mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 17:48:10 -03:30
Merge pull request #4259 from AlexSCorey/4216-OrgGetRequestDuplication
Removes duplicated GET request in Org. Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
@@ -41,8 +41,14 @@ class Organization extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async componentDidUpdate(prevProps) {
|
async componentDidUpdate(prevProps) {
|
||||||
const { location } = this.props;
|
const { location, match } = this.props;
|
||||||
if (location !== prevProps.location) {
|
const url = `/organizations/${match.params.id}/`;
|
||||||
|
|
||||||
|
if (
|
||||||
|
prevProps.location.pathname.startsWith(url) &&
|
||||||
|
prevProps.location !== location &&
|
||||||
|
location.pathname === `${url}details`
|
||||||
|
) {
|
||||||
await this.loadOrganization();
|
await this.loadOrganization();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class OrganizationEdit extends Component {
|
|||||||
organization: { id },
|
organization: { id },
|
||||||
history,
|
history,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
history.push(`/organizations/${id}`);
|
history.push(`/organizations/${id}/details`);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSuccess() {
|
handleSuccess() {
|
||||||
@@ -46,7 +46,7 @@ class OrganizationEdit extends Component {
|
|||||||
organization: { id },
|
organization: { id },
|
||||||
history,
|
history,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
history.push(`/organizations/${id}`);
|
history.push(`/organizations/${id}/details`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async submitInstanceGroups(groupsToAssociate, groupsToDisassociate) {
|
async submitInstanceGroups(groupsToAssociate, groupsToDisassociate) {
|
||||||
|
|||||||
@@ -76,6 +76,6 @@ describe('<OrganizationEdit />', () => {
|
|||||||
expect(history.push).not.toHaveBeenCalled();
|
expect(history.push).not.toHaveBeenCalled();
|
||||||
wrapper.find('button[aria-label="Cancel"]').prop('onClick')();
|
wrapper.find('button[aria-label="Cancel"]').prop('onClick')();
|
||||||
|
|
||||||
expect(history.push).toHaveBeenCalledWith('/organizations/1');
|
expect(history.push).toHaveBeenCalledWith('/organizations/1/details');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user