Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ent Search Deprecation] Update enterprise_search URLs for Elasticsearch->Build #202371

Merged
merged 4 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x-pack/plugins/enterprise_search/SERVER.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ On startup, [the plugin](server/plugin.ts) registers all API routes with the mai
API endpoints are organized according to loosely applied RESTful principles. GET for fetching data, POST for creating new data, PUT for updating data. The main routes you'll likely be working with:

`enterprise_search`
- enterprise_search/analytics
- elasticsearch/analytics
- enterprise_search/crawler
- enterprise_search/connectors
- enterprise_search/indices
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/enterprise_search/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const ANALYTICS_PLUGIN = {
defaultMessage:
'Dashboards and tools for visualizing end-user behavior and measuring the performance of your search applications.',
}),
URL: '/app/enterprise_search/analytics',
URL: '/app/elasticsearch/analytics',
SUPPORT_URL: 'https://discuss.elastic.co/c/enterprise-search/',
};

Expand Down Expand Up @@ -162,7 +162,7 @@ export const APPLICATIONS_PLUGIN = {
defaultMessage: 'Build',
}),
SUPPORT_URL: 'https://discuss.elastic.co/c/enterprise-search/',
URL: '/app/enterprise_search/applications',
URL: '/app/elasticsearch/applications',
};

