Skip to content

Commit

Permalink
fix: make workflow page not static (calcom#18925)
Browse files Browse the repository at this point in the history
* fix: make workflow page not static

* fix

* fix
  • Loading branch information
hbjORbj authored Jan 27, 2025
1 parent 7fb60fe commit ae51c8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
9 changes: 2 additions & 7 deletions apps/web/app/(use-page-wrapper)/workflows/[workflow]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export const generateMetadata = async ({ params }: PageProps): Promise<Metadata
);
};

export const generateStaticParams = () => [];

const Page = async ({ params }: PageProps) => {
// const session = await getServerSession({ req: buildLegacyRequest(headers(), cookies()) });
// const user = session?.user;
Expand All @@ -65,13 +63,10 @@ const Page = async ({ params }: PageProps) => {

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

export default Page;
export const dynamic = "force-static";
// generate segments on demand
export const dynamicParams = true;
export const revalidate = 10;
7 changes: 3 additions & 4 deletions packages/features/ee/workflows/pages/workflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Shell, { ShellMain } from "@calcom/features/shell/Shell";
import { classNames } from "@calcom/lib";
import { SENDER_ID } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { useParamsWithFallback } from "@calcom/lib/hooks/useParamsWithFallback";
import { HttpError } from "@calcom/lib/http-error";
import type { WorkflowRepository } from "@calcom/lib/server/repository/workflow";
import type { TimeUnit, WorkflowTriggerEvents } from "@calcom/prisma/enums";
Expand All @@ -25,7 +24,7 @@ import LicenseRequired from "../../common/components/LicenseRequired";
import SkeletonLoader from "../components/SkeletonLoaderEdit";
import WorkflowDetailsPage from "../components/WorkflowDetailsPage";
import { isSMSAction, isSMSOrWhatsappAction } from "../lib/actionHelperFunctions";
import { formSchema, querySchema } from "../lib/schema";
import { formSchema } from "../lib/schema";
import { getTranslatedText, translateVariablesToEnglish } from "../lib/variableTranslations";

export type FormValues = {
Expand All @@ -39,19 +38,20 @@ export type FormValues = {
};

type PageProps = {
workflow: number;
workflowData?: Awaited<ReturnType<typeof WorkflowRepository.getById>>;
verifiedNumbers?: Awaited<ReturnType<typeof WorkflowRepository.getVerifiedNumbers>>;
verifiedEmails?: Awaited<ReturnType<typeof WorkflowRepository.getVerifiedEmails>>;
};

function WorkflowPage({
workflow: workflowId,
workflowData: workflowDataProp,
verifiedNumbers: verifiedNumbersProp,
verifiedEmails: verifiedEmailsProp,
}: PageProps) {
const { t, i18n } = useLocale();
const session = useSession();
const params = useParamsWithFallback();

const [selectedOptions, setSelectedOptions] = useState<Option[]>([]);
const [isAllDataLoaded, setIsAllDataLoaded] = useState(false);
Expand All @@ -62,7 +62,6 @@ function WorkflowPage({
resolver: zodResolver(formSchema),
});

const { workflow: workflowId } = params ? querySchema.parse(params) : { workflow: -1 };
const utils = trpc.useUtils();

const userQuery = useMeQuery();
Expand Down

0 comments on commit ae51c8b

Please sign in to comment.