Skip to content

Commit 8e9bd86

Browse files
Merge branch 'master' into adding-job-synchronization-callout-to-job-list-pages
2 parents b1e9287 + 04d4e71 commit 8e9bd86

192 files changed

Lines changed: 3913 additions & 6269 deletions

File tree

Some content is hidden

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

packages/kbn-monaco/src/painless/diagnostics_adapter.ts

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,41 @@ export class DiagnosticsAdapter {
3232
constructor(private worker: WorkerAccessor) {
3333
const onModelAdd = (model: monaco.editor.IModel): void => {
3434
let handle: any;
35-
model.onDidChangeContent(() => {
36-
// Every time a new change is made, wait 500ms before validating
37-
clearTimeout(handle);
38-
handle = setTimeout(() => this.validate(model.uri), 500);
39-
});
4035

41-
this.validate(model.uri);
36+
if (model.getModeId() === ID) {
37+
model.onDidChangeContent(() => {
38+
// Do not validate if the language ID has changed
39+
if (model.getModeId() !== ID) {
40+
return;
41+
}
42+
43+
// Every time a new change is made, wait 500ms before validating
44+
clearTimeout(handle);
45+
handle = setTimeout(() => this.validate(model.uri), 500);
46+
});
47+
48+
model.onDidChangeLanguage(({ newLanguage }) => {
49+
// Reset the model markers if the language ID has changed and is no longer "painless"
50+
if (newLanguage !== ID) {
51+
return monaco.editor.setModelMarkers(model, ID, []);
52+
}
53+
});
54+
55+
this.validate(model.uri);
56+
}
4257
};
4358
monaco.editor.onDidCreateModel(onModelAdd);
4459
monaco.editor.getModels().forEach(onModelAdd);
4560
}
4661

4762
private async validate(resource: monaco.Uri): Promise<void> {
4863
const worker = await this.worker(resource);
49-
const errorMarkers = await worker.getSyntaxErrors();
50-
51-
const model = monaco.editor.getModel(resource);
64+
const errorMarkers = await worker.getSyntaxErrors(resource.toString());
5265

53-
// Set the error markers and underline them with "Error" severity
54-
monaco.editor.setModelMarkers(model!, ID, errorMarkers.map(toDiagnostics));
66+
if (errorMarkers) {
67+
const model = monaco.editor.getModel(resource);
68+
// Set the error markers and underline them with "Error" severity
69+
monaco.editor.setModelMarkers(model!, ID, errorMarkers.map(toDiagnostics));
70+
}
5571
}
5672
}

packages/kbn-monaco/src/painless/worker/painless_worker.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ export class PainlessWorker {
2828
this._ctx = ctx;
2929
}
3030

