(feat) O3-4315: Add support for workspace-launcher rendering type#410
(feat) O3-4315: Add support for workspace-launcher rendering type#410rdwaynedehoedt wants to merge 13 commits intoopenmrs:mainfrom
Conversation
|
Hi @NethmiRodrigo , could you review this PR Thanks! |
There was a problem hiding this comment.
@rdwaynedehoedt Please add a video demonstrating that everything still behaves as expected & add unit test covering this change.
NethmiRodrigo
left a comment
There was a problem hiding this comment.
Thanks @rdwaynedehoedt! Good work! Please look at the comments and include a screenshot of the UI and how it works in the description. Its also preferred to add unit tests for new functionality, similar to how the other inputs do.
...ion/question-form/rendering-types/inputs/workspace-launcher/workspace-launcher.component.tsx
Outdated
Show resolved
Hide resolved
...ion/question-form/rendering-types/inputs/workspace-launcher/workspace-launcher.component.tsx
Outdated
Show resolved
Hide resolved
NethmiRodrigo
left a comment
There was a problem hiding this comment.
Almost there @rdwaynedehoedt! Some minor changes. Excellent test cases!
...ion/question-form/rendering-types/inputs/workspace-launcher/workspace-launcher.component.tsx
Show resolved
Hide resolved
...ion/question-form/rendering-types/inputs/workspace-launcher/workspace-launcher.component.tsx
Outdated
Show resolved
Hide resolved
...question/question-form/rendering-types/inputs/workspace-launcher/workspace-launcher.test.tsx
Outdated
Show resolved
Hide resolved
...question/question-form/rendering-types/inputs/workspace-launcher/workspace-launcher.test.tsx
Outdated
Show resolved
Hide resolved
...question/question-form/rendering-types/inputs/workspace-launcher/workspace-launcher.test.tsx
Outdated
Show resolved
Hide resolved
… callback pattern - Remove unnecessary test setup - Use userEvent instead of fireEvent in tests
| await user.clear(workspaceNameInput); | ||
| await user.type(workspaceNameInput, newValue); | ||
|
|
||
| expect(mockSetFormField).toHaveBeenCalled(); |
There was a problem hiding this comment.
This is good to have, but we can make it a bit better by checking if it got called with the right object. Here's a place where you can use for guidance -
|
Pinging @rdwaynedehoedt, are you stuck on any part of updating the tests, if so do let me know and I'll try to help out |
Requirements
Summary
This PR implements the workspace-launcher rendering type for form questions as specified in O3-4315. The workspace-launcher allows form creators to add buttons that launch different workspaces or sub-forms within the OpenMRS application, enhancing clinical workflow integration.
The implementation includes:
workspace-launcher.component.tsxcomponent with input fields forbuttonLabelandworkspaceNameQuestionOptionsinterface intypes.tsto include these new propertiesThis feature is part of the O3 Form Builder v3 epic (O3-1144).
Related Issue
https://openmrs.atlassian.net/browse/O3-4315
Other
The workspace-launcher rendering type follows the specified JSON structure: