-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(fee-breakdown): Make Pay component data field a static value #4058
Conversation
Removed vultr server and associated DNS entries |
@@ -69,9 +69,9 @@ const Component: React.FC<Props> = (props: Props) => { | |||
<Input | |||
format="data" | |||
name="fn" | |||
value={values.fn} | |||
value={PASSPORT_FN} |
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 should mean that any existing services with a value other and application.fee.payable
just need the node to be saved to update this.
In reality, these would just be test services so I don't think there's a need for anything more sophisticated here such as a validation check or data migration.
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.
Confirmed that a legacy, un-updated Pay component still knows how to read/display correct amount: https://4058.planx.pizza/testing/pay-test 👍
And modal looks correct for next "Update"/"Save"
3857313
to
5a3e427
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.
In support of this 🙌
@@ -69,9 +69,9 @@ const Component: React.FC<Props> = (props: Props) => { | |||
<Input | |||
format="data" | |||
name="fn" | |||
value={values.fn} | |||
value={PASSPORT_FN} | |||
placeholder="Data field for calculated amount" |
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.
nit: can we also remove this confusing placeholder (eg "calculated" not "payable" language) since will never be seen now?
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.
Good catch! Removed 🗑️
@@ -10,12 +10,14 @@ import { array, boolean, object, string } from "yup"; | |||
|
|||
import { type BaseNodeData, parseBaseNodeData } from "../shared"; | |||
|
|||
export const PASSPORT_FN = "application.fee.payable" as const; |
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.
nit: can we rename to PAY_FN
so more clear if/when exported/imported beyond this component? (Eg tests, etc). Already have a few DEFAULT_FN
etc that I notice that we're commonly re-naming when importing elsewhere.
@@ -69,9 +69,9 @@ const Component: React.FC<Props> = (props: Props) => { | |||
<Input | |||
format="data" | |||
name="fn" | |||
value={values.fn} | |||
value={PASSPORT_FN} |
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.
Confirmed that a legacy, un-updated Pay component still knows how to read/display correct amount: https://4058.planx.pizza/testing/pay-test 👍
And modal looks correct for next "Update"/"Save"
e18fec5
to
9bcbb2c
Compare
What?
Makes the
data.fn
value of the Pay component a hard-coded variable -application.fee.payable
Why?
This is relied upon when working out the fee breakdown, as well as in the payload mapping. All real services are using this value and this matches the pattern for other variable like addresses where we need a single static passport key.