mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
add defaults to qs instead of passing as additional params to api request
This commit is contained in:
@@ -23,17 +23,19 @@ import {
|
|||||||
WorkflowJobsAPI,
|
WorkflowJobsAPI,
|
||||||
} from '@api';
|
} from '@api';
|
||||||
|
|
||||||
const QS_CONFIG = getQSConfig(
|
|
||||||
'job',
|
|
||||||
{
|
|
||||||
page: 1,
|
|
||||||
page_size: 20,
|
|
||||||
order_by: '-finished',
|
|
||||||
},
|
|
||||||
['page', 'page_size']
|
|
||||||
);
|
|
||||||
|
|
||||||
function JobList({ i18n, defaultParams, showTypeColumn = false }) {
|
function JobList({ i18n, defaultParams, showTypeColumn = false }) {
|
||||||
|
const QS_CONFIG = getQSConfig(
|
||||||
|
'job',
|
||||||
|
{
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
order_by: '-finished',
|
||||||
|
not__launch_type: 'sync',
|
||||||
|
...defaultParams,
|
||||||
|
},
|
||||||
|
['page', 'page_size']
|
||||||
|
);
|
||||||
|
|
||||||
const [selected, setSelected] = useState([]);
|
const [selected, setSelected] = useState([]);
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
@@ -48,7 +50,7 @@ function JobList({ i18n, defaultParams, showTypeColumn = false }) {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { count, results },
|
data: { count, results },
|
||||||
} = await UnifiedJobsAPI.read({ ...params, ...defaultParams });
|
} = await UnifiedJobsAPI.read({ ...params });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
itemCount: count,
|
itemCount: count,
|
||||||
|
|||||||
@@ -53,10 +53,7 @@ function Jobs({ i18n }) {
|
|||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path={match.path}>
|
<Route exact path={match.path}>
|
||||||
<PageSection>
|
<PageSection>
|
||||||
<JobList
|
<JobList showTypeColumn />
|
||||||
showTypeColumn
|
|
||||||
defaultParams={{ not__launch_type: 'sync' }}
|
|
||||||
/>
|
|
||||||
</PageSection>
|
</PageSection>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={`${match.path}/:id/details`}>
|
<Route path={`${match.path}/:id/details`}>
|
||||||
|
|||||||
Reference in New Issue
Block a user