From d951a5b872d301cf27452ae98e4078695cdbad82 Mon Sep 17 00:00:00 2001 From: Max Oehrlein <72990986+OMaxOe@users.noreply.github.com> Date: Wed, 30 Nov 2022 22:52:56 +0100 Subject: [PATCH] Allows brand customization (#5329) * adjustments for each language json file: - changed every Cal or Cal.com with a variable to make it possible to change that with a custom brand - fix and renamed ATTENDEE with attendeeName * added two new variables for appName and support mail address. so everybody can change it via env * changed static Cal or Cal.com with new defined constants * Using useLocal to modify static text to make it multilingual, and passing the correct variables for brand and mail * adding new readable variables for brand, website domain and mail address * fixed search routes * made static text multilingual and fixed german translations * Revert "fixed search routes" moved changes in another pr This reverts commit e6ba11a1ec7821d8c16c502d0357f6d5fcdb1958. * revert non whitelabel changes and moved it into another pr * revert attendeeName fix * reverted translation fixes and moved them in another pr * changed back to "Cal.com Logo" * changed back to "https://console.cal.com" * added new env variable for company name and replaced some domainName variables in language files * changed default for COMPANY_NAME to Cal.com, Inc. * changed Cal.com to APP_NAME for mail templates * Dropped website domain in favor of app name * Update .env.example * Apply suggestions from code review * Code review feedback * Delete App.tsx * Update packages/ui/Kbar.tsx * added meta.CTA back it was mistakenly removed * updated add members test Co-authored-by: maxi Co-authored-by: Peer Richelsen Co-authored-by: zomars --- .env.example | 5 + apps/web/components/Embed.tsx | 11 ++- apps/web/components/apps/App.tsx | 7 +- .../components/booking/pages/BookingPage.tsx | 3 +- .../components/eventtype/AvailabilityTab.tsx | 3 + .../components/eventtype/EventAdvancedTab.tsx | 4 +- apps/web/components/seo/head-seo.tsx | 3 +- apps/web/components/team/TeamSettings.tsx | 9 +- apps/web/components/ui/AuthContainer.tsx | 4 +- apps/web/lib/config/next-seo.config.ts | 4 +- apps/web/pages/404.tsx | 12 ++- apps/web/pages/500.tsx | 4 +- apps/web/pages/api/auth/[...nextauth].tsx | 8 +- apps/web/pages/booking/[uid].tsx | 5 +- apps/web/pages/event-types/index.tsx | 6 +- .../web/pages/getting-started/[[...step]].tsx | 7 +- .../web/pages/settings/developer/api-keys.tsx | 8 +- .../pages/settings/my-account/appearance.tsx | 5 +- .../web/pages/settings/my-account/profile.tsx | 7 +- apps/web/playwright/teams.e2e.ts | 2 +- apps/web/public/static/locales/ar/common.json | 90 ++++++++--------- apps/web/public/static/locales/cs/common.json | 90 ++++++++--------- apps/web/public/static/locales/de/common.json | 99 ++++++++++--------- apps/web/public/static/locales/en/common.json | 93 ++++++++--------- apps/web/public/static/locales/es/common.json | 96 +++++++++--------- apps/web/public/static/locales/fr/common.json | 93 +++++++++-------- apps/web/public/static/locales/he/common.json | 92 ++++++++--------- apps/web/public/static/locales/hu/common.json | 2 +- apps/web/public/static/locales/it/common.json | 93 +++++++++-------- apps/web/public/static/locales/ja/common.json | 88 ++++++++--------- apps/web/public/static/locales/ko/common.json | 95 +++++++++--------- apps/web/public/static/locales/nl/common.json | 97 +++++++++--------- apps/web/public/static/locales/pl/common.json | 94 +++++++++--------- .../public/static/locales/pt-BR/common.json | 94 +++++++++--------- apps/web/public/static/locales/pt/common.json | 89 +++++++++-------- apps/web/public/static/locales/ro/common.json | 93 +++++++++-------- apps/web/public/static/locales/ru/common.json | 92 ++++++++--------- apps/web/public/static/locales/sr/common.json | 93 +++++++++-------- apps/web/public/static/locales/sv/common.json | 91 +++++++++-------- apps/web/public/static/locales/tr/common.json | 95 +++++++++--------- apps/web/public/static/locales/uk/common.json | 91 +++++++++-------- apps/web/public/static/locales/vi/common.json | 90 ++++++++--------- .../public/static/locales/zh-CN/common.json | 98 +++++++++--------- .../public/static/locales/zh-TW/common.json | 91 +++++++++-------- .../src/templates/ForgotPasswordEmail.tsx | 4 +- .../emails/src/templates/TeamInviteEmail.tsx | 14 ++- .../templates/broken-integration-email.ts | 3 +- packages/emails/templates/feedback-email.ts | 4 +- .../emails/templates/forgot-password-email.ts | 10 +- .../templates/organizer-scheduled-email.ts | 3 +- .../emails/templates/team-invite-email.ts | 5 +- .../ee/common/components/LicenseRequired.tsx | 28 +++--- .../common/components/v2/LicenseRequired.tsx | 28 +++--- .../ee/payments/components/PaymentPage.tsx | 8 +- .../ee/sso/components/SAMLConfiguration.tsx | 3 +- .../ee/teams/pages/team-appearance-view.tsx | 7 +- .../webhooks/pages/webhook-edit-view.tsx | 3 +- .../webhooks/pages/webhook-new-view.tsx | 3 +- .../features/webhooks/pages/webhooks-view.tsx | 10 +- packages/lib/constants.ts | 3 + packages/lib/next-seo.config.ts | 4 +- packages/types/environment.d.ts | 3 + packages/ui/Kbar.tsx | 9 +- packages/ui/v2/core/Shell.tsx | 13 ++- turbo.json | 3 + 65 files changed, 1247 insertions(+), 1177 deletions(-) diff --git a/.env.example b/.env.example index 221c962a6d..6cbeb377f0 100644 --- a/.env.example +++ b/.env.example @@ -140,3 +140,8 @@ SENDGRID_SYNC_API_KEY= # Sentry NEXT_PUBLIC_SENTRY_DSN= SENTRY_IGNORE_API_RESOLUTION_ERROR= + +# Change your Brand +NEXT_PUBLIC_APP_NAME="Cal.com" +NEXT_PUBLIC_SUPPORT_MAIL_ADDRESS="help@cal.com" +NEXT_PUBLIC_COMPANY_NAME="Cal.com, Inc." diff --git a/apps/web/components/Embed.tsx b/apps/web/components/Embed.tsx index 899ea460a5..761cb87610 100644 --- a/apps/web/components/Embed.tsx +++ b/apps/web/components/Embed.tsx @@ -4,6 +4,7 @@ import { NextRouter, useRouter } from "next/router"; import { createRef, forwardRef, MutableRefObject, RefObject, useRef, useState } from "react"; import { components, ControlProps } from "react-select"; +import { APP_NAME, EMBED_LIB_URL, WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button, @@ -20,8 +21,6 @@ import { TextField, } from "@calcom/ui"; -import { EMBED_LIB_URL, WEBAPP_URL } from "@lib/config/constants"; - import ColorPicker from "@components/ui/colorpicker"; import Select from "@components/ui/form/Select"; @@ -498,7 +497,9 @@ const tabs = [ return ( <>
- {t("place_where_cal_widget_appear")} + + {t("place_where_cal_widget_appear", { appName: APP_NAME })} +