@openmrs/esm-appointments-app 5.2.2-pre.2638 → 5.2.2-pre.2640

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.
@@ -80,10 +80,10 @@
80
80
  "initial": true,
81
81
  "entry": true,
82
82
  "recorded": false,
83
- "size": 4545133,
83
+ "size": 4544644,
84
84
  "sizes": {
85
85
  "consume-shared": 252,
86
- "javascript": 4524209,
86
+ "javascript": 4523720,
87
87
  "share-init": 252,
88
88
  "runtime": 20420
89
89
  },
@@ -100,7 +100,7 @@
100
100
  "auxiliaryFiles": [
101
101
  "main.js.map"
102
102
  ],
103
- "hash": "8ca36fc7fce574c4",
103
+ "hash": "0026283adf5b433a",
104
104
  "childrenByOrder": {}
105
105
  },
106
106
  {
@@ -396,9 +396,9 @@
396
396
  "initial": false,
397
397
  "entry": false,
398
398
  "recorded": false,
399
- "size": 480840,
399
+ "size": 480351,
400
400
  "sizes": {
401
- "javascript": 480672,
401
+ "javascript": 480183,
402
402
  "consume-shared": 168
403
403
  },
404
404
  "names": [],
@@ -412,7 +412,7 @@
412
412
  "auxiliaryFiles": [
413
413
  "636.js.map"
414
414
  ],
415
- "hash": "29e81b62ef741b77",
415
+ "hash": "f379799e709c4e77",
416
416
  "childrenByOrder": {}
417
417
  },
418
418
  {
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"home-appointments","slot":"homepage-widgets-slot","component":"homeAppointments","order":1},{"name":"clinical-appointments-dashboard-link","slot":"homepage-dashboard-slot","component":"appointmentsDashboardLink","meta":{"name":"appointments","slot":"clinical-appointments-dashboard-slot","title":"Appointments"}},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"name":"appointments-calendar-dashboard-link","slot":"calendar-dashboard-slot","component":"appointmentsCalendarDashboardLink"},{"name":"check-in-appointment-modal","slot":"todays-appointment-slot","component":"checkInModal"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"early-appointments-panel","component":"earlyAppointments"}],"version":"5.2.2-pre.2638"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"home-appointments","slot":"homepage-widgets-slot","component":"homeAppointments","order":1},{"name":"clinical-appointments-dashboard-link","slot":"homepage-dashboard-slot","component":"appointmentsDashboardLink","meta":{"name":"appointments","slot":"clinical-appointments-dashboard-slot","title":"Appointments"}},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"name":"appointments-calendar-dashboard-link","slot":"calendar-dashboard-slot","component":"appointmentsCalendarDashboardLink"},{"name":"check-in-appointment-modal","slot":"todays-appointment-slot","component":"checkInModal"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"early-appointments-panel","component":"earlyAppointments"}],"version":"5.2.2-pre.2640"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-appointments-app",
3
- "version": "5.2.2-pre.2638",
3
+ "version": "5.2.2-pre.2640",
4
4
  "description": "Appointments front-end module for the OpenMRS SPA",
5
5
  "browser": "dist/openmrs-esm-appointments-app.js",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
- import { AppointmentSummary, Appointment } from '../types';
2
- import { formatDate, parseDate, formatDatetime } from '@openmrs/esm-framework';
3
- import dayjs, { Dayjs } from 'dayjs';
1
+ import dayjs, { type Dayjs } from 'dayjs';
2
+ import { formatDate, parseDate } from '@openmrs/esm-framework';
3
+ import { type AppointmentSummary, type Appointment } from '../types';
4
4
  import { configSchema } from '../config-schema';
5
5
 
