Skip to content

Commit

Permalink
Remove 'Create Rule' button from Rule Group page (elastic#164167)
Browse files Browse the repository at this point in the history
issue: elastic#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

(cherry picked from commit 9aafd1f)
  • Loading branch information
machadoum committed Aug 23, 2023
1 parent 1ea271f commit e37b34b
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions x-pack/plugins/security_solution/public/rules/landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 = () => (
<EuiFlexGroup gutterSize="none" direction="row">
<EuiFlexItem>
<Title title={RULES_PAGE_TITLE} />
</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();
Expand All @@ -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}
Expand Down

0 comments on commit e37b34b

Please sign in to comment.