mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 21:49:27 -02:30
Added 'Max Hosts' field in the Add/Edit Organization view
* max hosts field is enabled is user is superuser, otherwise it is disabled and default is 0 * OrganizationForm tests added for max hosts input * minMaxValue added in validators to validate user input for max hosts Signed-off-by: catjones9 <catjones@redhat.com>
This commit is contained in:
@@ -78,7 +78,7 @@ class OrganizationDetail extends Component {
|
||||
/>
|
||||
<Detail
|
||||
label={i18n._(t`Max Hosts`)}
|
||||
value={''+max_hosts}
|
||||
value={`${max_hosts}`}
|
||||
/>
|
||||
<Detail
|
||||
label={i18n._(t`Ansible Environment`)}
|
||||
|
||||
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { CardBody } from '@patternfly/react-core';
|
||||
import OrganizationForm from '../../components/OrganizationForm';
|
||||
import { Config } from '../../../../contexts/Config';
|
||||
import { withNetwork } from '../../../../contexts/Network';
|
||||
import { OrganizationsAPI } from '../../../../api';
|
||||
|
||||
@@ -64,11 +65,16 @@ class OrganizationEdit extends Component {
|
||||
|
||||
return (
|
||||
<CardBody>
|
||||
<OrganizationForm
|
||||
organization={organization}
|
||||
handleSubmit={this.handleSubmit}
|
||||
handleCancel={this.handleCancel}
|
||||
/>
|
||||
<Config>
|
||||
{({ me }) => (
|
||||
<OrganizationForm
|
||||
organization={organization}
|
||||
handleSubmit={this.handleSubmit}
|
||||
handleCancel={this.handleCancel}
|
||||
me={me || {}}
|
||||
/>
|
||||
)}
|
||||
</Config>
|
||||
{error ? <div>error</div> : null}
|
||||
</CardBody>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user