-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Dataset Quality] Failure store privilege fixes #232003
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
Changes from all commits
f0dcbf1
a13924e
2c1578f
53f76fd
bae92b0
fc29269
5fea582
43a2212
63fa39b
e2571cd
32284af
98ef295
d9667cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,23 +94,25 @@ export default function QualitySummaryCards({ | |
| /> | ||
| </EuiFlexItem> | ||
| <EuiFlexItem grow={true}> | ||
| {!dataStreamSettingsLoading && !hasFailureStore && canUserReadFailureStore ? ( | ||
| {!dataStreamSettingsLoading && !(hasFailureStore && canUserReadFailureStore) ? ( | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix for #231836 |
||
| <Card | ||
| isDisabled={true} | ||
| title={overviewPanelDatasetQualityIndicatorFailedDocs} | ||
| kpiValue={i18n.translate('xpack.datasetQuality.noFailureStoreTitle', { | ||
| defaultMessage: 'No failure store', | ||
| })} | ||
| footer={ | ||
| <EuiLink | ||
| href={locator?.getRedirectUrl(locatorParams)} | ||
| target="_blank" | ||
| external={false} | ||
| > | ||
| {i18n.translate('xpack.datasetQuality.enableFailureStore', { | ||
| defaultMessage: 'Enable failure store', | ||
| })} | ||
| </EuiLink> | ||
| canUserReadFailureStore && ( | ||
| <EuiLink | ||
| href={locator?.getRedirectUrl(locatorParams)} | ||
| target="_blank" | ||
| external={false} | ||
| > | ||
| {i18n.translate('xpack.datasetQuality.enableFailureStore', { | ||
| defaultMessage: 'Enable failure store', | ||
| })} | ||
| </EuiLink> | ||
| ) | ||
|
Comment on lines
+105
to
+115
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code executes only when
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so the logic is if one of them or both are false we display the card. then the link is only displayed if the user really has access to failure store and can enable it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right, I got confused a bit |
||
| } | ||
| /> | ||
| ) : ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,16 +11,17 @@ import { useDatasetQualityContext } from '../components/dataset_quality/context' | |
| export const useDatasetQualityState = () => { | ||
| const { service } = useDatasetQualityContext(); | ||
|
|
||
| const { datasetUserPrivileges, dataStreamStats } = | ||
| useSelector(service, (state) => state.context) ?? {}; | ||
| const { datasetUserPrivileges } = useSelector(service, (state) => state.context) ?? {}; | ||
|
|
||
| const statsLoading = useSelector( | ||
| service, | ||
| (state) => state.matches('initializing') || state.matches('main.stats.datasets.fetching') | ||
| ); | ||
|
|
||
| const canUserReadFailureStore = Boolean( | ||
| dataStreamStats?.some((ds) => ds.userPrivileges.canReadFailureStore) | ||
| Object.values(datasetUserPrivileges?.datasetsPrivilages ?? {})?.some( | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix for #231564 |
||
| (privilege) => privilege.canReadFailureStore | ||
| ) | ||
| ); | ||
|
|
||
| const canUserMonitorAnyDataset = Boolean( | ||
|
|
||
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.
fix for #231576