From 0aa0cf93b3f9e3153592684ce05babee2e0c5379 Mon Sep 17 00:00:00 2001 From: Jack Meyer Date: Tue, 19 May 2020 23:15:49 -0500 Subject: [PATCH] feat(careplan): adds ability to add a new care plan --- .../input/SelectWithLableFormGroup.tsx | 25 ++- .../enUs/translations/patient/index.ts | 12 ++ src/model/CarePlan.ts | 28 +++ src/model/Patient.ts | 2 + src/model/Permissions.ts | 2 + src/patients/care-plans/AddCarePlanModal.tsx | 197 ++++++++++++++++++ src/patients/care-plans/CarePlanTab.tsx | 70 +++++++ src/patients/patient-slice.ts | 31 +++ src/patients/view/ViewPatient.tsx | 9 + src/user/user-slice.ts | 2 + 10 files changed, 375 insertions(+), 3 deletions(-) create mode 100644 src/model/CarePlan.ts create mode 100644 src/patients/care-plans/AddCarePlanModal.tsx create mode 100644 src/patients/care-plans/CarePlanTab.tsx diff --git a/src/components/input/SelectWithLableFormGroup.tsx b/src/components/input/SelectWithLableFormGroup.tsx index be9874aca1..fff067037c 100644 --- a/src/components/input/SelectWithLableFormGroup.tsx +++ b/src/components/input/SelectWithLableFormGroup.tsx @@ -10,18 +10,37 @@ interface Props { value: string label: string name: string + isRequired?: boolean isEditable?: boolean options: Option[] onChange?: (event: React.ChangeEvent) => void + feedback?: string + isInvalid?: boolean } const SelectWithLabelFormGroup = (props: Props) => { - const { value, label, name, isEditable, options, onChange } = props + const { + value, + label, + name, + isEditable, + options, + onChange, + isRequired, + feedback, + isInvalid, + } = props const id = `${name}Select` return (
-
) diff --git a/src/user/user-slice.ts b/src/user/user-slice.ts index afcb489b76..c48dd0bc2a 100644 --- a/src/user/user-slice.ts +++ b/src/user/user-slice.ts @@ -25,6 +25,8 @@ const initialState: UserState = { Permissions.ViewIncident, Permissions.ViewIncidents, Permissions.ReportIncident, + Permissions.AddCarePlan, + Permissions.ReadCarePlan ], user: { id: 'some-hardcoded-id',