-
Notifications
You must be signed in to change notification settings - Fork 919
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
[FIX] Dashboard list integrated delete #3796
[FIX] Dashboard list integrated delete #3796
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #3796 +/- ##
=======================================
Coverage 66.46% 66.46%
=======================================
Files 3226 3226
Lines 62012 62012
Branches 9588 9588
=======================================
+ Hits 41215 41219 +4
+ Misses 18497 18494 -3
+ Partials 2300 2299 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@pjfitzgibbons One of the commits is missing the sign-off for DCO: https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3796/checks?check_run_id=12607666399 |
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.
@pjfitzgibbons For a bug fix like this, I'd expect a regression test case. Is the deletion case covered by any of the functional or unit tests? If you have a screencast that shows bulk and individual delete operations working, that's always helpful too.
Otherwise just some minor questions about the implementation choices and nature of the bug.
@pjfitzgibbons Just checking in on this - code freeze is Monday, so we'd like to be able to merge before then. |
Existing test cases should cover. There are delete cases, no-error means refactor has not changed behaviour. Do we have test cases that specifically cover "optional" plugin-available APIs ? |
Signed-off-by: Peter Fitzgibbons <[email protected]>
ae6d708
to
164f022
Compare
Fixed. (squashed the branch) |
Ran the code and functionality looks good with deleting the dashboards. Have not tried deleting with the new dashboard list functionality with other plugins. |
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.
@pjfitzgibbons This looks good - if you can add the suggested error toast, we should be ready to go.
So this bug was only for deleting objects that used the new interface (deleting legacy dashboards worked fine)? If that's the case, then yeah, we'd want to update our test cases to include mock non-dashboard objects that use the new interface that validates those functionalities. |
(current test failures can be ignored) |
Also need to be rebased to fix the link and cypress tests and the merge conflicts. @pjfitzgibbons |
@abbyhu2000 See #3796 (comment) - those failures are unrelated. But given the changelog conflict, I'll resolve and restart the automation. |
@pjfitzgibbons, attempting to recreate the error on main with and without an extra plugin registering but not able to recreate it. Are you still seeing this issue? What was the error from the toast? |
I believe deleting existing dashboard items worked fine - so you'd need to have a non-dashboard item registered to be able to delete and see the error, which is what I suggested in terms of test expansion. |
All checks passed. |
Signed-off-by: Josh Romero <[email protected]>
I'll look at testing tomorrow. |
Signed-off-by: Josh Romero <[email protected]>
return Promise.all( | ||
ids.map(({ id, appId }) => { | ||
return deps.savedObjectsClient.delete(appId, id); | ||
}) | ||
).catch((error) => { | ||
deps.toastNotifications.addError(error, { | ||
title: i18n.translate('dashboard.dashboardListingDeleteErrorTitle', { | ||
defaultMessage: 'Error deleting dashboard', | ||
}), | ||
}); | ||
}); |
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.
If I understand this correctly, we fire off a bunch of delete
requests in parallel and if one fails we show an error that there was a problem deleting the "dashboard" but in reality, we have deleted some stuff. This doesn't sound like good UX.
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.
I think we want to go with consistent UX (so that the same component on dashboard
and visualize
behaves the same) first, and then we can improve the existing UX in a follow-up.
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.
@@ -171,7 +170,18 @@ export function initDashboardApp(app, deps) { | |||
history.push(deps.addBasePath(viewUrl)); | |||
}; | |||
$scope.delete = (dashboards) => { | |||
return service.delete(dashboards.map((d) => d.id)); | |||
const ids = dashboards.map((d) => ({ id: d.id, appId: d.appId })); |
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.
Any reason why this map
is not combined with the map
inside the all
?
* [FIx] Dashboard-List Integrated Delete Signed-off-by: Peter Fitzgibbons <[email protected]> * Add toast notification on deletion error Signed-off-by: Josh Romero <[email protected]> * add toast notification dependency Signed-off-by: Josh Romero <[email protected]> --------- Signed-off-by: Peter Fitzgibbons <[email protected]> Signed-off-by: Josh Romero <[email protected]> Co-authored-by: Peter Fitzgibbons <[email protected]> Co-authored-by: Josh Romero <[email protected]> (cherry picked from commit 9d27023) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* [FIx] Dashboard-List Integrated Delete * Add toast notification on deletion error * add toast notification dependency --------- (cherry picked from commit 9d27023) Signed-off-by: Peter Fitzgibbons <[email protected]> Signed-off-by: Josh Romero <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Peter Fitzgibbons <[email protected]> Co-authored-by: Josh Romero <[email protected]>
Description
Fix delete on Dashboard items with Integrated Providers feature
Issues Resolved
resolves #3795
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr