Skip to content

Commit

Permalink
[Enterprise Search] Update Enterprise Search Decommissioning Callout (e…
Browse files Browse the repository at this point in the history
…lastic#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)
  • Loading branch information
markjhoy authored Oct 24, 2024
1 parent 2d39116 commit 20a83d1
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 43 deletions.
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -41,6 +42,7 @@ export const EmptyState: React.FC = () => {
{showDeprecationCallout ? (
<EnterpriseSearchDeprecationCallout
onDismissAction={onDismissDeprecationCallout}
learnMoreLinkUrl={docLinks.appSearchGuide}
restrictWidth
/>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -59,7 +60,10 @@ export const AppSearchPageTemplate: React.FC<
>
{pageViewTelemetry && <SendAppSearchTelemetry action="viewed" metric={pageViewTelemetry} />}
{showDeprecationCallout ? (
<EnterpriseSearchDeprecationCallout onDismissAction={onDismissDeprecationCallout} />
<EnterpriseSearchDeprecationCallout
onDismissAction={onDismissDeprecationCallout}
learnMoreLinkUrl={docLinks.appSearchGuide}
/>
) : (
<></>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import { EnterpriseSearchDeprecationCallout } from './deprecation_callout';
describe('EnterpriseSearchDeprecationCallout', () => {
it('renders', () => {
const dismissFxn = jest.fn();
const wrapper = shallow(<EnterpriseSearchDeprecationCallout onDismissAction={dismissFxn} />);
const wrapper = shallow(
<EnterpriseSearchDeprecationCallout onDismissAction={dismissFxn} learnMoreLinkUrl="#" />
);

expect(wrapper.find('EuiCallOut')).toHaveLength(1);
wrapper.find('EuiCallOut').simulate('dismiss');
Expand All @@ -23,7 +25,9 @@ describe('EnterpriseSearchDeprecationCallout', () => {

it('dismisses via the link', () => {
const dismissFxn = jest.fn();
const wrapper = shallow(<EnterpriseSearchDeprecationCallout onDismissAction={dismissFxn} />);
const wrapper = shallow(
<EnterpriseSearchDeprecationCallout onDismissAction={dismissFxn} learnMoreLinkUrl="#" />
);

expect(wrapper.find('EuiLink')).toHaveLength(1);
wrapper.find('EuiLink').simulate('click');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<DeprecationCalloutProps> = ({
onDismissAction,
learnMoreLinkUrl,
restrictWidth = false,
}) => {
const maxWidth = restrictWidth ? '75%' : '100%';
Expand All @@ -43,48 +43,14 @@ export const EnterpriseSearchDeprecationCallout: React.FC<DeprecationCalloutProp
data-test-subj="EnterpriseSearchDeprecationCallout"
>
<FormattedMessage
id="xpack.enterpriseSearch.deprecationCallout.first_message"
defaultMessage="The standalone Enterprise Search product, including App Search and Workplace Search, remains available in maintenance mode, but are not recommended for new search experiences. Instead, we recommend using our actively developed Elasticsearch-native tools. These tools offer the flexibility and composability of working directly with Elasticsearch indices."
/>
<EuiSpacer size="s" />
<FormattedMessage
id="xpack.enterpriseSearch.deprecationCallout.second_message"
defaultMessage="See this {workplaceSearchBlogUrl} for more information about upgrading your internal knowledge search or this {appSearchBlogUrl} about upgrading your catalog search."
values={{
workplaceSearchBlogUrl: (
<EuiLink
data-test-subj="workplaceSearch-deprecationCallout-blog-link"
href={docLinks.workplaceSearchEvolutionBlog}
target="_blank"
data-telemetry-id="workplaceSearch-deprecationCallout-blog-viewLink"
>
{i18n.translate(
'xpack.enterpriseSearch.deprecationCallout.viewWorkplaceSearchBlog',
{
defaultMessage: 'blog post',
}
)}
</EuiLink>
),
appSearchBlogUrl: (
<EuiLink
data-test-subj="appSearch-deprecationCallout-blog-link"
href={docLinks.appSearchEvolutionBlog}
target="_blank"
data-telemetry-id="appSearch-deprecationCallout-blog-viewLink"
>
{i18n.translate('xpack.enterpriseSearch.deprecationCallout.viewAppSearchBlog', {
defaultMessage: 'blog post',
})}
</EuiLink>
),
}}
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."
/>
<EuiSpacer size="s" />
<EuiFlexGroup direction="row" alignItems="center" justifyContent="flexStart">
<EuiFlexItem grow={false}>
<EuiButton
href={docLinks.appSearchEvolutionBlog}
href={learnMoreLinkUrl}
color="warning"
iconType="popout"
iconSide="right"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class DocLinks {
public workplaceSearchGitHub: string;
public workplaceSearchGmail: string;
public workplaceSearchGoogleDrive: string;
public workplaceSearchGuide: string;
public workplaceSearchIndexingSchedule: string;
public workplaceSearchJiraCloud: string;
public workplaceSearchJiraServer: string;
Expand Down Expand Up @@ -352,6 +353,7 @@ class DocLinks {
this.workplaceSearchGitHub = '';
this.workplaceSearchGmail = '';
this.workplaceSearchGoogleDrive = '';
this.workplaceSearchGuide = '';
this.workplaceSearchIndexingSchedule = '';
this.workplaceSearchJiraCloud = '';
this.workplaceSearchJiraServer = '';
Expand Down Expand Up @@ -540,6 +542,7 @@ class DocLinks {
this.workplaceSearchGitHub = docLinks.links.workplaceSearch.gitHub;
this.workplaceSearchGmail = docLinks.links.workplaceSearch.gmail;
this.workplaceSearchGoogleDrive = docLinks.links.workplaceSearch.googleDrive;
this.workplaceSearchGuide = docLinks.links.workplaceSearch.guide;
this.workplaceSearchIndexingSchedule = docLinks.links.workplaceSearch.indexingSchedule;
this.workplaceSearchJiraCloud = docLinks.links.workplaceSearch.jiraCloud;
this.workplaceSearchJiraServer = docLinks.links.workplaceSearch.jiraServer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { useValues } from 'kea';

import { EuiEmptyPrompt, EuiButton, EuiLink, EuiSpacer, EuiText } from '@elastic/eui';

import { APP_SEARCH_PLUGIN } from '../../../../common/constants';
import { EnterpriseSearchDeprecationCallout } from '../deprecation_callout/deprecation_callout';
import { docLinks } from '../doc_links';
import { KibanaLogic } from '../kibana/kibana_logic';
import { ProductName } from '../types';

Expand Down Expand Up @@ -52,11 +54,17 @@ export const RolesEmptyPrompt: React.FC<Props> = ({ onEnable, docsLink, productN
return null;
}

const deprecationLearnMoreLink =
productName === APP_SEARCH_PLUGIN.NAME
? docLinks.appSearchGuide
: docLinks.workplaceSearchGuide;

return (
<>
{showDeprecationCallout ? (
<EnterpriseSearchDeprecationCallout
onDismissAction={onDismissDeprecationCallout}
learnMoreLinkUrl={deprecationLearnMoreLink}
restrictWidth
/>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -77,7 +78,10 @@ export const Overview: React.FC = () => {
isLoading={dataLoading}
>
{showDeprecationCallout ? (
<EnterpriseSearchDeprecationCallout onDismissAction={onDismissDeprecationCallout} />
<EnterpriseSearchDeprecationCallout
onDismissAction={onDismissDeprecationCallout}
learnMoreLinkUrl={docLinks.workplaceSearchGuide}
/>
) : (
<></>
)}
Expand Down

0 comments on commit 20a83d1

Please sign in to comment.