Skip to content

Commit

Permalink
prod hotfixes (#3395)
Browse files Browse the repository at this point in the history
* New Crowdin translations by Github Action (#3387)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>

* fix bug with disabled save button (#3390)

Co-authored-by: CarinaWolli <wollencarina@gmail.com>

* Fix possible 404 when obtaining calendar busy lists (#3345)

* Edited typo (#3391)

"Workflows enable you to automate sending reminders and notifcations." --> "Workflows enable you to automate sending reminders and notifications."

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* HOTFIX: fixes soft failing on settings/profile routes (#3394)

* fixes soft failing on settings/profile routes

* Fixed auto changed code

* Fixed auto changed code

Probably down to some random windows incompatibility with the parser/beautifier at commit time

* Fix the path for "schema.prisma" file in README.md (#3386)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: martincollignon <2604526+martincollignon@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>
Co-authored-by: Taha <57881112+taha-programmer@users.noreply.github.com>
  • Loading branch information
10 people authored Jul 16, 2022
1 parent 1f582b2 commit d32ea5d
Show file tree
Hide file tree
Showing 24 changed files with 71 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ echo 'NEXT_PUBLIC_DEBUG=1' >> .env
</details>
1. Set a 32 character random string in your .env file for the `CALENDSO_ENCRYPTION_KEY` (You can use a command like `openssl rand -base64 24` to generate one).
1. Set up the database using the Prisma schema (found in `apps/web/prisma/schema.prisma`)
1. Set up the database using the Prisma schema (found in `packages/prisma/schema.prisma`)
```sh
yarn workspace @calcom/prisma db-deploy
Expand All @@ -189,7 +189,7 @@ echo 'NEXT_PUBLIC_DEBUG=1' >> .env
1. Click on the `User` model to add a new user record.
1. Fill out the fields `email`, `username`, `password`, and set `metadata` to empty `{}` (remembering to encrypt your password with [BCrypt](https://bcrypt-generator.com/)) and click `Save 1 Record` to create your first user.
> New users are set on a `TRIAL` plan by default. You might want to adjust this behavior to your needs in the `apps/web/prisma/schema.prisma` file.
> New users are set on a `TRIAL` plan by default. You might want to adjust this behavior to your needs in the `packages/prisma/schema.prisma` file.
1. Open a browser to [http://localhost:3000](http://localhost:3000) and login with your just created, first user.
### E2E-Testing
Expand Down
8 changes: 4 additions & 4 deletions apps/web/components/Kbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,31 +106,31 @@ export const KBarRoot = ({ children }: { children: React.ReactNode }) => {
section: "Profile Settings",
shortcut: ["p", "s"],
keywords: "setting profile",
perform: () => router.push("/settings"),
perform: () => router.push("/settings/profile"),
},
{
id: "avatar",
name: "Change Avatar",
section: "Profile Settings",
shortcut: ["c", "a"],
keywords: "remove change modify avatar",
perform: () => router.push("/settings"),
perform: () => router.push("/settings/profile"),
},
{
id: "timezone",
name: "Change Timezone",
section: "Profile Settings",
shortcut: ["c", "t"],
keywords: "change modify timezone",
perform: () => router.push("/settings"),
perform: () => router.push("/settings/profile"),
},
{
id: "brand-color",
name: "Change Brand Color",
section: "Profile Settings",
shortcut: ["b", "c"],
keywords: "change modify brand color",
perform: () => router.push("/settings"),
perform: () => router.push("/settings/profile"),
},
{
id: "teams",
Expand Down
1 change: 1 addition & 0 deletions apps/web/components/integrations/CalendarListContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function ConnectedCalendarsList(props: Props) {
actions={
<DisconnectIntegration
id={item.credentialId}
externalId={item.primary?.externalId}
render={(btnProps) => (
<Button {...btnProps} color="warn" data-testid="integration-connection-button">
{t("disconnect")}
Expand Down
5 changes: 3 additions & 2 deletions apps/web/components/integrations/DisconnectIntegration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import ConfirmationDialogContent from "@components/dialog/ConfirmationDialogCont
export default function DisconnectIntegration(props: {
/** Integration credential id */
id: number;
externalId?: string;
render: (renderProps: ButtonBaseProps) => JSX.Element;
onOpenChange: (isOpen: boolean) => unknown | Promise<unknown>;
}) {
const { id } = props;
const { id, externalId = "" } = props;
const { t } = useLocale();
const [modalOpen, setModalOpen] = useState(false);

Expand All @@ -42,7 +43,7 @@ export default function DisconnectIntegration(props: {
confirmBtnText={t("yes_remove_app")}
cancelBtnText="Cancel"
onConfirm={() => {
mutation.mutate({ id });
mutation.mutate({ id, externalId });
}}>
{t("are_you_sure_you_want_to_remove_this_app")}
</ConfirmationDialogContent>
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/ar/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "للقراءة فقط",
"one_time_link": "رابط لمرة واحدة",
"plan_description": "أنت حاليًا على خطة {{plan}}.",
"plan_upgrade_invitation": "قم بترقية حسابك إلى خطة Pro لفتح كل الميزات التي نقدمها.",
"plan_upgrade": "تحتاج إلى ترقية خطتك للحصول على أكثر من نوع حدث نشط.",
"plan_upgrade_teams": "تحتاج إلى ترقية خطتك لإنشاء فريق.",
"plan_upgrade_instructions": "يمكنك <1>الترقية هنا</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/cs/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Jen pro čtení",
"one_time_link": "Jednorázový odkaz",
"plan_description": "Momentálně používáte tarif {{plan}}.",
"plan_upgrade_invitation": "Přejděte s účtem na tarif PRO a odemkněte všechny funkce, které nabízíme.",
"plan_upgrade": "Je potřeba přejít na vyšší tarif, abyste mohli mít víc jak jeden aktivní typ události.",
"plan_upgrade_teams": "Je potřeba přejít na vyšší tarif, abyste mohli vytvořit tým.",
"plan_upgrade_instructions": "<1>Přejít na vyšší tarif</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Schreibgeschützt",
"one_time_link": "Einmaliger Link",
"plan_description": "Sie haben gerade den Tarif: {{plan}}.",
"plan_upgrade_invitation": "Aktualisieren Sie Ihr Konto auf den Pro-Plan, um alle Funktionen freizuschalten.",
"plan_upgrade": "Sie müssen Ihr Paket upgraden, um mehr als einen aktiven Ereignistyp zu haben.",
"plan_upgrade_teams": "Du musst deinen Plan upgraden, um ein Team zu erstellen.",
"plan_upgrade_instructions": "Sie können <1>hier upgraden</1>.",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/public/static/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@
"hour_timeUnit": "Hours",
"minute_timeUnit": "Minutes",
"new_workflow_heading": "Create your first workflow",
"new_workflow_description": "Workflows enable you to automate sending reminders and notifcations.",
"new_workflow_description": "Workflows enable you to automate sending reminders and notifications.",
"active_on": "Active on",
"workflow_updated_successfully": "{{workflowName}} workflow updated successfully",
"standard_to_premium_username_description": "This is a standard username and updating will take you to billing to downgrade.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Sólo Lectura",
"one_time_link": "Enlace de una sola vez",
"plan_description": "Actualmente estás en el plan {{plan}}.",
"plan_upgrade_invitation": "Actualiza tu cuenta al plan Pro para poder utilizar todas las funciones que ofrecemos.",
"plan_upgrade": "Necesitas actualizar tu plan para tener más de un tipo de evento activo.",
"plan_upgrade_teams": "Necesita actualizar su plan para crear un equipo.",
"plan_upgrade_instructions": "Puedes <1>actualizar aquí</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Lire seulement",
"one_time_link": "Lien à usage unique",
"plan_description": "Vous disposez actuellement de la formule {{plan}}.",
"plan_upgrade_invitation": "Mettez à niveau votre compte vers l'offre pro pour débloquer toutes les fonctionnalités que nous avons à proposer.",
"plan_upgrade": "Vous devez mettre à niveau votre plan pour avoir plus d'un type d'événement actif.",
"plan_upgrade_teams": "Vous devez mettre à niveau votre formule pour créer une équipe.",
"plan_upgrade_instructions": "Vous pouvez <1>mettre à niveau ici</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/he/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "לקריאה בלבד",
"one_time_link": "קישור חד-פעמי",
"plan_description": "כרגע אתה משתמש בחבילת {{plan}}.",
"plan_upgrade_invitation": "כדאי לשדרג את החשבון לחבילת Pro כדי ליהנות מכל התכונות שאנחנו מציעים.",
"plan_upgrade": "כדי שיהיה לך יותר מסוג אירוע פעיל אחד, עליך לשדרג את החבילה.",
"plan_upgrade_teams": "כדי ליצור צוות, עליך לשדרג את החבילה.",
"plan_upgrade_instructions": "ניתן <1>לשדרג אותה כאן</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/it/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Sola lettura",
"one_time_link": "Link monouso",
"plan_description": "Al momento sei nel piano {{plan}}.",
"plan_upgrade_invitation": "Passa al piano Pro per sbloccare tutte le funzionalità che abbiamo da offrire.",
"plan_upgrade": "È necessario aggiornare il piano per avere più di un tipo di evento attivo.",
"plan_upgrade_teams": "Devi aggiornare il tuo piano per creare un team.",
"plan_upgrade_instructions": "Puoi <1>cambiare piano qui</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/nl/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Enkel-lezen",
"one_time_link": "Eenmalige link",
"plan_description": "U heeft momenteel het {{plan}}-abonnement.",
"plan_upgrade_invitation": "Upgrade uw account naar het Pro-abonnement om alle functies te ontgrendelen die we te bieden hebben.",
"plan_upgrade": "U moet uw abonnement upgraden om meer dan één actief afspraaktype te hebben.",
"plan_upgrade_teams": "U moet uw abonnement upgraden om een team aan te maken.",
"plan_upgrade_instructions": "U kunt <1>hier upgraden</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/pl/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Tylko do odczytu",
"one_time_link": "Link jednorazowy",
"plan_description": "Jesteś obecnie na planie {{plan}}.",
"plan_upgrade_invitation": "Ulepsz swoje konto do planu Pro, aby odblokować wszystkie funkcje, które mamy do zaoferowania.",
"plan_upgrade": "Musisz ulepszyć swój plan, aby mieć więcej niż jeden aktywny typ zdarzeń.",
"plan_upgrade_teams": "Musisz ulepszyć swój plan, aby utworzyć drużynę.",
"plan_upgrade_instructions": "Możesz <1>ulepszyć tutaj</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/pt-BR/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Somente leitura",
"one_time_link": "Link único",
"plan_description": "Atualmente você está no plano {{plan}}.",
"plan_upgrade_invitation": "Atualize a sua conta para o plano Pro e desbloqueie todos os recursos que temos para oferecer.",
"plan_upgrade": "Você precisa fazer um upgrade do seu plano para ter mais de um tipo de evento ativo.",
"plan_upgrade_teams": "Você precisa fazer upgrade do seu plano para criar um time.",
"plan_upgrade_instructions": "Você pode <1>atualizar aqui</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/pt/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Somente Leitura",
"one_time_link": "Ligação de utilização única",
"plan_description": "O seu plano é o {{plan}}.",
"plan_upgrade_invitation": "Actualize a sua conta para o plano Pro para desbloquear todas as funcionalidades que temos para oferecer.",
"plan_upgrade": "Tem de atualizar o seu plano para ter mais de um tipo de evento ativo.",
"plan_upgrade_teams": "Tem de actualizar o seu plano para poder criar uma equipa.",
"plan_upgrade_instructions": "Pode <1>actualizar aqui</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/ro/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Needitabil",
"one_time_link": "Link unic",
"plan_description": "Aveți momentan planul {{plan}}.",
"plan_upgrade_invitation": "Faceți upgrade-ul contului la planul Pro pentru a activa toate avantajele pe care le oferim.",
"plan_upgrade": "Trebuie actualizat planul pentru a avea mai mult de un tip de eveniment activ.",
"plan_upgrade_teams": "Trebuie să faceți upgrade-ul planului pentru a crea o echipă.",
"plan_upgrade_instructions": "Puteți face <1>upgrade aici</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/ru/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Только для чтения",
"one_time_link": "Одноразовая ссылка",
"plan_description": "В настоящее время вы используете план {{plan}}.",
"plan_upgrade_invitation": "Перейдите на тарифный план Pro, чтобы воспользоваться всеми доступными функциями.",
"plan_upgrade": "Необходимо обновить тарифный план, чтобы иметь более одного активного типа события.",
"plan_upgrade_teams": "Вам нужно обновить тарифный план для создания команды.",
"plan_upgrade_instructions": "<1>Перейти на новый тарифный план</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/sv/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Skrivskyddad",
"one_time_link": "Engångslänk",
"plan_description": "Du är för närvarande på {{plan}} planen.",
"plan_upgrade_invitation": "Uppgradera ditt konto till pro-planen för att låsa upp alla funktioner vi har att erbjuda.",
"plan_upgrade": "Du måste uppgradera din plan för att ha mer än en aktiv händelsetyp.",
"plan_upgrade_teams": "Du behöver uppgradera din plan för att skapa ett team.",
"plan_upgrade_instructions": "Du kan <1>uppgradera här</1>.",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/uk/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
"readonly": "Тільки читання",
"one_time_link": "Одноразове посилання",
"plan_description": "Зараз ви використовуєте план {{plan}}.",
"plan_upgrade_invitation": "Перейдіть на план Pro, щоб отримати доступ до всіх наших функцій.",
"plan_upgrade": "Щоб мати кілька активних типів заходів, потрібно перейти на план вищого рівня.",
"plan_upgrade_teams": "Щоб створити команду, потрібно перейти на план вищого рівня.",
"plan_upgrade_instructions": " <1>Перейти можна тут</1>.",
Expand Down
36 changes: 32 additions & 4 deletions apps/web/server/routers/viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,10 @@ const loggedInViewerRouter = createProtectedRouter()
.mutation("deleteCredential", {
input: z.object({
id: z.number(),
externalId: z.string().optional(),
}),
async resolve({ input, ctx }) {
const { id } = input;
const { id, externalId } = input;

const credential = await prisma.credential.findFirst({
where: {
Expand Down Expand Up @@ -1060,14 +1061,41 @@ const loggedInViewerRouter = createProtectedRouter()
}
}

// If it's a calendar, remove the destination claendar from the event type
// If it's a calendar, remove the destination calendar from the event type
if (credential.app?.categories.includes(AppCategories.calendar)) {
if (eventType.destinationCalendar?.integration === credential.type) {
await prisma.destinationCalendar.delete({
const destinationCalendar = await prisma.destinationCalendar.findFirst({
where: {
id: eventType.destinationCalendar.id,
id: eventType.destinationCalendar?.id,
},
});
if (destinationCalendar) {
await prisma.destinationCalendar.delete({
where: {
id: destinationCalendar.id,
},
});
}
}

if (externalId) {
const existingSelectedCalendar = await prisma.selectedCalendar.findFirst({
where: {
externalId: externalId,
},
});
// @TODO: SelectedCalendar doesn't have unique ID so we should only delete one item
if (existingSelectedCalendar) {
await prisma.selectedCalendar.delete({
where: {
userId_integration_externalId: {
userId: existingSelectedCalendar.userId,
externalId: existingSelectedCalendar.externalId,
integration: existingSelectedCalendar.integration,
},
},
});
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/app-store/apps.browser.generated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ whereby:whereby_installAppButton,
wipemycalother:wipemycalother_installAppButton,
zapier:zapier_installAppButton,
zoomvideo:zoomvideo_installAppButton,
};
};
2 changes: 1 addition & 1 deletion packages/app-store/apps.server.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ whereby:whereby_api,
wipemycalother:wipemycalother_api,
zapier:zapier_api,
zoomvideo:zoomvideo_api,
};
};
20 changes: 11 additions & 9 deletions packages/app-store/office365calendar/lib/CalendarService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,18 @@ export default class Office365CalendarService implements Calendar {
});
const responseBody = await handleErrorsJson(response);
return responseBody.responses.reduce(
(acc: BufferedBusyTime[], subResponse: { body: { value: any[] } }) =>
(acc: BufferedBusyTime[], subResponse: { body: { value?: any[] } }) =>
acc.concat(
subResponse.body.value
.filter((evt) => evt.showAs !== "free" && evt.showAs !== "workingElsewhere")
.map((evt) => {
return {
start: evt.start.dateTime + "Z",
end: evt.end.dateTime + "Z",
};
})
subResponse.body?.value
? subResponse.body.value
.filter((evt) => evt.showAs !== "free" && evt.showAs !== "workingElsewhere")
.map((evt) => {
return {
start: evt.start.dateTime + "Z",
end: evt.end.dateTime + "Z",
};
})
: []
),
[]
);
Expand Down

1 comment on commit d32ea5d

@vercel
Copy link

@vercel vercel bot commented on d32ea5d Jul 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment failed with the following error:

The total size of all Environment Variables (4.78KB) exceeds 4KB.

Learn More: https://vercel.link/env-vars-limit

Please sign in to comment.