Skip to content

Commit

Permalink
[App Search] Temporarily remove sidebar layout and internal engine li…
Browse files Browse the repository at this point in the history
…nks for 7.11 release (#85820) (#85861)

* Hide layout/sidebar for main Engines Overview

* Remove internal links to Engine pages

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
Constance and kibanamachine authored Dec 14, 2020
1 parent e4d45bc commit c5bd996
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import '../../../__mocks__/enterprise_search_url.mock';
import { mockTelemetryActions, mountWithIntl } from '../../../__mocks__/';

import React from 'react';
import { EuiBasicTable, EuiPagination, EuiButtonEmpty } from '@elastic/eui';
import { EuiLinkTo } from '../../../shared/react_router_helpers';
import { EuiBasicTable, EuiPagination, EuiButtonEmpty, EuiLink } from '@elastic/eui';

import { EnginesTable } from './engines_table';

Expand Down Expand Up @@ -55,10 +54,10 @@ describe('EnginesTable', () => {
});

it('contains engine links which send telemetry', () => {
const engineLinks = wrapper.find(EuiLinkTo);
const engineLinks = wrapper.find(EuiLink);

engineLinks.forEach((link) => {
expect(link.prop('to')).toEqual('/engines/test-engine');
expect(link.prop('href')).toEqual('http://localhost:3002/as/engines/test-engine');
link.simulate('click');

expect(mockTelemetryActions.sendAppSearchTelemetry).toHaveBeenCalledWith({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

import React from 'react';
import { useActions } from 'kea';
import { EuiBasicTable, EuiBasicTableColumn } from '@elastic/eui';
import { EuiBasicTable, EuiBasicTableColumn, EuiLink } from '@elastic/eui';
import { FormattedMessage, FormattedDate, FormattedNumber } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

import { TelemetryLogic } from '../../../shared/telemetry';
import { EuiLinkTo } from '../../../shared/react_router_helpers';
import { getAppSearchUrl } from '../../../shared/enterprise_search_url';
import { getEngineRoute } from '../../routes';

import { ENGINES_PAGE_SIZE } from '../../../../../common/constants';
Expand Down Expand Up @@ -47,7 +47,8 @@ export const EnginesTable: React.FC<EnginesTableProps> = ({
const { sendAppSearchTelemetry } = useActions(TelemetryLogic);

const engineLinkProps = (name: string) => ({
to: getEngineRoute(name),
href: getAppSearchUrl(getEngineRoute(name)),
target: '_blank',
onClick: () =>
sendAppSearchTelemetry({
action: 'clicked',
Expand All @@ -62,9 +63,9 @@ export const EnginesTable: React.FC<EnginesTableProps> = ({
defaultMessage: 'Name',
}),
render: (name: string) => (
<EuiLinkTo data-test-subj="engineNameLink" {...engineLinkProps(name)}>
<EuiLink data-test-subj="engineNameLink" {...engineLinkProps(name)}>
{name}
</EuiLinkTo>
</EuiLink>
),
width: '30%',
truncateText: true,
Expand Down Expand Up @@ -137,12 +138,12 @@ export const EnginesTable: React.FC<EnginesTableProps> = ({
),
dataType: 'string',
render: (name: string) => (
<EuiLinkTo {...engineLinkProps(name)}>
<EuiLink {...engineLinkProps(name)}>
<FormattedMessage
id="xpack.enterpriseSearch.appSearch.enginesOverview.table.action.manage"
defaultMessage="Manage"
/>
</EuiLinkTo>
</EuiLink>
),
align: 'right',
width: '100px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('AppSearchConfigured', () => {
it('renders with layout', () => {
const wrapper = shallow(<AppSearchConfigured />);

expect(wrapper.find(Layout)).toHaveLength(2);
expect(wrapper.find(Layout)).toHaveLength(1);
expect(wrapper.find(Layout).last().prop('readOnlyMode')).toBeFalsy();
expect(wrapper.find(EnginesOverview)).toHaveLength(1);
expect(wrapper.find(EngineRouter)).toHaveLength(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import React, { useEffect } from 'react';
import { Route, Redirect, Switch } from 'react-router-dom';
import { useActions, useValues } from 'kea';

import { EuiPage, EuiPageBody } from '@elastic/eui';

import { getAppSearchUrl } from '../shared/enterprise_search_url';
import { KibanaLogic } from '../shared/kibana';
import { HttpLogic } from '../shared/http';
Expand Down Expand Up @@ -72,29 +74,31 @@ export const AppSearchConfigured: React.FC<InitialAppData> = (props) => {
</Layout>
</Route>
<Route>
<Layout navigation={<AppSearchNav />} readOnlyMode={readOnlyMode}>
{errorConnecting ? (
<ErrorConnecting />
) : (
<Switch>
<Route exact path={ROOT_PATH}>
<Redirect to={ENGINES_PATH} />
</Route>
<Route exact path={ENGINES_PATH}>
<EnginesOverview />
</Route>
<Route exact path={SETTINGS_PATH}>
<Settings />
</Route>
<Route exact path={CREDENTIALS_PATH}>
<Credentials />
</Route>
<Route>
<NotFound product={APP_SEARCH_PLUGIN} />
</Route>
</Switch>
)}
</Layout>
<EuiPage>
<EuiPageBody restrictWidth>
{errorConnecting ? (
<ErrorConnecting />
) : (
<Switch>
<Route exact path={ROOT_PATH}>
<Redirect to={ENGINES_PATH} />
</Route>
<Route exact path={ENGINES_PATH}>
<EnginesOverview />
</Route>
<Route exact path={SETTINGS_PATH}>
<Settings />
</Route>
<Route exact path={CREDENTIALS_PATH}>
<Credentials />
</Route>
<Route>
<NotFound product={APP_SEARCH_PLUGIN} />
</Route>
</Switch>
)}
</EuiPageBody>
</EuiPage>
</Route>
</Switch>
);
Expand Down

0 comments on commit c5bd996

Please sign in to comment.