-
Notifications
You must be signed in to change notification settings - Fork 7
Feature/eap full form #2122
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
base: project/early-action-protocols
Are you sure you want to change the base?
Feature/eap full form #2122
Conversation
|
d10a0db to
5ccc1bc
Compare
0adbb63 to
c9c84d0
Compare
c9c84d0 to
a172ce2
Compare
- Update DREF table actions
e52c062 to
4c88096
Compare
f8aabc4 to
1cb8802
Compare
1cb8802 to
04d7790
Compare
| "eapFullFormActivationSourceInformationNameLabel": "Name", | ||
| "eapFullFormActivationSourceInformationLinkLabel": "Link", | ||
| "eapFullFormActivationSourceInformationDeleteButton": "Delete Source Information" |
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.
Do not prefix string key with the namespace
| const handleSourceFieldChange = useCallback( | ||
| (newValue: string | undefined) => { | ||
| if ( | ||
| isNotDefined(newValue) | ||
| || newValue.startsWith('http://') | ||
| || newValue.startsWith('https://') | ||
| || newValue === 'h' | ||
| || newValue === 'ht' | ||
| || newValue === 'htt' | ||
| || newValue === 'http' | ||
| || newValue === 'http:' | ||
| || newValue === 'http:/' | ||
| || newValue === 'https' | ||
| || newValue === 'https:' | ||
| || newValue === 'https:/' | ||
| ) { | ||
| onFieldChange(newValue, 'source_link'); | ||
| return; | ||
| } | ||
|
|
||
| onFieldChange(`https://${newValue}`, 'source_link'); | ||
| }, | ||
| [onFieldChange], | ||
| ); |
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.
If this is copied from some other place, please add a utility function and reuse it
|
|
||
| return ( | ||
| <> | ||
| <NonFieldError error={error} /> |
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.
Please verify if the layout will work when there is an error
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.
Its working fine
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.
Do not prefix string key with namespace
|
|
||
| return ( | ||
| <TabPage> | ||
| <Container> |
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.
Does this Container component serve any purpose?
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.
Do not prefix string key with namespace, lets remove unused keys
| function getNextStep(current: TabKeys, direction: 1 | -1) { | ||
| if (direction === 1) { | ||
| const mapping: { [key in TabKeys]?: TabKeys } = { | ||
| overview: 'riskAnalysis', | ||
| riskAnalysis: 'triggerModel', | ||
| triggerModel: 'selectionActions', | ||
| selectionActions: 'eapActivation', | ||
| eapActivation: 'meal', | ||
| meal: 'nationalSocietyCapacity', | ||
| nationalSocietyCapacity: 'financeLogistics', | ||
| }; | ||
| return mapping[current]; | ||
| } | ||
| if (direction === -1) { | ||
| const mapping: { [key in TabKeys]?: TabKeys } = { | ||
| financeLogistics: 'nationalSocietyCapacity', | ||
| nationalSocietyCapacity: 'meal', | ||
| meal: 'eapActivation', | ||
| eapActivation: 'selectionActions', | ||
| selectionActions: 'triggerModel', | ||
| triggerModel: 'riskAnalysis', | ||
| riskAnalysis: 'overview', | ||
| }; | ||
| return mapping[current]; | ||
| } | ||
| return undefined; | ||
| } |
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.
Create a utility function and reuse it
app/src/views/EapFullForm/schema.ts
Outdated
| type ExtractContactPrefix<KEY extends FieldKeys> = | ||
| KEY extends `${infer PREFIX}_name` | ||
| ? `${PREFIX}_title` extends FieldKeys | ||
| ? `${PREFIX}_email` extends FieldKeys | ||
| ? `${PREFIX}_phone_number` extends FieldKeys | ||
| ? PREFIX | ||
| : never | ||
| : never | ||
| : never | ||
| : never; |
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.
Fix indentation
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.
Do not use custom styling
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.
Is this change needed? This might cause unnecessary conflicts when doing the rebase
4c88096 to
84b47e5
Compare
Summary
Provide a brief description of what this PR addresses and its purpose.
Addresses
Depends On
Changes
This PR Ensures:
console.logstatements meant for debuggingAdditional Notes
Optional: Add any other relevant context, screenshots, or details here.