-
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.
feat(#1243500): add header InfotoolTip in the grid and adapt the code…
… to the new 'depends' format in JSONLD
- Loading branch information
1 parent
5b5d1f6
commit 25e3aed
Showing
13 changed files
with
93 additions
and
86 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
16 changes: 13 additions & 3 deletions
16
packages/components/src/components/stateful/FieldGuesser/FieldGuesser.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 |
---|---|---|
@@ -1,15 +1,25 @@ | ||
import React from 'react' | ||
import { IFieldGuesserProps } from '@elastic-suite/gally-admin-shared' | ||
import { | ||
IFieldGuesserProps, | ||
getFieldState, | ||
} from '@elastic-suite/gally-admin-shared' | ||
|
||
import EditableFieldGuesser from './EditableFieldGuesser' | ||
import ReadableFieldGuesser from './ReadableFieldGuesser' | ||
|
||
function FieldGuesser(props: IFieldGuesserProps): JSX.Element { | ||
const { editable, ...fieldProps } = props | ||
const { visible, ...fieldStateProps } = getFieldState( | ||
fieldProps.data, | ||
fieldProps.depends | ||
) | ||
|
||
if (visible === false) return null | ||
|
||
if (editable) { | ||
return <EditableFieldGuesser {...fieldProps} /> | ||
return <EditableFieldGuesser {...fieldProps} {...fieldStateProps} /> | ||
} | ||
return <ReadableFieldGuesser {...fieldProps} /> | ||
return <ReadableFieldGuesser {...fieldProps} {...fieldStateProps} /> | ||
} | ||
|
||
export default FieldGuesser |
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
Oops, something went wrong.