mirror of
https://github.com/ansible/awx.git
synced 2026-02-15 18:20:00 -03:30
Add remove role functionality.
This commit is contained in:
@@ -112,7 +112,7 @@ class Organization extends Component {
|
||||
|
||||
return (
|
||||
<PageSection>
|
||||
<Card>
|
||||
<Card className="awx-c-card">
|
||||
{ cardHeader }
|
||||
<Switch>
|
||||
<Redirect
|
||||
|
||||
@@ -6,6 +6,7 @@ class OrganizationAccess extends React.Component {
|
||||
super(props);
|
||||
|
||||
this.getOrgAccessList = this.getOrgAccessList.bind(this);
|
||||
this.removeRole = this.removeRole.bind(this);
|
||||
}
|
||||
|
||||
getOrgAccessList (id, params) {
|
||||
@@ -13,6 +14,11 @@ class OrganizationAccess extends React.Component {
|
||||
return api.getOrganzationAccessList(id, params);
|
||||
}
|
||||
|
||||
removeRole (url, id) {
|
||||
const { api } = this.props;
|
||||
return api.disassociate(url, id);
|
||||
}
|
||||
|
||||
render () {
|
||||
const {
|
||||
location,
|
||||
@@ -23,6 +29,7 @@ class OrganizationAccess extends React.Component {
|
||||
return (
|
||||
<AccessList
|
||||
getAccessList={this.getOrgAccessList}
|
||||
removeRole={this.removeRole}
|
||||
match={match}
|
||||
location={location}
|
||||
history={history}
|
||||
|
||||
@@ -171,7 +171,7 @@ class OrganizationEdit extends Component {
|
||||
await api.associateInstanceGroup(url, id);
|
||||
}));
|
||||
await Promise.all(groupsToDisassociate.map(async id => {
|
||||
await api.disassociateInstanceGroup(url, id);
|
||||
await api.disassociate(url, id);
|
||||
}));
|
||||
} catch (err) {
|
||||
this.setState({ error: err });
|
||||
|
||||
Reference in New Issue
Block a user