diff --git a/src/plugins/home/public/application/components/add_data/add_data.test.tsx b/src/plugins/home/public/application/components/add_data/add_data.test.tsx index 24635ef4aaa89..10119632c01b7 100644 --- a/src/plugins/home/public/application/components/add_data/add_data.test.tsx +++ b/src/plugins/home/public/application/components/add_data/add_data.test.tsx @@ -9,6 +9,7 @@ import React from 'react'; import { AddData } from './add_data'; import { shallowWithIntl } from '@kbn/test/jest'; +import { FeatureCatalogueEntry, FeatureCatalogueCategory } from '../../../services'; jest.mock('../app_navigation_handler', () => { return { @@ -28,9 +29,9 @@ beforeEach(() => { const addBasePathMock = jest.fn((path: string) => (path ? path : 'path')); -const mockFeatures = [ +const mockFeatures: FeatureCatalogueEntry[] = [ { - category: 'data', + category: FeatureCatalogueCategory.DATA, description: 'Ingest data from popular apps and services.', showOnHomePage: true, icon: 'indexOpen', @@ -40,7 +41,7 @@ const mockFeatures = [ title: 'Ingest data', }, { - category: 'admin', + category: FeatureCatalogueCategory.ADMIN, description: 'Add and manage your fleet of Elastic Agents and integrations.', showOnHomePage: true, icon: 'indexManagementApp', @@ -50,7 +51,7 @@ const mockFeatures = [ title: 'Add Elastic Agent', }, { - category: 'data', + category: FeatureCatalogueCategory.DATA, description: 'Import your own CSV, NDJSON, or log file', showOnHomePage: true, icon: 'document', diff --git a/src/plugins/home/public/application/components/add_data/add_data.tsx b/src/plugins/home/public/application/components/add_data/add_data.tsx index f7ff43db29d6e..e20abab271f29 100644 --- a/src/plugins/home/public/application/components/add_data/add_data.tsx +++ b/src/plugins/home/public/application/components/add_data/add_data.tsx @@ -11,8 +11,7 @@ import PropTypes from 'prop-types'; import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { METRIC_TYPE } from '@kbn/analytics'; -// @ts-expect-error untyped service -import { FeatureCatalogueEntry } from '../../services'; +import type { FeatureCatalogueEntry } from '../../../services'; import { createAppNavigationHandler } from '../app_navigation_handler'; // @ts-expect-error untyped component import { Synopsis } from '../synopsis'; diff --git a/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx b/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx index 6e28b295cd463..5b0728a8a4c71 100644 --- a/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx +++ b/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx @@ -9,6 +9,7 @@ import React from 'react'; import { ManageData } from './manage_data'; import { shallowWithIntl } from '@kbn/test/jest'; +import { FeatureCatalogueEntry, FeatureCatalogueCategory } from '../../../services'; jest.mock('../app_navigation_handler', () => { return { @@ -28,9 +29,9 @@ beforeEach(() => { const addBasePathMock = jest.fn((path: string) => (path ? path : 'path')); -const mockFeatures = [ +const mockFeatures: FeatureCatalogueEntry[] = [ { - category: 'admin', + category: FeatureCatalogueCategory.ADMIN, description: 'Control who has access and what tasks they can perform.', icon: 'securityApp', id: 'security', @@ -40,7 +41,7 @@ const mockFeatures = [ showOnHomePage: true, }, { - category: 'admin', + category: FeatureCatalogueCategory.ADMIN, description: 'Track the real-time health and performance of your deployment.', icon: 'monitoringApp', id: 'monitoring', @@ -50,7 +51,7 @@ const mockFeatures = [ showOnHomePage: true, }, { - category: 'admin', + category: FeatureCatalogueCategory.ADMIN, description: 'Save snapshots to a backup repository, and restore to recover index and cluster state.', icon: 'storage', @@ -61,7 +62,7 @@ const mockFeatures = [ showOnHomePage: true, }, { - category: 'admin', + category: FeatureCatalogueCategory.ADMIN, description: 'Define lifecycle policies to automatically perform operations as an index ages.', icon: 'indexSettings', id: 'index_lifecycle_management', diff --git a/src/plugins/home/public/application/components/manage_data/manage_data.tsx b/src/plugins/home/public/application/components/manage_data/manage_data.tsx index dff3f0b1af428..4ca695b8cb118 100644 --- a/src/plugins/home/public/application/components/manage_data/manage_data.tsx +++ b/src/plugins/home/public/application/components/manage_data/manage_data.tsx @@ -11,8 +11,7 @@ import PropTypes from 'prop-types'; import { EuiFlexGroup, EuiHorizontalRule, EuiSpacer, EuiTitle, EuiFlexItem } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { METRIC_TYPE } from '@kbn/analytics'; -// @ts-expect-error untyped service -import { FeatureCatalogueEntry } from '../../services'; +import { FeatureCatalogueEntry } from '../../../services'; import { createAppNavigationHandler } from '../app_navigation_handler'; // @ts-expect-error untyped component import { Synopsis } from '../synopsis'; diff --git a/src/plugins/home/public/mocks/index.ts b/src/plugins/home/public/mocks.ts similarity index 67% rename from src/plugins/home/public/mocks/index.ts rename to src/plugins/home/public/mocks.ts index 4df32a84ae6c5..32bec31153ba0 100644 --- a/src/plugins/home/public/mocks/index.ts +++ b/src/plugins/home/public/mocks.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -import { featureCatalogueRegistryMock } from '../services/feature_catalogue/feature_catalogue_registry.mock'; -import { environmentServiceMock } from '../services/environment/environment.mock'; -import { configSchema } from '../../config'; -import { tutorialServiceMock } from '../services/tutorials/tutorial_service.mock'; +import { featureCatalogueRegistryMock } from './services/feature_catalogue/feature_catalogue_registry.mock'; +import { environmentServiceMock } from './services/environment/environment.mock'; +import { configSchema } from '../config'; +import { tutorialServiceMock } from './services/tutorials/tutorial_service.mock'; const createSetupContract = () => ({ featureCatalogue: featureCatalogueRegistryMock.createSetup(),