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/index_header/index.js b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/index.ts similarity index 80% 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..e715a7a4b89cb9 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,8 @@ * under the License. */ -import './index_header'; +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/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/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..aa97f801df2915 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/search_field.tsx @@ -0,0 +1,50 @@ +/* + * 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, { useState } from 'react'; +import { EuiFieldSearch } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +interface Props { + $scope: any; +} + +export const SearchField = ({ $scope }: Props) => { + const [text, setText] = useState($scope.fieldFilter || ''); + + return ( + { + const newText = event.target.value; + setText(newText); + $scope.fieldFilter = newText; + $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..b01100dac5bfc7 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/components/tabs.tsx @@ -0,0 +1,201 @@ +/* + * 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}`, + }; + }); + + 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 = [ + { + 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} + + { + const url = $scope.kbnUrl.getRouteUrl(obj, route); + $scope.kbnUrl.change(url); + $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} + + { + const url = $scope.kbnUrl.getRouteUrl(obj, route); + $scope.kbnUrl.change(url); + $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 4b3014fd28a51c..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 @@ -6,161 +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 6ae84b9c641c24..ff8084b3114bda 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'; @@ -31,129 +30,52 @@ import { fieldWildcardMatcher } 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 } 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'; - -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.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.kbnUrl.redirectToRoute(obj, route); - $scope.$apply(); - }, - getFieldInfo: $scope.getFieldInfo, - }} - /> - , - node, - ); - }); - } else { - destroyIndexedFieldsTable(); - } +const REACT_EDIT_INDEX_REACT_COMPONENT = 'editIndexReactComponent'; + +function updateReactComponent($scope, config) { + $scope.$$postDigest(() => { + const node = document.getElementById(REACT_EDIT_INDEX_REACT_COMPONENT); + if (!node) { + return; + } + + render( + + + + + {$scope.indexPattern.timeFieldName || ($scope.indexPattern.tags && $scope.indexPattern.tags.length) ? ( + + ) : null} + + + + + + {$scope.conflictFields.length > 0 ? : null} + + + , + node + ); + }); } -function destroyIndexedFieldsTable() { - const node = document.getElementById(REACT_INDEXED_FIELDS_DOM_ELEMENT_ID); +function destoryReactComponent() { + const node = document.getElementById(REACT_EDIT_INDEX_REACT_COMPONENT); node && unmountComponentAtNode(node); } @@ -184,6 +106,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); @@ -195,8 +118,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 () { @@ -218,16 +139,13 @@ uiModules.get('apps/management') $scope[filter] = val || ''; // null causes filter to check for null explicitly }; - $scope.changeTab = function (obj) { - $state.tab = obj.index; - updateIndexedFieldsTable($scope, $state); - updateScriptedFieldsTable($scope, $state); - updateSourceFiltersTable($scope, $state); + $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 () { @@ -294,39 +212,34 @@ uiModules.get('apps/management') return $scope.indexPattern.save(); }; + $scope.$watch('defaultIndex', () => { + updateReactComponent($scope, config); + }); + $scope.$watch('fieldFilter', () => { $scope.editSections = $scope.editSectionsProvider($scope.indexPattern, $scope.fieldFilter, indexPatternListProvider); if ($scope.fieldFilter === undefined) { 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(); }); - updateScriptedFieldsTable($scope, $state); - updateSourceFiltersTable($scope, $state); + updateReactComponent($scope, config); }); 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'); - } - }; - }); diff --git a/test/functional/page_objects/settings_page.js b/test/functional/page_objects/settings_page.js index 60f3d3a7e9eabf..89a28dccd6d689 100644 --- a/test/functional/page_objects/settings_page.js +++ b/test/functional/page_objects/settings_page.js @@ -195,17 +195,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'); }); } @@ -232,7 +234,7 @@ 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 + '"]' ); } diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index d3d66cd104120e..8251035f0f08c9 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -1825,7 +1825,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}」に上書きしてよろしいですか?", @@ -10473,4 +10473,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 c7448d0a7972c1..66c5912b3cbd4e 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1826,7 +1826,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}”?", @@ -10630,4 +10630,4 @@ "xpack.fileUpload.fileParser.errorReadingFile": "读取文件时出错", "xpack.fileUpload.fileParser.noFileProvided": "错误,未提供任何文件" } -} \ No newline at end of file +}