@cc-openmrs/cc-esm-active-prescriptions 1.0.13 → 1.0.16

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/dist/296.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[296],{4296(e,t,r){r.r(t),r.d(t,{default:()=>a});var n=r(6072),c=r(3335),i=r(5987),o=r(8150),p=r(2076);function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const a=function(e){var t=e.patientUuid,r=(0,p.useTranslation)().t,a=(0,n.useCallback)(function(){t?(0,i.launchWorkspace)("active-prescriptions-workspace",{patientUuid:t}):(0,i.launchWorkspace)("active-prescriptions-workspace")},[t]),u=r("prescriptionsActionMenuItem","Active prescriptions");return n.createElement(o.ED,{getIcon:function(e){return n.createElement(c.KM,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){s(e,t,r[t])})}return e}({},e),r=null!=(r={"aria-hidden":"true"})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t));var t,r},handler:a,iconDescription:u,label:u,type:"active-prescriptions"})}}}]);
1
+ "use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[296],{4296(e,t,r){r.r(t),r.d(t,{default:()=>s});var n=r(6072),c=r(3335),i=r(5987),o=r(8150),a=r(2076);function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const s=function(e){var t=e.patientUuid,r=(0,a.useTranslation)().t,s=(0,n.useCallback)(function(){t?(0,i.navigateAndLaunchWorkspace)({targetUrl:"".concat(window.getOpenmrsSpaBase(),"patient/").concat(t,"/chart"),contextKey:"patient-chart",workspaceName:"active-prescriptions-workspace",additionalProps:{patientUuid:t}}):(0,i.launchWorkspace)("active-prescriptions-workspace")},[t]),u=r("prescriptionsActionMenuItem","Active prescriptions");return n.createElement(o.ED,{getIcon:function(e){return n.createElement(c.KM,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){p(e,t,r[t])})}return e}({},e),r=null!=(r={"aria-hidden":"true"})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t));var t,r},handler:s,iconDescription:u,label:u,type:"active-prescriptions"})}}}]);
package/dist/477.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[477],{4477(c,e,t){t.r(e),t.d(e,{default:()=>a});var i=t(6072),s=t(4504),n=t(5987),r=t(2076);const a=function(c){var e=c.patientUuid,t=(0,(0,r.useTranslation)().t)("prescriptionsActionButton","Active prescriptions"),a=(0,i.useCallback)(function(){e?(0,n.launchWorkspace)("active-prescriptions-workspace",{patientUuid:e}):(0,n.launchWorkspace)("active-prescriptions-workspace")},[e]);return i.createElement(s.XSD,{itemText:t,onClick:a})}}}]);
1
+ "use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[477],{4477(t,e,c){c.r(e),c.d(e,{default:()=>s});var a=c(6072),i=c(4504),n=c(5987),r=c(2076);const s=function(t){var e=t.patientUuid,c=(0,(0,r.useTranslation)().t)("prescriptionsActionButton","Active prescriptions"),s=(0,a.useCallback)(function(){e?(0,n.navigateAndLaunchWorkspace)({targetUrl:"".concat(window.getOpenmrsSpaBase(),"patient/").concat(e,"/chart"),contextKey:"patient-chart",workspaceName:"active-prescriptions-workspace",additionalProps:{patientUuid:e}}):(0,n.launchWorkspace)("active-prescriptions-workspace")},[e]);return a.createElement(i.XSD,{itemText:c,onClick:s})}}}]);
@@ -265,9 +265,9 @@
265
265
  "initial": false,
266
266
  "entry": false,
267
267
  "recorded": false,
268
- "size": 3030,
268
+ "size": 3310,
269
269
  "sizes": {
270
- "javascript": 3030
270
+ "javascript": 3310
271
271
  },
272
272
  "names": [],
273
273
  "idHints": [],
@@ -281,7 +281,7 @@
281
281
  "auxiliaryFiles": [
282
282
  "296.js.map"
283
283
  ],
284
- "hash": "0596876aa46d42b1",
284
+ "hash": "83e9a7f23e03e55d",
285
285
  "childrenByOrder": {}
286
286
  },
287
287
  {
@@ -464,9 +464,9 @@
464
464
  "initial": false,
465
465
  "entry": false,
466
466
  "recorded": false,
467
- "size": 915,
467
+ "size": 1195,
468
468
  "sizes": {
469
- "javascript": 915
469
+ "javascript": 1195
470
470
  },
471
471
  "names": [],
472
472
  "idHints": [],
@@ -480,7 +480,7 @@
480
480
  "auxiliaryFiles": [
481
481
  "477.js.map"
482
482
  ],
483
- "hash": "04b0eab0a53e3865",
483
+ "hash": "17859c70c53fecaa",
484
484
  "childrenByOrder": {}
485
485
  },
