From 2725560c974db825fb6445101915c42e1aaa8437 Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Thu, 24 Oct 2024 10:12:52 -0400 Subject: [PATCH 1/2] update callout message; context-aware learn more --- packages/kbn-doc-links/src/get_doc_links.ts | 1 + packages/kbn-doc-links/src/types.ts | 1 + .../engines/components/empty_state.tsx | 2 + .../components/layout/page_template.tsx | 6 ++- .../deprecation_callout.tsx | 44 +++---------------- .../shared/doc_links/doc_links.ts | 3 ++ .../role_mapping/roles_empty_prompt.tsx | 8 ++++ .../views/overview/overview.tsx | 6 ++- 8 files changed, 30 insertions(+), 41 deletions(-) diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index 4160e4a94f5ad..1aa917eb1eae8 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -252,6 +252,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D gitHub: `${WORKPLACE_SEARCH_DOCS}workplace-search-github-connector.html`, gmail: `${WORKPLACE_SEARCH_DOCS}workplace-search-gmail-connector.html`, googleDrive: `${WORKPLACE_SEARCH_DOCS}workplace-search-google-drive-connector.html`, + guide: `${WORKPLACE_SEARCH_DOCS}index.html`, indexingSchedule: `${WORKPLACE_SEARCH_DOCS}workplace-search-customizing-indexing-rules.html#_indexing_schedule`, jiraCloud: `${WORKPLACE_SEARCH_DOCS}workplace-search-jira-cloud-connector.html`, jiraServer: `${WORKPLACE_SEARCH_DOCS}workplace-search-jira-server-connector.html`, diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index 53118549726c9..67d4106d5be9d 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -215,6 +215,7 @@ export interface DocLinks { readonly gettingStarted: string; readonly gmail: string; readonly googleDrive: string; + readonly guide: string; readonly indexingSchedule: string; readonly jiraCloud: string; readonly jiraServer: string; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.tsx index ef2f48dbe6c20..08e1260166a6e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_state.tsx @@ -13,6 +13,7 @@ import { EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { EnterpriseSearchDeprecationCallout } from '../../../../shared/deprecation_callout/deprecation_callout'; +import { docLinks } from '../../../../shared/doc_links'; import { EuiButtonTo } from '../../../../shared/react_router_helpers'; import { TelemetryLogic } from '../../../../shared/telemetry'; import { AppLogic } from '../../../app_logic'; @@ -41,6 +42,7 @@ export const EmptyState: React.FC = () => { {showDeprecationCallout ? ( ) : ( diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/page_template.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/page_template.tsx index f834c45965508..0b32d40ea334f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/page_template.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/page_template.tsx @@ -12,6 +12,7 @@ import useObservable from 'react-use/lib/useObservable'; import { APP_SEARCH_PLUGIN } from '../../../../../common/constants'; import { EnterpriseSearchDeprecationCallout } from '../../../shared/deprecation_callout/deprecation_callout'; +import { docLinks } from '../../../shared/doc_links'; import { KibanaLogic } from '../../../shared/kibana'; import { SetAppSearchChrome } from '../../../shared/kibana_chrome'; import { EnterpriseSearchPageTemplateWrapper, PageTemplateProps } from '../../../shared/layout'; @@ -59,7 +60,10 @@ export const AppSearchPageTemplate: React.FC< > {pageViewTelemetry && } {showDeprecationCallout ? ( - + ) : ( <> )} diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/deprecation_callout/deprecation_callout.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/deprecation_callout/deprecation_callout.tsx index 0c8ba65291ecf..e05b45fdfba2a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/deprecation_callout/deprecation_callout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/deprecation_callout/deprecation_callout.tsx @@ -11,15 +11,15 @@ import { EuiCallOut, EuiButton, EuiLink, EuiFlexItem, EuiFlexGroup, EuiSpacer } import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { docLinks } from '../doc_links'; - interface DeprecationCalloutProps { onDismissAction: () => void; + learnMoreLinkUrl: string; restrictWidth?: boolean; } export const EnterpriseSearchDeprecationCallout: React.FC = ({ onDismissAction, + learnMoreLinkUrl, restrictWidth = false, }) => { const maxWidth = restrictWidth ? '75%' : '100%'; @@ -43,48 +43,14 @@ export const EnterpriseSearchDeprecationCallout: React.FC - - - {i18n.translate( - 'xpack.enterpriseSearch.deprecationCallout.viewWorkplaceSearchBlog', - { - defaultMessage: 'blog post', - } - )} - - ), - appSearchBlogUrl: ( - - {i18n.translate('xpack.enterpriseSearch.deprecationCallout.viewAppSearchBlog', { - defaultMessage: 'blog post', - })} - - ), - }} + id="xpack.enterpriseSearch.deprecationCallout.message" + defaultMessage="The standalone App Search and Workplace Search products remain available in maintenance mode. We recommend using our Elastic Stack tools to build new semantic and AI powered search experiences." /> = ({ onEnable, docsLink, productN return null; } + const deprecationLearnMoreLink = + productName === APP_SEARCH_PLUGIN.NAME + ? docLinks.appSearchGuide + : docLinks.workplaceSearchGuide; + return ( <> {showDeprecationCallout ? ( ) : ( diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.tsx index c9c13c3ad5465..4bc9455498128 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview.tsx @@ -13,6 +13,7 @@ import { EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { EnterpriseSearchDeprecationCallout } from '../../../shared/deprecation_callout/deprecation_callout'; +import { docLinks } from '../../../shared/doc_links'; import { AppLogic } from '../../app_logic'; import { WorkplaceSearchPageTemplate } from '../../components/layout'; @@ -77,7 +78,10 @@ export const Overview: React.FC = () => { isLoading={dataLoading} > {showDeprecationCallout ? ( - + ) : ( <> )} From b8861a30880a6ee642d215373f4df7babf10064f Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Thu, 24 Oct 2024 11:58:07 -0400 Subject: [PATCH 2/2] fix missing var in test --- .../deprecation_callout/deprecation_callout.test.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/deprecation_callout/deprecation_callout.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/deprecation_callout/deprecation_callout.test.tsx index e4bad3393e0d9..3da3b5e45aaa7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/deprecation_callout/deprecation_callout.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/deprecation_callout/deprecation_callout.test.tsx @@ -14,7 +14,9 @@ import { EnterpriseSearchDeprecationCallout } from './deprecation_callout'; describe('EnterpriseSearchDeprecationCallout', () => { it('renders', () => { const dismissFxn = jest.fn(); - const wrapper = shallow(); + const wrapper = shallow( + + ); expect(wrapper.find('EuiCallOut')).toHaveLength(1); wrapper.find('EuiCallOut').simulate('dismiss'); @@ -23,7 +25,9 @@ describe('EnterpriseSearchDeprecationCallout', () => { it('dismisses via the link', () => { const dismissFxn = jest.fn(); - const wrapper = shallow(); + const wrapper = shallow( + + ); expect(wrapper.find('EuiLink')).toHaveLength(1); wrapper.find('EuiLink').simulate('click');