mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 03:17:39 -02:30
swap column types use of shape for exact and fix warnings it found
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { createMemoryHistory } from 'history';
|
import { createMemoryHistory } from 'history';
|
||||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||||
import { sleep } from '@testUtils/testUtils';
|
|
||||||
import ListHeader from './ListHeader';
|
import ListHeader from './ListHeader';
|
||||||
|
|
||||||
describe('ListHeader', () => {
|
describe('ListHeader', () => {
|
||||||
@@ -21,7 +20,7 @@ describe('ListHeader', () => {
|
|||||||
{ name: 'foo', key: 'foo', isDefault: true},
|
{ name: 'foo', key: 'foo', isDefault: true},
|
||||||
]}
|
]}
|
||||||
sortColumns={[
|
sortColumns={[
|
||||||
{ name: 'foo', key: 'foo', isDefault: true},
|
{ name: 'foo', key: 'foo'},
|
||||||
]}
|
]}
|
||||||
renderToolbar={renderToolbarFn}
|
renderToolbar={renderToolbarFn}
|
||||||
/>
|
/>
|
||||||
@@ -42,7 +41,7 @@ describe('ListHeader', () => {
|
|||||||
{ name: 'foo', key: 'foo', isDefault: true},
|
{ name: 'foo', key: 'foo', isDefault: true},
|
||||||
]}
|
]}
|
||||||
sortColumns={[
|
sortColumns={[
|
||||||
{ name: 'foo', key: 'foo', isDefault: true},
|
{ name: 'foo', key: 'foo'},
|
||||||
]}
|
]}
|
||||||
/>,
|
/>,
|
||||||
{ context: { router: { history } } }
|
{ context: { router: { history } } }
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
|||||||
import { getQSConfig } from '@util/qs';
|
import { getQSConfig } from '@util/qs';
|
||||||
import OptionsList from './OptionsList';
|
import OptionsList from './OptionsList';
|
||||||
|
|
||||||
const qsConfig = getQSConfig('test', {});
|
const qsConfig = getQSConfig('test', { order_by: 'foo' });
|
||||||
|
|
||||||
describe('<OptionsList />', () => {
|
describe('<OptionsList />', () => {
|
||||||
it('should display list of options', () => {
|
it('should display list of options', () => {
|
||||||
@@ -17,8 +17,8 @@ describe('<OptionsList />', () => {
|
|||||||
value={[]}
|
value={[]}
|
||||||
options={options}
|
options={options}
|
||||||
optionCount={3}
|
optionCount={3}
|
||||||
searchColumns={[]}
|
searchColumns={[{name: 'Foo', key: 'foo', isDefault: true}]}
|
||||||
sortColumns={[]}
|
sortColumns={[{ name: 'Foo', key: 'foo' }]}
|
||||||
qsConfig={qsConfig}
|
qsConfig={qsConfig}
|
||||||
selectItem={() => {}}
|
selectItem={() => {}}
|
||||||
deselectItem={() => {}}
|
deselectItem={() => {}}
|
||||||
@@ -40,8 +40,8 @@ describe('<OptionsList />', () => {
|
|||||||
value={[options[1]]}
|
value={[options[1]]}
|
||||||
options={options}
|
options={options}
|
||||||
optionCount={3}
|
optionCount={3}
|
||||||
searchColumns={[]}
|
searchColumns={[{name: 'Foo', key: 'foo', isDefault: true}]}
|
||||||
sortColumns={[]}
|
sortColumns={[{ name: 'Foo', key: 'foo' }]}
|
||||||
qsConfig={qsConfig}
|
qsConfig={qsConfig}
|
||||||
selectItem={() => {}}
|
selectItem={() => {}}
|
||||||
deselectItem={() => {}}
|
deselectItem={() => {}}
|
||||||
|
|||||||
@@ -181,7 +181,6 @@ class ResourceAccessList extends React.Component {
|
|||||||
{
|
{
|
||||||
name: i18n._(t`Username`),
|
name: i18n._(t`Username`),
|
||||||
key: 'username',
|
key: 'username',
|
||||||
isDefault: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: i18n._(t`First Name`),
|
name: i18n._(t`First Name`),
|
||||||
|
|||||||
@@ -186,7 +186,6 @@ function InventoryGroupsList({ i18n, location, match }) {
|
|||||||
{
|
{
|
||||||
name: i18n._(t`Is root group`),
|
name: i18n._(t`Is root group`),
|
||||||
key: 'parents__isnull',
|
key: 'parents__isnull',
|
||||||
isDefault: true,
|
|
||||||
isBoolean: true
|
isBoolean: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -173,7 +173,6 @@ class UsersList extends Component {
|
|||||||
{
|
{
|
||||||
name: i18n._(t`Username`),
|
name: i18n._(t`Username`),
|
||||||
key: 'username',
|
key: 'username',
|
||||||
isDefault: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: i18n._(t`First name`),
|
name: i18n._(t`First name`),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
shape,
|
shape,
|
||||||
|
exact,
|
||||||
arrayOf,
|
arrayOf,
|
||||||
number,
|
number,
|
||||||
string,
|
string,
|
||||||
@@ -251,15 +252,17 @@ export const Group = shape({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const SearchColumns = arrayOf(
|
export const SearchColumns = arrayOf(
|
||||||
shape({
|
exact({
|
||||||
name: string.isRequired,
|
name: string.isRequired,
|
||||||
key: string.isRequired,
|
key: string.isRequired,
|
||||||
isDefault: bool,
|
isDefault: bool,
|
||||||
|
isBoolean: bool,
|
||||||
|
options: arrayOf(arrayOf(string, string))
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
export const SortColumns = arrayOf(
|
export const SortColumns = arrayOf(
|
||||||
shape({
|
exact({
|
||||||
name: string.isRequired,
|
name: string.isRequired,
|
||||||
key: string.isRequired,
|
key: string.isRequired,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user