Skip to content

Commit

Permalink
Initial conversion of Engines overview to new page template
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Jun 18, 2021
1 parent 7644574 commit 6525da6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@ import { useValues, useActions } from 'kea';
import {
EuiFlexGroup,
EuiFlexItem,
EuiPageContent,
EuiPanel,
EuiPageContentHeader,
EuiPageContentHeaderSection,
EuiPageContentBody,
EuiTitle,
EuiSpacer,
} from '@elastic/eui';

import { FlashMessages } from '../../../shared/flash_messages';
import { LicensingLogic } from '../../../shared/licensing';
import { EuiButtonTo } from '../../../shared/react_router_helpers';
import { convertMetaToPagination, handlePageChange } from '../../../shared/table_pagination';
import { SendAppSearchTelemetry as SendTelemetry } from '../../../shared/telemetry';
import { AppLogic } from '../../app_logic';
import { EngineIcon, MetaEngineIcon } from '../../icons';
import { ENGINE_CREATION_PATH, META_ENGINE_CREATION_PATH } from '../../routes';
import { AppSearchPageTemplate } from '../layout';

import {
EnginesOverviewHeader,
Expand Down Expand Up @@ -77,12 +76,13 @@ export const EnginesOverview: React.FC = () => {
if (!engines.length) return <EmptyState />;

return (
<>
<SendTelemetry action="viewed" metric="engines_overview" />

<AppSearchPageTemplate
pageViewTelemetry="engines_overview"
pageChrome={[ENGINES_TITLE]}
pageHeader={{ children: <EnginesOverviewHeader /> }}
>
<EnginesOverviewHeader />
<EuiPageContent hasBorder>
<FlashMessages />
<EuiPanel hasBorder>
<EuiPageContentHeader>
<EuiPageContentHeaderSection>
<EuiFlexGroup gutterSize="xs" alignItems="center" responsive={false}>
Expand Down Expand Up @@ -168,7 +168,7 @@ export const EnginesOverview: React.FC = () => {
</EuiPageContentBody>
</>
)}
</EuiPageContent>
</>
</EuiPanel>
</AppSearchPageTemplate>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ export const AppSearchConfigured: React.FC<Required<InitialAppData>> = (props) =
<Library />
</Route>
)}
<Route exact path={ROOT_PATH}>
<Redirect to={ENGINES_PATH} />
</Route>
<Route exact path={ENGINES_PATH}>
<EnginesOverview />
</Route>
{canManageEngines && (
<Route exact path={ENGINE_CREATION_PATH}>
<EngineCreation />
Expand All @@ -110,12 +116,6 @@ export const AppSearchConfigured: React.FC<Required<InitialAppData>> = (props) =
<Route>
<Layout navigation={<AppSearchNav />} readOnlyMode={readOnlyMode}>
<Switch>
<Route exact path={ROOT_PATH}>
<Redirect to={ENGINES_PATH} />
</Route>
<Route exact path={ENGINES_PATH}>
<EnginesOverview />
</Route>
<Route path={ENGINE_PATH}>
<EngineRouter />
</Route>
Expand Down

0 comments on commit 6525da6

Please sign in to comment.