mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 06:56:00 -03:30
Code cleanup, renaming functions, use .all() on config promises
This commit is contained in:
@@ -53,7 +53,7 @@ class AWXLogin extends Component {
|
||||
try {
|
||||
const { data } = await api.login(username, password);
|
||||
updateConfig(data);
|
||||
fetchMe();
|
||||
await fetchMe();
|
||||
this.setState({ isAuthenticated: true, isLoading: false });
|
||||
} catch (error) {
|
||||
handleHttpError(error) || this.setState({ isInputValid: false, isLoading: false });
|
||||
|
||||
@@ -240,9 +240,6 @@ class Organization extends Component {
|
||||
path="/organizations/:id/notifications"
|
||||
render={() => (
|
||||
<OrganizationNotifications
|
||||
match={match}
|
||||
location={location}
|
||||
history={history}
|
||||
canToggleNotifications={canToggleNotifications}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -73,7 +73,7 @@ class OrganizationsList extends Component {
|
||||
this.onSelectAll = this.onSelectAll.bind(this);
|
||||
this.onSelect = this.onSelect.bind(this);
|
||||
this.updateUrl = this.updateUrl.bind(this);
|
||||
this.callOrganizations = this.callOrganizations.bind(this);
|
||||
this.fetchOptionsOrganizations = this.fetchOptionsOrganizations.bind(this);
|
||||
this.fetchOrganizations = this.fetchOrganizations.bind(this);
|
||||
this.handleOrgDelete = this.handleOrgDelete.bind(this);
|
||||
this.handleOpenOrgDeleteModal = this.handleOpenOrgDeleteModal.bind(this);
|
||||
@@ -82,7 +82,7 @@ class OrganizationsList extends Component {
|
||||
|
||||
componentDidMount () {
|
||||
const queryParams = this.getQueryParams();
|
||||
this.callOrganizations();
|
||||
this.fetchOptionsOrganizations();
|
||||
this.fetchOrganizations(queryParams);
|
||||
}
|
||||
|
||||
@@ -240,11 +240,11 @@ class OrganizationsList extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
async callOrganizations () {
|
||||
async fetchOptionsOrganizations () {
|
||||
const { api } = this.props;
|
||||
|
||||
try {
|
||||
const { data } = await api.callOrganizations();
|
||||
const { data } = await api.optionsOrganizations();
|
||||
const { actions } = data;
|
||||
|
||||
const stateToUpdate = {
|
||||
@@ -345,11 +345,14 @@ class OrganizationsList extends Component {
|
||||
<Trans>
|
||||
You dont have permission to delete the following Organizations:
|
||||
</Trans>
|
||||
{selected.map(row => (
|
||||
<div key={row.id}>
|
||||
{row.name}
|
||||
</div>
|
||||
))}
|
||||
{selected
|
||||
.filter(row => !row.summary_fields.user_capabilities.delete)
|
||||
.map(row => (
|
||||
<div key={row.id}>
|
||||
{row.name}
|
||||
</div>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
) : undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user