Scheduling infrastructure for absolutely everyone.
fix: routing form delete button not rendered (#7424)
Nafees Nazik2f8280a6eee1
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.jsonindex 9e614feb67f..e1c63f61225 100644--- a/apps/web/public/static/locales/en/common.json+++ b/apps/web/public/static/locales/en/common.json@@ -1619,9 +1619,10 @@"keep_me_connected_with_form": "Keep me connected with the form","fields_in_form_duplicated":"Any changes in Router and Fields of the form being duplicated, would reflect in the duplicate.","form_deleted": "Form deleted",- "delete_form": "Delete Form",+ "delete_form": "Are you sure you want to delete this form?","delete_form_action": "Yes, delete Form",- "delete_form_confirmation":"Are you sure you want to delete this form? Anyone who you've shared the link with will no longer be able to book using it. Also, all associated responses would be deleted.",+ "delete_form_confirmation":"Anyone who you've shared the link with will no longer be able to access it.",+ "delete_form_confirmation_2":"All associated responses will be deleted.","typeform_redirect_url_copied": "Typeform Redirect URL copied! You can go and set the URL in Typeform form.","modifications_in_fields_warning": "Modifications in fields and routes of following forms will be reflected in this form.","connected_forms": "Connected Forms",diff --git a/packages/app-store/ee/routing-forms/components/FormActions.tsx b/packages/app-store/ee/routing-forms/components/FormActions.tsxindex 7f976354c9e..826e2c92d7b 100644--- a/packages/app-store/ee/routing-forms/components/FormActions.tsx+++ b/packages/app-store/ee/routing-forms/components/FormActions.tsx@@ -219,7 +219,7 @@ function Dialogs({isLoading={deleteMutation.isLoading}variety="danger"title={t("delete_form")}- confirmBtn={t("delete_form_action")}+ confirmBtnText={t("delete_form_action")}loadingText={t("delete_form_action")}onConfirm={(e) => {if (!deleteDialogFormId) {@@ -230,7 +230,10 @@ function Dialogs({id: deleteDialogFormId,});}}>- {t("delete_form_confirmation")}+ <ul className="list-disc pl-3">+ <li> {t("delete_form_confirmation")}</li>+ <li> {t("delete_form_confirmation_2")}</li>+ </ul></ConfirmationDialogContent></Dialog><NewFormDialog appUrl={appUrl} />diff --git a/packages/ui/components/dialog/ConfirmationDialogContent.tsx b/packages/ui/components/dialog/ConfirmationDialogContent.tsxindex 578cee497c5..a2ed4fa08bd 100644--- a/packages/ui/components/dialog/ConfirmationDialogContent.tsx+++ b/packages/ui/components/dialog/ConfirmationDialogContent.tsx@@ -1,5 +1,5 @@import * as DialogPrimitive from "@radix-ui/react-dialog";-import type { PropsWithChildren, ReactNode } from "react";+import type { PropsWithChildren, ReactElement } from "react";import React from "react";import { useLocale } from "@calcom/lib/hooks/useLocale";@@ -7,16 +7,18 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";import { FiAlertCircle, FiCheck } from "../icon";import { DialogClose, DialogContent } from "./Dialog";+type ConfirmBtnType =+ | { confirmBtn?: never; confirmBtnText?: string }+ | { confirmBtnText?: never; confirmBtn?: ReactElement };+export type ConfirmationDialogContentProps = {- confirmBtn?: ReactNode;- confirmBtnText?: string;cancelBtnText?: string;isLoading?: boolean;loadingText?: string;onConfirm?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;title: string;variety?: "danger" | "warning" | "success";-};+} & ConfirmBtnType;export function ConfirmationDialogContent(props: PropsWithChildren<ConfirmationDialogContentProps>) {const { t } = useLocale();