mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 06:51:10 +03:00
update search based on pr feedback:
- fix InventoryHost list inadverdent breakage due to merge conflict - update label__name search key to labels__name - always snap to page 1 when a search happens - udpate capitalization of keys to be consistent - remove isDefault from sort col items in tests
This commit is contained in:
parent
068de221c1
commit
3cdf274bdb
@ -149,11 +149,11 @@ class AddResourceRole extends React.Component {
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`First name`),
|
||||
name: i18n._(t`First Name`),
|
||||
key: 'first_name',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Last name`),
|
||||
name: i18n._(t`Last Name`),
|
||||
key: 'last_name',
|
||||
}
|
||||
];
|
||||
@ -164,11 +164,11 @@ class AddResourceRole extends React.Component {
|
||||
key: 'username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`First name`),
|
||||
name: i18n._(t`First Name`),
|
||||
key: 'first_name',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Last name`),
|
||||
name: i18n._(t`Last Name`),
|
||||
key: 'last_name',
|
||||
}
|
||||
];
|
||||
@ -180,11 +180,11 @@ class AddResourceRole extends React.Component {
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
];
|
||||
|
@ -190,11 +190,11 @@ describe('<DataListToolbar />', () => {
|
||||
const upAlphaIconSelector = 'SortAlphaUpIcon';
|
||||
|
||||
const numericColumns = [
|
||||
{ name: 'ID', key: 'id', isDefault: true },
|
||||
{ name: 'ID', key: 'id' },
|
||||
];
|
||||
|
||||
const alphaColumns = [
|
||||
{ name: 'Name', key: 'name', isDefault: true },
|
||||
{ name: 'Name', key: 'name' },
|
||||
];
|
||||
|
||||
const searchColumns = [
|
||||
@ -252,7 +252,7 @@ describe('<DataListToolbar />', () => {
|
||||
{ name: 'Name', key: 'name', isDefault: true }
|
||||
];
|
||||
const sortColumns = [
|
||||
{ name: 'Name', key: 'name', isDefault: true }
|
||||
{ name: 'Name', key: 'name' }
|
||||
];
|
||||
|
||||
toolbar = mountWithContexts(
|
||||
|
@ -38,8 +38,10 @@ class ListHeader extends React.Component {
|
||||
|
||||
handleSearch(key, value) {
|
||||
const { location, qsConfig } = this.props;
|
||||
const oldParams = parseQueryString(qsConfig, location.search);
|
||||
this.pushHistoryState(mergeParams(oldParams, { [key]: value }));
|
||||
let params = parseQueryString(qsConfig, location.search);
|
||||
params = mergeParams(params, { [key]: value });
|
||||
params = replaceParams(params, { 'page' : 1 })
|
||||
this.pushHistoryState(params);
|
||||
}
|
||||
|
||||
handleReplaceSearch(key, value) {
|
||||
|
@ -82,11 +82,11 @@ function CredentialLookup({
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
}
|
||||
]}
|
||||
|
@ -71,15 +71,15 @@ function InstanceGroupsLookup(props) {
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Credential name`),
|
||||
name: i18n._(t`Credential Name`),
|
||||
key: 'credential__name'
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -75,11 +75,11 @@ function InventoryLookup({
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -129,11 +129,11 @@ function MultiCredentialsLookup(props) {
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -77,11 +77,11 @@ function OrganizationLookup({
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -106,11 +106,11 @@ function ProjectLookup({
|
||||
key: 'scm_url',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -11,7 +11,6 @@ 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,
|
||||
@ -222,11 +221,11 @@ class NotificationList extends Component {
|
||||
]
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -197,11 +197,11 @@ class HostsList extends Component {
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -184,16 +184,16 @@ function InventoryGroupsList({ i18n, location, match }) {
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Is root group`),
|
||||
name: i18n._(t`Is Root Group`),
|
||||
key: 'parents__isnull',
|
||||
isBoolean: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -131,7 +131,7 @@ function InventoryHosts({ i18n, location, match }) {
|
||||
itemCount={hostCount}
|
||||
pluralizedItemName={i18n._(t`Hosts`)}
|
||||
qsConfig={QS_CONFIG}
|
||||
onRowClick={this.handleSelect}
|
||||
onRowClick={handleSelect}
|
||||
toolbarSearchColumns={[
|
||||
{
|
||||
name: i18n._(t`Name`),
|
||||
@ -139,11 +139,11 @@ function InventoryHosts({ i18n, location, match }) {
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -181,11 +181,11 @@ class InventoriesList extends Component {
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -174,11 +174,11 @@ class JobList extends Component {
|
||||
key: 'id'
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Label name`),
|
||||
key: 'label__name'
|
||||
name: i18n._(t`Label Name`),
|
||||
key: 'labels__name'
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Job type`),
|
||||
name: i18n._(t`Job Type`),
|
||||
key: `type`,
|
||||
options: [
|
||||
[
|
||||
@ -208,7 +208,7 @@ class JobList extends Component {
|
||||
]
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username'
|
||||
},
|
||||
{
|
||||
|
@ -126,11 +126,11 @@ function OrganizationsList({ i18n }) {
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -192,11 +192,11 @@ class ProjectsList extends Component {
|
||||
key: 'scm_url',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -161,15 +161,15 @@ class TeamsList extends Component {
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Organization name`),
|
||||
name: i18n._(t`Organization Name`),
|
||||
key: 'organization__name',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -239,11 +239,11 @@ class TemplatesList extends Component {
|
||||
key: 'job_template__playbook',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created by (username)`),
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
key: 'created_by__username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Modified by (username)`),
|
||||
name: i18n._(t`Modified By (Username)`),
|
||||
key: 'modified_by__username',
|
||||
},
|
||||
]}
|
||||
|
@ -161,11 +161,11 @@ class UsersList extends Component {
|
||||
isDefault: true
|
||||
},
|
||||
{
|
||||
name: i18n._(t`First name`),
|
||||
name: i18n._(t`First Name`),
|
||||
key: 'first_name',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Last name`),
|
||||
name: i18n._(t`Last Name`),
|
||||
key: 'last_name',
|
||||
}
|
||||
]}
|
||||
@ -175,11 +175,11 @@ class UsersList extends Component {
|
||||
key: 'username',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`First name`),
|
||||
name: i18n._(t`First Name`),
|
||||
key: 'first_name',
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Last name`),
|
||||
name: i18n._(t`Last Name`),
|
||||
key: 'last_name',
|
||||
},
|
||||
]}
|
||||
|
@ -193,6 +193,7 @@ function removeParam(oldVal, deleteVal) {
|
||||
* @return {object} merged namespaced params object
|
||||
*/
|
||||
export function mergeParams(oldParams, newParams) {
|
||||
debugger;
|
||||
const merged = {};
|
||||
Object.keys(oldParams).forEach(key => {
|
||||
merged[key] = mergeParam(oldParams[key], newParams[key]);
|
||||
|
Loading…
Reference in New Issue
Block a user