[Security Solution][Alerts] Remove new terms rule type tour (#141293)

* Remove new terms rule type tour

* Remove unused storage constant
This commit is contained in:
Marshall Main 2022-09-26 18:48:42 -07:00 committed by GitHub
parent 3598af151e
commit bded4672f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 100 deletions

View file

@ -450,9 +450,6 @@ export const NEW_FEATURES_TOUR_STORAGE_KEYS = {
RULE_MANAGEMENT_PAGE: 'securitySolution.rulesManagementPage.newFeaturesTour.v8.4',
};
export const RULES_MANAGEMENT_FEATURE_TOUR_STORAGE_KEY =
'securitySolution.rulesManagementPage.newFeaturesTour.v8.4';
export const RULE_DETAILS_EXECUTION_LOG_TABLE_SHOW_METRIC_COLUMNS_STORAGE_KEY =
'securitySolution.ruleDetails.ruleExecutionLog.showMetrics.v8.2';

View file

@ -42,7 +42,6 @@ import { useInvalidateRules } from '../../../containers/detection_engine/rules/u
import { useBoolState } from '../../../../common/hooks/use_bool_state';
import { RULES_TABLE_ACTIONS } from '../../../../common/lib/apm/user_actions';
import { useStartTransaction } from '../../../../common/lib/apm/use_start_transaction';
import { RulesPageTourComponent } from './tour';
const RulesPageComponent: React.FC = () => {
const [isImportModalVisible, showImportModal, hideImportModal] = useBoolState();
@ -231,19 +230,17 @@ const RulesPageComponent: React.FC = () => {
{i18n.IMPORT_RULE}
</EuiButton>
</EuiFlexItem>
<RulesPageTourComponent>
<EuiFlexItem grow={false}>
<SecuritySolutionLinkButton
data-test-subj="create-new-rule"
fill
iconType="plusInCircle"
isDisabled={!userHasPermissions(canUserCRUD) || loading}
deepLinkId={SecurityPageName.rulesCreate}
>
{i18n.ADD_NEW_RULE}
</SecuritySolutionLinkButton>
</EuiFlexItem>
</RulesPageTourComponent>
<EuiFlexItem grow={false}>
<SecuritySolutionLinkButton
data-test-subj="create-new-rule"
fill
iconType="plusInCircle"
isDisabled={!userHasPermissions(canUserCRUD) || loading}
deepLinkId={SecurityPageName.rulesCreate}
>
{i18n.ADD_NEW_RULE}
</SecuritySolutionLinkButton>
</EuiFlexItem>
</EuiFlexGroup>
</HeaderPage>
{(prePackagedRuleStatus === 'ruleNeedUpdate' ||

View file

@ -1,69 +0,0 @@
/*
* 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 { EuiText, EuiTourStep } from '@elastic/eui';
import React, { useCallback, useEffect, useState } from 'react';
import { RULES_MANAGEMENT_FEATURE_TOUR_STORAGE_KEY } from '../../../../../common/constants';
import { useKibana } from '../../../../common/lib/kibana';
import * as i18n from './translations';
export interface Props {
children: React.ReactElement;
}
export const RulesPageTourComponent: React.FC<Props> = ({ children }) => {
const tourConfig = {
currentTourStep: 1,
isTourActive: true,
tourPopoverWidth: 300,
};
const { storage } = useKibana().services;
const [tourState, setTourState] = useState(() => {
const restoredTourState = storage.get(RULES_MANAGEMENT_FEATURE_TOUR_STORAGE_KEY);
if (restoredTourState != null) {
return restoredTourState;
}
return tourConfig;
});
const demoTourSteps = [
{
step: 1,
title: i18n.NEW_TERMS_TOUR_TITLE,
content: <EuiText>{i18n.NEW_TERMS_TOUR_CONTENT}</EuiText>,
},
];
const finishTour = useCallback(() => {
setTourState({
...tourState,
isTourActive: false,
});
}, [tourState]);
useEffect(() => {
storage.set(RULES_MANAGEMENT_FEATURE_TOUR_STORAGE_KEY, tourState);
}, [tourState, storage]);
return (
<EuiTourStep
content={demoTourSteps[0].content}
isStepOpen={tourState.currentTourStep === 1 && tourState.isTourActive}
minWidth={tourState.tourPopoverWidth}
onFinish={finishTour}
step={1}
stepsTotal={demoTourSteps.length}
subtitle={tourState.tourSubtitle}
title={demoTourSteps[0].title}
anchorPosition="rightUp"
>
{children}
</EuiTourStep>
);
};

View file

@ -1084,20 +1084,6 @@ export const RULES_BULK_EDIT_FAILURE_DESCRIPTION = (rulesCount: number) =>
}
);
export const NEW_TERMS_TOUR_TITLE = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.tour.newTermsTitle',
{
defaultMessage: 'A new Security Rule type is available!',
}
);
export const NEW_TERMS_TOUR_CONTENT = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.tour.newTermsContent',
{
defaultMessage: '"New Terms" rules alert on values that have not previously been seen',
}
);
export const RULE_PREVIEW_TITLE = i18n.translate(
'xpack.securitySolution.detectionEngine.createRule.rulePreviewTitle',
{