Skip to content

Commit

Permalink
Added a stub Relevance Tuning page
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonStoltz committed Jan 26, 2021
1 parent 22fd5d0 commit aec3666
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ export const EngineNav: React.FC = () => {
)}
{canManageEngineRelevanceTuning && (
<SideNavLink
isExternal
to={getAppSearchUrl(generateEnginePath(ENGINE_RELEVANCE_TUNING_PATH))}
to={generateEnginePath(ENGINE_RELEVANCE_TUNING_PATH)}
data-test-subj="EngineRelevanceTuningLink"
>
<EuiFlexGroup justifyContent="spaceBetween" gutterSize="none">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
// ENGINE_SCHEMA_PATH,
// ENGINE_CRAWLER_PATH,
// META_ENGINE_SOURCE_ENGINES_PATH,
// ENGINE_RELEVANCE_TUNING_PATH,
ENGINE_RELEVANCE_TUNING_PATH,
// ENGINE_SYNONYMS_PATH,
// ENGINE_CURATIONS_PATH,
// ENGINE_RESULT_SETTINGS_PATH,
Expand All @@ -37,6 +37,7 @@ import { Loading } from '../../../shared/loading';
import { EngineOverview } from '../engine_overview';
import { AnalyticsRouter } from '../analytics';
import { DocumentDetail, Documents } from '../documents';
import { RelevanceTuning } from '../relevance_tuning';

import { EngineLogic } from './';

Expand Down Expand Up @@ -95,6 +96,9 @@ export const EngineRouter: React.FC = () => {
<Route path={ENGINE_DOCUMENTS_PATH}>
<Documents engineBreadcrumb={engineBreadcrumb} />
</Route>
<Route path={ENGINE_RELEVANCE_TUNING_PATH}>
<RelevanceTuning engineBreadcrumb={engineBreadcrumb} />
</Route>
<Route>
<SetPageChrome trail={[...engineBreadcrumb, OVERVIEW_TITLE]} />
<EngineOverview />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*/

export { RELEVANCE_TUNING_TITLE } from './constants';
export { RelevanceTuning } from './relevance_tuning';
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';

import { shallow } from 'enzyme';

import { RelevanceTuning } from './relevance_tuning';

describe('RelevanceTuning', () => {
beforeEach(() => {
jest.clearAllMocks();
});

it('renders', () => {
const wrapper = shallow(<RelevanceTuning engineBreadcrumb={['test']} />);
expect(wrapper.isEmptyRender()).toBe(false);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import {
EuiPageHeader,
EuiPageHeaderSection,
EuiTitle,
EuiPageContentBody,
EuiPageContent,
} from '@elastic/eui';

import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome';
import { FlashMessages } from '../../../shared/flash_messages';

import { RELEVANCE_TUNING_TITLE } from './constants';

interface Props {
engineBreadcrumb: string[];
}

export const RelevanceTuning: React.FC<Props> = ({ engineBreadcrumb }) => {
return (
<>
<SetPageChrome trail={[...engineBreadcrumb, RELEVANCE_TUNING_TITLE]} />
<EuiPageHeader>
<EuiPageHeaderSection>
<EuiTitle size="l">
<h1>{RELEVANCE_TUNING_TITLE}</h1>
</EuiTitle>
</EuiPageHeaderSection>
</EuiPageHeader>
<EuiPageContent>
<EuiPageContentBody>
<FlashMessages />
</EuiPageContentBody>
</EuiPageContent>
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const ENGINE_CRAWLER_PATH = `${ENGINE_PATH}/crawler`;

export const META_ENGINE_SOURCE_ENGINES_PATH = `${ENGINE_PATH}/engines`;

export const ENGINE_RELEVANCE_TUNING_PATH = `${ENGINE_PATH}/search-settings`;
export const ENGINE_RELEVANCE_TUNING_PATH = `${ENGINE_PATH}/relevance-tuning`;
export const ENGINE_SYNONYMS_PATH = `${ENGINE_PATH}/synonyms`;
export const ENGINE_CURATIONS_PATH = `${ENGINE_PATH}/curations`;
// TODO: Curations sub-pages
Expand Down

0 comments on commit aec3666

Please sign in to comment.