mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-31 02:29:03 +00:00 
			
		
		
		
	ui: fixed re-render issue in glossary term page (#14051)
This commit is contained in:
		
							parent
							
								
									dc1d465b7e
								
							
						
					
					
						commit
						06d9ca3f49
					
				| @ -18,6 +18,7 @@ import { Glossary } from '../../../../generated/entity/data/glossary'; | |||||||
| import { GlossaryTerm } from '../../../../generated/entity/data/glossaryTerm'; | import { GlossaryTerm } from '../../../../generated/entity/data/glossaryTerm'; | ||||||
| import { ChangeDescription } from '../../../../generated/entity/type'; | import { ChangeDescription } from '../../../../generated/entity/type'; | ||||||
| import { TagLabel } from '../../../../generated/type/tagLabel'; | import { TagLabel } from '../../../../generated/type/tagLabel'; | ||||||
|  | import { getEntityName } from '../../../../utils/EntityUtils'; | ||||||
| import { | import { | ||||||
|   getEntityVersionByField, |   getEntityVersionByField, | ||||||
|   getEntityVersionTags, |   getEntityVersionTags, | ||||||
| @ -109,7 +110,7 @@ const GlossaryOverviewTab = ({ | |||||||
|           <Col span={24}> |           <Col span={24}> | ||||||
|             <DescriptionV1 |             <DescriptionV1 | ||||||
|               description={glossaryDescription} |               description={glossaryDescription} | ||||||
|               entityName={selectedData?.displayName ?? selectedData?.name} |               entityName={getEntityName(selectedData)} | ||||||
|               entityType={EntityType.GLOSSARY} |               entityType={EntityType.GLOSSARY} | ||||||
|               hasEditAccess={permissions.EditDescription || permissions.EditAll} |               hasEditAccess={permissions.EditDescription || permissions.EditAll} | ||||||
|               isEdit={isDescriptionEditable} |               isEdit={isDescriptionEditable} | ||||||
|  | |||||||
| @ -13,7 +13,7 @@ | |||||||
| 
 | 
 | ||||||
| import { AxiosError } from 'axios'; | import { AxiosError } from 'axios'; | ||||||
| import { compare } from 'fast-json-patch'; | import { compare } from 'fast-json-patch'; | ||||||
| import React, { useEffect, useMemo, useState } from 'react'; | import React, { useCallback, useEffect, useMemo, useState } from 'react'; | ||||||
| import { useTranslation } from 'react-i18next'; | import { useTranslation } from 'react-i18next'; | ||||||
| import { useHistory, useParams } from 'react-router-dom'; | import { useHistory, useParams } from 'react-router-dom'; | ||||||
| import ErrorPlaceHolder from '../../../components/common/ErrorWithPlaceholder/ErrorPlaceHolder'; | import ErrorPlaceHolder from '../../../components/common/ErrorWithPlaceholder/ErrorPlaceHolder'; | ||||||
| @ -248,7 +248,8 @@ const GlossaryPage = () => { | |||||||
|       .finally(() => setDeleteStatus(LOADING_STATE.INITIAL)); |       .finally(() => setDeleteStatus(LOADING_STATE.INITIAL)); | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   const handleGlossaryTermUpdate = async (updatedData: GlossaryTerm) => { |   const handleGlossaryTermUpdate = useCallback( | ||||||
|  |     async (updatedData: GlossaryTerm) => { | ||||||
|       const jsonPatch = compare(selectedData as GlossaryTerm, updatedData); |       const jsonPatch = compare(selectedData as GlossaryTerm, updatedData); | ||||||
|       try { |       try { | ||||||
|         const response = await patchGlossaryTerm( |         const response = await patchGlossaryTerm( | ||||||
| @ -269,7 +270,9 @@ const GlossaryPage = () => { | |||||||
|       } catch (error) { |       } catch (error) { | ||||||
|         showErrorToast(error as AxiosError); |         showErrorToast(error as AxiosError); | ||||||
|       } |       } | ||||||
|   }; |     }, | ||||||
|  |     [selectedData] | ||||||
|  |   ); | ||||||
| 
 | 
 | ||||||
|   const handleGlossaryTermDelete = (id: string) => { |   const handleGlossaryTermDelete = (id: string) => { | ||||||
|     setDeleteStatus(LOADING_STATE.WAITING); |     setDeleteStatus(LOADING_STATE.WAITING); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Shailesh Parmar
						Shailesh Parmar