Adding checkbox to toggle hideNotes (#2310)

This commit is contained in:
sean-brydon authored and GitHub committed 2022-03-29 09:59:22 -07:00
1 parent 80af5dd236
commit 6b0e8db496
1 file changed
+20
+20
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,