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] Show underlying data editor navigation #125983
Conversation
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
…na into feature/show-underlying-data
Managed to properly fix this issue and also had some time to think about the user flow in this case. For instance let's assume this (bizarre) formula: Redirecting the user to discover now will show up an empty search box with the While this is technically right, I think that we missed some informations along the way, in particular the interest of the user for smaller sets of documents. Ideally, I think we should preserve this information providing "disabled" distinct filters (other than the Of course this is not something we need to have since day one, but I see it as an interesting enhancement of this feature as follow up. What do you think @flash1293 @ghudgins ? |
@@ -290,6 +313,26 @@ export const LensTopNavMenu = ({ | |||
filters, | |||
initialContext, | |||
]); | |||
|
|||
const canShowUnderlyingData = useMemo(() => { |
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 name implies a boolean value. Maybe layerMetaInfo
?
@elasticmachine merge upstream |
Just noticed that the "Open in Discover" button remains grayed-out when I remove the second layer: Screen.Recording.2022-03-04.at.4.45.01.PM.mov |
Yes, that was reported in the known issues section. |
@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.
} | ||
|
||
const uniqueFields = [...new Set(columnsWithNoTimeShifts.map(({ fields }) => fields).flat())]; | ||
// If no field, return? Or rather carry on and show the default columns? |
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.
Is this comment still neccessary?
layerId: firstLayerId, | ||
state: datasourceState, | ||
}); | ||
// maybe add also datasourceId validation here? |
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.
Let's put it in for now, I think long term we can make it work for other datasources as well.
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
…re-browser-errors * 'main' of github.com:elastic/kibana: (46 commits) [Reporting] Capture Kibana stopped error (elastic#127017) add updatedAt to SimpleSavedObject (elastic#126359) Remove deprecated & unused `ElasticsearchServiceStart.legacy` (elastic#127050) remove opacity for fitting line series (elastic#127176) Remove deprecated & unused `HttpServiceSetup.auth` (elastic#127056) [Lens] Show underlying data editor navigation (elastic#125983) Bump dependencies (elastic#127238) Remove deprecated & unused `public-AsyncPlugin` (elastic#127048) Remove deprecated & unused `SavedObjectsImportFailure.title` (elastic#127043) skip flaky suite (elastic#123372) [kbn/generate] add basic package generator (elastic#127095) [build] Up compression quality (elastic#127064) Made fix to broken test. Deleted all existing pipelines before test starts. FLAKY: elastic#118593 (elastic#127102) Increase timeout for Jest integration tests (elastic#127220) skip failing test suite (elastic#126949) [DOCS] Adds note for data source performance impact (elastic#127184) [Security Solution] Adds CCS privileges warning enable switch in advanced settings (elastic#124459) [App Search] Move to tabbed single tabbed JSON flyout with upload and paste options and refactor cards (elastic#127162) Update dependency chromedriver to v99 (elastic#127079) [kbn/pm] add timings for more parts of bootstrap (elastic#127157) ... # Conflicts: # x-pack/plugins/reporting/common/errors/index.ts # x-pack/plugins/reporting/server/lib/tasks/execute_report.ts
Summary
Fixes part of #122631
The main part of this PR is the availability of 2 main functions here that can be composed:
getLayerMetaInfo
to extract all relevant information to navigate to Discover from a Lens statecombineQueryAndFilters
to combine all meta information into thequery
andfilters
states to pass to the navigation.The following is a diagram of the flow enabled by this PR (dotted lines means that they haven't been implemented yet):
In the editor the button is shown as first on the left:
When the configuration is not supported the button is disabled:
When Discover is disabled (either
navLinks
ordiscover.show
capabilities ) then the button is not displayed at all:Notes
This PR does not include the embeddable action yet, providing only the foundation for the main task and an initial testing playground with the editor button.
Known bugs
activeData
still contains the reference layer data in it, making the check fail at the multiple layers stepSome questions
What label should have the button in the editor? ✅
Open in Discover
has been used, but open to suggestions here.What should happen when no fields are present in the configuration? (I.e.
Count of records
?) ✅Document
). It is currently enabled as described.What should happen for configuration with (at least one) time shift? ✅
What should happen when there is a reference layer with only a static value?
How to get back to the visualization configuration once navigated to Discover? ✅
Right now there's only the browser history to support that, which relies on the persisted state (i.e. last saved state or empty). I think it makes sense to have aGo back to Lens
button in Discover which helps the user to get back to complete/edit its configuration.What name should have the custom filter built with Lens aggregated filters? ✅
Lens context ($language)
custom label is used.What should happen for transposed datatables? ✅
field: term
values.Checklist
Delete any items that are not applicable to this PR.