diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/scripted_fields_table/scripted_fields_table.html b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/scripted_fields_table/scripted_fields_table.html index 46c3eb1ca50a..11cf13a34b96 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/scripted_fields_table/scripted_fields_table.html +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/scripted_fields_table/scripted_fields_table.html @@ -6,6 +6,48 @@

These scripted fields are computed on the fly from your data. They can be used in visualizations and displayed in your documents, however they can not be searched. You can manage them here and add new ones as you see fit, but be careful, scripts can be tricky!

+
+
+ + + Deprecation Warning + +
+ +
+
+ We've detected that the following deprecated languages are in use: {{ getDeprecatedLanguagesInUse().join(', ') }}. + Support for these languages will be removed in the next major version of Kibana and Elasticsearch. + We recommend converting your scripted fields to + Painless. +
+
+
+ +
+
+ + + Unsupported Languages + +
+ +
+
+ We've detected that the following unsupported languages are in use: {{ getUnsupportedLanguagesInUse().join(', ') }}. + All scripted fields should be converted to Painless. +
+
+
+ +
+
+ + + Deprecation Warning + +
+ +
+
diff --git a/src/ui/public/field_editor/field_editor.js b/src/ui/public/field_editor/field_editor.js index 7083719eb5b7..2da58a5f8a9c 100644 --- a/src/ui/public/field_editor/field_editor.js +++ b/src/ui/public/field_editor/field_editor.js @@ -8,7 +8,11 @@ import { uiModules } from 'ui/modules'; import fieldEditorTemplate from 'ui/field_editor/field_editor.html'; import '../directives/documentation_href'; import './field_editor.less'; -import { GetEnabledScriptingLanguagesProvider, getSupportedScriptingLanguages } from '../scripting_languages'; +import { + GetEnabledScriptingLanguagesProvider, + getSupportedScriptingLanguages, + getDeprecatedScriptingLanguages +} from '../scripting_languages'; import { getKbnTypeNames } from '../../../utils'; uiModules @@ -38,7 +42,7 @@ uiModules const notify = new Notifier({ location: 'Field Editor' }); getScriptingLangs().then((langs) => { - self.scriptingLangs = _.intersection(langs, ['expression', 'painless']); + self.scriptingLangs = langs; if (!_.includes(self.scriptingLangs, self.field.lang)) { self.field.lang = undefined; } @@ -103,6 +107,10 @@ uiModules ); }; + self.isDeprecatedLang = function (lang) { + return _.contains(getDeprecatedScriptingLanguages(), lang); + }; + $scope.$watch('editor.selectedFormatId', function (cur, prev) { const format = self.field.format; const changedFormat = cur !== prev; @@ -179,7 +187,7 @@ uiModules function getScriptingLangs() { return getEnabledScriptingLanguages() .then((enabledLanguages) => { - return _.intersection(enabledLanguages, getSupportedScriptingLanguages()); + return _.intersection(enabledLanguages, _.union(getSupportedScriptingLanguages(), getDeprecatedScriptingLanguages())); }); } diff --git a/src/ui/public/scripting_languages/index.js b/src/ui/public/scripting_languages/index.js index 74a38bf0f249..f773baa34488 100644 --- a/src/ui/public/scripting_languages/index.js +++ b/src/ui/public/scripting_languages/index.js @@ -4,7 +4,11 @@ import { Notifier } from 'ui/notify/notifier'; const notify = new Notifier({ location: 'Scripting Language Service' }); export function getSupportedScriptingLanguages() { - return ['expression', 'painless']; + return ['painless']; +} + +export function getDeprecatedScriptingLanguages() { + return ['expression']; } export function GetEnabledScriptingLanguagesProvider($http) {