Adding checkbox to toggle hideNotes (#2310)

This commit is contained in:
sean-brydon 2022-03-29 17:59:22 +01:00 committed by GitHub
parent 80af5dd236
commit 6b0e8db496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -424,6 +424,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
schedulingType: SchedulingType | null;
price: number;
hidden: boolean;
hideCalendarNotes: boolean;
locations: { type: LocationType; address?: string; link?: string }[];
customInputs: EventTypeCustomInput[];
users: string[];
@ -1228,6 +1229,24 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
</div>
</div>
<Controller
name="hideCalendarNotes"
control={formMethods.control}
defaultValue={eventType.hideCalendarNotes}
render={() => (
<CheckboxField
id="hideCalendarNotes"
name="hideCalendarNotes"
label={t("disable_notes")}
description={t("disable_notes_description")}
defaultChecked={eventType.hideCalendarNotes}
onChange={(e) => {
formMethods.setValue("hideCalendarNotes", e?.target.checked);
}}
/>
)}
/>
<Controller
name="requiresConfirmation"
control={formMethods.control}
@ -1873,6 +1892,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
periodEndDate: true,
periodCountCalendarDays: true,
requiresConfirmation: true,
hideCalendarNotes: true,
disableGuests: true,
minimumBookingNotice: true,
beforeEventBuffer: true,