mirror of
https://github.com/ansible/awx.git
synced 2026-02-02 01:58:09 -03:30
Removes the need to pass default search params to the select resource step
This commit is contained in:
@@ -106,7 +106,7 @@ class AddResourceRole extends React.Component {
|
||||
|
||||
async readUsers (queryParams) {
|
||||
const { api } = this.props;
|
||||
return api.readUsers(queryParams);
|
||||
return api.readUsers(Object.assign(queryParams, { is_superuser: false }));
|
||||
}
|
||||
|
||||
async readTeams (queryParams) {
|
||||
@@ -174,9 +174,6 @@ class AddResourceRole extends React.Component {
|
||||
{selectedResource === 'users' && (
|
||||
<SelectResourceStep
|
||||
columns={userColumns}
|
||||
defaultSearchParams={{
|
||||
is_superuser: false
|
||||
}}
|
||||
displayKey="username"
|
||||
emptyListBody={i18n._(t`Please add users to populate this list`)}
|
||||
emptyListTitle={i18n._(t`No Users Found`)}
|
||||
|
||||
@@ -70,7 +70,7 @@ class SelectResourceStep extends React.Component {
|
||||
}
|
||||
|
||||
async readResourceList (queryParams) {
|
||||
const { onSearch, defaultSearchParams } = this.props;
|
||||
const { onSearch } = this.props;
|
||||
const { page, order_by } = queryParams;
|
||||
|
||||
let sortOrder = 'ascending';
|
||||
@@ -84,7 +84,7 @@ class SelectResourceStep extends React.Component {
|
||||
this.setState({ error: false });
|
||||
|
||||
try {
|
||||
const { data } = await onSearch(Object.assign(queryParams, defaultSearchParams));
|
||||
const { data } = await onSearch(queryParams);
|
||||
const { count, results } = data;
|
||||
|
||||
const stateToUpdate = {
|
||||
@@ -189,7 +189,6 @@ class SelectResourceStep extends React.Component {
|
||||
|
||||
SelectResourceStep.propTypes = {
|
||||
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
defaultSearchParams: PropTypes.shape(),
|
||||
displayKey: PropTypes.string,
|
||||
emptyListBody: PropTypes.string,
|
||||
emptyListTitle: PropTypes.string,
|
||||
@@ -202,7 +201,6 @@ SelectResourceStep.propTypes = {
|
||||
};
|
||||
|
||||
SelectResourceStep.defaultProps = {
|
||||
defaultSearchParams: {},
|
||||
displayKey: 'name',
|
||||
emptyListBody: i18nMark('Please add items to populate this list'),
|
||||
emptyListTitle: i18nMark('No Items Found'),
|
||||
|
||||
Reference in New Issue
Block a user