Skip to content

Commit

Permalink
[8.10] Remove 'Create Rule' button from Rule Group page (#164167) (#1…
Browse files Browse the repository at this point in the history
…64535)

# Backport

This will backport the following commits from `main` to `8.10`:
- [Remove 'Create Rule' button from Rule Group page
(#164167)](#164167)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Pablo
Machado","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-23T08:20:32Z","message":"Remove
'Create Rule' button from Rule Group page (#164167)\n\nissue:
https://github.com/elastic/kibana/issues/163462\r\n\r\n##
Summary\r\n\r\nChange of plan. We are going to delete the
button.\r\n\r\n~Disable the 'Create Rule' button on the Rule Group page
and add the\r\nread icon to the topbar when the user is on read
mode.~\r\nDelete 'Create Rule' button on the Rule Group page\r\n\r\n###
How to reproduce it\r\n* ~Create a role with read access to the security
solution feature~\r\n* ~Login with a user that has the created
role~\r\n* Open the rule group page\r\n\r\n### Checklist\r\n\r\nDelete
any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"9aafd1ff834c4609317846ed8643faf47a6fb6de","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat
Hunting","Team: SecuritySolution","Team:Threat
Hunting:Explore","v8.10.0","v8.11.0"],"number":164167,"url":"https://github.com/elastic/kibana/pull/164167","mergeCommit":{"message":"Remove
'Create Rule' button from Rule Group page (#164167)\n\nissue:
https://github.com/elastic/kibana/issues/163462\r\n\r\n##
Summary\r\n\r\nChange of plan. We are going to delete the
button.\r\n\r\n~Disable the 'Create Rule' button on the Rule Group page
and add the\r\nread icon to the topbar when the user is on read
mode.~\r\nDelete 'Create Rule' button on the Rule Group page\r\n\r\n###
How to reproduce it\r\n* ~Create a role with read access to the security
solution feature~\r\n* ~Login with a user that has the created
role~\r\n* Open the rule group page\r\n\r\n### Checklist\r\n\r\nDelete
any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"9aafd1ff834c4609317846ed8643faf47a6fb6de"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164167","number":164167,"mergeCommit":{"message":"Remove
'Create Rule' button from Rule Group page (#164167)\n\nissue:
https://github.com/elastic/kibana/issues/163462\r\n\r\n##
Summary\r\n\r\nChange of plan. We are going to delete the
button.\r\n\r\n~Disable the 'Create Rule' button on the Rule Group page
and add the\r\nread icon to the topbar when the user is on read
mode.~\r\nDelete 'Create Rule' button on the Rule Group page\r\n\r\n###
How to reproduce it\r\n* ~Create a role with read access to the security
solution feature~\r\n* ~Login with a user that has the created
role~\r\n* Open the rule group page\r\n\r\n### Checklist\r\n\r\nDelete
any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"9aafd1ff834c4609317846ed8643faf47a6fb6de"}}]}]
BACKPORT-->

Co-authored-by: Pablo Machado <[email protected]>
  • Loading branch information
kibanamachine and machadoum authored Aug 23, 2023
1 parent 2228c0c commit 7b1731d
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 7b1731d

Please sign in to comment.