mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 05:45:02 -02:30
fixes qs namespace, and location of proptypes
This commit is contained in:
@@ -15,6 +15,7 @@ import { t } from '@lingui/macro';
|
|||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { PencilAltIcon } from '@patternfly/react-icons';
|
import { PencilAltIcon } from '@patternfly/react-icons';
|
||||||
|
import { formatDateString } from '../../../util/dates';
|
||||||
import { Application } from '../../../types';
|
import { Application } from '../../../types';
|
||||||
import DataListCell from '../../../components/DataListCell';
|
import DataListCell from '../../../components/DataListCell';
|
||||||
|
|
||||||
@@ -25,6 +26,10 @@ const DataListAction = styled(_DataListAction)`
|
|||||||
grid-template-columns: 40px;
|
grid-template-columns: 40px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const Label = styled.b`
|
||||||
|
margin-right: 20px;
|
||||||
|
`;
|
||||||
|
|
||||||
function ApplicationListItem({
|
function ApplicationListItem({
|
||||||
application,
|
application,
|
||||||
isSelected,
|
isSelected,
|
||||||
@@ -32,13 +37,6 @@ function ApplicationListItem({
|
|||||||
detailUrl,
|
detailUrl,
|
||||||
i18n,
|
i18n,
|
||||||
}) {
|
}) {
|
||||||
ApplicationListItem.propTypes = {
|
|
||||||
application: Application.isRequired,
|
|
||||||
detailUrl: string.isRequired,
|
|
||||||
isSelected: bool.isRequired,
|
|
||||||
onSelect: func.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
const labelId = `check-action-${application.id}`;
|
const labelId = `check-action-${application.id}`;
|
||||||
return (
|
return (
|
||||||
<DataListItem
|
<DataListItem
|
||||||
@@ -73,6 +71,10 @@ function ApplicationListItem({
|
|||||||
<b>{application.summary_fields.organization.name}</b>
|
<b>{application.summary_fields.organization.name}</b>
|
||||||
</Link>
|
</Link>
|
||||||
</DataListCell>,
|
</DataListCell>,
|
||||||
|
<DataListCell key="modified" aria-label={i18n._(t`last modified`)}>
|
||||||
|
<Label>{i18n._(t`Last Modified`)}</Label>
|
||||||
|
<span>{formatDateString(application.modified)}</span>
|
||||||
|
</DataListCell>,
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<DataListAction
|
<DataListAction
|
||||||
@@ -99,4 +101,12 @@ function ApplicationListItem({
|
|||||||
</DataListItem>
|
</DataListItem>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ApplicationListItem.propTypes = {
|
||||||
|
application: Application.isRequired,
|
||||||
|
detailUrl: string.isRequired,
|
||||||
|
isSelected: bool.isRequired,
|
||||||
|
onSelect: func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
export default withI18n()(ApplicationListItem);
|
export default withI18n()(ApplicationListItem);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import useSelected from '../../../util/useSelected';
|
|||||||
|
|
||||||
import ApplicationListItem from './ApplicationListItem';
|
import ApplicationListItem from './ApplicationListItem';
|
||||||
|
|
||||||
const QS_CONFIG = getQSConfig('inventory', {
|
const QS_CONFIG = getQSConfig('applications', {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
order_by: 'name',
|
order_by: 'name',
|
||||||
@@ -105,12 +105,8 @@ function ApplicationsList({ i18n }) {
|
|||||||
isDefault: true,
|
isDefault: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: i18n._(t`Created by (Username)`),
|
name: i18n._(t`Description`),
|
||||||
key: 'created_by__username',
|
key: 'description',
|
||||||
},
|
|
||||||
{
|
|
||||||
name: i18n._(t`Modified by (Username)`),
|
|
||||||
key: 'modified_by__username',
|
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
toolbarSortColumns={[
|
toolbarSortColumns={[
|
||||||
@@ -118,6 +114,18 @@ function ApplicationsList({ i18n }) {
|
|||||||
name: i18n._(t`Name`),
|
name: i18n._(t`Name`),
|
||||||
key: 'name',
|
key: 'name',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: i18n._(t`Created`),
|
||||||
|
key: 'created',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: i18n._(t`Organization`),
|
||||||
|
key: 'organization',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: i18n._(t`Description`),
|
||||||
|
key: 'description',
|
||||||
|
},
|
||||||
]}
|
]}
|
||||||
renderToolbar={props => (
|
renderToolbar={props => (
|
||||||
<DatalistToolbar
|
<DatalistToolbar
|
||||||
|
|||||||
Reference in New Issue
Block a user