[data view field editor] Composite runtime field editor#136954
[data view field editor] Composite runtime field editor#136954mattkime merged 143 commits intoelastic:mainfrom
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
src/plugins/data_view_field_editor/public/components/field_editor/composite_editor.tsx
Outdated
Show resolved
Hide resolved
|
|
||
| const lastPreview$ = useMemo(() => { | ||
| const replaySubj = new BehaviorSubject<FieldPreview[]>([]); | ||
| fieldPreview$.subscribe(replaySubj); |
There was a problem hiding this comment.
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