second pass double checking all keys show up in the lists they should

This commit is contained in:
John Mitchell 2019-12-19 17:00:29 -05:00
parent 30b6e318cc
commit 068de221c1
9 changed files with 88 additions and 43 deletions

View File

@ -179,6 +179,14 @@ class AddResourceRole extends React.Component {
key: 'name',
isDefault: true
},
{
name: i18n._(t`Created by (username)`),
key: 'created_by__username',
},
{
name: i18n._(t`Modified by (username)`),
key: 'modified_by__username',
},
];
const teamSortColumns = [

View File

@ -70,6 +70,10 @@ function InstanceGroupsLookup(props) {
key: 'name',
isDefault: true
},
{
name: i18n._(t`Credential name`),
key: 'credential__name'
},
{
name: i18n._(t`Created by (username)`),
key: 'created_by__username',

View File

@ -83,10 +83,12 @@ function InventoryLookup({
key: 'modified_by__username',
},
]}
sortColumns={[{
name: i18n._(t`Name`),
key: 'name'
}]}
sortColumns={[
{
name: i18n._(t`Name`),
key: 'name',
},
]}
multiple={state.multiple}
header={i18n._(t`Inventory`)}
name="inventory"

View File

@ -11,6 +11,7 @@ import PaginatedDataList from '@components/PaginatedDataList';
import { getQSConfig, parseQueryString } from '@util/qs';
import { NotificationTemplatesAPI } from '@api';
import { type } from 'os';
const QS_CONFIG = getQSConfig('notification', {
page: 1,
@ -205,12 +206,28 @@ class NotificationList extends Component {
isDefault: true
},
{
name: i18n._(t`Modified`),
key: 'modified',
name: i18n._(t`Type`),
key: 'type',
options: [
['email', i18n._(t`Email`)],
['grafana', i18n._(t`Grafana`)],
['hipchat', i18n._(t`Hipchat`)],
['irc', i18n._(t`IRC`)],
['mattermost', i18n._(t`Mattermost`)],
['pagerduty', i18n._(t`Pagerduty`)],
['rocketchat', i18n._(t`Rocket.Chat`)],
['slack', i18n._(t`Slack`)],
['twilio', i18n._(t`Twilio`)],
['webhook', i18n._(t`Webhook`)],
]
},
{
name: i18n._(t`Created`),
key: 'created',
name: i18n._(t`Created by (username)`),
key: 'created_by__username',
},
{
name: i18n._(t`Modified by (username)`),
key: 'modified_by__username',
},
]}
toolbarSortColumns={[
@ -218,14 +235,6 @@ class NotificationList extends Component {
name: i18n._(t`Name`),
key: 'name',
},
{
name: i18n._(t`Modified`),
key: 'modified',
},
{
name: i18n._(t`Created`),
key: 'created',
},
]}
renderItem={notification => (
<NotificationListItem

View File

@ -197,12 +197,12 @@ class HostsList extends Component {
isDefault: true
},
{
name: i18n._(t`Modified`),
key: 'modified',
name: i18n._(t`Created by (username)`),
key: 'created_by__username',
},
{
name: i18n._(t`Created`),
key: 'created',
name: i18n._(t`Modified by (username)`),
key: 'modified_by__username',
},
]}
toolbarSortColumns={[
@ -210,14 +210,6 @@ class HostsList extends Component {
name: i18n._(t`Name`),
key: 'name',
},
{
name: i18n._(t`Modified`),
key: 'modified',
},
{
name: i18n._(t`Created`),
key: 'created',
},
]}
renderToolbar={props => (
<DataListToolbar

View File

@ -181,12 +181,12 @@ class InventoriesList extends Component {
isDefault: true
},
{
name: i18n._(t`Modified`),
key: 'modified',
name: i18n._(t`Created by (username)`),
key: 'created_by__username',
},
{
name: i18n._(t`Created`),
key: 'created',
name: i18n._(t`Modified by (username)`),
key: 'modified_by__username',
},
]}
toolbarSortColumns={[
@ -194,14 +194,6 @@ class InventoriesList extends Component {
name: i18n._(t`Name`),
key: 'name',
},
{
name: i18n._(t`Modified`),
key: 'modified',
},
{
name: i18n._(t`Created`),
key: 'created',
},
]}
renderToolbar={props => (
<DatalistToolbar

View File

@ -125,6 +125,14 @@ function OrganizationsList({ i18n }) {
key: 'name',
isDefault: true
},
{
name: i18n._(t`Created by (username)`),
key: 'created_by__username',
},
{
name: i18n._(t`Modified by (username)`),
key: 'modified_by__username',
},
]}
toolbarSortColumns={[
{

View File

@ -1,7 +1,8 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { useLocation } from 'react-router-dom';
import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
import { OrganizationsAPI } from '@api';
import PaginatedDataList from '@components/PaginatedDataList';
import { getQSConfig, parseQueryString } from '@util/qs';
@ -12,7 +13,7 @@ const QS_CONFIG = getQSConfig('team', {
order_by: 'name',
});
function OrganizationTeams({ id }) {
function OrganizationTeams({ id, i18n }) {
const location = useLocation();
const [contentError, setContentError] = useState(null);
const [hasContentLoading, setHasContentLoading] = useState(false);
@ -46,6 +47,27 @@ function OrganizationTeams({ id }) {
itemCount={itemCount}
pluralizedItemName="Teams"
qsConfig={QS_CONFIG}
toolbarSearchColumns={[
{
name: i18n._(t`Name`),
key: 'name',
isDefault: true
},
{
name: i18n._(t`Created by (username)`),
key: 'created_by__username',
},
{
name: i18n._(t`Modified by (username)`),
key: 'modified_by__username',
},
]}
toolbarSortColumns={[
{
name: i18n._(t`Name`),
key: 'name',
},
]}
/>
);
}
@ -55,4 +77,4 @@ OrganizationTeams.propTypes = {
};
export { OrganizationTeams as _OrganizationTeams };
export default OrganizationTeams;
export default withI18n()(OrganizationTeams);

View File

@ -164,6 +164,14 @@ class TeamsList extends Component {
name: i18n._(t`Organization name`),
key: 'organization__name',
},
{
name: i18n._(t`Created by (username)`),
key: 'created_by__username',
},
{
name: i18n._(t`Modified by (username)`),
key: 'modified_by__username',
},
]}
toolbarSortColumns={[
{