Skip to content

Commit

Permalink
Update messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecote committed Oct 19, 2021
1 parent 8af8fa5 commit 9a85150
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ describe('health check', () => {
});

const [description] = queryAllByText(/API keys/i);
const [action] = queryAllByText(/how to enable API keys/i);
const [action] = queryAllByText(/Learn more/i);

expect(description.textContent).toMatchInlineSnapshot(`"You must enable API keys"`);

expect(action.textContent).toMatchInlineSnapshot(
`"Learn how to enable API keys.(opens in a new tab or window)"`
expect(description.textContent).toMatchInlineSnapshot(
`"You must enable API keys to use Alerting. Learn more.(opens in a new tab or window)"`
);

expect(action.textContent).toMatchInlineSnapshot(`"Learn more.(opens in a new tab or window)"`);

expect(action.getAttribute('href')).toMatchInlineSnapshot(
`"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-settings.html#api-key-service-settings"`
);
Expand Down Expand Up @@ -141,11 +141,13 @@ describe('health check', () => {

const description = queryByRole(/banner/i);
expect(description!.textContent).toMatchInlineSnapshot(
`"To create a rule, set a value for xpack.encryptedSavedObjects.encryptionKey in your kibana.yml file and ensure the Encrypted Saved Objects plugin is enabled. Learn how.(opens in a new tab or window)"`
`"You must configure an encryption key to use Alerting. Learn more.(opens in a new tab or window)"`
);

const action = queryByText(/Learn/i);
expect(action!.textContent).toMatchInlineSnapshot(`"Learn how.(opens in a new tab or window)"`);
expect(action!.textContent).toMatchInlineSnapshot(
`"Learn more.(opens in a new tab or window)"`
);
expect(action!.getAttribute('href')).toMatchInlineSnapshot(
`"https://www.elastic.co/guide/en/kibana/mocked-test-branch/alert-action-settings-kb.html#general-alert-action-settings"`
);
Expand Down Expand Up @@ -177,11 +179,13 @@ describe('health check', () => {
const description = queryByText(/You must enable/i);

expect(description!.textContent).toMatchInlineSnapshot(
`"You must enable API keys and configure an encryption key. Learn how.(opens in a new tab or window)"`
`"You must enable API keys and configure an encryption key to use Alerting. Learn more.(opens in a new tab or window)"`
);

const action = queryByText(/Learn/i);
expect(action!.textContent).toMatchInlineSnapshot(`"Learn how.(opens in a new tab or window)"`);
expect(action!.textContent).toMatchInlineSnapshot(
`"Learn more.(opens in a new tab or window)"`
);
expect(action!.getAttribute('href')).toMatchInlineSnapshot(
`"https://www.elastic.co/guide/en/kibana/mocked-test-branch/alerting-setup.html#alerting-prerequisites"`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const EncryptionError = ({ docLinks, className }: PromptErrorProps) => (
<h2>
<FormattedMessage
id="xpack.triggersActionsUI.components.healthCheck.encryptionErrorTitle"
defaultMessage="Encrypted saved objects are not available"
defaultMessage="Additional setup required"
/>
</h2>
}
Expand All @@ -118,22 +118,14 @@ const EncryptionError = ({ docLinks, className }: PromptErrorProps) => (
{i18n.translate(
'xpack.triggersActionsUI.components.healthCheck.encryptionErrorBeforeKey',
{
defaultMessage: 'To create a rule, set a value for ',
}
)}
<EuiCode>{'xpack.encryptedSavedObjects.encryptionKey'}</EuiCode>
{i18n.translate(
'xpack.triggersActionsUI.components.healthCheck.encryptionErrorAfterKey',
{
defaultMessage:
' in your kibana.yml file and ensure the Encrypted Saved Objects plugin is enabled. ',
defaultMessage: 'You must configure an encryption key to use Alerting. ',
}
)}
<EuiLink href={docLinks.links.alerting.generalSettings} external target="_blank">
{i18n.translate(
'xpack.triggersActionsUI.components.healthCheck.encryptionErrorAction',
{
defaultMessage: 'Learn how.',
defaultMessage: 'Learn more.',
}
)}
</EuiLink>
Expand All @@ -153,15 +145,15 @@ const ApiKeysDisabledError = ({ docLinks, className }: PromptErrorProps) => (
<h2>
<FormattedMessage
id="xpack.triggersActionsUI.components.healthCheck.apiKeysDisabledErrorTitle"
defaultMessage="You must enable API keys"
defaultMessage="Additional setup required"
/>
</h2>
}
body={
<div className={`${className}__body`}>
<p role="banner">
{i18n.translate('xpack.triggersActionsUI.components.healthCheck.apiKeysDisabledError', {
defaultMessage: 'Alerting relies on API keys. ',
defaultMessage: 'You must enable API keys to use Alerting. ',
})}
<EuiLink
href={docLinks.links.security.elasticsearchEnableApiKeys}
Expand All @@ -171,7 +163,7 @@ const ApiKeysDisabledError = ({ docLinks, className }: PromptErrorProps) => (
{i18n.translate(
'xpack.triggersActionsUI.components.healthCheck.apiKeysDisabledErrorAction',
{
defaultMessage: 'Learn how to enable API keys.',
defaultMessage: 'Learn more.',
}
)}
</EuiLink>
Expand Down Expand Up @@ -232,14 +224,15 @@ const ApiKeysAndEncryptionError = ({ docLinks, className }: PromptErrorProps) =>
{i18n.translate(
'xpack.triggersActionsUI.components.healthCheck.apiKeysAndEncryptionError',
{
defaultMessage: 'You must enable API keys and configure an encryption key. ',
defaultMessage:
'You must enable API keys and configure an encryption key to use Alerting. ',
}
)}
<EuiLink href={docLinks.links.alerting.setupPrerequisites} external target="_blank">
{i18n.translate(
'xpack.triggersActionsUI.components.healthCheck.apiKeysAndEncryptionErrorAction',
{
defaultMessage: 'Learn how.',
defaultMessage: 'Learn more.',
}
)}
</EuiLink>
Expand Down

0 comments on commit 9a85150

Please sign in to comment.