feat: Internal Notes for bookings (#18804)
* migration + migrate booking limit page to team settings * new pages * use settings toggle for displaying content * get current team presets * update mutation * i18n for settings page * remove redudant await * cancelation UI for select * handle other selection * extract into a util * inital cancelation reason flow * fix i18n to be more readable * add cancel reason logic * nits * improve copy * ensure is teamMember and not isAdmin for getting internalNotes * improvie spacing between elements * fix types * more type fixes * correct types * Update packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts * use input component and remove mb-2 to allign with icon button * Update packages/trpc/server/routers/viewer/teams/updateInternalNotesPresets.handler.ts Co-authored-by: Eunjae Lee <[email protected]> * nits * type fixs * fix type * fix type * fix nullable option lost in merge --------- Co-authored-by: Eunjae Lee <[email protected]>
This commit is contained in:
1 parent
1fd4c3fd4c
commit
656d6dc195
22 files changed
+683
-22
No files matched your search
@@ -193,6 +193,20 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||
}
|
||||
|
||||
const { currentOrgDomain } = orgDomainConfig(context.req);
|
||||
|
||||
async function getInternalNotePresets(teamId: number) {
|
||||
return await prisma.internalNotePreset.findMany({
|
||||
where: {
|
||||
teamId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
cancellationReason: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
props: {
|
||||
orgSlug: currentOrgDomain,
|
||||
@@ -210,6 +224,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||
requiresLoginToUpdate,
|
||||
rescheduledToUid,
|
||||
isLoggedInUserHost,
|
||||
internalNotePresets: eventType?.team?.id ? await getInternalNotePresets(eventType.team.id) : [],
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -771,6 +771,7 @@ export default function Success(props: PageProps) {
|
||||
profile={{ name: props.profile.name, slug: props.profile.slug }}
|
||||
recurringEvent={eventType.recurringEvent}
|
||||
team={eventType?.team?.name}
|
||||
teamId={eventType?.team?.id}
|
||||
setIsCancellationMode={setIsCancellationMode}
|
||||
theme={isSuccessBookingPage ? props.profile.theme : "light"}
|
||||
allRemainingBookings={allRemainingBookings}
|
||||
@@ -778,6 +779,7 @@ export default function Success(props: PageProps) {
|
||||
bookingCancelledEventProps={bookingCancelledEventProps}
|
||||
currentUserEmail={currentUserEmail}
|
||||
isHost={isHost}
|
||||
internalNotePresets={props.internalNotePresets}
|
||||
/>
|
||||
</>
|
||||
))}
|
||||
|
||||
Reference in new issue
Block a user