mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 06:58:06 -03:30
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:
parent
5fdf6cf60f
commit
b57405b696
@ -3,7 +3,6 @@ import { useLocation } from 'react-router-dom';
|
||||
import { withI18n } from '@lingui/react';
|
||||
import { t } from '@lingui/macro';
|
||||
import { SchedulesAPI } from '@api';
|
||||
import { Card, PageSection } from '@patternfly/react-core';
|
||||
import AlertModal from '@components/AlertModal';
|
||||
import ErrorDetail from '@components/ErrorDetail';
|
||||
import DataListToolbar from '@components/DataListToolbar';
|
||||
@ -86,63 +85,61 @@ function ScheduleList({ i18n, loadSchedules }) {
|
||||
};
|
||||
|
||||
return (
|
||||
<PageSection>
|
||||
<Card>
|
||||
<PaginatedDataList
|
||||
contentError={contentError}
|
||||
hasContentLoading={isLoading || isDeleteLoading}
|
||||
items={schedules}
|
||||
itemCount={itemCount}
|
||||
qsConfig={QS_CONFIG}
|
||||
onRowClick={handleSelect}
|
||||
renderItem={item => (
|
||||
<ScheduleListItem
|
||||
isSelected={selected.some(row => row.id === item.id)}
|
||||
key={item.id}
|
||||
onSelect={() => handleSelect(item)}
|
||||
schedule={item}
|
||||
/>
|
||||
)}
|
||||
toolbarSearchColumns={[
|
||||
{
|
||||
name: i18n._(t`Name`),
|
||||
key: 'name',
|
||||
isDefault: true,
|
||||
},
|
||||
]}
|
||||
toolbarSortColumns={[
|
||||
{
|
||||
name: i18n._(t`Name`),
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Next Run`),
|
||||
key: 'next_run',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Type`),
|
||||
key: 'unified_job_template__polymorphic_ctype__model',
|
||||
},
|
||||
]}
|
||||
renderToolbar={props => (
|
||||
<DataListToolbar
|
||||
{...props}
|
||||
showSelectAll
|
||||
isAllSelected={isAllSelected}
|
||||
onSelectAll={handleSelectAll}
|
||||
qsConfig={QS_CONFIG}
|
||||
additionalControls={[
|
||||
<ToolbarDeleteButton
|
||||
key="delete"
|
||||
onDelete={handleDelete}
|
||||
itemsToDelete={selected}
|
||||
pluralizedItemName={i18n._(t`Schedules`)}
|
||||
/>,
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Card>
|
||||
<>
|
||||
<PaginatedDataList
|
||||
contentError={contentError}
|
||||
hasContentLoading={isLoading || isDeleteLoading}
|
||||
items={schedules}
|
||||
itemCount={itemCount}
|
||||
qsConfig={QS_CONFIG}
|
||||
onRowClick={handleSelect}
|
||||
renderItem={item => (
|
||||
<ScheduleListItem
|
||||
isSelected={selected.some(row => row.id === item.id)}
|
||||
key={item.id}
|
||||
onSelect={() => handleSelect(item)}
|
||||
schedule={item}
|
||||
/>
|
||||
)}
|
||||
toolbarSearchColumns={[
|
||||
{
|
||||
name: i18n._(t`Name`),
|
||||
key: 'name',
|
||||
isDefault: true,
|
||||
},
|
||||
]}
|
||||
toolbarSortColumns={[
|
||||
{
|
||||
name: i18n._(t`Name`),
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Next Run`),
|
||||
key: 'next_run',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Type`),
|
||||
key: 'unified_job_template__polymorphic_ctype__model',
|
||||
},
|
||||
]}
|
||||
renderToolbar={props => (
|
||||
<DataListToolbar
|
||||
{...props}
|
||||
showSelectAll
|
||||
isAllSelected={isAllSelected}
|
||||
onSelectAll={handleSelectAll}
|
||||
qsConfig={QS_CONFIG}
|
||||
additionalControls={[
|
||||
<ToolbarDeleteButton
|
||||
key="delete"
|
||||
onDelete={handleDelete}
|
||||
itemsToDelete={selected}
|
||||
pluralizedItemName={i18n._(t`Schedules`)}
|
||||
/>,
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
{deletionError && (
|
||||
<AlertModal
|
||||
isOpen={deletionError}
|
||||
@ -154,7 +151,7 @@ function ScheduleList({ i18n, loadSchedules }) {
|
||||
<ErrorDetail error={deletionError} />
|
||||
</AlertModal>
|
||||
)}
|
||||
</PageSection>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import { t } from '@lingui/macro';
|
||||
import Breadcrumbs from '@components/Breadcrumbs';
|
||||
import ScheduleList from '@components/ScheduleList';
|
||||
import { SchedulesAPI } from '@api';
|
||||
import { PageSection, Card } from '@patternfly/react-core';
|
||||
|
||||
function Schedules({ i18n }) {
|
||||
const loadSchedules = params => {
|
||||
@ -21,7 +22,11 @@ function Schedules({ i18n }) {
|
||||
/>
|
||||
<Switch>
|
||||
<Route path="/schedules">
|
||||
<ScheduleList loadSchedules={loadSchedules} />
|
||||
<PageSection>
|
||||
<Card>
|
||||
<ScheduleList loadSchedules={loadSchedules} />
|
||||
</Card>
|
||||
</PageSection>
|
||||
</Route>
|
||||
</Switch>
|
||||
</>
|
||||
|
||||
@ -112,10 +112,6 @@ class Template extends Component {
|
||||
}
|
||||
|
||||
tabsArray.push(
|
||||
{
|
||||
name: i18n._(t`Schedules`),
|
||||
link: '/home',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Completed Jobs`),
|
||||
link: `${match.url}/completed_jobs`,
|
||||
|
||||
@ -61,7 +61,7 @@ describe('<Template />', () => {
|
||||
const tabs = await waitForElement(
|
||||
wrapper,
|
||||
'.pf-c-tabs__item',
|
||||
el => el.length === 7
|
||||
el => el.length === 6
|
||||
);
|
||||
expect(tabs.at(2).text()).toEqual('Notifications');
|
||||
done();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user