chore: atoms and docs update (#19137)

* hide docs for old google connect endpoint

* update docs for atoms

* fix css styles for week view

* update v2 reference

* add dutch translations in cal provider

* fix: add nl i18n in BaseCalProvider

---------

Co-authored-by: Morgan Vernay <morgan@cal.com>
This commit is contained in:
Rajiv Sahal
2025-02-10 20:05:28 +00:00
committed by GitHub
co-authored by Morgan Vernay
parent 77d0fa9ff8
commit cc6016aef3
8 changed files with 33 additions and 162 deletions
+3 -2
View File
@@ -26,7 +26,8 @@ import {
Headers,
} from "@nestjs/common";
import { ConfigService } from "@nestjs/config";
import { ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiExcludeController } from "@nestjs/swagger";
import { ApiOperation } from "@nestjs/swagger";
import { Request } from "express";
import { APPS_READ, GOOGLE_CALENDAR_TYPE, SUCCESS_STATUS } from "@calcom/platform-constants";
@@ -41,7 +42,7 @@ const CALENDAR_SCOPES = [
path: "/v2/gcal",
version: API_VERSIONS_VALUES,
})
@DocsTags("Platform / Google Calendar")
@ApiExcludeController(true)
export class GcalController {
private readonly logger = new Logger("Platform Gcal Provider");
-150
View File
@@ -63,98 +63,6 @@
]
}
},
"/v2/gcal/oauth/auth-url": {
"get": {
"operationId": "GcalController_redirect",
"summary": "Get auth URL",
"parameters": [
{
"name": "Authorization",
"required": true,
"in": "header",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GcalAuthUrlOutput"
}
}
}
}
},
"tags": [
"Platform / Google Calendar"
]
}
},
"/v2/gcal/oauth/save": {
"get": {
"operationId": "GcalController_save",
"summary": "Connect a calendar",
"parameters": [
{
"name": "state",
"required": true,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "code",
"required": true,
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GcalSaveRedirectOutput"
}
}
}
}
},
"tags": [
"Platform / Google Calendar"
]
}
},
"/v2/gcal/check": {
"get": {
"operationId": "GcalController_check",
"summary": "Check a calendar connection status",
"parameters": [],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GcalCheckOutput"
}
}
}
}
},
"tags": [
"Platform / Google Calendar"
]
}
},
"/v2/oauth-clients/{clientId}/users": {
"get": {
"operationId": "OAuthClientUsersController_getManagedUsers",
@@ -14304,64 +14212,6 @@
"data"
]
},
"AuthUrlData": {
"type": "object",
"properties": {
"authUrl": {
"type": "string"
}
},
"required": [
"authUrl"
]
},
"GcalAuthUrlOutput": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success",
"enum": [
"success",
"error"
]
},
"data": {
"$ref": "#/components/schemas/AuthUrlData"
}
},
"required": [
"status",
"data"
]
},
"GcalSaveRedirectOutput": {
"type": "object",
"properties": {
"url": {
"type": "string"
}
},
"required": [
"url"
]
},
"GcalCheckOutput": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success",
"enum": [
"success",
"error"
]
}
},
"required": [
"status"
]
},
"ProviderVerifyClientData": {
"type": "object",
"properties": {
@@ -100,6 +100,10 @@ Below is a list of props that can be passed to the availability settings atom.
| onDeleteSuccess | No | A callback function that gets triggered when the user availability is deleted successfully |
| onDeleteError | No | A callback function that gets triggered when the user availability fails to delete |
| enableOverrides | No | Allows user to enable or disable date overrides display in the atom; defaults to disabled |
| disableEditableHeading | No | Prevents users from editing the heading |
| allowDelete | No | When set to false, this prop hides the delete button |
| allowSetToDefault | No | When set to false, this prop hides the set to default toggle |
| disableToasts | No | Allows users to enable or disable toast notifications, with the default setting being disabled. |
Along with the props, Availability settings atom accepts custom styles via the **customClassNames** prop. Below is a list of props that fall under this **customClassNames** prop.
<p></p>
+4 -1
View File
@@ -116,7 +116,10 @@ Below is a list of props that can be passed to the booker atom.
| onReserveSlotSuccess | No | Callback function for successful slot reservation |
| onReserveSlotError | No | Callback function triggered on slot reservation failure |
| onDeleteSlotSuccess | No | Callback function for successful slot deletion |
| onDeleteSlotError | No | Callback function triggered on slot deletion failure
| onDeleteSlotError | No | Callback function triggered on slot deletion failure
| view | No | Specifies the layout of the booker atom into column, week, or month view |
| metadata | No | Used to pass custom metadata values into the booker. Metadata should be an object eg: `{ bookingSource: "website", userRole: "admin" }` |
| bannerUrl | No | Adds custom banner to the booker atom |
Along with the props, booker atom accepts custom styles via the **customClassNames** prop. Below is a list of props that fall under this **customClassNames** prop.
<p></p>
+2 -2
View File
@@ -85,12 +85,12 @@ Customizations can be done to the destination calendar settings atom via props.
The selected calendar settings atom lets you select which calendars you want to check for conflicts to prevent double bookings. Below code snippet can be used to render the selected calendar settings atom.
```js
import { SelectedCalendarSettings } from "@calcom/atoms";
import { SelectedCalendarsSettings } from "@calcom/atoms";
export default function SelectedCalendars( props : SelectedCalendarsProps ) {
return (
<>
<SelectedCalendarSettings classNames="mx-5 mb-6" />
<SelectedCalendarsSettings classNames="mx-5 mb-6" />
</>
)
}
@@ -7,6 +7,7 @@ import deTranslations from "@calcom/web/public/static/locales/de/common.json";
import enTranslations from "@calcom/web/public/static/locales/en/common.json";
import esTranslations from "@calcom/web/public/static/locales/es/common.json";
import frTranslations from "@calcom/web/public/static/locales/fr/common.json";
import nlTranslations from "@calcom/web/public/static/locales/nl/common.json";
import ptBrTranslations from "@calcom/web/public/static/locales/pt-BR/common.json";
import { AtomsContext } from "../hooks/useAtomsContext";
@@ -27,6 +28,7 @@ import type {
ptBrTranslationKeys,
deTranslationKeys,
esTranslationKeys,
nlTranslationKeys,
} from "./CalProvider";
export function BaseCalProvider({
@@ -208,6 +210,8 @@ function getTranslation(key: string, language: CalProviderLanguagesType) {
return deTranslations[key as deTranslationKeys];
case "es":
return esTranslations[key as esTranslationKeys];
case "nl":
return nlTranslations[key as nlTranslationKeys];
default:
return enTranslations[key as enTranslationKeys];
}
@@ -9,6 +9,7 @@ import type deTranslations from "@calcom/web/public/static/locales/de/common.jso
import type enTranslations from "@calcom/web/public/static/locales/en/common.json";
import type esTranslations from "@calcom/web/public/static/locales/es/common.json";
import type frTranslations from "@calcom/web/public/static/locales/fr/common.json";
import type nlTranslations from "@calcom/web/public/static/locales/nl/common.json";
import type ptBrTranslations from "@calcom/web/public/static/locales/pt-BR/common.json";
import http from "../lib/http";
@@ -19,19 +20,22 @@ export type frTranslationKeys = keyof typeof frTranslations;
export type deTranslationKeys = keyof typeof deTranslations;
export type esTranslationKeys = keyof typeof esTranslations;
export type ptBrTranslationKeys = keyof typeof ptBrTranslations;
export type nlTranslationKeys = keyof typeof nlTranslations;
export type translationKeys =
| enTranslationKeys
| frTranslationKeys
| deTranslationKeys
| esTranslationKeys
| ptBrTranslationKeys;
| ptBrTranslationKeys
| nlTranslationKeys;
const FR = "fr";
export const EN = "en";
const PT_BR = "pt-BR";
const DE = "de";
const ES = "es";
export const CAL_PROVIDER_LANGUAUES = [FR, EN, PT_BR, DE, ES] as const;
const NL = "nl";
export const CAL_PROVIDER_LANGUAUES = [FR, EN, PT_BR, DE, ES, NL] as const;
export type CalProviderLanguagesType = (typeof CAL_PROVIDER_LANGUAUES)[number];
const queryClient = new QueryClient();
@@ -61,7 +65,12 @@ type i18nEsProps = {
language?: "es";
};
export type i18nProps = i18nFrProps | i18nEnProps | i18nPtBrProps | i18nDeProps | i18nEsProps;
type i18nNlProps = {
labels?: Partial<Record<nlTranslationKeys, string>>;
language?: "nl";
};
export type i18nProps = i18nFrProps | i18nEnProps | i18nPtBrProps | i18nDeProps | i18nEsProps | i18nNlProps;
export type CalProviderProps = {
children?: ReactNode;
+4 -4
View File
@@ -13182,19 +13182,19 @@ select {
--calendar-dates-sticky-offset:66px
}
.\[--disabled-gradient-background\: \#E5E7EB\] {
.\[--disabled-gradient-background\:\#E5E7EB\] {
--disabled-gradient-background:#e5e7eb
}
.\[--disabled-gradient-background\: \#F8F9FB\] {
.\[--disabled-gradient-background\:\#F8F9FB\] {
--disabled-gradient-background:#f8f9fb
}
.\[--disabled-gradient-foreground\: \#D1D5DB\] {
.\[--disabled-gradient-foreground\:\#D1D5DB\] {
--disabled-gradient-foreground:#d1d5db
}
.\[--disabled-gradient-foreground\: \#E6E7EB\] {
.\[--disabled-gradient-foreground\:\#E6E7EB\] {
--disabled-gradient-foreground:#e6e7eb
}