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

[RAM] Disable rule status dropdown on readonly user #128971

Merged
merged 4 commits into from
Mar 31, 2022

Conversation

Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Mar 30, 2022

Summary

Fixes #128672

Screen Shot 2022-03-30 at 12 59 27 PM

When logged in as a read-only user, the Enable/Disable/Snooze control will just be a normal badge, and won't open a dropdown.

Checklist

@Zacqary Zacqary added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) auto-backport Deprecated - use backport:version if exact versions are needed Feature:Alerting/RulesManagement Issues related to the Rules Management UX v8.2.0 labels Mar 30, 2022
@Zacqary Zacqary requested a review from a team as a code owner March 30, 2022 18:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Zacqary added 2 commits March 30, 2022 13:57
# Conflicts:
#	x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.test.tsx
#	x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.tsx
#	x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx
@kibana-ci
Copy link
Collaborator

💚 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
triggersActionsUi 700.1KB 700.3KB +148.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@JiaweiWu JiaweiWu left a comment

Choose a reason for hiding this comment

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

Not too sure about the designs, but code wise, LGTM!

@@ -60,6 +61,7 @@ export const RuleStatusDropdown: React.FunctionComponent<ComponentOpts> = ({
enableRule,
snoozeRule,
unsnoozeRule,
isEditable,
Copy link
Contributor

Choose a reason for hiding this comment

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

should this default to true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer making it a required prop. We shouldn't be using this component in any context where we can't determine if the rule is editable or not.

@XavierM XavierM added the v8.3.0 label Mar 31, 2022
@Zacqary Zacqary merged commit 70fa265 into elastic:main Mar 31, 2022
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.2 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 128971

Questions ?

Please refer to the Backport tool documentation

Zacqary added a commit to Zacqary/kibana that referenced this pull request Apr 2, 2022
* [RAM] Disable rule status dropdown on readonly user

* Add test for readonly dropdown

(cherry picked from commit 70fa265)

# Conflicts:
#	x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.test.tsx
#	x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.tsx
#	x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx
Zacqary added a commit that referenced this pull request Apr 3, 2022
…129270)

* [RAM] Disable rule status dropdown on readonly user (#128971)

* [RAM] Disable rule status dropdown on readonly user

* Add test for readonly dropdown

(cherry picked from commit 70fa265)

# Conflicts:
#	x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.test.tsx
#	x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.tsx
#	x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx

* Remove previousSnoozeInterval

* remove previousSnoozeInterval

* remove previousSnoozeInterval

* remove previousSnoozeInterval

Co-authored-by: Xavier Mouligneau <xavier.mouligneau@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Alerting/RulesManagement Issues related to the Rules Management UX release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.2.0 v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RAM] Snooze UI should respect user roles
6 participants