Skip to content

Commit d2afcac

Browse files
committed
Add links to docs to our read-only callouts
1 parent 05a789e commit d2afcac

10 files changed

Lines changed: 146 additions & 54 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import React from 'react';
8+
import { ExternalLink } from './external_link';
9+
10+
export const SecuritySolutionRequirementsLink = () => (
11+
<ExternalLink
12+
url="https://www.elastic.co/guide/en/security/current/sec-requirements.html"
13+
text="Elastic Security system requirements"
14+
/>
15+
);
16+
17+
export const DetectionsRequirementsLink = () => (
18+
<ExternalLink
19+
url="https://www.elastic.co/guide/en/security/current/detections-permissions-section.html"
20+
text="Detections prerequisites and requirements"
21+
/>
22+
);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import React, { FC } from 'react';
8+
import { EuiLink } from '@elastic/eui';
9+
10+
interface ExternalLinkProps {
11+
url: string;
12+
text: string;
13+
}
14+
15+
/**
16+
* A simplistic text link for opening external urls in a new browser tab.
17+
*/
18+
export const ExternalLink: FC<ExternalLinkProps> = ({ url, text }) => {
19+
return (
20+
<EuiLink href={url} external target="_blank" rel="noopener">
21+
{text}
22+
</EuiLink>
23+
);
24+
};

x-pack/plugins/security_solution/public/detections/components/callouts/read_only_alerts_callout/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const readOnlyAccessToAlertsMessage: CallOutMessage = {
1414
type: 'primary',
1515
id: 'read-only-access-to-alerts',
1616
title: i18n.READ_ONLY_ALERTS_CALLOUT_TITLE,
17-
description: <p>{i18n.READ_ONLY_ALERTS_CALLOUT_MSG}</p>,
17+
description: i18n.readOnlyAlertsCallOutBody(),
1818
};
1919

