Skip to content

5165 add print picklist#5188

Merged
dorner merged 12 commits into
rubyforgood:mainfrom
bsbonus:5165-add-print-picklist
May 15, 2025
Merged

5165 add print picklist#5188
dorner merged 12 commits into
rubyforgood:mainfrom
bsbonus:5165-add-print-picklist

Conversation

@bsbonus
Copy link
Copy Markdown
Contributor

@bsbonus bsbonus commented May 5, 2025

Checklist:

X I have performed a self-review of my own code,
X I have commented my code, particularly in hard-to-understand areas,
X I have added tests that prove my fix is effective or that my feature works,
X New and existing unit tests pass locally with my changes ("bundle exec rake"),
X Title include "WIP" if work is in progress.
X I acknowledge that I will not force push my branch once reviews have started.

Resolves #5165

Description

Adds ability for bank users to print out pdf of individual donation requests, not just the bulk "unfulfilled" pdf download.

Type of change

X New feature (non-breaking change which adds functionality)
X This change requires a documentation update

How Has This Been Tested?

Both through UI testing and automated tests. Essentially:

  1. Creating some requests and ensuring they can be downloaded as pdfs on the requests list page
  2. Ensuring the same requests can also be downloaded as pdf on the detail page for the request

Screenshots

Screenshot 2025-05-05 at 1 12 31 PM Screenshot 2025-05-05 at 1 12 36 PM

Comment thread app/pdfs/picklists_pdf.rb
@@ -1,3 +1,5 @@
require "prawn/table"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lack of this was tossing an error for me locally

Comment thread docs/user_guide/bank/essentials_requests.md Outdated
@bsbonus bsbonus changed the title 5165 add print picklist - WIP 5165 add print picklist May 6, 2025
end

let(:formatted_date_range) { date_range.map { _1.to_fs(:date_picker) }.join(" - ") }
let(:formatted_date_range) { date_range.map { it.to_fs(:date_picker) }.join(" - ") }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling this out, as no idea why this was picked up by the linter. I didn't mess with these files?

end

let(:formatted_date_range) { date_range.map { _1.to_fs(:date_picker) }.join(" - ") }
let(:formatted_date_range) { date_range.map { it.to_fs(:date_picker) }.join(" - ") }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling this out, as no idea why this was picked up by the linter. I didn't mess with these files?


context "with manufacturer donations in the last year" do
let(:formatted_date_range) { date_range.map { _1.to_fs(:date_picker) }.join(" - ") }
let(:formatted_date_range) { date_range.map { it.to_fs(:date_picker) }.join(" - ") }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling this out, as no idea why this was picked up by the linter. I didn't mess with these files?

end

let(:formatted_date_range) { date_range.map { _1.to_fs(:date_picker) }.join(" - ") }
let(:formatted_date_range) { date_range.map { it.to_fs(:date_picker) }.join(" - ") }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling this out, as no idea why this was picked up by the linter. I didn't mess with these files?

end

let(:formatted_date_range) { date_range.map { _1.to_fs(:date_picker) }.join(" - ") }
let(:formatted_date_range) { date_range.map { it.to_fs(:date_picker) }.join(" - ") }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling this out, as no idea why this was picked up by the linter. I didn't mess with these files?

end

let(:formatted_date_range) { date_range.map { _1.to_fs(:date_picker) }.join(" - ") }
let(:formatted_date_range) { date_range.map { it.to_fs(:date_picker) }.join(" - ") }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't know why rubocop linted on these...i didn't open them?

@cielf
Copy link
Copy Markdown
Collaborator

cielf commented May 8, 2025

It passes my functional testing. Over to @dorner for technical comments.

@cielf cielf requested a review from dorner May 8, 2025 03:24
Copy link
Copy Markdown
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One request re the specs. Thanks so much for adding tests to related code - it's great that you're leaving the repo in a better state than you came in. :)

Comment thread spec/system/request_system_spec.rb Outdated
end

it 'should render a link if there are unfulfilled requests' do
visit requests_path
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be a request test - system tests are heavier and likelier to flake out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad you suggested this -- this test case was already covered by spec/requests/requests_requests_spec.rb

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorner let me know if you want anything else here -- looks gtg to me 🤷

@bsbonus bsbonus requested a review from dorner May 12, 2025 21:43
Copy link
Copy Markdown
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dorner dorner merged commit 36b9034 into rubyforgood:main May 15, 2025
12 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

@bsbonus: Your PR 5165 add print picklist is part of today's Human Essentials production release: 2025.05.18.
Thank you very much for your contribution!

GiovannyCordeiro pushed a commit to GiovannyCordeiro/human-essentials that referenced this pull request Jun 6, 2025
* Test: Adds missing test coverage for 'print unfulfilled' request UI

* Test: Adds missing tests for requests controller #print_unfulfilled

* Test: Adds overlooked cases for picklist pdf

* Feature: Adds routing for new print picklist

* Feature: Adds print_picklist to requests controller

* Feature: Adds links to UI to access print_picklist

* Docs: Adds placeholder for update to picklist docs until PR is finalized

* Feature-5165 update docs to reflect new print individual picklist

* Fixes rubocop issues

* Removes duplicate spec case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add capability to print a single request, whether or not fulfilled

3 participants