From 8d12fceb5ddafb021be1f9e9462992e3dd7b038e Mon Sep 17 00:00:00 2001 From: sainthkh Date: Mon, 7 Oct 2019 13:04:00 +0900 Subject: [PATCH 1/9] De-angularized index_header --- .../index.js => components/index.ts} | 2 +- .../components/index_header.tsx | 94 +++++++++++++++++++ .../edit_index_pattern.html | 7 +- .../edit_index_pattern/edit_index_pattern.js | 37 +++++++- .../index_header/index_header.html | 59 ------------ .../index_header/index_header.js | 42 --------- 6 files changed, 132 insertions(+), 109 deletions(-) rename src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/{index_header/index.js => components/index.ts} (94%) create mode 100644 src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index_header.tsx delete mode 100644 src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index_header.html delete mode 100644 src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index_header.js diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index.js b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts similarity index 94% rename from src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index.js rename to src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts index 7c288286bd61e4..44c05a55b36f95 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts @@ -17,4 +17,4 @@ * under the License. */ -import './index_header'; +export { IndexHeader } from './index_header'; diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index_header.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index_header.tsx new file mode 100644 index 00000000000000..5e9809ef1124e7 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index_header.tsx @@ -0,0 +1,94 @@ +/* + * 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 React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiButtonEmpty, EuiIcon } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +interface Props { + defaultIndex: boolean; + indexPatternTitle: string; + setDefault: any; + refreshFields: any; + removePattern: any; +} + +export const IndexHeader = ({ + defaultIndex, + indexPatternTitle, + setDefault, + refreshFields, + removePattern, +}: Props) => { + return ( +
+ + + +

+ {defaultIndex ? : null} + {indexPatternTitle} +

+
+
+ + + setDefault()} + size="s" + aria-label={i18n.translate('kbn.management.editIndexPattern.setDefaultAria', { + defaultMessage: 'Set as default index', + })} + title={i18n.translate('kbn.management.editIndexPattern.setDefaultTooltip', { + defaultMessage: 'Set as default index', + })} + data-test-subj="setDefaultIndexPatternButton" + > + + + refreshFields()} + aria-label={i18n.translate('kbn.management.editIndexPattern.refreshAria', { + defaultMessage: 'Reload field list', + })} + title={i18n.translate('kbn.management.editIndexPattern.refreshTooltip', { + defaultMessage: 'Refresh field list', + })} + > + + + removePattern()} + aria-label={i18n.translate('kbn.management.editIndexPattern.removeAria', { + defaultMessage: 'Remove index pattern', + })} + title={i18n.translate('kbn.management.editIndexPattern.removeTooltip', { + defaultMessage: 'Remove index pattern', + })} + data-test-subj="deleteIndexPatternButton" + > + + + + +
+
+ ); +}; diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html index 4b3014fd28a51c..d5893878474b0f 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html @@ -7,12 +7,7 @@ aria-label="{{::'kbn.management.editIndexPattern.detailsAria' | i18n: { defaultMessage: 'Index pattern details' } }}" > - +

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 1eb56403d3a78e..0b30d228d77ff3 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 @@ -18,7 +18,6 @@ */ import _ from 'lodash'; -import './index_header'; import './create_edit_field'; import { docTitle } from 'ui/doc_title'; import { KbnUrlProvider } from 'ui/url'; @@ -36,12 +35,14 @@ import { IndexedFieldsTable } from './indexed_fields_table'; import { ScriptedFieldsTable } from './scripted_fields_table'; import { i18n } from '@kbn/i18n'; import { I18nContext } from 'ui/i18n'; +import { IndexHeader } from './components'; import { getEditBreadcrumbs } from '../breadcrumbs'; const REACT_SOURCE_FILTERS_DOM_ELEMENT_ID = 'reactSourceFiltersTable'; const REACT_INDEXED_FIELDS_DOM_ELEMENT_ID = 'reactIndexedFieldsTable'; const REACT_SCRIPTED_FIELDS_DOM_ELEMENT_ID = 'reactScriptedFieldsTable'; +const REACT_EDIT_INDEX_HEADER = 'reactEditIndexHeader'; function updateSourceFiltersTable($scope, $state) { if ($state.tab === 'sourceFilters') { @@ -157,6 +158,33 @@ function destroyIndexedFieldsTable() { node && unmountComponentAtNode(node); } +function updateIndexHeader($scope, config) { + $scope.$$postDigest(() => { + const node = document.getElementById(REACT_EDIT_INDEX_HEADER); + if (!node) { + return; + } + + render( + + + , + node + ); + }); +} + +function destoryIndexHeader() { + const node = document.getElementById(REACT_EDIT_INDEX_HEADER); + node && unmountComponentAtNode(node); +} + uiRoutes .when('/management/kibana/index_patterns/:indexPatternId', { template, @@ -185,6 +213,7 @@ uiModules.get('apps/management') $scope.indexPattern, $scope.indexPattern.id === config.get('defaultIndex') ); + config.bindToScope($scope, 'defaultIndex'); $scope.getFieldInfo = indexPatternListProvider.getFieldInfo; docTitle.change($scope.indexPattern.title); @@ -295,6 +324,10 @@ uiModules.get('apps/management') return $scope.indexPattern.save(); }; + $scope.$watch('defaultIndex', () => { + updateIndexHeader($scope, config); + }); + $scope.$watch('fieldFilter', () => { $scope.editSections = $scope.editSectionsProvider($scope.indexPattern, $scope.fieldFilter, indexPatternListProvider); if ($scope.fieldFilter === undefined) { @@ -326,8 +359,10 @@ uiModules.get('apps/management') $scope.$on('$destroy', () => { destroyIndexedFieldsTable(); destroyScriptedFieldsTable(); + destoryIndexHeader(); }); + updateIndexHeader($scope, config); updateScriptedFieldsTable($scope, $state); updateSourceFiltersTable($scope, $state); }); diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index_header.html b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index_header.html deleted file mode 100644 index d6b91d96f13d34..00000000000000 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index_header.html +++ /dev/null @@ -1,59 +0,0 @@ -

-
- -

- - {{indexPattern.title}} -

-
- -
- - - - - -
-
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index_header.js b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index_header.js deleted file mode 100644 index 80435b8d20f259..00000000000000 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index_header.js +++ /dev/null @@ -1,42 +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 { uiModules } from 'ui/modules'; -import template from './index_header.html'; -uiModules - .get('apps/management') - .directive('kbnManagementIndexPatternsHeader', function (config) { - return { - restrict: 'E', - template, - replace: true, - scope: { - indexPattern: '=', - setDefault: '&', - refreshFields: '&', - delete: '&', - }, - link: function ($scope, $el, attrs) { - $scope.delete = attrs.delete ? $scope.delete : null; - $scope.setDefault = attrs.setDefault ? $scope.setDefault : null; - $scope.refreshFields = attrs.refreshFields ? $scope.refreshFields : null; - config.bindToScope($scope, 'defaultIndex'); - } - }; - }); From eb3aa1f7a554783cae25ec84b12c2b57f3ca1644 Mon Sep 17 00:00:00 2001 From: sainthkh Date: Mon, 7 Oct 2019 14:08:51 +0900 Subject: [PATCH 2/9] De-angularized texts. --- .../edit_index_pattern/components/alerts.tsx | 49 ++++++++++++++ .../edit_index_pattern/components/badges.tsx | 53 +++++++++++++++ .../components/guide_text.tsx | 54 +++++++++++++++ .../edit_index_pattern/components/index.ts | 3 + .../edit_index_pattern.html | 67 +------------------ .../edit_index_pattern/edit_index_pattern.js | 30 ++++++--- 6 files changed, 181 insertions(+), 75 deletions(-) create mode 100644 src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/alerts.tsx create mode 100644 src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/badges.tsx create mode 100644 src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/guide_text.tsx diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/alerts.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/alerts.tsx new file mode 100644 index 00000000000000..4dee95351031b8 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/alerts.tsx @@ -0,0 +1,49 @@ +/* + * 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 React from 'react'; +import { EuiCallOut } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; + +interface Props { + conflictFields: any; +} + +export const Alerts = ({ conflictFields }: Props) => { + return ( + + } + color="warning" + iconType="bolt" + > + + + ); +}; diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/badges.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/badges.tsx new file mode 100644 index 00000000000000..badd00f4512d2f --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/badges.tsx @@ -0,0 +1,53 @@ +/* + * 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 React from 'react'; +import { EuiBadge } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; + +interface Props { + indexPattern: any; +} + +export const Badges = ({ indexPattern }: Props) => { + return ( +

+ {indexPattern.timeFieldName ? ( + + + + ) : null} + {indexPattern.tags && indexPattern.tags.length + ? indexPattern.tags.map((tag: any, i: number) => { + return ( + + {tag.name} + + ); + }) + : null} +

+ ); +}; diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/guide_text.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/guide_text.tsx new file mode 100644 index 00000000000000..42cd8980b5368e --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/guide_text.tsx @@ -0,0 +1,54 @@ +/* + * 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 React from 'react'; +import { EuiText, EuiLink, EuiIcon } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; + +interface Props { + indexPattern: any; +} + +export const GuideText = ({ indexPattern }: Props) => { + return ( + +

+ {indexPattern.title}, + apiLink: ( + + + + + ), + }} + /> +

+
+ ); +}; diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts index 44c05a55b36f95..0404ea4be856f4 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts @@ -18,3 +18,6 @@ */ export { IndexHeader } from './index_header'; +export { Badges } from './badges'; +export { GuideText } from './guide_text'; +export { Alerts } from './alerts'; diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html index d5893878474b0f..8cae01350fe02b 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html @@ -6,72 +6,7 @@ role="region" aria-label="{{::'kbn.management.editIndexPattern.detailsAria' | i18n: { defaultMessage: 'Index pattern details' } }}" > - -
- -
-

- - - - - - - - - - - - - - - {{tag.name}} - - - - -

- -
- -
-

- - - - - -

-
- -
- - -
-
- - -
- -
-
- -
-
-
+
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 0b30d228d77ff3..d75cc64526fe41 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 @@ -35,14 +35,15 @@ import { IndexedFieldsTable } from './indexed_fields_table'; import { ScriptedFieldsTable } from './scripted_fields_table'; import { i18n } from '@kbn/i18n'; import { I18nContext } from 'ui/i18n'; -import { IndexHeader } from './components'; +import { EuiSpacer } from '@elastic/eui'; +import { IndexHeader, Badges, GuideText, Alerts } from './components'; import { getEditBreadcrumbs } from '../breadcrumbs'; const REACT_SOURCE_FILTERS_DOM_ELEMENT_ID = 'reactSourceFiltersTable'; const REACT_INDEXED_FIELDS_DOM_ELEMENT_ID = 'reactIndexedFieldsTable'; const REACT_SCRIPTED_FIELDS_DOM_ELEMENT_ID = 'reactScriptedFieldsTable'; -const REACT_EDIT_INDEX_HEADER = 'reactEditIndexHeader'; +const REACT_EDIT_INDEX_REACT_COMPONENT = 'editIndexReactComponent'; function updateSourceFiltersTable($scope, $state) { if ($state.tab === 'sourceFilters') { @@ -158,9 +159,9 @@ function destroyIndexedFieldsTable() { node && unmountComponentAtNode(node); } -function updateIndexHeader($scope, config) { +function updateReactComponent($scope, config) { $scope.$$postDigest(() => { - const node = document.getElementById(REACT_EDIT_INDEX_HEADER); + const node = document.getElementById(REACT_EDIT_INDEX_REACT_COMPONENT); if (!node) { return; } @@ -174,14 +175,25 @@ function updateIndexHeader($scope, config) { refreshFields={$scope.refreshFields} removePattern={$scope.removePattern} /> + + + {$scope.indexPattern.timeFieldName || ($scope.indexPattern.tags && $scope.indexPattern.tags.length) ? ( + + ) : null} + + + + + + {$scope.conflictFields.length > 0 ? : null} , node ); }); } -function destoryIndexHeader() { - const node = document.getElementById(REACT_EDIT_INDEX_HEADER); +function destoryReactComponent() { + const node = document.getElementById(REACT_EDIT_INDEX_REACT_COMPONENT); node && unmountComponentAtNode(node); } @@ -325,7 +337,7 @@ uiModules.get('apps/management') }; $scope.$watch('defaultIndex', () => { - updateIndexHeader($scope, config); + updateReactComponent($scope, config); }); $scope.$watch('fieldFilter', () => { @@ -359,10 +371,10 @@ uiModules.get('apps/management') $scope.$on('$destroy', () => { destroyIndexedFieldsTable(); destroyScriptedFieldsTable(); - destoryIndexHeader(); + destoryReactComponent(); }); - updateIndexHeader($scope, config); + updateReactComponent($scope, config); updateScriptedFieldsTable($scope, $state); updateSourceFiltersTable($scope, $state); }); From ecfd2eb6756dec7e029897ee577082cb9e013dab Mon Sep 17 00:00:00 2001 From: sainthkh Date: Mon, 7 Oct 2019 18:29:46 +0900 Subject: [PATCH 3/9] De-angularized filters. --- .../edit_index_pattern.html | 51 -------------- .../edit_index_pattern/edit_index_pattern.js | 69 ++++++++++++++++++- 2 files changed, 68 insertions(+), 52 deletions(-) diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html index 8cae01350fe02b..98b92182e22e8a 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html @@ -32,57 +32,6 @@
- -
-
-
- - -
-
- -
- -
- -
- -
-
-
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 d75cc64526fe41..b7da8484193516 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 @@ -35,7 +35,7 @@ import { IndexedFieldsTable } from './indexed_fields_table'; import { ScriptedFieldsTable } from './scripted_fields_table'; import { i18n } from '@kbn/i18n'; import { I18nContext } from 'ui/i18n'; -import { EuiSpacer } from '@elastic/eui'; +import { EuiSpacer, EuiFieldSearch, EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui'; import { IndexHeader, Badges, GuideText, Alerts } from './components'; import { getEditBreadcrumbs } from '../breadcrumbs'; @@ -45,6 +45,22 @@ const REACT_INDEXED_FIELDS_DOM_ELEMENT_ID = 'reactIndexedFieldsTable'; const REACT_SCRIPTED_FIELDS_DOM_ELEMENT_ID = 'reactScriptedFieldsTable'; const REACT_EDIT_INDEX_REACT_COMPONENT = 'editIndexReactComponent'; +const SearchField = ({ $scope }) => { + return ( + { + $scope.fieldFilter = event.target.value; + $scope.$apply(); + }} + /> + ); +}; + function updateSourceFiltersTable($scope, $state) { if ($state.tab === 'sourceFilters') { $scope.$$postDigest(() => { @@ -55,6 +71,11 @@ function updateSourceFiltersTable($scope, $state) { render( + + + + + + + + + + {$scope.scriptedFieldLanguages.length > 0 ? + + ({ value: t, text: t })))} + value={$scope.scriptedFieldLanguageFilter} + onChange={event => { + $scope.scriptedFieldLanguageFilter = event.target.value; + $scope.$apply(); + }} + data-test-subj="scriptedFieldLanguageFilterDropdown" + /> + + : null + } + + + + + + {$scope.indexedFieldTypes.length > 0 ? + + ({ value: t, text: t })))} + value={$scope.indexedFieldTypeFilter} + onChange={event => { + $scope.indexedFieldTypeFilter = event.target.value; + $scope.$apply(); + }} + data-test-subj="indexedFieldTypeFilterDropdown" + /> + + : null + } + Date: Mon, 7 Oct 2019 19:29:14 +0900 Subject: [PATCH 4/9] De-angularized tabs. --- .../edit_index_pattern/components/index.ts | 1 + .../components/search_field.tsx | 46 ++++ .../edit_index_pattern/components/tabs.tsx | 186 +++++++++++++++ .../edit_index_pattern.html | 33 --- .../edit_index_pattern/edit_index_pattern.js | 215 +----------------- 5 files changed, 240 insertions(+), 241 deletions(-) create mode 100644 src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/search_field.tsx create mode 100644 src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts index 0404ea4be856f4..e715a7a4b89cb9 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts @@ -21,3 +21,4 @@ export { IndexHeader } from './index_header'; export { Badges } from './badges'; export { GuideText } from './guide_text'; export { Alerts } from './alerts'; +export { Tabs } from './tabs'; diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/search_field.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/search_field.tsx new file mode 100644 index 00000000000000..8798143b23be7d --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/search_field.tsx @@ -0,0 +1,46 @@ +/* + * 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 React from 'react'; +import { EuiFieldSearch } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +interface Props { + $scope: any; +} + +export const SearchField = ({ $scope }: Props) => { + return ( + { + $scope.fieldFilter = event.target.value; + $scope.$apply(); + }} + /> + ); +}; diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx new file mode 100644 index 00000000000000..f017129a3c0982 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx @@ -0,0 +1,186 @@ +/* + * 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 React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiSelect, EuiTabbedContent, EuiSpacer } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { SearchField } from './search_field'; +// @ts-ignore +import { IndexedFieldsTable } from '../indexed_fields_table'; +// @ts-ignore +import { ScriptedFieldsTable } from '../scripted_fields_table'; +// @ts-ignore +import { SourceFiltersTable } from '../source_filters_table'; + +interface Props { + $scope: any; +} + +export const Tabs = ({ $scope }: Props) => { + const tabs = tabContents.map(tab => { + const section = $scope.editSections.find((s: any) => s.index === tab.index); + return { + id: tab.index, + name: `${section.title} (${ + section.count !== section.totalCount + ? `${section.count} / ${section.totalCount}` + : `${section.count}` + })`, + content: tab.content($scope), + 'data-test-subj': `tab-${tab.index}`, + }; + }); + + return ; +}; + +const tabContents = [ + { + index: 'indexedFields', + content: ($scope: any) => ( + <> + + + + + + {$scope.indexedFieldTypes.length > 0 ? ( + + ({ value: t, text: t })))} + value={$scope.indexedFieldTypeFilter} + onChange={event => { + $scope.indexedFieldTypeFilter = event.target.value; + $scope.$apply(); + }} + data-test-subj="indexedFieldTypeFilterDropdown" + /> + + ) : null} + + { + $scope.kbnUrl.redirectToRoute(obj, route); + $scope.$apply(); + }, + getFieldInfo: $scope.getFieldInfo, + }} + /> + + ), + }, + { + index: 'scriptedFields', + content: ($scope: any) => ( + <> + + + + + {$scope.scriptedFieldLanguages.length > 0 ? ( + + ({ value: t, text: t })))} + value={$scope.scriptedFieldLanguageFilter} + onChange={event => { + $scope.scriptedFieldLanguageFilter = event.target.value; + $scope.$apply(); + }} + data-test-subj="scriptedFieldLanguageFilterDropdown" + /> + + ) : null} + + { + $scope.kbnUrl.redirectToRoute(obj, route); + $scope.$apply(); + }, + getRouteHref: (obj: any, route: any) => $scope.kbnUrl.getRouteHref(obj, route), + }} + onRemoveField={() => { + $scope.editSections = $scope.editSectionsProvider( + $scope.indexPattern, + $scope.fieldFilter, + $scope.indexPatternListProvider + ); + $scope.refreshFilters(); + $scope.$apply(); + }} + /> + + ), + }, + { + index: 'sourceFilters', + content: ($scope: any) => ( + <> + + + + + + { + $scope.editSections = $scope.editSectionsProvider( + $scope.indexPattern, + $scope.fieldFilter, + $scope.indexPatternListProvider + ); + $scope.refreshFilters(); + $scope.$apply(); + }} + /> + + ), + }, +]; diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html index 98b92182e22e8a..5c1fdba3a2fd77 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.html @@ -7,39 +7,6 @@ aria-label="{{::'kbn.management.editIndexPattern.detailsAria' | i18n: { defaultMessage: 'Index pattern details' } }}" >
- - -
- -
- - -
-
- -
- -
-
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 b7da8484193516..d6bdf8fa78c190 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 @@ -30,202 +30,15 @@ import { FieldWildcardProvider } from 'ui/field_wildcard'; import { IndexPatternListFactory } from 'ui/management/index_pattern_list'; import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { SourceFiltersTable } from './source_filters_table'; -import { IndexedFieldsTable } from './indexed_fields_table'; -import { ScriptedFieldsTable } from './scripted_fields_table'; import { i18n } from '@kbn/i18n'; import { I18nContext } from 'ui/i18n'; -import { EuiSpacer, EuiFieldSearch, EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui'; -import { IndexHeader, Badges, GuideText, Alerts } from './components'; +import { EuiSpacer } from '@elastic/eui'; +import { IndexHeader, Badges, GuideText, Alerts, Tabs } from './components'; import { getEditBreadcrumbs } from '../breadcrumbs'; -const REACT_SOURCE_FILTERS_DOM_ELEMENT_ID = 'reactSourceFiltersTable'; -const REACT_INDEXED_FIELDS_DOM_ELEMENT_ID = 'reactIndexedFieldsTable'; -const REACT_SCRIPTED_FIELDS_DOM_ELEMENT_ID = 'reactScriptedFieldsTable'; const REACT_EDIT_INDEX_REACT_COMPONENT = 'editIndexReactComponent'; -const SearchField = ({ $scope }) => { - return ( - { - $scope.fieldFilter = event.target.value; - $scope.$apply(); - }} - /> - ); -}; - -function updateSourceFiltersTable($scope, $state) { - if ($state.tab === 'sourceFilters') { - $scope.$$postDigest(() => { - const node = document.getElementById(REACT_SOURCE_FILTERS_DOM_ELEMENT_ID); - if (!node) { - return; - } - - render( - - - - - - - { - $scope.editSections = $scope.editSectionsProvider($scope.indexPattern, $scope.fieldFilter, $scope.indexPatternListProvider); - $scope.refreshFilters(); - $scope.$apply(); - }} - /> - , - node, - ); - }); - } else { - destroySourceFiltersTable(); - } -} - -function destroySourceFiltersTable() { - const node = document.getElementById(REACT_SOURCE_FILTERS_DOM_ELEMENT_ID); - node && unmountComponentAtNode(node); -} - - -function updateScriptedFieldsTable($scope, $state) { - if ($state.tab === 'scriptedFields') { - $scope.$$postDigest(() => { - const node = document.getElementById(REACT_SCRIPTED_FIELDS_DOM_ELEMENT_ID); - if (!node) { - return; - } - - render( - - - - - - {$scope.scriptedFieldLanguages.length > 0 ? - - ({ value: t, text: t })))} - value={$scope.scriptedFieldLanguageFilter} - onChange={event => { - $scope.scriptedFieldLanguageFilter = event.target.value; - $scope.$apply(); - }} - data-test-subj="scriptedFieldLanguageFilterDropdown" - /> - - : null - } - - { - $scope.kbnUrl.redirectToRoute(obj, route); - $scope.$apply(); - }, - getRouteHref: (obj, route) => $scope.kbnUrl.getRouteHref(obj, route), - }} - onRemoveField={() => { - $scope.editSections = $scope.editSectionsProvider($scope.indexPattern, $scope.fieldFilter, $scope.indexPatternListProvider); - $scope.refreshFilters(); - $scope.$apply(); - }} - /> - , - node, - ); - }); - } else { - destroyScriptedFieldsTable(); - } -} - -function destroyScriptedFieldsTable() { - const node = document.getElementById(REACT_SCRIPTED_FIELDS_DOM_ELEMENT_ID); - node && unmountComponentAtNode(node); -} - -function updateIndexedFieldsTable($scope, $state) { - if ($state.tab === 'indexedFields') { - $scope.$$postDigest(() => { - const node = document.getElementById(REACT_INDEXED_FIELDS_DOM_ELEMENT_ID); - if (!node) { - return; - } - - render( - - - - - - {$scope.indexedFieldTypes.length > 0 ? - - ({ value: t, text: t })))} - value={$scope.indexedFieldTypeFilter} - onChange={event => { - $scope.indexedFieldTypeFilter = event.target.value; - $scope.$apply(); - }} - data-test-subj="indexedFieldTypeFilterDropdown" - /> - - : null - } - - { - $scope.kbnUrl.redirectToRoute(obj, route); - $scope.$apply(); - }, - getFieldInfo: $scope.getFieldInfo, - }} - /> - , - node, - ); - }); - } else { - destroyIndexedFieldsTable(); - } -} - -function destroyIndexedFieldsTable() { - const node = document.getElementById(REACT_INDEXED_FIELDS_DOM_ELEMENT_ID); - node && unmountComponentAtNode(node); -} - function updateReactComponent($scope, config) { $scope.$$postDigest(() => { const node = document.getElementById(REACT_EDIT_INDEX_REACT_COMPONENT); @@ -253,6 +66,8 @@ function updateReactComponent($scope, config) { {$scope.conflictFields.length > 0 ? : null} + + , node ); @@ -304,8 +119,6 @@ uiModules.get('apps/management') $scope.editSections = $scope.editSectionsProvider($scope.indexPattern, $scope.fieldFilter, indexPatternListProvider); $scope.refreshFilters(); $scope.fields = $scope.indexPattern.getNonScriptedFields(); - updateIndexedFieldsTable($scope, $state); - updateScriptedFieldsTable($scope, $state); }); $scope.refreshFilters = function () { @@ -329,9 +142,6 @@ uiModules.get('apps/management') $scope.changeTab = function (obj) { $state.tab = obj.index; - updateIndexedFieldsTable($scope, $state); - updateScriptedFieldsTable($scope, $state); - updateSourceFiltersTable($scope, $state); $state.save(); }; @@ -413,35 +223,24 @@ uiModules.get('apps/management') return; } - switch($state.tab) { - case 'indexedFields': - updateIndexedFieldsTable($scope, $state); - case 'scriptedFields': - updateScriptedFieldsTable($scope, $state); - case 'sourceFilters': - updateSourceFiltersTable($scope, $state); - } + updateReactComponent($scope, config); }); $scope.$watch('indexedFieldTypeFilter', () => { if ($scope.indexedFieldTypeFilter !== undefined && $state.tab === 'indexedFields') { - updateIndexedFieldsTable($scope, $state); + updateReactComponent($scope, config); } }); $scope.$watch('scriptedFieldLanguageFilter', () => { if ($scope.scriptedFieldLanguageFilter !== undefined && $state.tab === 'scriptedFields') { - updateScriptedFieldsTable($scope, $state); + updateReactComponent($scope, config); } }); $scope.$on('$destroy', () => { - destroyIndexedFieldsTable(); - destroyScriptedFieldsTable(); destoryReactComponent(); }); updateReactComponent($scope, config); - updateScriptedFieldsTable($scope, $state); - updateSourceFiltersTable($scope, $state); }); From 10f85f6f72e0befb6cdab78427ef005bc2de990a Mon Sep 17 00:00:00 2001 From: sainthkh Date: Tue, 8 Oct 2019 10:24:15 +0900 Subject: [PATCH 5/9] Made SearchField controlled component. --- .../edit_index_pattern/components/search_field.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/search_field.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/search_field.tsx index 8798143b23be7d..aa97f801df2915 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/search_field.tsx +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/search_field.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React from 'react'; +import React, { useState } from 'react'; import { EuiFieldSearch } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -26,6 +26,8 @@ interface Props { } export const SearchField = ({ $scope }: Props) => { + const [text, setText] = useState($scope.fieldFilter || ''); + return ( { defaultMessage: 'Filter', })} data-test-subj="indexPatternFieldFilter" - value={$scope.fieldFilter} + value={text} onChange={event => { - $scope.fieldFilter = event.target.value; + const newText = event.target.value; + setText(newText); + $scope.fieldFilter = newText; $scope.$apply(); }} /> From e9ef754d596cec3621517a587810e20206dd44d7 Mon Sep 17 00:00:00 2001 From: sainthkh Date: Tue, 8 Oct 2019 10:56:32 +0900 Subject: [PATCH 6/9] Add EuiSpacer for scripted fields and source filter tabs. --- .../index_patterns/edit_index_pattern/components/tabs.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx index f017129a3c0982..381d372a427d2f 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx @@ -105,6 +105,7 @@ const tabContents = [ index: 'scriptedFields', content: ($scope: any) => ( <> + @@ -161,6 +162,7 @@ const tabContents = [ index: 'sourceFilters', content: ($scope: any) => ( <> + From 463ccbf668e8c80fda3eb76675ad0036218ccbb4 Mon Sep 17 00:00:00 2001 From: sainthkh Date: Tue, 8 Oct 2019 10:57:37 +0900 Subject: [PATCH 7/9] Load tab from state. --- .../edit_index_pattern/components/tabs.tsx | 19 ++++++++++++++++--- .../edit_index_pattern/edit_index_pattern.js | 6 +++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx index 381d372a427d2f..b01100dac5bfc7 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx @@ -47,7 +47,18 @@ export const Tabs = ({ $scope }: Props) => { }; }); - return ; + const currentTabIndex = tabContents.findIndex(t => t.index === $scope.state.tab); + const currentTab = currentTabIndex !== -1 ? tabs[currentTabIndex] : tabs[0]; + + return ( + { + $scope.changeTab(tab.id); + }} + /> + ); }; const tabContents = [ @@ -92,7 +103,8 @@ const tabContents = [ indexedFieldTypeFilter={$scope.indexedFieldTypeFilter} helpers={{ redirectToRoute: (obj: any, route: any) => { - $scope.kbnUrl.redirectToRoute(obj, route); + const url = $scope.kbnUrl.getRouteUrl(obj, route); + $scope.kbnUrl.change(url); $scope.$apply(); }, getFieldInfo: $scope.getFieldInfo, @@ -140,7 +152,8 @@ const tabContents = [ scriptedFieldLanguageFilter={$scope.scriptedFieldLanguageFilter} helpers={{ redirectToRoute: (obj: any, route: any) => { - $scope.kbnUrl.redirectToRoute(obj, route); + const url = $scope.kbnUrl.getRouteUrl(obj, route); + $scope.kbnUrl.change(url); $scope.$apply(); }, getRouteHref: (obj: any, route: any) => $scope.kbnUrl.getRouteHref(obj, route), 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 d6bdf8fa78c190..c7ef9dc314f41e 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 @@ -140,13 +140,13 @@ uiModules.get('apps/management') $scope[filter] = val || ''; // null causes filter to check for null explicitly }; - $scope.changeTab = function (obj) { - $state.tab = obj.index; + $scope.changeTab = function (index) { + $state.tab = index; $state.save(); }; $scope.$watch('state.tab', function (tab) { - if (!tab) $scope.changeTab($scope.editSections[0]); + if (!tab) $scope.changeTab($scope.editSections[0].index); }); $scope.$watchCollection('indexPattern.fields', function () { From 33babaeff2fd7240d26cd1cd5e3e133a7ffae7c7 Mon Sep 17 00:00:00 2001 From: sainthkh Date: Tue, 8 Oct 2019 12:25:29 +0900 Subject: [PATCH 8/9] Fixed functional tests. --- test/functional/page_objects/settings_page.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/functional/page_objects/settings_page.js b/test/functional/page_objects/settings_page.js index e40efeaef71fee..07dc97d4ced2ab 100644 --- a/test/functional/page_objects/settings_page.js +++ b/test/functional/page_objects/settings_page.js @@ -193,17 +193,19 @@ export function SettingsPageProvider({ getService, getPageObjects }) { async getFieldsTabCount() { return retry.try(async () => { - const text = await testSubjects.getVisibleText('tab-count-indexedFields'); - return text.replace(/\((.*)\)/, '$1'); + const text = await testSubjects.getVisibleText('tab-indexedFields'); + const index = text.indexOf('('); + return text.substring(index).replace(/\((.*)\)/, '$1'); }); } async getScriptedFieldsTabCount() { - const selector = '[data-test-subj="tab-count-scriptedFields"]'; + const selector = '[data-test-subj="tab-scriptedFields"]'; return await retry.try(async () => { const theText = await (await find.byCssSelector(selector)) .getVisibleText(); - return theText.replace(/\((.*)\)/, '$1'); + const index = theText.indexOf('('); + return theText.substring(index).replace(/\((.*)\)/, '$1'); }); } @@ -230,13 +232,13 @@ export function SettingsPageProvider({ getService, getPageObjects }) { async setFieldTypeFilter(type) { await find.clickByCssSelector( - 'select[data-test-subj="indexedFieldTypeFilterDropdown"] > option[label="' + type + '"]' + 'select[data-test-subj="indexedFieldTypeFilterDropdown"] > option[value="' + type + '"]' ); } async setScriptedFieldLanguageFilter(language) { await find.clickByCssSelector( - 'select[data-test-subj="scriptedFieldLanguageFilterDropdown"] > option[label="' + + 'select[data-test-subj="scriptedFieldLanguageFilterDropdown"] > option[value="' + language + '"]' ); From 3361750b972a455ae7ff99dcf03fae1115b033cf Mon Sep 17 00:00:00 2001 From: sainthkh Date: Tue, 8 Oct 2019 12:43:37 +0900 Subject: [PATCH 9/9] Fixed jp, ch language file problem caused by string format change. --- x-pack/plugins/translations/translations/ja-JP.json | 4 ++-- x-pack/plugins/translations/translations/zh-CN.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 4cb92cb4dc554c..31c3bff8afe7b9 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -1842,7 +1842,7 @@ "kbn.management.editIndexPattern.tabs.sourceHeader": "ソースフィルター", "kbn.management.editIndexPattern.timeFilterHeader": "時間フィルターフィールド名: {timeFieldName}", "kbn.management.editIndexPattern.timeFilterLabel.mappingAPILink": "マッピング API", - "kbn.management.editIndexPattern.timeFilterLabel.timeFilterDetail": "このページは {indexPatternTitle} インデックス内のすべてのフィールドと、Elasticsearch に記録された各フィールドのコアタイプを一覧表示します。フィールドタイプを変更するには Elasticsearch を使用します", + "kbn.management.editIndexPattern.timeFilterLabel.timeFilterDetail": "このページは {indexPatternTitle} インデックス内のすべてのフィールドと、Elasticsearch に記録された各フィールドのコアタイプを一覧表示します。フィールドタイプを変更するには Elasticsearch {apiLink}を使用します", "kbn.management.editIndexPatternLiveRegionAriaLabel": "インデックスパターン", "kbn.management.indexPattern.confirmOverwriteButton": "上書き", "kbn.management.indexPattern.confirmOverwriteLabel": "「{title}」に上書きしてよろしいですか?", @@ -11382,4 +11382,4 @@ "xpack.fileUpload.fileParser.errorReadingFile": "ファイルの読み込み中にエラーが発生しました", "xpack.fileUpload.fileParser.noFileProvided": "エラー、ファイルが提供されていません" } -} \ No newline at end of file +} diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 46b0efa3cbc1d1..e8aa2aed9bc66b 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1843,7 +1843,7 @@ "kbn.management.editIndexPattern.tabs.sourceHeader": "源筛选", "kbn.management.editIndexPattern.timeFilterHeader": "时间筛选字段名称:{timeFieldName}", "kbn.management.editIndexPattern.timeFilterLabel.mappingAPILink": "映射 API", - "kbn.management.editIndexPattern.timeFilterLabel.timeFilterDetail": "此页根据 Elasticsearch 的记录列出“{indexPatternTitle}”索引中的每个字段以及字段的关联核心类型。要更改字段类型,请使用 Elasticsearch", + "kbn.management.editIndexPattern.timeFilterLabel.timeFilterDetail": "此页根据 Elasticsearch 的记录列出“{indexPatternTitle}”索引中的每个字段以及字段的关联核心类型。要更改字段类型,请使用 Elasticsearch {apiLink}", "kbn.management.editIndexPatternLiveRegionAriaLabel": "索引模式", "kbn.management.indexPattern.confirmOverwriteButton": "覆盖", "kbn.management.indexPattern.confirmOverwriteLabel": "确定要覆盖 “{title}”?", @@ -11384,4 +11384,4 @@ "xpack.fileUpload.fileParser.errorReadingFile": "读取文件时出错", "xpack.fileUpload.fileParser.noFileProvided": "错误,未提供任何文件" } -} \ No newline at end of file +}