From 4c0b8fec526d8aa3730ca550db70dbdd01d593e3 Mon Sep 17 00:00:00 2001 From: Jesus Soto Date: Thu, 12 Mar 2020 10:47:49 -0500 Subject: [PATCH] feat: added successful alert when adding new appointments Added successful alert when adding new appointments. Replicated successful alert from new patients process and added the successful property on the translation file re #1894 --- src/locales/enUs/translations/scheduling/index.ts | 1 + src/scheduling/appointments/new/NewAppointment.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/locales/enUs/translations/scheduling/index.ts b/src/locales/enUs/translations/scheduling/index.ts index b6cd4f627a..1fd39fe511 100644 --- a/src/locales/enUs/translations/scheduling/index.ts +++ b/src/locales/enUs/translations/scheduling/index.ts @@ -17,6 +17,7 @@ export default { routine: 'Routine', walkUp: 'Walk Up', }, + successfullyCreated: 'Appointment successfully created.', errors: { patientRequired: 'Patient is required.', errorCreatingAppointment: 'Error Creating Appointment!', diff --git a/src/scheduling/appointments/new/NewAppointment.tsx b/src/scheduling/appointments/new/NewAppointment.tsx index b0dddfc7a4..bde5a108d5 100644 --- a/src/scheduling/appointments/new/NewAppointment.tsx +++ b/src/scheduling/appointments/new/NewAppointment.tsx @@ -7,7 +7,7 @@ import { useDispatch } from 'react-redux' import Appointment from 'model/Appointment' import addMinutes from 'date-fns/addMinutes' import { isBefore } from 'date-fns' -import { Button } from '@hospitalrun/components' +import { Button, Toast } from '@hospitalrun/components' import useAddBreadcrumbs from '../../../breadcrumbs/useAddBreadcrumbs' import { createAppointment } from '../appointment-slice' import AppointmentDetailForm from '../AppointmentDetailForm' @@ -42,6 +42,11 @@ const NewAppointment = () => { const onNewAppointmentSaveSuccess = (newAppointment: Appointment) => { history.push(`/appointments/${newAppointment.id}`) + Toast( + 'success', + t('Success!'), + `${t('scheduling.appointment.successfullyCreated')} ${newAppointment.id}`, + ) } const onSave = () => {