-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple Forms: Refactor PDF Stamper Part 1 #16268
Conversation
Generated by 🚫 Danger |
@Thrillberg Could you ask a teammate for a review, then I'll review it |
def desired_stamps | ||
[ | ||
{ | ||
coords: [50, 560], | ||
text: data['statement_of_truth_signature'], | ||
page: 1 | ||
} | ||
] | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this one was formatted differently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAWP! Fixing now 😸
config = [ | ||
{ type: :new_page }, | ||
{ type: :new_page }, | ||
{ type: :new_page }, | ||
{ type: :new_page } | ||
] | ||
config[page] = { type: :text, position: } | ||
config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be rewritten with .tap
:
config = [ | |
{ type: :new_page }, | |
{ type: :new_page }, | |
{ type: :new_page }, | |
{ type: :new_page } | |
] | |
config[page] = { type: :text, position: } | |
config | |
[ | |
{ type: :new_page }, | |
{ type: :new_page }, | |
{ type: :new_page }, | |
{ type: :new_page } | |
].tap do |config| | |
config[page] = { type: :text, position: } | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes! I need to get more used to tap
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just one question and one small suggestion. 👍
40436f7
to
982fe72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, great work again! 👍
Summary
This PR takes part of the work from this draft PR: #16242 and separates it into its own standalone PR. This should be more easily reviewable. I can then come back and apply part 2 in a separate PR and close out the aforementioned draft PR.
This is some refactoring of our PDF Stamper class with the ultimate aim of making it more uniform in how it handles desired stamps.
Related issue(s)
https://app.zenhub.com/workspaces/vagov-product-team-forms-634853151f5c6000165942bc/issues/gh/department-of-veterans-affairs/va.gov-team-forms/1198
Testing done
Tests altered and passing.