Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/calcom/cal.com into feat_#1…
Browse files Browse the repository at this point in the history
…6333_teamOOOCrud
  • Loading branch information
vijayraghav-io committed Dec 11, 2024
2 parents b06b8db + dd3505a commit 5973e78
Show file tree
Hide file tree
Showing 24 changed files with 1,172 additions and 157 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ APP_ROUTER_APPS_CATEGORIES_ENABLED=0
APP_ROUTER_APPS_CATEGORIES_CATEGORY_ENABLED=0
APP_ROUTER_BOOKING_ENABLED=0
APP_ROUTER_BOOKINGS_STATUS_ENABLED=0
APP_ROUTER_WORKFLOWS_ENABLED=0
APP_ROUTER_GETTING_STARTED_STEP_ENABLED=0
APP_ROUTER_VIDEO_ENABLED=0
APP_ROUTER_TEAM_ENABLED=0
Expand Down
1 change: 0 additions & 1 deletion apps/web/abTest/middlewareFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const ROUTES: [URLPattern, boolean][] = [
["/auth/error", process.env.APP_ROUTER_AUTH_ERROR_ENABLED === "1"] as const,
["/auth/platform/:path*", process.env.APP_ROUTER_AUTH_PLATFORM_ENABLED === "1"] as const,
["/auth/oauth2/:path*", process.env.APP_ROUTER_AUTH_OAUTH2_ENABLED === "1"] as const,
["/workflows/:path*", process.env.APP_ROUTER_WORKFLOWS_ENABLED === "1"] as const,
["/getting-started/:step", process.env.APP_ROUTER_GETTING_STARTED_STEP_ENABLED === "1"] as const,
["/bookings/:status", process.env.APP_ROUTER_BOOKINGS_STATUS_ENABLED === "1"] as const,
["/booking/:path*", process.env.APP_ROUTER_BOOKING_ENABLED === "1"] as const,
Expand Down
36 changes: 0 additions & 36 deletions apps/web/app/future/workflows/page.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { WithLayout } from "app/layoutHOC";
import { notFound } from "next/navigation";
import { z } from "zod";

import { getServerSessionForAppDir } from "@calcom/feature-auth/lib/get-server-session-for-app-dir";
// import { getServerSessionForAppDir } from "@calcom/feature-auth/lib/get-server-session-for-app-dir";
import LegacyPage from "@calcom/features/ee/workflows/pages/workflow";
import { WorkflowRepository } from "@calcom/lib/server/repository/workflow";

Expand All @@ -21,7 +21,7 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => {
const workflow = await WorkflowRepository.getById({ id: +parsed.data.workflow });

return await _generateMetadata(
() => (workflow && workflow.name ? workflow.name : "Untitled"),
(t) => (workflow && workflow.name ? workflow.name : t("untitled")),
() => ""
);
};
Expand All @@ -30,31 +30,33 @@ export const generateStaticParams = () => [];

const Page = async ({ params, searchParams }: PageProps) => {
// FIXME: Refactor me once next-auth endpoint is migrated to App Router
const session = await getServerSessionForAppDir();
const user = session?.user;
// const session = await getServerSessionForAppDir();
// const user = session?.user;
const parsed = querySchema.safeParse({ ...params, ...searchParams });
if (!parsed.success) {
notFound();
}

const workflow = await WorkflowRepository.getById({ id: +parsed.data.workflow });
let verifiedEmails, verifiedNumbers;
try {
verifiedEmails = await WorkflowRepository.getVerifiedEmails({
userEmail: user?.email ?? null,
userId: user?.id ?? null,
teamId: workflow?.team?.id,
});
} catch (err) {}
try {
verifiedNumbers = await WorkflowRepository.getVerifiedNumbers({
userId: user?.id ?? null,
teamId: workflow?.team?.id,
});
} catch (err) {}
// const workflow = await WorkflowRepository.getById({ id: +parsed.data.workflow });
// let verifiedEmails, verifiedNumbers;
// try {
// verifiedEmails = await WorkflowRepository.getVerifiedEmails({
// userEmail: user?.email ?? null,
// userId: user?.id ?? null,
// teamId: workflow?.team?.id,
// });
// } catch (err) {}
// try {
// verifiedNumbers = await WorkflowRepository.getVerifiedNumbers({
// userId: user?.id ?? null,
// teamId: workflow?.team?.id,
// });
// } catch (err) {}

return (
<LegacyPage workflowData={workflow} verifiedEmails={verifiedEmails} verifiedNumbers={verifiedNumbers} />
<LegacyPage
// workflowData={workflow} verifiedEmails={verifiedEmails} verifiedNumbers={verifiedNumbers}
/>
);
};

Expand Down
40 changes: 40 additions & 0 deletions apps/web/app/workflows/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import type { PageProps } from "app/_types";
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";

// import { getServerSessionForAppDir } from "@calcom/feature-auth/lib/get-server-session-for-app-dir";
// import { getTeamsFiltersFromQuery } from "@calcom/features/filters/lib/getTeamsFiltersFromQuery";
// import { WorkflowRepository } from "@calcom/lib/server/repository/workflow";
import LegacyPage from "@calcom/features/ee/workflows/pages/index";

export const generateMetadata = async () =>
await _generateMetadata(
(t) => t("workflows"),
(t) => t("workflows_to_automate_notifications")
);

const Page = async ({ params, searchParams }: PageProps) => {
// FIXME: Refactor me once next-auth endpoint is migrated to App Router
// const session = await getServerSessionForAppDir();
// const user = session?.user;

// const filters = getTeamsFiltersFromQuery({ ...searchParams, ...params });

// let filteredList;
// try {
// filteredList = await WorkflowRepository.getFilteredList({
// userId: user?.id,
// input: {
// filters,
// },
// });
// } catch (err) {}

return (
<LegacyPage
// filteredList={filteredList}
/>
);
};

export default WithLayout({ getLayout: null, ServerPage: Page })<"P">;
1 change: 0 additions & 1 deletion apps/web/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ export const config = {
"/apps/categories/:category/",
"/future/apps/categories/:category/",
"/workflows/:path*",
"/future/workflows/:path*",
"/getting-started/:step/",
"/future/getting-started/:step/",
"/apps",
Expand Down
3 changes: 3 additions & 0 deletions apps/web/modules/insights/insights-routing-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
FailedBookingsByField,
RoutingFormResponsesTable,
RoutingKPICards,
RoutedToPerPeriod,
} from "@calcom/features/insights/components";
import { FiltersProvider } from "@calcom/features/insights/context/FiltersProvider";
import { RoutingInsightsFilters } from "@calcom/features/insights/filters/routing/FilterBar";
Expand All @@ -30,6 +31,8 @@ export default function InsightsPage() {
)}
</RoutingFormResponsesTable>