2020
const ReadOnlyAlertsCallOutComponent = () => {

x-pack/plugins/security_solution/public/detections/components/callouts/read_only_alerts_callout/translations.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import React from 'react';
8+
import { i18n } from '@kbn/i18n';
9+
import { FormattedMessage } from '@kbn/i18n/react';
10+
import {
11+
SecuritySolutionRequirementsLink,
12+
DetectionsRequirementsLink,
13+
} from '../documentation_links';
14+
15+
export const READ_ONLY_ALERTS_CALLOUT_TITLE = i18n.translate(
16+
'xpack.securitySolution.detectionEngine.readOnlyAlertsCallOut.messageTitle',
17+
{
18+
defaultMessage: 'You cannot change alert states',
19+
}
20+
);
21+
22+
export const readOnlyAlertsCallOutBody = () => (
23+
<FormattedMessage
24+
id="xpack.securitySolution.detectionEngine.readOnlyAlertsCallOut.messageBody.messageDetail"
25+
defaultMessage="{essence} Related documentation: {docs}"
26+
values={{
27+
essence: (
28+
<p>
29+
<FormattedMessage
30+
id="xpack.securitySolution.detectionEngine.readOnlyAlertsCallOut.messageBody.essenceDescription"
31+
defaultMessage="You only have permissions to view alerts. If you need to update alert states (open or close alerts), contact your Kibana administrator."
32+
/>
33+
</p>
34+
),
35+
docs: (
36+
<ul>
37+
<li>
38+
<DetectionsRequirementsLink />
39+
</li>
40+
<li>
41+
<SecuritySolutionRequirementsLink />
42+
</li>
43+
</ul>
44+
),
45+
}}
46+
/>
47+
);

x-pack/plugins/security_solution/public/detections/components/callouts/read_only_rules_callout/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const readOnlyAccessToRulesMessage: CallOutMessage = {
1414
type: 'primary',
1515
id: 'read-only-access-to-rules',
1616
title: i18n.READ_ONLY_RULES_CALLOUT_TITLE,
17-
description: <p>{i18n.READ_ONLY_RULES_CALLOUT_MSG}</p>,
17+
description: i18n.readOnlyRulesCallOutBody(),
1818
};
1919

2020
const ReadOnlyRulesCallOutComponent = () => {

x-pack/plugins/security_solution/public/detections/components/callouts/read_only_rules_callout/translations.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import React from 'react';
8+
import { i18n } from '@kbn/i18n';
9+
import { FormattedMessage } from '@kbn/i18n/react';
10+
import {
11+
SecuritySolutionRequirementsLink,
12+
DetectionsRequirementsLink,
13+
} from '../documentation_links';
14+
15+
export const READ_ONLY_RULES_CALLOUT_TITLE = i18n.translate(
16+
'xpack.securitySolution.detectionEngine.readOnlyRulesCallOut.messageTitle',
17+
{
18+
defaultMessage: 'Rule permissions required',
19+
}
20+
);
21+
22+
export const readOnlyRulesCallOutBody = () => (
23+
<FormattedMessage
24+
id="xpack.securitySolution.detectionEngine.readOnlyRulesCallOut.messageBody.messageDetail"
25+
defaultMessage="{essence} Related documentation: {docs}"
26+
values={{
27+
essence: (
28+
<p>
29+
<FormattedMessage
30+
id="xpack.securitySolution.detectionEngine.readOnlyRulesCallOut.messageBody.essenceDescription"
31+
defaultMessage="You are currently missing the required permissions to create/edit detection engine rule. Please contact your administrator for further assistance."
32+
/>
33+
</p>
34+
),
35+
docs: (
36+
<ul>
37+
<li>
38+
<DetectionsRequirementsLink />
39+
</li>
40+
<li>
41+
<SecuritySolutionRequirementsLink />
42+
</li>
43+
</ul>
44+
),
45+
}}
46+
/>
47+
);

x-pack/plugins/translations/translations/ja-JP.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16826,8 +16826,7 @@
1682616826
"xpack.securitySolution.detectionEngine.noApiIntegrationKeyCallOutMsg": "Kibanaを起動するごとに保存されたオブジェクトの新しい暗号化キーを作成します。永続キーがないと、Kibanaの再起動後にルールを削除または修正することができません。永続キーを設定するには、kibana.ymlファイルに32文字以上のテキスト値を付けてxpack.encryptedSavedObjects.encryptionKey設定を追加してください。",
1682716827
"xpack.securitySolution.detectionEngine.noApiIntegrationKeyCallOutTitle": "API統合キーが必要です",
1682816828
"xpack.securitySolution.detectionEngine.noIndexTitle": "検出エンジンを設定しましょう",
16829-
"xpack.securitySolution.detectionEngine.readOnlyAlertsCallOutMsg": "アラートを表示する権限のみが付与されています。アラート状態を更新(アラートを開く、アラートを閉じる)必要がある場合は、Kibana管理者に連絡してください。",
16830-
"xpack.securitySolution.detectionEngine.readOnlyAlertsCallOutTitle": "アラート状態を変更することはできません",
16829+
"xpack.securitySolution.detectionEngine.readOnlyAlertsCallOut.messageTitle": "アラート状態を変更することはできません",
1683116830
"xpack.securitySolution.detectionEngine.pageTitle": "検出エンジン",
1683216831
"xpack.securitySolution.detectionEngine.panelSubtitleShowing": "表示中",
1683316832
"xpack.securitySolution.detectionEngine.queryPreview.queryGraphCountLabel": "カウント",
@@ -16842,8 +16841,7 @@
1684216841
"xpack.securitySolution.detectionEngine.queryPreview.queryPreviewGraphTitle": "{hits} {hits, plural, =1 {ヒット} other {ヒット}}",
1684316842
"xpack.securitySolution.detectionEngine.queryPreview.queryPreviewHelpText": "クエリ結果をプレビューするデータのタイムフレームを選択します",
1684416843
"xpack.securitySolution.detectionEngine.queryPreview.queryPreviewLabel": "クイッククエリプレビュー",
16845-
"xpack.securitySolution.detectionEngine.readOnlyRulesCallOutMsg": "現在、検出エンジンルールを作成/編集するための必要な権限がありません。サポートについては、管理者にお問い合わせください。",
16846-
"xpack.securitySolution.detectionEngine.readOnlyRulesCallOutTitle": "ルールアクセス権が必要です",
16844+
"xpack.securitySolution.detectionEngine.readOnlyRulesCallOut.messageTitle": "ルールアクセス権が必要です",
1684716845
"xpack.securitySolution.detectionEngine.rule.editRule.errorMsgDescription": "{countError, plural, one {このタブ} other {これらのタブ}}に無効な入力があります: {tabHasError}",
1684816846
"xpack.securitySolution.detectionEngine.ruleDescription.mlJobStartedDescription": "開始",
1684916847
"xpack.securitySolution.detectionEngine.ruleDescription.mlJobStoppedDescription": "停止",

x-pack/plugins/translations/translations/zh-CN.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16843,8 +16843,7 @@
1684316843
"xpack.securitySolution.detectionEngine.noApiIntegrationKeyCallOutMsg": "每次启动 Kibana,都会为已保存对象生成新的加密密钥。没有持久性密钥,在 Kibana 重新启动后,将无法删除或修改规则。要设置持久性密钥,请将文本值为 32 个或更多任意字符的 xpack.encryptedSavedObjects.encryptionKey 设置添加到 kibana.yml 文件。",
1684416844
"xpack.securitySolution.detectionEngine.noApiIntegrationKeyCallOutTitle": "需要 API 集成密钥",
1684516845
"xpack.securitySolution.detectionEngine.noIndexTitle": "让我们来设置您的检测引擎",
16846-
"xpack.securitySolution.detectionEngine.readOnlyAlertsCallOutMsg": "您仅有权查看告警。如果您需要更新告警状态(打开或关闭告警),请联系您的 Kibana 管理员。",
16847-
"xpack.securitySolution.detectionEngine.readOnlyAlertsCallOutTitle": "您无法更改告警状态",
16846+
"xpack.securitySolution.detectionEngine.readOnlyAlertsCallOut.messageTitle": "您无法更改告警状态",
1684816847
"xpack.securitySolution.detectionEngine.pageTitle": "检测引擎",
1684916848
"xpack.securitySolution.detectionEngine.panelSubtitleShowing": "正在显示",
1685016849
"xpack.securitySolution.detectionEngine.queryPreview.queryGraphCountLabel": "计数",
@@ -16859,8 +16858,7 @@
1685916858
"xpack.securitySolution.detectionEngine.queryPreview.queryPreviewGraphTitle": "{hits} 个{hits, plural, =1 {命中} other {命中}}",
1686016859
"xpack.securitySolution.detectionEngine.queryPreview.queryPreviewHelpText": "选择数据的时间范围以预览查询结果",
1686116860
"xpack.securitySolution.detectionEngine.queryPreview.queryPreviewLabel": "快速查询预览",
16862-
"xpack.securitySolution.detectionEngine.readOnlyRulesCallOutMsg": "您当前缺少所需的权限,无法创建/编辑检测引擎规则。有关进一步帮助,请联系您的管理员。",
16863-
"xpack.securitySolution.detectionEngine.readOnlyRulesCallOutTitle": "需要规则权限",
16861+
"xpack.securitySolution.detectionEngine.readOnlyRulesCallOut.messageTitle": "需要规则权限",
1686416862
"xpack.securitySolution.detectionEngine.rule.editRule.errorMsgDescription": "您在{countError, plural, one {以下选项卡} other {以下选项卡}}中的输入无效:{tabHasError}",
1686516863
"xpack.securitySolution.detectionEngine.ruleDescription.mlJobStartedDescription": "已启动",
1686616864
"xpack.securitySolution.detectionEngine.ruleDescription.mlJobStoppedDescription": "已停止",

0 commit comments

Comments
 (0)