-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[data view field editor] Composite runtime field editor #136954
[data view field editor] Composite runtime field editor #136954
Conversation
…ld-editor/composite-runtime-field
…ld-editor/composite-runtime-field
…ld-editor/composite-runtime-field
…ld-editor/composite-runtime-field
…-editor/composite-runtime-field
…-editor/composite-runtime-field
…-editor/composite-runtime-field
This is how I was able to reproduce different state inconsistencies When field preview request is still in progress, change to runtime field name leads to stale name in the preview and lose of "updating" state until request finishesbug1.movSwitching between composite and non-composite types could lead to stale composite keys, probably related to "resetting" fields (see how key7 is there in generated fields list at the end)bug2.mov |
…me/kibana into composite-runtime-field-editor_v2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/plugins/data_view_field_editor/public/components/field_editor/composite_editor.tsx
Outdated
Show resolved
Hide resolved
@@ -189,6 +152,89 @@ const FieldEditorComponent = ({ field, onChange, onFormModifiedChange }: Props) | |||
|
|||
const isValueVisible = get(formData, '__meta__.isValueVisible'); | |||
|
|||
const lastPreview$ = useMemo(() => { | |||
const replaySubj = new BehaviorSubject<FieldPreview[]>([]); | |||
fieldPreview$.subscribe(replaySubj); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So maybe lastPreview$ is not needed in the end? not sure exactly why it is needed. I believe in resetTypes we could just use fieldPreview.getValue() first
Also, useMemo is probably no the best choice here because it isn't guaranteed to be a stable reference and should be used just for perf optimizations
@Dosant |
@Dosant I believe I resolved the items you brought up, mind taking another look? |
Would it be difficult to make it BehaviourSubject? Or would this not work? But if not making a BehaviourSubject, can we reuse this |
@Dosant I was largely able to implement your suggestions. My only complaint is that I couldn't find a way to get the filter function to properly express that it was returning |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
@mattkime, I think you can use type guards like this:
|
Summary
Implement composite runtime field editor in data view field editor.
Closes: #126247
Screen.Recording.2022-08-13.at.11.34.57.PM.mov