6
6
  export const getHighestAppointmentServiceLoad = (appointmentSummary: Array<any> = []) => {
@@ -29,18 +29,18 @@ export const getServiceCountByAppointmentType = (
29
29
 
30
30
  function getAppointmentDuration(startTime = 0, endTime = 0) {
31
31
  const diff = endTime - startTime;
32
- var minutes = Math.floor(diff / 60000);
32
+ const minutes = Math.floor(diff / 60000);
33
33
  return minutes + 'min';
34
34
  }
35
35
 
36
36
  function formatAMPM(date) {
37
- var hours = date.getHours();
38
- var minutes = date.getMinutes();
39
- var ampm = hours >= 12 ? 'PM' : 'AM';
37
+ let hours = date.getHours();
38
+ let minutes = date.getMinutes();
39
+ let ampm = hours >= 12 ? 'PM' : 'AM';
40
40
  hours = hours % 12;
41
41
  hours = hours ? hours : 12; // the hour '0' should be '12'
42
42
  minutes = minutes < 10 ? '0' + minutes : minutes;
43
- var strTime = hours + ':' + minutes + ' ' + ampm;
43
+ const strTime = hours + ':' + minutes + ' ' + ampm;
44
44
  return strTime;
45
45
  }
46
46
 
@@ -64,9 +64,11 @@ export const mapAppointmentProperties = (appointment: Appointment, t?: Function)
64
64
  comments: appointment.comments ? appointment.comments : '--',
65
65
  appointmentNumber: appointment.appointmentNumber,
66
66
  color: appointment?.service?.color ?? '',
67
- identifier: appointment?.patient?.identifiers?.find(
68
- (identifier) => identifier.identifierName === configSchema.patientIdentifierType._default,
69
- ).identifier,
67
+ identifier: appointment?.patient?.identifiers?.length
68
+ ? appointment.patient.identifiers.find(
69
+ (identifier) => identifier.identifierName === configSchema.patientIdentifierType._default,
70
+ ).identifier
71
+ : appointment.patient?.identifier,
70
72
  duration: appointment.service?.durationMins
71
73
  ? appointment?.service?.durationMins + t('minutes', 'min')
72
74
  : getAppointmentDuration(appointment.startDateTime, appointment.endDateTime),
@@ -96,7 +96,8 @@ export const ActionsMenu = ({ appointment, useBahmniUI }: ActionMenuProps) => {
96
96
  return (
97
97
  <Layer>
98
98
  <OverflowMenu
99
- aria-label="Edit appointment"
99
+ align="left"
100
+ aria-label="Options"
100
101
  selectorPrimaryFocus={'#editPatientDetails'}
101
102
  size={isDesktop ? 'sm' : 'lg'}
102
103
  flipped>
@@ -32,9 +32,9 @@ import { EmptyDataIllustration } from './empty-data-illustration.component';
32
32
  import { launchCheckInAppointmentModal, handleComplete } from './common';
33
33
  import { SeeAllAppointmentsLink, AddAppointmentLink, ViewCalendarLink } from './links.component';
34
34
  import { type Appointment, type MappedHomeAppointment } from '../types';
35
+ import { type ConfigObject } from '../config-schema';
35
36
  import { useTodaysAppointments } from './appointments-table.resource';
36
37
  import styles from './appointments-list.scss';
37
- import { type ConfigObject } from '../config-schema';
38
38
 
39
39
  interface PaginationData {
40
40
  goTo: (page: number) => void;
@@ -78,7 +78,7 @@ const RenderStatus = ({ status, t, appointmentUuid, mutate }: RenderStatusProps)
78
78
  );
79
79
  case 'CheckedIn':
80
80
  return (
81
- <Button kind="ghost" className={styles.actionButton} onClick={() => handleComplete(appointmentUuid, mutate, t)}>
81
+ <Button kind="ghost" onClick={() => handleComplete(appointmentUuid, mutate, t)}>
82
82
  {t('complete', 'Complete')}
83
83
  </Button>
84
84
  );
@@ -87,7 +87,6 @@ const RenderStatus = ({ status, t, appointmentUuid, mutate }: RenderStatusProps)
87
87
  <Button
88
88
  size="sm"
89
89
  kind="ghost"
90
- className={styles.actionButton}
91
90
  disabled={status === 'CheckedIn'}
92
91
  onClick={() => launchCheckInAppointmentModal(appointmentUuid)}>
93
92
  {t('checkIn', 'Check In')}
@@ -185,7 +184,7 @@ const AppointmentsBaseTable = () => {
185
184
  identifier: {
186
185
  content: (
187
186
  <div className={styles.nameContainer}>
188
- <span className={styles.identifier}>{appointment.identifier}</span>
187
+ <span>{appointment.identifier}</span>
189
188
  </div>
190
189
  ),
191
190
  sortKey: appointment.identifier,
@@ -205,7 +204,7 @@ const AppointmentsBaseTable = () => {
205
204
  },
206
205
  actionButton: {
207
206
  content: (
208
- <span className={styles.serviceContainer}>
207
+ <span>
209
208
  <RenderStatus status={appointment.status} appointmentUuid={appointment.id} t={t} mutate={mutate} />
210
209
  </span>
211
210
  ),
@@ -286,7 +285,7 @@ const AppointmentsBaseTable = () => {
286
285
  sortRow={handleSorting}
287
286
  overflowMenuOnHover={isDesktop(layout)}
288
287
  rows={tableRows}
289
- size={isDesktop(layout) ? 'md' : 'lg'}
288
+ size={isDesktop(layout) ? 'lg' : 'sm'}
290
289
  useZebraStyles={true}>
291
290
  {({ rows, headers, getHeaderProps, getTableProps, getRowProps }) => {
292
291
  return (
@@ -84,15 +84,6 @@
84
84
  width: max-content;
85
85
  }
86
86
 
87
- .identifier {
88
- font-weight: 700;
89
- }
90
-
91
- .actionButton {
92
- position: static;
93
- padding: layout.$spacing-03 layout.$spacing-05 layout.$spacing-03 0;
94
- }
95
-
96
87
  .serviceColor {
97
88
  border-radius: 50%;
98
89
  margin-right: layout.$spacing-03;
@@ -135,7 +126,6 @@
135
126
  .missedIcon,
136
127
  .cancelIcon {
137
128
  width: 8rem;
138
- padding: layout.$spacing-03 layout.$spacing-05 layout.$spacing-03 0;
139
129
  display: flex;
140
130
  align-items: center;
141
131
  height: layout.$spacing-09;
@@ -3,9 +3,9 @@ import useSWR from 'swr';
3
3
  import dayjs from 'dayjs';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { openmrsFetch } from '@openmrs/esm-framework';
6
- import { AppointmentService, Appointment } from '../types';
7
6
  import { useAppointmentDate, mapAppointmentProperties } from '../helpers';
8
7
  import { omrsDateFormat } from '../constants';
8
+ import type { AppointmentService, Appointment } from '../types';
9
9
 
10
10
  export function useTodaysAppointments() {
11
11
  const { t } = useTranslation();
@@ -1,5 +1,5 @@
1
- import { OpenmrsResource } from '@openmrs/esm-framework';
2
- import { amPm } from '../helpers';
1
+ import { type OpenmrsResource } from '@openmrs/esm-framework';
2
+ import { type amPm } from '../helpers';
3
3
 
4
4
  export enum SearchTypes {
5
5
  BASIC = 'basic',
@@ -15,6 +15,7 @@ export interface Appointment {
15
15
  endDateTime: Date | number | any;
16
16
  location: OpenmrsResource;
17
17
  patient: {
18
+ identifier: string;
18
19
  identifiers: Array<Identifier>;
19
20
  name: string;
20
21
  uuid: string;