Skip to content

Commit

Permalink
review + translations
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM committed Jun 20, 2023
1 parent 1bc1264 commit 4bc468f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 17 deletions.
Expand Up @@ -20,7 +20,7 @@ import { ChannelsResponse, GetChannelsResponse } from '../../../common/slack_api
import { INTERNAL_BASE_STACK_CONNECTORS_API_PATH } from '../../../common';
import * as i18n from './translations';

interface UseLoadTagsQueryProps {
interface UseFetchChannelsProps {
authToken: string;
}

Expand All @@ -38,7 +38,7 @@ const fetchChannels = async (
);
};

export function useFetchChannels(props: UseLoadTagsQueryProps) {
export function useFetchChannels(props: UseFetchChannelsProps) {
const { authToken } = props;

const {
Expand Down
@@ -0,0 +1,35 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { httpServiceMock, httpServerMock } from '@kbn/core/server/mocks';
import { getSlackApiChannelsRoute } from './get_slack_api_channels';

describe('getWellKnownEmailServiceRoute', () => {
it('returns config for well known email service', async () => {
const router = httpServiceMock.createRouter();

getSlackApiChannelsRoute(router);

const [config, handler] = router.get.mock.calls[0];
expect(config.path).toMatchInlineSnapshot(
`"/internal/stack_connectors/_email_config/{service}"`
);

const mockResponse = httpServerMock.createResponseFactory();
mockResponse.ok();
const mockRequest = httpServerMock.createKibanaRequest();
await handler({}, mockRequest, mockResponse);

expect(mockResponse.ok).toHaveBeenCalledWith({
body: {
host: 'smtp.gmail.com',
port: 465,
secure: true,
},
});
});
});
6 changes: 1 addition & 5 deletions x-pack/plugins/translations/translations/fr-FR.json
Expand Up @@ -35303,10 +35303,7 @@
"xpack.stackConnectors.components.slack..error.requiredSlackMessageText": "Le message est requis.",
"xpack.stackConnectors.components.slack.connectorTypeTitle": "Envoyer vers Slack",
"xpack.stackConnectors.components.slack.error.invalidWebhookUrlText": "L'URL de webhook n'est pas valide.",
"xpack.stackConnectors.components.slack.loadingMessage": "Chargement des canaux",
"xpack.stackConnectors.components.slack.messageTextAreaFieldLabel": "Message",
"xpack.stackConnectors.components.slack.noChannelsAvailable": "Aucun canal disponible",
"xpack.stackConnectors.components.slack.noChannelsFound": "Aucun canal trouvé",
"xpack.stackConnectors.components.slack.selectMessageText": "Envoyez un message à un canal ou à un utilisateur Slack.",
"xpack.stackConnectors.components.slack.webApi": "API web",
"xpack.stackConnectors.components.slack.webhook": "Webhook",
Expand Down Expand Up @@ -35459,7 +35456,6 @@
"xpack.stackConnectors.slack.configurationErrorNoHostname": "erreur lors de la configuration de l'action slack : impossible d'analyser le nom de l'hôte depuis webhookUrl",
"xpack.stackConnectors.slack.errorPostingErrorMessage": "erreur lors de la publication du message slack",
"xpack.stackConnectors.slack.errorPostingRetryLaterErrorMessage": "erreur lors de la publication d'un message slack, réessayer ultérieurement",
"xpack.stackConnectors.slack.params..showChannelsListButton": "Canaux",
"xpack.stackConnectors.slack.params.componentError.getChannelsRequestFailed": "Impossible de récupérer la liste des canaux Slack",
"xpack.stackConnectors.slack.title": "Slack",
"xpack.stackConnectors.slack.unexpectedNullResponseErrorMessage": "réponse nulle inattendue de Slack",
Expand Down Expand Up @@ -39575,4 +39571,4 @@
"xpack.painlessLab.title": "Painless Lab",
"xpack.painlessLab.walkthroughButtonLabel": "Présentation"
}
}
}
6 changes: 1 addition & 5 deletions x-pack/plugins/translations/translations/ja-JP.json
Expand Up @@ -35284,10 +35284,7 @@
"xpack.stackConnectors.components.slack..error.requiredSlackMessageText": "メッセージが必要です。",
"xpack.stackConnectors.components.slack.connectorTypeTitle": "Slack に送信",
"xpack.stackConnectors.components.slack.error.invalidWebhookUrlText": "Web フック URL が無効です。",
"xpack.stackConnectors.components.slack.loadingMessage": "チャンネルを読み込み中",
"xpack.stackConnectors.components.slack.messageTextAreaFieldLabel": "メッセージ",
"xpack.stackConnectors.components.slack.noChannelsAvailable": "チャンネルがありません",
"xpack.stackConnectors.components.slack.noChannelsFound": "チャンネルが見つかりません",
"xpack.stackConnectors.components.slack.selectMessageText": "Slack チャネルにメッセージを送信します。",
"xpack.stackConnectors.components.slack.webApi": "Web API",
"xpack.stackConnectors.components.slack.webhook": "Web フック",
Expand Down Expand Up @@ -35440,7 +35437,6 @@
"xpack.stackConnectors.slack.configurationErrorNoHostname": "slack アクションの構成エラー:Web フック URL からホスト名をパースできません",
"xpack.stackConnectors.slack.errorPostingErrorMessage": "slack メッセージの投稿エラー",
"xpack.stackConnectors.slack.errorPostingRetryLaterErrorMessage": "slack メッセージの投稿エラー、後ほど再試行",
"xpack.stackConnectors.slack.params..showChannelsListButton": "チャンネル",
"xpack.stackConnectors.slack.params.componentError.getChannelsRequestFailed": "Slackチャンネルリストを取得できませんでした",
"xpack.stackConnectors.slack.title": "Slack",
"xpack.stackConnectors.slack.unexpectedNullResponseErrorMessage": "Slack から予期せぬ null 応答",
Expand Down Expand Up @@ -39545,4 +39541,4 @@
"xpack.painlessLab.title": "Painless Lab",
"xpack.painlessLab.walkthroughButtonLabel": "実地検証"
}
}
}
6 changes: 1 addition & 5 deletions x-pack/plugins/translations/translations/zh-CN.json
Expand Up @@ -35278,10 +35278,7 @@
"xpack.stackConnectors.components.slack..error.requiredSlackMessageText": "“消息”必填。",
"xpack.stackConnectors.components.slack.connectorTypeTitle": "发送到 Slack",
"xpack.stackConnectors.components.slack.error.invalidWebhookUrlText": "Webhook URL 无效。",
"xpack.stackConnectors.components.slack.loadingMessage": "正在加载频道",
"xpack.stackConnectors.components.slack.messageTextAreaFieldLabel": "消息",
"xpack.stackConnectors.components.slack.noChannelsAvailable": "无频道可用",
"xpack.stackConnectors.components.slack.noChannelsFound": "找不到频道",
"xpack.stackConnectors.components.slack.selectMessageText": "向 Slack 频道或用户发送消息。",
"xpack.stackConnectors.components.slack.webApi": "Web API",
"xpack.stackConnectors.components.slack.webhook": "Webhook",
Expand Down Expand Up @@ -35434,7 +35431,6 @@
"xpack.stackConnectors.slack.configurationErrorNoHostname": "配置 slack 操作时出错:无法解析 webhookUrl 中的主机名",
"xpack.stackConnectors.slack.errorPostingErrorMessage": "发布 slack 消息时出错",
"xpack.stackConnectors.slack.errorPostingRetryLaterErrorMessage": "发布 slack 消息时出错,稍后重试",
"xpack.stackConnectors.slack.params..showChannelsListButton": "频道",
"xpack.stackConnectors.slack.params.componentError.getChannelsRequestFailed": "无法检索 Slack 频道列表",
"xpack.stackConnectors.slack.title": "Slack",
"xpack.stackConnectors.slack.unexpectedNullResponseErrorMessage": "来自 slack 的异常空响应",
Expand Down Expand Up @@ -39539,4 +39535,4 @@
"xpack.painlessLab.title": "Painless 实验室",
"xpack.painlessLab.walkthroughButtonLabel": "指导"
}
}
}

0 comments on commit 4bc468f

Please sign in to comment.