Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Update prebuilt rule customization UI copy #210817

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34948,8 +34948,6 @@
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.guideLabel": "Guide d'investigation",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.maxAlertsFieldLessThanWarning": "Kibana ne permet qu'un maximum de {maxNumber} {maxNumber, plural, =1 {alerte} other {alertes}} par exécution de règle.",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.nameFieldRequiredError": "Nom obligatoire.",
"xpack.securitySolution.detectionEngine.createRule.stepAboutrule.noteHelpText": "Ajouter un guide d'investigation sur les règles...",
"xpack.securitySolution.detectionEngine.createRule.stepAboutrule.setupHelpText": "Ajouter le guide de configuration de règle...",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupHelpText": "Fournissez des instructions sur les conditions préalables à la règle, telles que les intégrations requises, les étapes de configuration et tout ce qui est nécessaire au bon fonctionnement de la règle.",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupLabel": "Guide de configuration",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.tagFieldEmptyError": "Une balise ne doit pas être vide",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34809,8 +34809,6 @@
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.guideLabel": "調査ガイド",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.maxAlertsFieldLessThanWarning": "Kibanaで許可される最大数は、1回の実行につき、{maxNumber} {maxNumber, plural, other {アラート}}です。",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.nameFieldRequiredError": "名前が必要です。",
"xpack.securitySolution.detectionEngine.createRule.stepAboutrule.noteHelpText": "ルール調査ガイドを追加...",
"xpack.securitySolution.detectionEngine.createRule.stepAboutrule.setupHelpText": "ルールセットアップガイドを追加...",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupHelpText": "必要な統合、構成ステップ、ルールが正常に動作するために必要な他のすべての項目といった、ルール前提条件に関する指示を入力します。",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupLabel": "セットアップガイド",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.tagFieldEmptyError": "タグを空にすることはできません",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34279,8 +34279,6 @@
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.guideLabel": "调查指南",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.maxAlertsFieldLessThanWarning": "每次规则运行时,Kibana 最多只允许 {maxNumber} 个{maxNumber, plural, other {告警}}。",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.nameFieldRequiredError": "名称必填。",
"xpack.securitySolution.detectionEngine.createRule.stepAboutrule.noteHelpText": "添加规则调查指南......",
"xpack.securitySolution.detectionEngine.createRule.stepAboutrule.setupHelpText": "添加规则设置指南......",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupHelpText": "提供有关规则先决条件的说明,如所需集成、配置步骤,以及规则正常运行所需的任何其他内容。",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupLabel": "设置指南",
"xpack.securitySolution.detectionEngine.createRule.stepAboutRule.tagFieldEmptyError": "标签不得为空",
Expand Down
21 changes: 19 additions & 2 deletions x-pack/solutions/security/packages/upselling/messages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,27 @@ export const UPGRADE_NOTES_MANAGEMENT_USER_FILTER = (requiredLicense: string) =>
},
});

export const UPGRADE_PREBUILT_RULE_CUSTOMIZATION = (requiredLicense: string) =>
export const PREBUILT_RULE_CUSTOMIZATION = (requiredLicense: string, licenseKind: string) =>
i18n.translate('securitySolutionPackages.ruleManagement.prebuiltRuleCustomization.upsell', {
defaultMessage: 'Upgrade to {requiredLicense} to enable prebuilt rule customization',
defaultMessage: '{requiredLicense} {licenseKind} is required to customize prebuilt rules',
values: {
requiredLicense,
licenseKind,
},
});

