[Enterprise Search] Remove Workplace Search from Top Level Search (#166747)

## Summary

Removes legacy Workplace Search result from the top level search.

![image](5b854468-1d1f-4ddc-8fe9-80dcde8c8ccb)

This is part of the initiative for a longer term place for eventually
deprecating the legacy Workplace Search app.


### Checklist
- [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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Mark J. Hoy 2023-09-19 13:29:22 -04:00 committed by GitHub
parent 20be3d0b5d
commit c5c2156621
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 10 deletions

View file

@ -8,7 +8,7 @@
import { NEVER } from 'rxjs';
import { TestScheduler } from 'rxjs/testing';
import { ENTERPRISE_SEARCH_CONTENT_PLUGIN } from '../../common/constants';
import { APP_SEARCH_PLUGIN, ENTERPRISE_SEARCH_CONTENT_PLUGIN } from '../../common/constants';
import { getSearchResultProvider } from './search_result_provider';
@ -47,6 +47,18 @@ describe('Enterprise Search search provider', () => {
},
};
const appSearchResult = {
icon: 'logoEnterpriseSearch',
id: 'app_search',
score: 100,
title: 'App Search',
type: 'Search',
url: {
path: `${APP_SEARCH_PLUGIN.URL}`,
prependBasePath: true,
},
};
const searchResultProvider = getSearchResultProvider(basePathMock, {
hasConnectors: true,
hasWebCrawler: true,
@ -192,5 +204,41 @@ describe('Enterprise Search search provider', () => {
});
});
});
it('returns results for legacy app search', () => {
const searchProvider = getSearchResultProvider(basePathMock, {
hasConnectors: false,
hasWebCrawler: false,
canDeployEntSearch: true,
} as any);
getTestScheduler().run(({ expectObservable }) => {
expectObservable(
searchProvider.find(
{ term: 'app search' },
{ aborted$: NEVER, maxResults: 1, preference: '' },
{} as any
)
).toBe('(a|)', {
a: [appSearchResult],
});
});
});
it('does not return results for legacy workplace search', () => {
const searchProvider = getSearchResultProvider(basePathMock, {
hasConnectors: false,
hasWebCrawler: false,
canDeployEntSearch: true,
} as any);
getTestScheduler().run(({ expectObservable }) => {
expectObservable(
searchProvider.find(
{ term: 'workplace search' },
{ aborted$: NEVER, maxResults: 1, preference: '' },
{} as any
)
).toBe('(a|)', {
a: [],
});
});
});
});
});

View file

@ -18,7 +18,6 @@ import {
ENTERPRISE_SEARCH_CONNECTOR_CRAWLER_SERVICE_TYPE,
ENTERPRISE_SEARCH_CONTENT_PLUGIN,
APP_SEARCH_PLUGIN,
WORKPLACE_SEARCH_PLUGIN,
ESRE_PLUGIN,
} from '../../common/constants';
@ -106,14 +105,6 @@ export function getSearchResultProvider(
serviceType: 'app_search',
url: APP_SEARCH_PLUGIN.URL,
},
{
keywords: ['workplace', 'search'],
name: i18n.translate('xpack.enterpriseSearch.searchProvider.workplaceSearch.name', {
defaultMessage: 'Workplace Search',
}),
serviceType: 'workplace_search',
url: WORKPLACE_SEARCH_PLUGIN.URL,
},
{
keywords: ['esre', 'search'],
name: i18n.translate('xpack.enterpriseSearch.searchProvider.esre.name', {