From 20a83d1785eec579f9f37a6337357d8a6eee59cd Mon Sep 17 00:00:00 2001 From: "Mark J. Hoy" Date: Thu, 24 Oct 2024 15:10:16 -0400 Subject: [PATCH] [Enterprise Search] Update Enterprise Search Decommissioning Callout (#197658) ## Summary Updates the decommissioning callout text and makes the "Learn more" button context aware for App Search and Workplace Search. ![image](https://github.com/user-attachments/assets/4871fbb3-61f1-4c39-8af0-d8964a091bca) ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) - [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --- 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.test.tsx | 8 +++- .../deprecation_callout.tsx | 44 +++---------------- .../shared/doc_links/doc_links.ts | 3 ++ .../role_mapping/roles_empty_prompt.tsx | 8 ++++ .../views/overview/overview.tsx | 6 ++- 9 files changed, 36 insertions(+), 43 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.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'); 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 ? ( - + ) : ( <> )}