Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add image delete confirmation dialog
dominik-zeglen2df3b14f8533
diff --git a/saleor/static/dashboard-next/collections/views/CollectionDetails.tsx b/saleor/static/dashboard-next/collections/views/CollectionDetails.tsxindex d1a130c5bb..f65e7e1eca 100644--- a/saleor/static/dashboard-next/collections/views/CollectionDetails.tsx+++ b/saleor/static/dashboard-next/collections/views/CollectionDetails.tsx@@ -28,7 +28,8 @@ import {collectionListUrl,collectionRemovePath,collectionRemoveUrl,- collectionUrl+ collectionUrl,+ collectionImageRemovePath} from "../urls";export type CollectionDetailsQueryParams = Partial<{@@ -69,6 +70,7 @@ export const CollectionDetails: React.StatelessComponent<context: "notification"})});+ navigate(collectionUrl(id))}};@@ -185,6 +187,16 @@ export const CollectionDetails: React.StatelessComponent<.errors));+ const imageRemoveTransitionState = getMutationState(+ updateCollection.opts.called,+ updateCollection.opts.loading,+ maybe(+ () =>+ updateCollection.opts.data.collectionUpdate+ .errors+ )+ );+return (<><WindowTitle@@ -318,6 +330,38 @@ export const CollectionDetails: React.StatelessComponent<</ActionDialog>)}/>+ <Route+ path={collectionImageRemovePath(":id")}+ render={({ match }) => (+ <ActionDialog+ confirmButtonState={+ imageRemoveTransitionState+ }+ onClose={() =>+ navigate(collectionUrl(id), true, true)+ }+ onConfirm={() =>+ updateCollection.mutate({+ id,+ input: {+ backgroundImage: null+ }+ })+ }+ open={!!match}+ title={i18n.t("Remove collection", {+ context: "modal title"+ })}+ variant="delete"+ >+ <DialogContentText>+ {i18n.t(+ "Are you sure you want to remove collection's image?"+ )}+ </DialogContentText>+ </ActionDialog>+ )}+ /></>);}}