forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui) Fix UI flickering when switching between glossary entities (d…
- Loading branch information
1 parent
036983c
commit 4f78de6
Showing
23 changed files
with
292 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
datahub-web-react/src/app/entity/shared/GlossaryEntityContext.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { useContext } from 'react'; | ||
import { GenericEntityProperties } from './types'; | ||
|
||
export interface GlossaryEntityContextType { | ||
isInGlossaryContext: boolean; | ||
entityData: GenericEntityProperties | null; | ||
setEntityData: (entityData: GenericEntityProperties | null) => void; | ||
// Since we have glossary data in the profile and in the sidebar browser, we need to communicate to the | ||
// sidebar when to refetch for a given node or at the root level (if we're editing a term or node without a parent). | ||
// This will happen when you edit a name, move a term/group, create a new term/group, and delete a term/group | ||
urnsToUpdate: string[]; | ||
setUrnsToUpdate: (updatdUrns: string[]) => void; | ||
} | ||
|
||
export const GlossaryEntityContext = React.createContext<GlossaryEntityContextType>({ | ||
isInGlossaryContext: false, | ||
entityData: null, | ||
setEntityData: () => {}, | ||
urnsToUpdate: [], | ||
setUrnsToUpdate: () => {}, | ||
}); | ||
|
||
export const useGlossaryEntityData = () => { | ||
const { isInGlossaryContext, entityData, setEntityData, urnsToUpdate, setUrnsToUpdate } = | ||
useContext(GlossaryEntityContext); | ||
return { isInGlossaryContext, entityData, setEntityData, urnsToUpdate, setUrnsToUpdate }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.