@openmrs/esm-appointments-app 5.2.2-pre.2441 → 5.2.2-pre.2447

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 (57) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/dist/{755.js → 799.js} +1 -1
  3. package/dist/799.js.map +1 -0
  4. package/dist/main.js +1 -1
  5. package/dist/main.js.map +1 -1
  6. package/dist/openmrs-esm-appointments-app.js +1 -1
  7. package/dist/openmrs-esm-appointments-app.js.buildmanifest.json +28 -28
  8. package/dist/routes.json +1 -1
  9. package/package.json +1 -1
  10. package/src/admin/appointment-services/appointment-services.component.tsx +1 -1
  11. package/src/appointments/appointment-tabs.component.tsx +2 -2
  12. package/src/appointments/appointment-tabs.test.tsx +4 -4
  13. package/src/appointments/common-components/appointments-actions.component.tsx +4 -2
  14. package/src/appointments/common-components/appointments-actions.test.tsx +1 -1
  15. package/src/appointments/common-components/appointments-table.component.tsx +2 -2
  16. package/src/appointments/common-components/appointments-table.test.tsx +1 -1
  17. package/src/appointments/common-components/checkin-button.component.tsx +1 -1
  18. package/src/appointments/details/appointment-details.component.tsx +1 -1
  19. package/src/appointments/forms/cancel-form/cancel-appointment.component.tsx +1 -1
  20. package/src/appointments/forms/cancel-form/cancel-appointment.test.tsx +3 -3
  21. package/src/appointments/forms/create-edit-form/appointments-form.component.tsx +5 -5
  22. package/src/appointments/forms/create-edit-form/appointments-form.test.tsx +14 -9
  23. package/src/appointments/forms/{useInitialFormValues.tsx → useInitialFormValues.ts} +3 -3
  24. package/src/appointments/unscheduled/unscheduled-appointments.component.tsx +1 -1
  25. package/src/appointments-calendar/calendar-view.component.tsx +1 -1
  26. package/src/appointments-calendar/daily/daily-calendar-view.component.tsx +2 -2
  27. package/src/appointments-calendar/daily/daily-header.component.tsx +2 -2
  28. package/src/appointments-calendar/daily/daily-view-workload.component.tsx +3 -3
  29. package/src/appointments-calendar/daily/daily-view-workload.test.tsx +1 -1
  30. package/src/appointments-calendar/monthly/monthly-calendar-view.component.tsx +2 -2
  31. package/src/appointments-calendar/monthly/monthly-header.module.tsx +3 -5
  32. package/src/appointments-calendar/weekly/weekly-calendar-view.component.tsx +4 -4
  33. package/src/appointments-calendar/weekly/weekly-header.component.tsx +5 -5
  34. package/src/appointments-calendar/weekly/weekly-view-workload.component.tsx +4 -4
  35. package/src/appointments-calendar/weekly/weekly-view-workload.test.tsx +1 -1
  36. package/src/appointments-metrics/appointments-metrics.test.tsx +8 -10
  37. package/src/appointments.test.tsx +6 -4
  38. package/src/createDashboardLink.component.tsx +5 -6
  39. package/src/home-appointments/appointments-list.component.tsx +2 -2
  40. package/src/home-appointments/appointments-list.test.tsx +3 -3
  41. package/src/hooks/{useAppointmentList.tsx → useAppointmentList.ts} +1 -1
  42. package/src/hooks/{useAppointmentService.tsx → useAppointmentService.ts} +1 -1
  43. package/src/hooks/{useAppointments.tsx → useAppointments.ts} +1 -1
  44. package/src/hooks/{useAppointmentsCalendar.tsx → useAppointmentsCalendar.ts} +1 -1
  45. package/src/hooks/{useClinicalMetrics.tsx → useClinicalMetrics.ts} +1 -1
  46. package/src/hooks/{useDefaultLocation.tsx → useDefaultLocation.ts} +1 -1
  47. package/src/hooks/{usePatientAppointmentHistory.tsx → usePatientAppointmentHistory.ts} +1 -1
  48. package/src/hooks/{useProviders.tsx → useProviders.ts} +1 -1
  49. package/src/hooks/{useUnscheduledAppointments.tsx → useUnscheduledAppointments.ts} +2 -2
  50. package/src/hooks/{useVisits.tsx → useVisits.ts} +1 -1
  51. package/src/overlay.component.tsx +2 -2
  52. package/src/past-visit/encounter-list.component.tsx +1 -1
  53. package/src/past-visit/past-visit.component.tsx +2 -2
  54. package/src/patient-queue/visit-form/visit-form.component.tsx +3 -3
  55. package/tsconfig.json +1 -1
  56. package/dist/755.js.map +0 -1
  57. /package/src/hooks/{useServiceQueus.tsx → useServiceQueus.ts} +0 -0
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import dayjs from 'dayjs';
3
3
  import userEvent from '@testing-library/user-event';
