From 00e25ade91ce5d67c3f97efc54aea8f03f260958 Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Thu, 30 Jun 2022 16:32:07 +0530 Subject: [PATCH] fixed issue-5779 Add manage tab to soft deleted entity (#5781) * fixed issue-5779 Added manage tab to soft deleted entity * miner fix * addressing comments --- .../DashboardDetails/DashboardDetails.component.tsx | 7 ++++--- .../DatasetDetails/DatasetDetails.component.tsx | 7 ++++--- .../MlModelDetail/MlModelDetail.component.tsx | 7 ++++--- .../PipelineDetails/PipelineDetails.component.tsx | 7 ++++--- .../TopicDetails/TopicDetails.component.tsx | 7 ++++--- .../components/common/DeleteWidget/DeleteWidget.tsx | 12 +++++++----- .../common/DeleteWidget/DeleteWidgetBody.tsx | 2 +- .../common/DeleteWidget/DeleteWidgetModal.tsx | 6 +++--- .../src/main/resources/ui/src/utils/CommonUtils.tsx | 8 ++++---- 9 files changed, 35 insertions(+), 28 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DashboardDetails/DashboardDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DashboardDetails/DashboardDetails.component.tsx index 165875a4f77..00a2f16b6da 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DashboardDetails/DashboardDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DashboardDetails/DashboardDetails.component.tsx @@ -201,7 +201,6 @@ const DashboardDetails = ({ selectedName: 'icon-managecolor', }, isProtected: true, - isHidden: deleted, protectedState: !owner || hasEditAccess(), position: 4, }, @@ -703,11 +702,11 @@ const DashboardDetails = ({ /> )} - {activeTab === 4 && !deleted && ( + {activeTab === 4 && (
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.component.tsx index cc50967b750..debbd4c46d4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.component.tsx @@ -313,7 +313,6 @@ const DatasetDetails: React.FC = ({ selectedName: 'icon-managecolor', }, isProtected: false, - isHidden: deleted, protectedState: !owner || hasEditAccess(), position: 10, }, @@ -804,17 +803,19 @@ const DatasetDetails: React.FC = ({ tableDetails={tableDetails} /> )} - {activeTab === 10 && !deleted && ( + {activeTab === 10 && (
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx index 9486516ebdf..c1402c105b3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/MlModelDetail/MlModelDetail.component.tsx @@ -193,7 +193,6 @@ const MlModelDetail: FC = ({ selectedName: 'icon-managecolor', }, isProtected: false, - isHidden: mlModelDetail.deleted, protectedState: !mlModelDetail.owner || hasEditAccess(), position: 3, }, @@ -452,17 +451,19 @@ const MlModelDetail: FC = ({ {getMlModelStore()}
)} - {activeTab === 3 && !mlModelDetail.deleted && ( + {activeTab === 3 && (
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/PipelineDetails/PipelineDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/PipelineDetails/PipelineDetails.component.tsx index 434f74df684..0c6315c4403 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/PipelineDetails/PipelineDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/PipelineDetails/PipelineDetails.component.tsx @@ -194,7 +194,6 @@ const PipelineDetails = ({ selectedName: 'icon-managecolor', }, isProtected: true, - isHidden: deleted, protectedState: !owner || hasEditAccess(), position: 4, }, @@ -485,17 +484,19 @@ const PipelineDetails = ({ />
)} - {activeTab === 4 && !deleted && ( + {activeTab === 4 && (
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicDetails.component.tsx index 599fcf8a1c1..a2765a24c30 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TopicDetails/TopicDetails.component.tsx @@ -217,7 +217,6 @@ const TopicDetails: React.FC = ({ selectedName: 'icon-managecolor', }, isProtected: true, - isHidden: deleted, protectedState: !owner || hasEditAccess(), position: 5, }, @@ -485,17 +484,19 @@ const TopicDetails: React.FC = ({
)} - {activeTab === 5 && !deleted && ( + {activeTab === 5 && (
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidget.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidget.tsx index bbfa2f4e8ec..aeb41032e7e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidget.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidget.tsx @@ -42,7 +42,7 @@ const DeleteWidget = ({ useState(ENTITY_DELETE_STATE); const prepareDeleteMessage = (softDelete = false) => { - const softDeleteText = `Soft deleting will deactivate the ${entityName}. This will disable any discovery, read or write operations on ${entityName}`; + const softDeleteText = `Delete will deactivate the ${entityType} ${entityName}. This will disable any discovery, read or write operations on ${entityName}`; const hardDeleteText = getEntityDeleteMessage(getTitleCase(entityType), ''); return softDelete ? softDeleteText : hardDeleteText; @@ -147,10 +147,10 @@ const DeleteWidget = ({ {allowSoftDelete && (
handleOnEntityDelete(true)} /> @@ -158,10 +158,12 @@ const DeleteWidget = ({ )}
handleOnEntityDelete(false)} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetBody.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetBody.tsx index 3b07cf97b2e..a8ba800bf31 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetBody.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetBody.tsx @@ -34,7 +34,7 @@ const DeleteWidgetBody = ({ }: DeleteWidgetBodyProps) => { return (
-
+

diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx index d361944d878..d9938e9da97 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/DeleteWidget/DeleteWidgetModal.tsx @@ -51,12 +51,12 @@ const DeleteWidgetV1 = ({ const DELETE_OPTION = [ { - title: `Soft delete ${entityType} “${entityName}”`, + title: `Delete ${entityType} “${entityName}”`, description: prepareDeleteMessage(true), type: DeleteType.SOFT_DELETE, }, { - title: `Delete ${entityType} “${entityName}”`, + title: `Permanently Delete ${entityType} “${entityName}”`, description: prepareDeleteMessage(), type: DeleteType.HARD_DELETE, }, @@ -208,7 +208,7 @@ const DeleteWidgetV1 = ({ key={option.type} value={option.type}>

{option.title}

-

+

{option.description}

diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx index 866fdf92c75..b877c66f65f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx @@ -612,13 +612,13 @@ export const getEntityName = (entity?: EntityReference) => { export const getEntityDeleteMessage = (entity: string, dependents: string) => { if (dependents) { - return `Deleting this ${getTitleCase( + return `Permanently deleting this ${getTitleCase( entity - )} will permanently remove its metadata, as well as the metadata of ${dependents} from OpenMetadata.`; + )} will remove its metadata, as well as the metadata of ${dependents} from OpenMetadata permanently.`; } else { - return `Deleting this ${getTitleCase( + return `Permanently deleting this ${getTitleCase( entity - )} will permanently remove its metadata from OpenMetadata.`; + )} will remove its metadata from OpenMetadata permanently.`; } };