Skip to content
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

Merged

Conversation

TinaHeiligers
Copy link
Contributor

@TinaHeiligers TinaHeiligers commented Dec 13, 2024

fix #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

Summary

Summarize your PR. If it involves visual changes include a screenshot or gif.

@TinaHeiligers TinaHeiligers added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Dec 13, 2024
@TinaHeiligers TinaHeiligers requested a review from a team as a code owner December 13, 2024 00:34
@@ -417,7 +420,9 @@ export class Table extends PureComponent<TableProps, TableState> {
iconType="trash"
color="danger"
onClick={onDelete}
isDisabled={allHidden || !capabilities.savedObjectsManagement.delete}
isDisabled={
Copy link
Contributor Author

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();
Copy link
Contributor Author

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)

Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TinaHeiligers TinaHeiligers enabled auto-merge (squash) December 13, 2024 16:13
@TinaHeiligers TinaHeiligers merged commit 4ee5222 into elastic:main Dec 13, 2024
8 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
savedObjectsManagement 87.2KB 87.3KB +77.0B

History

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12320393939

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 13, 2024
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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 13, 2024
# 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saved Objects Management delete tooltip persisting
4 participants