Skip to content

Commit

Permalink
Merge branch 'main' into fix/registration-form-touched-fields
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen authored Sep 21, 2024
2 parents ab68d64 + 42c3c4b commit 877cc91
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useEffect, useState } from 'react';
import dayjs from 'dayjs';
import { useParams } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { useAppointmentsCalendar } from '../hooks/useAppointmentsCalendar';
import AppointmentsHeader from '../header/appointments-header.component';
import CalendarHeader from './header/calendar-header.component';
import MonthlyCalendarView from './monthly/monthly-calendar-view.component';
import SelectedDateContext from '../hooks/selectedDateContext';
import { useParams } from 'react-router-dom';
import { omrsDateFormat } from '../constants';

const AppointmentsCalendarView: React.FC = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React, { useContext } from 'react';
import dayjs from 'dayjs';
import { useTranslation } from 'react-i18next';
import { Button } from '@carbon/react';
import { ArrowLeft } from '@carbon/react/icons';
import { navigate } from '@openmrs/esm-framework';
import { spaHomePage } from '../../constants';
import styles from './calendar-header.scss';
import SelectedDateContext from '../../hooks/selectedDateContext';
import dayjs from 'dayjs';
import styles from './calendar-header.scss';

const CalendarHeader: React.FC = () => {
const { t } = useTranslation();
const { selectedDate } = useContext(SelectedDateContext);
const backButtonOnClick = () => {

const handleClick = () => {
navigate({ to: `${spaHomePage}/appointments/${dayjs(selectedDate).format('YYYY-MM-DD')}` });
};

Expand All @@ -20,10 +21,10 @@ const CalendarHeader: React.FC = () => {
<div className={styles.titleContainer}>
<Button
className={styles.backButton}
iconDescription={t('back', 'Back')}
kind="ghost"
onClick={backButtonOnClick}
onClick={handleClick}
renderIcon={ArrowLeft}
iconDescription={t('back', 'Back')}
size="lg">
<span>{t('back', 'Back')}</span>
</Button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { useContext, useMemo } from 'react';
import classNames from 'classnames';
import dayjs, { type Dayjs } from 'dayjs';
import { User } from '@carbon/react/icons';
import { navigate, useLayoutType } from '@openmrs/esm-framework';
import { isSameMonth } from '../../helpers';
import { spaHomePage } from '../../constants';
import styles from './monthly-view-workload.scss';
import { isSameMonth } from '../../helpers';
import { type DailyAppointmentsCountByService } from '../../types';
import SelectedDateContext from '../../hooks/selectedDateContext';
import { User } from '@carbon/react/icons';
import MonthlyWorkloadViewExpanded from './monthly-workload-view-expanded.component';
import styles from './monthly-view-workload.scss';

export interface MonthlyWorkloadViewProps {
events: Array<DailyAppointmentsCountByService>;
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-appointments-app/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const spaRoot = window['getOpenmrsSpaBase'];
export const basePath = '/appointments';
export const spaHomePage = ` ${window.getOpenmrsSpaBase()}home`;
export const spaHomePage = `${window.spaBase}/home`;
export const omrsDateFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZZ';
export const appointmentLocationTagName = 'Appointment Location';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React, { useContext } from 'react';
import dayjs from 'dayjs';
import isToday from 'dayjs/plugin/isToday';
import { launchWorkspace } from '@openmrs/esm-framework';
import { useTranslation } from 'react-i18next';
import { Calendar, Hospital } from '@carbon/react/icons';
import { Button } from '@carbon/react';
import { ExtensionSlot, isDesktop, navigate, useLayoutType } from '@openmrs/esm-framework';
import { ExtensionSlot, isDesktop, launchWorkspace, navigate, useLayoutType } from '@openmrs/esm-framework';
import { spaHomePage } from '../constants';
import styles from './metrics-header.scss';
import SelectedDateContext from '../hooks/selectedDateContext';
import styles from './metrics-header.scss';

dayjs.extend(isToday);

Expand Down Expand Up @@ -39,7 +38,7 @@ const MetricsHeader: React.FC = () => {
onClick={() =>
navigate({ to: `${spaHomePage}/appointments/calendar/${dayjs(selectedDate).format('YYYY-MM-DD')}` })
}>
{t('appointmentsCalendar', 'Appointments Calendar')}
{t('appointmentsCalendar', 'Appointments calendar')}
</Button>
<ExtensionSlot
name="patient-search-button-slot"
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-appointments-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"appointments": "Appointments",
"Appointments": "Appointments",
"appointments_lower": "appointments",
"appointmentsCalendar": "Appointments Calendar",
"appointmentsCalendar": "Appointments calendar",
"appointmentScheduled": "Appointment scheduled",
"appointmentService": "Appointment service",
"appointmentServiceCreate": "Appointment service created successfully",
Expand Down

0 comments on commit 877cc91

Please sign in to comment.