Skip to content

Commit 2f3347f

Browse files
author
Aaron Caldwell
committed
Merge remote-tracking branch 'upstream/master' into np-update-layer-dependencies
2 parents db6c7f3 + 73a8548 commit 2f3347f

File tree

684 files changed

+25469
-6819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

684 files changed

+25469
-6819
lines changed

.github/workflows/pr-project-assigner.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ jobs:
88
name: Assign a PR to project based on label
99
steps:
1010
- name: Assign to project
11-
uses: elastic/github-actions/project-assigner@v1.0.3
11+
uses: elastic/github-actions/project-assigner@v2.0.0
1212
id: project_assigner
1313
with:
1414
issue-mappings: |
1515
[
16+
{ "label": "Team:AppArch", "projectNumber": 37, "columnName": "Review in progress" },
17+
{ "label": "Feature:Lens", "projectNumber": 32, "columnName": "In progress" },
18+
{ "label": "Team:Canvas", "projectNumber": 38, "columnName": "Review in progress" }
1619
]
17-
ghToken: ${{ secrets.PROJECT_ASSIGNER_TOKEN }}
20+
ghToken: ${{ secrets.GITHUB_TOKEN }}
1821

19-
# { "label": "Team:AppArch", "projectName": "kibana-app-arch", "columnId": 6173897 },
20-
# { "label": "Feature:Lens", "projectName": "Lens", "columnId": 6219362 },
21-
# { "label": "Team:Canvas", "projectName": "canvas", "columnId": 6187580 }

.github/workflows/project-assigner.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
name: Assign issue or PR to project based on label
99
steps:
1010
- name: Assign to project
11-
uses: elastic/github-actions/project-assigner@v1.0.3
11+
uses: elastic/github-actions/project-assigner@v2.0.0
1212
id: project_assigner
1313
with:
14-
issue-mappings: '[{"label": "Team:AppArch", "projectName": "kibana-app-arch", "columnId": 6173895}, {"label": "Feature:Lens", "projectName": "Lens", "columnId": 6219363}, {"label": "Team:Canvas", "projectName": "canvas", "columnId": 6187593}]'
15-
ghToken: ${{ secrets.PROJECT_ASSIGNER_TOKEN }}
14+
issue-mappings: '[{"label": "Team:AppArch", "projectNumber": 37, "columnName": "To triage"}, {"label": "Feature:Lens", "projectNumber": 32, "columnName": "Long-term goals"}, {"label": "Team:Canvas", "projectNumber": 38, "columnName": "Inbox"}]'
15+
ghToken: ${{ secrets.GITHUB_TOKEN }}
1616

1717

docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
| [esQuery](./kibana-plugin-plugins-data-server.esquery.md) | |
6161
| [fieldFormats](./kibana-plugin-plugins-data-server.fieldformats.md) | |
6262
| [indexPatterns](./kibana-plugin-plugins-data-server.indexpatterns.md) | |
63-
| [search](./kibana-plugin-plugins-data-server.search.md) | |
6463

6564
## Type Aliases
6665

