+ i18n-default-message="Support for time-interval based index patterns has been removed! In the next major version of Kibana these index patterns will stop working. Migrate this index pattern to a wildcard pattern by specifying the new pattern below.">
+
+
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.js b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.js
index 9fe6df00caa28..8aa281f16572a 100644
--- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.js
+++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.js
@@ -198,6 +198,16 @@ uiModules.get('apps/management')
updateScriptedFieldsTable($scope, $state);
});
+ $scope.migration = {
+ isMigrating: false,
+ newTitle: $scope.indexPattern.getIndex()
+ };
+ $scope.migrate = async function () {
+ $scope.migration.isMigrating = true;
+ await $scope.indexPattern.migrate($scope.migration.newTitle);
+ $scope.migration.isMigrating = false;
+ };
+
$scope.refreshFilters = function () {
const indexedFieldTypes = [];
const scriptedFieldLanguages = [];
diff --git a/src/legacy/core_plugins/kibana/ui_setting_defaults.js b/src/legacy/core_plugins/kibana/ui_setting_defaults.js
index e2756d3cf1094..4b02c27f3f66b 100644
--- a/src/legacy/core_plugins/kibana/ui_setting_defaults.js
+++ b/src/legacy/core_plugins/kibana/ui_setting_defaults.js
@@ -600,17 +600,6 @@ export function getUiSettingDefaults() {
'patterns from which to query the field mapping',
}),
},
- 'indexPatterns:warnAboutUnsupportedTimePatterns': {
- name: i18n.translate('kbn.advancedSettings.indexPattern.unsupportedTimePatternWarningTitle', {
- defaultMessage: 'Time pattern warning',
- }),
- value: false,
- description: i18n.translate('kbn.advancedSettings.indexPattern.unsupportedTimePatternWarningText', {
- defaultMessage:
- 'When an index pattern is using the now unsupported "time pattern" format, a warning will ' +
- 'be displayed once per session that is using this pattern. Set this to false to disable that warning.',
- }),
- },
'format:defaultTypeMap': {
name: i18n.translate('kbn.advancedSettings.format.defaultTypeMapTitle', {
defaultMessage: 'Field type format name',
diff --git a/src/legacy/ui/public/courier/fetch/request/serialize_fetch_params/__tests__/serialize_fetch_params.js b/src/legacy/ui/public/courier/fetch/request/serialize_fetch_params/__tests__/serialize_fetch_params.js
deleted file mode 100644
index 47c50d726c9fc..0000000000000
--- a/src/legacy/ui/public/courier/fetch/request/serialize_fetch_params/__tests__/serialize_fetch_params.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import ngMock from 'ng_mock';
-import expect from '@kbn/expect';
-
-import StubIndexPatternProvider from 'test_utils/stub_index_pattern';
-
-import { SerializeFetchParamsProvider } from '../serialize_fetch_params_provider';
-
-describe('SerializeFetchParamsProvider', () => {
- let serializeFetchParams;
- let IndexPattern;
-
- require('test_utils/no_digest_promises').activateForSuite();
-
- beforeEach(ngMock.module('kibana'));
- beforeEach(ngMock.inject((Private) => {
- serializeFetchParams = Private(SerializeFetchParamsProvider);
- IndexPattern = Private(StubIndexPatternProvider);
- }));
-
- describe('when passed IndexPatterns', () => {
- it(' that are out of range, queries .kibana', () => {
- // Check out https://github.com/elastic/kibana/issues/10905 for the reasons behind this
- // test. When an IndexPattern is out of time range, it returns an array that is then stored in a cache. This
- // cached object was being modified in a following function, which was a subtle side affect - it looked like
- // only a local change.
- const indexPattern = new IndexPattern('logstash-*', null, []);
- // Stub the call so it looks like the request returns an empty list, which will happen if the time range
- // selected doesn't contain any data for the particular index.
- indexPattern.toIndexList = () => Promise.resolve([]);
- const reqsFetchParams = [
- {
- index: indexPattern,
- type: 'planet',
- search_type: 'water',
- body: { foo: 'earth' }
- },
- {
- index: indexPattern,
- type: 'planet',
- search_type: 'rings',
- body: { foo: 'saturn' }
- }
- ];
- return serializeFetchParams(reqsFetchParams).then(value => {
- const indexLineMatch = value.match(/"index":\[".kibana"\]/g);
- expect(indexLineMatch).to.not.be(null);
- expect(indexLineMatch.length).to.be(2);
- const queryLineMatch = value.match(/"query":\{"bool":\{"must_not":\[\{"match_all":\{\}\}\]\}\}/g);
- expect(queryLineMatch).to.not.be(null);
- expect(queryLineMatch.length).to.be(2);
- });
- });
- });
-});
diff --git a/src/legacy/ui/public/courier/fetch/request/serialize_fetch_params/serialize_fetch_params.js b/src/legacy/ui/public/courier/fetch/request/serialize_fetch_params/serialize_fetch_params.js
index 612bbf10aa06c..bafa4f83a2011 100644
--- a/src/legacy/ui/public/courier/fetch/request/serialize_fetch_params/serialize_fetch_params.js
+++ b/src/legacy/ui/public/courier/fetch/request/serialize_fetch_params/serialize_fetch_params.js
@@ -17,81 +17,30 @@
* under the License.
*/
-import _ from 'lodash';
-
-function emptySearch() {
- return {
- query: {
- bool: {
- must_not: [
- { match_all: {} }
- ]
- }
- }
- };
-}
-
/**
*
* @param requestsFetchParams {Array.