Files
cal.diy/companion/utils/defaultLocations.ts
T
Everton Resende a71d62dc33 fix(ui): change phone booking display from Organizer Phone Number to Phone Call (#27636)
* fix(ui): change phone booking display from Organizer Phone Number to Phone Call

The label \"Organizer Phone Number\" was confusing for attendees on the
booking page, as it exposed internal terminology. Replaced with the
more user-friendly \"Phone Call\" label across the booking UI, companion
app, and test assertions.

Closes #13010

* fix: remove duplicate phone_call i18n key

The phone_call key already existed in en/common.json (line 1685,
Cal.ai Voice Agent section). Removed the duplicate entry we added.

Found by ai-codex review.
2026-02-06 15:28:38 +00:00

98 lines
2.9 KiB
TypeScript

/**
* Default location types that are available alongside conferencing apps
* These match the pattern from packages/app-store/locations.ts
*/
export enum DefaultLocationType {
AttendeeInPerson = "attendeeInPerson",
InPerson = "inPerson",
Phone = "phone",
UserPhone = "userPhone",
Link = "link",
Conferencing = "conferencing",
SomewhereElse = "somewhereElse",
}
export type DefaultLocation = {
type: DefaultLocationType;
label: string;
iconUrl: string;
category: "in person" | "conferencing" | "other" | "phone";
organizerInputType?: "text" | "phone" | null;
organizerInputPlaceholder?: string;
organizerInputLabel?: string;
messageForOrganizer?: string;
};
/**
* Default locations available in Cal.com
* Icons are served from https://app.cal.com/{iconPath}
*/
export const defaultLocations: DefaultLocation[] = [
{
type: DefaultLocationType.AttendeeInPerson,
label: "In Person (Attendee Address)",
iconUrl: "https://app.cal.com/map-pin-dark.svg",
category: "in person",
},
{
type: DefaultLocationType.SomewhereElse,
label: "Custom Attendee Location",
iconUrl: "https://app.cal.com/message-pin.svg",
category: "other",
},
{
type: DefaultLocationType.InPerson,
label: "In Person (Organizer Address)",
iconUrl: "https://app.cal.com/map-pin-dark.svg",
category: "in person",
organizerInputType: "text",
organizerInputPlaceholder: "Enter address or place",
organizerInputLabel: "Address",
messageForOrganizer: "Provide an Address or Place",
},
{
type: DefaultLocationType.Link,
label: "Link Meeting",
iconUrl: "https://app.cal.com/link.svg",
category: "other",
organizerInputType: "text",
organizerInputPlaceholder: "https://meet.example.com/join/123456",
organizerInputLabel: "Meeting Link",
messageForOrganizer: "Provide a Meeting Link",
},
{
type: DefaultLocationType.Phone,
label: "Attendee Phone Number",
iconUrl: "https://app.cal.com/phone.svg",
category: "phone",
organizerInputType: null,
messageForOrganizer: "Cal will ask your invitee to enter a phone number before scheduling.",
},
{
type: DefaultLocationType.UserPhone,
label: "Phone Call",
iconUrl: "https://app.cal.com/phone.svg",
category: "phone",
organizerInputType: "phone",
organizerInputPlaceholder: "Enter phone number",
organizerInputLabel: "Phone Number",
messageForOrganizer: "Provide your phone number with country code",
},
];
/**
* Get icon URL for a default location type
*/
export function getDefaultLocationIconUrl(locationType: string): string | null {
const location = defaultLocations.find((loc) => loc.type === locationType);
return location ? location.iconUrl : null;
}
/**
* Check if a location type is a default location (not a conferencing app)
*/
export function isDefaultLocation(locationType: string): boolean {
return defaultLocations.some((loc) => loc.type === locationType);
}