@@ -70,6 +69,5 @@
7069
| [IFieldFormatsRegistry](./kibana-plugin-plugins-data-server.ifieldformatsregistry.md) | |
7170
| [ISearch](./kibana-plugin-plugins-data-server.isearch.md) | |
7271
| [ISearchCancel](./kibana-plugin-plugins-data-server.isearchcancel.md) | |
73-
| [ParsedInterval](./kibana-plugin-plugins-data-server.parsedinterval.md) | |
7472
| [TSearchStrategyProvider](./kibana-plugin-plugins-data-server.tsearchstrategyprovider.md) | Search strategy provider creates an instance of a search strategy with the request handler context bound to it. This way every search strategy can use whatever information they require from the request context. |
7573

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Alerting Example
2+
3+
This example plugin shows you how to create a custom Alert Type, create alerts based on that type and corresponding UI for viewing the details of all the alerts within the custom plugin.
4+
5+
To run this example, use the command `yarn start --run-examples`.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export const ALERTING_EXAMPLE_APP_ID = 'AlertingExample';
21+
22+
// always firing
23+
export const DEFAULT_INSTANCES_TO_GENERATE = 5;
24+
25+
// Astros
26+
export enum Craft {
27+
OuterSpace = 'Outer Space',
28+
ISS = 'ISS',
29+
}
30+
export enum Operator {
31+
AreAbove = 'Are above',
32+
AreBelow = 'Are below',
33+
AreExactly = 'Are exactly',
34+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"id": "alertingExample",
3+
"version": "0.0.1",
4+
"kibanaVersion": "kibana",
5+
"configPath": ["alerting_example"],
6+
"server": true,
7+
"ui": true,
8+
"requiredPlugins": ["triggers_actions_ui", "charts", "data", "alerting", "actions"],
9+
"optionalPlugins": []
10+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "alerting_example",
3+
"version": "1.0.0",
4+
"main": "target/examples/alerting_example",
5+
"kibana": {
6+
"version": "kibana",
7+
"templateVersion": "1.0.0"
8+
},
9+
"license": "Apache-2.0",
10+
"scripts": {
11+
"kbn": "node ../../scripts/kbn.js",
12+
"build": "rm -rf './target' && tsc"
13+
},
14+
"devDependencies": {
15+
"typescript": "3.7.2"
16+
}
17+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import React, { Fragment } from 'react';
21+
import { EuiFlexGroup, EuiFlexItem, EuiFieldNumber, EuiFormRow } from '@elastic/eui';
22+
import { i18n } from '@kbn/i18n';
23+
import { AlertTypeModel } from '../../../../x-pack/plugins/triggers_actions_ui/public';
24+
import { DEFAULT_INSTANCES_TO_GENERATE } from '../../common/constants';
25+
26+
interface AlwaysFiringParamsProps {
27+
alertParams: { instances?: number };
28+
setAlertParams: (property: string, value: any) => void;
29+
errors: { [key: string]: string[] };
30+
}
31+
32+
export function getAlertType(): AlertTypeModel {
33+
return {
34+
id: 'example.always-firing',
35+
name: 'Always Fires',
36+
iconClass: 'bolt',
37+
alertParamsExpression: AlwaysFiringExpression,
38+
validate: (alertParams: AlwaysFiringParamsProps['alertParams']) => {
39+
const { instances } = alertParams;
40+
const validationResult = {
41+
errors: {
42+
instances: new Array<string>(),
43+
},
44+
};
45+
if (instances && instances < 0) {
46+
validationResult.errors.instances.push(
47+
i18n.translate('AlertingExample.addAlert.error.invalidRandomInstances', {
48+
defaultMessage: 'instances must be equal or greater than zero.',
49+
})
50+
);
51+
}
52+
return validationResult;
53+
},
54+
};
55+
}
56+
57+
export const AlwaysFiringExpression: React.FunctionComponent<AlwaysFiringParamsProps> = ({
58+
alertParams,
59+
setAlertParams,
60+
}) => {
61+
const { instances = DEFAULT_INSTANCES_TO_GENERATE } = alertParams;
62+
return (
63+
<Fragment>
64+
<EuiFlexGroup gutterSize="s" wrap direction="column">
65+
<EuiFlexItem grow={true}>
66+
<EuiFormRow
67+
label="Random Instances to generate"
68+
helpText="How many randomly generated Alert Instances do you wish to activate on each alert run?"
69+
>
70+
<EuiFieldNumber
71+
name="instances"
72+
value={instances}
73+
onChange={event => {
74+
setAlertParams('instances', event.target.valueAsNumber);
75+
}}
76+
/>
77+
</EuiFormRow>
78+
</EuiFlexItem>
79+
</EuiFlexGroup>
80+
</Fragment>
81+
);
82+
};

0 commit comments

Comments
 (0)