Hide attendees from calendar description (#6800)
* Show the organizer timezone when booking on seats * Only show organizer in event description * Type fixes * Update snapshot with new response --------- Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Alan <alannnc@gmail.com>pull/6799/head^2
parent
64ede37ad6
commit
4f9aa8bd96
|
@ -1 +1 @@
|
||||||
{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30 min","title":"30 min between Nameless and Test Testson","description":"","additionalNotes":"","customInputs":{},"startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"id":"[redacted/dynamic]","name":"Nameless","email":"[redacted/dynamic]","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"},"attendees":[{"email":"test@example.com","name":"Test Testson","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"}],"location":"[redacted/dynamic]","destinationCalendar":null,"hideCalendarNotes":false,"requiresConfirmation":"[redacted/dynamic]","eventTypeId":"[redacted/dynamic]","seatsShowAttendees":false,"uid":"[redacted/dynamic]","videoCallData":"[redacted/dynamic]","appsStatus":"[redacted/dynamic]","eventTitle":"30 min","eventDescription":null,"price":0,"currency":"usd","length":30,"bookingId":"[redacted/dynamic]","metadata":{"videoCallUrl":"[redacted/dynamic]"},"status":"ACCEPTED","additionalInformation":"[redacted/dynamic]"}}
|
{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30 min","title":"30 min between Nameless and Test Testson","description":"","additionalNotes":"","customInputs":{},"startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"id":"[redacted/dynamic]","name":"Nameless","email":"[redacted/dynamic]","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"},"attendees":[{"email":"test@example.com","name":"Test Testson","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"}],"location":"[redacted/dynamic]","destinationCalendar":null,"hideCalendarNotes":false,"requiresConfirmation":"[redacted/dynamic]","eventTypeId":"[redacted/dynamic]","seatsShowAttendees":false,"seatsPerTimeSlot":null,"uid":"[redacted/dynamic]","videoCallData":"[redacted/dynamic]","appsStatus":"[redacted/dynamic]","eventTitle":"30 min","eventDescription":null,"price":0,"currency":"usd","length":30,"bookingId":"[redacted/dynamic]","metadata":{"videoCallUrl":"[redacted/dynamic]"},"status":"ACCEPTED","additionalInformation":"[redacted/dynamic]"}}
|
|
@ -1543,6 +1543,7 @@
|
||||||
"delete_sso_configuration": "Delete {{connectionType}} configuration",
|
"delete_sso_configuration": "Delete {{connectionType}} configuration",
|
||||||
"delete_sso_configuration_confirmation": "Yes, delete {{connectionType}} configuration",
|
"delete_sso_configuration_confirmation": "Yes, delete {{connectionType}} configuration",
|
||||||
"delete_sso_configuration_confirmation_description": "Are you sure you want to delete the {{connectionType}} configuration? Your team members who use {{connectionType}} login will no longer be able to access Cal.com.",
|
"delete_sso_configuration_confirmation_description": "Are you sure you want to delete the {{connectionType}} configuration? Your team members who use {{connectionType}} login will no longer be able to access Cal.com.",
|
||||||
|
"organizer_timezone": "Organizer timezone",
|
||||||
"email_no_user_cta":"Create your account",
|
"email_no_user_cta":"Create your account",
|
||||||
"email_user_cta":"View Invitation",
|
"email_user_cta":"View Invitation",
|
||||||
"email_no_user_invite_heading":"You’ve been invited to join a team on {{appName}}",
|
"email_no_user_invite_heading":"You’ve been invited to join a team on {{appName}}",
|
||||||
|
|
|
@ -328,6 +328,7 @@ export default class EventManager {
|
||||||
private async createAllCalendarEvents(event: CalendarEvent) {
|
private async createAllCalendarEvents(event: CalendarEvent) {
|
||||||
/** Can I use destinationCalendar here? */
|
/** Can I use destinationCalendar here? */
|
||||||
/* How can I link a DC to a cred? */
|
/* How can I link a DC to a cred? */
|
||||||
|
|
||||||
let createdEvents: EventResult<NewCalendarEventType>[] = [];
|
let createdEvents: EventResult<NewCalendarEventType>[] = [];
|
||||||
if (event.destinationCalendar) {
|
if (event.destinationCalendar) {
|
||||||
if (event.destinationCalendar.credentialId) {
|
if (event.destinationCalendar.credentialId) {
|
||||||
|
|
|
@ -22,6 +22,10 @@ export default class AttendeeScheduledEmail extends BaseEmail {
|
||||||
this.attendee = attendee;
|
this.attendee = attendee;
|
||||||
this.showAttendees = showAttendees;
|
this.showAttendees = showAttendees;
|
||||||
this.t = attendee.language.translate;
|
this.t = attendee.language.translate;
|
||||||
|
|
||||||
|
if (!this.showAttendees) {
|
||||||
|
this.calEvent.attendees = [this.attendee];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getiCalEventAsString(): string | undefined {
|
protected getiCalEventAsString(): string | undefined {
|
||||||
|
|
|
@ -552,6 +552,7 @@ async function handler(req: NextApiRequest & { userId?: number | undefined }) {
|
||||||
requiresConfirmation: requiresConfirmation ?? false,
|
requiresConfirmation: requiresConfirmation ?? false,
|
||||||
eventTypeId: eventType.id,
|
eventTypeId: eventType.id,
|
||||||
seatsShowAttendees: !!eventType.seatsShowAttendees,
|
seatsShowAttendees: !!eventType.seatsShowAttendees,
|
||||||
|
seatsPerTimeSlot: eventType.seatsPerTimeSlot,
|
||||||
};
|
};
|
||||||
|
|
||||||
// For seats, if the booking already exists then we want to add the new attendee to the existing booking
|
// For seats, if the booking already exists then we want to add the new attendee to the existing booking
|
||||||
|
@ -621,10 +622,6 @@ async function handler(req: NextApiRequest & { userId?: number | undefined }) {
|
||||||
|
|
||||||
const newSeat = booking.attendees.length !== 0;
|
const newSeat = booking.attendees.length !== 0;
|
||||||
|
|
||||||
if (!evt.seatsShowAttendees) {
|
|
||||||
evt.attendees = invitee;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remember objects are passed into functions as references
|
* Remember objects are passed into functions as references
|
||||||
* so if you modify it in a inner function it will be modified in the outer function
|
* so if you modify it in a inner function it will be modified in the outer function
|
||||||
|
|
|
@ -17,13 +17,21 @@ ${calEvent.type}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getWhen = (calEvent: CalendarEvent) => {
|
export const getWhen = (calEvent: CalendarEvent) => {
|
||||||
return `
|
return calEvent.seatsPerTimeSlot
|
||||||
|
? `
|
||||||
|
${calEvent.organizer.language.translate("organizer_timezone")}:
|
||||||
|
${calEvent.organizer.timeZone}
|
||||||
|
`
|
||||||
|
: `
|
||||||
${calEvent.organizer.language.translate("invitee_timezone")}:
|
${calEvent.organizer.language.translate("invitee_timezone")}:
|
||||||
${calEvent.attendees[0].timeZone}
|
${calEvent.attendees[0].timeZone}
|
||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getWho = (calEvent: CalendarEvent) => {
|
export const getWho = (calEvent: CalendarEvent) => {
|
||||||
|
if (calEvent.seatsPerTimeSlot && !calEvent.seatsShowAttendees) {
|
||||||
|
calEvent.attendees = [];
|
||||||
|
}
|
||||||
const attendees = calEvent.attendees
|
const attendees = calEvent.attendees
|
||||||
.map((attendee) => {
|
.map((attendee) => {
|
||||||
return `
|
return `
|
||||||
|
|
|
@ -155,6 +155,7 @@ export interface CalendarEvent {
|
||||||
eventTypeId?: number | null;
|
eventTypeId?: number | null;
|
||||||
appsStatus?: AppsStatus[];
|
appsStatus?: AppsStatus[];
|
||||||
seatsShowAttendees?: boolean | null;
|
seatsShowAttendees?: boolean | null;
|
||||||
|
seatsPerTimeSlot?: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EntryPoint {
|
export interface EntryPoint {
|
||||||
|
|
Loading…
Reference in New Issue