assorted schedule list fixes:

- remove pagesection and card from component...move to where called for root list
- remove unnecessary placeholder schedule tab on job template detail
This commit is contained in:
John Mitchell
2020-03-02 10:00:27 -05:00
parent 5fdf6cf60f
commit b57405b696
4 changed files with 63 additions and 65 deletions

View File

@@ -3,7 +3,6 @@ import { useLocation } from 'react-router-dom';
import { withI18n } from '@lingui/react'; import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro'; import { t } from '@lingui/macro';
import { SchedulesAPI } from '@api'; import { SchedulesAPI } from '@api';
import { Card, PageSection } from '@patternfly/react-core';
import AlertModal from '@components/AlertModal'; import AlertModal from '@components/AlertModal';
import ErrorDetail from '@components/ErrorDetail'; import ErrorDetail from '@components/ErrorDetail';
import DataListToolbar from '@components/DataListToolbar'; import DataListToolbar from '@components/DataListToolbar';
@@ -86,8 +85,7 @@ function ScheduleList({ i18n, loadSchedules }) {
}; };
return ( return (
<PageSection> <>
<Card>
<PaginatedDataList <PaginatedDataList
contentError={contentError} contentError={contentError}
hasContentLoading={isLoading || isDeleteLoading} hasContentLoading={isLoading || isDeleteLoading}
@@ -142,7 +140,6 @@ function ScheduleList({ i18n, loadSchedules }) {
/> />
)} )}
/> />
</Card>
{deletionError && ( {deletionError && (
<AlertModal <AlertModal
isOpen={deletionError} isOpen={deletionError}
@@ -154,7 +151,7 @@ function ScheduleList({ i18n, loadSchedules }) {
<ErrorDetail error={deletionError} /> <ErrorDetail error={deletionError} />
</AlertModal> </AlertModal>
)} )}
</PageSection> </>
); );
} }

View File

@@ -6,6 +6,7 @@ import { t } from '@lingui/macro';
import Breadcrumbs from '@components/Breadcrumbs'; import Breadcrumbs from '@components/Breadcrumbs';
import ScheduleList from '@components/ScheduleList'; import ScheduleList from '@components/ScheduleList';
import { SchedulesAPI } from '@api'; import { SchedulesAPI } from '@api';
import { PageSection, Card } from '@patternfly/react-core';
function Schedules({ i18n }) { function Schedules({ i18n }) {
const loadSchedules = params => { const loadSchedules = params => {
@@ -21,7 +22,11 @@ function Schedules({ i18n }) {
/> />
<Switch> <Switch>
<Route path="/schedules"> <Route path="/schedules">
<PageSection>
<Card>
<ScheduleList loadSchedules={loadSchedules} /> <ScheduleList loadSchedules={loadSchedules} />
</Card>
</PageSection>
</Route> </Route>
</Switch> </Switch>
</> </>

View File

@@ -112,10 +112,6 @@ class Template extends Component {
} }
tabsArray.push( tabsArray.push(
{
name: i18n._(t`Schedules`),
link: '/home',
},
{ {
name: i18n._(t`Completed Jobs`), name: i18n._(t`Completed Jobs`),
link: `${match.url}/completed_jobs`, link: `${match.url}/completed_jobs`,

View File

@@ -61,7 +61,7 @@ describe('<Template />', () => {
const tabs = await waitForElement( const tabs = await waitForElement(
wrapper, wrapper,
'.pf-c-tabs__item', '.pf-c-tabs__item',
el => el.length === 7 el => el.length === 6
); );
expect(tabs.at(2).text()).toEqual('Notifications'); expect(tabs.at(2).text()).toEqual('Notifications');
done(); done();