mirror of
https://github.com/ansible/awx.git
synced 2024-10-30 22:21:13 +03:00
Fix loading pending approval count on login
This commit is contained in:
parent
703de8f3c0
commit
9f0307404e
@ -18,7 +18,6 @@ function AtApprovalsDrawerController (strings, Rest, GetBasePath, $rootScope) {
|
||||
};
|
||||
vm.emptyListReason = vm.strings.get('approvals.NONE');
|
||||
|
||||
// This will probably need to be expanded
|
||||
vm.toolbarSortOptions = [
|
||||
toolbarSortDefault,
|
||||
{ label: `${vm.strings.get('sort.CREATED_DESCENDING')}`, value: '-created' }
|
||||
|
@ -112,6 +112,7 @@ export default
|
||||
$rootScope.login_username = null;
|
||||
$rootScope.login_password = null;
|
||||
$rootScope.userLoggedOut = true;
|
||||
$rootScope.pendingApprovalCount = 0;
|
||||
if ($rootScope.sessionTimer) {
|
||||
$rootScope.sessionTimer.clearTimers();
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ export default
|
||||
timeout: null,
|
||||
|
||||
getSessionTime: function () {
|
||||
if(Store('sessionTime')){
|
||||
if(Store('sessionTime') && Store('sessionTime')[$rootScope.current_user.id]){
|
||||
return Store('sessionTime')[$rootScope.current_user.id].time;
|
||||
}
|
||||
else {
|
||||
|
@ -132,13 +132,6 @@ export default ['$log', '$cookies', '$rootScope', 'ProcessErrors',
|
||||
$rootScope.user_is_system_auditor = data.results[0].is_system_auditor;
|
||||
scope.$emit('AuthorizationGetLicense');
|
||||
});
|
||||
})
|
||||
.catch(({data, status}) => {
|
||||
Authorization.logout().then( () => {
|
||||
Wait('stop');
|
||||
Alert('Error', 'Failed to access user information. GET returned status: ' + status, 'alert-danger', loginAgain);
|
||||
});
|
||||
});
|
||||
|
||||
Rest.setUrl(`${GetBasePath('workflow_approvals')}?status=pending&page_size=1`);
|
||||
Rest.get()
|
||||
@ -151,6 +144,13 @@ export default ['$log', '$cookies', '$rootScope', 'ProcessErrors',
|
||||
msg: i18n._('Failed to get workflow jobs pending approval. GET returned status: ') + status
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(({data, status}) => {
|
||||
Authorization.logout().then( () => {
|
||||
Wait('stop');
|
||||
Alert('Error', 'Failed to access user information. GET returned status: ' + status, 'alert-danger', loginAgain);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Call the API to get an auth token
|
||||
|
Loading…
Reference in New Issue
Block a user