diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddGlossary/AddGlossary.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddGlossary/AddGlossary.component.tsx index c782c369612..25229d37566 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddGlossary/AddGlossary.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddGlossary/AddGlossary.component.tsx @@ -57,7 +57,7 @@ const AddGlossary = ({ const [reviewer, setReviewer] = useState>([]); const getDescription = () => { - return markdownRef.current?.getEditorContent() || undefined; + return markdownRef.current?.getEditorContent() || ''; }; const onReviewerModalCancel = () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddGlossaryTerm/AddGlossaryTerm.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddGlossaryTerm/AddGlossaryTerm.component.tsx index 2e7d76be43c..c4a6ba19793 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddGlossaryTerm/AddGlossaryTerm.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddGlossaryTerm/AddGlossaryTerm.component.tsx @@ -84,7 +84,7 @@ const AddGlossaryTerm = ({ }, [glossaryData]); const getDescription = () => { - return markdownRef.current?.getEditorContent() || undefined; + return markdownRef.current?.getEditorContent() || ''; }; const onRelatedTermsModalCancel = () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/GlossaryDetails/GlossaryDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/GlossaryDetails/GlossaryDetails.component.tsx index 153e8906e9c..b3ae430fe6f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/GlossaryDetails/GlossaryDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/GlossaryDetails/GlossaryDetails.component.tsx @@ -20,11 +20,13 @@ import { TITLE_FOR_NON_ADMIN_ACTION, TITLE_FOR_NON_OWNER_ACTION, } from '../../constants/constants'; +import { EntityType } from '../../enums/entity.enum'; import { Glossary } from '../../generated/entity/data/glossary'; import { Operation } from '../../generated/entity/policies/policy'; import { LabelType, Source, State } from '../../generated/type/tagLabel'; import jsonData from '../../jsons/en'; import UserCard from '../../pages/teams/UserCard'; +import { hasEditAccess } from '../../utils/CommonUtils'; import SVGIcons from '../../utils/SvgUtils'; import { getTagCategories, @@ -37,6 +39,7 @@ import Avatar from '../common/avatar/Avatar'; import Description from '../common/description/Description'; import NonAdminAction from '../common/non-admin-action/NonAdminAction'; import TabsPane from '../common/TabsPane/TabsPane'; +import ManageTabComponent from '../ManageTab/ManageTab.component'; import ReviewerModal from '../Modals/ReviewerModal/ReviewerModal.component'; import TagsContainer from '../tags-container/tags-container'; import TagsViewer from '../tags-viewer/tags-viewer'; @@ -60,12 +63,12 @@ const GlossaryDetails = ({ isHasAccess, glossary, updateGlossary }: props) => { const tabs = [ { - name: 'Reviewers', + name: 'Manage', icon: { - alt: 'schema', - name: 'icon-schema', - title: 'Schema', - selectedName: 'icon-schemacolor', + alt: 'manage', + name: 'icon-manage', + title: 'Manage', + selectedName: 'icon-managecolor', }, isProtected: false, position: 1, @@ -177,6 +180,20 @@ const GlossaryDetails = ({ isHasAccess, glossary, updateGlossary }: props) => { setActiveTab(value); }; + const handleUpdateOwner = (owner: Glossary['owner']) => { + const updatedData = { + ...glossary, + owner, + }; + + return new Promise((_, reject) => { + updateGlossary(updatedData); + setTimeout(() => { + reject(); + }, 500); + }); + }; + useEffect(() => { if (glossary.reviewers && glossary.reviewers.length) { setReviewer( @@ -228,7 +245,7 @@ const GlossaryDetails = ({ isHasAccess, glossary, updateGlossary }: props) => { ))} ) : ( -
+

No reviewers assigned

{AddReviewerButton()}

@@ -352,7 +369,29 @@ const GlossaryDetails = ({ isHasAccess, glossary, updateGlossary }: props) => { />
- {activeTab === 1 && getReviewerTabData()} + {activeTab === 1 && ( +
+
{getReviewerTabData()}
+
+ +
+
+ )}
{showRevieweModal && ( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/GlossaryTerms/GlossaryTermsV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/GlossaryTerms/GlossaryTermsV1.component.tsx index d4887161800..5054e01799f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/GlossaryTerms/GlossaryTermsV1.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/GlossaryTerms/GlossaryTermsV1.component.tsx @@ -23,6 +23,7 @@ import { } from 'Models'; import React, { Fragment, useEffect, useState } from 'react'; import { TITLE_FOR_NON_ADMIN_ACTION } from '../../constants/constants'; +import { EntityType } from '../../enums/entity.enum'; import { GlossaryTerm, TermReference, @@ -41,6 +42,7 @@ import { Button } from '../buttons/Button/Button'; import Description from '../common/description/Description'; import NonAdminAction from '../common/non-admin-action/NonAdminAction'; import TabsPane from '../common/TabsPane/TabsPane'; +import ManageTabComponent from '../ManageTab/ManageTab.component'; import GlossaryReferenceModal from '../Modals/GlossaryReferenceModal/GlossaryReferenceModal'; import RelatedTermsModal from '../Modals/RelatedTermsModal/RelatedTermsModal'; import ReviewerModal from '../Modals/ReviewerModal/ReviewerModal.component'; @@ -98,7 +100,7 @@ const GlossaryTermsV1 = ({ position: 2, }, { - name: 'Reviewers', + name: 'Manage', isProtected: false, position: 3, }, @@ -361,7 +363,7 @@ const GlossaryTermsV1 = ({ ))}
) : ( -
+

No reviewers assigned

{AddReviewerButton()}

@@ -611,7 +613,25 @@ const GlossaryTermsV1 = ({ onAssetPaginate={onAssetPaginate} /> )} - {activeTab === 3 && getReviewerTabData()} + {activeTab === 3 && ( +
+
{getReviewerTabData()}
+
+ +
+
+ )}
{showRelatedTermsModal && ( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx index 0bbd3fd705c..d12513ddce5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx @@ -38,6 +38,7 @@ const ManageTab: FunctionComponent = ({ currentTier = '', currentUser = '', hideTier = false, + hideOwner = false, onSave, hasEditAccess, allowTeamOwner = true, @@ -97,7 +98,7 @@ const ManageTab: FunctionComponent = ({ const newOwner: TableDetail['owner'] = prepareOwner(updatedOwner); if (hideTier) { if (newOwner || !isUndefined(teamJoinable)) { - onSave(newOwner, '', Boolean(teamJoinable)).catch(() => { + onSave?.(newOwner, '', Boolean(teamJoinable)).catch(() => { setInitialOwnerLoadingState(); }); } else { @@ -105,7 +106,7 @@ const ManageTab: FunctionComponent = ({ } } else { const newTier = prepareTier(updatedTier); - onSave(newOwner, newTier, Boolean(teamJoinable)).catch(() => { + onSave?.(newOwner, newTier, Boolean(teamJoinable)).catch(() => { setInitialOwnerLoadingState(); }); } @@ -116,7 +117,7 @@ const ManageTab: FunctionComponent = ({ const newOwner: TableDetail['owner'] = prepareOwner(currentUser); if (hideTier) { if (newOwner || !isUndefined(teamJoinable)) { - onSave(newOwner, '', Boolean(teamJoinable)).catch(() => { + onSave?.(newOwner, '', Boolean(teamJoinable)).catch(() => { setInitialTierLoadingState(); }); } else { @@ -124,7 +125,7 @@ const ManageTab: FunctionComponent = ({ } } else { const newTier = prepareTier(updatedTier); - onSave(newOwner, newTier, Boolean(teamJoinable)).catch(() => { + onSave?.(newOwner, newTier, Boolean(teamJoinable)).catch(() => { setInitialTierLoadingState(); }); } @@ -305,23 +306,25 @@ const ManageTab: FunctionComponent = ({ className={classNames('tw-mt-2 tw-pb-4', { 'tw-mb-3': !hideTier, })}> - - setListVisible((visible) => !visible) - } - hasEditAccess={hasEditAccess} - isAuthDisabled={isAuthDisabled} - isJoinableActionAllowed={isJoinableActionAllowed()} - listOwners={listOwners} - listVisible={listVisible} - owner={owner} - ownerName={ownerName} - statusOwner={statusOwner} - teamJoinable={teamJoinable} - /> + {!hideOwner && ( + + setListVisible((visible) => !visible) + } + hasEditAccess={hasEditAccess} + isAuthDisabled={isAuthDisabled} + isJoinableActionAllowed={isJoinableActionAllowed()} + listOwners={listOwners} + listVisible={listVisible} + owner={owner} + ownerName={ownerName} + statusOwner={statusOwner} + teamJoinable={teamJoinable} + /> + )} {getTierWidget()} {getDeleteEntityWidget()} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.interface.ts index 1e68158f051..111e43f617b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.interface.ts @@ -18,9 +18,10 @@ export interface ManageProps { currentUser?: string; manageSectionType?: string; hideTier?: boolean; + hideOwner?: boolean; isJoinable?: boolean; allowSoftDelete?: boolean; - onSave: ( + onSave?: ( owner: TableDetail['owner'], tier: TableDetail['tier'], isJoinable?: boolean 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 d1cbb742ddb..1f26797a59a 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 @@ -72,6 +72,8 @@ const DeleteWidget = ({ if (services.includes((entityType || '') as EntityType)) { return `services/${entityType}s`; + } else if (entityType === EntityType.GLOSSARY) { + return `glossaries`; } else { return `${entityType}s`; } diff --git a/openmetadata-ui/src/main/resources/ui/src/generated/api/data/createGlossary.ts b/openmetadata-ui/src/main/resources/ui/src/generated/api/data/createGlossary.ts index ec1e19cb911..25c8bf5ff85 100644 --- a/openmetadata-ui/src/main/resources/ui/src/generated/api/data/createGlossary.ts +++ b/openmetadata-ui/src/main/resources/ui/src/generated/api/data/createGlossary.ts @@ -19,7 +19,7 @@ export interface CreateGlossary { /** * Description of the glossary instance. */ - description?: string; + description: string; /** * Display Name that identifies this glossary. */ diff --git a/openmetadata-ui/src/main/resources/ui/src/generated/api/data/createGlossaryTerm.ts b/openmetadata-ui/src/main/resources/ui/src/generated/api/data/createGlossaryTerm.ts index 164ff91a9eb..19ebe5df1e2 100644 --- a/openmetadata-ui/src/main/resources/ui/src/generated/api/data/createGlossaryTerm.ts +++ b/openmetadata-ui/src/main/resources/ui/src/generated/api/data/createGlossaryTerm.ts @@ -19,7 +19,7 @@ export interface CreateGlossaryTerm { /** * Description of the glossary term. */ - description?: string; + description: string; /** * Display Name that identifies this glossary. */ diff --git a/openmetadata-ui/src/main/resources/ui/src/generated/entity/data/glossary.ts b/openmetadata-ui/src/main/resources/ui/src/generated/entity/data/glossary.ts index e35d229aa41..d87baa73acb 100644 --- a/openmetadata-ui/src/main/resources/ui/src/generated/entity/data/glossary.ts +++ b/openmetadata-ui/src/main/resources/ui/src/generated/entity/data/glossary.ts @@ -28,7 +28,7 @@ export interface Glossary { /** * Description of the glossary. */ - description?: string; + description: string; /** * Display Name that identifies this glossary. */ diff --git a/openmetadata-ui/src/main/resources/ui/src/generated/entity/data/glossaryTerm.ts b/openmetadata-ui/src/main/resources/ui/src/generated/entity/data/glossaryTerm.ts index 9205398950b..cc46e650823 100644 --- a/openmetadata-ui/src/main/resources/ui/src/generated/entity/data/glossaryTerm.ts +++ b/openmetadata-ui/src/main/resources/ui/src/generated/entity/data/glossaryTerm.ts @@ -31,7 +31,7 @@ export interface GlossaryTerm { /** * Description of the glossary term. */ - description?: string; + description: string; /** * Display Name that identifies this glossary. */ @@ -83,7 +83,11 @@ export interface GlossaryTerm { */ synonyms?: string[]; /** - * Tags for this glossary term. + * Tags associated with this glossary term. These tags captures relationship of a glossary + * term with a tag automatically. As an example a glossary term 'User.PhoneNumber' might + * have an associated tag 'PII.Sensitive'. When 'User.Address' is used to label a column in + * a table, 'PII.Sensitive' label is also applied automatically due to Associated tag + * relationship. */ tags?: TagLabel[]; /** diff --git a/openmetadata-ui/src/main/resources/ui/src/mocks/Glossary.mock.ts b/openmetadata-ui/src/main/resources/ui/src/mocks/Glossary.mock.ts index 3176a2178a0..fd683bb882c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/mocks/Glossary.mock.ts +++ b/openmetadata-ui/src/main/resources/ui/src/mocks/Glossary.mock.ts @@ -67,6 +67,7 @@ export const mockedGlossaries = [ children: mockedGlossaryTerms, deleted: false, displayName: 'Mocked Glossary', + description: '', id: 'mocked-glossary-id', name: 'Mock Glossary', owner: {