diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx index f2296078443..24d3ab33458 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx @@ -25,6 +25,7 @@ import { TITLE_FOR_NON_ADMIN_ACTION } from '../../constants/constants'; import { Glossary } from '../../generated/entity/data/glossary'; import { GlossaryTerm } from '../../generated/entity/data/glossaryTerm'; import { useAuth } from '../../hooks/authHooks'; +import { useAfterMount } from '../../hooks/useAfterMount'; import { ModifiedGlossaryData } from '../../pages/GlossaryPage/GlossaryPageV1.component'; import { getEntityDeleteMessage } from '../../utils/CommonUtils'; import { generateTreeData } from '../../utils/GlossaryUtils'; @@ -110,6 +111,15 @@ const GlossaryV1 = ({ >([]); const [showActions, setShowActions] = useState(false); const [isDelete, setIsDelete] = useState(false); + const [addTermButtonWidth, setAddTermButtonWidth] = useState( + document.getElementById('add-term-button')?.offsetWidth || 0 + ); + const [manageButtonWidth, setManageButtonWidth] = useState( + document.getElementById('manage-button')?.offsetWidth || 0 + ); + const [leftPanelWidth, setLeftPanelWidth] = useState( + document.getElementById('glossary-left-panel')?.offsetWidth || 0 + ); /** * To create breadcrumb from the fqn @@ -163,10 +173,23 @@ const GlossaryV1 = ({ handleBreadcrum(selectedKey); }, [selectedKey]); + useAfterMount(() => { + setLeftPanelWidth( + document.getElementById('glossary-left-panel')?.offsetWidth || 0 + ); + setAddTermButtonWidth( + document.getElementById('add-term-button')?.offsetWidth || 0 + ); + setManageButtonWidth( + document.getElementById('manage-button')?.offsetWidth || 0 + ); + }); + const manageButtonContent = () => { return (
setIsDelete(true)}>
{ return ( -
+
Glossary
@@ -256,9 +279,14 @@ const GlossaryV1 = ({
- +
-
+