Skip to content

Commit

Permalink
Update AS engine creation routing
Browse files Browse the repository at this point in the history
- so that it correctly shows as a child route of the Engines link

+ update breadcrumbs
  • Loading branch information
cee-chen committed Jun 23, 2021
1 parent c1dd140 commit 31dab28
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
EuiButton,
} from '@elastic/eui';

import { ENGINES_TITLE } from '../engines';
import { AppSearchPageTemplate } from '../layout';

import {
Expand All @@ -43,7 +44,7 @@ export const EngineCreation: React.FC = () => {

return (
<AppSearchPageTemplate
pageChrome={[ENGINE_CREATION_TITLE]}
pageChrome={[ENGINES_TITLE, ENGINE_CREATION_TITLE]}
pageHeader={{ pageTitle: ENGINE_CREATION_TITLE }}
data-test-subj="EngineCreation"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('EmptyState', () => {
});

it('sends a user to engine creation', () => {
expect(button.prop('to')).toEqual('/engine_creation');
expect(button.prop('to')).toEqual('/engines/new');
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
} from '@elastic/eui';

import { AppLogic } from '../../app_logic';
import { ENGINES_TITLE } from '../engines';
import { AppSearchPageTemplate } from '../layout';

import {
Expand Down Expand Up @@ -73,7 +74,7 @@ export const MetaEngineCreation: React.FC = () => {

return (
<AppSearchPageTemplate
pageChrome={[META_ENGINE_CREATION_TITLE]}
pageChrome={[ENGINES_TITLE, META_ENGINE_CREATION_TITLE]}
pageHeader={{
pageTitle: META_ENGINE_CREATION_TITLE,
description: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ export const AppSearchConfigured: React.FC<Required<InitialAppData>> = (props) =
<Route exact path={ENGINES_PATH}>
<EnginesOverview />
</Route>
<Route path={ENGINE_PATH}>
<EngineRouter />
</Route>
{canManageEngines && (
<Route exact path={ENGINE_CREATION_PATH}>
<EngineCreation />
Expand All @@ -117,6 +114,9 @@ export const AppSearchConfigured: React.FC<Required<InitialAppData>> = (props) =
<MetaEngineCreation />
</Route>
)}
<Route path={ENGINE_PATH}>
<EngineRouter />
</Route>
{canViewSettings && (
<Route exact path={SETTINGS_PATH}>
<Settings />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const CREDENTIALS_PATH = '/credentials';
export const ROLE_MAPPINGS_PATH = '/role_mappings';

export const ENGINES_PATH = '/engines';
export const ENGINE_CREATION_PATH = '/engine_creation';
export const ENGINE_CREATION_PATH = `${ENGINES_PATH}/new`; // This is safe from conflicting with an :engineName path because new is a reserved name
export const ENGINE_PATH = `${ENGINES_PATH}/:engineName`;

export const ENGINE_ANALYTICS_PATH = `${ENGINE_PATH}/analytics`;
Expand All @@ -39,7 +39,7 @@ export const ENGINE_REINDEX_JOB_PATH = `${ENGINE_SCHEMA_PATH}/reindex_job/:reind
export const ENGINE_CRAWLER_PATH = `${ENGINE_PATH}/crawler`;
export const ENGINE_CRAWLER_DOMAIN_PATH = `${ENGINE_CRAWLER_PATH}/domains/:domainId`;

export const META_ENGINE_CREATION_PATH = '/meta_engine_creation';
export const META_ENGINE_CREATION_PATH = `${ENGINES_PATH}/new_meta_engine`; // This is safe from conflicting with an :engineName path because engine names cannot have underscores
export const META_ENGINE_SOURCE_ENGINES_PATH = `${ENGINE_PATH}/engines`;

export const ENGINE_RELEVANCE_TUNING_PATH = `${ENGINE_PATH}/relevance_tuning`;
Expand Down

0 comments on commit 31dab28

Please sign in to comment.