Skip to content

Commit

Permalink
(fix) fix failing procedure form and update peer dependeny
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldkibet committed Jul 5, 2024
1 parent df30976 commit 3ae7349
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"dependencies": {
"@carbon/react": "^1.33.1",
"@hookform/resolvers": "^3.3.4",
"@openmrs/esm-patient-common-lib": "^8.0.1",
"fuzzy": "^0.1.3",
"lodash-es": "^4.17.21",
"react-hook-form": "^7.51.1",
Expand All @@ -57,6 +56,7 @@
},
"peerDependencies": {
"@openmrs/esm-framework": "*",
"@openmrs/esm-patient-common-lib": "8.x",
"dayjs": "1.x",
"react": "18.x",
"react-i18next": "11.x",
Expand Down
21 changes: 14 additions & 7 deletions src/form/post-procedures/post-procedure-form.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { closeOverlay } from "../../components/overlay/hook";
import { type ConfigObject, StringPath } from "../../config-schema";
import { updateOrder } from "../../procedures-ordered/pick-procedure-order/add-to-worklist-dialog.resource";
import { mutate } from "swr";
import { closeWorkspace } from "@openmrs/esm-patient-common-lib";

Check warning on line 40 in src/form/post-procedures/post-procedure-form.component.tsx

View workflow job for this annotation

GitHub Actions / build

'closeWorkspace' is defined but never used

const validationSchema = z.object({
startDatetime: z.date({ required_error: "Start datetime is required" }),
Expand Down Expand Up @@ -260,9 +261,12 @@ const PostProcedureForm: React.FC<PostProcedureFormProps> = ({
value={value}
id="startDatetime"
labelText={t("startDatetime", "Start Datetime")}
onChange={onChange}
invalid={!!errors.startDatetime}
invalidText={errors.startDatetime?.message}
onChange={(calendar) =>
onChange(
new Date(calendar.year, calendar.month, calendar.day, 0, 0)
)
}
isInvalid={!!errors.startDatetime}
/>
)}
/>
Expand All @@ -276,9 +280,12 @@ const PostProcedureForm: React.FC<PostProcedureFormProps> = ({
value={value}
id="endDatetime"
labelText={t("endDatetime", "End Datetime")}
onChange={onChange}
invalid={!!errors.endDatetime}
invalidText={errors.endDatetime?.message}
onChange={(calendar) =>
onChange(
new Date(calendar.year, calendar.month, calendar.day, 0, 0)
)
}
isInvalid={!!errors.endDatetime}
/>
)}
/>
Expand Down Expand Up @@ -500,7 +507,7 @@ const PostProcedureForm: React.FC<PostProcedureFormProps> = ({
</Layer>
</Stack>
<ButtonSet className={styles.buttonSetContainer}>
<Button size="lg" kind="secondary">
<Button onClick={() => closeOverlay()} size="lg" kind="secondary">
{t("discard", "Discard")}
</Button>
<Button type="submit" size="lg" kind="primary">
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4945,6 +4945,7 @@ __metadata:
zod: ^3.22.4
peerDependencies:
"@openmrs/esm-framework": "*"
"@openmrs/esm-patient-common-lib": 8.x
dayjs: 1.x
react: 18.x
react-i18next: 11.x
Expand Down

0 comments on commit 3ae7349

Please sign in to comment.