[Security Solution] Add "Rule Preview" title before the rule preview section (#138286)

* [Security Solution] Add "Rule Preview" title before the rule preview section (#138165)

* Review feedback: naming according to guidelines
This commit is contained in:
Ievgen Sorokopud 2022-08-10 12:12:34 +02:00 committed by GitHub
parent ab5a726f85
commit a0cb2608fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 30 deletions

View file

@ -236,7 +236,6 @@ const RulePreviewComponent: React.FC<RulePreviewProps> = ({
return (
<>
<EuiSpacer />
<EuiButtonGroup
legend="Quick query or advanced query preview selector"
data-test-subj="quickAdvancedToggleButtonGroup"
@ -245,7 +244,7 @@ const RulePreviewComponent: React.FC<RulePreviewProps> = ({
options={quickAdvancedToggleButtonOptions}
color="primary"
/>
<EuiSpacer />
<EuiSpacer size="s" />
{showAdvancedOptions && showInvocationCountWarning && (
<>
<EuiCallOut

View file

@ -830,34 +830,36 @@ const StepDefineRuleComponent: FC<StepDefineRuleProps> = ({
}}
/>
</Form>
<EuiSpacer size="s" />
<RulePreview
index={index}
dataViewId={formDataViewId}
isDisabled={getIsRulePreviewDisabled({
ruleType,
isQueryBarValid,
isThreatQueryBarValid,
index,
dataViewId: formDataViewId,
threatIndex,
threatMapping: formThreatMapping,
machineLearningJobId,
queryBar: formQuery ?? initialState.queryBar,
newTermsFields: formNewTermsFields,
})}
query={formQuery}
ruleType={ruleType}
threatIndex={threatIndex}
threatQuery={formThreatQuery}
threatMapping={formThreatMapping}
threshold={formThreshold}
machineLearningJobId={machineLearningJobId}
anomalyThreshold={anomalyThreshold}
eqlOptions={optionsSelected}
newTermsFields={newTermsFields}
historyWindowSize={historyWindowSize}
/>
<EuiSpacer size="m" />
<RuleTypeEuiFormRow label={i18n.RULE_PREVIEW_TITLE} $isVisible={true} fullWidth>
<RulePreview
index={index}
dataViewId={formDataViewId}
isDisabled={getIsRulePreviewDisabled({
ruleType,
isQueryBarValid,
isThreatQueryBarValid,
index,
dataViewId: formDataViewId,
threatIndex,
threatMapping: formThreatMapping,
machineLearningJobId,
queryBar: formQuery ?? initialState.queryBar,
newTermsFields: formNewTermsFields,
})}
query={formQuery}
ruleType={ruleType}
threatIndex={threatIndex}
threatQuery={formThreatQuery}
threatMapping={formThreatMapping}
threshold={formThreshold}
machineLearningJobId={machineLearningJobId}
anomalyThreshold={anomalyThreshold}
eqlOptions={optionsSelected}
newTermsFields={newTermsFields}
historyWindowSize={historyWindowSize}
/>
</RuleTypeEuiFormRow>
</StepContentWrapper>
{!isUpdateView && (

View file

@ -98,3 +98,10 @@ export const SOURCE = i18n.translate(
defaultMessage: 'Source',
}
);
export const RULE_PREVIEW_TITLE = i18n.translate(
'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.rulePreviewTitle',
{
defaultMessage: 'Rule Preview',
}
);