Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Change delete dialog
Lukasz Szewczyk81d09a59085b
diff --git a/saleor/static/dashboard-next/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsx b/saleor/static/dashboard-next/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsxindex 594d177c7d..02a77e1d8b 100644--- a/saleor/static/dashboard-next/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsx+++ b/saleor/static/dashboard-next/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsx@@ -25,13 +25,12 @@ const decorate = withStyles(export interface CategoryDeleteDialogProps {open: boolean;name: string;- productCount: number;onClose?();onConfirm?();}const CategoryDeleteDialog = decorate<CategoryDeleteDialogProps>(props => {- const { classes, name, open, onConfirm, onClose, productCount } = props;+ const { classes, name, open, onConfirm, onClose } = props;return (<Dialog open={open}><DialogTitle>@@ -46,16 +45,6 @@ const CategoryDeleteDialog = decorate<CategoryDeleteDialogProps>(props => {)}}/>- {productCount > 0 && (- <DialogContentText>- {i18n.t(- "There are {{count}} product(s) in this category that will also be removed.",- {- count: productCount- }- )}- </DialogContentText>- )}</DialogContent><DialogActions><Button onClick={onClose}>diff --git a/saleor/static/dashboard-next/categories/components/CategoryUpdatePage/CategoryUpdatePage.tsx b/saleor/static/dashboard-next/categories/components/CategoryUpdatePage/CategoryUpdatePage.tsxindex 6fdb20625e..cc515d0178 100644--- a/saleor/static/dashboard-next/categories/components/CategoryUpdatePage/CategoryUpdatePage.tsx+++ b/saleor/static/dashboard-next/categories/components/CategoryUpdatePage/CategoryUpdatePage.tsx@@ -12,7 +12,8 @@ import CategoryDetailsForm from "../../components/CategoryDetailsForm";import SeoForm from "../../../components/SeoForm";import Form from "../../../components/Form";import CategoryProductsCard from "../CategoryProductsCard";-import CategoryDeleteDialog from "../../components/CategoryDeleteDialog";+import DialogContentText from "@material-ui/core/DialogContentText";+import ActionDialog from "../../../components/ActionDialog";import { MoneyType } from "../../../products";import Toggle from "../../../components/Toggle";import SaveButtonBar, {@@ -32,7 +33,6 @@ interface FormData {export interface CategoryUpdatePageProps {errors: UserError[];disabled: boolean;- productCount?: number;category: {SeoDescription: string;SeoTitle: string;@@ -109,7 +109,6 @@ export const CategoryUpdatePage = decorate<CategoryUpdatePageProps>(saveButtonBarState,onSubmit,onBack,- productCount,onAddCategory,onCategoryClick}) => {@@ -249,13 +248,22 @@ export const CategoryUpdatePage = decorate<CategoryUpdatePageProps>(</div></Container>{!isRoot && (- <CategoryDeleteDialog- name={category.name}+ <ActionDialog+ title={i18n.t("Remove category")}open={openedDeleteDialog}- productCount={productCount}onClose={toggleDeleteDialog}onConfirm={onDelete}- />+ variant={"delete"}+ >+ <DialogContentText+ dangerouslySetInnerHTML={{+ __html: i18n.t(+ "Are you sure you want to remove <strong>{{ name }}</strong>?",+ { name: category.name }+ )+ }}+ />+ </ActionDialog>)}</>)}