@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.
Files changed (46) hide show
  1. package/.turbo/turbo-build.log +21 -24
  2. package/dist/1837.js +1 -0
  3. package/dist/1837.js.map +1 -0
  4. package/dist/4055.js +1 -1
  5. package/dist/4411.js +2 -0
  6. package/dist/4411.js.map +1 -0
  7. package/dist/5628.js +1 -1
  8. package/dist/5628.js.map +1 -1
  9. package/dist/6138.js +1 -0
  10. package/dist/6138.js.map +1 -0
  11. package/dist/6173.js +1 -0
  12. package/dist/6173.js.map +1 -0
  13. package/dist/6336.js +1 -0
  14. package/dist/6336.js.map +1 -0
  15. package/dist/8519.js +2 -0
  16. package/dist/8519.js.map +1 -0
  17. package/dist/9538.js +1 -1
  18. package/dist/main.js +1 -2
  19. package/dist/main.js.map +1 -1
  20. package/dist/openmrs-esm-patient-flags-app.js +1 -1
  21. package/dist/openmrs-esm-patient-flags-app.js.buildmanifest.json +189 -140
  22. package/dist/openmrs-esm-patient-flags-app.js.map +1 -1
  23. package/dist/routes.json +1 -1
  24. package/package.json +5 -4
  25. package/src/flags/flags-highlight-bar.test.tsx +2 -2
  26. package/src/flags/flags-list.test.tsx +25 -11
  27. package/src/flags/flags.component.tsx +2 -2
  28. package/src/flags/flags.test.tsx +2 -2
  29. package/src/flags/patient-flags.workspace.tsx +4 -5
  30. package/src/index.ts +3 -5
  31. package/src/routes.json +1 -1
  32. package/translations/fr.json +3 -3
  33. package/translations/it.json +6 -6
  34. package/dist/2276.js +0 -2
  35. package/dist/2276.js.map +0 -1
  36. package/dist/2537.js +0 -1
  37. package/dist/2537.js.map +0 -1
  38. package/dist/4918.js +0 -1
  39. package/dist/4918.js.map +0 -1
  40. package/dist/884.js +0 -2
  41. package/dist/884.js.map +0 -1
  42. package/dist/9124.js +0 -1
  43. package/dist/9124.js.map +0 -1
  44. package/dist/main.js.LICENSE.txt +0 -60
  45. /package/dist/{2276.js.LICENSE.txt → 4411.js.LICENSE.txt} +0 -0
  46. /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 { launchWorkspace } from '@openmrs/esm-framework';
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(launchWorkspace);
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, waitFor } from '@testing-library/react';
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
- closeWorkspaceWithSavedChanges={jest.fn()}
31
- patientUuid={mockPatient.id}
32
- patient={mockPatient}
33
- promptBeforeClosing={jest.fn()}
34
- setTitle={jest.fn()}
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
- closeWorkspaceWithSavedChanges={jest.fn()}
63
- patientUuid={mockPatient.id}
64
- patient={mockPatient}
65
- promptBeforeClosing={jest.fn()}
66
- setTitle={jest.fn()}
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, launchWorkspace } from '@openmrs/esm-framework';
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(() => launchWorkspace('patient-flags-workspace'), []);
21
+ const handleClickEditFlags = useCallback(() => launchWorkspace2('patient-flags-workspace'), []);
22
22
 
23
23
  const renderFlag = (flag: FlagWithPriority) => {
24
24
  const hasPriority = flag.flagWithPriority?.priority?.name;
@@ -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 { launchWorkspace } from '@openmrs/esm-framework';
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(launchWorkspace);
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 DefaultPatientWorkspaceProps } from '@openmrs/esm-patient-common-lib';
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<DefaultPatientWorkspaceProps> = ({
14
- patientUuid,
13
+ const FlagsList: React.FC<PatientWorkspace2DefinitionProps<{}, {}>> = ({
15
14
  closeWorkspace,
16
- closeWorkspaceWithSavedChanges,
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={() => closeWorkspaceWithSavedChanges()}
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, getSyncLifecycle } from '@openmrs/esm-framework';
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 = getSyncLifecycle(flagTagsComponent, {
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 = getSyncLifecycle(flagsOverviewComponent, {
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.openmrs.org/routes.schema.json",
3
3
  "backendDependencies": {
4
- "webservices.rest": "^2.2.0"
4
+ "webservices.rest": ">=2.2.0"
5
5
  },
6
6
  "extensions": [
7
7
  {
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "activeFirst": "Actif en premier",
3
3
  "alphabetically": "A - Z",
4
- "assigned": "Assigned",
4
+ "assigned": "Assigné",
5
5
  "clearSearch": "Effacer la recherche",
6
- "clinical": "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": "Sort by"
33
+ "sortBy": "Trier par"
34
34
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "activeFirst": "Attivi per primi",
3
3
  "alphabetically": "A - Z",
4
- "assigned": "Assigned",
4
+ "assigned": "Assegnato",
5
5
  "clearSearch": "Cancella ricerca",
6
- "clinical": "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": "Enable flag error",
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": "Info flag",
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": "Risk flag",
30
+ "riskFlag": "Segnalazione di rischio",
31
31
  "saveAndClose": "Salva e chiudi",
32
32
  "searchForAFlag": "Cerca una segnalazione",
33
- "sortBy": "Sort by"
33
+ "sortBy": "Ordina per"
34
34
  }