Skip to content
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) O3-2006 Adds ability to launch workspace from form #186

Merged
merged 7 commits into from
Apr 23, 2024

Conversation

pirupius
Copy link
Member

@pirupius pirupius commented Apr 15, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Adds support to launch the workspace within a form with the addition of workspace-launcher

Screenshots

Form builder
Screenshot 2024-04-16 at 01 53 48

Forms workspace within patient chart

Screen.Recording.2024-04-22.at.12.04.04.mov

Related Issue

Other

Copy link

github-actions bot commented Apr 15, 2024

Size Change: -480 kB (-28%) 🎉

Total Size: 1.22 MB

Filename Size Change
dist/29.js 220 kB +51 kB (+30%) 🚨
dist/402.js 0 B -237 kB (removed) 🏆
dist/616.js 0 B -202 kB (removed) 🏆
dist/981.js 0 B -85.7 kB (removed) 🏆
ℹ️ View Unchanged
Filename Size Change
dist/100.js 2.41 kB +2 B (0%)
dist/154.js 80.8 kB 0 B
dist/162.js 16.3 kB 0 B
dist/225.js 2.57 kB 0 B
dist/248.js 108 kB 0 B
dist/327.js 1.58 kB 0 B
dist/353.js 3.02 kB 0 B
dist/459.js 6.07 kB 0 B
dist/505.js 6.94 kB -5 B (0%)
dist/540.js 2.63 kB 0 B
dist/561.js 487 B 0 B
dist/599.js 2.5 kB 0 B
dist/606.js 2.23 kB 0 B
dist/633.js 95 kB 0 B
dist/713.js 7.82 kB 0 B
dist/784.js 237 kB 0 B
dist/791.js 9.8 kB -1 B (0%)
dist/828.js 94 kB 0 B
dist/859.js 830 B 0 B
dist/886.js 0 B -6.59 kB (removed) 🏆
dist/942.js 487 B +5 B (+1%)
dist/993.js 3.08 kB 0 B
dist/main.js 312 kB +685 B (0%)
dist/openmrs-form-engine-lib.js 3.76 kB +190 B (+5%) 🔍

compressed-size-action

package.json Show resolved Hide resolved
src/declarations.d.tsx Outdated Show resolved Hide resolved
@samuelmale
Copy link
Member

samuelmale commented Apr 16, 2024

@pirupius FYI, the attached demo seems to be powered by the AFE and not RFE.

@pirupius
Copy link
Member Author

Thanks @samuelmale will correct that video.

@pirupius pirupius force-pushed the feat/O3-2006/launch-workspace-from-form branch from 66cf176 to 8a15286 Compare April 22, 2024 09:15
@pirupius pirupius marked this pull request as ready for review April 22, 2024 09:16
@pirupius pirupius force-pushed the feat/O3-2006/launch-workspace-from-form branch from 8a15286 to b83c910 Compare April 22, 2024 09:46
@pirupius
Copy link
Member Author

@samuelmale the video has been updated to use esm-form-engine-app and the PR is ready

Copy link
Member

@samuelmale samuelmale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very close, just a few minor comments

);
};

export default WorkspaceLauncher;
Copy link
Member

@samuelmale samuelmale Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pirupius can you suffix the component file name with ".component.tsx"

import React from 'react';
import { useTranslation } from 'react-i18next';
import { showSnackbar } from '@openmrs/esm-framework';
import { useLaunchWorkspaceRequiringVisit } from '@openmrs/esm-patient-common-lib/src/useLaunchWorkspaceRequiringVisit';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency:

Suggested change
import { useLaunchWorkspaceRequiringVisit } from '@openmrs/esm-patient-common-lib/src/useLaunchWorkspaceRequiringVisit';
import { useLaunchWorkspaceRequiringVisit } from '@openmrs/esm-patient-common-lib';

Copy link
Member Author

@pirupius pirupius Apr 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the recommended way in cases where we need imports from a single source rather than the whole module for faster optimization. Similar usages have been used in other packages within 3.x for example in the medications HERE

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the recommended way in cases where we need imports from a single source rather than the whole module for faster optimization.

I understand the idea @pirupius but I would stick to the standard imports until there is a clear consensus around this. Maybe in the future we gotta document this to make it well known that it's the recommended way. We may have to do the same for framework imports for more consistency and also the optimisation bit.

@@ -1488,6 +1488,41 @@ __metadata:
languageName: node
linkType: hard

"@carbon/react@npm:^1.12.0":
version: 1.55.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to do a Carbon bump?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a side effect of the patient commons lib being added. It requires ^1.55.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commons lib requires v^1.12.0 but currently hydrated with v1.40.0

yarn.lock Show resolved Hide resolved
@pirupius pirupius force-pushed the feat/O3-2006/launch-workspace-from-form branch from b83c910 to 379200c Compare April 23, 2024 15:51
Copy link
Member

@samuelmale samuelmale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks @pirupius 🍻

@samuelmale samuelmale merged commit ab9db4d into main Apr 23, 2024
5 checks passed
@samuelmale samuelmale deleted the feat/O3-2006/launch-workspace-from-form branch April 23, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants