Skip to content

Commit

Permalink
Merge branch 'main' into event-availability-platform-wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
SomayChauhan committed Oct 16, 2024
2 parents dbdc75b + 92a48b4 commit 8abec82
Show file tree
Hide file tree
Showing 141 changed files with 3,684 additions and 1,755 deletions.
16 changes: 14 additions & 2 deletions apps/web/lib/video/[uid]/getServerSideProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { GetServerSidePropsContext } from "next";
import {
generateGuestMeetingTokenFromOwnerMeetingToken,
setEnableRecordingUIAndUserIdForOrganizer,
updateMeetingTokenIfExpired,
} from "@calcom/app-store/dailyvideo/lib/VideoApiAdapter";
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
import { getCalVideoReference } from "@calcom/features/get-cal-video-reference";
Expand Down Expand Up @@ -78,10 +79,21 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {

const oldVideoReference = getCalVideoReference(bookingObj.references);

const endTime = new Date(booking.endTime);
const fourteenDaysAfter = new Date(endTime.getTime() + 14 * 24 * 60 * 60 * 1000);
const epochTimeFourteenDaysAfter = Math.floor(fourteenDaysAfter.getTime() / 1000);

const videoReferencePassword = await updateMeetingTokenIfExpired({
bookingReferenceId: oldVideoReference.id,
roomName: oldVideoReference.uid,
meetingToken: oldVideoReference.meetingPassword,
exp: epochTimeFourteenDaysAfter,
});

// set meetingPassword for guests
if (session?.user.id !== bookingObj.user?.id) {
const guestMeetingPassword = await generateGuestMeetingTokenFromOwnerMeetingToken(
oldVideoReference.meetingPassword,
videoReferencePassword,
session?.user.id
);

Expand All @@ -93,7 +105,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
else {
const meetingPassword = await setEnableRecordingUIAndUserIdForOrganizer(
oldVideoReference.id,
oldVideoReference.meetingPassword,
videoReferencePassword,
session?.user.id
);
if (!!meetingPassword) {
Expand Down
15 changes: 3 additions & 12 deletions apps/web/modules/settings/my-account/appearance-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,10 @@ const AppearanceView = ({
<Form
form={userAppThemeFormMethods}
handleSubmit={({ appTheme }) => {
if (appTheme === "light" || appTheme === "dark") {
mutation.mutate({
appTheme,
});
return;
}
if (appTheme === "system") appTheme = null;
mutation.mutate({
appTheme: null,
appTheme,
});
if (values.appTheme === "light") {
document.body.classList.remove("dark");
} else if (values.appTheme === "dark") {
document.body.classList.remove("light");
}
}}>
<div className="border-subtle flex flex-col justify-between border-x px-6 py-8 sm:flex-row">
<ThemeLabel
Expand Down Expand Up @@ -236,6 +226,7 @@ const AppearanceView = ({
</div>
<SectionBottomActions className="mb-6" align="end">
<Button
loading={mutation.isPending}
disabled={isUserAppThemeSubmitting || !isUserAppThemeDirty}
type="submit"
data-testid="update-app-theme-btn"
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@calcom/web",
"version": "4.5.11",
"version": "4.6.1",
"private": true,
"scripts": {
"analyze": "ANALYZE=true next build",
Expand Down
6 changes: 5 additions & 1 deletion apps/web/pages/settings/organizations/members.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import MembersView from "@calcom/features/ee/organizations/pages/settings/members";
import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import SettingsLayout from "@calcom/features/settings/layouts/SettingsLayout";

import PageWrapper from "@components/PageWrapper";

Expand All @@ -8,6 +8,10 @@ export {
type PageProps,
} from "@calcom/features/ee/organizations/pages/settings/getServerSidePropsMembers";

export const getLayout = (page: React.ReactElement) => (
<SettingsLayout containerClassName="lg:max-w-screen-2xl">{page}</SettingsLayout>
);

const Page = () => <MembersView />;

Page.getLayout = getLayout;
Expand Down
2 changes: 1 addition & 1 deletion apps/web/playwright/organization/lib/inviteUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function acceptTeamOrOrgInvite(page: Page) {
}

async function inviteAnEmail(page: Page, invitedUserEmail: string) {
await page.locator('button:text("Add")').click();
await page.getByTestId("new-organization-member-button").click();
await page.locator('input[name="inviteUser"]').fill(invitedUserEmail);
await submitAndWaitForResponse(page, "/api/trpc/teams/inviteMember?batch=1", {
action: () => page.locator('button:text("Send invite")').click(),
Expand Down
24 changes: 16 additions & 8 deletions apps/web/playwright/organization/organization-invitation.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test.describe("Organization", () => {
const invitedUserEmail = users.trackEmail({ username: "rick", domain: "domain.com" });
// '-domain' because the email doesn't match orgAutoAcceptEmail
const usernameDerivedFromEmail = `${invitedUserEmail.split("@")[0]}-domain`;
await inviteAnEmail(page, invitedUserEmail);
await inviteAnEmail(page, invitedUserEmail, true);
await expectUserToBeAMemberOfTeam({
page,
teamId: team.id,
Expand Down Expand Up @@ -164,7 +164,7 @@ test.describe("Organization", () => {

await test.step("By invite link", async () => {
await page.goto(`/settings/teams/${team.id}/members`);
const inviteLink = await copyInviteLink(page);
const inviteLink = await copyInviteLink(page, true);
const email = users.trackEmail({ username: "rick", domain: "domain.com" });
// '-domain' because the email doesn't match orgAutoAcceptEmail
const usernameDerivedFromEmail = `${email.split("@")[0]}-domain`;
Expand Down Expand Up @@ -333,7 +333,7 @@ test.describe("Organization", () => {
await page.goto(`/settings/teams/${team.id}/members`);
const invitedUserEmail = users.trackEmail({ username: "rick", domain: "example.com" });
const usernameDerivedFromEmail = invitedUserEmail.split("@")[0];
await inviteAnEmail(page, invitedUserEmail);
await inviteAnEmail(page, invitedUserEmail, true);
await expectUserToBeAMemberOfTeam({
page,
teamId: team.id,
Expand Down Expand Up @@ -391,7 +391,7 @@ test.describe("Organization", () => {
await test.step("By invite link", async () => {
await page.goto(`/settings/teams/${team.id}/members`);

const inviteLink = await copyInviteLink(page);
const inviteLink = await copyInviteLink(page, true);
const email = users.trackEmail({ username: "rick", domain: "example.com" });
// '-domain' because the email doesn't match orgAutoAcceptEmail
const usernameDerivedFromEmail = `${email.split("@")[0]}`;
Expand Down Expand Up @@ -481,8 +481,12 @@ export async function signupFromEmailInviteLink({
await signupPage.close();
}

async function inviteAnEmail(page: Page, invitedUserEmail: string) {
await page.locator('button:text("Add")').click();
async function inviteAnEmail(page: Page, invitedUserEmail: string, teamPage?: boolean) {
if (teamPage) {
await page.getByTestId("new-member-button").click();
} else {
await page.getByTestId("new-organization-member-button").click();
}
await page.locator('input[name="inviteUser"]').fill(invitedUserEmail);
const submitPromise = page.waitForResponse("/api/trpc/teams/inviteMember?batch=1");
await page.locator('button:text("Send invite")').click();
Expand Down Expand Up @@ -558,8 +562,12 @@ function assertInviteLink(inviteLink: string | null | undefined): asserts invite
if (!inviteLink) throw new Error("Invite link not found");
}

async function copyInviteLink(page: Page) {
await page.locator('button:text("Add")').click();
async function copyInviteLink(page: Page, teamPage?: boolean) {
if (teamPage) {
await page.getByTestId("new-member-button").click();
} else {
await page.getByTestId("new-organization-member-button").click();
}
const inviteLink = await getInviteLink(page);
return inviteLink;
}
7 changes: 4 additions & 3 deletions apps/web/playwright/team/team-invitation.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test.describe("Team", () => {
username: "rick",
domain: `domain-${Date.now()}.com`,
});
await page.locator(`button:text("${t("add")}")`).click();
await page.getByTestId("new-member-button").click();
await page.locator('input[name="inviteUser"]').fill(invitedUserEmail);
await page.locator(`button:text("${t("send_invite")}")`).click();
const inviteLink = await expectInvitationEmailToBeReceived(
Expand Down Expand Up @@ -74,7 +74,8 @@ test.describe("Team", () => {
email: `user-invite-${Date.now()}@domain.com`,
password: "P4ssw0rd!",
});
await page.locator(`button:text("${t("add")}")`).click();

await page.getByTestId("new-member-button").click();
const inviteLink = await getInviteLink(page);

const context = await browser.newContext();
Expand Down Expand Up @@ -105,7 +106,7 @@ test.describe("Team", () => {
username: "rick",
domain: `example.com`,
});
await page.locator(`button:text("${t("add")}")`).click();
await page.getByTestId("new-member-button").click();
await page.locator('input[name="inviteUser"]').fill(invitedUserEmail);
await page.locator(`button:text("${t("send_invite")}")`).click();
await expectInvitationEmailToBeReceived(
Expand Down
9 changes: 8 additions & 1 deletion apps/web/public/static/locales/ar/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@
"invalid_credential_action": "إعادة تثبيت التطبيق",
"reschedule_reason": "سبب إعادة الجدولة",
"choose_common_schedule_team_event": "اختر جدولًا زمنيًا مشتركًا",
"choose_common_schedule_team_event_description": "قم بتمكين هذا الخيار إذا كنت ترغب في استخدام جدول زمني مشترك بين المضيفين. عند تعطيل هذا الخيار، سيتم حجز كل مضيف على أساس جدوله الافتراضي.",
"choose_common_schedule_team_event_description": "قم بتمكين هذا إذا كنت ترغب في استخدام جدول مشترك بين المضيفين. عند التعطيل، سيتم حجز كل مضيف بناءً على جدوله الافتراضي أو الجدول الذي تم اختياره.",
"reason": "السبب",
"sender_id": "معرّف المرسل",
"sender_id_error_message": "يسمح بالحروف والأرقام والمسافات فقط (بحد أقصى 11 حرفًا)",
Expand Down Expand Up @@ -2595,6 +2595,7 @@
"new_option": "خيار جديد",
"update_profile": "تحديث العضو",
"attribute_updated_successfully": "تم تحديث السمة بنجاح",
"attribute_deleted_successfully": "تم حذف السمة بنجاح",
"attributes_edited_successfully": "تم تعديل السمات بنجاح",
"attribute_meta_description": "إدارة السمات لأعضاء فريقك",
"attributes_edit_description": "تعديل السمات لأعضاء فريقك",
Expand Down Expand Up @@ -2640,6 +2641,9 @@
"month_to_date": "منذ بداية الشهر",
"year_to_date": "منذ بداية السنة",
"custom_range": "نطاق مخصص",
"show_all_columns": "عرض جميع الأعمدة",
"toggle_columns": "تبديل الأعمدة",
"no_columns_found": "لم يتم العثور على أعمدة",
"salesforce_create_record_as": "عند الحجز، أضف الأحداث والمشاركين الجدد كالتالي:",
"salesforce_lead": "عميل محتمل",
"salesforce_contact_under_account": "جهة اتصال تحت حساب",
Expand All @@ -2650,5 +2654,8 @@
"salesforce_book_directly_with_attendee_owner": "إذا كان المشارك موجودًا في Salesforce، احجز مباشرة مع المالك",
"salesforce_check_owner_of": "الكيان الذي يجب التحقق من مالكه للحجز مباشرة",
"account": "حساب",
"choose_hosts_schedule": "اختر جداول المضيفين",
"hosts_schedule_description": "يمكنك اختيار جدول مختلف لكل مضيف. يتم اختيار جدول المضيف الافتراضي لكل مضيف بشكل افتراضي.",
"no_hosts_description": "لا يوجد مضيفون معينون، أضف مضيفين في علامة التبويب التعيين.",
"ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ أضف السلاسل الجديدة أعلاه هنا ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"
}
9 changes: 8 additions & 1 deletion apps/web/public/static/locales/az/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@
"invalid_credential_action": "Tətbiqi yenidən quraşdırın",
"reschedule_reason": "Yenidən planlaşdırma səbəbi",
"choose_common_schedule_team_event": "Ümumi cədvəli seçin",
"choose_common_schedule_team_event_description": "Əgər ev sahibləri arasında ümumi cədvəldən istifadə etmək istəyirsinizsə, bunu aktiv edin. Deaktiv edildikdə, hər bir ev sahibi öz standart cədvəlinə əsasən rezervasiya ediləcək.",
"choose_common_schedule_team_event_description": "Əgər hostlar arasında ümumi cədvəldən istifadə etmək istəyirsinizsə, bunu aktivləşdirin. Deaktiv edildikdə, hər host öz standart cədvəlinə və ya seçilmiş cədvəlinə əsasən rezervasiya ediləcək.",
"reason": "Səbəb",
"sender_id": "Göndərən ID",
"sender_id_error_message": "Yalnız hərflər, rəqəmlər və boşluqlar icazəlidir (maks. 11 simvol)",
Expand Down Expand Up @@ -2595,6 +2595,7 @@
"new_option": "Yeni seçim",
"update_profile": "Üzvü yenilə",
"attribute_updated_successfully": "Atribut uğurla yeniləndi",
"attribute_deleted_successfully": "Atribut uğurla silindi",
"attributes_edited_successfully": "Atributlar uğurla redaktə edildi",
"attribute_meta_description": "Komanda üzvləriniz üçün atributları idarə edin",
"attributes_edit_description": "Komanda üzvləriniz üçün atributları redaktə edin",
Expand Down Expand Up @@ -2640,6 +2641,9 @@
"month_to_date": "bu ayın tarixinə qədər",
"year_to_date": "bu ilin tarixinə qədər",
"custom_range": "xüsusi aralıq",
"show_all_columns": "Bütün sütunları göstər",
"toggle_columns": "Sütunları dəyiş",
"no_columns_found": "Sütun tapılmadı",
"salesforce_create_record_as": "Rezervasiya zamanı tədbirləri əlavə edin və yeni iştirakçıları belə qeyd edin:",
"salesforce_lead": "Potensial müştəri",
"salesforce_contact_under_account": "Hesab altında əlaqə",
Expand All @@ -2650,5 +2654,8 @@
"salesforce_book_directly_with_attendee_owner": "Əgər iştirakçı Salesforce-da mövcuddursa, birbaşa sahib ilə rezervasiya edin",
"salesforce_check_owner_of": "Birbaşa rezervasiya etmək üçün sahibini yoxlayacaq obyekt",
"account": "Hesab",
"choose_hosts_schedule": "Hostların cədvəlini seçin",
"hosts_schedule_description": "Hər bir host üçün fərqli cədvəl seçə bilərsiniz. Hər hostun standart cədvəli avtomatik olaraq seçilir.",
"no_hosts_description": "Host təyin edilməyib, təyinat sekmesinde host əlavə edin.",
"ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ Yeni sətirləri bura əlavə edin ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"
}
9 changes: 8 additions & 1 deletion apps/web/public/static/locales/cs/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@
"invalid_credential_action": "Přeinstalovat aplikaci",
"reschedule_reason": "Důvod změny termínu",
"choose_common_schedule_team_event": "Vyberte společný plán",
"choose_common_schedule_team_event_description": "Tuto možnost povolte, pokud chcete používat společný plán mezi hostiteli. Při zakázání této možnosti bude každý hostitel rezervován na základě svého výchozího plánu.",
"choose_common_schedule_team_event_description": "Povolte tuto možnost, pokud chcete použít společný rozvrh mezi hostiteli. Pokud je zakázána, každý hostitel bude rezervován podle svého výchozího rozvrhu nebo zvoleného rozvrhu.",
"reason": "Důvod",
"sender_id": "ID odesílatele",
"sender_id_error_message": "Povolena jsou pouze písmena, číslice a mezery (max. 11 znaků)",
Expand Down Expand Up @@ -2595,6 +2595,7 @@
"new_option": "Nová možnost",
"update_profile": "Aktualizovat člena",
"attribute_updated_successfully": "Atribut úspěšně aktualizován",
"attribute_deleted_successfully": "Atribut byl úspěšně smazán",
"attributes_edited_successfully": "Atributy úspěšně upraveny",
"attribute_meta_description": "Spravujte atributy pro členy svého týmu",
"attributes_edit_description": "Upravte atributy pro členy svého týmu",
Expand Down Expand Up @@ -2640,6 +2641,9 @@
"month_to_date": "od začátku měsíce",
"year_to_date": "od začátku roku",
"custom_range": "vlastní rozsah",
"show_all_columns": "Zobrazit všechny sloupce",
"toggle_columns": "Přepnout sloupce",
"no_columns_found": "Žádné sloupce nebyly nalezeny",
"salesforce_create_record_as": "Při rezervaci přidejte události a nové účastníky jako:",
"salesforce_lead": "Lead",
"salesforce_contact_under_account": "Kontakt pod účtem",
Expand All @@ -2650,5 +2654,8 @@
"salesforce_book_directly_with_attendee_owner": "Pokud účastník existuje v Salesforce, rezervujte přímo s vlastníkem",
"salesforce_check_owner_of": "Entita ke kontrole vlastníka pro přímou rezervaci",
"account": "Účet",
"choose_hosts_schedule": "Vyberte rozvrhy hostitelů",
"hosts_schedule_description": "Můžete vybrat jiný rozvrh pro každého hostitele. Výchozí rozvrh každého hostitele je vybrán automaticky.",
"no_hosts_description": "Žádní hostitelé nejsou přiřazeni, přidejte hostitele na kartě přiřazení.",
"ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ Přidejte své nové řetězce nahoru ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"
}
9 changes: 8 additions & 1 deletion apps/web/public/static/locales/da/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@
"invalid_credential_action": "Geninstaller app",
"reschedule_reason": "Årsag til omlægning",
"choose_common_schedule_team_event": "Vælg en fælles tidsplan",
"choose_common_schedule_team_event_description": "Aktivér dette hvis du ønsker at bruge en fælles tidsplan mellem værter. Når deaktiveret, vil hver vært blive booket baseret på deres standardtidsplan.",
"choose_common_schedule_team_event_description": "Aktivér dette, hvis du vil bruge en fælles tidsplan mellem værter. Når det er deaktiveret, vil hver vært blive booket baseret på deres standardtidsplan eller deres valgte tidsplan.",
"reason": "Årsag",
"sender_id": "Afsender ID",
"sender_id_error_message": "Kun bogstaver, tal og mellemrum tilladt (maks. 11 tegn)",
Expand Down Expand Up @@ -2595,6 +2595,7 @@
"new_option": "Ny mulighed",
"update_profile": "Opdater medlem",
"attribute_updated_successfully": "Egenskab opdateret med succes",
"attribute_deleted_successfully": "Attribut slettet med succes",
"attributes_edited_successfully": "Egenskaber redigeret med succes",
"attribute_meta_description": "Administrer egenskaber for dine teammedlemmer",
"attributes_edit_description": "Rediger egenskaber for dine teammedlemmer",
Expand Down Expand Up @@ -2640,6 +2641,9 @@
"month_to_date": "måned til dato",
"year_to_date": "år til dato",
"custom_range": "tilpasset interval",
"show_all_columns": "Vis alle kolonner",
"toggle_columns": "Skift kolonner",
"no_columns_found": "Ingen kolonner fundet",
"salesforce_create_record_as": "Ved booking, tilføj begivenheder og nye deltagere som:",
"salesforce_lead": "Lead",
"salesforce_contact_under_account": "Kontakt under en konto",
Expand All @@ -2650,5 +2654,8 @@
"salesforce_book_directly_with_attendee_owner": "Hvis deltageren findes i Salesforce, book direkte med ejeren",
"salesforce_check_owner_of": "Enhed til at tjekke ejeren af for at booke direkte",
"account": "Konto",
"choose_hosts_schedule": "Vælg værternes tidsplaner",
"hosts_schedule_description": "Du kan vælge en anden tidsplan for hver vært. Hver værts standardtidsplan er valgt som standard.",
"no_hosts_description": "Ingen værter tildelt, tilføj værter i tildelingsfanen.",
"ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ Tilføj dine nye strenge ovenfor her ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"
}
Loading

0 comments on commit 8abec82

Please sign in to comment.