-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[ResponseOps][Rules]Hide rule actions instead of disabling them in the rules list #216783
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
[ResponseOps][Rules]Hide rule actions instead of disabling them in the rules list #216783
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
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.
LTGM! I tested and I found the following:
- If there is a schedule I cannot see it with read permissions. I think we should show it but the button should be disabled and the user cannot change it.
Stack read permissions. Solutions all permissions:

- If I only have read access across all solutions (all rule types) the last column is an empty column. Maybe we can remove it entirely to save some space. Not sure how feasible it is or if it is straightforward. If not we can leave it as it is. Let's talk offline about it.

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 addressing my comments! As we discussed offline there is no need to hide the actions column entirely if the user has read access to all rule types. I left some comments.
@@ -418,19 +418,20 @@ export const RuleDetails: React.FunctionComponent<RuleDetailsProps> = ({ | |||
</EuiFlexGroup> | |||
} | |||
rightSideItems={[ | |||
<RuleActionsPopover | |||
canSaveRule={canSaveRule} |
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.
Let's keep it just to be safe.
if (isRuleEditable) { | ||
return unsnoozedButton; | ||
} | ||
return null; |
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 found this a bit confusing. I think it is better if at the top of the useMemo
we do:
if (!isScheduled && !isSnoozed && !isSnoozedIndefinitely && !isRuleEditable) {
return null;
}
and leave the rest of the logic as it is. Wdyt?
isRuleEditable={false} | ||
/> | ||
); | ||
expect(screen.queryByTestId('rulesListNotifyBadge-unsnoozed')).not.toBeInTheDocument(); |
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 you need to check for rulesListNotifyBadge
as the buttonWithToolTip
will be undefined because the button
will be null
, right?
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
Starting backport for target branches: 8.17, 8.18, 8.x, 9.0 |
…e rules list (elastic#216783) Closes elastic#210979 ## Summary - This PR updates the rules list and rules details pages to hide actions for the users with read-only access. Previously, these actions were disabled, but now they are completely hidden. Specifically: - on the `Rules List` page, the snooze bell icon and the table row actions are now hidden for the users with read-only access - on the `Rule Details` page, the actions button is now hidden (previously, the users could click on it, but the options were disabled) <img width="1899" alt="Screenshot 2025-04-02 at 14 06 53" src="https://github.com/user-attachments/assets/712297bf-b807-4ecc-87da-a32cd67d169f" /> <img width="1899" alt="Screenshot 2025-04-02 at 14 07 06" src="https://github.com/user-attachments/assets/a88762fa-feeb-4117-9dc4-31744c752d82" /> (cherry picked from commit afc5274)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
… in the rules list (#216783) (#217947) # Backport This will backport the following commits from `main` to `8.x`: - [[ResponseOps][Rules]Hide rule actions instead of disabling them in the rules list (#216783)](#216783) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Georgiana-Andreea Onoleață","email":"georgiana.onoleata@elastic.co"},"sourceCommit":{"committedDate":"2025-04-11T08:52:35Z","message":"[ResponseOps][Rules]Hide rule actions instead of disabling them in the rules list (#216783)\n\nCloses https://github.com/elastic/kibana/issues/210979\n\n## Summary\n\n- This PR updates the rules list and rules details pages to hide actions\nfor the users with read-only access. Previously, these actions were\ndisabled, but now they are completely hidden. Specifically:\n- on the `Rules List` page, the snooze bell icon and the table row\nactions are now hidden for the users with read-only access\n- on the `Rule Details` page, the actions button is now hidden\n(previously, the users could click on it, but the options were disabled)\n \n<img width=\"1899\" alt=\"Screenshot 2025-04-02 at 14 06 53\"\nsrc=\"https://github.com/user-attachments/assets/712297bf-b807-4ecc-87da-a32cd67d169f\"\n/>\n\n<img width=\"1899\" alt=\"Screenshot 2025-04-02 at 14 07 06\"\nsrc=\"https://github.com/user-attachments/assets/a88762fa-feeb-4117-9dc4-31744c752d82\"\n/>","sha":"afc5274fb800b2e82dd0e389946ac3bab0415f57","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.19.0","v8.17.5"],"title":"[ResponseOps][Rules]Hide rule actions instead of disabling them in the rules list","number":216783,"url":"https://github.com/elastic/kibana/pull/216783","mergeCommit":{"message":"[ResponseOps][Rules]Hide rule actions instead of disabling them in the rules list (#216783)\n\nCloses https://github.com/elastic/kibana/issues/210979\n\n## Summary\n\n- This PR updates the rules list and rules details pages to hide actions\nfor the users with read-only access. Previously, these actions were\ndisabled, but now they are completely hidden. Specifically:\n- on the `Rules List` page, the snooze bell icon and the table row\nactions are now hidden for the users with read-only access\n- on the `Rule Details` page, the actions button is now hidden\n(previously, the users could click on it, but the options were disabled)\n \n<img width=\"1899\" alt=\"Screenshot 2025-04-02 at 14 06 53\"\nsrc=\"https://github.com/user-attachments/assets/712297bf-b807-4ecc-87da-a32cd67d169f\"\n/>\n\n<img width=\"1899\" alt=\"Screenshot 2025-04-02 at 14 07 06\"\nsrc=\"https://github.com/user-attachments/assets/a88762fa-feeb-4117-9dc4-31744c752d82\"\n/>","sha":"afc5274fb800b2e82dd0e389946ac3bab0415f57"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216783","number":216783,"mergeCommit":{"message":"[ResponseOps][Rules]Hide rule actions instead of disabling them in the rules list (#216783)\n\nCloses https://github.com/elastic/kibana/issues/210979\n\n## Summary\n\n- This PR updates the rules list and rules details pages to hide actions\nfor the users with read-only access. Previously, these actions were\ndisabled, but now they are completely hidden. Specifically:\n- on the `Rules List` page, the snooze bell icon and the table row\nactions are now hidden for the users with read-only access\n- on the `Rule Details` page, the actions button is now hidden\n(previously, the users could click on it, but the options were disabled)\n \n<img width=\"1899\" alt=\"Screenshot 2025-04-02 at 14 06 53\"\nsrc=\"https://github.com/user-attachments/assets/712297bf-b807-4ecc-87da-a32cd67d169f\"\n/>\n\n<img width=\"1899\" alt=\"Screenshot 2025-04-02 at 14 07 06\"\nsrc=\"https://github.com/user-attachments/assets/a88762fa-feeb-4117-9dc4-31744c752d82\"\n/>","sha":"afc5274fb800b2e82dd0e389946ac3bab0415f57"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Georgiana-Andreea Onoleață <georgiana.onoleata@elastic.co>
Closes #210979
Summary
Rules List
page, the snooze bell icon and the table row actions are now hidden for the users with read-only accessRule Details
page, the actions button is now hidden (previously, the users could click on it, but the options were disabled)