Skip to content

Commit

Permalink
[Alerting] Update alerting action variables to follow new terminology (
Browse files Browse the repository at this point in the history
…#93836) (#94079)

* Removing duplicate ActionVariable interface. Updating common action variables in UI

* Passing in alert values as rule variables in transform_action_params

* Fixing unit tests

* Fixing functional test

* Adding functiional test

* Updating paths

* Fixing i18n

* Fixing i18n

* Fixing api docs

* Plugin api build

* Moving spaceId and tags under rule prefix

* Using top level alert prefix

* Fixing i18n

* build api docs

* Fixing functional test

* Fixing functional test

Co-authored-by: ymao1 <[email protected]>
  • Loading branch information
kibanamachine and ymao1 authored Mar 9, 2021
1 parent 274a649 commit 2c76ea8
Show file tree
Hide file tree
Showing 25 changed files with 906 additions and 489 deletions.
194 changes: 104 additions & 90 deletions api_docs/alerting.json

Large diffs are not rendered by default.

114 changes: 32 additions & 82 deletions api_docs/triggers_actions_ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -927,56 +927,6 @@
},
"initialIsOpen": false
},
{
"id": "def-public.ActionVariable",
"type": "Interface",
"label": "ActionVariable",
"description": [],
"tags": [],
"children": [
{
"tags": [],
"id": "def-public.ActionVariable.name",
"type": "string",
"label": "name",
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 161
}
},
{
"tags": [],
"id": "def-public.ActionVariable.description",
"type": "string",
"label": "description",
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 162
}
},
{
"tags": [],
"id": "def-public.ActionVariable.useWithTripleBracesInTemplates",
"type": "CompoundType",
"label": "useWithTripleBracesInTemplates",
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 163
},
"signature": [
"boolean | undefined"
]
}
],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 160
},
"initialIsOpen": false
},
{
"id": "def-public.AggregationType",
"type": "Interface",
Expand Down Expand Up @@ -1130,7 +1080,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 227
"lineNumber": 222
}
},
{
Expand All @@ -1141,7 +1091,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 228
"lineNumber": 223
}
},
{
Expand All @@ -1152,7 +1102,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 229
"lineNumber": 224
}
},
{
Expand All @@ -1163,7 +1113,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 230
"lineNumber": 225
},
"signature": [
"string | ((docLinks: ",
Expand All @@ -1185,7 +1135,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 231
"lineNumber": 226
},
"signature": [
"(alertParams: Params) => ",
Expand All @@ -1206,7 +1156,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 232
"lineNumber": 227
},
"signature": [
"React.FunctionComponent<any> | React.LazyExoticComponent<React.ComponentType<",
Expand All @@ -1228,7 +1178,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 235
"lineNumber": 230
}
},
{
Expand All @@ -1239,7 +1189,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 236
"lineNumber": 231
},
"signature": [
"string | undefined"
Expand All @@ -1248,7 +1198,7 @@
],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 226
"lineNumber": 221
},
"initialIsOpen": false
},
Expand Down Expand Up @@ -1277,7 +1227,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 209
"lineNumber": 204
},
"signature": [
"Params"
Expand All @@ -1291,7 +1241,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 210
"lineNumber": 205
}
},
{
Expand All @@ -1302,7 +1252,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 211
"lineNumber": 206
}
},
{
Expand All @@ -1313,7 +1263,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 212
"lineNumber": 207
},
"signature": [
"\"onActionGroupChange\" | \"onActiveAlert\" | \"onThrottleInterval\""
Expand All @@ -1327,7 +1277,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 213
"lineNumber": 208
},
"signature": [
"<Key extends keyof Params>(property: Key, value: Params[Key] | undefined) => void"
Expand All @@ -1341,7 +1291,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 214
"lineNumber": 209
},
"signature": [
"<Prop extends \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"muteAll\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"throttle\" | \"notifyWhen\" | \"mutedInstanceIds\" | \"executionStatus\">(key: Prop, value: Pick<",
Expand All @@ -1363,7 +1313,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 218
"lineNumber": 213
},
"signature": [
{
Expand All @@ -1383,7 +1333,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 219
"lineNumber": 214
}
},
{
Expand All @@ -1394,7 +1344,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 220
"lineNumber": 215
},
"signature": [
{
Expand All @@ -1415,7 +1365,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 221
"lineNumber": 216
},
"signature": [
"MetaData | undefined"
Expand All @@ -1429,7 +1379,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 222
"lineNumber": 217
},
"signature": [
{
Expand All @@ -1449,7 +1399,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 223
"lineNumber": 218
},
"signature": [
{
Expand All @@ -1464,7 +1414,7 @@
],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 204
"lineNumber": 199
},
"initialIsOpen": false
},
Expand Down Expand Up @@ -1591,7 +1541,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 240
"lineNumber": 235
},
"signature": [
"any"
Expand All @@ -1600,7 +1550,7 @@
],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 239
"lineNumber": 234
},
"initialIsOpen": false
},
Expand Down Expand Up @@ -1924,7 +1874,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 115
"lineNumber": 116
},
"signature": [
"Record<string, any>"
Expand All @@ -1933,7 +1883,7 @@
],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 114
"lineNumber": 115
},
"initialIsOpen": false
}
Expand All @@ -1959,7 +1909,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 66
"lineNumber": 67
},
"initialIsOpen": false
},
Expand Down Expand Up @@ -1997,7 +1947,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 147
"lineNumber": 148
},
"signature": [
"PreConfiguredActionConnector",
Expand Down Expand Up @@ -2045,7 +1995,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 51
"lineNumber": 52
},
"signature": [
"{ get: (id: string) => ActionTypeModel<ActionConnector, ActionParams, any>; register: (objectType: ActionTypeModel<ActionConnector, ActionParams, any>) => void; list: () => ActionTypeModel<ActionConnector, ActionParams, any>[]; has: (id: string) => boolean; }"
Expand All @@ -2060,7 +2010,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 171
"lineNumber": 166
},
"signature": [
"AsActionVariables<\"params\" | \"state\"> & Partial<AsActionVariables<\"context\">>"
Expand All @@ -2075,7 +2025,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 33
"lineNumber": 34
},
"signature": [
"{ enabled: boolean; id: string; name: string; params: Record<string, unknown>; actions: AlertAction[]; muteAll: boolean; tags: string[]; alertTypeId: string; consumer: string; schedule: ",
Expand Down Expand Up @@ -2121,7 +2071,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/triggers_actions_ui/public/types.ts",
"lineNumber": 55
"lineNumber": 56
},
"signature": [
"{ get: (id: string) => AlertTypeModel<Record<string, unknown>>; register: (objectType: AlertTypeModel<Record<string, unknown>>) => void; list: () => AlertTypeModel<Record<string, unknown>>[]; has: (id: string) => boolean; }"
Expand Down
7 changes: 7 additions & 0 deletions x-pack/plugins/alerting/common/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,10 @@ export interface AlertsHealth {
timestamp: string;
};
}

export interface ActionVariable {
name: string;
description: string;
deprecated?: boolean;
useWithTripleBracesInTemplates?: boolean;
}
1 change: 0 additions & 1 deletion x-pack/plugins/alerting/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { AlertsConfigType } from './types';
export type AlertsClient = PublicMethodsOf<AlertsClientClass>;

export type {
ActionVariable,
AlertType,
ActionGroup,
ActionGroupIdsOf,
Expand Down
Loading

0 comments on commit 2c76ea8

Please sign in to comment.