-
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
Fix delete disabled state #204154
Fix delete disabled state #204154
Conversation
@@ -417,7 +420,9 @@ export class Table extends PureComponent<TableProps, TableState> { | |||
iconType="trash" | |||
color="danger" | |||
onClick={onDelete} | |||
isDisabled={allHidden || !capabilities.savedObjectsManagement.delete} | |||
isDisabled={ |
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.
Enables delete if some saved objects aren't hidden and delete is allowed
); | ||
|
||
await waitFor(() => { | ||
expect(screen.getByTestId('savedObjectsManagementDelete')).toBeDisabled(); |
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.
Assert the button's disabled rather than relying on a snapshot, changes to which are easily overlooked (or "fixed" without inspection)
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
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/12320393939 |
fix elastic#204095 Disables delete when no saved objects are selected or all objects selected are hidden and delete is allowed. ![Screenshot 2024-12-12 at 18 02 10](https://github.com/user-attachments/assets/e894a087-7906-4905-bd2e-2325a90d37c0) ## Summary Summarize your PR. If it involves visual changes include a screenshot or gif. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit 4ee5222)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [Fix delete disabled state (#204154)](#204154) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Christiane (Tina) Heiligers","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-13T17:39:48Z","message":"Fix delete disabled state (#204154)\n\nfix https://github.com/elastic/kibana/issues/204095\r\n\r\nDisables delete when no saved objects are selected or all objects\r\nselected are hidden and delete is allowed.\r\n\r\n![Screenshot 2024-12-12 at 18 02\r\n10](https://github.com/user-attachments/assets/e894a087-7906-4905-bd2e-2325a90d37c0)\r\n\r\n\r\n## Summary\r\n\r\nSummarize your PR. If it involves visual changes include a screenshot or\r\ngif.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"4ee52227bce2a1ffffaf930d41513bb0c644c199","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor"],"title":"Fix delete disabled state","number":204154,"url":"https://github.com/elastic/kibana/pull/204154","mergeCommit":{"message":"Fix delete disabled state (#204154)\n\nfix https://github.com/elastic/kibana/issues/204095\r\n\r\nDisables delete when no saved objects are selected or all objects\r\nselected are hidden and delete is allowed.\r\n\r\n![Screenshot 2024-12-12 at 18 02\r\n10](https://github.com/user-attachments/assets/e894a087-7906-4905-bd2e-2325a90d37c0)\r\n\r\n\r\n## Summary\r\n\r\nSummarize your PR. If it involves visual changes include a screenshot or\r\ngif.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"4ee52227bce2a1ffffaf930d41513bb0c644c199"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204154","number":204154,"mergeCommit":{"message":"Fix delete disabled state (#204154)\n\nfix https://github.com/elastic/kibana/issues/204095\r\n\r\nDisables delete when no saved objects are selected or all objects\r\nselected are hidden and delete is allowed.\r\n\r\n![Screenshot 2024-12-12 at 18 02\r\n10](https://github.com/user-attachments/assets/e894a087-7906-4905-bd2e-2325a90d37c0)\r\n\r\n\r\n## Summary\r\n\r\nSummarize your PR. If it involves visual changes include a screenshot or\r\ngif.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"4ee52227bce2a1ffffaf930d41513bb0c644c199"}}]}] BACKPORT--> Co-authored-by: Christiane (Tina) Heiligers <[email protected]>
fix #204095
Disables delete when no saved objects are selected or all objects selected are hidden and delete is allowed.
Summary
Summarize your PR. If it involves visual changes include a screenshot or gif.