diff --git a/x-pack/plugins/enterprise_search/common/constants.ts b/x-pack/plugins/enterprise_search/common/constants.ts index fc9a47717871b29..c5839df4c603b30 100644 --- a/x-pack/plugins/enterprise_search/common/constants.ts +++ b/x-pack/plugins/enterprise_search/common/constants.ts @@ -4,6 +4,40 @@ * you may not use this file except in compliance with the Elastic License. */ +import { i18n } from '@kbn/i18n'; + +export const ENTERPRISE_SEARCH_PLUGIN = { + ID: 'enterpriseSearch', + NAME: i18n.translate('xpack.enterpriseSearch.productName', { + defaultMessage: 'Enterprise Search', + }), + URL: '/app/enterprise_search', +}; + +export const APP_SEARCH_PLUGIN = { + ID: 'appSearch', + NAME: i18n.translate('xpack.enterpriseSearch.appSearch.productName', { + defaultMessage: 'App Search', + }), + DESCRIPTION: i18n.translate('xpack.enterpriseSearch.appSearch.productDescription', { + defaultMessage: + 'Leverage dashboards, analytics, and APIs for advanced application search made simple.', + }), + URL: '/app/enterprise_search/app_search', +}; + +export const WORKPLACE_SEARCH_PLUGIN = { + ID: 'workplaceSearch', + NAME: i18n.translate('xpack.enterpriseSearch.workplaceSearch.productName', { + defaultMessage: 'Workplace Search', + }), + DESCRIPTION: i18n.translate('xpack.enterpriseSearch.workplaceSearch.productDescription', { + defaultMessage: + 'Search all documents, files, and sources available across your virtual workplace.', + }), + URL: '/app/enterprise_search/workplace_search', +}; + export const JSON_HEADER = { 'Content-Type': 'application/json' }; // This needs specific casing or Chrome throws a 415 error export const ENGINES_PAGE_SIZE = 10; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx index df278bf938a690b..f899423319afc9d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx @@ -9,6 +9,7 @@ import { EuiSpacer, EuiTitle, EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; +import { APP_SEARCH_PLUGIN } from '../../../../../common/constants'; import { SetupGuide as SetupGuideLayout } from '../../../shared/setup_guide'; import { SetAppSearchBreadcrumbs as SetBreadcrumbs } from '../../../shared/kibana_breadcrumbs'; import { SendAppSearchTelemetry as SendTelemetry } from '../../../shared/telemetry'; @@ -16,14 +17,16 @@ import GettingStarted from '../../assets/getting_started.png'; export const SetupGuide: React.FC = () => ( - + ( breadcrumbs: TBreadcrumbs = [] ) => [ - generateBreadcrumb({ text: 'Enterprise Search' }), + generateBreadcrumb({ text: ENTERPRISE_SEARCH_PLUGIN.NAME }), ...breadcrumbs.map(({ text, path }: IGenerateBreadcrumbProps) => generateBreadcrumb({ text, path, history }) ), ]; export const appSearchBreadcrumbs = (history: History) => (breadcrumbs: TBreadcrumbs = []) => - enterpriseSearchBreadcrumbs(history)([{ text: 'App Search', path: '/' }, ...breadcrumbs]); + enterpriseSearchBreadcrumbs(history)([ + { text: APP_SEARCH_PLUGIN.NAME, path: '/' }, + ...breadcrumbs, + ]); export const workplaceSearchBreadcrumbs = (history: History) => (breadcrumbs: TBreadcrumbs = []) => - enterpriseSearchBreadcrumbs(history)([{ text: 'Workplace Search', path: '/' }, ...breadcrumbs]); + enterpriseSearchBreadcrumbs(history)([ + { text: WORKPLACE_SEARCH_PLUGIN.NAME, path: '/' }, + ...breadcrumbs, + ]); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx index 9fa508d599425e6..a1bc17e05dc056e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/error_state/error_state.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import { WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants'; import { ErrorStatePrompt } from '../../../shared/error_state'; import { SetWorkplaceSearchBreadcrumbs as SetBreadcrumbs } from '../../../shared/kibana_breadcrumbs'; import { SendWorkplaceSearchTelemetry as SendTelemetry } from '../../../shared/telemetry'; @@ -20,11 +20,7 @@ export const ErrorState: React.FC = () => { - + diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/setup_guide/setup_guide.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/setup_guide/setup_guide.tsx index 5b5d067d23eb8fb..e96d114c67c5d5b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/setup_guide/setup_guide.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/setup_guide/setup_guide.tsx @@ -9,8 +9,8 @@ import { EuiSpacer, EuiTitle, EuiText, EuiButton } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; +import { WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants'; import { SetupGuide as SetupGuideLayout } from '../../../shared/setup_guide'; - import { SetWorkplaceSearchBreadcrumbs as SetBreadcrumbs } from '../../../shared/kibana_breadcrumbs'; import { SendWorkplaceSearchTelemetry as SendTelemetry } from '../../../shared/telemetry'; import GettingStarted from '../../assets/getting_started.png'; @@ -21,14 +21,16 @@ const GETTING_STARTED_LINK_URL = export const SetupGuide: React.FC = () => { return ( - + diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts index fc95828a3f4a4f6..66d2ae82fe3ce68 100644 --- a/x-pack/plugins/enterprise_search/public/plugin.ts +++ b/x-pack/plugins/enterprise_search/public/plugin.ts @@ -20,6 +20,7 @@ import { import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; import { LicensingPluginSetup } from '../../licensing/public'; +import { APP_SEARCH_PLUGIN, WORKPLACE_SEARCH_PLUGIN } from '../common/constants'; import { getPublicUrl } from './applications/shared/enterprise_search_url'; import AppSearchLogo from './applications/app_search/assets/logo.svg'; import WorkplaceSearchLogo from './applications/workplace_search/assets/logo.svg'; @@ -44,9 +45,9 @@ export class EnterpriseSearchPlugin implements Plugin { const config = { host: this.config.host }; core.application.register({ - id: 'appSearch', - title: 'App Search', - appRoute: '/app/enterprise_search/app_search', + id: APP_SEARCH_PLUGIN.ID, + title: APP_SEARCH_PLUGIN.NAME, + appRoute: APP_SEARCH_PLUGIN.URL, category: DEFAULT_APP_CATEGORIES.enterpriseSearch, mount: async (params: AppMountParameters) => { const [coreStart] = await core.getStartServices(); @@ -61,9 +62,9 @@ export class EnterpriseSearchPlugin implements Plugin { }); core.application.register({ - id: 'workplaceSearch', - title: 'Workplace Search', - appRoute: '/app/enterprise_search/workplace_search', + id: WORKPLACE_SEARCH_PLUGIN.ID, + title: WORKPLACE_SEARCH_PLUGIN.NAME, + appRoute: WORKPLACE_SEARCH_PLUGIN.URL, category: DEFAULT_APP_CATEGORIES.enterpriseSearch, mount: async (params: AppMountParameters) => { const [coreStart] = await core.getStartServices(); @@ -76,23 +77,21 @@ export class EnterpriseSearchPlugin implements Plugin { }); plugins.home.featureCatalogue.register({ - id: 'appSearch', - title: 'App Search', + id: APP_SEARCH_PLUGIN.ID, + title: APP_SEARCH_PLUGIN.NAME, icon: AppSearchLogo, - description: - 'Leverage dashboards, analytics, and APIs for advanced application search made simple.', - path: '/app/enterprise_search/app_search', + description: APP_SEARCH_PLUGIN.DESCRIPTION, + path: APP_SEARCH_PLUGIN.URL, category: FeatureCatalogueCategory.DATA, showOnHomePage: true, }); plugins.home.featureCatalogue.register({ - id: 'workplaceSearch', - title: 'Workplace Search', + id: WORKPLACE_SEARCH_PLUGIN.ID, + title: WORKPLACE_SEARCH_PLUGIN.NAME, icon: WorkplaceSearchLogo, - description: - 'Search all documents, files, and sources available across your virtual workplace.', - path: '/app/enterprise_search/workplace_search', + description: WORKPLACE_SEARCH_PLUGIN.DESCRIPTION, + path: WORKPLACE_SEARCH_PLUGIN.URL, category: FeatureCatalogueCategory.DATA, showOnHomePage: true, }); diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index a7bd68f92f78b9f..6de6671337797dd 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -19,6 +19,11 @@ import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { SecurityPluginSetup } from '../../security/server'; import { PluginSetupContract as FeaturesPluginSetup } from '../../features/server'; +import { + ENTERPRISE_SEARCH_PLUGIN, + APP_SEARCH_PLUGIN, + WORKPLACE_SEARCH_PLUGIN, +} from '../common/constants'; import { ConfigType } from './'; import { checkAccess } from './lib/check_access'; import { registerPublicUrlRoute } from './routes/enterprise_search/public_url'; @@ -64,13 +69,13 @@ export class EnterpriseSearchPlugin implements Plugin { * Register space/feature control */ features.registerFeature({ - id: 'enterpriseSearch', - name: 'Enterprise Search', + id: ENTERPRISE_SEARCH_PLUGIN.ID, + name: ENTERPRISE_SEARCH_PLUGIN.NAME, order: 0, icon: 'logoEnterpriseSearch', - navLinkId: 'appSearch', // TODO - remove this once functional tests no longer rely on navLinkId - app: ['kibana', 'appSearch', 'workplaceSearch'], // TODO: 'enterpriseSearch' - catalogue: ['appSearch', 'workplaceSearch'], // TODO: 'enterpriseSearch' + navLinkId: APP_SEARCH_PLUGIN.ID, // TODO - remove this once functional tests no longer rely on navLinkId + app: ['kibana', APP_SEARCH_PLUGIN.ID, WORKPLACE_SEARCH_PLUGIN.ID], + catalogue: [APP_SEARCH_PLUGIN.ID, WORKPLACE_SEARCH_PLUGIN.ID], privileges: null, }); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx index 7b5c714c236b39d..90e24f6da5d0a1d 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { Direction, - EuiButtonEmpty, + EuiButton, EuiCallOut, EuiEmptyPrompt, EuiFlexGroup, @@ -147,25 +147,29 @@ export const DataFrameAnalyticsList: FC = ({ return ( <> {i18n.translate('xpack.ml.dataFrame.analyticsList.emptyPromptTitle', { - defaultMessage: 'No data frame analytics jobs found', + defaultMessage: 'Create your first data frame analytics job', })} } actions={ !isManagementTable ? [ - setIsSourceIndexModalVisible(true)} isDisabled={disabled} + color="primary" + iconType="plusInCircle" + fill data-test-subj="mlAnalyticsCreateFirstButton" > {i18n.translate('xpack.ml.dataFrame.analyticsList.emptyPromptButtonText', { - defaultMessage: 'Create your first data frame analytics job', + defaultMessage: 'Create job', })} - , + , ] : [] }