@openmrs/esm-appointments-app 9.2.1-pre.7279 → 9.2.1-pre.7288

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.
@@ -4,7 +4,7 @@ import isToday from 'dayjs/plugin/isToday';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { Calendar, Hospital } from '@carbon/react/icons';
6
6
  import { Button } from '@carbon/react';
7
- import { ExtensionSlot, isDesktop, launchWorkspace, navigate, useLayoutType } from '@openmrs/esm-framework';
7
+ import { ExtensionSlot, isDesktop, launchWorkspace2, navigate, useLayoutType } from '@openmrs/esm-framework';
8
8
  import { spaHomePage } from '../constants';
9
9
  import { useAppointmentsStore } from '../store';
10
10
  import styles from './metrics-header.scss';
@@ -24,7 +24,7 @@ const MetricsHeader: React.FC = () => {
24
24
  mutate: () => {}, // TODO get this to mutate properly
25
25
  };
26
26
 
27
- launchWorkspace('appointments-form-workspace', { ...props });
27
+ launchWorkspace2('appointments-form-workspace', { ...props });
28
28
  };
29
29
 
30
30
  return (
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Layer, OverflowMenu, OverflowMenuItem } from '@carbon/react';
4
- import { launchWorkspace, showModal, useLayoutType } from '@openmrs/esm-framework';
4
+ import { launchWorkspace2, showModal, useLayoutType } from '@openmrs/esm-framework';
5
5
  import type { Appointment } from '../types';
6
6
  import styles from './patient-appointments-action-menu.scss';
7
7
 
@@ -15,10 +15,10 @@ export const PatientAppointmentsActionMenu = ({ appointment, patientUuid }: appo
15
15
  const isTablet = useLayoutType() === 'tablet';
16
16
 
17
17
  const handleLaunchEditAppointmentForm = () => {
18
- launchWorkspace('appointments-form-workspace', {
18
+ launchWorkspace2('appointments-form-workspace', {
19
19
  appointment,
20
20
  context: 'editing',
21
- workspaceTitle: t('editAppointment', 'Edit appointment'),
21
+ patientUuid,
22
22
  });
23
23
  };
24
24
 
@@ -3,7 +3,7 @@ import dayjs from 'dayjs';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { Button, ContentSwitcher, DataTableSkeleton, InlineLoading, Layer, Switch, Tile } from '@carbon/react';
5
5
  import { Add } from '@carbon/react/icons';
6
- import { launchWorkspace, useLayoutType } from '@openmrs/esm-framework';
6
+ import { launchWorkspace2, useLayoutType } from '@openmrs/esm-framework';
7
7
  import { CardHeader, EmptyDataIllustration, ErrorState } from '@openmrs/esm-patient-common-lib';
8
8
  import { usePatientAppointments } from './patient-appointments.resource';
9
9
  import { PatientAppointmentContextTypes, usePatientAppointmentContext } from '../hooks/patient-appointment-context';
@@ -44,14 +44,14 @@ const PatientAppointmentsBase: React.FC<PatientAppointmentsBaseProps> = ({ patie
44
44
  if (
45
45
  (patientAppointmentContext as PatientAppointmentContextTypes) === PatientAppointmentContextTypes.PATIENT_CHART
46
46
  ) {
47
- launchWorkspace('appointments-form-workspace', {
47
+ launchWorkspace2('appointments-form-workspace', {
48
48
  context: 'creating',
49
+ patientUuid,
49
50
  });
50
51
  } else {
51
- launchWorkspace('appointments-form-workspace', {
52
+ launchWorkspace2('appointments-form-workspace', {
52
53
  context: 'creating',
53
54
  patientUuid,
54
- workspaceTitle: t('createNewAppointment', 'Create new appointment'),
55
55
  });
56
56
  }
57
57
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ExtensionSlot, launchWorkspace } from '@openmrs/esm-framework';
2
+ import { ExtensionSlot, launchWorkspace2 } from '@openmrs/esm-framework';
3
3
  import styles from './patient-search.scss';
4
4
 
5
5
  const PatientSearch: React.FC = () => {
@@ -10,7 +10,7 @@ const PatientSearch: React.FC = () => {
10
10
  mutate: () => {}, // TODO get this to mutate properly
11
11
  };
12
12
 
13
- launchWorkspace('appointments-form-workspace', { ...props });
13
+ launchWorkspace2('appointments-form-workspace', { ...props });
14
14
  };
15
15
 
16
16
  return (
package/src/routes.json CHANGED
@@ -135,12 +135,23 @@
135
135
  "component": "cancelAppointmentModal"
136
136
  }
137
137
  ],
138
- "workspaces": [
138
+ "workspaces2": [
139
139
  {
140
140
  "name": "appointments-form-workspace",
141
141
  "component": "appointmentsFormWorkspace",
142
- "title": "createNewAppointment",
143
- "type": "form"
142
+ "window": "appointments-form-window"
143
+ }
144
+ ],
145
+ "workspaceWindows2": [
146
+ {
147
+ "name": "appointments-form-window",
148
+ "group": "appointmentsFormWorkspaceGroup"
149
+ }
150
+ ],
151
+ "workspaceGroups2": [
152
+ {
153
+ "name": "appointmentsFormWorkspaceGroup",
154
+ "overlay": false
144
155
  }
145
156
  ]
146
157
  }