-
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
[Actionable Observability] rules page read permissions & snoozed status & no data screen #128108
Merged
mgiota
merged 22 commits into
elastic:main
from
mgiota:123585_rules_page_read_permissions
Mar 24, 2022
Merged
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3a07e12
users with read permissions can not edit/delete/create rules
mgiota 32ff27d
users with read permissions can not change the status
mgiota 22d99c8
Merge branch 'main' of github.com:elastic/kibana into 123585_rules_pa…
mgiota dbeef85
Merge branch 'main' into 123585_rules_page_read_permissions
kibanamachine 882de2e
clean up unused code
mgiota 20607d6
localization for change status aria label
mgiota 237cb23
remove console log
mgiota 2d51427
add muted status
mgiota ca868ba
rename to snoozed
mgiota d87bd1c
remove unused imports
mgiota ab76864
rename snoozed to snoozed permanently
mgiota 316a086
localize statuses
mgiota 1699116
implement no data and no permission screen
mgiota f71fca7
fix prompt filenames
mgiota 4685334
fix i18n error
mgiota f249324
Merge branch 'main' into 123585_rules_page_read_permissions
kibanamachine 4b9937e
change permanently to indefinitely
mgiota 7ddd805
do not show noData screen when filters are applied and don't match an…
mgiota bd5a873
add centered spinner on initial load
mgiota b98f947
move currrent functionality from triggers_actions_ui related to pagin…
mgiota d3e9162
disable status column if license is not enabled
mgiota e4c11f4
Merge branch 'main' into 123585_rules_page_read_permissions
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
x-pack/plugins/observability/public/pages/rules/components/center_justified_spinner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; | ||
import { EuiLoadingSpinnerSize } from '@elastic/eui/src/components/loading/loading_spinner'; | ||
|
||
interface Props { | ||
size?: EuiLoadingSpinnerSize; | ||
} | ||
|
||
export function CenterJustifiedSpinner({ size }: Props) { | ||
return ( | ||
<EuiFlexGroup data-test-subj="centerJustifiedSpinner" justifyContent="center"> | ||
<EuiFlexItem grow={false}> | ||
<EuiLoadingSpinner size={size || 'xl'} /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
x-pack/plugins/observability/public/pages/rules/components/prompts/no_data_prompt.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import React from 'react'; | ||
import { EuiButton, EuiEmptyPrompt, EuiLink, EuiButtonEmpty, EuiPageTemplate } from '@elastic/eui'; | ||
|
||
export function NoDataPrompt({ | ||
onCTAClicked, | ||
documentationLink, | ||
}: { | ||
onCTAClicked: () => void; | ||
documentationLink: string; | ||
}) { | ||
return ( | ||
<EuiPageTemplate | ||
template="centeredContent" | ||
pageContentProps={{ | ||
paddingSize: 'none', | ||
role: null, // For passing a11y tests in EUI docs only | ||
}} | ||
> | ||
<EuiEmptyPrompt | ||
color="plain" | ||
hasBorder={true} | ||
data-test-subj="createFirstRuleEmptyPrompt" | ||
title={ | ||
<h2> | ||
<FormattedMessage | ||
id="xpack.observability.rules.emptyPrompt.emptyTitle" | ||
defaultMessage="Create your first Rule" | ||
/> | ||
</h2> | ||
} | ||
body={ | ||
<p> | ||
<FormattedMessage | ||
id="xpack.observability.rules.noDataPrompt.noDataDesc" | ||
defaultMessage="Rules allow you to receive alerts and automate custom actions when specific conditions are met." | ||
/> | ||
</p> | ||
} | ||
actions={[ | ||
<EuiButton | ||
iconType="plusInCircle" | ||
data-test-subj="createFirstRuleButton" | ||
key="create-action" | ||
fill | ||
onClick={onCTAClicked} | ||
> | ||
<FormattedMessage | ||
id="xpack.observability.rules.emptyPrompt.emptyButton" | ||
defaultMessage="Create Rule" | ||
/> | ||
</EuiButton>, | ||
<EuiButtonEmpty color="primary"> | ||
<EuiLink href={documentationLink} target="_blank"> | ||
Documentation | ||
</EuiLink> | ||
</EuiButtonEmpty>, | ||
]} | ||
/> | ||
</EuiPageTemplate> | ||
); | ||
} |
44 changes: 44 additions & 0 deletions
44
x-pack/plugins/observability/public/pages/rules/components/prompts/no_permission_prompt.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import React from 'react'; | ||
import { EuiEmptyPrompt, EuiPageTemplate } from '@elastic/eui'; | ||
|
||
export function NoPermissionPrompt() { | ||
return ( | ||
<EuiPageTemplate | ||
template="centeredContent" | ||
pageContentProps={{ | ||
paddingSize: 'none', | ||
role: null, // For passing a11y tests in EUI docs only | ||
}} | ||
> | ||
<EuiEmptyPrompt | ||
color="plain" | ||
hasBorder={true} | ||
iconType="securityApp" | ||
title={ | ||
<h1> | ||
<FormattedMessage | ||
id="xpack.observability.rules.noPermissionToCreateTitle" | ||
defaultMessage="No permissions to create rules" | ||
/> | ||
</h1> | ||
} | ||
body={ | ||
<p data-test-subj="permissionDeniedMessage"> | ||
<FormattedMessage | ||
id="xpack.observability.rules.noPermissionToCreateDescription" | ||
defaultMessage="Contact your system administrator." | ||
/> | ||
</p> | ||
} | ||
/> | ||
</EuiPageTemplate> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is it possible to have a rule
enabled
andmuted
at the same time?I assume
snoozed
==muteAll
, right? The API that provides theitem
is usingmuteAll
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.
@fkanout Yep we are using muteAll for the snoozed (indefinitely) state. And yes a rule can be enabled and muted at the same time. I had similar questions here #123580 (comment) and we ended up with @katrin-freihofner on following:
Enabled
state is shown in the UISnoozed indefinitely
state is shown in the UI, and yep it is enabled as well.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.
@mgiota, excellent explanation, thanks!
snoozed
+enabled
will keep the rule but it will not generate alerts?