-
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
[Discover] Removing SavedObject usage for savedSearch #112983
[Discover] Removing SavedObject usage for savedSearch #112983
Conversation
7a5fe7f
to
7000224
Compare
2af74a6
to
bb32a6a
Compare
@elasticmachine merge upstream |
@elasticmachine merge upstream |
ab44b21
to
61d82f7
Compare
269ae6b
to
5a6e2f0
Compare
5a6e2f0
to
479c5a9
Compare
479c5a9
to
702607e
Compare
702607e
to
0aa4101
Compare
@elastic/kibana-reporting-services could we get a review on this? |
@flash1293 I think I fixed these issues. |
src/plugins/discover/public/saved_searches/saved_search_url_conflict_callout.ts
Outdated
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.
Comments got addressed, works fine for me 👍
@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.
Is there a way we could improve showing a conflicting saved search? Because currently users need to navigate to a different application, return to Discover, to have it removed. This is confusing, because first you'll try to reload the page, but the last link of Discover is still in session, which means, still the conflict screen is displayed. So I think showing the default view with the default index pattern and showing an error message about the conflicting saved object would be a better experience in this case.
This should not be the case, a conflicted saved search loads just fine (and shows a warning callout above the app). I'm guessing you are talking about the case with a conflicted index pattern (if you follow Joe Portners script with an export containing both index pattern and saved search, it will actually put both into a conflicting state). We discussed this with Joe and the current guidance is to fail on conflicts on "secondary saved objects" (SOs managed by some other part of Kibana, but used in the current view) - this is also how dashboard behaves (even though it's just per panel there). I don't have a strong opinion on this - @jportner what do you think? |
yes, exactly that's what I did. fine with failing here, just to remove the failure in this special case could be improved |
We do the "show toast and go to default view of the app" in some other error cases (e.g. Visualize). Could be done here as well, but we would have to make sure to not enter a loop (what if the default index pattern is conflicted?) |
yes, this could be the case. Is there a way to remove or clean the last discover URL in the session in case there's an conflicting error? |
Yeah, for the most consistent user experience we should do this. FWIW, a more recent development is #113335, in which we will add validation before objects are created to prevent legacy URL alias conflict scenarios from happening in the first place. We hope no users will ever run into this in the real world, but we have this error handling out of an abundance of caution. I wouldn't worry too much about making sure this screen has a really nice workflow to help users fix the issue. If this does happen, users will need to disable the legacy URL alias using our API. With #114172 that was recently merged, the |
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.
LGTM, tested locally.
…ct-loader # Conflicts: # src/plugins/discover/public/application/apps/context/services/context.ts
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: cc @alexwizp |
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.
LGTM, tested and works as expected ... talked with @alexwizp and decided to move forward here and solve the problem with the special case of conflicts in saves search and index pattern in a follow up PR.
* [Discover] Step 2 - remove SavedObjectLoader * Fix PR comments * fix test names * fix ts error * add handling of missed 'so' * add Embeddable error * fix jest * add DiscoverError component * fix Joe comments * add search params * add throwErrorOnUrlConflict util method * add error handling into transform plugin * do some updates * add spaces into visualize, visualizations * fix Tim's comment * pass false into createGetterSetter for getSpaces * Fix comments * Fix lint Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Uladzislau Lasitsa <Uladzislau_Lasitsa@epam.com> # Conflicts: # src/plugins/discover/public/application/apps/context/services/context.ts
…#114767) * [Discover] Removing SavedObject usage for savedSearch (#112983) * [Discover] Step 2 - remove SavedObjectLoader * Fix PR comments * fix test names * fix ts error * add handling of missed 'so' * add Embeddable error * fix jest * add DiscoverError component * fix Joe comments * add search params * add throwErrorOnUrlConflict util method * add error handling into transform plugin * do some updates * add spaces into visualize, visualizations * fix Tim's comment * pass false into createGetterSetter for getSpaces * Fix comments * Fix lint Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Uladzislau Lasitsa <Uladzislau_Lasitsa@epam.com> # Conflicts: # src/plugins/discover/public/application/apps/context/services/context.ts * Update context.ts * fix saved_object_manangement
…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) ...
Closes: #105810
Get rid of
savedSearch
SavedObject inDiscover
. This work is done because theSavedObject
class has been deprecated and will be removed inKibana 8
To avoid the PR affecting many files, I suggest breaking it down into several parts:
Step 1 (7.16 and 8.0):
The goal of this step is to get rid of legacy dependencies in all external plugins. What should be done:
savedSearch
SavedObject
as deprecated and move intolegacy
folder.savedSearch
and use it from all external plugins instead ofSavedObjectLoader
;lastSavedTitle
fromSavedSearch
savedObject.get
should be replaced tosavedObject.resolve
Step 2 (7.16 and 8.0):
ISearchSource
,SearchSource
type should be replaced toISearchSource
getSavedSearchById
andgetSavedSearchUrlById
from the DiscoverServices API;Discover
to work withsavedSearch
'es withoutSavedObject
.Step 3 (7.16 and 8.0):
Discover
to correctly handle cases onIndex Pattern conflicts
.Step 4 (only for 8.0): 🏃
Testing notes:
This PR contains changes with replacing
get()
toresolve()
for support ofSharing Saved Objects
. To test it follow the following guide #107099 (comment)Screens:
SavedSearchURLConflictCallout
:Redirect:
Conflict index pattern:
Transform plugin: