From 7b6e8253a6237e3f5dfc7506fb222ee83a47f68b Mon Sep 17 00:00:00 2001 From: xusongfu Date: Mon, 19 Dec 2022 14:59:12 +0800 Subject: [PATCH] fix: fix the delete operation of cluster instance Disable the delete operation if the stack is not ready or the status is `DELETE_IN_PROGRESS` Change-Id: I18457d3593761e36a7173488b646ebdedf656ec2 --- .../container-infra/containers/Clusters/actions/Delete.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/container-infra/containers/Clusters/actions/Delete.jsx b/src/pages/container-infra/containers/Clusters/actions/Delete.jsx index 125039cd..c540ed8d 100644 --- a/src/pages/container-infra/containers/Clusters/actions/Delete.jsx +++ b/src/pages/container-infra/containers/Clusters/actions/Delete.jsx @@ -38,7 +38,10 @@ export default class DeleteClusters extends ConfirmAction { policy = 'cluster:delete'; - allowedCheckFunc = () => true; + allowedCheckFunc = (item) => { + const { stack_id, status } = item; + return !!stack_id && status !== 'DELETE_IN_PROGRESS'; + }; onSubmit = (data) => globalClustersStore.delete({ id: data.id }); }