export const VECTOR_SEARCH_PLUGIN = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('AddAnalyticsCollectionsApiLogic', () => {
http.post.mockReturnValue(promise);
const result = createAnalyticsCollection({ name: 'test' });
await nextTick();
expect(http.post).toHaveBeenCalledWith('/internal/enterprise_search/analytics/collections', {
expect(http.post).toHaveBeenCalledWith('/internal/elasticsearch/analytics/collections', {
body: JSON.stringify({ name: 'test' }),
});
await expect(result).resolves.toEqual({ name: 'test' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const createAnalyticsCollection = async ({
name,
}: AddAnalyticsCollectionApiLogicArgs): Promise<AddAnalyticsCollectionApiLogicResponse> => {
const { http } = HttpLogic.values;
const route = '/internal/enterprise_search/analytics/collections';
const route = '/internal/elasticsearch/analytics/collections';
const response = await http.post<AnalyticsCollection>(route, {
body: JSON.stringify({ name }),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('AnalyticsEventsExistApiLogic', () => {
const result = checkAnalyticsEventsExist({ indexName });
await nextTick();
expect(http.get).toHaveBeenCalledWith(
`/internal/enterprise_search/analytics/collection/${indexName}/events/exist`
`/internal/elasticsearch/analytics/collection/${indexName}/events/exist`
);
await expect(result).resolves.toEqual({ exists: true });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const checkAnalyticsEventsExist = async ({
indexName,
}: AnalyticsEventsExistApiLogicArgs): Promise<AnalyticsEventsExistApiLogicResponse> => {
const { http } = HttpLogic.values;
const route = `/internal/enterprise_search/analytics/collection/${indexName}/events/exist`;
const route = `/internal/elasticsearch/analytics/collection/${indexName}/events/exist`;
const response = await http.get<AnalyticsEventsExist>(route);

return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('DeleteAnalyticsCollectionApiLogic', () => {
const result = deleteAnalyticsCollection({ name });
await nextTick();
expect(http.delete).toHaveBeenCalledWith(
`/internal/enterprise_search/analytics/collections/${name}`
`/internal/elasticsearch/analytics/collections/${name}`
);
await expect(result).resolves.toEqual(undefined);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type DeleteAnalyticsCollectionApiLogicResponse = void;

export const deleteAnalyticsCollection = async ({ name }: { name: string }) => {
const { http } = HttpLogic.values;
const route = `/internal/enterprise_search/analytics/collections/${name}`;
const route = `/internal/elasticsearch/analytics/collections/${name}`;
await http.delete<DeleteAnalyticsCollectionApiLogicResponse>(route);

return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('FetchAnalyticsCollectionApiLogic', () => {
const result = fetchAnalyticsCollection({ name });
await nextTick();
expect(http.get).toHaveBeenCalledWith(
`/internal/enterprise_search/analytics/collections/${name}`
`/internal/elasticsearch/analytics/collections/${name}`
);
await expect(result).resolves.toEqual({ name: 'result' });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type FetchAnalyticsCollectionApiLogicResponse = AnalyticsCollection;

export const fetchAnalyticsCollection = async ({ name }: { name: string }) => {
const { http } = HttpLogic.values;
const route = `/internal/enterprise_search/analytics/collections/${name}`;
const route = `/internal/elasticsearch/analytics/collections/${name}`;
const response = await http.get<AnalyticsCollection>(route);

return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('GenerateAnalyticsApiKeyLogic', () => {
});
await nextTick();
expect(http.post).toHaveBeenCalledWith(
'/internal/enterprise_search/analytics/collections/puggles/api_key',
'/internal/elasticsearch/analytics/collections/puggles/api_key',
{
body: JSON.stringify({
keyName: 'puggles read only key',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const generateAnalyticsApiKey = async ({
collectionName: string;
keyName: string;
}) => {
const route = `/internal/enterprise_search/analytics/collections/${collectionName}/api_key`;
const route = `/internal/elasticsearch/analytics/collections/${collectionName}/api_key`;

return await HttpLogic.values.http.post<APIKeyResponse>(route, {
body: JSON.stringify({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('FetchAnalyticsCollectionsApiLogic', () => {
http.get.mockReturnValue(promise);
const result = fetchAnalyticsCollections({});
await nextTick();
expect(http.get).toHaveBeenCalledWith('/internal/enterprise_search/analytics/collections', {
expect(http.get).toHaveBeenCalledWith('/internal/elasticsearch/analytics/collections', {
query: { query: '' },
});
await expect(result).resolves.toEqual([{ name: 'result' }]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const fetchAnalyticsCollections = async ({
query = '',
}: FetchAnalyticsCollectionsApiLogicArgs) => {
const { http } = HttpLogic.values;
const route = '/internal/enterprise_search/analytics/collections';
const route = '/internal/elasticsearch/analytics/collections';
const response = await http.get<FetchAnalyticsCollectionsApiLogicResponse>(route, {
query: {
query,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ const baseNavItems = [
},
{
'data-test-subj': 'searchSideNav-SearchApplications',
href: '/app/enterprise_search/applications/search_applications',
href: '/app/elasticsearch/applications/search_applications',
id: 'searchApplications',
items: undefined,
name: 'Search Applications',
},
{
'data-test-subj': 'searchSideNav-BehavioralAnalytics',
href: '/app/enterprise_search/analytics',
href: '/app/elasticsearch/analytics',
id: 'analyticsCollections',
items: undefined,
name: 'Behavioral Analytics',
Expand Down Expand Up @@ -195,12 +195,12 @@ const mockNavLinks = [
{
id: 'enterpriseSearchApplications:searchApplications',
title: 'Search Applications',
url: '/app/enterprise_search/applications/search_applications',
url: '/app/elasticsearch/applications/search_applications',
},
{
id: 'enterpriseSearchAnalytics',
title: 'Behavioral Analytics',
url: '/app/enterprise_search/analytics',
url: '/app/elasticsearch/analytics',
},
{
id: 'searchInferenceEndpoints:inferenceEndpoints',
Expand Down Expand Up @@ -387,17 +387,17 @@ describe('useEnterpriseSearchApplicationNav', () => {
const engineItem: EuiSideNavItemType<unknown> = enginesItem!.items[0];
expect(engineItem).toMatchInlineSnapshot(`
Object {
"href": "/app/enterprise_search/applications/search_applications/my-test-engine",
"href": "/app/elasticsearch/applications/search_applications/my-test-engine",
"id": "searchApplicationId",
"items": Array [
Object {
"href": "/app/enterprise_search/applications/search_applications/my-test-engine/docs_explorer",
"href": "/app/elasticsearch/applications/search_applications/my-test-engine/docs_explorer",
"id": "enterpriseSearchApplicationDocsExplorer",
"items": undefined,
"name": "Docs Explorer",
},
Object {
"href": "/app/enterprise_search/applications/search_applications/my-test-engine/content",
"href": "/app/elasticsearch/applications/search_applications/my-test-engine/content",
"iconToString": undefined,
"id": "enterpriseSearchApplicationsContent",
"items": undefined,
Expand All @@ -410,7 +410,7 @@ describe('useEnterpriseSearchApplicationNav', () => {
"nameToString": "Content",
},
Object {
"href": "/app/enterprise_search/applications/search_applications/my-test-engine/connect",
"href": "/app/elasticsearch/applications/search_applications/my-test-engine/connect",
"id": "enterpriseSearchApplicationConnect",
"items": undefined,
"name": "Connect",
Expand Down Expand Up @@ -448,7 +448,7 @@ describe('useEnterpriseSearchApplicationNav', () => {
// @ts-ignore
const engineItem: EuiSideNavItemType<unknown> = enginesItem!.items[0];
expect(engineItem).toEqual({
href: `/app/enterprise_search/applications/search_applications/${engineName}`,
href: `/app/elasticsearch/applications/search_applications/${engineName}`,
id: 'searchApplicationId',
name: engineName,
});
Expand All @@ -470,7 +470,7 @@ describe('useEnterpriseSearchApplicationNav', () => {

expect(engineItem).toMatchInlineSnapshot(`
Object {
"href": "/app/enterprise_search/applications/search_applications/my-test-engine/content",
"href": "/app/elasticsearch/applications/search_applications/my-test-engine/content",
"iconToString": "warning",
"id": "enterpriseSearchApplicationsContent",
"items": undefined,
Expand Down Expand Up @@ -535,24 +535,24 @@ describe('useEnterpriseSearchAnalyticsNav', () => {
expect(analyticsNav).not.toBeUndefined();
expect(analyticsNav).toEqual({
'data-test-subj': 'searchSideNav-BehavioralAnalytics',
href: '/app/enterprise_search/analytics',
href: '/app/elasticsearch/analytics',
id: 'analyticsCollections',
items: [
{
id: 'analyticsCollection',
items: [
{
href: '/app/enterprise_search/analytics/overview-path',
href: '/app/elasticsearch/analytics/overview-path',
id: 'analyticsCollectionOverview',
name: 'Overview',
},
{
href: '/app/enterprise_search/analytics/explorer-path',
href: '/app/elasticsearch/analytics/explorer-path',
id: 'analyticsCollectionExplorer',
name: 'Explorer',
},
{
href: '/app/enterprise_search/analytics/integration-path',
href: '/app/elasticsearch/analytics/integration-path',
id: 'analyticsCollectionIntegration',
name: 'Integration',
},
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/enterprise_search/public/navigation_tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const getNavigationTreeDefinition = ({

return (
pathNameSerialized ===
prepend(`/app/enterprise_search/applications${SEARCH_APPLICATIONS_PATH}`)
prepend(`/app/elasticsearch/applications${SEARCH_APPLICATIONS_PATH}`)
);
},
link: 'enterpriseSearchApplications:searchApplications',
Expand All @@ -190,7 +190,7 @@ export const getNavigationTreeDefinition = ({

if (someSubItemSelected) return false;

return pathNameSerialized === prepend(`/app/enterprise_search/analytics`);
return pathNameSerialized === prepend(`/app/elasticsearch/analytics`);
},
link: 'enterpriseSearchAnalytics',
renderAs: 'item',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Enterprise Search Analytics API', () => {
let mockRouter: MockRouter;
const mockClient = {};

describe('GET /internal/enterprise_search/analytics/collections', () => {
describe('GET /internal/elasticsearch/analytics/collections', () => {
beforeEach(() => {
const context = {
core: Promise.resolve({ elasticsearch: { client: mockClient } }),
Expand All @@ -34,7 +34,7 @@ describe('Enterprise Search Analytics API', () => {
mockRouter = new MockRouter({
context,
method: 'get',
path: '/internal/enterprise_search/analytics/collections',
path: '/internal/elasticsearch/analytics/collections',
});

const mockDataPlugin = {
Expand Down Expand Up @@ -99,7 +99,7 @@ describe('Enterprise Search Analytics API', () => {
});
});

describe('GET /internal/enterprise_search/analytics/collections/{id}', () => {
describe('GET /internal/elasticsearch/analytics/collections/{id}', () => {
beforeEach(() => {
const context = {
core: Promise.resolve({ elasticsearch: { client: mockClient } }),
Expand All @@ -108,7 +108,7 @@ describe('Enterprise Search Analytics API', () => {
mockRouter = new MockRouter({
context,
method: 'get',
path: '/internal/enterprise_search/analytics/collections/{name}',
path: '/internal/elasticsearch/analytics/collections/{name}',
});

const mockDataPlugin = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function registerAnalyticsRoutes({
}: AnalyticsRouteDependencies) {
router.get(
{
path: '/internal/enterprise_search/analytics/collections',
path: '/internal/elasticsearch/analytics/collections',
validate: {
query: schema.object({
query: schema.maybe(schema.string()),
Expand All @@ -75,7 +75,7 @@ export function registerAnalyticsRoutes({

router.get(
{
path: '/internal/enterprise_search/analytics/collections/{name}',
path: '/internal/elasticsearch/analytics/collections/{name}',
validate: {
params: schema.object({
name: schema.string(),
Expand All @@ -101,7 +101,7 @@ export function registerAnalyticsRoutes({

router.post(
{
path: '/internal/enterprise_search/analytics/collections/{name}/api_key',
path: '/internal/elasticsearch/analytics/collections/{name}/api_key',
validate: {
body: schema.object({
keyName: schema.string(),
Expand All @@ -127,7 +127,7 @@ export function registerAnalyticsRoutes({

router.post(
{
path: '/internal/enterprise_search/analytics/collections',
path: '/internal/elasticsearch/analytics/collections',
validate: {
body: schema.object({
name: schema.string(),
Expand Down Expand Up @@ -172,7 +172,7 @@ export function registerAnalyticsRoutes({

router.delete(
{
path: '/internal/enterprise_search/analytics/collections/{name}',
path: '/internal/elasticsearch/analytics/collections/{name}',
validate: {
params: schema.object({
name: schema.string(),
Expand All @@ -195,7 +195,7 @@ export function registerAnalyticsRoutes({

router.get(
{
path: '/internal/enterprise_search/analytics/collection/{name}/events/exist',
path: '/internal/elasticsearch/analytics/collection/{name}/events/exist',
validate: {
params: schema.object({
name: schema.string(),
Expand Down
6 changes: 3 additions & 3 deletions x-pack/test/accessibility/apps/group3/enterprise_search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('Playground', () => {
before(async () => {
await common.navigateToApp('enterprise_search/applications');
await common.navigateToApp('elasticsearch/applications');
});

it('loads playground', async function () {
Expand All @@ -120,7 +120,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('Search Applications', () => {
before(async () => {
await common.navigateToApp('enterprise_search/applications/search_applications');
await common.navigateToApp('elasticsearch/applications/search_applications');
});

it('loads search applications list', async function () {
Expand All @@ -133,7 +133,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
describe('Behavioral Analytics', () => {
before(async () => {
await common.navigateToApp('enterprise_search/analytics');
await common.navigateToApp('elasticsearch/analytics');
});

it('loads Behavioral Analytics page', async function () {
Expand Down
Loading