Fixes/locations (#2383)

* Moves locations to App Store and Core

* LocationType fixes

* Update App.d.ts

* Re-add Google Meet

* Moves location labels to the app store

* Renames labels to locationLabels

* Update utils.ts

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Omar Lópezandkodiakhq[bot] authored and GitHub committed 2022-04-05 18:03:22 +00:00
1 parent 4d58281d6f
commit f8b7e17fda
23 files changed
+78 -53

No files matched your search

@@ -52,7 +52,7 @@ type BookingFormValues = {
};
};
const BookingPage = ({ eventType, booking, profile }: BookingPageProps) => {
const BookingPage = ({ eventType, booking, profile, locationLabels }: BookingPageProps) => {
const { t, i18n } = useLocale();
const router = useRouter();
const { contracts } = useContracts();
@@ -130,21 +130,6 @@ const BookingPage = ({ eventType, booking, profile }: BookingPageProps) => {
const telemetry = useTelemetry();
const locationInfo = (type: LocationType) => locations.find((location) => location.type === type);
// TODO: Move to translations
// Also TODO: Get these dynamically from App Store
const locationLabels = {
[LocationType.InPerson]: t("in_person_meeting"),
[LocationType.Phone]: t("phone_call"),
[LocationType.Link]: t("link_meeting"),
[LocationType.GoogleMeet]: "Google Meet",
[LocationType.Zoom]: "Zoom Video",
[LocationType.Jitsi]: "Jitsi Meet",
[LocationType.Daily]: "Cal Video",
[LocationType.Huddle01]: "Huddle01 Video",
[LocationType.Tandem]: "Tandem Video",
[LocationType.Teams]: "MS Teams",
};
const loggedInIsOwner = eventType?.users[0]?.name === session?.user?.name;
const defaultValues = () => {
if (!rescheduleUid) {
+1 -1
View File
@@ -1 +1 @@
export * from "@calcom/lib/location";
export * from "@calcom/core/location";
+6
View File
@@ -5,12 +5,15 @@ import utc from "dayjs/plugin/utc";
import { GetServerSidePropsContext } from "next";
import { JSONObject } from "superjson/dist/types";
import { getLocationLabels } from "@calcom/app-store/utils";
import { asStringOrThrow } from "@lib/asStringOrNull";
import prisma from "@lib/prisma";
import { inferSSRProps } from "@lib/types/inferSSRProps";
import BookingPage from "@components/booking/pages/BookingPage";
import { getTranslation } from "@server/lib/i18n";
import { ssrInit } from "@server/lib/ssr";
dayjs.extend(utc);
@@ -133,8 +136,11 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
booking = await getBooking();
}
const t = await getTranslation(context.locale ?? "en", "common");
return {
props: {
locationLabels: getLocationLabels(t),
profile: {
slug: user.username,
name: user.name,
+7
View File
@@ -2,12 +2,16 @@ import { Prisma } from "@prisma/client";
import { GetServerSidePropsContext } from "next";
import { JSONObject } from "superjson/dist/types";
import { getLocationLabels } from "@calcom/app-store/utils";
import { asStringOrThrow } from "@lib/asStringOrNull";
import prisma from "@lib/prisma";
import { inferSSRProps } from "@lib/types/inferSSRProps";
import BookingPage from "@components/booking/pages/BookingPage";
import { getTranslation } from "@server/lib/i18n";
export type TeamBookingPageProps = inferSSRProps<typeof getServerSideProps>;
export default function TeamBookingPage(props: TeamBookingPageProps) {
@@ -94,8 +98,11 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
booking = await getBooking();
}
const t = await getTranslation(context.locale ?? "en", "common");
return {
props: {
locationLabels: getLocationLabels(t),
profile: {
...eventTypeObject.team,
slug: "team/" + eventTypeObject.slug,