@openmrs/esm-patient-allergies-app 11.3.1-patch.9064 → 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 +23 -19
  2. package/dist/3357.js +1 -1
  3. package/dist/3357.js.map +1 -1
  4. package/dist/3753.js +2 -0
  5. package/dist/3753.js.map +1 -0
  6. package/dist/4055.js +1 -1
  7. package/dist/4341.js +1 -0
  8. package/dist/4341.js.map +1 -0
  9. package/dist/5563.js +1 -1
  10. package/dist/5563.js.map +1 -1
  11. package/dist/5670.js +1 -1
  12. package/dist/5670.js.map +1 -1
  13. package/dist/6336.js +1 -0
  14. package/dist/6336.js.map +1 -0
  15. package/dist/6884.js +1 -1
  16. package/dist/9540.js +2 -0
  17. package/dist/9540.js.map +1 -0
  18. package/dist/main.js +1 -1
  19. package/dist/main.js.map +1 -1
  20. package/dist/openmrs-esm-patient-allergies-app.js +1 -1
  21. package/dist/openmrs-esm-patient-allergies-app.js.buildmanifest.json +122 -143
  22. package/dist/openmrs-esm-patient-allergies-app.js.map +1 -1
  23. package/dist/routes.json +1 -1
  24. package/package.json +3 -3
  25. package/src/allergies/allergies-action-menu.component.tsx +3 -4
  26. package/src/allergies/allergies-detailed-summary.component.tsx +2 -2
  27. package/src/allergies/allergies-form/allergy-form.test.tsx +29 -12
  28. package/src/allergies/allergies-form/allergy-form.workspace.tsx +204 -193
  29. package/src/allergies/allergies-list.extension.tsx +14 -9
  30. package/src/allergies/allergies-list.scss +4 -0
  31. package/src/allergies/allergies-overview.component.tsx +2 -2
  32. package/src/index.ts +0 -1
  33. package/src/routes.json +9 -4
  34. package/translations/fr.json +1 -1
  35. package/dist/1533.js +0 -2
  36. package/dist/1533.js.map +0 -1
  37. package/dist/2537.js +0 -1
  38. package/dist/2537.js.map +0 -1
  39. package/dist/4918.js +0 -1
  40. package/dist/4918.js.map +0 -1
  41. package/dist/5836.js +0 -2
  42. package/dist/5836.js.map +0 -1
  43. package/dist/8803.js +0 -1
  44. package/dist/8803.js.map +0 -1
  45. /package/dist/{1533.js.LICENSE.txt → 3753.js.LICENSE.txt} +0 -0
  46. /package/dist/{5836.js.LICENSE.txt → 9540.js.LICENSE.txt} +0 -0
@@ -1,17 +1,18 @@
1
1
  import React from 'react';
2
- import { useTranslation } from 'react-i18next';
2
+ import classNames from 'classnames';
3
3
  import { Tag, TagSkeleton, Tooltip } from '@carbon/react';
4
- import { getCoreTranslation } from '@openmrs/esm-framework';
4
+ import { getCoreTranslation, translateFrom } from '@openmrs/esm-framework';
5
5
  import { useAllergies } from './allergy-intolerance.resource';
6
6
  import { severityOrder } from '../utils';
7
7
  import styles from './allergies-list.scss';
8
8
 
9
+ const moduleName = '@openmrs/esm-patient-allergies-app';
10
+
9
11
  interface AllergyListProps {
10
12
  patientUuid: string;
11
13
  }
12
14
 
