From 1119414b496ae4cf9ba5d7d8f44fd76a129af781 Mon Sep 17 00:00:00 2001 From: Spencer Date: Tue, 13 Jun 2017 17:22:41 -0700 Subject: [PATCH] [indexPatterns] remove support for time patterns (#12158) * [indexPatterns] remove support for time patterns * Revert "[indexPatterns] remove support for time patterns" This reverts commit 4263e37c665dd1600b306871d915868d7aaca4cd. * [indexPatterns] remove ability to create time-based patterns * [indexPattern/routes] fix export of routes for stub * [Storage] export Storage class for testing * [indexPatterns/unsupportedTimePatterns] add tests * [indexPatterns] focus warning check module * [indexPatterns/tests] fix method name * add metion of this change to migration docs * disable warnings by default until we have a migration tool * prevent the warning from disapearing * fix grammar * enabled warnings in the tests --- docs/migration/migrate_6_0.asciidoc | 6 + .../__tests__/create_index_pattern.js | 52 ----- .../create_index_pattern.html | 211 ------------------ .../create_index_pattern.js | 139 +----------- .../send_create_index_pattern_request.js | 2 - .../edit_index_pattern.html | 12 +- .../kibana/ui_setting_defaults.js | 5 + src/server/index_patterns/mixin.js | 2 - src/server/index_patterns/routes/index.js | 1 - .../routes/test_time_pattern_route.js | 22 -- .../service/index_patterns_service.js | 28 --- .../index_patterns/service/lib/index.js | 2 +- src/test_utils/public/stub_index_pattern.js | 4 +- .../__tests__/_index_pattern.js | 52 +++++ .../stub_index_patterns_api_client.js | 4 - .../__tests__/unsupported_time_patterns.js | 76 +++++++ .../public/index_patterns/_index_pattern.js | 38 +++- .../public/index_patterns/fields_fetcher.js | 6 - .../index_patterns_api_client.js | 14 -- .../unsupported_time_patterns.js | 28 +++ src/ui/public/storage/storage.js | 2 +- .../apis/index_patterns/index.js | 1 - .../index_patterns/test_time_pattern_route.js | 53 ----- .../apps/management/_initial_state.js | 7 - test/functional/page_objects/settings_page.js | 5 - 25 files changed, 210 insertions(+), 562 deletions(-) delete mode 100644 src/server/index_patterns/routes/test_time_pattern_route.js create mode 100644 src/ui/public/index_patterns/__tests__/unsupported_time_patterns.js create mode 100644 src/ui/public/index_patterns/unsupported_time_patterns.js delete mode 100644 test/api_integration/apis/index_patterns/test_time_pattern_route.js diff --git a/docs/migration/migrate_6_0.asciidoc b/docs/migration/migrate_6_0.asciidoc index 84483742037a..34211219ad36 100644 --- a/docs/migration/migrate_6_0.asciidoc +++ b/docs/migration/migrate_6_0.asciidoc @@ -52,3 +52,9 @@ This is no longer the case. Now, only commas are a valid query separator: e.g. ` *Details:* In Kibana 4.2, we renamed all configuration names in kibana.yml to use `.` as a separator instead of `_`, though the legacy configurations would still continue to work. In 5.0, we started logging deprecation notices whenever the legacy configurations were encountered. In 6.0 onward, legacy configuration names that use an underscore instead of a dot will no longer work. *Impact:* Any usages of underscore separated configuration names in kibana.yml need to be updated to their modern equivalents. See <> for accepted configurations. + +[float] +=== Time-interval based index patterns are no longer supported +*Details:* Starting in Kibana 6.0.0 we removed the ability to create index patterns that use a date-pattern and interval to identify Elasticsearch indices. Index patterns must now use wildcards which are more performant in most cases. + +*Impact:* Existing index patterns and saved objects will continue to function without issue, and in a subsequent release we will provide utilities to migrate your index patterns/saved objects. \ No newline at end of file diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern/__tests__/create_index_pattern.js b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern/__tests__/create_index_pattern.js index 122bed1668c4..f29a6be44cd9 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern/__tests__/create_index_pattern.js +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern/__tests__/create_index_pattern.js @@ -28,7 +28,6 @@ describe('createIndexPattern UI', () => { beforeEach(ngMock.inject(($injector) => { setup = function () { const Private = $injector.get('Private'); - const Promise = $injector.get('Promise'); const $compile = $injector.get('$compile'); const $rootScope = $injector.get('$rootScope'); @@ -39,12 +38,6 @@ describe('createIndexPattern UI', () => { trash.push(() => $scope.$destroy()); $scope.$apply(); - // prevents errors when switching to time pattern - indexPatternsApiClient.testTimePattern = sinon.spy(() => Promise.resolve({ - all: ['logstash-0', 'logstash-2017.01.01'], - matches: ['logstash-2017.01.01'], - })); - const setNameTo = (name) => { $view.findTestSubject('createIndexPatternNameInput') .val(name) @@ -122,13 +115,6 @@ describe('createIndexPattern UI', () => { expect($enableExpand).to.have.length(1); expect($enableExpand.is(':checked')).to.be(false); }); - - it('displays the option (off) to use time patterns', () => { - const { $view } = setup(); - const $enableTimePattern = $view.findTestSubject('createIndexPatternNameIsPatternCheckBox'); - expect($enableTimePattern).to.have.length(1); - expect($enableTimePattern.is(':checked')).to.be(false); - }); }); describe('cross cluster pattern', () => { @@ -149,43 +135,5 @@ describe('createIndexPattern UI', () => { const $enableExpand = $view.findTestSubject('createIndexPatternEnableExpand'); expect($enableExpand).to.have.length(0); }); - - it('removes the option to use time patterns', () => { - const { $view, setNameTo } = setup(); - setNameTo('cluster2:logstash-*'); - - const $enableTimePattern = $view.findTestSubject('createIndexPatternNameIsPatternCheckBox'); - expect($enableTimePattern).to.have.length(0); - }); - }); - - describe('expand selected', () => { - it('removes the option to use time patterns', () => { - const { $view } = setup(); - - const { controller } = $view.findTestSubject('createIndexPatternContainer').scope(); - const $enableExpand = $view.findTestSubject('createIndexPatternEnableExpand'); - expect($enableExpand).to.have.length(1); - $enableExpand.click(); - expect(controller.isExpandWildcardEnabled()).to.be(true); - - const $enableTimePattern = $view.findTestSubject('createIndexPatternNameIsPatternCheckBox'); - expect($enableTimePattern).to.have.length(0); - }); - }); - - describe('time pattern selected', () => { - it('removes the option to use wildcard expansion', () => { - const { $view } = setup(); - - const { controller } = $view.findTestSubject('createIndexPatternContainer').scope(); - const $enableTimePattern = $view.findTestSubject('createIndexPatternNameIsPatternCheckBox'); - expect($enableTimePattern).to.have.length(1); - $enableTimePattern.click(); - expect(controller.formValues.nameIsPattern).to.be(true); - - const $enableExpand = $view.findTestSubject('createIndexPatternEnableExpand'); - expect($enableExpand).to.have.length(0); - }); }); }); diff --git a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern/create_index_pattern.html b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern/create_index_pattern.html index a24193fc1b4f..5bc4f9ec4033 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern/create_index_pattern.html +++ b/src/core_plugins/kibana/public/management/sections/indices/create_index_pattern/create_index_pattern.html @@ -61,37 +61,8 @@

- -

- — - -

- -

-   - - - -

@@ -160,188 +131,6 @@ - -
- -
- -
- -
-
- - -
- -
-
- - - -
-
-
- - -
- - -
- -
-
-
- - -
-
-
- - - {{err}} - -
-
- -
-
- - -
- -
-
- {{sample}} -
- -
- -
-
-
- - -
-
- - -
- -
-
- {{match}} -
- -
- -
-
-
- -
-
- - -
- -
-
- {{match}} -
-
- -
- - - -
-
-
-