From 60f5eb603b470cc4475107bfcc1fbfca95e1c6de Mon Sep 17 00:00:00 2001 From: Prakash Senthil Vel <23444145+prakashsvmx@users.noreply.github.com> Date: Tue, 11 Jul 2023 01:59:23 +0530 Subject: [PATCH] remove warning message in delete bucket replication rule (#2931) --- .../Buckets/BucketDetails/BucketReplicationPanel.tsx | 10 ++++++++-- .../Buckets/BucketDetails/DeleteReplicationRule.tsx | 9 --------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketReplicationPanel.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketReplicationPanel.tsx index 2d9bb5e22..74a1ad8b8 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketReplicationPanel.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketReplicationPanel.tsx @@ -242,7 +242,10 @@ const BucketReplicationPanel = ({ classes }: IBucketReplicationProps) => { ruleToDelete={selectedRRule} rulesToDelete={selectedRepRules} remainingRules={replicationRules.length} - allSelected={selectedRepRules.length === replicationRules.length} + allSelected={ + replicationRules.length > 0 && + selectedRepRules.length === replicationRules.length + } deleteSelectedRules={deleteSelectedRules} /> )} @@ -277,7 +280,10 @@ const BucketReplicationPanel = ({ classes }: IBucketReplicationProps) => { label={"Remove Selected Rules"} icon={} color={"secondary"} - disabled={selectedRepRules.length === 0} + disabled={ + selectedRepRules.length === 0 || + replicationRules.length === 0 + } variant={"secondary"} /> diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/DeleteReplicationRule.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/DeleteReplicationRule.tsx index a152c71f6..51b3184fb 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/DeleteReplicationRule.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/DeleteReplicationRule.tsx @@ -24,7 +24,6 @@ import ConfirmDialog from "../../Common/ModalWrapper/ConfirmDialog"; import { ConfirmDeleteIcon } from "mds"; import Grid from "@mui/material/Grid"; import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper"; -import WarningMessage from "../../Common/WarningMessage/WarningMessage"; import { setErrorSnackMessage } from "../../../../systemSlice"; import { useAppDispatch } from "../../../../store"; @@ -101,10 +100,6 @@ const DeleteReplicationRule = ({ {deleteSelectedRules ? ( - Are you sure you want to remove the selected replication rules for bucket {selectedBucket}?

@@ -123,10 +118,6 @@ const DeleteReplicationRule = ({
) : ( - Are you sure you want to delete replication rule{" "} {ruleToDelete}?