-
Notifications
You must be signed in to change notification settings - Fork 92
feat: add support to form in action modals #11094
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
Conversation
|
Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:
|
|
Can we use the component Dialog This PR is using the deprecated ResponsiveModel |
...Overview/components/EventHistory/EventHistoryDialog/components/ActionTypeSpecificContent.tsx
Outdated
Show resolved
Hide resolved
packages/commons/src/events/utils.ts
Outdated
| export function getCustomActionFields(eventConfig: EventConfig): FieldConfig[] { | ||
| const customActions = eventConfig.actions.filter( | ||
| (action): action is CustomActionConfig => action.type === ActionType.CUSTOM | ||
| ) satisfies CustomActionConfig[] | ||
|
|
||
| if (!customActions.length) { | ||
| return [] | ||
| } | ||
|
|
||
| return customActions.flatMap((action) => action.form) | ||
| } |
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 would currently cause issues if we have fields with the same id in different custom actions.
We should not get the fields for all custom actions, instead just the fields of the custom action we are executing now.
Lets use this function for getting the config of the correct action: https://github.com/opencrvs/opencrvs-core/blob/develop/packages/commons/src/events/utils.ts#L100
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.
Done here
Refactored to call custom action configs with improved types. Leave any improvement suggestions if necessary.
| expect(sanitizeForSnapshot(event, UNSTABLE_EVENT_FIELDS)).toMatchSnapshot() | ||
| }) | ||
|
|
||
| // @todo - un-skip after implementing validation for error field input |
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 not implemented yet?
cibelius
left a comment
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.
Great work 💯

Description
Country Config PR: opencrvs/opencrvs-countryconfig#1155
Farajaland PR: opencrvs/opencrvs-farajaland#1840
Clearly describe what has been changed. Include relevant context or background.
Explain how the issue was fixed (if applicable) and the root cause.
Link this pull request to the GitHub issue (and optionally name the branch
ocrvs-<issue #>)Checklist