Skip to content

SL-1368: close the workspace after the form is printed - #40

Merged
cioan merged 1 commit into
mainfrom
SL-1368
Jul 21, 2026
Merged

cioan merged 1 commit into
mainfrom
SL-1368

Conversation

@cioan

@cioan cioan commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

Close the workspace after the form is printed

Screenshots

print_And_save.mov

Related Issue

https://openmrs.atlassian.net/browse/HTML-890

@chibongho , after @mogoodrich made this commit to the htmlformentryui, I was able to get this printing working from the ward app. Please see the recording above.
openmrs/openmrs-module-htmlformentryui@9d840b8

Thanks!

@chibongho chibongho left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good. Very minor suggestions.

return;
}

var returnUrl = settings.data instanceof FormData ? (settings.data.get('returnUrl') || '') : '';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
var returnUrl = settings.data instanceof FormData ? (settings.data.get('returnUrl') || '') : '';
const returnUrl = settings.data instanceof FormData ? (settings.data.get('returnUrl') || '') : '';

// A "Save & Print" form (eg. a discharge disposition) carries printForm=true in its
// returnUrl. When present, the form will reload the visit page and auto-print, so tell
// the parent a print is pending and it should wait for it before closing the workspace.
var printPending = returnUrl.indexOf('printForm=true') !== -1 || returnUrl.indexOf('printForm%3Dtrue') !== -1;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
var printPending = returnUrl.indexOf('printForm=true') !== -1 || returnUrl.indexOf('printForm%3Dtrue') !== -1;
const printPending = returnUrl.indexOf('printForm=true') !== -1 || returnUrl.indexOf('printForm%3Dtrue') !== -1;

@cioan
cioan merged commit 377fb80 into main Jul 21, 2026
3 checks passed
@cioan
cioan deleted the SL-1368 branch July 22, 2026 15:22
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