Skip to content

Commit

Permalink
Convert Settings > Connectors to new page template
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Jun 17, 2021
1 parent cc36617 commit 0fc182b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import React from 'react';

import { shallow } from 'enzyme';

import { Loading } from '../../../../shared/loading';
import { LicenseCallout } from '../../../components/shared/license_callout';

import { Connectors } from './connectors';
Expand All @@ -33,16 +32,6 @@ describe('Connectors', () => {
expect(wrapper.find('[data-test-subj="ConnectorRow"]')).toHaveLength(configuredSources.length);
});

it('returns loading when loading', () => {
setMockValues({
connectors: configuredSources,
dataLoading: true,
});
const wrapper = shallow(<Connectors />);

expect(wrapper.find(Loading)).toHaveLength(1);
});

it('renders LicenseCallout for restricted items', () => {
const wrapper = shallow(<Connectors />);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import {
EuiSpacer,
} from '@elastic/eui';

import { Loading } from '../../../../shared/loading';
import { EuiButtonEmptyTo } from '../../../../shared/react_router_helpers';
import { WorkplaceSearchPageTemplate } from '../../../components/layout';
import { LicenseCallout } from '../../../components/shared/license_callout';
import { SourceIcon } from '../../../components/shared/source_icon';
import { ViewContentHeader } from '../../../components/shared/view_content_header';
import {
NAV,
CONFIGURE_BUTTON,
CONNECTORS_HEADER_TITLE,
CONNECTORS_HEADER_DESCRIPTION,
Expand All @@ -46,8 +46,6 @@ export const Connectors: React.FC = () => {
initializeConnectors();
}, []);

if (dataLoading) return <Loading />;

const availableConnectors = reject(
connectors,
({ serviceType }) => serviceType === CUSTOM_SERVICE_TYPE
Expand Down Expand Up @@ -125,12 +123,15 @@ export const Connectors: React.FC = () => {
);

return (
<>
<ViewContentHeader
title={CONNECTORS_HEADER_TITLE}
description={CONNECTORS_HEADER_DESCRIPTION}
/>
<WorkplaceSearchPageTemplate
pageChrome={[NAV.SETTINGS, NAV.SETTINGS_SOURCE_PRIORITIZATION]}
pageHeader={{
pageTitle: CONNECTORS_HEADER_TITLE,
description: CONNECTORS_HEADER_DESCRIPTION,
}}
isLoading={dataLoading}
>
{connectorsList}
</>
</WorkplaceSearchPageTemplate>
);
};

0 comments on commit 0fc182b

Please sign in to comment.