mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 12:41:19 -03:30
fix prettier issues
This commit is contained in:
parent
1b726a1b2f
commit
9ecb704e10
@ -210,83 +210,85 @@ class Search extends React.Component {
|
||||
<NoOptionDropdown>{searchColumnName}</NoOptionDropdown>
|
||||
)}
|
||||
</DataToolbarItem>
|
||||
{columns.map(({ key, name, options, isBoolean, booleanLabels = {} }) => (
|
||||
<DataToolbarFilter
|
||||
chips={chipsByKey[key] ? chipsByKey[key].chips : []}
|
||||
deleteChip={(unusedKey, val) => {
|
||||
onRemove(chipsByKey[key].key, val);
|
||||
}}
|
||||
categoryName={chipsByKey[key] ? chipsByKey[key].label : key}
|
||||
key={key}
|
||||
showToolbarItem={searchKey === key}
|
||||
>
|
||||
{(options && (
|
||||
<Fragment>
|
||||
<Select
|
||||
variant={SelectVariant.checkbox}
|
||||
aria-label={name}
|
||||
onToggle={this.handleFilterDropdownToggle}
|
||||
onSelect={(event, selection) =>
|
||||
this.handleFilterDropdownSelect(key, event, selection)
|
||||
}
|
||||
selections={chipsByKey[key].chips}
|
||||
isExpanded={isFilterDropdownOpen}
|
||||
placeholderText={`Filter By ${name}`}
|
||||
>
|
||||
{options.map(([optionKey, optionLabel]) => (
|
||||
<SelectOption key={optionKey} value={optionKey}>
|
||||
{optionLabel}
|
||||
</SelectOption>
|
||||
))}
|
||||
</Select>
|
||||
</Fragment>
|
||||
)) ||
|
||||
(isBoolean && (
|
||||
<Select
|
||||
aria-label={name}
|
||||
onToggle={this.handleFilterDropdownToggle}
|
||||
onSelect={(event, selection) =>
|
||||
this.handleFilterBooleanSelect(key, selection)
|
||||
}
|
||||
selections={chipsByKey[key].chips[0]}
|
||||
isExpanded={isFilterDropdownOpen}
|
||||
placeholderText={`Filter By ${name}`}
|
||||
>
|
||||
<SelectOption key="true" value="true">
|
||||
{booleanLabels.true || i18n._(t`Yes`)}
|
||||
</SelectOption>
|
||||
<SelectOption key="false" value="false">
|
||||
{booleanLabels.false || i18n._(t`No`)}
|
||||
</SelectOption>
|
||||
</Select>
|
||||
)) || (
|
||||
<InputGroup>
|
||||
{/* TODO: add support for dates:
|
||||
qsConfig.dateFields.filter(field => field === key).length && "date" */}
|
||||
<TextInput
|
||||
type={
|
||||
(qsConfig.integerFields.find(
|
||||
field => field === searchKey
|
||||
) &&
|
||||
'number') ||
|
||||
'search'
|
||||
{columns.map(
|
||||
({ key, name, options, isBoolean, booleanLabels = {} }) => (
|
||||
<DataToolbarFilter
|
||||
chips={chipsByKey[key] ? chipsByKey[key].chips : []}
|
||||
deleteChip={(unusedKey, val) => {
|
||||
onRemove(chipsByKey[key].key, val);
|
||||
}}
|
||||
categoryName={chipsByKey[key] ? chipsByKey[key].label : key}
|
||||
key={key}
|
||||
showToolbarItem={searchKey === key}
|
||||
>
|
||||
{(options && (
|
||||
<Fragment>
|
||||
<Select
|
||||
variant={SelectVariant.checkbox}
|
||||
aria-label={name}
|
||||
onToggle={this.handleFilterDropdownToggle}
|
||||
onSelect={(event, selection) =>
|
||||
this.handleFilterDropdownSelect(key, event, selection)
|
||||
}
|
||||
aria-label={i18n._(t`Search text input`)}
|
||||
value={searchValue}
|
||||
onChange={this.handleSearchInputChange}
|
||||
onKeyDown={this.handleTextKeyDown}
|
||||
/>
|
||||
<Button
|
||||
variant={ButtonVariant.control}
|
||||
aria-label={i18n._(t`Search submit button`)}
|
||||
onClick={this.handleSearch}
|
||||
selections={chipsByKey[key].chips}
|
||||
isExpanded={isFilterDropdownOpen}
|
||||
placeholderText={`Filter By ${name}`}
|
||||
>
|
||||
<SearchIcon />
|
||||
</Button>
|
||||
</InputGroup>
|
||||
)}
|
||||
</DataToolbarFilter>
|
||||
))}
|
||||
{options.map(([optionKey, optionLabel]) => (
|
||||
<SelectOption key={optionKey} value={optionKey}>
|
||||
{optionLabel}
|
||||
</SelectOption>
|
||||
))}
|
||||
</Select>
|
||||
</Fragment>
|
||||
)) ||
|
||||
(isBoolean && (
|
||||
<Select
|
||||
aria-label={name}
|
||||
onToggle={this.handleFilterDropdownToggle}
|
||||
onSelect={(event, selection) =>
|
||||
this.handleFilterBooleanSelect(key, selection)
|
||||
}
|
||||
selections={chipsByKey[key].chips[0]}
|
||||
isExpanded={isFilterDropdownOpen}
|
||||
placeholderText={`Filter By ${name}`}
|
||||
>
|
||||
<SelectOption key="true" value="true">
|
||||
{booleanLabels.true || i18n._(t`Yes`)}
|
||||
</SelectOption>
|
||||
<SelectOption key="false" value="false">
|
||||
{booleanLabels.false || i18n._(t`No`)}
|
||||
</SelectOption>
|
||||
</Select>
|
||||
)) || (
|
||||
<InputGroup>
|
||||
{/* TODO: add support for dates:
|
||||
qsConfig.dateFields.filter(field => field === key).length && "date" */}
|
||||
<TextInput
|
||||
type={
|
||||
(qsConfig.integerFields.find(
|
||||
field => field === searchKey
|
||||
) &&
|
||||
'number') ||
|
||||
'search'
|
||||
}
|
||||
aria-label={i18n._(t`Search text input`)}
|
||||
value={searchValue}
|
||||
onChange={this.handleSearchInputChange}
|
||||
onKeyDown={this.handleTextKeyDown}
|
||||
/>
|
||||
<Button
|
||||
variant={ButtonVariant.control}
|
||||
aria-label={i18n._(t`Search submit button`)}
|
||||
onClick={this.handleSearch}
|
||||
>
|
||||
<SearchIcon />
|
||||
</Button>
|
||||
</InputGroup>
|
||||
)}
|
||||
</DataToolbarFilter>
|
||||
)
|
||||
)}
|
||||
</DataToolbarGroup>
|
||||
);
|
||||
}
|
||||
|
||||
@ -188,9 +188,9 @@ function InventoryGroupsList({ i18n, location, match }) {
|
||||
key: 'parents__isnull',
|
||||
isBoolean: true,
|
||||
booleanLabels: {
|
||||
"true": i18n._(t`Show Only Root Groups`),
|
||||
"false": i18n._(t`Show All Groups`)
|
||||
}
|
||||
true: i18n._(t`Show Only Root Groups`),
|
||||
false: i18n._(t`Show All Groups`),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: i18n._(t`Created By (Username)`),
|
||||
|
||||
@ -258,8 +258,8 @@ export const SearchColumns = arrayOf(
|
||||
isDefault: bool,
|
||||
isBoolean: bool,
|
||||
booleanLabels: shape({
|
||||
"true": string.isRequired,
|
||||
"false": string.isRequired
|
||||
true: string.isRequired,
|
||||
false: string.isRequired,
|
||||
}),
|
||||
options: arrayOf(arrayOf(string, string)),
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user