4
4
  import { render, screen } from '@testing-library/react';
5
- import { CalendarType } from '../../types';
5
+ import { type CalendarType } from '../../types';
6
6
  import { spaBasePath } from '../../constants';
7
7
  import { navigate } from '@openmrs/esm-framework';
8
8
  import WeeklyWorkloadView from './weekly-view-workload.component';
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
- import { act, render, screen } from '@testing-library/react';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import { openmrsFetch } from '@openmrs/esm-framework';
4
- import { mockAppointmentMetrics, mockProvidersCount, mockStartTime } from '../../../../__mocks__/appointments.mock';
4
+ import { mockAppointmentMetrics, mockProvidersCount, mockStartTime } from '__mocks__';
5
5
  import AppointmentsMetrics from './appointments-metrics.component';
6
6
 
7
7
  const mockedOpenmrsFetch = openmrsFetch as jest.Mock;
8
8
 
9
9
  jest.mock('../hooks/useClinicalMetrics', () => {
10
- const originalModule = jest.requireActual('../hooks/useClinicalMetrics.tsx');
10
+ const originalModule = jest.requireActual('../hooks/useClinicalMetrics');
11
11
 
12
12
  return {
13
13
  ...originalModule,
@@ -36,13 +36,11 @@ describe('Appointment metrics', () => {
36
36
 
37
37
  renderAppointmentMetrics();
38
38
 
39
- await act(() => {
40
- expect(screen.getByText(/appointment metrics/i)).toBeInTheDocument();
41
- expect(screen.getByText(/scheduled appointments/i)).toBeInTheDocument();
42
- expect(screen.getByText(/patients/i)).toBeInTheDocument();
43
- expect(screen.getByText(/16/i)).toBeInTheDocument();
44
- expect(screen.getByText(/4/i)).toBeInTheDocument();
45
- });
39
+ await screen.findByText(/appointment metrics/i);
40
+ expect(screen.getByText(/scheduled appointments/i)).toBeInTheDocument();
41
+ expect(screen.getByText(/patients/i)).toBeInTheDocument();
42
+ expect(screen.getByText(/16/i)).toBeInTheDocument();
43
+ expect(screen.getByText(/4/i)).toBeInTheDocument();
46
44
  });
47
45
  });
48
46
 
@@ -2,12 +2,14 @@ import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import ClinicalAppointments from './appointments.component';
4
4
 
5
- describe('ClinicalAppointments Component', () => {
5
+ describe('Clinical Appointments', () => {
6
6
  it('should render correctly', () => {
7
7
  render(<ClinicalAppointments />);
8
8
 
9
- expect(screen.getByTestId('appointments-header')).toBeInTheDocument();
10
- expect(screen.getByTestId('clinic-metrics')).toBeInTheDocument();
11
- expect(screen.getByTestId('appointment-list')).toBeInTheDocument();
9
+ expect(screen.getByTitle(/patient queue illustration/i)).toBeInTheDocument();
10
+ expect(screen.getByText(/^appointments$/i)).toBeInTheDocument();
11
+ expect(screen.getByText(/home/i)).toBeInTheDocument();
12
+ expect(screen.getByPlaceholderText(/DD-MMM-YYYY/i)).toBeInTheDocument();
13
+ expect(screen.getByRole('button', { name: /appointments calendar/i })).toBeInTheDocument();
12
14
  });
13
15
  });
@@ -32,9 +32,8 @@ function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: Dash
32
32
  );
33
33
  }
34
34
 
35
- export const createDashboardLink = (dashboardLinkConfig: DashboardLinkConfig) => () =>
36
- (
37
- <BrowserRouter>
38
- <DashboardExtension dashboardLinkConfig={dashboardLinkConfig} />
39
- </BrowserRouter>
40
- );
35
+ export const createDashboardLink = (dashboardLinkConfig: DashboardLinkConfig) => () => (
36
+ <BrowserRouter>
37
+ <DashboardExtension dashboardLinkConfig={dashboardLinkConfig} />
38
+ </BrowserRouter>
39
+ );
@@ -31,10 +31,10 @@ import { ActionsMenu } from './appointment-actions.component';
31
31
  import { EmptyDataIllustration } from './empty-data-illustration.component';
32
32
  import { launchCheckInAppointmentModal, handleComplete } from './common';
33
33
  import { SeeAllAppointmentsLink, AddAppointmentLink, ViewCalendarLink } from './links.component';
34
- import { Appointment, MappedHomeAppointment } from '../types';
34
+ import { type Appointment, type MappedHomeAppointment } from '../types';
35
35
  import { useTodaysAppointments } from './appointments-table.resource';
36
36
  import styles from './appointments-list.scss';
37
- import { ConfigObject } from '../config-schema';
37
+ import { type ConfigObject } from '../config-schema';
38
38
 
39
39
  interface PaginationData {
40
40
  goTo: (page: number) => void;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
- import AppointmentsBaseTable from './appointments-list.component';
4
- import { mockSession } from '../../../../__mocks__/session.mock';
5
- import { useTodaysAppointments } from './appointments-table.resource';
3
+ import { mockSession } from '__mocks__';
6
4
  import { usePagination } from '@openmrs/esm-framework';
5
+ import { useTodaysAppointments } from './appointments-table.resource';
6
+ import AppointmentsBaseTable from './appointments-list.component';
7
7
 
8
8
  const useTodaysAppointmentsMock = useTodaysAppointments as jest.Mock;
9
9
  const usePaginationMock = usePagination as jest.Mock;
@@ -1,6 +1,6 @@
1
1
  import useSWR from 'swr';
2
2
  import { openmrsFetch } from '@openmrs/esm-framework';
3
- import { AppointmentService, Identifier, Provider } from '../types';
3
+ import { type AppointmentService, type Identifier, type Provider } from '../types';
4
4
  import { useAppointmentDate } from '../helpers';
5
5
  import dayjs from 'dayjs';
6
6
  import { configSchema } from '../config-schema';
@@ -1,6 +1,6 @@
1
1
  import { openmrsFetch } from '@openmrs/esm-framework';
2
2
  import useSWR from 'swr';
3
- import { AppointmentService } from '../types';
3
+ import { type AppointmentService } from '../types';
4
4
 
5
5
  export function useAppointmentServices() {
6
6
  const { data, error, isLoading } = useSWR<{ data: Array<AppointmentService> }>(
@@ -2,7 +2,7 @@ import { openmrsFetch } from '@openmrs/esm-framework';
2
2
  import dayjs from 'dayjs';
3
3
  import useSWR from 'swr';
4
4
  import { omrsDateFormat } from '../constants';
5
- import { Appointment, DurationPeriod } from '../types';
5
+ import { type Appointment, DurationPeriod } from '../types';
6
6
 
7
7
  interface AppointmentsReturnType {
8
8
  isLoading: boolean;
@@ -1,4 +1,4 @@
1
- import { openmrsFetch, OpenmrsResource } from '@openmrs/esm-framework';
1
+ import { openmrsFetch, type OpenmrsResource } from '@openmrs/esm-framework';
2
2
  import dayjs from 'dayjs';
3
3
  import useSWR from 'swr';
4
4
  import { omrsDateFormat } from '../constants';
@@ -2,7 +2,7 @@ import useSWR from 'swr';
2
2
  import dayjs from 'dayjs';
3
3
  import uniqBy from 'lodash-es/uniqBy';
4
4
  import { openmrsFetch } from '@openmrs/esm-framework';
5
- import { Appointment, AppointmentSummary } from '../types';
5
+ import { type Appointment, type AppointmentSummary } from '../types';
6
6
  import { omrsDateFormat } from '../constants';
7
7
  import {
8
8
  getHighestAppointmentServiceLoad,
@@ -1,4 +1,4 @@
1
- import { FetchResponse, openmrsFetch, useConfig } from '@openmrs/esm-framework';
1
+ import { type FetchResponse, openmrsFetch, useConfig } from '@openmrs/esm-framework';
2
2
  import useSWRImmutable from 'swr/immutable';
3
3
 
4
4
  export const useDefaultLoginLocation = () => {
@@ -1,5 +1,5 @@
1
1
  import { openmrsFetch } from '@openmrs/esm-framework';
2
- import { AppointmentsFetchResponse } from '../types';
2
+ import { type AppointmentsFetchResponse } from '../types';
3
3
  import useSWR from 'swr';
4
4
  import dayjs from 'dayjs';
5
5
  import { useAppointmentDate } from '../helpers';
@@ -1,6 +1,6 @@
1
1
  import { openmrsFetch } from '@openmrs/esm-framework';
2
2
  import useSWR from 'swr';
3
- import { Provider } from '../types';
3
+ import { type Provider } from '../types';
4
4
 
5
5
  export function useProviders() {
6
6
  const apiUrl = `/ws/rest/v1/provider`;
@@ -1,7 +1,7 @@
1
1
  import { openmrsFetch } from '@openmrs/esm-framework';
2
2
  import useSWR from 'swr';
3
- import { mapAppointmentProperties, useAppointmentDate } from '../helpers';
4
- import { Identifier } from '../types';
3
+ import { useAppointmentDate } from '../helpers';
4
+ import { type Identifier } from '../types';
5
5
  import { configSchema } from '../config-schema';
6
6
 
7
7
  export interface Response {
@@ -1,5 +1,5 @@
1
1
  import useSWR from 'swr';
2
- import { useSession, Visit, openmrsFetch } from '@openmrs/esm-framework';
2
+ import { useSession, type Visit, openmrsFetch } from '@openmrs/esm-framework';
3
3
  import dayjs from 'dayjs';
4
4
  import { useAppointmentDate } from '../helpers';
5
5
 
@@ -11,7 +11,7 @@ const Overlay: React.FC = () => {
11
11
  const overlayClass = layout !== 'tablet' ? styles.desktopOverlay : styles.tabletOverlay;
12
12
  return (
13
13
  <>
14
- {isOverlayOpen && (
14
+ {isOverlayOpen ? (
15
15
  <div className={overlayClass}>
16
16
  {layout === 'tablet' && (
17
17
  <Header onClick={() => closeOverlay()} aria-label="Tablet overlay" className={styles.tabletOverlayHeader}>
@@ -32,7 +32,7 @@ const Overlay: React.FC = () => {
32
32
  )}
33
33
  {component}
34
34
  </div>
35
- )}
35
+ ) : null}
36
36
  </>
37
37
  );
38
38
  };
@@ -9,7 +9,7 @@ import {
9
9
  } from '@carbon/react';
10
10
  import { useTranslation } from 'react-i18next';
11
11
  import { formatDatetime, parseDate } from '@openmrs/esm-framework';
12
- import { FormattedEncounter } from './past-visit.component';
12
+ import { type FormattedEncounter } from './past-visit.component';
13
13
  import styles from './past-visit.scss';
14
14
 
15
15
  interface EncounterListProps {
@@ -2,8 +2,8 @@ import React, { useState } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { StructuredListSkeleton, Tab, Tabs } from '@carbon/react';
5
- import { formatDate, OpenmrsResource, parseDate, useLayoutType } from '@openmrs/esm-framework';
6
- import { Observation } from '../types';
5
+ import { formatDate, type OpenmrsResource, parseDate, useLayoutType } from '@openmrs/esm-framework';
6
+ import { type Observation } from '../types';
7
7
  import { usePastVisits } from './past-visit.resource';
8
8
  import EncounterList from './encounter-list.component';
9
9
  import styles from './past-visit.scss';
@@ -25,7 +25,7 @@ import {
25
25
  ExtensionSlot,
26
26
  useLayoutType,
27
27
  useVisitTypes,
28
- NewVisitPayload,
28
+ type NewVisitPayload,
29
29
  saveVisit,
30
30
  toOmrsIsoString,
31
31
  toDateObjectStrict,
@@ -37,10 +37,10 @@ import {
37
37
  } from '@openmrs/esm-framework';
38
38
  import isEmpty from 'lodash-es/isEmpty';
39
39
  import BaseVisitType from './base-visit-type.component';
40
- import { amPm, convertTime12to24, useAppointmentDate } from '../../helpers';
40
+ import { type amPm, convertTime12to24, useAppointmentDate } from '../../helpers';
41
41
  import { closeOverlay } from '../../hooks/useOverlay';
42
42
  import { saveQueueEntry } from './queue.resource';
43
- import { MappedAppointment } from '../../types';
43
+ import { type MappedAppointment } from '../../types';
44
44
  import { useAppointments } from '../../appointments/appointments-table.resource';
45
45
  import { useDefaultLoginLocation } from '../../hooks/useDefaultLocation';
46
46
  import { useVisits } from '../../hooks/useVisits';
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "extends": "../../tsconfig.json",
3
3
  "include": ["src/**/*"],
4
- "exclude": ["src/**/*.test.tsx", "src/**/*.outdated.tsx"]
4
+ "exclude": ["src/**/*.test.tsx"]
5
5
  }