<RoutedToPerPeriod />

<FailedBookingsByField />

<small className="text-default block text-center">
Expand Down
21 changes: 0 additions & 21 deletions apps/web/pages/workflows/[workflow].tsx

This file was deleted.

9 changes: 0 additions & 9 deletions apps/web/pages/workflows/index.tsx

This file was deleted.

6 changes: 6 additions & 0 deletions apps/web/public/static/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"second_one": "{{count}} second",
"second_other": "{{count}} seconds",
"upgrade_now": "Upgrade now",
"untitled": "Untitled",
"accept_invitation": "Accept Invitation",
"max_characters": "Max. Characters",
"min_characters": "Min. Characters",
Expand Down Expand Up @@ -2824,6 +2825,11 @@
"routing_form_insights_booking_status": "Booking Status",
"routing_form_insights_booking_at": "Booking At",
"routing_form_insights_submitted_at": "Submitted At",
"total_bookings_per_period": "Total Bookings per period",
"routed_to_per_period": "Routed to per period",
"per_day": "Per day",
"per_week": "Per week",
"per_month": "Per month",
"routing_form_insights_assignment_reason": "Assignment Reason",
"access_denied": "Access Denied",
"salesforce_route_to_owner": "Contact owner will be the Round Robin host if available",
Expand Down
1 change: 0 additions & 1 deletion apps/web/scripts/vercel-app-router-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ checkRoute "$APP_ROUTER_AUTH_SAML_ENABLED" app/future/auth/saml-idp
checkRoute "$APP_ROUTER_AUTH_ERROR_ENABLED" app/future/auth/error
checkRoute "$APP_ROUTER_AUTH_PLATFORM_ENABLED" app/future/auth/platform
checkRoute "$APP_ROUTER_AUTH_OAUTH2_ENABLED" app/future/auth/oauth2
checkRoute "$APP_ROUTER_WORKFLOWS_ENABLED" app/future/workflows
checkRoute "$APP_ROUTER_GETTING_STARTED_STEP_ENABLED" app/future/getting-started
checkRoute "$APP_ROUTER_BOOKINGS_STATUS_ENABLED" app/future/bookings
checkRoute "$APP_ROUTER_BOOKING_ENABLED" app/future/booking
Expand Down
48 changes: 48 additions & 0 deletions packages/features/data-table/components/DataTableSkeleton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { TableNew, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@calcom/ui";

interface DataTableSkeletonProps {
columns: number;
rows?: number;
columnWidths?: number[];
}

export function DataTableSkeleton({ columns, rows = 10, columnWidths = [] }: DataTableSkeletonProps) {
return (
<div
className="grid h-[75dvh]"
style={{ gridTemplateRows: "auto 1fr auto", gridTemplateAreas: "'header' 'body' 'footer'" }}>
<div
className="scrollbar-thin border-subtle relative h-full overflow-auto rounded-md border"
style={{ gridArea: "body" }}>
<TableNew>
<TableHeader className="bg-subtle sticky top-0 z-10">
<TableRow>
{[...Array(columns)].map((_, index) => (
<TableHead key={`skeleton-header-${index}`}>
<div
className="bg-subtle h-4 animate-pulse rounded-md"
style={{ width: columnWidths[index] ? `${columnWidths[index]}px` : "200px" }}
/>
</TableHead>
))}
</TableRow>
</TableHeader>
<TableBody>
{[...Array(rows)].map((_, rowIndex) => (
<TableRow key={`skeleton-row-${rowIndex}`}>
{[...Array(columns)].map((_, colIndex) => (
<TableCell key={`skeleton-cell-${rowIndex}-${colIndex}`}>
<div
className="bg-subtle h-6 animate-pulse rounded-md"
style={{ width: columnWidths[colIndex] ? `${columnWidths[colIndex]}px` : "200px" }}
/>
</TableCell>
))}
</TableRow>
))}
</TableBody>
</TableNew>
</div>
</div>
);
}
1 change: 1 addition & 0 deletions packages/features/data-table/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export { DataTablePagination } from "./DataTablePagination";
export { DataTableFilters } from "./filters";
export { useFetchMoreOnBottomReached } from "./useFetchMoreOnBottomReached";
export { DataTable } from "./DataTable";
export { DataTableSkeleton } from "./DataTableSkeleton";
export type { DataTableProps } from "./DataTable";
Loading

0 comments on commit 5973e78

Please sign in to comment.