-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[new-visits-widget] - updating branch to be in sync with [main] FormE…
…ngine changes (#1821) * (fix) O3-3046: Updated the interpretation keys for vital signs matching table headers (#1791) * (fix) O3-2975: Encounter datetime should not be sent when saving vitals and biometrics form (#1790) * (chore) Bump Angular form engine (#1799) * (feat) O3-3084: Sort fetched tests alphabetically in the lab order search inside order basket (#1797) * Sort fetched tests alphabetically in the lab order search * Updated tests * (feat) Update Angular form engine translations (#1801) * (test) Refactor lab orders E2E test (#1803) * (test) Split lab test step for saving the form (#1805) * (fix) O3-3093: React form engine workspace should close after submitting a form (#1804) * Patient forms not passing the closeWorkspaceWithSavedChanges function * Passing closeWorkspaceWithSavedChanges to the forms * Passing 'markFormAsDirty' in the form engine * Bumped @openmrs/esm-form-engine-lib * Fixed the import * Reverted changes in form entry app * (chore) Bump `@openmrs/esm-form-engine-lib` (#1807) * Bumped @openmrs/esm-form-engine-lib * Updated yarn.lock * (chore) Bump @openmrs/openmrs-form-engine-lib (#1808) * (chore) O3-3114: Bump react form engine (#1809) (chore) Bump react form engine * (chore) clean up unused webpack config and bumps engine (#1810) * (chore) clean up unused webpack config and bumps engine * Bumping form-engine again --------- Co-authored-by: Vineet Sharma <sharmava05@gmail.com> * (chore) Bump form-engine with added translations (#1811) * Bump form-engine with added translations * Bump form-engine to latest pre-release * (fix) Use order reasons should correctly chunk concept references and load all of them (#1813) (fix) Use order reasons should correctly chunk concept references and load all of them * (feat) O3-3077: Add validation to restrict users from initiating future visit (#1793) * (fix) O3-3133: Clicking the cancel button should not close the workspace (#1815) * (feat) Conditionally repress browser-specific date; also updates the form engine * (feat) O3-3112: Add form collapse toggle to the `esm-form-engine-app` (#1814) * feat: form collapse * refactor: rename formCollapseToggle * refactor: remove redundant add lister * refactor: use usecallback for handleFormEmbedded --------- Co-authored-by: Dennis Kigen <kigen.work@gmail.com> * (feat) O3-3133: Adapt cancel logic in the react form engine workspace (#1816) * (chore) Bump react form engine (#1817) * (chore) Bump ejs from 3.1.9 to 3.1.10 (#1819) Bumps [ejs](https://github.com/mde/ejs) from 3.1.9 to 3.1.10. - [Release notes](https://github.com/mde/ejs/releases) - [Commits](mde/ejs@v3.1.9...v3.1.10) --- updated-dependencies: - dependency-name: ejs dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Vineet Sharma <sharmava05@gmail.com> Co-authored-by: Dennis Kigen <kigen.work@gmail.com> Co-authored-by: Daud Kakumirizi <dkakumirizii@gmail.com> Co-authored-by: CynthiaKamau <cynthiakamau54@gmail.com> Co-authored-by: Pius Rubangakene <piruville@gmail.com> Co-authored-by: Ian <52504170+ibacher@users.noreply.github.com> Co-authored-by: Donald Kibet <chelashawdonald@yahoo.com> Co-authored-by: Ian <ian.c.bacher@gmail.com> Co-authored-by: Usama Idriss Kakumba <53287480+usamaidrsk@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
17c7182
commit da12dea
Showing
32 changed files
with
252 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { type Page } from '@playwright/test'; | ||
|
||
export class OrdersPage { | ||
constructor(readonly page: Page) {} | ||
|
||
readonly ordersTable = () => this.page.getByRole('table', { name: /orders/i }); | ||
|
||
async goTo(patientUuid: string) { | ||
await this.page.goto(`/openmrs/spa/patient/${patientUuid}/chart/Orders`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# esm-form-engine | ||
|
||
This is a wrapper around ohri form engine | ||
This is a wrapper around react form engine | ||
|
46 changes: 46 additions & 0 deletions
46
packages/esm-form-engine-app/src/form-collapse-toggle/form-collapse-toggle.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React, { useCallback, useEffect, useState } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Toggle } from '@carbon/react'; | ||
import styles from './styles.scss'; | ||
|
||
const FormCollapseToggle = () => { | ||
const { t } = useTranslation(); | ||
const [isFormEmbedded, setIsFormEmbedded] = useState<boolean>(false); | ||
|
||
const handleFormEmbedded = useCallback((event) => { | ||
setIsFormEmbedded(event?.detail?.value || false); | ||
}, []); | ||
|
||
useEffect(() => { | ||
window.addEventListener('openmrs:form-view-embedded', handleFormEmbedded); | ||
|
||
return () => { | ||
window.removeEventListener('openmrs:form-view-embedded', handleFormEmbedded); | ||
}; | ||
}, [handleFormEmbedded]); | ||
|
||
const handleOnToggle = (value: boolean) => { | ||
const FormCollapseToggleEvent = new CustomEvent('openmrs:form-collapse-toggle', { detail: { value } }); | ||
window.dispatchEvent(FormCollapseToggleEvent); | ||
}; | ||
|
||
if (!isFormEmbedded) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className={styles.toggleContainer}> | ||
<Toggle | ||
size="sm" | ||
aria-label={t('toggleCollapseOrExpand', 'Toggle collapse or expand')} | ||
defaultToggled | ||
id="collapsable-toggle" | ||
labelA={t('expandAll', 'Expand all')} | ||
labelB={t('collapseAll', 'Collapse all')} | ||
onToggle={handleOnToggle} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FormCollapseToggle; |
6 changes: 6 additions & 0 deletions
6
packages/esm-form-engine-app/src/form-collapse-toggle/styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.toggleContainer { | ||
display: flex; | ||
align-items: center; | ||
height: var(--workspace-header-height); | ||
margin-right: 0.5rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.