2022-04-05 18:03:22 +00:00
|
|
|
export enum DefaultLocationType {
|
2022-02-15 20:30:52 +00:00
|
|
|
InPerson = "inPerson",
|
|
|
|
Phone = "phone",
|
2022-05-16 15:50:12 +00:00
|
|
|
UserPhone = "userPhone",
|
2022-03-13 15:56:56 +00:00
|
|
|
Link = "link",
|
2022-04-05 18:03:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** If your App has a location option, add it here */
|
|
|
|
export enum AppStoreLocationType {
|
2022-02-15 20:30:52 +00:00
|
|
|
GoogleMeet = "integrations:google:meet",
|
|
|
|
Zoom = "integrations:zoom",
|
|
|
|
Daily = "integrations:daily",
|
|
|
|
Jitsi = "integrations:jitsi",
|
|
|
|
Huddle01 = "integrations:huddle01",
|
|
|
|
Tandem = "integrations:tandem",
|
2022-03-23 22:00:30 +00:00
|
|
|
Teams = "integrations:office365_video",
|
2022-02-15 20:30:52 +00:00
|
|
|
}
|
2022-04-05 18:03:22 +00:00
|
|
|
|
2022-05-25 20:34:08 +00:00
|
|
|
export type LocationObject = {
|
|
|
|
type: LocationType;
|
|
|
|
address?: string;
|
|
|
|
link?: string;
|
|
|
|
displayLocationPublicly?: boolean;
|
|
|
|
hostPhoneNumber?: string;
|
|
|
|
};
|
|
|
|
|
2022-04-05 18:03:22 +00:00
|
|
|
export const LocationType = { ...DefaultLocationType, ...AppStoreLocationType };
|
|
|
|
export type LocationType = DefaultLocationType | AppStoreLocationType;
|
2022-05-25 20:34:08 +00:00
|
|
|
|
|
|
|
export const locationHiddenFilter = (locations: LocationObject[]) =>
|
|
|
|
locations.filter((el) => {
|
|
|
|
// Filter out locations that are not to be displayed publicly
|
|
|
|
const values = Object.values(AppStoreLocationType);
|
|
|
|
// Display if the location can be set to public - and also display all locations like google meet etc
|
|
|
|
if (el.displayLocationPublicly || values.includes(el["type"] as unknown as AppStoreLocationType))
|
|
|
|
return el;
|
|
|
|
else {
|
|
|
|
delete el.address;
|
|
|
|
delete el.link;
|
|
|
|
return el;
|
|
|
|
}
|
|
|
|
});
|