From 51ecb0af01c84b357c75acbf8b55a8c8d6c4d4a7 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 4 Jun 2021 08:32:28 -0600 Subject: [PATCH 01/11] Link to home file data visualizer --- .../empty_state/empty_state.test.tsx | 3 - .../empty_state/empty_state.tsx | 62 ++++++------------- .../index_pattern_table.tsx | 2 - .../index_pattern_management/public/index.ts | 2 - .../mount_management_section.tsx | 6 +- .../index_pattern_management/public/mocks.ts | 4 -- .../index_pattern_management/public/plugin.ts | 4 +- .../service/environment/environment.mock.ts | 34 ---------- .../service/environment/environment.test.ts | 38 ------------ .../public/service/environment/environment.ts | 41 ------------ .../public/service/environment/index.ts | 9 --- .../index_pattern_management_service.ts | 4 -- .../index_pattern_management/public/types.ts | 7 --- .../plugins/file_data_visualizer/kibana.json | 1 + .../file_data_visualizer/public/plugin.ts | 3 +- .../public/register_home.ts | 20 ++++++ x-pack/plugins/ml/kibana.json | 1 - x-pack/plugins/ml/public/plugin.ts | 8 --- x-pack/plugins/ml/public/register_feature.ts | 19 ------ 19 files changed, 45 insertions(+), 223 deletions(-) delete mode 100644 src/plugins/index_pattern_management/public/service/environment/environment.mock.ts delete mode 100644 src/plugins/index_pattern_management/public/service/environment/environment.test.ts delete mode 100644 src/plugins/index_pattern_management/public/service/environment/environment.ts delete mode 100644 src/plugins/index_pattern_management/public/service/environment/index.ts diff --git a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.test.tsx b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.test.tsx index fa300667ff9191..ed68d4d4ddd646 100644 --- a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.test.tsx +++ b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.test.tsx @@ -13,7 +13,6 @@ import sinon from 'sinon'; import { findTestSubject } from '@elastic/eui/lib/test'; import { mountWithIntl } from '@kbn/test/jest'; import { docLinksServiceMock } from '../../../../../../core/public/mocks'; -import { MlCardState } from '../../../types'; const docLinks = docLinksServiceMock.createStartContract(); @@ -30,7 +29,6 @@ describe('EmptyState', () => { docLinks={docLinks} onRefresh={() => {}} navigateToApp={async () => {}} - getMlCardState={() => MlCardState.ENABLED} canSave={true} /> ); @@ -48,7 +46,6 @@ describe('EmptyState', () => { docLinks={docLinks} onRefresh={onRefreshHandler} navigateToApp={async () => {}} - getMlCardState={() => MlCardState.ENABLED} canSave={true} /> ); diff --git a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx index 438eb8a031993f..0ae6e282abd6d1 100644 --- a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx +++ b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx @@ -28,60 +28,18 @@ import { } from '@elastic/eui'; import { useHistory } from 'react-router-dom'; import { reactRouterNavigate } from '../../../../../../plugins/kibana_react/public'; -import { MlCardState } from '../../../types'; export const EmptyState = ({ onRefresh, navigateToApp, docLinks, - getMlCardState, canSave, }: { onRefresh: () => void; navigateToApp: ApplicationStart['navigateToApp']; docLinks: DocLinksStart; - getMlCardState: () => MlCardState; canSave: boolean; }) => { - const mlCard = ( - - navigateToApp('ml', { path: '#/filedatavisualizer' })} - className="inpEmptyState__card" - betaBadgeLabel={ - getMlCardState() === MlCardState.ENABLED - ? undefined - : i18n.translate( - 'indexPatternManagement.createIndexPattern.emptyState.basicLicenseLabel', - { - defaultMessage: 'Basic', - } - ) - } - betaBadgeTooltipContent={i18n.translate( - 'indexPatternManagement.createIndexPattern.emptyState.basicLicenseDescription', - { - defaultMessage: 'This feature requires a Basic license.', - } - )} - isDisabled={getMlCardState() === MlCardState.DISABLED} - icon={} - title={ - - } - description={ - - } - /> - - ); - const createAnyway = ( - {getMlCardState() !== MlCardState.HIDDEN ? mlCard : <>} + + navigateToApp('home', { path: '#/tutorial_directory/fileDataViz' })} + className="inpEmptyState__card" + icon={} + title={ + + } + description={ + + } + /> + { application, http, data, - getMlCardState, } = useKibana().services; const [indexPatterns, setIndexPatterns] = useState([]); const [creationOptions, setCreationOptions] = useState([]); @@ -182,7 +181,6 @@ export const IndexPatternTable = ({ canSave, history }: Props) => { onRefresh={loadSources} docLinks={docLinks} navigateToApp={application.navigateToApp} - getMlCardState={getMlCardState} canSave={canSave} /> ); diff --git a/src/plugins/index_pattern_management/public/index.ts b/src/plugins/index_pattern_management/public/index.ts index 94611705a93908..726c055d1b8c34 100644 --- a/src/plugins/index_pattern_management/public/index.ts +++ b/src/plugins/index_pattern_management/public/index.ts @@ -30,5 +30,3 @@ export { IndexPatternCreationOption, IndexPatternListConfig, } from './service'; - -export { MlCardState } from './types'; diff --git a/src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx b/src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx index 355f529fe0f759..ec5b7c74020a5a 100644 --- a/src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx +++ b/src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx @@ -23,7 +23,7 @@ import { CreateIndexPatternWizardWithRouter, } from '../components'; import { IndexPatternManagementStartDependencies, IndexPatternManagementStart } from '../plugin'; -import { IndexPatternManagmentContext, MlCardState } from '../types'; +import { IndexPatternManagmentContext } from '../types'; const readOnlyBadge = { text: i18n.translate('indexPatternManagement.indexPatterns.badge.readOnly.text', { @@ -37,8 +37,7 @@ const readOnlyBadge = { export async function mountManagementSection( getStartServices: StartServicesAccessor, - params: ManagementAppMountParams, - getMlCardState: () => MlCardState + params: ManagementAppMountParams ) { const [ { chrome, application, uiSettings, notifications, overlays, http, docLinks }, @@ -63,7 +62,6 @@ export async function mountManagementSection( indexPatternFieldEditor, indexPatternManagementStart: indexPatternManagementStart as IndexPatternManagementStart, setBreadcrumbs: params.setBreadcrumbs, - getMlCardState, fieldFormatEditors: indexPatternFieldEditor.fieldFormatEditors, }; diff --git a/src/plugins/index_pattern_management/public/mocks.ts b/src/plugins/index_pattern_management/public/mocks.ts index 3462131e50463b..6c709fb14f08d7 100644 --- a/src/plugins/index_pattern_management/public/mocks.ts +++ b/src/plugins/index_pattern_management/public/mocks.ts @@ -26,9 +26,6 @@ const createSetupContract = (): IndexPatternManagementSetup => ({ list: { addListConfig: jest.fn(), } as any, - environment: { - update: jest.fn(), - }, }); const createStartContract = (): IndexPatternManagementStart => ({ @@ -93,7 +90,6 @@ const createIndexPatternManagmentContext = (): { indexPatternFieldEditor, indexPatternManagementStart: createStartContract(), setBreadcrumbs: () => {}, - getMlCardState: () => 2, fieldFormatEditors: indexPatternFieldEditor.fieldFormatEditors, }; }; diff --git a/src/plugins/index_pattern_management/public/plugin.ts b/src/plugins/index_pattern_management/public/plugin.ts index ed92172c8b91ca..e3c156927bface 100644 --- a/src/plugins/index_pattern_management/public/plugin.ts +++ b/src/plugins/index_pattern_management/public/plugin.ts @@ -77,9 +77,7 @@ export class IndexPatternManagementPlugin mount: async (params) => { const { mountManagementSection } = await import('./management_app'); - return mountManagementSection(core.getStartServices, params, () => - this.indexPatternManagementService.environmentService.getEnvironment().ml() - ); + return mountManagementSection(core.getStartServices, params); }, }); diff --git a/src/plugins/index_pattern_management/public/service/environment/environment.mock.ts b/src/plugins/index_pattern_management/public/service/environment/environment.mock.ts deleted file mode 100644 index 1eaab2eaccc111..00000000000000 --- a/src/plugins/index_pattern_management/public/service/environment/environment.mock.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import type { PublicMethodsOf } from '@kbn/utility-types'; -import { EnvironmentService, EnvironmentServiceSetup } from './environment'; -import { MlCardState } from '../../types'; - -const createSetupMock = (): jest.Mocked => { - const setup = { - update: jest.fn(), - }; - return setup; -}; - -const createMock = (): jest.Mocked> => { - const service = { - setup: jest.fn(), - getEnvironment: jest.fn(() => ({ - ml: () => MlCardState.ENABLED, - })), - }; - service.setup.mockImplementation(createSetupMock); - return service; -}; - -export const environmentServiceMock = { - createSetup: createSetupMock, - create: createMock, -}; diff --git a/src/plugins/index_pattern_management/public/service/environment/environment.test.ts b/src/plugins/index_pattern_management/public/service/environment/environment.test.ts deleted file mode 100644 index 9e571374b4784f..00000000000000 --- a/src/plugins/index_pattern_management/public/service/environment/environment.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { EnvironmentService } from './environment'; -import { MlCardState } from '../../types'; - -describe('EnvironmentService', () => { - describe('setup', () => { - test('allows multiple update calls', () => { - const setup = new EnvironmentService().setup(); - expect(() => { - setup.update({ ml: () => MlCardState.ENABLED }); - }).not.toThrow(); - }); - }); - - describe('getEnvironment', () => { - test('returns default values', () => { - const service = new EnvironmentService(); - expect(service.getEnvironment().ml()).toEqual(MlCardState.DISABLED); - }); - - test('returns last state of update calls', () => { - let cardState = MlCardState.DISABLED; - const service = new EnvironmentService(); - const setup = service.setup(); - setup.update({ ml: () => cardState }); - expect(service.getEnvironment().ml()).toEqual(MlCardState.DISABLED); - cardState = MlCardState.ENABLED; - expect(service.getEnvironment().ml()).toEqual(MlCardState.ENABLED); - }); - }); -}); diff --git a/src/plugins/index_pattern_management/public/service/environment/environment.ts b/src/plugins/index_pattern_management/public/service/environment/environment.ts deleted file mode 100644 index 7bf0c1eb52068a..00000000000000 --- a/src/plugins/index_pattern_management/public/service/environment/environment.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { MlCardState } from '../../types'; - -/** @public */ -export interface Environment { - /** - * Flag whether ml features should be advertised - */ - readonly ml: () => MlCardState; -} - -export class EnvironmentService { - private environment = { - ml: () => MlCardState.DISABLED, - }; - - public setup() { - return { - /** - * Update the environment to influence how available features are presented. - * @param update - */ - update: (update: Partial) => { - this.environment = Object.assign({}, this.environment, update); - }, - }; - } - - public getEnvironment() { - return this.environment; - } -} - -export type EnvironmentServiceSetup = ReturnType; diff --git a/src/plugins/index_pattern_management/public/service/environment/index.ts b/src/plugins/index_pattern_management/public/service/environment/index.ts deleted file mode 100644 index ab5297ed0e14c0..00000000000000 --- a/src/plugins/index_pattern_management/public/service/environment/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export { EnvironmentService, Environment, EnvironmentServiceSetup } from './environment'; diff --git a/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts b/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts index 15be7f11892e49..f30ccfcb9f3ed7 100644 --- a/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts +++ b/src/plugins/index_pattern_management/public/service/index_pattern_management_service.ts @@ -9,7 +9,6 @@ import { HttpSetup } from '../../../../core/public'; import { IndexPatternCreationManager, IndexPatternCreationConfig } from './creation'; import { IndexPatternListManager, IndexPatternListConfig } from './list'; -import { EnvironmentService } from './environment'; interface SetupDependencies { httpClient: HttpSetup; } @@ -22,12 +21,10 @@ interface SetupDependencies { export class IndexPatternManagementService { indexPatternCreationManager: IndexPatternCreationManager; indexPatternListConfig: IndexPatternListManager; - environmentService: EnvironmentService; constructor() { this.indexPatternCreationManager = new IndexPatternCreationManager(); this.indexPatternListConfig = new IndexPatternListManager(); - this.environmentService = new EnvironmentService(); } public setup({ httpClient }: SetupDependencies) { @@ -40,7 +37,6 @@ export class IndexPatternManagementService { return { creation: creationManagerSetup, list: indexPatternListConfigSetup, - environment: this.environmentService.setup(), }; } diff --git a/src/plugins/index_pattern_management/public/types.ts b/src/plugins/index_pattern_management/public/types.ts index 58a138df633fd3..a61eeb99b25a57 100644 --- a/src/plugins/index_pattern_management/public/types.ts +++ b/src/plugins/index_pattern_management/public/types.ts @@ -33,14 +33,7 @@ export interface IndexPatternManagmentContext { indexPatternFieldEditor: IndexPatternFieldEditorStart; indexPatternManagementStart: IndexPatternManagementStart; setBreadcrumbs: ManagementAppMountParams['setBreadcrumbs']; - getMlCardState: () => MlCardState; fieldFormatEditors: IndexPatternFieldEditorStart['fieldFormatEditors']; } export type IndexPatternManagmentContextValue = KibanaReactContextValue; - -export enum MlCardState { - HIDDEN, - DISABLED, - ENABLED, -} diff --git a/x-pack/plugins/file_data_visualizer/kibana.json b/x-pack/plugins/file_data_visualizer/kibana.json index eea52bb6e98b2c..d82a7e515c9c99 100644 --- a/x-pack/plugins/file_data_visualizer/kibana.json +++ b/x-pack/plugins/file_data_visualizer/kibana.json @@ -18,6 +18,7 @@ "home" ], "requiredBundles": [ + "home", "kibanaReact", "maps", "esUiShared" diff --git a/x-pack/plugins/file_data_visualizer/public/plugin.ts b/x-pack/plugins/file_data_visualizer/public/plugin.ts index 0064f96195eafb..2edd50b5a1bf44 100644 --- a/x-pack/plugins/file_data_visualizer/public/plugin.ts +++ b/x-pack/plugins/file_data_visualizer/public/plugin.ts @@ -18,7 +18,7 @@ import type { MapsStartApi } from '../../maps/public'; import type { SecurityPluginSetup } from '../../security/public'; import { getFileDataVisualizerComponent } from './api'; import { getMaxBytesFormatted } from './application/util/get_max_bytes'; -import { registerHomeAddData } from './register_home'; +import { registerHomeAddData, registerHomeFeatureCatalogue } from './register_home'; export interface FileDataVisualizerSetupDependencies { home?: HomePublicPluginSetup; @@ -46,6 +46,7 @@ export class FileDataVisualizerPlugin public setup(core: CoreSetup, plugins: FileDataVisualizerSetupDependencies) { if (plugins.home) { registerHomeAddData(plugins.home); + registerHomeFeatureCatalogue(plugins.home); } } diff --git a/x-pack/plugins/file_data_visualizer/public/register_home.ts b/x-pack/plugins/file_data_visualizer/public/register_home.ts index e54c37a8d06bc0..ae449c220c5921 100644 --- a/x-pack/plugins/file_data_visualizer/public/register_home.ts +++ b/x-pack/plugins/file_data_visualizer/public/register_home.ts @@ -7,8 +7,11 @@ import { i18n } from '@kbn/i18n'; import type { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; +import { FeatureCatalogueCategory } from '../../../../src/plugins/home/public'; import { FileDataVisualizerWrapper } from './lazy_load_bundle/component_wrapper'; +const FILE_DATA_VIS_TAB_ID = 'fileDataViz'; + export function registerHomeAddData(home: HomePublicPluginSetup) { home.addData.registerAddDataTab({ id: 'fileDataViz', @@ -18,3 +21,20 @@ export function registerHomeAddData(home: HomePublicPluginSetup) { component: FileDataVisualizerWrapper, }); } + +export function registerHomeFeatureCatalogue(home: HomePublicPluginSetup) { + home.featureCatalogue.register({ + id: `file_data_visualizer`, + title: i18n.translate('xpack.fileDataVisualizer.title', { + defaultMessage: 'Upload a file', + }), + description: i18n.translate('xpack.fileDataVisualizer.description', { + defaultMessage: 'Import your own CSV, NDJSON, or log file.', + }), + icon: 'document', + path: `/app/home#/tutorial_directory/${FILE_DATA_VIS_TAB_ID}`, + showOnHomePage: true, + category: FeatureCatalogueCategory.DATA, + order: 520, + }); +} diff --git a/x-pack/plugins/ml/kibana.json b/x-pack/plugins/ml/kibana.json index 6804b3f52b52ac..e490ecd865a708 100644 --- a/x-pack/plugins/ml/kibana.json +++ b/x-pack/plugins/ml/kibana.json @@ -16,7 +16,6 @@ "embeddable", "uiActions", "kibanaLegacy", - "indexPatternManagement", "discover", "triggersActionsUi" ], diff --git a/x-pack/plugins/ml/public/plugin.ts b/x-pack/plugins/ml/public/plugin.ts index 1f41f0a1d25c30..98b3cda40e3f7d 100644 --- a/x-pack/plugins/ml/public/plugin.ts +++ b/x-pack/plugins/ml/public/plugin.ts @@ -24,7 +24,6 @@ import type { } from 'src/plugins/share/public'; import type { DataPublicPluginStart } from 'src/plugins/data/public'; import type { HomePublicPluginSetup } from 'src/plugins/home/public'; -import type { IndexPatternManagementSetup } from 'src/plugins/index_pattern_management/public'; import type { EmbeddableSetup, EmbeddableStart } from 'src/plugins/embeddable/public'; import type { SpacesPluginStart } from '../../spaces/public'; @@ -78,7 +77,6 @@ export interface MlSetupDependencies { uiActions: UiActionsSetup; kibanaVersion: string; share: SharePluginSetup; - indexPatternManagement: IndexPatternManagementSetup; triggersActionsUi?: TriggersAndActionsUIPublicPluginSetup; alerting?: AlertingSetup; } @@ -148,12 +146,6 @@ export class MlPlugin implements Plugin { if (pluginsSetup.home) { registerFeature(pluginsSetup.home); } - - // register ML for the index pattern management no data screen. - pluginsSetup.indexPatternManagement.environment.update({ - ml: () => - capabilities.ml.canFindFileStructure ? MlCardState.ENABLED : MlCardState.HIDDEN, - }); } else { // if ml is disabled in elasticsearch, disable ML in kibana this.appUpdater$.next(() => ({ diff --git a/x-pack/plugins/ml/public/register_feature.ts b/x-pack/plugins/ml/public/register_feature.ts index 191e064c85b900..e8d64360df1230 100644 --- a/x-pack/plugins/ml/public/register_feature.ts +++ b/x-pack/plugins/ml/public/register_feature.ts @@ -13,10 +13,6 @@ import { import { PLUGIN_ID } from '../common/constants/app'; export const registerFeature = (home: HomePublicPluginSetup) => { - // register ML for the kibana home screen. - // so the file data visualizer appears to allow people to import data - home.environment.update({ ml: true }); - // register ML so it appears on the Kibana home page home.featureCatalogue.register({ id: PLUGIN_ID, @@ -37,19 +33,4 @@ export const registerFeature = (home: HomePublicPluginSetup) => { solutionId: 'kibana', order: 500, }); - - home.featureCatalogue.register({ - id: `${PLUGIN_ID}_file_data_visualizer`, - title: i18n.translate('xpack.ml.fileDataVisualizerTitle', { - defaultMessage: 'Upload a file', - }), - description: i18n.translate('xpack.ml.fileDataVisualizerDescription', { - defaultMessage: 'Import your own CSV, NDJSON, or log file.', - }), - icon: 'document', - path: '/app/ml/filedatavisualizer', - showOnHomePage: true, - category: FeatureCatalogueCategory.DATA, - order: 520, - }); }; From 069d1f23e06f0b92c19a06308915f6e8969c70dc Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 4 Jun 2021 08:47:22 -0600 Subject: [PATCH 02/11] remove unused import --- x-pack/plugins/ml/public/plugin.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/ml/public/plugin.ts b/x-pack/plugins/ml/public/plugin.ts index 98b3cda40e3f7d..5674b8230ff6a4 100644 --- a/x-pack/plugins/ml/public/plugin.ts +++ b/x-pack/plugins/ml/public/plugin.ts @@ -30,7 +30,6 @@ import type { SpacesPluginStart } from '../../spaces/public'; import { AppStatus, AppUpdater, DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; import type { UiActionsSetup, UiActionsStart } from '../../../../src/plugins/ui_actions/public'; import type { KibanaLegacyStart } from '../../../../src/plugins/kibana_legacy/public'; -import { MlCardState } from '../../../../src/plugins/index_pattern_management/public'; import type { LicenseManagementUIPluginSetup } from '../../license_management/public'; import type { LicensingPluginSetup } from '../../licensing/public'; From e71b8f13f8f2a886335c0ba7e6d6f9b5b1065bd4 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 4 Jun 2021 09:41:35 -0600 Subject: [PATCH 03/11] i18n cleanup --- x-pack/plugins/translations/translations/ja-JP.json | 4 ---- x-pack/plugins/translations/translations/zh-CN.json | 4 ---- 2 files changed, 8 deletions(-) diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index d1e6835b486b23..2b71fe11a843f4 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -2888,8 +2888,6 @@ "indexPatternManagement.createIndexPattern.betaLabel": "ベータ", "indexPatternManagement.createIndexPattern.description": "インデックスパターンは、{single}または{multiple}データソース、{star}と一致します。", "indexPatternManagement.createIndexPattern.documentation": "ドキュメンテーションを表示", - "indexPatternManagement.createIndexPattern.emptyState.basicLicenseDescription": "この機能にはベーシックライセンスが必要です。", - "indexPatternManagement.createIndexPattern.emptyState.basicLicenseLabel": "基本", "indexPatternManagement.createIndexPattern.emptyState.checkDataButton": "新規データを確認", "indexPatternManagement.createIndexPattern.emptyState.createAnyway": "一部のインデックスは表示されない場合があります。{link}してください。", "indexPatternManagement.createIndexPattern.emptyState.createAnywayLink": "インデックスパターンを作成します", @@ -14765,8 +14763,6 @@ "xpack.ml.fieldTypeIcon.numberTypeAriaLabel": "数字タイプ", "xpack.ml.fieldTypeIcon.textTypeAriaLabel": "テキストタイプ", "xpack.ml.fieldTypeIcon.unknownTypeAriaLabel": "不明なタイプ", - "xpack.ml.fileDataVisualizerDescription": "CSV、NDJSON、またはログファイルをインポートします。", - "xpack.ml.fileDataVisualizerTitle": "ファイルをアップロード", "xpack.ml.formatters.metricChangeDescription.actualSameAsTypicalDescription": "実際値が通常値と同じ", "xpack.ml.formatters.metricChangeDescription.moreThan100xHigherDescription": "100x よりも高い", "xpack.ml.formatters.metricChangeDescription.moreThan100xLowerDescription": "100x よりも低い", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 97f3ebdb733968..29b51c53101b23 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -2902,8 +2902,6 @@ "indexPatternManagement.createIndexPattern.betaLabel": "公测版", "indexPatternManagement.createIndexPattern.description": "索引模式可以匹配单个源,例如 {single} 或 {multiple} 个数据源、{star}。", "indexPatternManagement.createIndexPattern.documentation": "阅读文档", - "indexPatternManagement.createIndexPattern.emptyState.basicLicenseDescription": "此功能需要基本级许可证。", - "indexPatternManagement.createIndexPattern.emptyState.basicLicenseLabel": "基本级", "indexPatternManagement.createIndexPattern.emptyState.checkDataButton": "检查新数据", "indexPatternManagement.createIndexPattern.emptyState.createAnyway": "部分索引可能已隐藏。仍然尝试{link}。", "indexPatternManagement.createIndexPattern.emptyState.createAnywayLink": "创建索引模式", @@ -14958,8 +14956,6 @@ "xpack.ml.fieldTypeIcon.numberTypeAriaLabel": "数字类型", "xpack.ml.fieldTypeIcon.textTypeAriaLabel": "文本类型", "xpack.ml.fieldTypeIcon.unknownTypeAriaLabel": "未知类型", - "xpack.ml.fileDataVisualizerDescription": "导入您自己的 CSV、NDJSON 或日志文件。", - "xpack.ml.fileDataVisualizerTitle": "上传文件", "xpack.ml.formatters.metricChangeDescription.actualSameAsTypicalDescription": "实际上与典型模式相同", "xpack.ml.formatters.metricChangeDescription.moreThan100xHigherDescription": "高 100 多倍", "xpack.ml.formatters.metricChangeDescription.moreThan100xLowerDescription": "低 100 多倍", From 9647a63ceb10f1944e5c8e0190b9c32162773896 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 4 Jun 2021 10:03:01 -0600 Subject: [PATCH 04/11] remove unused import from EmptyState --- .../components/index_pattern_table/empty_state/empty_state.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx index 0ae6e282abd6d1..240e732752916c 100644 --- a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx +++ b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx @@ -8,7 +8,6 @@ import './empty_state.scss'; import React from 'react'; -import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { DocLinksStart, ApplicationStart } from 'kibana/public'; import { From bb460520b9d85a471b8c8e8ab512bf26bab7c0b2 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 4 Jun 2021 10:14:17 -0600 Subject: [PATCH 05/11] use const --- x-pack/plugins/file_data_visualizer/public/register_home.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/file_data_visualizer/public/register_home.ts b/x-pack/plugins/file_data_visualizer/public/register_home.ts index ae449c220c5921..9bdadf350282e7 100644 --- a/x-pack/plugins/file_data_visualizer/public/register_home.ts +++ b/x-pack/plugins/file_data_visualizer/public/register_home.ts @@ -14,7 +14,7 @@ const FILE_DATA_VIS_TAB_ID = 'fileDataViz'; export function registerHomeAddData(home: HomePublicPluginSetup) { home.addData.registerAddDataTab({ - id: 'fileDataViz', + id: FILE_DATA_VIS_TAB_ID, name: i18n.translate('xpack.fileDataVisualizer.embeddedTabTitle', { defaultMessage: 'Upload file', }), From 1a4c4c3ca8f01ef13c02b065cd934d5b937d20a9 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 4 Jun 2021 11:00:12 -0600 Subject: [PATCH 06/11] remove ml functional test cases checking for ml_file_data_visualizer --- .../test/functional/apps/ml/permissions/full_ml_access.ts | 8 -------- .../test/functional/apps/ml/permissions/no_ml_access.ts | 8 -------- .../test/functional/apps/ml/permissions/read_ml_access.ts | 8 -------- x-pack/test/functional/services/ml/common_ui.ts | 8 -------- .../apps/ml/permissions/full_ml_access.ts | 8 -------- .../functional_basic/apps/ml/permissions/no_ml_access.ts | 8 -------- .../apps/ml/permissions/read_ml_access.ts | 8 -------- 7 files changed, 56 deletions(-) diff --git a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts index a203b078774c7c..b3d0fe919dbc09 100644 --- a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts +++ b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts @@ -35,14 +35,6 @@ export default function ({ getService }: FtrProviderContext) { await ml.securityUI.logout(); }); - it('should display the ML file data vis link on the Kibana home page', async () => { - await ml.testExecution.logTestStep('should load the Kibana home page'); - await ml.navigation.navigateToKibanaHome(); - - await ml.testExecution.logTestStep('should display the ML file data vis link'); - await ml.commonUI.assertKibanaHomeFileDataVisLinkExists(); - }); - it('should display the ML entry in Kibana app menu', async () => { await ml.testExecution.logTestStep('should open the Kibana app menu'); await ml.navigation.openKibanaNav(); diff --git a/x-pack/test/functional/apps/ml/permissions/no_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/no_ml_access.ts index 280801d1becb5b..24a07130c9c43b 100644 --- a/x-pack/test/functional/apps/ml/permissions/no_ml_access.ts +++ b/x-pack/test/functional/apps/ml/permissions/no_ml_access.ts @@ -41,14 +41,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await PageObjects.error.expectForbidden(); }); - it('should not display the ML file data vis link on the Kibana home page', async () => { - await ml.testExecution.logTestStep('should load the Kibana home page'); - await ml.navigation.navigateToKibanaHome(); - - await ml.testExecution.logTestStep('should not display the ML file data vis link'); - await ml.commonUI.assertKibanaHomeFileDataVisLinkNotExists(); - }); - it('should not display the ML entry in Kibana app menu', async () => { await ml.testExecution.logTestStep('should open the Kibana app menu'); await ml.navigation.openKibanaNav(); diff --git a/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts index 55cfb035d0cfe0..ca8accf6ee19f0 100644 --- a/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts +++ b/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts @@ -35,14 +35,6 @@ export default function ({ getService }: FtrProviderContext) { await ml.securityUI.logout(); }); - it('should not display the ML file data vis link on the Kibana home page', async () => { - await ml.testExecution.logTestStep('should load the Kibana home page'); - await ml.navigation.navigateToKibanaHome(); - - await ml.testExecution.logTestStep('should not display the ML file data vis link'); - await ml.commonUI.assertKibanaHomeFileDataVisLinkNotExists(); - }); - it('should display the ML entry in Kibana app menu', async () => { await ml.testExecution.logTestStep('should open the Kibana app menu'); await ml.navigation.openKibanaNav(); diff --git a/x-pack/test/functional/services/ml/common_ui.ts b/x-pack/test/functional/services/ml/common_ui.ts index b61bc8871482ff..67a0b3f4feeea6 100644 --- a/x-pack/test/functional/services/ml/common_ui.ts +++ b/x-pack/test/functional/services/ml/common_ui.ts @@ -98,14 +98,6 @@ export function MachineLearningCommonUIProvider({ getService }: FtrProviderConte }); }, - async assertKibanaHomeFileDataVisLinkExists() { - await testSubjects.existOrFail('homeSynopsisLinkml_file_data_visualizer'); - }, - - async assertKibanaHomeFileDataVisLinkNotExists() { - await testSubjects.missingOrFail('homeSynopsisLinkml_file_data_visualizer'); - }, - async assertRadioGroupValue(testSubject: string, expectedValue: string) { const assertRadioGroupValue = await testSubjects.find(testSubject); const input = await assertRadioGroupValue.findByCssSelector(':checked'); diff --git a/x-pack/test/functional_basic/apps/ml/permissions/full_ml_access.ts b/x-pack/test/functional_basic/apps/ml/permissions/full_ml_access.ts index 6a80fe18404fbc..6b38445b27c107 100644 --- a/x-pack/test/functional_basic/apps/ml/permissions/full_ml_access.ts +++ b/x-pack/test/functional_basic/apps/ml/permissions/full_ml_access.ts @@ -55,14 +55,6 @@ export default function ({ getService }: FtrProviderContext) { await ml.securityUI.logout(); }); - it('should display the ML file data vis link on the Kibana home page', async () => { - await ml.testExecution.logTestStep('should load the Kibana home page'); - await ml.navigation.navigateToKibanaHome(); - - await ml.testExecution.logTestStep('should display the ML file data vis link'); - await ml.commonUI.assertKibanaHomeFileDataVisLinkExists(); - }); - it('should display the ML entry in Kibana app menu', async () => { await ml.testExecution.logTestStep('should open the Kibana app menu'); await ml.navigation.openKibanaNav(); diff --git a/x-pack/test/functional_basic/apps/ml/permissions/no_ml_access.ts b/x-pack/test/functional_basic/apps/ml/permissions/no_ml_access.ts index 91a37d0d98cda3..7130a3c03f14a6 100644 --- a/x-pack/test/functional_basic/apps/ml/permissions/no_ml_access.ts +++ b/x-pack/test/functional_basic/apps/ml/permissions/no_ml_access.ts @@ -39,14 +39,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await PageObjects.error.expectForbidden(); }); - it('should not display the ML file data vis link on the Kibana home page', async () => { - await ml.testExecution.logTestStep('should load the Kibana home page'); - await ml.navigation.navigateToKibanaHome(); - - await ml.testExecution.logTestStep('should not display the ML file data vis link'); - await ml.commonUI.assertKibanaHomeFileDataVisLinkNotExists(); - }); - it('should not display the ML entry in Kibana app menu', async () => { await ml.testExecution.logTestStep('should open the Kibana app menu'); await ml.navigation.openKibanaNav(); diff --git a/x-pack/test/functional_basic/apps/ml/permissions/read_ml_access.ts b/x-pack/test/functional_basic/apps/ml/permissions/read_ml_access.ts index f207b795820048..5650db2b6511fd 100644 --- a/x-pack/test/functional_basic/apps/ml/permissions/read_ml_access.ts +++ b/x-pack/test/functional_basic/apps/ml/permissions/read_ml_access.ts @@ -55,14 +55,6 @@ export default function ({ getService }: FtrProviderContext) { await ml.securityUI.logout(); }); - it('should not display the ML file data vis link on the Kibana home page', async () => { - await ml.testExecution.logTestStep('should load the Kibana home page'); - await ml.navigation.navigateToKibanaHome(); - - await ml.testExecution.logTestStep('should not display the ML file data vis link'); - await ml.commonUI.assertKibanaHomeFileDataVisLinkNotExists(); - }); - it('should display the ML entry in Kibana app menu', async () => { await ml.testExecution.logTestStep('should open the Kibana app menu'); await ml.navigation.openKibanaNav(); From 8094b21a9c7fd15e0524e82934bc90099f044dc9 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 4 Jun 2021 11:02:42 -0600 Subject: [PATCH 07/11] more clean-up of ml_file_data_visualizer --- .../test/ui_capabilities/security_and_spaces/tests/catalogue.ts | 2 -- x-pack/test/ui_capabilities/security_only/tests/catalogue.ts | 2 -- 2 files changed, 4 deletions(-) diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts index afd8d1fb54cf6e..d8ad9537c83d16 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts @@ -51,7 +51,6 @@ export default function catalogueTests({ getService }: FtrProviderContext) { uiCapabilities.value!.catalogue, (enabled, catalogueId) => catalogueId !== 'ml' && - catalogueId !== 'ml_file_data_visualizer' && catalogueId !== 'monitoring' && !esFeatureExceptions.includes(catalogueId) ); @@ -68,7 +67,6 @@ export default function catalogueTests({ getService }: FtrProviderContext) { // (easier to say: all "proper" Kibana features are enabled) const exceptions = [ 'ml', - 'ml_file_data_visualizer', 'monitoring', 'enterpriseSearch', 'appSearch', diff --git a/x-pack/test/ui_capabilities/security_only/tests/catalogue.ts b/x-pack/test/ui_capabilities/security_only/tests/catalogue.ts index d64b4f75e20a6c..49437d2059226d 100644 --- a/x-pack/test/ui_capabilities/security_only/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/security_only/tests/catalogue.ts @@ -52,7 +52,6 @@ export default function catalogueTests({ getService }: FtrProviderContext) { (enabled, catalogueId) => catalogueId !== 'ml' && catalogueId !== 'monitoring' && - catalogueId !== 'ml_file_data_visualizer' && !esFeatureExceptions.includes(catalogueId) ); expect(uiCapabilities.value!.catalogue).to.eql(expected); @@ -65,7 +64,6 @@ export default function catalogueTests({ getService }: FtrProviderContext) { // everything except ml and monitoring and enterprise search is enabled const exceptions = [ 'ml', - 'ml_file_data_visualizer', 'monitoring', 'enterpriseSearch', 'appSearch', From dda46dfaf54405b813a266b2a3a9c9a65663ceb1 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 4 Jun 2021 15:27:20 -0600 Subject: [PATCH 08/11] jest snapshot and nav to home page in no_ml_access tests --- .../empty_state/__snapshots__/empty_state.test.tsx.snap | 2 -- x-pack/test/functional/apps/ml/permissions/no_ml_access.ts | 1 + .../test/functional_basic/apps/ml/permissions/no_ml_access.ts | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap index 645694371f9059..1310488c65fab8 100644 --- a/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap +++ b/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/__snapshots__/empty_state.test.tsx.snap @@ -59,7 +59,6 @@ exports[`EmptyState should render normally 1`] = ` } - isDisabled={false} onClick={[Function]} title={ { await ml.testExecution.logTestStep('should open the Kibana app menu'); + await ml.navigation.navigateToKibanaHome(); await ml.navigation.openKibanaNav(); await ml.testExecution.logTestStep('should not display the ML nav link'); diff --git a/x-pack/test/functional_basic/apps/ml/permissions/no_ml_access.ts b/x-pack/test/functional_basic/apps/ml/permissions/no_ml_access.ts index 7130a3c03f14a6..8d3aa3c6b6ada7 100644 --- a/x-pack/test/functional_basic/apps/ml/permissions/no_ml_access.ts +++ b/x-pack/test/functional_basic/apps/ml/permissions/no_ml_access.ts @@ -41,6 +41,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should not display the ML entry in Kibana app menu', async () => { await ml.testExecution.logTestStep('should open the Kibana app menu'); + await ml.navigation.navigateToKibanaHome(); await ml.navigation.openKibanaNav(); await ml.testExecution.logTestStep('should not display the ML nav link'); From 37707624bb35ed2fceb03f8b300f3cc1ecda4bb1 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Tue, 8 Jun 2021 09:14:49 -0600 Subject: [PATCH 09/11] revert change to functional test dual_privileges_all at everything_space --- .../test/ui_capabilities/security_and_spaces/tests/catalogue.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts index d8ad9537c83d16..d44546c670b64c 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts @@ -51,6 +51,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { uiCapabilities.value!.catalogue, (enabled, catalogueId) => catalogueId !== 'ml' && + catalogueId !== 'ml_file_data_visualizer' && catalogueId !== 'monitoring' && !esFeatureExceptions.includes(catalogueId) ); From 015b2bf501a3544542948c1a36bcad1f3e980fdc Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Tue, 8 Jun 2021 11:37:21 -0600 Subject: [PATCH 10/11] revert another change to security_and_spaces/tests/catalogue.ts --- .../test/ui_capabilities/security_and_spaces/tests/catalogue.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts index d44546c670b64c..afd8d1fb54cf6e 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts @@ -68,6 +68,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { // (easier to say: all "proper" Kibana features are enabled) const exceptions = [ 'ml', + 'ml_file_data_visualizer', 'monitoring', 'enterpriseSearch', 'appSearch', From 7890959ba4d70fbff957434794f44a1e460b7162 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Tue, 8 Jun 2021 14:36:05 -0600 Subject: [PATCH 11/11] revert changes to x-pack/test/ui_capabilities/security_only/tests/catalogue.ts --- x-pack/test/ui_capabilities/security_only/tests/catalogue.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/test/ui_capabilities/security_only/tests/catalogue.ts b/x-pack/test/ui_capabilities/security_only/tests/catalogue.ts index 49437d2059226d..d64b4f75e20a6c 100644 --- a/x-pack/test/ui_capabilities/security_only/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/security_only/tests/catalogue.ts @@ -52,6 +52,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { (enabled, catalogueId) => catalogueId !== 'ml' && catalogueId !== 'monitoring' && + catalogueId !== 'ml_file_data_visualizer' && !esFeatureExceptions.includes(catalogueId) ); expect(uiCapabilities.value!.catalogue).to.eql(expected); @@ -64,6 +65,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { // everything except ml and monitoring and enterprise search is enabled const exceptions = [ 'ml', + 'ml_file_data_visualizer', 'monitoring', 'enterpriseSearch', 'appSearch',