-
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
[Saved object] prevent deleting managed content from UI #176443
[Saved object] prevent deleting managed content from UI #176443
Conversation
/ci |
/ci |
/ci |
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.
Overall looking good @drewdaemon ! Thanks for making this improvement. I left a few comments that I'd like to get your thoughts on before approving.
...lugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
Outdated
Show resolved
Hide resolved
...jects_management/public/management_section/objects_table/components/delete_confirm_modal.tsx
Outdated
Show resolved
Hide resolved
@jloleysens I have unified the behavior of hidden and managed saved objects. Could you take another look? |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Async chunks
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.
LGTM, just a couple remarks
<p | ||
css={css` | ||
margin-block-end: 0 !important; | ||
`} | ||
> |
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.
🙈 In theory we should be able to do this without inline css just with EUI components, don't we?
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 the concern is around inline CSS (?) this uses emotion so it generates a class for this element.
selectedSavedObjects.filter( | ||
({ managed, meta: { hiddenType } }) => !managed && !hiddenType | ||
).length === 0 || !capabilities.savedObjectsManagement.delete |
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.
NIT: I would memo
this now that we're doing a full array lookup via filter
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.
Sorry, I missed these comments. This is a good idea. Will open 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.
Thanks for making those enhancements @drewdaemon ! LGTM.
## Summary Closes elastic#172391 This change stops users from deleting managed content from the SO management page by - keeping the delete action disabled when the selection contains only managed content - excluding managed content from the list in the delete modal https://github.com/elastic/kibana/assets/315764/5bfa974e-823e-4c35-b6b9-71fcd08bf5e8 <img width="1673" alt="Screenshot 2024-02-07 at 12 53 29 PM" src="https://github.com/elastic/kibana/assets/315764/645238ec-dfe7-4f10-b468-df40e4fcb698"> ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials — will be done in elastic#175150 - [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
## Summary Closes elastic#172391 This change stops users from deleting managed content from the SO management page by - keeping the delete action disabled when the selection contains only managed content - excluding managed content from the list in the delete modal https://github.com/elastic/kibana/assets/315764/5bfa974e-823e-4c35-b6b9-71fcd08bf5e8 <img width="1673" alt="Screenshot 2024-02-07 at 12 53 29 PM" src="https://github.com/elastic/kibana/assets/315764/645238ec-dfe7-4f10-b468-df40e4fcb698"> ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials — will be done in elastic#175150 - [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
Summary
Closes #172391
This change stops users from deleting managed content from the SO management page by
Screen.Recording.2024-02-07.at.12.53.56.PM.mov
Checklist
Delete any items that are not applicable to this PR.