forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Remove rule update/install callouts (elastic#160269)
## Summary This PR removes the callouts displaying new or updated rules. Given that the callouts cannot be dismissed, we've decided to remove them temporarily to prevent UI clutter, as there may be other callouts on the page. We're going to reintroduce these callouts in 8.10 with the ability to dismiss them till the next detection rules package release. Ticket to re-add the callouts in 8.10: elastic#160270 (cherry picked from commit 4dfb7bc)
- Loading branch information
Showing
2 changed files
with
70 additions
and
66 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
...ection_engine/rule_management_ui/components/rule_update_callouts/rule_update_callouts.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,63 @@ | ||
/* | ||
* 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 { EuiFlexGroup } from '@elastic/eui'; | ||
import React, { useCallback } from 'react'; | ||
import { SecurityPageName } from '../../../../app/types'; | ||
import { useGetSecuritySolutionLinkProps } from '../../../../common/components/links'; | ||
import { useKibana } from '../../../../common/lib/kibana'; | ||
import { usePrebuiltRulesStatus } from '../../../rule_management/logic/prebuilt_rules/use_prebuilt_rules_status'; | ||
import { MiniCallout } from '../mini_callout/mini_callout'; | ||
import { | ||
getUpdateRulesCalloutTitle, | ||
NEW_PREBUILT_RULES_AVAILABLE_CALLOUT_TITLE, | ||
} from '../mini_callout/translations'; | ||
import { AllRulesTabs } from '../rules_table/rules_table_toolbar'; | ||
|
||
export const RuleUpdateCallouts = () => { | ||
const { data: prebuiltRulesStatus } = usePrebuiltRulesStatus(); | ||
|
||
const rulesToInstallCount = prebuiltRulesStatus?.num_prebuilt_rules_to_install ?? 0; | ||
const rulesToUpgradeCount = prebuiltRulesStatus?.num_prebuilt_rules_to_upgrade ?? 0; | ||
|
||
// Check against rulesInstalledCount since we don't want to show banners if we're showing the empty prompt | ||
const shouldDisplayNewRulesCallout = rulesToInstallCount > 0; | ||
const shouldDisplayUpdateRulesCallout = rulesToUpgradeCount > 0; | ||
|
||
const getSecuritySolutionLinkProps = useGetSecuritySolutionLinkProps(); | ||
const { href } = getSecuritySolutionLinkProps({ | ||
deepLinkId: SecurityPageName.rules, | ||
path: AllRulesTabs.updates, | ||
}); | ||
const { | ||
application: { navigateToUrl }, | ||
} = useKibana().services; | ||
|
||
const updateCallOutOnClick = useCallback(() => { | ||
navigateToUrl(href); | ||
}, [navigateToUrl, href]); | ||
|
||
return ( | ||
<EuiFlexGroup direction="column"> | ||
{shouldDisplayUpdateRulesCallout && ( | ||
<MiniCallout | ||
iconType={'iInCircle'} | ||
data-test-subj="prebuilt-rules-update-callout" | ||
title={getUpdateRulesCalloutTitle(updateCallOutOnClick)} | ||
/> | ||
)} | ||
{shouldDisplayNewRulesCallout && ( | ||
<MiniCallout | ||
color="success" | ||
data-test-subj="prebuilt-rules-new-callout" | ||
iconType={'iInCircle'} | ||
title={NEW_PREBUILT_RULES_AVAILABLE_CALLOUT_TITLE} | ||
/> | ||
)} | ||
</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