Skip to content

Commit

Permalink
fixed typechecks
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Dec 17, 2020
1 parent 23f5d87 commit d69222c
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
export function getAlertType(): AlertTypeModel {
return {
id: 'example.always-firing',
name: 'Always Fires',
description: 'Alert when called',
iconClass: 'bolt',
documentationUrl: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ function isValueInEnum(enumeratin: Record<string, any>, value: any): boolean {
export function getAlertType(): AlertTypeModel {
return {
id: 'example.people-in-space',
name: 'People Are In Space Right Now',
description: 'Alert when people are in space right now',
iconClass: 'globe',
documentationUrl: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export function registerApmAlerts(
) {
alertTypeRegistry.register({
id: AlertType.ErrorCount,
name: i18n.translate('xpack.apm.alertTypes.errorCount', {
defaultMessage: 'Error count threshold',
}),
description: i18n.translate('xpack.apm.alertTypes.errorCount.description', {
defaultMessage:
'Alert when the number of errors in a service exceeds a defined threshold.',
Expand Down Expand Up @@ -45,9 +42,6 @@ export function registerApmAlerts(

alertTypeRegistry.register({
id: AlertType.TransactionDuration,
name: i18n.translate('xpack.apm.alertTypes.transactionDuration', {
defaultMessage: 'Transaction duration threshold',
}),
description: i18n.translate(
'xpack.apm.alertTypes.transactionDuration.description',
{
Expand Down Expand Up @@ -82,9 +76,6 @@ export function registerApmAlerts(

alertTypeRegistry.register({
id: AlertType.TransactionErrorRate,
name: i18n.translate('xpack.apm.alertTypes.transactionErrorRate', {
defaultMessage: 'Transaction error rate threshold',
}),
description: i18n.translate(
'xpack.apm.alertTypes.transactionErrorRate.description',
{
Expand Down Expand Up @@ -119,9 +110,6 @@ export function registerApmAlerts(

alertTypeRegistry.register({
id: AlertType.TransactionDurationAnomaly,
name: i18n.translate('xpack.apm.alertTypes.transactionDurationAnomaly', {
defaultMessage: 'Transaction duration anomaly',
}),
description: i18n.translate(
'xpack.apm.alertTypes.transactionDurationAnomaly.description',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ describe('alert_form', () => {
const alertType = {
id: 'alert-type',
iconClass: 'test',
name: 'test-alert',
description: 'Testing',
documentationUrl: 'https://...',
validate: validationMethod,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('alertType', () => {

it('alert type creation structure is the expected value', async () => {
expect(alertType.id).toBe('.geo-containment');
expect(alertType.name).toBe('Geo tracking containment');
expect(alertType.name).toBe('Tracking containment');
expect(alertType.actionGroups).toEqual([
{ id: 'Tracked entity contained', name: 'Tracking containment met' },
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('alertType', () => {

it('alert type creation structure is the expected value', async () => {
expect(alertType.id).toBe('.geo-threshold');
expect(alertType.name).toBe('Geo tracking threshold');
expect(alertType.name).toBe('Tracking threshold');
expect(alertType.actionGroups).toEqual([
{ id: 'tracking threshold met', name: 'Tracking threshold met' },
]);
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/stack_alerts/server/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('AlertingBuiltins Plugin', () => {
},
],
"id": ".geo-threshold",
"name": "Geo tracking threshold",
"name": "Tracking threshold",
}
`);

Expand Down
5 changes: 0 additions & 5 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -9297,7 +9297,6 @@
"xpack.infra.logFlyout.setFilterTooltip": "フィルターでイベントを表示",
"xpack.infra.logFlyout.valueColumnLabel": "値",
"xpack.infra.logs.alertFlyout.addCondition": "条件を追加",
"xpack.infra.logs.alertFlyout.alertName": "ログしきい値",
"xpack.infra.logs.alertFlyout.criterionComparatorValueTitle": "比較:値",
"xpack.infra.logs.alertFlyout.criterionFieldTitle": "フィールド",
"xpack.infra.logs.alertFlyout.error.criterionComparatorRequired": "コンパレーターが必要です。",
Expand Down Expand Up @@ -9629,7 +9628,6 @@
"xpack.infra.metrics.alertFlyout.aggregationText.p99": "99パーセンタイル",
"xpack.infra.metrics.alertFlyout.aggregationText.rate": "レート",
"xpack.infra.metrics.alertFlyout.aggregationText.sum": "合計",
"xpack.infra.metrics.alertFlyout.alertName": "メトリックしきい値",
"xpack.infra.metrics.alertFlyout.alertOnNoData": "データがない場合に通知する",
"xpack.infra.metrics.alertFlyout.alertPreviewError": "このアラート条件をプレビューするときにエラーが発生しました",
"xpack.infra.metrics.alertFlyout.alertPreviewErrorDesc": "しばらくたってから再試行するか、詳細を確認してください。",
Expand Down Expand Up @@ -9718,7 +9716,6 @@
"xpack.infra.metrics.expressionItems.components.closablePopoverTitle.closeLabel": "閉じる",
"xpack.infra.metrics.invalidNodeErrorDescription": "構成をよく確認してください",
"xpack.infra.metrics.invalidNodeErrorTitle": "{nodeName} がメトリックデータを収集していないようです",
"xpack.infra.metrics.inventory.alertFlyout.alertName": "インベントリ",
"xpack.infra.metrics.loadingNodeDataText": "データを読み込み中",
"xpack.infra.metrics.missingTSVBModelError": "{nodeType}では{metricId}のTSVBモデルが存在しません",
"xpack.infra.metrics.pluginTitle": "メトリック",
Expand Down Expand Up @@ -19137,7 +19134,6 @@
"xpack.stackAlerts.geoThreshold.indexLabel": "インデックス",
"xpack.stackAlerts.geoThreshold.indexPatternSelectLabel": "インデックスパターン",
"xpack.stackAlerts.geoThreshold.indexPatternSelectPlaceholder": "インデックスパターンを選択",
"xpack.stackAlerts.geoThreshold.name.trackingThreshold": "追跡しきい値",
"xpack.stackAlerts.geoThreshold.noIndexPattern.doThisLinkTextDescription": "インデックスパターンを作成します",
"xpack.stackAlerts.geoThreshold.noIndexPattern.doThisPrefixDescription": "次のことが必要です ",
"xpack.stackAlerts.geoThreshold.noIndexPattern.doThisSuffixDescription": " 地理空間フィールドを含む",
Expand Down Expand Up @@ -19512,7 +19508,6 @@
"xpack.triggersActionsUI.sections.alertForm.renotifyFieldLabel": "通知間隔",
"xpack.triggersActionsUI.sections.alertForm.renotifyWithTooltip": "アラートがアクティブな間にアクションを繰り返す頻度を定義します。",
"xpack.triggersActionsUI.sections.alertForm.selectAlertActionTypeTitle": "アクションタイプを選択してください",
"xpack.triggersActionsUI.sections.alertForm.selectedAlertTypeTitle": "{alertType}",
"xpack.triggersActionsUI.sections.alertForm.unableToAddAction": "デフォルトアクショングループの定義がないのでアクションを追加できません",
"xpack.triggersActionsUI.sections.alertForm.unableToLoadActionsMessage": "コネクターを読み込めません",
"xpack.triggersActionsUI.sections.alertForm.unableToLoadActionTypesMessage": "アクションタイプを読み込めません",
Expand Down
5 changes: 0 additions & 5 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -9306,7 +9306,6 @@
"xpack.infra.logFlyout.setFilterTooltip": "使用筛选查看事件",
"xpack.infra.logFlyout.valueColumnLabel": "值",
"xpack.infra.logs.alertFlyout.addCondition": "添加条件",
"xpack.infra.logs.alertFlyout.alertName": "日志阈值",
"xpack.infra.logs.alertFlyout.criterionComparatorValueTitle": "对比:值",
"xpack.infra.logs.alertFlyout.criterionFieldTitle": "字段",
"xpack.infra.logs.alertFlyout.error.criterionComparatorRequired": "比较运算符必填。",
Expand Down Expand Up @@ -9639,7 +9638,6 @@
"xpack.infra.metrics.alertFlyout.aggregationText.p99": "第 99 个百分位",
"xpack.infra.metrics.alertFlyout.aggregationText.rate": "比率",
"xpack.infra.metrics.alertFlyout.aggregationText.sum": "求和",
"xpack.infra.metrics.alertFlyout.alertName": "指标阈值",
"xpack.infra.metrics.alertFlyout.alertOnNoData": "没数据时提醒我",
"xpack.infra.metrics.alertFlyout.alertPreviewError": "尝试预览此告警条件时发生错误",
"xpack.infra.metrics.alertFlyout.alertPreviewErrorDesc": "请稍后重试或查看详情了解更多信息。",
Expand Down Expand Up @@ -9731,7 +9729,6 @@
"xpack.infra.metrics.expressionItems.components.closablePopoverTitle.closeLabel": "关闭",
"xpack.infra.metrics.invalidNodeErrorDescription": "反复检查您的配置",
"xpack.infra.metrics.invalidNodeErrorTitle": "似乎 {nodeName} 未在收集任何指标数据",
"xpack.infra.metrics.inventory.alertFlyout.alertName": "库存",
"xpack.infra.metrics.loadingNodeDataText": "正在加载数据",
"xpack.infra.metrics.missingTSVBModelError": "{nodeType} 的 {metricId} TSVB 模型不存在",
"xpack.infra.metrics.pluginTitle": "指标",
Expand Down Expand Up @@ -19155,7 +19152,6 @@
"xpack.stackAlerts.geoThreshold.indexLabel": "索引",
"xpack.stackAlerts.geoThreshold.indexPatternSelectLabel": "索引模式",
"xpack.stackAlerts.geoThreshold.indexPatternSelectPlaceholder": "选择索引模式",
"xpack.stackAlerts.geoThreshold.name.trackingThreshold": "跟踪阈值",
"xpack.stackAlerts.geoThreshold.noIndexPattern.doThisLinkTextDescription": "创建索引模式",
"xpack.stackAlerts.geoThreshold.noIndexPattern.doThisPrefixDescription": "您将需要 ",
"xpack.stackAlerts.geoThreshold.noIndexPattern.doThisSuffixDescription": " (包含地理空间字段)。",
Expand Down Expand Up @@ -19531,7 +19527,6 @@
"xpack.triggersActionsUI.sections.alertForm.renotifyFieldLabel": "通知频率",
"xpack.triggersActionsUI.sections.alertForm.renotifyWithTooltip": "定义告警处于活动状态时重复操作的频率。",
"xpack.triggersActionsUI.sections.alertForm.selectAlertActionTypeTitle": "选择操作类型",
"xpack.triggersActionsUI.sections.alertForm.selectedAlertTypeTitle": "{alertType}",
"xpack.triggersActionsUI.sections.alertForm.unableToAddAction": "无法添加操作,因为未定义默认操作组",
"xpack.triggersActionsUI.sections.alertForm.unableToLoadActionsMessage": "无法加载连接器",
"xpack.triggersActionsUI.sections.alertForm.unableToLoadActionTypesMessage": "无法加载操作类型",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ describe('alert_edit', () => {
const alertType = {
id: 'my-alert-type',
iconClass: 'test',
name: 'test-alert',
description: 'test',
documentationUrl: null,
validate: (): ValidationResult => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CLIENT_ALERT_TYPES } from '../../../common/constants/alerts';
import { DurationAnomalyTranslations } from './translations';
import { AlertTypeInitializer } from '.';

const { name, defaultActionMessage, description } = DurationAnomalyTranslations;
const { defaultActionMessage, description } = DurationAnomalyTranslations;
const DurationAnomalyAlert = React.lazy(() => import('./lazy_wrapper/duration_anomaly'));

export const initDurationAnomalyAlertType: AlertTypeInitializer = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class AlertingFixturePlugin implements Plugin<Setup, Start, AlertingExamp

triggersActionsUi.alertTypeRegistry.register({
id: 'test.always-firing',
name: 'Test Always Firing',
description: 'Always fires',
iconClass: 'alert',
documentationUrl: null,
Expand All @@ -41,7 +40,6 @@ export class AlertingFixturePlugin implements Plugin<Setup, Start, AlertingExamp

triggersActionsUi.alertTypeRegistry.register({
id: 'test.noop',
name: 'Test Noop',
description: `Doesn't do anything`,
iconClass: 'alert',
documentationUrl: null,
Expand Down

0 comments on commit d69222c

Please sign in to comment.