fix: routing form delete button not rendered (#7424)
parent
4e1e2577eb
commit
2f8280a6ee
|
@ -1619,9 +1619,10 @@
|
||||||
"keep_me_connected_with_form": "Keep me connected with the form",
|
"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.",
|
"fields_in_form_duplicated":"Any changes in Router and Fields of the form being duplicated, would reflect in the duplicate.",
|
||||||
"form_deleted": "Form deleted",
|
"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_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.",
|
"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.",
|
"modifications_in_fields_warning": "Modifications in fields and routes of following forms will be reflected in this form.",
|
||||||
"connected_forms": "Connected Forms",
|
"connected_forms": "Connected Forms",
|
||||||
|
|
|
@ -219,7 +219,7 @@ function Dialogs({
|
||||||
isLoading={deleteMutation.isLoading}
|
isLoading={deleteMutation.isLoading}
|
||||||
variety="danger"
|
variety="danger"
|
||||||
title={t("delete_form")}
|
title={t("delete_form")}
|
||||||
confirmBtn={t("delete_form_action")}
|
confirmBtnText={t("delete_form_action")}
|
||||||
loadingText={t("delete_form_action")}
|
loadingText={t("delete_form_action")}
|
||||||
onConfirm={(e) => {
|
onConfirm={(e) => {
|
||||||
if (!deleteDialogFormId) {
|
if (!deleteDialogFormId) {
|
||||||
|
@ -230,7 +230,10 @@ function Dialogs({
|
||||||
id: deleteDialogFormId,
|
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>
|
</ConfirmationDialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
<NewFormDialog appUrl={appUrl} />
|
<NewFormDialog appUrl={appUrl} />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
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 React from "react";
|
||||||
|
|
||||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||||
|
@ -7,16 +7,18 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||||
import { FiAlertCircle, FiCheck } from "../icon";
|
import { FiAlertCircle, FiCheck } from "../icon";
|
||||||
import { DialogClose, DialogContent } from "./Dialog";
|
import { DialogClose, DialogContent } from "./Dialog";
|
||||||
|
|
||||||
|
type ConfirmBtnType =
|
||||||
|
| { confirmBtn?: never; confirmBtnText?: string }
|
||||||
|
| { confirmBtnText?: never; confirmBtn?: ReactElement };
|
||||||
|
|
||||||
export type ConfirmationDialogContentProps = {
|
export type ConfirmationDialogContentProps = {
|
||||||
confirmBtn?: ReactNode;
|
|
||||||
confirmBtnText?: string;
|
|
||||||
cancelBtnText?: string;
|
cancelBtnText?: string;
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
loadingText?: string;
|
loadingText?: string;
|
||||||
onConfirm?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
onConfirm?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||||
title: string;
|
title: string;
|
||||||
variety?: "danger" | "warning" | "success";
|
variety?: "danger" | "warning" | "success";
|
||||||
};
|
} & ConfirmBtnType;
|
||||||
|
|
||||||
export function ConfirmationDialogContent(props: PropsWithChildren<ConfirmationDialogContentProps>) {
|
export function ConfirmationDialogContent(props: PropsWithChildren<ConfirmationDialogContentProps>) {
|
||||||
const { t } = useLocale();
|
const { t } = useLocale();
|
||||||
|
|
Loading…
Reference in New Issue