486
486
  {
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"Red box","component":"redBox","slot":"Boxes"},{"name":"Blue box","component":"blueBox","slot":"Boxes"},{"name":"Brand box","component":"brandBox","slot":"Boxes"},{"name":"Prescriptions banner action","component":"prescriptionsActionButton","slot":"patient-actions-slot","order":50,"meta":{"label":"Active prescriptions","icon":"certificate"}},{"name":"Prescriptions action","component":"prescriptionsActionMenuItem","slot":"action-menu-patient-chart-items-slot","order":50,"meta":{"label":"Prescriptions","icon":"pill"}}],"pages":[{"component":"root","route":"root"}],"workspaces":[{"name":"active-prescriptions-workspace","title":"activePrescriptionsWorkspaceTitle","component":"root","type":"active-prescriptions","canHide":true,"width":"wider"}],"version":"1.0.13"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"Red box","component":"redBox","slot":"Boxes"},{"name":"Blue box","component":"blueBox","slot":"Boxes"},{"name":"Brand box","component":"brandBox","slot":"Boxes"},{"name":"Prescriptions action 2","component":"prescriptionsActionMenuItem","slot":"action-menu-patient-chart-items-slot","order":4,"meta":{"label":"Prescriptions 2","icon":"pill"}},{"name":"Prescriptions action","component":"prescriptionsActionButton","slot":"patient-actions-slot","order":50}],"pages":[{"component":"root","route":"root"}],"workspaces":[{"name":"active-prescriptions-workspace","title":"activePrescriptionsWorkspaceTitle","component":"root","type":"active-prescriptions","canHide":true,"width":"wider"}],"version":"1.0.16"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-openmrs/cc-esm-active-prescriptions",
3
- "version": "1.0.13",
3
+ "version": "1.0.16",
4
4
  "license": "MPL-2.0",
5
5
  "description": "An OpenMRS seed application for building microfrontends",
6
6
  "browser": "dist/openmrs-esm-template-app.js",
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { OverflowMenuItem } from '@carbon/react';
3
- import { launchWorkspace } from '@openmrs/esm-framework';
3
+ import { launchWorkspace, navigateAndLaunchWorkspace } from '@openmrs/esm-framework';
4
4
  import { useTranslation } from 'react-i18next';
5
5
 
6
6
  interface PrescriptionsActionButtonProps {
@@ -13,7 +13,12 @@ const PrescriptionsActionButton: React.FC<PrescriptionsActionButtonProps> = ({ p
13
13
 
14
14
  const handleClick = useCallback(() => {
15
15
  if (patientUuid) {
16
- launchWorkspace('active-prescriptions-workspace', { patientUuid });
16
+ navigateAndLaunchWorkspace({
17
+ targetUrl: `${window.getOpenmrsSpaBase()}patient/${patientUuid}/chart`,
18
+ contextKey: 'patient-chart',
19
+ workspaceName: 'active-prescriptions-workspace',
20
+ additionalProps: { patientUuid },
21
+ });
17
22
  } else {
18
23
  launchWorkspace('active-prescriptions-workspace');
19
24
  }
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { CertificateCheck } from '@carbon/react/icons';
3
- import { launchWorkspace } from '@openmrs/esm-framework';
3
+ import { launchWorkspace, navigateAndLaunchWorkspace } from '@openmrs/esm-framework';
4
4
  import { ActionMenuButton } from '@openmrs/esm-styleguide';
5
5
  import { useTranslation } from 'react-i18next';
6
6
 
@@ -13,7 +13,12 @@ const PrescriptionsActionMenuItem: React.FC<PrescriptionsActionMenuItemProps> =
13
13
 
14
14
  const handleClick = useCallback(() => {
15
15
  if (patientUuid) {
16
- launchWorkspace('active-prescriptions-workspace', { patientUuid });
16
+ navigateAndLaunchWorkspace({
17
+ targetUrl: `${window.getOpenmrsSpaBase()}patient/${patientUuid}/chart`,
18
+ contextKey: 'patient-chart',
19
+ workspaceName: 'active-prescriptions-workspace',
20
+ additionalProps: { patientUuid },
21
+ });
17
22
  } else {
18
23
  launchWorkspace('active-prescriptions-workspace');
19
24
  }
package/src/routes.json CHANGED
@@ -21,24 +21,20 @@
21
21
  "slot": "Boxes"
22
22
  },
23
23
  {
24
- "name": "Prescriptions banner action",
25
- "component": "prescriptionsActionButton",
26
- "slot": "patient-actions-slot",
27
- "order": 50,
28
- "meta": {
29
- "label": "Active prescriptions",
30
- "icon": "certificate"
31
- }
32
- },
33
- {
34
- "name": "Prescriptions action",
24
+ "name": "Prescriptions action 2",
35
25
  "component": "prescriptionsActionMenuItem",
36
26
  "slot": "action-menu-patient-chart-items-slot",
37
- "order": 50,
27
+ "order": 4,
38
28
  "meta": {
39
- "label": "Prescriptions",
29
+ "label": "Prescriptions 2",
40
30
  "icon": "pill"
41
31
  }
32
+ },
33
+ {
34
+ "name": "Prescriptions action",
35
+ "component": "prescriptionsActionButton",
36
+ "slot": "patient-actions-slot",
37
+ "order": 50
42
38
  }
43
39
  ],
44
40
  "pages": [