fix: atoms icons and build issues (#16248)
* fix: atoms icons and build issues * fixup! fix: atoms icons and build issues * fixup! fixup! fix: atoms icons and build issues * fix import paths * rename SchedulingType to something more specific * fix: Invalid define value (must be an entity name or valid JSON syntax) * chore: atoms build CI job * chore: enable atoms build in CI * fix build * fixup! fix build * fixup! fixup! fix build * chore: replace calendar-days icon with calendar * fixup! Merge branch 'fix-atoms-build-icons' of github.com:calcom/cal.com into fix-atoms-build-icons * fixup! Merge branch 'fix-atoms-build-icons' of github.com:calcom/cal.com into fix-atoms-build-icons * fixup! Merge branch 'fix-atoms-build-icons' of github.com:calcom/cal.com into fix-atoms-build-icons --------- Co-authored-by: Lauris Skraucis <[email protected]> Co-authored-by: Ryukemeister <[email protected]> Co-authored-by: supalarry <[email protected]>
This commit is contained in:
35 files changed
+284
-72
No files matched your search
@@ -1,21 +1,19 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import type {
|
||||
BookingLimitsKeyOutputType_2024_06_14,
|
||||
TransformBookingLimitsSchema_2024_06_14,
|
||||
} from "@calcom/platform-types";
|
||||
import {
|
||||
BookingWindowPeriodInputTypeEnum_2024_06_14,
|
||||
BookingWindowPeriodOutputTypeEnum_2024_06_14,
|
||||
BookingLimitsEnum_2024_06_14,
|
||||
} from "@calcom/platform-enums/monorepo";
|
||||
import {
|
||||
type CreateEventTypeInput_2024_06_14,
|
||||
type Integration_2024_06_14,
|
||||
type BusinessDaysWindow_2024_06_14,
|
||||
type RangeWindow_2024_06_14,
|
||||
type TransformFutureBookingsLimitSchema_2024_06_14,
|
||||
type BookingLimitsKeyOutputType_2024_06_14,
|
||||
type TransformBookingLimitsSchema_2024_06_14,
|
||||
} from "@calcom/platform-types";
|
||||
import {
|
||||
BookingWindowPeriodInputTypeEnum_2024_06_14,
|
||||
BookingWindowPeriodOutputTypeEnum_2024_06_14,
|
||||
} from "@calcom/platform-types/event-types/event-types_2024_06_14/inputs/enums/booking-window.enum";
|
||||
import { BookingLimitsEnum_2024_06_14 } from "@calcom/platform-types/event-types/event-types_2024_06_14/inputs/enums/interval-limits.enum";
|
||||
|
||||
const integrationsMapping: Record<Integration_2024_06_14, string> = {
|
||||
"cal-video": "integrations:daily",
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
import {
|
||||
BookingWindowPeriodInputTypeEnum_2024_06_14,
|
||||
BookingWindowPeriodOutputTypeEnum_2024_06_14,
|
||||
BookingLimitsEnum_2024_06_14,
|
||||
} from "@calcom/platform-enums/monorepo";
|
||||
import type {
|
||||
AddressLocation_2024_06_14,
|
||||
IntegrationLocation_2024_06_14,
|
||||
@@ -13,11 +18,6 @@ import type {
|
||||
BusinessDaysWindow_2024_06_14,
|
||||
BookingField_2024_06_14,
|
||||
} from "@calcom/platform-types";
|
||||
import {
|
||||
BookingWindowPeriodInputTypeEnum_2024_06_14,
|
||||
BookingWindowPeriodOutputTypeEnum_2024_06_14,
|
||||
} from "@calcom/platform-types/event-types/event-types_2024_06_14/inputs/enums/booking-window.enum";
|
||||
import { BookingLimitsEnum_2024_06_14 } from "@calcom/platform-types/event-types/event-types_2024_06_14/inputs/enums/interval-limits.enum";
|
||||
|
||||
import type { transformApiEventTypeBookingFields, transformApiEventTypeLocations } from "./api-request";
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ export const AppleConnect: FC<Partial<Omit<OAuthConnectProps, "redir">>> = ({
|
||||
<Dialog open={isDialogOpen}>
|
||||
<DialogTrigger>
|
||||
<Button
|
||||
StartIcon="calendar-days"
|
||||
StartIcon="calendar"
|
||||
color="primary"
|
||||
disabled={isDisabled}
|
||||
className={cn("", className, isDisabled && "cursor-not-allowed", !isDisabled && "cursor-pointer")}
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
"typescript": "^4.9.4",
|
||||
"vite": "^5.0.10",
|
||||
"vite-plugin-dts": "^3.7.3",
|
||||
"vite-plugin-inspect": "^0.8.4"
|
||||
"vite-plugin-inspect": "^0.8.4",
|
||||
"vite-plugin-node-polyfills": "^0.22.0"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@@ -1,59 +1,66 @@
|
||||
import react from "@vitejs/plugin-react-swc";
|
||||
import path from "path";
|
||||
import { resolve } from "path";
|
||||
import { defineConfig } from "vite";
|
||||
import { defineConfig, loadEnv } from "vite";
|
||||
import dts from "vite-plugin-dts";
|
||||
import Inspect from "vite-plugin-inspect";
|
||||
|
||||
export default defineConfig({
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
"@calcom/lib",
|
||||
"@calcom/features",
|
||||
"@calcom/prisma",
|
||||
"@calcom/dayjs",
|
||||
"@calcom/platform-constants",
|
||||
"@calcom/platform-types",
|
||||
"@calcom/platform-utils",
|
||||
],
|
||||
},
|
||||
plugins: [Inspect(), react(), dts({ insertTypesEntry: true })],
|
||||
build: {
|
||||
commonjsOptions: {
|
||||
include: [/@calcom\/lib/, /@calcom\/features/, /node_modules/],
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), ""); // .env inside of packages/platform/atoms
|
||||
const webAppUrl = env.NEXT_PUBLIC_WEBAPP_URL ?? "https://app.cal.com";
|
||||
return {
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
"@calcom/lib",
|
||||
"@calcom/features",
|
||||
"@calcom/prisma",
|
||||
"@calcom/dayjs",
|
||||
"@calcom/platform-constants",
|
||||
"@calcom/platform-types",
|
||||
"@calcom/platform-utils",
|
||||
],
|
||||
},
|
||||
lib: {
|
||||
entry: [resolve(__dirname, "index.ts")],
|
||||
name: "CalAtoms",
|
||||
fileName: "cal-atoms",
|
||||
plugins: [Inspect(), react(), dts({ insertTypesEntry: true })],
|
||||
define: {
|
||||
"process.env.NEXT_PUBLIC_WEBAPP_URL": `"${webAppUrl}"`,
|
||||
},
|
||||
rollupOptions: {
|
||||
external: ["react", "fs", "path", "os", "react-dom"],
|
||||
output: {
|
||||
globals: {
|
||||
react: "React",
|
||||
"react-dom": "ReactDOM",
|
||||
build: {
|
||||
commonjsOptions: {
|
||||
include: [/@calcom\/lib/, /@calcom\/features/, /node_modules/],
|
||||
},
|
||||
lib: {
|
||||
entry: [resolve(__dirname, "index.ts")],
|
||||
name: "CalAtoms",
|
||||
fileName: "cal-atoms",
|
||||
},
|
||||
rollupOptions: {
|
||||
external: ["react", "fs", "path", "os", "react-dom"],
|
||||
output: {
|
||||
globals: {
|
||||
react: "React",
|
||||
"react-dom": "ReactDOM",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
fs: resolve("../../../node_modules/rollup-plugin-node-builtins"),
|
||||
path: resolve("../../../node_modules/rollup-plugin-node-builtins"),
|
||||
os: resolve("../../../node_modules/rollup-plugin-node-builtins"),
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
".prisma/client": path.resolve(__dirname, "../../prisma-client"),
|
||||
"@prisma/client": path.resolve(__dirname, "../../prisma-client"),
|
||||
"@calcom/prisma": path.resolve(__dirname, "../../prisma"),
|
||||
"@calcom/dayjs": path.resolve(__dirname, "../../dayjs"),
|
||||
"@calcom/platform-constants": path.resolve(__dirname, "../constants/index.ts"),
|
||||
"@calcom/platform-types": path.resolve(__dirname, "../types/index.ts"),
|
||||
"@calcom/platform-utils": path.resolve(__dirname, "../constants/index.ts"),
|
||||
"@calcom/web/public/static/locales/en/common.json": path.resolve(
|
||||
__dirname,
|
||||
"../../../apps/web/public/static/locales/en/common.json"
|
||||
),
|
||||
resolve: {
|
||||
alias: {
|
||||
fs: resolve("../../../node_modules/rollup-plugin-node-builtins"),
|
||||
path: resolve("../../../node_modules/rollup-plugin-node-builtins"),
|
||||
os: resolve("../../../node_modules/rollup-plugin-node-builtins"),
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
".prisma/client": path.resolve(__dirname, "../../prisma-client"),
|
||||
"@prisma/client": path.resolve(__dirname, "../../prisma-client"),
|
||||
"@calcom/prisma": path.resolve(__dirname, "../../prisma"),
|
||||
"@calcom/dayjs": path.resolve(__dirname, "../../dayjs"),
|
||||
"@calcom/platform-constants": path.resolve(__dirname, "../constants/index.ts"),
|
||||
"@calcom/platform-types": path.resolve(__dirname, "../types/index.ts"),
|
||||
"@calcom/platform-utils": path.resolve(__dirname, "../constants/index.ts"),
|
||||
"@calcom/web/public/static/locales/en/common.json": path.resolve(
|
||||
__dirname,
|
||||
"../../../apps/web/public/static/locales/en/common.json"
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
Contains enums shared by platform api and packages
|
||||
|
||||
from api-v2 please import from @calcom/platform-enums
|
||||
|
||||
from any other package please import from @calcom/platform-enums/monorepo
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,7 @@
|
||||
export * from "./event-types/booking-window.enum";
|
||||
export * from "./event-types/editable";
|
||||
export * from "./event-types/field-type";
|
||||
export * from "./event-types/interval-limits.enum";
|
||||
export * from "./event-types/period-type";
|
||||
export * from "./event-types/scheduling-type";
|
||||
export * from "./event-types/frequency";
|
||||
@@ -0,0 +1,7 @@
|
||||
export * from "./event-types/booking-window.enum";
|
||||
export * from "./event-types/editable";
|
||||
export * from "./event-types/field-type";
|
||||
export * from "./event-types/interval-limits.enum";
|
||||
export * from "./event-types/period-type";
|
||||
export * from "./event-types/scheduling-type";
|
||||
export * from "./event-types/frequency";
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@calcom/platform-enums",
|
||||
"version": "0.0.0",
|
||||
"main": "./dist/index.ts",
|
||||
"types": "./dist/index.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts.map"
|
||||
},
|
||||
"./monorepo": {
|
||||
"import": "./monorepo.ts",
|
||||
"require": "./monorepo.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest ./tests",
|
||||
"build": "rm -rf ./dist && tsc --build --force tsconfig.json",
|
||||
"build:watch": "tsc --build --force ./tsconfig.json --watch",
|
||||
"post-install": "yarn build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@calcom/platform-constants": "*"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import {
|
||||
BOOKING_READ,
|
||||
BOOKING_WRITE,
|
||||
EVENT_TYPE_READ,
|
||||
EVENT_TYPE_WRITE,
|
||||
PERMISSIONS,
|
||||
SCHEDULE_READ,
|
||||
SCHEDULE_WRITE,
|
||||
APPS_READ,
|
||||
APPS_WRITE,
|
||||
PROFILE_READ,
|
||||
PROFILE_WRITE,
|
||||
} from "@calcom/platform-constants";
|
||||
import type { PLATFORM_PERMISSION } from "@calcom/platform-types";
|
||||
|
||||
export const hasPermission = (userPermissions: number, permission: PLATFORM_PERMISSION): boolean => {
|
||||
// use bitwise AND to check if user has the permission
|
||||
return (userPermissions & permission) === permission;
|
||||
};
|
||||
|
||||
export const hasPermissions = (userPermissions: number, permissions: PLATFORM_PERMISSION[]): boolean => {
|
||||
// use bitwise AND to check if each required permission is present
|
||||
return permissions.every((permission) => hasPermission(userPermissions, permission));
|
||||
};
|
||||
|
||||
export const hasEventTypeReadPermission = (userPermissions: number): boolean => {
|
||||
return hasPermission(userPermissions, EVENT_TYPE_READ);
|
||||
};
|
||||
|
||||
export const hasEventTypeWritePermission = (userPermissions: number): boolean => {
|
||||
return hasPermission(userPermissions, EVENT_TYPE_WRITE);
|
||||
};
|
||||
|
||||
export const hasBookingReadPermission = (userPermissions: number): boolean => {
|
||||
return hasPermission(userPermissions, BOOKING_READ);
|
||||
};
|
||||
|
||||
export const hasBookingWritePermission = (userPermissions: number): boolean => {
|
||||
return hasPermission(userPermissions, BOOKING_WRITE);
|
||||
};
|
||||
|
||||
export const hasScheduleReadPermission = (userPermissions: number): boolean => {
|
||||
return hasPermission(userPermissions, SCHEDULE_READ);
|
||||
};
|
||||
|
||||
export const hasScheduleWritePermission = (userPermissions: number): boolean => {
|
||||
return hasPermission(userPermissions, SCHEDULE_WRITE);
|
||||
};
|
||||
|
||||
export const hasAppsReadPermission = (userPermissions: number): boolean => {
|
||||
return hasPermission(userPermissions, APPS_READ);
|
||||
};
|
||||
|
||||
export const hasAppsWritePermission = (userPermissions: number): boolean => {
|
||||
return hasPermission(userPermissions, APPS_WRITE);
|
||||
};
|
||||
|
||||
export const hasProfileReadPermission = (userPermissions: number): boolean => {
|
||||
return hasPermission(userPermissions, PROFILE_READ);
|
||||
};
|
||||
|
||||
export const hasProfileWritePermission = (userPermissions: number): boolean => {
|
||||
return hasPermission(userPermissions, PROFILE_WRITE);
|
||||
};
|
||||
|
||||
export const listPermissions = (userPermissions: number): PLATFORM_PERMISSION[] => {
|
||||
return PERMISSIONS.reduce((acc, permission) => {
|
||||
if (hasPermission(userPermissions, permission)) {
|
||||
return [...acc, permission];
|
||||
}
|
||||
return acc;
|
||||
}, [] as PLATFORM_PERMISSION[]);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "@calcom/tsconfig/base.json",
|
||||
"compilerOptions": {
|
||||
"target": "ES5",
|
||||
"resolveJsonModule": true,
|
||||
"experimentalDecorators": true,
|
||||
"baseUrl": "./",
|
||||
"outDir": "./dist"
|
||||
},
|
||||
"include": ["."],
|
||||
"exclude": ["dist", "node_modules"]
|
||||
}
|
||||
+1
-1
@@ -13,7 +13,7 @@ import {
|
||||
IsBoolean,
|
||||
} from "class-validator";
|
||||
|
||||
import { BookingWindowPeriodInputTypeEnum_2024_06_14 } from "./enums/booking-window.enum";
|
||||
import { BookingWindowPeriodInputTypeEnum_2024_06_14 } from "@calcom/platform-enums";
|
||||
|
||||
export type BookingWindowPeriodInputType_2024_06_14 = "businessDays" | "calendarDays" | "range";
|
||||
export type BookingWindowPeriodOutputType_2024_06_14 = "RANGE" | "ROLLING_WINDOW" | "ROLLING";
|
||||
|
||||
+2
-1
@@ -11,6 +11,8 @@ import {
|
||||
ValidateNested,
|
||||
} from "class-validator";
|
||||
|
||||
import { SchedulingType } from "@calcom/platform-enums";
|
||||
|
||||
import type { BookingField_2024_06_14 } from "./booking-fields.input";
|
||||
import { ValidateBookingFields_2024_06_14 } from "./booking-fields.input";
|
||||
import { BookingLimitsCount_2024_06_14, ValidateBookingLimistsCount } from "./booking-limits-count.input";
|
||||
@@ -20,7 +22,6 @@ import {
|
||||
} from "./booking-limits-duration.input";
|
||||
import type { BookingWindow_2024_06_14 } from "./booking-window.input";
|
||||
import { ValidateBookingWindow } from "./booking-window.input";
|
||||
import { SchedulingType } from "./enums/scheduling-type";
|
||||
import { ValidateLocations_2024_06_14 } from "./locations.input";
|
||||
import type { Location_2024_06_14 } from "./locations.input";
|
||||
|
||||
|
||||
+3
-3
@@ -24,7 +24,7 @@ enum SchedulingTypeEnum {
|
||||
MANAGED = "MANAGED",
|
||||
}
|
||||
|
||||
export type SchedulingType = "ROUND_ROBIN" | "COLLECTIVE" | "MANAGED";
|
||||
export type EventTypesOutputSchedulingType = "ROUND_ROBIN" | "COLLECTIVE" | "MANAGED";
|
||||
|
||||
class User_2024_06_14 {
|
||||
@IsInt()
|
||||
@@ -99,7 +99,7 @@ export class EventTypeOutput_2024_06_14 {
|
||||
afterEventBuffer?: number;
|
||||
|
||||
@IsEnum(SchedulingTypeEnum)
|
||||
schedulingType!: SchedulingType | null;
|
||||
schedulingType!: EventTypesOutputSchedulingType | null;
|
||||
|
||||
@Type(() => RecurringEvent_2024_06_14)
|
||||
recurringEvent!: RecurringEvent_2024_06_14 | null;
|
||||
@@ -209,7 +209,7 @@ export class TeamEventTypeOutput_2024_06_14 {
|
||||
afterEventBuffer?: number;
|
||||
|
||||
@IsEnum(SchedulingTypeEnum)
|
||||
schedulingType!: SchedulingType | null;
|
||||
schedulingType!: EventTypesOutputSchedulingType | null;
|
||||
|
||||
@Type(() => RecurringEvent_2024_06_14)
|
||||
recurringEvent!: RecurringEvent_2024_06_14 | null;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@calcom/platform-constants": "*",
|
||||
"@calcom/platform-enums": "*",
|
||||
"@types/express": "^4.17.21",
|
||||
"class-validator": "^0.14.0"
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"@calcom/lib": ["../lib"],
|
||||
"@calcom/lib/*": ["../lib/*"],
|
||||
"@calcom/platform-constants": ["../platform/constants/index.ts"],
|
||||
"@calcom/platform-enums": ["../platform/enums/index.ts"],
|
||||
"@calcom/platform-types": ["../platform/types/index.ts"],
|
||||
"@calcom/platform-utils": ["../platform/utils/index.ts"],
|
||||
"@calcom/prisma": ["../prisma"],
|
||||
|
||||
@@ -13,6 +13,7 @@ export const lucideIconList = new Set([
|
||||
"badge-check",
|
||||
"ban",
|
||||
"bell",
|
||||
"blocks",
|
||||
"bold",
|
||||
"book-open-check",
|
||||
"book-open",
|
||||
@@ -137,5 +138,4 @@ export const lucideIconList = new Set([
|
||||
"webhook",
|
||||
"x",
|
||||
"zap",
|
||||
"blocks",
|
||||
]);
|
||||
@@ -20,6 +20,7 @@ export type IconName =
|
||||
| "book-user"
|
||||
| "building"
|
||||
| "calendar-check-2"
|
||||
| "calendar-days"
|
||||
| "calendar-heart"
|
||||
| "calendar-search"
|
||||
| "calendar-x-2"
|
||||
|
||||
Reference in new issue
Block a user