-
Notifications
You must be signed in to change notification settings - Fork 325
(BREAKING) O3-4961 Workspace v2 migration #2800
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
|
Awesome seeing this PR out! Thanks @ibacher and @denniskigen for your time in getting this large commit and change reviewed and merged. |
|
Size Change: -1.89 MB (-8.98%) ✅ Total Size: 19.2 MB
ℹ️ View Unchanged
|
|
Could you do a quick rebase so we can try to get this in quicker, @chibongho! |
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 replaced in some way? I'm a little worried that this one has a much bigger downstream impact on places where we embed the form workspace (which isn't just in the chart).
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.
With this change, there is just one workspace to render a form, whether it be a RFE or HTML form, The workspace itself will take care of rendering it appropriately, instead of having the caller decide which workspace to launch based on the form type. I included this change in this PR as it simplifies the migration.
packages/esm-patient-common-lib/src/store/patient-chart-store.ts
Outdated
Show resolved
Hide resolved
packages/esm-patient-common-lib/src/store/patient-chart-store.ts
Outdated
Show resolved
Hide resolved
packages/esm-patient-common-lib/src/store/patient-chart-store.ts
Outdated
Show resolved
Hide resolved
| "component": "addDrugOrderWorkspace", | ||
| "type": "order" | ||
| }, | ||
| { |
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.
Shouldn't this workspace be ported over too?
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.
Yeah, I added this workspace recently, but I have a new requirement to make that "Fill Prescription" workspace support batching multiple drugs in a single order. I'll likely just remove this workspace and make the order basket work in the dispensing app.
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 like there's a lot of churn here. Any reason why?
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.
There are a couple of components (the order-cancellation-form) removed and a few translation strings deleted from other places. I'm not sure whether those are things we need or if they just weren't being used?
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.
The order-cancellation-form is no longer is use. I confirmed with @PiusKariuki.
The other big component that's removed is html-form-entry.workspace.tsx. form-entry.workspace.tsx will open both RFE and HTML forms
|
Have you noticed a touch of judder in the workspace launch animation when launching a form for the first time, @chibongho? Subsequent launches don't exhibit the same judder. judder.mp4judder2.mp4 |
Yeah, I've seen minor animation bugs with workspace v2. I'll try to fix. |
Co-authored-by: Ian <[email protected]>
Requirements
Summary
(This is the big one.) This PR migrates the patient chart workspaces to the v2 system.
Included here:
routes.json, theworkspace2,workspaceWindow2andworkspaceGroup2sections are used to declare workspaces / windows / group with the schema defined here"patient-chart"workspace group, with thepatientandvisitContextbeing the group prop. For workspaces that modify create / modify encounters, the encounter is the workspace prop. Any changes to workspace props / window props / group props will trigger an attempt to close presently opened workspaces, with a prompt for unsaved changes if necessary.patient-chart.component.tsxlaunches the"patient-chart"workspace group to render the action menu (right nav).<Workspace2>, taking in the workspace title and whether it has unsaved changes as props.<ActionMenuButton>are switched to render<ActionMenuButton2>instead, which no longer takes an arbitraryonClickcallback. Instead, it takes the name and props of the workspace to launch.useVisit()andusePatientChartStore()from workspaces. We need it because workspaces need to be changed to take thevisitContextfrom their workspace group props. That PR has been out for a while and now has conflicts with the main branch, but I'm happy to resolve the conflicts and rebase this PR on top of that one, if anybody wants to review that PR separately.patient-form-entry-workspaceandpatient-html-form-entry-workspaceinto a single workspace. Currently, to render a form, the caller is responsible for launching the correct workspace based on whether it the form is a RFE form or HTML form. There is a helper functionlaunchFormEntryOrHtmlFormsto help with that, but it still requires the caller to calluseConfig({externalModuleName: '@openmrs/esm-patient-forms-app'})and pass the config in. This is now refactored to just one workspace (patient-form-entry-workspace). It can load any form regardless of what kind it is, and the logic to render it as RFE or HTML form is self-contained.Screenshots
Related Issue
Other