-
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
[Lens] Navigate from discover to lens #77873
[Lens] Navigate from discover to lens #77873
Conversation
@elasticmachine merge upstream |
Pinging @elastic/kibana-app (Team:KibanaApp) |
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.
Thanks for taking a look at this! I would mainly like you to make this more generic, with the perspective that we want to add other ways of navigating to Lens from apps, not just discover.
export type ActionType = keyof ActionContextMapping; | ||
|
||
export interface ActionContextMapping { | ||
[DEFAULT_ACTION]: BaseContext; | ||
[ACTION_VISUALIZE_FIELD]: VisualizeFieldContext; | ||
[ACTION_VISUALIZE_GEO_FIELD]: VisualizeFieldContext; | ||
[ACTION_VISUALIZE_LENS_FIELD]: VisualizeFieldContext; |
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 if I understand this correctly, this is using the same trigger, but different action for Lens- this sounds like what we agreed.
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.
Yes, exactly same trigger VISUALIZE_FIELD_TRIGGER
but different action!
...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
x-pack/plugins/lens/public/indexpattern_datasource/indexpattern_suggestions.test.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/indexpattern_datasource/indexpattern_suggestions.ts
Show resolved
Hide resolved
x-pack/plugins/lens/public/trigger_actions/visualize_field_actions.ts
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
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.
Didn't test, uiActions
usage lgtm
@elasticmachine merge upstream |
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.
Great work so far @stratoula ! I added some comments, but it feels really close already.
...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
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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.
Almost perfect from my side, left a small comment
...ck/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx
Show resolved
Hide resolved
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.
Thanks, Lens changes LGTM once build is green
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
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.
Reviewed and tested again, LGTM!
@@ -132,6 +134,11 @@ export async function mountApp( | |||
onAppLeave={params.onAppLeave} | |||
setHeaderActionMenu={params.setHeaderActionMenu} | |||
history={routeProps.history} | |||
initialContext={ | |||
historyLocationState && historyLocationState.type === ACTION_VISUALIZE_LENS_FIELD | |||
? historyLocationState.payload |
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.
This is okay, but I was almost expecting the entire historyLocationState
to be passed in here so that the app is making fewer decisions. No need to change it unless you're planning on making other changes.
* Create lens action and unregister the visualize one * remove console * Implement Discover to Lens, wip, missing tests * Add unit tests * fix embed lens to empty dashboard functional tests * fix suggestions on save * Fix bug on save button, query and filters should be transferred from discover * Add functional test for the navigation from Discover to Lens * PR update after code review * unregister visualize action only if the action exists * Change the test to not be flaky * Move suggestions to editor frame and hide the emptyWorkspace for visualize field * Update ui actions docs * Add a retry to remove test flakiness * Fix bug of infinite loader when removing the y axis dimension Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.addtriggeraction.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.getaction.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggeractions.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggercompatibleactions.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.registeraction.md # src/plugins/ui_actions/public/public.api.md
* Create lens action and unregister the visualize one * remove console * Implement Discover to Lens, wip, missing tests * Add unit tests * fix embed lens to empty dashboard functional tests * fix suggestions on save * Fix bug on save button, query and filters should be transferred from discover * Add functional test for the navigation from Discover to Lens * PR update after code review * unregister visualize action only if the action exists * Change the test to not be flaky * Move suggestions to editor frame and hide the emptyWorkspace for visualize field * Update ui actions docs * Add a retry to remove test flakiness * Fix bug of infinite loader when removing the y axis dimension Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.actioncontextmapping.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.addtriggeraction.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.getaction.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggeractions.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.gettriggercompatibleactions.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.md # docs/development/plugins/ui_actions/public/kibana-plugin-plugins-ui_actions-public.uiactionsservice.registeraction.md # src/plugins/ui_actions/public/public.api.md
Summary
Closes #67415.
As we want to promote Lens, this PR changes the navigation from Discover (Visualize button) to Lens instead of the legacy visualizations. On OSS nothing changes, this applies only for Basic+ licenses.
To accomplish this, Lens must unregister the Visualize action and register its own. It adds the indexPatternId and the fieldName to the location state and passes it to the Lens architecture in order to depict the suggestions to the users.
Note: We decided to not have a link for Lens right now, for this reason the right click on Visualize button doesn't work anymore.
Example of bytes field (kibana_sample_data_logs dataset) visualization to Lens:
Checklist