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) Implement 'markFormAsDirty' to prompt the user before closing a dirty form #364

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

samuelmale
Copy link
Member

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

The workspace system exposes an API that prevents forms with draft data or unpersisted data from being closed accidentally, which could lead to data loss. This functionality was supported by the form engine prior to the migration; this PR restores that support in the form engine.

Screenshots

2024-08-09 00-42-01 2024-08-09 00_43_26

Related Issue

Other

Copy link

github-actions bot commented Aug 8, 2024

Size Change: -86.1 kB (-7.01%) ✅

Total Size: 1.14 MB

Filename Size Change
dist/674.js 0 B -86.2 kB (removed) 🏆
ℹ️ View Unchanged
Filename Size Change
dist/151.js 300 kB 0 B
dist/225.js 2.57 kB 0 B
dist/277.js 1.84 kB 0 B
dist/3.js 481 B 0 B
dist/300.js 711 B 0 B
dist/335.js 968 B 0 B
dist/353.js 3.02 kB 0 B
dist/41.js 3.37 kB 0 B
dist/422.js 6.8 kB 0 B
dist/540.js 2.63 kB 0 B
dist/55.js 758 B 0 B
dist/572.js 252 kB +104 B (+0.04%)
dist/617.js 86.9 kB 0 B
dist/635.js 14.3 kB 0 B
dist/733.js 107 kB 0 B
dist/901.js 11.8 kB 0 B
dist/99.js 691 B 0 B
dist/993.js 3.09 kB 0 B
dist/main.js 340 kB 0 B
dist/openmrs-esm-form-engine-lib.js 3.67 kB 0 B

compressed-size-action

Copy link
Member

@denniskigen denniskigen left a comment

Choose a reason for hiding this comment

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

LGTM

@samuelmale samuelmale merged commit 6f04f6c into main Aug 8, 2024
4 checks passed
@samuelmale samuelmale deleted the feat/markFormDirty branch August 8, 2024 21:50
@denniskigen
Copy link
Member

In hindsight, maybe one improvement would be to not close the workspace when the user hits the cancel button so they don't have to manually restore it from the Side rail.

@samuelmale
Copy link
Member Author

I agree, had the same impression. This needs to be resolved in the form-engine-app by getting rid of this call: https://github.com/openmrs/openmrs-esm-patient-chart/blob/main/packages/esm-form-engine-app/src/form-renderer/form-renderer.component.tsx#L35

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