31-
private getTextDocument(): string {
32-
const model = this._ctx.getMirrorModels()[0];
33-
return model.getValue();
31+
private getTextDocument(modelUri: string): string | undefined {
32+
const model = this._ctx.getMirrorModels().find((m) => m.uri.toString() === modelUri);
33+
34+
return model?.getValue();
3435
}
3536

36-
public async getSyntaxErrors() {
37-
const code = this.getTextDocument();
38-
return parseAndGetSyntaxErrors(code);
37+
public async getSyntaxErrors(modelUri: string) {
38+
const code = this.getTextDocument(modelUri);
39+
40+
if (code) {
41+
return parseAndGetSyntaxErrors(code);
42+
}
3943
}
4044

4145
public provideAutocompleteSuggestions(

src/dev/run_find_plugins_with_circular_deps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const allowedList: CircularDepList = new Set([
4242
'src/plugins/vis_default_editor -> src/plugins/visualize',
4343
'src/plugins/visualizations -> src/plugins/visualize',
4444
'x-pack/plugins/actions -> x-pack/plugins/case',
45+
'x-pack/plugins/case -> x-pack/plugins/security_solution',
4546
'x-pack/plugins/apm -> x-pack/plugins/infra',
4647
'x-pack/plugins/lists -> x-pack/plugins/security_solution',
4748
'x-pack/plugins/security -> x-pack/plugins/spaces',

test/api_integration/apis/saved_objects/find.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ export default function ({ getService }) {
7878
}));
7979
});
8080

81-
describe('page beyond total', () => {
81+
// FLAKY: https://github.com/elastic/kibana/issues/85911
82+
describe.skip('page beyond total', () => {
8283
it('should return 200 with empty response', async () =>
8384
await supertest
8485
.get('/api/saved_objects/_find?type=visualization&page=100&per_page=100')

x-pack/examples/alerting_example/public/components/create_alert.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import React, { useMemo, useState } from 'react';
7+
import React, { useMemo, useState, useCallback } from 'react';
88

99
import { EuiIcon, EuiFlexItem, EuiCard, EuiFlexGroup } from '@elastic/eui';
1010

@@ -16,15 +16,18 @@ export const CreateAlert = ({
1616
}: Pick<AlertingExampleComponentParams, 'triggersActionsUi'>) => {
1717
const [alertFlyoutVisible, setAlertFlyoutVisibility] = useState<boolean>(false);
1818

19+
const onCloseAlertFlyout = useCallback(() => setAlertFlyoutVisibility(false), [
20+
setAlertFlyoutVisibility,
21+
]);
22+
1923
const AddAlertFlyout = useMemo(
2024
() =>
2125
triggersActionsUi.getAddAlertFlyout({
2226
consumer: ALERTING_EXAMPLE_APP_ID,
23-
addFlyoutVisible: alertFlyoutVisible,
24-
setAddFlyoutVisibility: setAlertFlyoutVisibility,
27+
onClose: onCloseAlertFlyout,
2528
}),
2629
// eslint-disable-next-line react-hooks/exhaustive-deps
27-
[alertFlyoutVisible]
30+
[onCloseAlertFlyout]
2831
);
2932

3033
return (
@@ -37,7 +40,7 @@ export const CreateAlert = ({
3740
onClick={() => setAlertFlyoutVisibility(true)}
3841
/>
3942
</EuiFlexItem>
40-
<EuiFlexItem>{AddAlertFlyout}</EuiFlexItem>
43+
<EuiFlexItem>{alertFlyoutVisible && AddAlertFlyout}</EuiFlexItem>
4144
</EuiFlexGroup>
4245
);
4346
};

x-pack/plugins/actions/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ The ServiceNow action uses the [V2 Table API](https://developer.servicenow.com/a
553553
| Property | Description | Type |
554554
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------- |
555555
| apiUrl | ServiceNow instance URL. | string |
556-
| incidentConfiguration | Optional property and specific to **Cases only**. If defined, the object should contain an attribute called `mapping`. A `mapping` is an array of objects. Each mapping object should be of the form `{ source: string, target: string, actionType: string }`. `source` is the Case field. `target` is the ServiceNow field where `source` will be mapped to. `actionType` can be one of `nothing`, `overwrite` or `append`. For example the `{ source: 'title', target: 'short_description', actionType: 'overwrite' }` record, inside mapping array, means that the title of a case will be mapped to the short description of an incident in ServiceNow and will be overwrite on each update. | object _(optional)_ |
557556

558557
### `secrets`
559558

@@ -600,7 +599,6 @@ The Jira action uses the [V2 API](https://developer.atlassian.com/cloud/jira/pla
600599
| Property | Description | Type |
601600
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
602601
| apiUrl | Jira instance URL. | string |
603-
| incidentConfiguration | Optional property and specific to **Cases only**. if defined, the object should contain an attribute called `mapping`. A `mapping` is an array of objects. Each mapping object should be of the form `{ source: string, target: string, actionType: string }`. `source` is the Case field. `target` is the Jira field where `source` will be mapped to. `actionType` can be one of `nothing`, `overwrite` or `append`. For example the `{ source: 'title', target: 'summary', actionType: 'overwrite' }` record, inside mapping array, means that the title of a case will be mapped to the short description of an incident in Jira and will be overwrite on each update. | object _(optional)_ |
604602

605603
### `secrets`
606604

@@ -653,7 +651,6 @@ ID: `.resilient`
653651
| Property | Description | Type |
654652
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
655653
| apiUrl | IBM Resilient instance URL. | string |
656-
| incidentConfiguration | Optional property and specific to **Cases only**. If defined, the object should contain an attribute called `mapping`. A `mapping` is an array of objects. Each mapping object should be of the form `{ source: string, target: string, actionType: string }`. `source` is the Case field. `target` is the Jira field where `source` will be mapped to. `actionType` can be one of `nothing`, `overwrite` or `append`. For example the `{ source: 'title', target: 'summary', actionType: 'overwrite' }` record, inside mapping array, means that the title of a case will be mapped to the short description of an incident in IBM Resilient and will be overwrite on each update. | object |
657654

658655
### `secrets`
659656

x-pack/plugins/actions/server/builtin_action_types/case/constants.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

x-pack/plugins/actions/server/builtin_action_types/case/schema.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

x-pack/plugins/actions/server/builtin_action_types/case/transformers.test.ts

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)