export const PREBUILT_RULE_CUSTOMIZATION_DESCRIPTION = (
requiredLicense: string,
licenseKind: string
) =>
i18n.translate(
'securitySolutionPackages.ruleManagement.prebuiltRuleCustomization.descriptionUpsell',
{
defaultMessage:
"Without the {requiredLicense} {licenseKind}, prebuilt rules can't be customized. To access this feature, upgrade your {licenseKind} or contact your admin for assistance.",
values: {
requiredLicense,
licenseKind,
},
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ export type UpsellingMessageId =
| 'alert_suppression_rule_form'
| 'alert_suppression_rule_details'
| 'note_management_user_filter'
| 'prebuilt_rule_customization';
| 'prebuilt_rule_customization'
| 'prebuilt_rule_customization_description';
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ interface MarkdownEditorProps {
autoFocusDisabled?: boolean;
setIsMarkdownInvalid: (value: boolean) => void;
includePlugins?: boolean;
placeholder?: string;
}

type EuiMarkdownEditorRef = ElementRef<typeof EuiMarkdownEditor>;
Expand All @@ -56,6 +57,7 @@ const MarkdownEditorComponent = forwardRef<MarkdownEditorRef, MarkdownEditorProp
autoFocusDisabled,
setIsMarkdownInvalid,
includePlugins = true,
placeholder,
},
ref
) => {
Expand Down Expand Up @@ -118,6 +120,7 @@ const MarkdownEditorComponent = forwardRef<MarkdownEditorRef, MarkdownEditorProp
errors={markdownErrorMessages}
data-test-subj={dataTestSubj}
height={height}
placeholder={placeholder}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type MarkdownEditorFormProps = EuiMarkdownEditorProps & {

export const MarkdownEditorForm = React.memo(
forwardRef<MarkdownEditorRef, MarkdownEditorFormProps>(
({ field, dataTestSubj, idAria, includePlugins }, ref) => {
({ field, dataTestSubj, idAria, includePlugins, placeholder }, ref) => {
const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field);
const [isMarkdownInvalid, setIsMarkdownInvalid] = useState(false);

Expand All @@ -48,6 +48,7 @@ export const MarkdownEditorForm = React.memo(
data-test-subj={`${dataTestSubj}-markdown-editor`}
setIsMarkdownInvalid={setIsMarkdownInvalid}
includePlugins={includePlugins}
placeholder={placeholder}
/>
</EuiFormRow>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ const StepAboutRuleComponent: FC<StepAboutRuleProps> = ({
<EuiSpacer size="l" />
<EuiToolTip
content={
ruleSource?.type === 'external'
? I18n.AUTHOR_IMMUTABLE_FIELD_TOOLTIP_TEXT
: undefined
ruleSource?.type === 'external' ? I18n.FIELD_NOT_EDITABLE_TOOLTIP_TEXT : undefined
}
display="block"
position="right"
Expand All @@ -306,9 +304,7 @@ const StepAboutRuleComponent: FC<StepAboutRuleProps> = ({
<EuiSpacer size="l" />
<EuiToolTip
content={
ruleSource?.type === 'external'
? I18n.LICENSE_IMMUTABLE_FIELD_TOOLTIP_TEXT
: undefined
ruleSource?.type === 'external' ? I18n.FIELD_NOT_EDITABLE_TOOLTIP_TEXT : undefined
}
display="block"
position="right"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,22 @@ export const URL_FORMAT_INVALID = i18n.translate(
);

export const ADD_RULE_NOTE_HELP_TEXT = i18n.translate(
'xpack.securitySolution.detectionEngine.createRule.stepAboutrule.noteHelpText',
'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.noteHelpText',
{
defaultMessage: 'Add rule investigation guide...',
}
);

export const ADD_RULE_SETUP_HELP_TEXT = i18n.translate(
'xpack.securitySolution.detectionEngine.createRule.stepAboutrule.setupHelpText',
'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.addRuleSetupHelpText',
{
defaultMessage: 'Add rule setup guide...',
}
);

export const AUTHOR_IMMUTABLE_FIELD_TOOLTIP_TEXT = i18n.translate(
'xpack.securitySolution.detectionEngine.createRule.stepAboutrule.authorImmutableFieldTooltipText',
export const FIELD_NOT_EDITABLE_TOOLTIP_TEXT = i18n.translate(
'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldNotEditableTooltipText',
{
defaultMessage: 'Author is not editable for Elastic rules',
}
);

export const LICENSE_IMMUTABLE_FIELD_TOOLTIP_TEXT = i18n.translate(
'xpack.securitySolution.detectionEngine.createRule.stepAboutrule.licenseImmutableFieldTooltipText',
{
defaultMessage: 'License is not editable for Elastic rules',
defaultMessage: 'This field is not editable',
Copy link
Contributor

@rylnd rylnd Feb 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to indicate why the field(s) aren't editable, as the copy did previously? I don't see any EUI recommendation recommendation explicitly for reasoning, but it feels like more context here might be helpful to the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nastasha's idea was to make these messages more generic and more reusable. But now as you brought this up, I think it might be a good idea to be just a bit more specific, like: "This field is not editable for Elastic rules". Or maybe we can even pass in the name as a parameter to avoid having multiple translation strings.

wdyt, @nastasha-solomon?

Copy link
Contributor

@nastasha-solomon nastasha-solomon Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, just getting to this now. That's a valid point, @rylnd. Changing the language to what @nikitaindik suggested should remove the ambiguity.

@nikitaindik either of your suggestions work. I'd just make some minor adjustments:

  • This field can't be edited for Elastic rules.
  • <field name> can't be edited for Elastic rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for you suggestions, folks! Pushed an update.

Scherm­afbeelding 2025-02-19 om 12 39 16 Scherm­afbeelding 2025-02-19 om 12 39 21

}
);
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => {
usePrebuiltRulesCustomizationStatus();
const canEditRule = isRulesCustomizationEnabled || !rule.immutable;

const prebuiltCustomizationUpsellingMessage = usePrebuiltRuleCustomizationUpsellingMessage();
const prebuiltCustomizationUpsellingMessage = usePrebuiltRuleCustomizationUpsellingMessage(
'prebuilt_rule_customization_description'
);

const { detailName: ruleId } = useParams<{ detailName: string }>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';
import useToggle from 'react-use/lib/useToggle';
import { EuiPopover, EuiText, EuiButtonIcon } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { TITLE } from './translations';
import * as i18n from './translations';
import type { VersionsPickerOptionEnum } from './versions_picker/versions_picker';
import { useFieldUpgradeContext } from '../rule_upgrade/field_upgrade_context';
import { getOptionDetails } from './utils';
Expand Down Expand Up @@ -48,25 +48,20 @@ export function ComparisonSideHelpInfo({ options }: ComparisonSideHelpInfoProps)
<EuiText style={{ width: POPOVER_WIDTH }} size="s">
<FormattedMessage
id="xpack.securitySolution.detectionEngine.rules.upgradeRules.comparisonSide.upgradeHelpText"
defaultMessage="The {title} lets you compare the values of a field across different versions of a rule: {versions} Differences are shown as JSON, with red lines showing what was removed, green lines showing additions, and bold text highlighting changes. Use {title} to review and understand changes across versions."
defaultMessage="The {title} lets you compare the values of a field across different versions of a rule:"
values={{
title: <strong>{TITLE}</strong>,
versions: (
<>
<br />
<ul>
{optionsWithDescriptions.map(
({ title: displayName, description: explanation }) => (
<li key={displayName}>
<strong>{displayName}</strong> {'-'} {explanation}
</li>
)
)}
</ul>
</>
),
title: <strong>{i18n.TITLE}</strong>,
}}
/>
<ul>
{optionsWithDescriptions.map(({ title: displayName, description: explanation }) => (
<li key={displayName}>
<strong>{displayName}</strong>
{':'} {explanation}
</li>
))}
</ul>
<p>{i18n.DIFF_FORMAT_AND_COLORS_EXPLANATION}</p>
</EuiText>
</EuiPopover>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,40 @@ export const NO_CHANGES = i18n.translate(
export const UPDATE_FROM_ELASTIC_TITLE = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.updateFromElasticTitle',
{
defaultMessage: 'Update from Elastic',
defaultMessage: 'Changes from Elastic',
}
);

export const UPDATE_FROM_ELASTIC_EXPLANATION = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.updateFromElasticExplanation',
{
defaultMessage: 'view the changes in Elastic’s latest update',
defaultMessage:
"Compare the field's original value with changes from the Elastic update. Your changes aren't displayed.",
}
);

export const MY_CHANGES_TITLE = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.myChangesTitle',
export const MY_CHANGES_AND_FINAL_UPDATES_TITLE = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.myChangesAndFinalUpdatesTitle',
{
defaultMessage: 'My changes',
defaultMessage: 'My changes and final updates',
}
);

export const MY_CHANGES_EXPLANATION = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.myChangesExplanation',
export const MY_CHANGES_AND_FINAL_UPDATES_TITLE_EXPLANATION = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.myChangesAndFinalUpdatesExplanation',
{
defaultMessage: `view what you have changed in your installed rule and in the {finalUpdateSectionLabel} section`,
defaultMessage:
"Compare the field's original value with your changes or changes made in the {finalUpdateSectionLabel} section.",
values: {
finalUpdateSectionLabel: FINAL_UPDATE,
},
}
);

export const MY_CHANGES_IN_RULE_UPGRADE_WORKFLOW_EXPLANATION = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.myChangesFinalUpdateOnlyExplanation',
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.myChangesInRuleUpdateWorkflowOnlyExplanation',
{
defaultMessage: `view the changes you made in the {finalUpdateSectionLabel} section`,
defaultMessage: 'View the changes you made in the {finalUpdateSectionLabel} section',
values: {
finalUpdateSectionLabel: FINAL_UPDATE,
},
Expand All @@ -66,30 +68,40 @@ export const MY_CHANGES_IN_RULE_UPGRADE_WORKFLOW_EXPLANATION = i18n.translate(
export const MERGED_CHANGES_TITLE = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.mergedChangesTitle',
{
defaultMessage: 'My changes merged with Elastic’s',
defaultMessage: "My changes merged with Elastic's",
}
);

export const MERGED_CHANGES_EXPLANATION = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.mergedChangesExplanation',
{
defaultMessage: 'view an update suggestion that combines your changes with Elastic’s',
defaultMessage:
"Compare the field's original value with a version that combines your changes with those in the Elastic update. This version is only a suggestion.",
}
);

export const MY_ORIGINAL_CHANGES_TITLE = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.myOriginalChangesTitle',
{
defaultMessage: 'My original changes',
defaultMessage: 'My changes only',
}
);

export const MY_ORIGINAL_CHANGES_EXPLANATION = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.myCustomizationExplanation',
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.myOriginalChangesExplanation',
{
defaultMessage: `view what you have changed in your installed rule. Doesn’t include changes made in the {finalUpdateSectionLabel} section.`,
defaultMessage:
"Compare the field's original value with your changes. Modifications in the {finalUpdateSectionLabel} section aren't displayed.",
values: {
finalUpdateSectionLabel: FINAL_UPDATE,
},
}
);

export const DIFF_FORMAT_AND_COLORS_EXPLANATION = i18n.translate(
'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.diffFormatAndColorsExplanation',
{
defaultMessage:
"Differences are shown in JSON and color-coded or bolded. Lines that are highlighted in green were added. Lines that are highlighted in red were removed. Text that's bolded was changed.",
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ export function getOptionDetails(
case VersionsPickerOptionEnum.MyChanges:
return hasResolvedValueDifferentFromSuggested
? {
title: i18n.MY_CHANGES_TITLE,
title: i18n.MY_CHANGES_AND_FINAL_UPDATES_TITLE,
description: i18n.MY_CHANGES_IN_RULE_UPGRADE_WORKFLOW_EXPLANATION,
}
: {
title: i18n.MY_CHANGES_TITLE,
description: i18n.MY_CHANGES_EXPLANATION,
title: i18n.MY_CHANGES_AND_FINAL_UPDATES_TITLE,
description: i18n.MY_CHANGES_AND_FINAL_UPDATES_TITLE_EXPLANATION,
};
case VersionsPickerOptionEnum.MyOriginalChanges:
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';
import useToggle from 'react-use/lib/useToggle';
import { EuiPopover, EuiText, EuiButtonIcon } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import * as i18n from '../../../../../../rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/translations';
import * as i18n from './translations';

/**
* Theme doesn't expose width variables. Using provided size variables will require
Expand All @@ -36,9 +36,9 @@ export function FieldFinalSideHelpInfo(): JSX.Element {
<EuiText style={{ width: POPOVER_WIDTH }} size="s">
<FormattedMessage
id="xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeHelpText"
defaultMessage="The Final Update section lets you preview and edit the final value of a field. This is the value the rule will have after you click {updateButtonLabel}."
defaultMessage="The {finalUpdateSectionLabel} section lets you preview and edit the final value of a field. This value is fully applied when you update the rule."
values={{
updateButtonLabel: <strong>{i18n.UPDATE_BUTTON_LABEL}</strong>,
finalUpdateSectionLabel: <strong>{i18n.FINAL_UPDATE}</strong>,
}}
/>
</EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function FieldUpgradeStateInfo({ state }: FieldUpgradeStateInfoProps): JS
switch (state) {
case FieldUpgradeStateEnum.NoUpdate:
return {
color: 'success',
color: 'default',
title: i18n.NO_UPDATE,
description: i18n.NO_UPDATE_DESCRIPTION,
};
Expand Down
Loading