@openmrs/esm-patient-flags-app 11.3.0 → 11.3.1-patch.9310
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +21 -24
- package/dist/1837.js +1 -0
- package/dist/1837.js.map +1 -0
- package/dist/4055.js +1 -1
- package/dist/4411.js +2 -0
- package/dist/4411.js.map +1 -0
- package/dist/5628.js +1 -1
- package/dist/5628.js.map +1 -1
- package/dist/6138.js +1 -0
- package/dist/6138.js.map +1 -0
- package/dist/6173.js +1 -0
- package/dist/6173.js.map +1 -0
- package/dist/6336.js +1 -0
- package/dist/6336.js.map +1 -0
- package/dist/8519.js +2 -0
- package/dist/8519.js.map +1 -0
- package/dist/9538.js +1 -1
- package/dist/main.js +1 -2
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-patient-flags-app.js +1 -1
- package/dist/openmrs-esm-patient-flags-app.js.buildmanifest.json +189 -140
- package/dist/openmrs-esm-patient-flags-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +5 -4
- package/src/flags/flags-highlight-bar.test.tsx +2 -2
- package/src/flags/flags-list.test.tsx +25 -11
- package/src/flags/flags.component.tsx +2 -2
- package/src/flags/flags.test.tsx +2 -2
- package/src/flags/patient-flags.workspace.tsx +4 -5
- package/src/index.ts +3 -5
- package/src/routes.json +1 -1
- package/translations/fr.json +3 -3
- package/translations/it.json +6 -6
- package/dist/2276.js +0 -2
- package/dist/2276.js.map +0 -1
- package/dist/2537.js +0 -1
- package/dist/2537.js.map +0 -1
- package/dist/4918.js +0 -1
- package/dist/4918.js.map +0 -1
- package/dist/884.js +0 -2
- package/dist/884.js.map +0 -1
- package/dist/9124.js +0 -1
- package/dist/9124.js.map +0 -1
- package/dist/main.js.LICENSE.txt +0 -60
- /package/dist/{2276.js.LICENSE.txt → 4411.js.LICENSE.txt} +0 -0
- /package/dist/{884.js.LICENSE.txt → 8519.js.LICENSE.txt} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
|
-
import {
|
|
4
|
+
import { launchWorkspace2 } from '@openmrs/esm-framework';
|
|
5
5
|
import { mockPatient } from 'tools';
|
|
6
6
|
import { mockPatientFlags } from '__mocks__';
|
|
7
7
|
import { usePatientFlags } from './hooks/usePatientFlags';
|
|
8
8
|
import FlagsHighlightBar from './flags-highlight-bar.component';
|
|
9
9
|
|
|
10
10
|
const mockUsePatientFlags = jest.mocked(usePatientFlags);
|
|
11
|
-
const mockLaunchWorkspace = jest.mocked(
|
|
11
|
+
const mockLaunchWorkspace = jest.mocked(launchWorkspace2);
|
|
12
12
|
|
|
13
13
|
jest.mock('./hooks/usePatientFlags', () => {
|
|
14
14
|
const originalModule = jest.requireActual('./hooks/usePatientFlags');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render, screen
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
|
4
4
|
import { mockPatient } from 'tools';
|
|
5
5
|
import { mockPatientFlags } from '__mocks__';
|
|
@@ -27,11 +27,18 @@ it('renders an Edit form that enables users to toggle flags on or off', async ()
|
|
|
27
27
|
render(
|
|
28
28
|
<FlagsList
|
|
29
29
|
closeWorkspace={jest.fn()}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
groupProps={{
|
|
31
|
+
patientUuid: mockPatient.id,
|
|
32
|
+
patient: mockPatient,
|
|
33
|
+
visitContext: null,
|
|
34
|
+
mutateVisitContext: null,
|
|
35
|
+
}}
|
|
36
|
+
workspaceProps={{}}
|
|
37
|
+
windowProps={{}}
|
|
38
|
+
workspaceName=""
|
|
39
|
+
launchChildWorkspace={null}
|
|
40
|
+
windowName={''}
|
|
41
|
+
isRootWorkspace={false}
|
|
35
42
|
/>,
|
|
36
43
|
);
|
|
37
44
|
|
|
@@ -59,11 +66,18 @@ it('sorts by active and retired correctly via controlled dropdown', async () =>
|
|
|
59
66
|
render(
|
|
60
67
|
<FlagsList
|
|
61
68
|
closeWorkspace={jest.fn()}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
groupProps={{
|
|
70
|
+
patientUuid: mockPatient.id,
|
|
71
|
+
patient: mockPatient,
|
|
72
|
+
visitContext: null,
|
|
73
|
+
mutateVisitContext: null,
|
|
74
|
+
}}
|
|
75
|
+
workspaceProps={{}}
|
|
76
|
+
windowProps={{}}
|
|
77
|
+
workspaceName=""
|
|
78
|
+
launchChildWorkspace={null}
|
|
79
|
+
windowName={''}
|
|
80
|
+
isRootWorkspace={false}
|
|
67
81
|
/>,
|
|
68
82
|
);
|
|
69
83
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Button, Tag, Toggletip, ToggletipButton, ToggletipContent } from '@carbon/react';
|
|
4
|
-
import { CloseIcon, EditIcon,
|
|
4
|
+
import { CloseIcon, EditIcon, launchWorkspace2 } from '@openmrs/esm-framework';
|
|
5
5
|
import { usePatientFlags } from './hooks/usePatientFlags';
|
|
6
6
|
import styles from './flags.scss';
|
|
7
7
|
|
|
@@ -18,7 +18,7 @@ const Flags: React.FC<FlagsProps> = ({ patientUuid, onHandleCloseHighlightBar, s
|
|
|
18
18
|
const { flags, isLoading, error } = usePatientFlags(patientUuid);
|
|
19
19
|
const filteredFlags = flags.filter((flag: FlagWithPriority) => !flag.voided);
|
|
20
20
|
|
|
21
|
-
const handleClickEditFlags = useCallback(() =>
|
|
21
|
+
const handleClickEditFlags = useCallback(() => launchWorkspace2('patient-flags-workspace'), []);
|
|
22
22
|
|
|
23
23
|
const renderFlag = (flag: FlagWithPriority) => {
|
|
24
24
|
const hasPriority = flag.flagWithPriority?.priority?.name;
|
package/src/flags/flags.test.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { screen, render } from '@testing-library/react';
|
|
4
|
-
import {
|
|
4
|
+
import { launchWorkspace2 } from '@openmrs/esm-framework';
|
|
5
5
|
import { mockPatient } from 'tools';
|
|
6
6
|
import { mockPatientFlags } from '__mocks__';
|
|
7
7
|
import { usePatientFlags } from './hooks/usePatientFlags';
|
|
@@ -10,7 +10,7 @@ import Flags from './flags.component';
|
|
|
10
10
|
type FlagWithPriority = ReturnType<typeof usePatientFlags>['flags'][0];
|
|
11
11
|
|
|
12
12
|
const mockUsePatientFlags = jest.mocked(usePatientFlags);
|
|
13
|
-
const mockLaunchWorkspace = jest.mocked(
|
|
13
|
+
const mockLaunchWorkspace = jest.mocked(launchWorkspace2);
|
|
14
14
|
|
|
15
15
|
jest.mock('./hooks/usePatientFlags', () => {
|
|
16
16
|
const originalModule = jest.requireActual('./hooks/usePatientFlags');
|
|
@@ -2,7 +2,7 @@ import React, { useMemo, useState } from 'react';
|
|
|
2
2
|
import { orderBy } from 'lodash-es';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Button, ButtonSet, Dropdown, Form, InlineLoading, Search, Tile, Toggle, Stack } from '@carbon/react';
|
|
5
|
-
import { type
|
|
5
|
+
import { type PatientWorkspace2DefinitionProps } from '@openmrs/esm-patient-common-lib';
|
|
6
6
|
import { useLayoutType, showSnackbar, parseDate, formatDate, ResponsiveWrapper } from '@openmrs/esm-framework';
|
|
7
7
|
import { usePatientFlags, enablePatientFlag, disablePatientFlag } from './hooks/usePatientFlags';
|
|
8
8
|
import { getFlagType } from './utils';
|
|
@@ -10,10 +10,9 @@ import styles from './flags-list.scss';
|
|
|
10
10
|
|
|
11
11
|
type SortKey = 'alpha' | 'active' | 'retired';
|
|
12
12
|
|
|
13
|
-
const FlagsList: React.FC<
|
|
14
|
-
patientUuid,
|
|
13
|
+
const FlagsList: React.FC<PatientWorkspace2DefinitionProps<{}, {}>> = ({
|
|
15
14
|
closeWorkspace,
|
|
16
|
-
|
|
15
|
+
groupProps: { patientUuid },
|
|
17
16
|
}) => {
|
|
18
17
|
const { t } = useTranslation();
|
|
19
18
|
const { flags, isLoading, error, mutate } = usePatientFlags(patientUuid);
|
|
@@ -219,7 +218,7 @@ const FlagsList: React.FC<DefaultPatientWorkspaceProps> = ({
|
|
|
219
218
|
disabled={isEnabling || isDisabling}
|
|
220
219
|
kind="primary"
|
|
221
220
|
type="submit"
|
|
222
|
-
onClick={() =>
|
|
221
|
+
onClick={() => closeWorkspace({ discardUnsavedChanges: true })}
|
|
223
222
|
>
|
|
224
223
|
{(() => {
|
|
225
224
|
if (isEnabling) return t('enablingFlag', 'Enabling flag...');
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { defineConfigSchema, getAsyncLifecycle
|
|
1
|
+
import { defineConfigSchema, getAsyncLifecycle } from '@openmrs/esm-framework';
|
|
2
2
|
import { configSchema } from './config-schema';
|
|
3
|
-
import flagTagsComponent from './flags/flags-highlight-bar.component';
|
|
4
|
-
import flagsOverviewComponent from './flags/flags.component';
|
|
5
3
|
|
|
6
4
|
const moduleName = '@openmrs/esm-patient-flags-app';
|
|
7
5
|
|
|
@@ -11,12 +9,12 @@ export function startupApp() {
|
|
|
11
9
|
defineConfigSchema(moduleName, configSchema);
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
export const flagTags =
|
|
12
|
+
export const flagTags = getAsyncLifecycle(() => import('./flags/flags-highlight-bar.component'), {
|
|
15
13
|
featureName: 'patient-flag-tags',
|
|
16
14
|
moduleName,
|
|
17
15
|
});
|
|
18
16
|
|
|
19
|
-
export const flagsOverview =
|
|
17
|
+
export const flagsOverview = getAsyncLifecycle(() => import('./flags/flags.component'), {
|
|
20
18
|
featureName: 'patient-flags-overview',
|
|
21
19
|
moduleName,
|
|
22
20
|
});
|
package/src/routes.json
CHANGED
package/translations/fr.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"activeFirst": "Actif en premier",
|
|
3
3
|
"alphabetically": "A - Z",
|
|
4
|
-
"assigned": "
|
|
4
|
+
"assigned": "Assigné",
|
|
5
5
|
"clearSearch": "Effacer la recherche",
|
|
6
|
-
"clinical": "
|
|
6
|
+
"clinical": "Clinique",
|
|
7
7
|
"closeFlagsBar": "Fermer la barre des drapeaux",
|
|
8
8
|
"disableFlagError": "Erreur de désactivation du drapeau",
|
|
9
9
|
"disablingFlag": "Désactivation du drapeau en cours...",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"riskFlag": "Risk flag",
|
|
31
31
|
"saveAndClose": "Sauvegarder et fermer",
|
|
32
32
|
"searchForAFlag": "Rechercher un drapeau",
|
|
33
|
-
"sortBy": "
|
|
33
|
+
"sortBy": "Trier par"
|
|
34
34
|
}
|
package/translations/it.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"activeFirst": "Attivi per primi",
|
|
3
3
|
"alphabetically": "A - Z",
|
|
4
|
-
"assigned": "
|
|
4
|
+
"assigned": "Assegnato",
|
|
5
5
|
"clearSearch": "Cancella ricerca",
|
|
6
|
-
"clinical": "
|
|
6
|
+
"clinical": "Clinico",
|
|
7
7
|
"closeFlagsBar": "Chiudi barra segnalazioni",
|
|
8
8
|
"disableFlagError": "Errore nella disattivazione della segnalazione",
|
|
9
9
|
"disablingFlag": "Disattivazione della segnalazione in corso...",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"editFlags": "Modifica segnalazioni",
|
|
13
13
|
"editPatientFlags": "Modifica segnalazioni paziente",
|
|
14
14
|
"enabledFlag": "Segnalazione attivata",
|
|
15
|
-
"enableFlagError": "
|
|
15
|
+
"enableFlagError": "Errore nell'attivazione della segnalazione",
|
|
16
16
|
"enablingFlag": "Attivazione della segnalazione in corso...",
|
|
17
17
|
"flagCount_one": "{{count}} segnalazione di rischio",
|
|
18
18
|
"flagCount_other": "{{count}} segnalazioni di rischio",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"flagDisableError": "Errore nella disattivazione della segnalazione",
|
|
22
22
|
"flagEnabledSuccessfully": "Segnalazione attivata con successo",
|
|
23
23
|
"flagEnableError": "Errore nell'attivazione della segnalazione",
|
|
24
|
-
"infoFlag": "
|
|
24
|
+
"infoFlag": "Segnalazione di informazione",
|
|
25
25
|
"loading": "Caricamento in corso",
|
|
26
26
|
"matchesForSearchTerm_one": "{{count}} segnalazione",
|
|
27
27
|
"matchesForSearchTerm_other": "{{count}} segnalazioni",
|
|
28
28
|
"noFlagsFound": "Spiacente, nessuna segnalazione trovata corrispondente alla ricerca",
|
|
29
29
|
"retiredFirst": "Disattivati per primi",
|
|
30
|
-
"riskFlag": "
|
|
30
|
+
"riskFlag": "Segnalazione di rischio",
|
|
31
31
|
"saveAndClose": "Salva e chiudi",
|
|
32
32
|
"searchForAFlag": "Cerca una segnalazione",
|
|
33
|
-
"sortBy": "
|
|
33
|
+
"sortBy": "Ordina per"
|
|
34
34
|
}
|