Skip to content

Commit

Permalink
[SIEM][Detection Engine] Adds release notes link and updates one UI s…
Browse files Browse the repository at this point in the history
…ection (#62145)

## Summary

Based on feed back from two users within our community slack channel of SIEM we are adding a release notes link to the product for when rules are updated.

Also, because new rules can show up we are changing the words of the "Reload X deleted Elastic prebuilt rule" to "Install X Elastic prebuilt rule" as it is misleading to imply the user has deleted rules when really they have either deleted rules or new rules are available to be installed.

The screen shot with the link of "release notes". Previously the link of "release notes" did not exist:

This new link right now goes to:
https://www.elastic.co/guide/en/siem/guide/master/prebuilt-rules.html

where in the link `master` is replaced with the version of the product that is deployed. I think we want to replace that link with a new one which will have release notes of rules for each new version of the rules.   

<img width="688" alt="Screen Shot 2020-03-20 at 2 29 47 PM" src="https://user-images.githubusercontent.com/1151048/77207801-ef0b1480-6abf-11ea-8ad7-771b0f3334d6.png">

Screen shot of the new text for Install Elastic Rules:
<img width="679" alt="Screen Shot 2020-03-20 at 3 20 44 PM" src="https://user-images.githubusercontent.com/1151048/77207875-1b269580-6ac0-11ea-908d-6ec1694df62f.png">

Screen shot of the existing Reload Elastic Rules the above screen shot is replacing:
<img width="817" alt="Screen Shot 2020-03-20 at 2 36 52 PM" src="https://user-images.githubusercontent.com/1151048/77207833-03e7a800-6ac0-11ea-92f8-7bb065775122.png">

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)
- [x] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials
  • Loading branch information
FrankHassanabad authored Apr 1, 2020
1 parent 620f304 commit d78bfba
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('Deleting prebuilt rules', () => {
cy.get(RELOAD_PREBUILT_RULES_BTN).should('exist');
cy.get(RELOAD_PREBUILT_RULES_BTN)
.invoke('text')
.should('eql', 'Reload 1 deleted Elastic prebuilt rule ');
.should('eql', 'Install 1 Elastic prebuilt rule ');

reloadDeletedRules();

Expand Down Expand Up @@ -146,7 +146,7 @@ describe('Deleting prebuilt rules', () => {
cy.get(RELOAD_PREBUILT_RULES_BTN).should('exist');
cy.get(RELOAD_PREBUILT_RULES_BTN)
.invoke('text')
.should('eql', `Reload ${numberOfRulesToBeSelected} deleted Elastic prebuilt rules `);
.should('eql', `Install ${numberOfRulesToBeSelected} Elastic prebuilt rules `);
cy.get(ELASTIC_RULES_BTN)
.invoke('text')
.should('eql', `Elastic rules (${expectedNumberOfRulesAfterDeletion})`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,10 @@ export const UPDATE_PREPACKAGED_RULES = (updateRules: number) =>
defaultMessage:
'Update {updateRules} Elastic prebuilt {updateRules, plural, =1 {rule} other {rules}} ',
});

export const RELEASE_NOTES_HELP = i18n.translate(
'xpack.siem.detectionEngine.rules.releaseNotesHelp',
{
defaultMessage: 'Release notes',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

import React, { memo } from 'react';

import { EuiCallOut, EuiButton } from '@elastic/eui';
import { EuiCallOut, EuiButton, EuiLink } from '@elastic/eui';

import { useKibana } from '../../../../../lib/kibana';
import * as i18n from './translations';

interface UpdatePrePackagedRulesCallOutProps {
Expand All @@ -19,13 +21,25 @@ const UpdatePrePackagedRulesCallOutComponent: React.FC<UpdatePrePackagedRulesCal
loading,
numberOfUpdatedRules,
updateRules,
}) => (
<EuiCallOut title={i18n.UPDATE_PREPACKAGED_RULES_TITLE}>
<p>{i18n.UPDATE_PREPACKAGED_RULES_MSG(numberOfUpdatedRules)}</p>
<EuiButton onClick={updateRules} size="s" isLoading={loading}>
{i18n.UPDATE_PREPACKAGED_RULES(numberOfUpdatedRules)}
</EuiButton>
</EuiCallOut>
);
}) => {
const { services } = useKibana();
return (
<EuiCallOut title={i18n.UPDATE_PREPACKAGED_RULES_TITLE}>
<p>
{i18n.UPDATE_PREPACKAGED_RULES_MSG(numberOfUpdatedRules)}
<br />
<EuiLink
href={`${services.docLinks.ELASTIC_WEBSITE_URL}guide/en/siem/guide/${services.docLinks.DOC_LINK_VERSION}/prebuilt-rules-changelog.html`}
target="_blank"
>
{i18n.RELEASE_NOTES_HELP}
</EuiLink>
</p>
<EuiButton onClick={updateRules} size="s" isLoading={loading}>
{i18n.UPDATE_PREPACKAGED_RULES(numberOfUpdatedRules)}
</EuiButton>
</EuiCallOut>
);
};

export const UpdatePrePackagedRulesCallOut = memo(UpdatePrePackagedRulesCallOutComponent);
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export const RELOAD_MISSING_PREPACKAGED_RULES = (missingRules: number) =>
i18n.translate('xpack.siem.detectionEngine.rules.reloadMissingPrePackagedRulesButton', {
values: { missingRules },
defaultMessage:
'Reload {missingRules} deleted Elastic prebuilt {missingRules, plural, =1 {rule} other {rules}} ',
'Install {missingRules} Elastic prebuilt {missingRules, plural, =1 {rule} other {rules}} ',
});

export const IMPORT_RULE_BTN_TITLE = i18n.translate(
Expand Down

0 comments on commit d78bfba

Please sign in to comment.