Skip to content

Commit 99bb559

Browse files
Merge branch '7.x' into backport/7.x/pr-84454
2 parents e3e3c40 + 0e5e413 commit 99bb559

3 files changed

Lines changed: 31 additions & 5 deletions

File tree

x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/common_fields/common_processor_fields.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import React, { FunctionComponent } from 'react';
88
import { i18n } from '@kbn/i18n';
9+
import { PainlessLang } from '@kbn/monaco';
910

1011
import {
1112
FieldConfig,
@@ -56,14 +57,17 @@ const tagConfig: FieldConfig = {
5657
};
5758

5859
export const CommonProcessorFields: FunctionComponent = () => {
60+
const suggestionProvider = PainlessLang.getSuggestionProvider('processor_conditional');
61+
5962
return (
6063
<section>
6164
<UseField
6265
config={ifConfig}
6366
component={TextEditor}
6467
componentProps={{
6568
editorProps: {
66-
languageId: 'painless',
69+
languageId: PainlessLang.ID,
70+
suggestionProvider,
6771
height: EDITOR_PX_HEIGHT.extraSmall,
6872
options: {
6973
lineNumbers: 'off',

x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/processor_form/processors/script.tsx

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

7-
import React, { useState } from 'react';
7+
import React, { useState, useEffect } from 'react';
88
import { i18n } from '@kbn/i18n';
99
import { FormattedMessage } from '@kbn/i18n/react';
10+
import { PainlessLang } from '@kbn/monaco';
1011
import { EuiCode, EuiSwitch, EuiFormRow } from '@elastic/eui';
1112

12-
import { FIELD_TYPES, fieldValidators, UseField, Field } from '../../../../../../shared_imports';
13+
import {
14+
FIELD_TYPES,
15+
fieldValidators,
16+
UseField,
17+
Field,
18+
useFormData,
19+
} from '../../../../../../shared_imports';
1320

1421
import { XJsonEditor, TextEditor } from '../field_components';
1522

@@ -122,6 +129,17 @@ const fieldsConfig: FieldsConfig = {
122129

123130
export const Script: FormFieldsComponent = ({ initialFieldValues }) => {
124131
const [showId, setShowId] = useState(() => !!initialFieldValues?.id);
132+
const [scriptLanguage, setScriptLanguage] = useState<string>('plaintext');
133+
134+
const [{ fields }] = useFormData({ watch: 'fields.lang' });
135+
136+
const suggestionProvider = PainlessLang.getSuggestionProvider('processor_conditional');
137+
138+
useEffect(() => {
139+
const isPainlessLang = fields?.lang === 'painless' || fields?.lang === ''; // Scripting language defaults to painless if none specified
140+
setScriptLanguage(isPainlessLang ? PainlessLang.ID : 'plaintext');
141+
}, [fields]);
142+
125143
return (
126144
<>
127145
<EuiFormRow>
@@ -147,6 +165,9 @@ export const Script: FormFieldsComponent = ({ initialFieldValues }) => {
147165
component={TextEditor}
148166
componentProps={{
149167
editorProps: {
168+
languageId: scriptLanguage,
169+
suggestionProvider:
170+
scriptLanguage === PainlessLang.ID ? suggestionProvider : undefined,
150171
height: EDITOR_PX_HEIGHT.medium,
151172
'aria-label': i18n.translate(
152173
'xpack.ingestPipelines.pipelineEditor.scriptForm.sourceFieldAriaLabel',

x-pack/test/functional/apps/lens/rollup.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
1313
const listingTable = getService('listingTable');
1414
const esArchiver = getService('esArchiver');
1515

16-
describe('lens rollup tests', () => {
16+
// FLAKY: https://github.com/elastic/kibana/issues/84978
17+
describe.skip('lens rollup tests', () => {
1718
before(async () => {
1819
await esArchiver.loadIfNeeded('lens/rollup/data');
1920
await esArchiver.loadIfNeeded('lens/rollup/config');
@@ -24,7 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
2425
await esArchiver.unload('lens/rollup/config');
2526
});
2627

27-
it.skip('should allow creation of lens xy chart', async () => {
28+
it('should allow creation of lens xy chart', async () => {
2829
await PageObjects.visualize.navigateToNewVisualization();
2930
await PageObjects.visualize.clickVisType('lens');
3031
await PageObjects.lens.goToTimeRange();

0 commit comments

Comments
 (0)