Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: atoms and docs update #19137

Merged
merged 8 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/api/v2/src/ee/gcal/gcal.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -41,7 +42,7 @@ const CALENDAR_SCOPES = [
path: "/v2/gcal",
version: API_VERSIONS_VALUES,
})
@DocsTags("Platform / Google Calendar")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is one of the old endpoints we initially had when there was only the google connect atom, good to hide this from docs now.

@ApiExcludeController(true)
export class GcalController {
private readonly logger = new Logger("Platform Gcal Provider");

Expand Down
150 changes: 0 additions & 150 deletions apps/api/v2/swagger/documentation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down
4 changes: 4 additions & 0 deletions docs/platform/atoms/availability-settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
5 changes: 4 additions & 1 deletion docs/platform/atoms/booker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions docs/platform/atoms/calendar-settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

typo fix


export default function SelectedCalendars( props : SelectedCalendarsProps ) {
return (
<>
<SelectedCalendarSettings classNames="mx-5 mb-6" />
<SelectedCalendarsSettings classNames="mx-5 mb-6" />
</>
)
}
Expand Down
4 changes: 4 additions & 0 deletions packages/platform/atoms/cal-provider/BaseCalProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -27,6 +28,7 @@ import type {
ptBrTranslationKeys,
deTranslationKeys,
esTranslationKeys,
nlTranslationKeys,
} from "./CalProvider";

export function BaseCalProvider({
Expand Down Expand Up @@ -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];
}
Expand Down
15 changes: 12 additions & 3 deletions packages/platform/atoms/cal-provider/CalProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding dutch translations


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();
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions packages/platform/atoms/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Loading