[Lens] introduce unified user messages system#147818
[Lens] introduce unified user messages system#147818drewdaemon merged 51 commits intoelastic:mainfrom
Conversation
becaa38 to
3933fe8
Compare
d59b3f0 to
fbec723
Compare
fbec723 to
0de8d2c
Compare
875505b to
8f3afc6
Compare
16f46bd to
6a5e7bf
Compare
…ck-render-on-missing-field
…m:andrewctate/kibana into 143673/dont-block-render-on-missing-field
...ck/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx
Outdated
Show resolved
Hide resolved
...ck/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx
Outdated
Show resolved
Hide resolved
dej611
left a comment
There was a problem hiding this comment.
Tested locally and it works.
Left some minor code refactoring nits. Approving to not block.
MichaelMarcialis
left a comment
There was a problem hiding this comment.
Left one small comment, but LGTM otherwise.
x-pack/plugins/lens/public/app_plugin/get_application_user_messages.tsx
Outdated
Show resolved
Hide resolved
stratoula
left a comment
There was a problem hiding this comment.
Changes LGTM! Thanx Andrew, I really like the new system and will become even more handy in the future:)
…m:andrewctate/kibana into 143673/dont-block-render-on-missing-field
💚 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: |
Summary
Preparation for #147485, #143673
This PR revamps the code that surfaces feedback in Lens. Warnings, deprecation messages, and errors are merged into a unified concept of the
UserMessage. Guiding principles:Architecture changes
Current State
Warnings and errors are distinct entities. Ad hoc methods and call stacks have been added each time messages needed to be displayed in new UI locations. Warnings surfaced from children in the component tree are pushed to the Redux store in order to display them at a higher hierarchical level. Dimension trigger state is controlled by visualization configuration.
New State
Most user messages originate from
visualization.getUserMessages,datasource.getUserMessages, andgetApplicationUserMessages. When messages need to be generated outside those routines,addUserMessagesutility makes them available globally. Redux store is no longer in play. Dimension trigger state is now controlled by user messages just like every other display location. Messages are queried for display via the globalgetUserMessagesAPI.Example test cases
Display locations
Editor toolbar
clientipEmbeddable badge
Trigger shard failures by following these instructions
Dimension trigger
Visualization
@timestampText-based languages query input
discover:enableSqlin Advanced SettingsBanner
lens:useFieldExistenceSamplingin Advanced SettingsChecklist
Delete any items that are not applicable to this PR.