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 28e6901b97e..933e68c6938 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 @@ -14,11 +14,14 @@ import { PlusOutlined } from '@ant-design/icons'; import { Button, Space, Switch, Typography } from 'antd'; import { UserSelectableList } from 'components/common/UserSelectableList/UserSelectableList.component'; -import Tags from 'components/Tag/Tags/tags'; +import { UserTag } from 'components/common/UserTag/UserTag.component'; +import { UserTagSize } from 'components/common/UserTag/UserTag.interface'; +import { UserTeamSelectableList } from 'components/common/UserTeamSelectableList/UserTeamSelectableList.component'; import { cloneDeep, toString } from 'lodash'; import { EntityTags } from 'Models'; import React, { useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; +import { getEntityName } from 'utils/EntityUtils'; import { ADD_GLOSSARY_ERROR } from '../../constants/Glossary.constant'; import { allowedNameRegEx } from '../../constants/regex.constants'; import { PageLayoutType } from '../../enums/layout.enum'; @@ -60,6 +63,7 @@ const AddGlossary = ({ const [tags, setTags] = useState([]); const [mutuallyExclusive, setMutuallyExclusive] = useState(false); const [reviewer, setReviewer] = useState>([]); + const [owner, setOwner] = useState(); const getDescription = () => { return markdownRef.current?.getEditorContent() || ''; @@ -68,6 +72,9 @@ const AddGlossary = ({ const handleReviewerSave = (reviewer: EntityReference[]) => { setReviewer(reviewer); }; + const handleUpdatedOwner = async (owner: EntityReference | undefined) => { + setOwner(owner); + }; const handleValidation = ( event: React.ChangeEvent @@ -93,13 +100,6 @@ const AddGlossary = ({ }); }; - const handleReviewerRemove = ( - _event: React.MouseEvent, - removedTag: string - ) => { - setReviewer((pre) => pre.filter((option) => option.name !== removedTag)); - }; - const validateForm = () => { const errMsg = { name: !name.trim(), @@ -113,6 +113,10 @@ const AddGlossary = ({ const handleSave = () => { if (validateForm()) { + const selectedOwner = owner || { + id: getCurrentUserId(), + type: 'user', + }; const data: CreateGlossary = { name: name.trim(), displayName: (displayName || name).trim(), @@ -120,10 +124,7 @@ const AddGlossary = ({ reviewers: reviewer.map((d) => toString(d.fullyQualifiedName)).filter(Boolean) ?? [], - owner: { - id: getCurrentUserId(), - type: 'user', - }, + owner: selectedOwner, tags: tags, mutuallyExclusive, }; @@ -225,9 +226,9 @@ const AddGlossary = ({ - +