From 9aafd1ff834c4609317846ed8643faf47a6fb6de Mon Sep 17 00:00:00 2001 From: Pablo Machado Date: Wed, 23 Aug 2023 10:20:32 +0200 Subject: [PATCH] Remove 'Create Rule' button from Rule Group page (#164167) issue: https://github.com/elastic/kibana/issues/163462 ## Summary Change of plan. We are going to delete the button. ~Disable the 'Create Rule' button on the Rule Group page and add the read icon to the topbar when the user is on read mode.~ Delete 'Create Rule' button on the Rule Group page ### How to reproduce it * ~Create a role with read access to the security solution feature~ * ~Login with a user that has the created role~ * Open the rule group page ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --- .../public/rules/landing.tsx | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/x-pack/plugins/security_solution/public/rules/landing.tsx b/x-pack/plugins/security_solution/public/rules/landing.tsx index aaf28d48d0bd7..e934c917a9d30 100644 --- a/x-pack/plugins/security_solution/public/rules/landing.tsx +++ b/x-pack/plugins/security_solution/public/rules/landing.tsx @@ -7,14 +7,13 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; -import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; +import { EuiSpacer } from '@elastic/eui'; import { LandingLinksIconsCategories } from '@kbn/security-solution-navigation/landing_links'; import { SecurityPageName } from '../../common'; import { PluginTemplateWrapper } from '../common/components/plugin_template_wrapper'; import { SecuritySolutionPageWrapper } from '../common/components/page_wrapper'; import { SpyRoute } from '../common/utils/route/spy_routes'; import { Title } from '../common/components/header_page/title'; -import { SecuritySolutionLinkButton } from '../common/components/links'; import { useRootNavLink } from '../common/links/nav_links'; import { useGlobalQueryString } from '../common/utils/global_query_string'; import { trackLandingLinkClick } from '../common/lib/telemetry/trackers'; @@ -23,23 +22,6 @@ const RULES_PAGE_TITLE = i18n.translate('xpack.securitySolution.rules.landing.pa defaultMessage: 'Rules', }); -const CREATE_RULE_BUTTON = i18n.translate('xpack.securitySolution.rules.landing.createRule', { - defaultMessage: 'Create rule', -}); - -const RulesLandingHeader: React.FC = () => ( - - - - </EuiFlexItem> - <EuiFlexItem grow={false}> - <SecuritySolutionLinkButton deepLinkId={SecurityPageName.rulesCreate} iconType="plusInCircle"> - {CREATE_RULE_BUTTON} - </SecuritySolutionLinkButton> - </EuiFlexItem> - </EuiFlexGroup> -); - export const RulesLandingPage = () => { const { links = [], categories = [] } = useRootNavLink(SecurityPageName.rulesLanding) ?? {}; const urlState = useGlobalQueryString(); @@ -48,7 +30,7 @@ export const RulesLandingPage = () => { <PluginTemplateWrapper> <TrackApplicationView viewId={SecurityPageName.rulesLanding}> <SecuritySolutionPageWrapper> - <RulesLandingHeader /> + <Title title={RULES_PAGE_TITLE} /> <EuiSpacer size="xl" /> <LandingLinksIconsCategories links={links}