@kenyaemr/esm-patient-flags-app 5.4.2-pre.2349 → 5.4.2-pre.2351

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.
@@ -318,9 +318,9 @@
318
318
  "initial": false,
319
319
  "entry": false,
320
320
  "recorded": false,
321
- "size": 116847,
321
+ "size": 117371,
322
322
  "sizes": {
323
- "javascript": 116847
323
+ "javascript": 117371
324
324
  },
325
325
  "names": [],
326
326
  "idHints": [],
@@ -333,7 +333,7 @@
333
333
  "auxiliaryFiles": [
334
334
  "541.js.map"
335
335
  ],
336
- "hash": "daeb53db985a7b0a",
336
+ "hash": "c105f61b367ddecf",
337
337
  "childrenByOrder": {}
338
338
  },
339
339
  {
@@ -384,10 +384,10 @@
384
384
  "initial": true,
385
385
  "entry": true,
386
386
  "recorded": false,
387
- "size": 6182928,
387
+ "size": 6183452,
388
388
  "sizes": {
389
389
  "consume-shared": 210,
390
- "javascript": 6161777,
390
+ "javascript": 6162301,
391
391
  "share-init": 210,
392
392
  "runtime": 20731
393
393
  },
@@ -404,7 +404,7 @@
404
404
  "auxiliaryFiles": [
405
405
  "main.js.map"
406
406
  ],
407
- "hash": "e73c2075a8f3678a",
407
+ "hash": "b567e56ca4ae0187",
408
408
  "childrenByOrder": {}
409
409
  },
410
410
  {
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemr":"^19.0.0"},"pages":[],"extensions":[{"name":"patient-flag","slot":"top-of-all-patient-dashboards-slot","component":"patientFlag","order":0,"online":true,"offline":false},{"name":"kenyaemr-module-links","slot":"top-nav-actions-slot","component":"navbarButtons","order":5,"online":true,"offline":true}],"version":"5.4.2-pre.2349"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemr":"^19.0.0"},"pages":[],"extensions":[{"name":"patient-flag","slot":"top-of-all-patient-dashboards-slot","component":"patientFlag","order":0,"online":true,"offline":false},{"name":"kenyaemr-module-links","slot":"top-nav-actions-slot","component":"navbarButtons","order":5,"online":true,"offline":true}],"version":"5.4.2-pre.2351"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-patient-flags-app",
3
- "version": "5.4.2-pre.2349",
3
+ "version": "5.4.2-pre.2351",
4
4
  "description": "Patient flags microfrontend for the OpenMRS SPA",
5
5
  "browser": "dist/openmrs-esm-patient-flags-app.js",
6
6
  "main": "src/index.ts",
@@ -1,5 +1,17 @@
1
- import { Type } from '@openmrs/esm-framework';
1
+ import { ConfigSchema, Type } from '@openmrs/esm-framework';
2
2
 
3
- export const configSchema = {};
3
+ export const configSchema: ConfigSchema = {
4
+ excludeLinks: {
5
+ _type: Type.Array,
6
+ _elements: {
7
+ _type: Type.String,
8
+ _description: 'Label for the link to hide',
9
+ },
10
+ _default: [],
11
+ _description: 'Array of links to hide in the patient flags app',
12
+ },
13
+ };
4
14
 
5
- export type ConfigObject = {};
15
+ export type ConfigObject = {
16
+ excludeLinks: Array<string>;
17
+ };
@@ -31,8 +31,8 @@ const handleClearCache = async () => {
31
31
 
32
32
  export const useModuleLinks = () => {
33
33
  const { t } = useTranslation();
34
- const config = useConfig<ConfigObject>();
35
- return [
34
+ const { excludeLinks } = useConfig<ConfigObject>();
35
+ const moduleLinks = [
36
36
  {
37
37
  label: t('systemInfo', 'System Info'),
38
38
  url: `${openmrsSpaBase}about`,
@@ -117,9 +117,11 @@ export const useModuleLinks = () => {
117
117
  },
118
118
  {
119
119
  label: t('reports', 'Reports'),
120
- url: `${openmrsSpaBase}reports`,
120
+ url: `/openmrs/kenyaemr/reports/reportsHome.page`,
121
121
  icon: <Report size={24} />,
122
122
  privilege: 'o3: View Reports',
123
123
  },
124
124
  ];
125
+
126
+ return moduleLinks.filter((link) => !excludeLinks.some((excludeLink) => excludeLink === link.label));
125
127
  };