13
15
  const AllergyList: React.FC<AllergyListProps> = ({ patientUuid }) => {
14
- const { t } = useTranslation();
15
16
  const { allergies, isLoading } = useAllergies(patientUuid);
16
17
 
17
18
  const sortedAllergies = allergies?.sort(
@@ -19,18 +20,22 @@ const AllergyList: React.FC<AllergyListProps> = ({ patientUuid }) => {
19
20
  );
20
21
 
21
22
  if (isLoading) {
22
- return <TagSkeleton />;
23
+ return (
24
+ <div className={styles.container}>
25
+ <TagSkeleton />
26
+ </div>
27
+ );
23
28
  }
24
29
 
25
30
  if (sortedAllergies?.length) {
26
31
  return (
27
- <div className={styles.label}>
28
- <span>{t('allergies', 'Allergies')}:</span>
32
+ <div className={classNames(styles.label, styles.container)}>
33
+ <span>{translateFrom(moduleName, 'allergies', 'Allergies')}:</span>
29
34
  {sortedAllergies.map((allergy) => (
30
35
  <Tooltip
31
36
  align="bottom"
32
37
  key={allergy.id}
33
- label={`${allergy.reactionToSubstance} - ${allergy.reactionSeverity || getCoreTranslation('unknown')}`}
38
+ label={`${allergy.reactionToSubstance} - ${allergy.reactionSeverity ? translateFrom(moduleName, allergy.reactionSeverity) : getCoreTranslation('unknown')}`}
34
39
  >
35
40
  <Tag
36
41
  className={styles.allergyLabel}
@@ -46,8 +51,8 @@ const AllergyList: React.FC<AllergyListProps> = ({ patientUuid }) => {
46
51
  }
47
52
 
48
53
  return (
49
- <div className={styles.label}>
50
- {t('allergies', 'Allergies')}: {getCoreTranslation('unknown')}
54
+ <div className={classNames(styles.label, styles.container)}>
55
+ {translateFrom(moduleName, 'allergies', 'Allergies')}: {getCoreTranslation('unknown')}
51
56
  </div>
52
57
  );
53
58
  };
@@ -3,6 +3,10 @@
3
3
  @use '@carbon/type';
4
4
  @use '@openmrs/esm-styleguide/src/vars' as *;
5
5
 
6
+ .container {
7
+ margin: layout.$spacing-03 layout.$spacing-05;
8
+ }
9
+
6
10
  .label {
7
11
  @include type.type-style('label-01');
8
12
  color: $text-02;
@@ -13,7 +13,7 @@ import {
13
13
  TableRow,
14
14
  } from '@carbon/react';
15
15
  import { useTranslation } from 'react-i18next';
16
- import { AddIcon, launchWorkspace, useLayoutType, usePagination } from '@openmrs/esm-framework';
16
+ import { AddIcon, launchWorkspace2, useLayoutType, usePagination } from '@openmrs/esm-framework';
17
17
  import { CardHeader, EmptyState, ErrorState, PatientChartPagination } from '@openmrs/esm-patient-common-lib';
18
18
  import { allergiesCount, patientAllergiesFormWorkspace } from '../constants';
19
19
  import { useAllergies } from './allergy-intolerance.resource';
@@ -57,7 +57,7 @@ const AllergiesOverview: React.FC<AllergiesOverviewProps> = ({ patient }) => {
57
57
  }));
58
58
  }, [paginatedAllergies]);
59
59
 
60
- const launchAllergiesForm = useCallback(() => launchWorkspace(patientAllergiesFormWorkspace), []);
60
+ const launchAllergiesForm = useCallback(() => launchWorkspace2(patientAllergiesFormWorkspace), []);
61
61
 
62
62
  if (isLoading) {
63
63
  return <DataTableSkeleton role="progressbar" compact={isDesktop} zebra />;
package/src/index.ts CHANGED
@@ -51,7 +51,6 @@ export const allergiesDashboardLink = getSyncLifecycle(
51
51
  options,
52
52
  );
53
53
 
54
- // t('recordNewAllergy', "Record a new allergy")
55
54
  export const allergyFormWorkspace = getAsyncLifecycle(
56
55
  () => import('./allergies/allergies-form/allergy-form.workspace'),
57
56
  options,
package/src/routes.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.openmrs.org/routes.schema.json",
3
3
  "backendDependencies": {
4
4
  "fhir2": ">=1.2",
5
- "webservices.rest": "^2.2.0"
5
+ "webservices.rest": ">=2.2.0"
6
6
  },
7
7
  "extensions": [
8
8
  {
@@ -44,12 +44,17 @@
44
44
  "component": "deleteAllergyModal"
45
45
  }
46
46
  ],
47
- "workspaces": [
47
+ "workspaces2": [
48
48
  {
49
49
  "name": "patient-allergy-form-workspace",
50
- "title": "recordNewAllergy",
51
50
  "component": "allergyFormWorkspace",
52
- "type": "form"
51
+ "window": "patient-allergy-form-window"
52
+ }
53
+ ],
54
+ "workspaceWindows2": [
55
+ {
56
+ "name": "patient-allergy-form-window",
57
+ "group": "patient-chart"
53
58
  }
54
59
  ]
55
60
  }
@@ -48,5 +48,5 @@
48
48
  "typeAdditionalComments": "Ajouter ici tous commentaires additionnels",
49
49
  "typeAllergenName": "Veuillez saisir le nom de l'allergène",
50
50
  "typeAllergicReactionName": "Veuillez saisir le nom de la réaction allergique",
51
- "unknown": "Unknown"
51
+ "unknown": "Inconnu(e)"
52
52
  }