From da926d1f2d32c1496f14283fea5ffcbe3fab4ff8 Mon Sep 17 00:00:00 2001 From: Karan Hotchandani <33024356+karanh37@users.noreply.github.com> Date: Tue, 27 Feb 2024 17:26:01 +0530 Subject: [PATCH] Disable updation of mutually exclusive in classification and minor other fixes (#15361) * fix minor issues of classification and glossary assets * add mutually exclusive label * fix cypress --- .../Pages/ClassificationVersionPage.spec.js | 8 -- .../ClassificationDetails.tsx | 77 ++++--------------- .../AssetSelectionModal.tsx | 4 +- .../tabs/AssetsTabs.component.tsx | 6 +- ...ssaryUpdateConfirmationModal.interface.tsx | 4 +- .../GlossaryUpdateConfirmationModal.tsx | 34 ++++---- .../common/EntityDescription/Description.tsx | 4 + .../ui/src/locale/languages/de-de.json | 3 +- .../ui/src/locale/languages/en-us.json | 3 +- .../ui/src/locale/languages/es-es.json | 3 +- .../ui/src/locale/languages/fr-fr.json | 3 +- .../ui/src/locale/languages/he-he.json | 3 +- .../ui/src/locale/languages/ja-jp.json | 3 +- .../ui/src/locale/languages/nl-nl.json | 3 +- .../ui/src/locale/languages/pt-br.json | 3 +- .../ui/src/locale/languages/ru-ru.json | 3 +- .../ui/src/locale/languages/zh-cn.json | 3 +- 17 files changed, 66 insertions(+), 101 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ClassificationVersionPage.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ClassificationVersionPage.spec.js index fd0ffd6deb5..5eb9301a88a 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ClassificationVersionPage.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/ClassificationVersionPage.spec.js @@ -114,14 +114,6 @@ describe( 'mutuallyExclusiveContainer' ); - cy.get( - '[data-testid="mutually-exclusive-container"] [data-testid="diff-removed"]' - ).should('be.visible'); - - cy.get( - '[data-testid="mutually-exclusive-container"] [data-testid="diff-added"]' - ).should('be.visible'); - cy.get('[data-testid="version-button"]').click(); cy.get('[data-testid="manage-button"]').click({ diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Classifications/ClassificationDetails/ClassificationDetails.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Classifications/ClassificationDetails/ClassificationDetails.tsx index edad271d020..f08b363fa2d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Classifications/ClassificationDetails/ClassificationDetails.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Classifications/ClassificationDetails/ClassificationDetails.tsx @@ -11,7 +11,7 @@ * limitations under the License. */ import Icon from '@ant-design/icons/lib/components/Icon'; -import { Button, Col, Row, Space, Switch, Tooltip, Typography } from 'antd'; +import { Button, Col, Row, Space, Tooltip, Typography } from 'antd'; import ButtonGroup from 'antd/lib/button/button-group'; import { ColumnsType } from 'antd/lib/table'; import { AxiosError } from 'axios'; @@ -30,7 +30,7 @@ import { useHistory } from 'react-router-dom'; import { ReactComponent as IconTag } from '../../../assets/svg/classification.svg'; import { ReactComponent as LockIcon } from '../../../assets/svg/closed-lock.svg'; import { ReactComponent as VersionIcon } from '../../../assets/svg/ic-version.svg'; -import { DE_ACTIVE_COLOR } from '../../../constants/constants'; +import { DE_ACTIVE_COLOR, PRIMERY_COLOR } from '../../../constants/constants'; import { EntityField } from '../../../constants/Feeds.constants'; import { usePermissionProvider } from '../../../context/PermissionProvider/PermissionProvider'; import { ResourceEntity } from '../../../context/PermissionProvider/PermissionProvider.interface'; @@ -48,10 +48,7 @@ import { getTagsTableColumn, } from '../../../utils/ClassificationUtils'; import { getEntityName } from '../../../utils/EntityUtils'; -import { - getEntityVersionByField, - getMutuallyExclusiveDiff, -} from '../../../utils/EntityVersionUtils'; +import { getEntityVersionByField } from '../../../utils/EntityVersionUtils'; import { checkPermission } from '../../../utils/PermissionsUtils'; import { getClassificationDetailsPath, @@ -65,7 +62,6 @@ import ManageButton from '../../common/EntityPageInfos/ManageButton/ManageButton import ErrorPlaceHolder from '../../common/ErrorWithPlaceholder/ErrorPlaceHolder'; import NextPrevious from '../../common/NextPrevious/NextPrevious'; import { NextPreviousProps } from '../../common/NextPrevious/NextPrevious.interface'; -import RichTextEditorPreviewer from '../../common/RichTextEditor/RichTextEditorPreviewer'; import Table from '../../common/Table/Table'; import EntityHeaderTitle from '../../Entity/EntityHeaderTitle/EntityHeaderTitle.component'; import { ClassificationDetailsProps } from './ClassificationDetails.interface'; @@ -238,18 +234,6 @@ const ClassificationDetails = forwardRef( isClassificationDisabled, ]); - const handleUpdateMutuallyExclusive = async (value: boolean) => { - if ( - !isUndefined(currentClassification) && - !isUndefined(handleUpdateClassification) - ) { - handleUpdateClassification({ - ...currentClassification, - mutuallyExclusive: value, - }); - } - }; - const editDescriptionPermission = useMemo( () => !isVersionView && @@ -388,16 +372,6 @@ const ClassificationDetails = forwardRef( : currentClassification?.description; }, [currentClassification, changeDescription]); - const mutuallyExclusive = useMemo(() => { - return isVersionView - ? getMutuallyExclusiveDiff( - changeDescription, - EntityField.MUTUALLY_EXCLUSIVE, - toString(currentClassification?.mutuallyExclusive) - ) - : ''; - }, [currentClassification, changeDescription]); - useEffect(() => { if (currentClassification?.fullyQualifiedName && !isAddingTag) { fetchClassificationChildren(currentClassification.fullyQualifiedName); @@ -418,7 +392,19 @@ const ClassificationDetails = forwardRef( + {headerBadge} + {currentClassification?.mutuallyExclusive && ( +
+ +
+ )} + + } className={classNames({ 'opacity-60': isClassificationDisabled, })} @@ -508,37 +494,6 @@ const ClassificationDetails = forwardRef( /> -
- - - {t('label.mutually-exclusive')} - - - {isVersionView ? ( - <> - : - - - ) : ( - - )} - -
- - , }; - case UpdateState.SUCESS: + case UpdateState.SUCCESS: return { content: progressBar, footer: , @@ -218,6 +218,19 @@ export const GlossaryUpdateConfirmationModal = ({ } }, [updateState, failedStatus]); + const modalTitle = useMemo(() => { + switch (updateState) { + case UpdateState.VALIDATING: + case UpdateState.UPDATING: + case UpdateState.SUCCESS: + return t('message.glossary-tag-update-modal-title-validating'); + case UpdateState.FAILED: + return t('message.glossary-tag-update-modal-title-failed'); + default: + return undefined; + } + }, [updateState]); + return ( {data.content} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/EntityDescription/Description.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/EntityDescription/Description.tsx index 0e15902c35a..7ae76a07d14 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/EntityDescription/Description.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/EntityDescription/Description.tsx @@ -38,6 +38,10 @@ import { ModalWithMarkdownEditor } from '../../Modals/ModalWithMarkdownEditor/Mo import RichTextEditorPreviewer from '../RichTextEditor/RichTextEditorPreviewer'; import { DescriptionProps } from './Description.interface'; +/** + * @deprecated will be removed + * Use DescriptionV1 instead + */ const Description: FC = ({ className, header, diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json index 24f12b4cfef..c84a74e1c64 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/de-de.json @@ -1437,7 +1437,8 @@ "get-started-with-open-metadata": "Erste Schritte mit OpenMetadata", "glossary-tag-assignment-help-message": "You can either remove these assets or remove the conflicting tags from the assets, and try adding the tags again.", "glossary-tag-update-description": "This action will apply the tag to all Assets linked to the Glossary Term", - "glossary-tag-update-modal-title": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-failed": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-validating": "Validating data assets", "glossary-term-description": "Jeder Begriff im Glossar hat eine eindeutige Definition. Neben der Definition des Standardbegriffs für ein Konzept können auch Synonyme sowie verwandte Begriffe (z. B. übergeordnete und untergeordnete Begriffe) angegeben werden. Es können Referenzen zu den Assets hinzugefügt werden, die sich auf die Begriffe beziehen. Neue Begriffe können dem Glossar hinzugefügt oder aktualisiert werden. Die Glossarbegriffe können von bestimmten Benutzern überprüft werden, die die Begriffe akzeptieren oder ablehnen können.", "glossary-term-status": "Glossary Term was {{status}}.", "go-back-to-login-page": "Zurück zur Anmeldeseite", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json index bfd72bf18db..2331a72a5c7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json @@ -1437,7 +1437,8 @@ "get-started-with-open-metadata": "Get started with OpenMetadata", "glossary-tag-assignment-help-message": "You can either remove these assets or remove the conflicting tags from the assets, and try adding the tags again.", "glossary-tag-update-description": "This action will apply the tag to all Assets linked to the Glossary Term", - "glossary-tag-update-modal-title": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-failed": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-validating": "Validating data assets", "glossary-term-description": "Every term in the glossary has a unique definition. Along with defining the standard term for a concept, the synonyms as well as related terms (for e.g., parent and child terms) can be specified. References can be added to the assets related to the terms. New terms can be added or updated to the Glossary. The glossary terms can be reviewed by certain users, who can accept or reject the terms.", "glossary-term-status": "Glossary Term was {{status}}.", "go-back-to-login-page": "Go back to Login page", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json index 70b4caae933..21ed59545a8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json @@ -1437,7 +1437,8 @@ "get-started-with-open-metadata": "Empezar con OpenMetadata", "glossary-tag-assignment-help-message": "You can either remove these assets or remove the conflicting tags from the assets, and try adding the tags again.", "glossary-tag-update-description": "This action will apply the tag to all Assets linked to the Glossary Term", - "glossary-tag-update-modal-title": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-failed": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-validating": "Validating data assets", "glossary-term-description": "Cada término en el glosario tiene una definición única. Además de definir el término estándar para un concepto, se pueden especificar sinónimos y términos relacionados (por ejemplo, términos padre e hijo). Se pueden agregar referencias a los activos relacionados con los términos. Se pueden agregar o actualizar nuevos términos al glosario. Los términos del glosario pueden ser revisados por ciertos usuarios, quienes pueden aceptar o rechazar los términos.", "glossary-term-status": "Glossary Term was {{status}}.", "go-back-to-login-page": "Volver a la página de inicio de sesión", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json index 6394ae7c50e..5e03ac9a0c6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json @@ -1437,7 +1437,8 @@ "get-started-with-open-metadata": "Commencez votre Journée avec OpenMetadata", "glossary-tag-assignment-help-message": "You can either remove these assets or remove the conflicting tags from the assets, and try adding the tags again.", "glossary-tag-update-description": "This action will apply the tag to all Assets linked to the Glossary Term", - "glossary-tag-update-modal-title": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-failed": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-validating": "Validating data assets", "glossary-term-description": "Chaque terme du glossaire a une définition unique. En plus de définir le terme standard pour un concept, les synonymes ainsi que les termes associés (par exemple, les termes parent et enfant) peuvent être spécifiés. Des références peuvent être ajoutées aux actifs liés aux termes. De nouveaux termes peuvent être ajoutés ou mis à jour dans le glossaire. Les termes du glossaire peuvent être examinés par certains utilisateurs, qui peuvent accepter ou rejeter les termes.", "glossary-term-status": "Glossary Term was {{status}}.", "go-back-to-login-page": "Retour à la page d'accueil", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json index 30905ba7f00..d42d5dc7872 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/he-he.json @@ -1437,7 +1437,8 @@ "get-started-with-open-metadata": "התחל עם OpenMetadata", "glossary-tag-assignment-help-message": "You can either remove these assets or remove the conflicting tags from the assets, and try adding the tags again.", "glossary-tag-update-description": "This action will apply the tag to all Assets linked to the Glossary Term", - "glossary-tag-update-modal-title": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-failed": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-validating": "Validating data assets", "glossary-term-description": "כל מונח במילון מסביר כיצד הוא מזהה את עצמו. בנוסף להגדרת המונח התקנית עבור קונספט, ניתן לציין נרדפים ומונחים קשורים (לדוגמה, מונחים הורה וילד). יש להוסיף הפניות לנכסים הקשורים למונחים. ניתן להוסיף מונחים חדשים או לעדכן את המילון. ניתן לבדוק את המונחים במילון על ידי משתמשים מסויימים, שיכולים לקבל או לדחות את המונחים.", "glossary-term-status": "מצב המונח הוא {{status}}.", "go-back-to-login-page": "חזור לדף התחברות", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json index 4b76878654c..c0ca8fc6f4a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json @@ -1437,7 +1437,8 @@ "get-started-with-open-metadata": "Get started with OpenMetadata", "glossary-tag-assignment-help-message": "You can either remove these assets or remove the conflicting tags from the assets, and try adding the tags again.", "glossary-tag-update-description": "This action will apply the tag to all Assets linked to the Glossary Term", - "glossary-tag-update-modal-title": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-failed": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-validating": "Validating data assets", "glossary-term-description": "Every term in the glossary has a unique definition. Along with defining the standard term for a concept, the synonyms as well as related terms (for e.g., parent and child terms) can be specified. References can be added to the assets related to the terms. New terms can be added or updated to the Glossary. The glossary terms can be reviewed by certain users, who can accept or reject the terms.", "glossary-term-status": "Glossary Term was {{status}}.", "go-back-to-login-page": "ログインページに戻る", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json index fb194b8cd82..a3cf6bac3ad 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/nl-nl.json @@ -1437,7 +1437,8 @@ "get-started-with-open-metadata": "Aan de slag met OpenMetadata", "glossary-tag-assignment-help-message": "Je kunt deze assets verwijderen of de conflicterende tags van de assets verwijderen en vervolgens proberen de tags opnieuw toe te voegen.", "glossary-tag-update-description": "Deze actie zal de tag toepassen op alle assets die zijn gekoppeld aan de term in het woordenboek", - "glossary-tag-update-modal-title": "Validatie is mislukt voor de volgende data-assets", + "glossary-tag-update-modal-title-failed": "Validatie is mislukt voor de volgende data-assets", + "glossary-tag-update-modal-title-validating": "Validating data assets", "glossary-term-description": "Elke term in het woordenboek heeft een unieke definitie. Naast het definiëren van de standaardterm voor een concept, kunnen ook synoniemen en gerelateerde termen (bijv. ouder- en kindtermen) worden gespecificeerd. Referenties kunnen worden toegevoegd aan de assets die verband houden met de termen. Nieuwe termen kunnen worden toegevoegd of bijgewerkt naar het woordenboek. De woordenboektermen kunnen worden beoordeeld door bepaalde gebruikers, die de termen kunnen accepteren of afwijzen.", "glossary-term-status": "Woordenboekterm was {{status}}.", "go-back-to-login-page": "Ga terug naar de inlogpagina", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json index 801e62824dd..be5e5f25f8f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json @@ -1437,7 +1437,8 @@ "get-started-with-open-metadata": "Comece com o OpenMetadata", "glossary-tag-assignment-help-message": "Você pode remover esses ativos ou retirar as tags conflitantes dos ativos e tentar adicionar as tags novamente.", "glossary-tag-update-description": "Esta ação aplicará a tag a todos os Ativos vinculados ao Termo de Glossário", - "glossary-tag-update-modal-title": "A validação falhou para os seguintes ativos de dados", + "glossary-tag-update-modal-title-failed": "A validação falhou para os seguintes ativos de dados", + "glossary-tag-update-modal-title-validating": "Validating data assets", "glossary-term-description": "Cada termo no glossário tem uma definição única. Além de definir o termo padrão para um conceito, os sinônimos e termos relacionados (por exemplo, termos pai e filho) podem ser especificados. Referências podem ser adicionadas aos ativos relacionados aos termos. Novos termos podem ser adicionados ou atualizados no Glossário. Os termos do glossário podem ser revisados por certos usuários, que podem aceitar ou rejeitar os termos.", "glossary-term-status": "Termo do Glossário foi {{status}}.", "go-back-to-login-page": "Voltar para a página de Login", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json index bdfd8edf536..f6250e31240 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ru-ru.json @@ -1437,7 +1437,8 @@ "get-started-with-open-metadata": "Начните работу с OpenMetadata", "glossary-tag-assignment-help-message": "You can either remove these assets or remove the conflicting tags from the assets, and try adding the tags again.", "glossary-tag-update-description": "This action will apply the tag to all Assets linked to the Glossary Term", - "glossary-tag-update-modal-title": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-failed": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-validating": "Validating data assets", "glossary-term-description": "Каждый термин в глоссарии имеет уникальное определение. Наряду с определением стандартного термина для понятия можно указать синонимы, а также связанные термины (например, родительские и дочерние термины). Ссылки могут быть добавлены к объектам данных, связанным с терминами. Новые термины могут быть добавлены или обновлены в Глоссарий. Термины глоссария могут быть просмотрены определенными пользователями, которые могут принять или отклонить термины.", "glossary-term-status": "Glossary Term was {{status}}.", "go-back-to-login-page": "Вернуться на страницу входа", diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json index 4b401fab021..2dcd354ec6f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json @@ -1437,7 +1437,8 @@ "get-started-with-open-metadata": "开始使用 OpenMetadata", "glossary-tag-assignment-help-message": "You can either remove these assets or remove the conflicting tags from the assets, and try adding the tags again.", "glossary-tag-update-description": "This action will apply the tag to all Assets linked to the Glossary Term", - "glossary-tag-update-modal-title": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-failed": "Validation failed for the following data assets", + "glossary-tag-update-modal-title-validating": "Validating data assets", "glossary-term-description": "术语库中的每个术语都有一个唯一的定义。除了为概念定义标准术语之外,还可以指定同义词以及相关术语(例如,父项和子项)。可以向与术语相关的资产添加引用。可以向术语库添加或更新新术语。某些用户可以审查术语,并接受或拒绝这些术语。", "glossary-term-status": "Glossary Term was {{status}}.", "go-back-to-login-page": "返回登录页面",