-
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 views] add getDefaultDataView method #113891
Conversation
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
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.
Code lgtm,
p.s. there was no code owner ping? I think we forgot to add data_views
to codeowners? Could you add it?
💔 Backport failed
To backport manually run: |
* add new method to data views api * add tests Co-authored-by: Kibana Machine <[email protected]> # Conflicts: # src/plugins/data_views/common/data_views/data_views.ts
* add new method to data views api * add tests Co-authored-by: Kibana Machine <[email protected]> # Conflicts: # src/plugins/data_views/common/data_views/data_views.ts
…ide-users-to-saving-ux * 'master' of github.com:elastic/kibana: (133 commits) [DOCS] Indicate reports are a subscription feature (elastic#114653) Update namespace for indices (elastic#114612) [DOCS] Adds Logstash pipeline settings (elastic#114648) Bump EPR snapshot version used for tests (elastic#114529) [Security Solution] [Endpoint] Fleet summary card adjustments (elastic#114291) skip flaky suite (elastic#68400) [Visualizations] fix usage of optional dependencies (elastic#114286) [Security Solution] [Detections] Improves custom query rule upgrade test (elastic#114454) [fleet] Add Integration Preference selector (elastic#114432) [Reporting] Add new `data-render-error` attribute (elastic#114472) Replace EuiCodeEditor with CodeEditor in app-services code (elastic#114316) [data views] add getDefaultDataView method (elastic#113891) [Security Solution] [Endpoint] Event filters uses the new card design (elastic#114126) [fleet] Tweak Header UI (elastic#114704) [APM] Filter on tx metrics for instance stats (elastic#114758) [APM] Fix typo in linting docs (elastic#114764) [Discover] Removing SavedObject usage for savedSearch (elastic#112983) [Fleet] Add Integration Policy Page Improvements (elastic#114556) [Lens] Keep the custom label when transitioning to/from Formula (elastic#114270) [Security Solution][Endpoint] Host Isolation API changes (elastic#113621) ...
Summary
Addresses #112362
Closes: #112846
The DataViews service has this terrible method called
ensureDefaultDataView
which a number of apps call when loading which a) ensures there's a default data viewand b) redirects to Data View Management if there aren't any.There's no reason why the code that ensures there's a default data view should be tied to the code that redirects if there aren't any data views at all.
The
getDefaultDataView
ensures a default data view exists AND returns the default data view. Thats proper coupling. As for theensureDefaultDataView
- consumers should stop using it.