mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
AC-1308 spinner lingers after 403 error
Happening on response to Delete prompt. Removed modal hide listener when starting spinner. Not sure why I thought that was needed. Instead, just close the dialog and start the spinner. If an error occurs, ProcessErrors always stops the spinner. Issue was caused by a race condition. ProcessErrors would sometimes fire tht stop before the event listener fired a start.
This commit is contained in:
@@ -12,21 +12,21 @@
|
|||||||
|
|
||||||
function AdminsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, AdminList, GenerateList, LoadBreadCrumbs,
|
function AdminsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, AdminList, GenerateList, LoadBreadCrumbs,
|
||||||
Prompt, SearchInit, PaginateInit, ReturnToCaller, GetBasePath, SelectionInit) {
|
Prompt, SearchInit, PaginateInit, ReturnToCaller, GetBasePath, SelectionInit) {
|
||||||
|
|
||||||
var list = AdminList,
|
var list = AdminList,
|
||||||
defaultUrl = GetBasePath('organizations') + $routeParams.organization_id + '/users/',
|
defaultUrl = GetBasePath('organizations') + $routeParams.organization_id + '/users/',
|
||||||
generator = GenerateList,
|
generator = GenerateList,
|
||||||
mode = 'select',
|
mode = 'select',
|
||||||
url = GetBasePath('organizations') + $routeParams.organization_id + '/admins/';
|
url = GetBasePath('organizations') + $routeParams.organization_id + '/admins/';
|
||||||
|
|
||||||
generator.inject(AdminList, { mode: mode, scope: $scope });
|
generator.inject(AdminList, { mode: mode, scope: $scope });
|
||||||
|
|
||||||
SelectionInit({ scope: $scope, list: list, url: url, returnToCaller: 1 });
|
SelectionInit({ scope: $scope, list: list, url: url, returnToCaller: 1 });
|
||||||
|
|
||||||
SearchInit({ scope: $scope, set: 'admins', list: list, url: defaultUrl });
|
SearchInit({ scope: $scope, set: 'admins', list: list, url: defaultUrl });
|
||||||
|
|
||||||
PaginateInit({ scope: $scope, list: list, url: defaultUrl });
|
PaginateInit({ scope: $scope, list: list, url: defaultUrl });
|
||||||
|
|
||||||
$scope.search(list.iterator);
|
$scope.search(list.iterator);
|
||||||
|
|
||||||
LoadBreadCrumbs();
|
LoadBreadCrumbs();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
function CredentialsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, CredentialList,
|
function CredentialsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, CredentialList,
|
||||||
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
||||||
ClearScope, ProcessErrors, GetBasePath, SelectionInit, GetChoices, Wait, Stream) {
|
ClearScope, ProcessErrors, GetBasePath, SelectionInit, GetChoices, Wait, Stream) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
Wait('start');
|
Wait('start');
|
||||||
@@ -40,8 +40,8 @@ function CredentialsList($scope, $rootScope, $location, $log, $routeParams, Rest
|
|||||||
}
|
}
|
||||||
$scope.removePostRefresh = $scope.$on('PostRefresh', function () {
|
$scope.removePostRefresh = $scope.$on('PostRefresh', function () {
|
||||||
var i, j;
|
var i, j;
|
||||||
|
|
||||||
// Cleanup after a delete
|
// Cleanup after a delete
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
|
|
||||||
@@ -102,10 +102,8 @@ function CredentialsList($scope, $rootScope, $location, $log, $routeParams, Rest
|
|||||||
|
|
||||||
$scope.deleteCredential = function (id, name) {
|
$scope.deleteCredential = function (id, name) {
|
||||||
var action = function () {
|
var action = function () {
|
||||||
$('#prompt-modal').on('hidden.bs.modal', function () {
|
|
||||||
Wait('start');
|
|
||||||
});
|
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
@@ -135,7 +133,7 @@ CredentialsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeP
|
|||||||
function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, CredentialForm, GenerateForm, Rest, Alert,
|
function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, CredentialForm, GenerateForm, Rest, Alert,
|
||||||
ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList, SearchInit, PaginateInit, LookUpInit, UserList, TeamList,
|
ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList, SearchInit, PaginateInit, LookUpInit, UserList, TeamList,
|
||||||
GetBasePath, GetChoices, Empty, KindChange, OwnerChange, FormSave) {
|
GetBasePath, GetChoices, Empty, KindChange, OwnerChange, FormSave) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
// Inject dynamic view
|
// Inject dynamic view
|
||||||
@@ -143,7 +141,7 @@ function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $routePar
|
|||||||
generator = GenerateForm,
|
generator = GenerateForm,
|
||||||
defaultUrl = GetBasePath('credentials'),
|
defaultUrl = GetBasePath('credentials'),
|
||||||
url;
|
url;
|
||||||
|
|
||||||
generator.inject(form, { mode: 'add', related: false, scope: $scope });
|
generator.inject(form, { mode: 'add', related: false, scope: $scope });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
LoadBreadCrumbs();
|
LoadBreadCrumbs();
|
||||||
@@ -269,7 +267,7 @@ CredentialsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log
|
|||||||
function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, CredentialForm, GenerateForm, Rest, Alert,
|
function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, CredentialForm, GenerateForm, Rest, Alert,
|
||||||
ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, Prompt, GetBasePath, GetChoices,
|
ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, Prompt, GetBasePath, GetChoices,
|
||||||
KindChange, UserList, TeamList, LookUpInit, Empty, OwnerChange, FormSave, Stream, Wait) {
|
KindChange, UserList, TeamList, LookUpInit, Empty, OwnerChange, FormSave, Stream, Wait) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
var defaultUrl = GetBasePath('credentials'),
|
var defaultUrl = GetBasePath('credentials'),
|
||||||
@@ -278,7 +276,7 @@ function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||||
master = {},
|
master = {},
|
||||||
id = $routeParams.credential_id;
|
id = $routeParams.credential_id;
|
||||||
|
|
||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
$scope.id = id;
|
$scope.id = id;
|
||||||
@@ -344,9 +342,9 @@ function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
Rest.setUrl(defaultUrl + ':id/');
|
Rest.setUrl(defaultUrl + ':id/');
|
||||||
Rest.get({ params: { id: id } })
|
Rest.get({ params: { id: id } })
|
||||||
.success(function (data) {
|
.success(function (data) {
|
||||||
|
|
||||||
var i, fld;
|
var i, fld;
|
||||||
|
|
||||||
LoadBreadCrumbs({
|
LoadBreadCrumbs({
|
||||||
path: '/credentials/' + id,
|
path: '/credentials/' + id,
|
||||||
title: data.name
|
title: data.name
|
||||||
|
|||||||
@@ -316,9 +316,7 @@ function InventoriesList($scope, $rootScope, $location, $log, $routeParams, $com
|
|||||||
|
|
||||||
var action = function () {
|
var action = function () {
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
$('#prompt-modal').on('hidden.bs.modal', function () {
|
Wait('start');
|
||||||
Wait('start');
|
|
||||||
});
|
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function JobTemplatesList($scope, $rootScope, $location, $log, $routeParams, Res
|
|||||||
view = GenerateList,
|
view = GenerateList,
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||||
mode = (base === 'job_templates') ? 'edit' : 'select';
|
mode = (base === 'job_templates') ? 'edit' : 'select';
|
||||||
|
|
||||||
view.inject(list, { mode: mode, scope: $scope });
|
view.inject(list, { mode: mode, scope: $scope });
|
||||||
$rootScope.flashMessage = null;
|
$rootScope.flashMessage = null;
|
||||||
|
|
||||||
@@ -71,10 +71,8 @@ function JobTemplatesList($scope, $rootScope, $location, $log, $routeParams, Res
|
|||||||
|
|
||||||
$scope.deleteJobTemplate = function (id, name) {
|
$scope.deleteJobTemplate = function (id, name) {
|
||||||
var action = function () {
|
var action = function () {
|
||||||
$('#prompt-modal').on('hidden.bs.modal', function () {
|
|
||||||
Wait('start');
|
|
||||||
});
|
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
@@ -110,7 +108,7 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GetBasePath,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GetBasePath,
|
||||||
InventoryList, CredentialList, ProjectList, LookUpInit, md5Setup, ParseTypeChange, Wait, Empty, ToJSON,
|
InventoryList, CredentialList, ProjectList, LookUpInit, md5Setup, ParseTypeChange, Wait, Empty, ToJSON,
|
||||||
CallbackHelpInit) {
|
CallbackHelpInit) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
// Inject dynamic view
|
// Inject dynamic view
|
||||||
@@ -121,11 +119,11 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
CloudCredentialList = {},
|
CloudCredentialList = {},
|
||||||
selectPlaybook, checkSCMStatus,
|
selectPlaybook, checkSCMStatus,
|
||||||
callback;
|
callback;
|
||||||
|
|
||||||
CallbackHelpInit({ scope: $scope });
|
CallbackHelpInit({ scope: $scope });
|
||||||
|
|
||||||
generator.inject(form, { mode: 'add', related: false, scope: $scope });
|
generator.inject(form, { mode: 'add', related: false, scope: $scope });
|
||||||
|
|
||||||
callback = function() {
|
callback = function() {
|
||||||
// Make sure the form controller knows there was a change
|
// Make sure the form controller knows there was a change
|
||||||
$scope[form.name + '_form'].setDirty();
|
$scope[form.name + '_form'].setDirty();
|
||||||
@@ -343,7 +341,7 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
CredentialList, ProjectList, LookUpInit, GetBasePath, md5Setup, ParseTypeChange, JobStatusToolTip, FormatDate,
|
CredentialList, ProjectList, LookUpInit, GetBasePath, md5Setup, ParseTypeChange, JobStatusToolTip, FormatDate,
|
||||||
Wait, Stream, Empty, Prompt, ParseVariableString, ToJSON, SchedulesControllerInit, JobsControllerInit, JobsListUpdate,
|
Wait, Stream, Empty, Prompt, ParseVariableString, ToJSON, SchedulesControllerInit, JobsControllerInit, JobsListUpdate,
|
||||||
GetChoices, SchedulesListInit, SchedulesList, CallbackHelpInit) {
|
GetChoices, SchedulesListInit, SchedulesList, CallbackHelpInit) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
var defaultUrl = GetBasePath('job_templates'),
|
var defaultUrl = GetBasePath('job_templates'),
|
||||||
@@ -364,19 +362,19 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
|
|
||||||
$scope.parseType = 'yaml';
|
$scope.parseType = 'yaml';
|
||||||
$scope.showJobType = false;
|
$scope.showJobType = false;
|
||||||
|
|
||||||
// Our job type options
|
// Our job type options
|
||||||
$scope.job_type_options = [
|
$scope.job_type_options = [
|
||||||
{ value: 'run', label: 'Run' },
|
{ value: 'run', label: 'Run' },
|
||||||
{ value: 'check', label: 'Check' }
|
{ value: 'check', label: 'Check' }
|
||||||
];
|
];
|
||||||
|
|
||||||
$scope.verbosity_options = [
|
$scope.verbosity_options = [
|
||||||
{ value: 0, label: 'Default' },
|
{ value: 0, label: 'Default' },
|
||||||
{ value: 1, label: 'Verbose' },
|
{ value: 1, label: 'Verbose' },
|
||||||
{ value: 3, label: 'Debug' }
|
{ value: 3, label: 'Debug' }
|
||||||
];
|
];
|
||||||
|
|
||||||
callback = function() {
|
callback = function() {
|
||||||
// Make sure the form controller knows there was a change
|
// Make sure the form controller knows there was a change
|
||||||
$scope[form.name + '_form'].$setDirty();
|
$scope[form.name + '_form'].$setDirty();
|
||||||
@@ -482,7 +480,7 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
$scope.removeJobTemplateLoadFinished = $scope.$on('jobTemplateLoadFinished', function () {
|
$scope.removeJobTemplateLoadFinished = $scope.$on('jobTemplateLoadFinished', function () {
|
||||||
loadingFinishedCount++;
|
loadingFinishedCount++;
|
||||||
if (loadingFinishedCount >= 2) {
|
if (loadingFinishedCount >= 2) {
|
||||||
// The initial template load finished. Now load related jobs, which
|
// The initial template load finished. Now load related jobs, which
|
||||||
// will turn off the 'working' spinner.
|
// will turn off the 'working' spinner.
|
||||||
for (var set in relatedSets) {
|
for (var set in relatedSets) {
|
||||||
$scope.search(relatedSets[set].iterator);
|
$scope.search(relatedSets[set].iterator);
|
||||||
@@ -601,7 +599,7 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
master[fld] = $scope[fld];
|
master[fld] = $scope[fld];
|
||||||
}
|
}
|
||||||
if (fld === 'variables') {
|
if (fld === 'variables') {
|
||||||
// Parse extra_vars, converting to YAML.
|
// Parse extra_vars, converting to YAML.
|
||||||
$scope.variables = ParseVariableString(data.extra_vars);
|
$scope.variables = ParseVariableString(data.extra_vars);
|
||||||
master.variables = $scope.variables;
|
master.variables = $scope.variables;
|
||||||
}
|
}
|
||||||
@@ -617,15 +615,15 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
|
|
||||||
$scope.ask_variables_on_launch = (data.ask_variables_on_launch) ? 'true' : 'false';
|
$scope.ask_variables_on_launch = (data.ask_variables_on_launch) ? 'true' : 'false';
|
||||||
master.ask_variables_on_launch = $scope.ask_variables_on_launch;
|
master.ask_variables_on_launch = $scope.ask_variables_on_launch;
|
||||||
|
|
||||||
relatedSets = form.relatedSets(data.related);
|
relatedSets = form.relatedSets(data.related);
|
||||||
|
|
||||||
if (data.host_config_key) {
|
if (data.host_config_key) {
|
||||||
$scope.example_config_key = data.host_config_key;
|
$scope.example_config_key = data.host_config_key;
|
||||||
}
|
}
|
||||||
$scope.example_template_id = id;
|
$scope.example_template_id = id;
|
||||||
$scope.setCallbackHelp();
|
$scope.setCallbackHelp();
|
||||||
|
|
||||||
$scope.callback_url = $scope.callback_server_path + ((data.related.callback) ? data.related.callback :
|
$scope.callback_url = $scope.callback_server_path + ((data.related.callback) ? data.related.callback :
|
||||||
GetBasePath('job_templates') + id + '/callback/');
|
GetBasePath('job_templates') + id + '/callback/');
|
||||||
master.callback_url = $scope.callback_url;
|
master.callback_url = $scope.callback_url;
|
||||||
@@ -661,7 +659,7 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
form: form,
|
form: form,
|
||||||
relatedSets: relatedSets
|
relatedSets: relatedSets
|
||||||
});
|
});
|
||||||
|
|
||||||
RelatedPaginateInit({
|
RelatedPaginateInit({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
relatedSets: relatedSets
|
relatedSets: relatedSets
|
||||||
@@ -694,7 +692,7 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
variable: 'status_choices',
|
variable: 'status_choices',
|
||||||
callback: 'choicesReady'
|
callback: 'choicesReady'
|
||||||
});
|
});
|
||||||
|
|
||||||
GetChoices({
|
GetChoices({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
url: GetBasePath('unified_jobs'),
|
url: GetBasePath('unified_jobs'),
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
function OrganizationsList($routeParams, $scope, $rootScope, $location, $log, Rest, Alert, LoadBreadCrumbs, Prompt,
|
function OrganizationsList($routeParams, $scope, $rootScope, $location, $log, Rest, Alert, LoadBreadCrumbs, Prompt,
|
||||||
GenerateList, OrganizationList, SearchInit, PaginateInit, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) {
|
GenerateList, OrganizationList, SearchInit, PaginateInit, ClearScope, ProcessErrors, GetBasePath, SelectionInit, Wait, Stream) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
var list = OrganizationList,
|
var list = OrganizationList,
|
||||||
@@ -21,11 +21,11 @@ function OrganizationsList($routeParams, $scope, $rootScope, $location, $log, Re
|
|||||||
mode = (paths[0] === 'organizations') ? 'edit' : 'select',
|
mode = (paths[0] === 'organizations') ? 'edit' : 'select',
|
||||||
defaultUrl = GetBasePath('organizations'),
|
defaultUrl = GetBasePath('organizations'),
|
||||||
url;
|
url;
|
||||||
|
|
||||||
generate.inject(OrganizationList, { mode: mode, scope: $scope });
|
generate.inject(OrganizationList, { mode: mode, scope: $scope });
|
||||||
$rootScope.flashMessage = null;
|
$rootScope.flashMessage = null;
|
||||||
LoadBreadCrumbs();
|
LoadBreadCrumbs();
|
||||||
|
|
||||||
if (mode === 'select') {
|
if (mode === 'select') {
|
||||||
url = GetBasePath('projects') + $routeParams.project_id + '/organizations/';
|
url = GetBasePath('projects') + $routeParams.project_id + '/organizations/';
|
||||||
SelectionInit({ scope: $scope, list: list, url: url, returnToCaller: 1 });
|
SelectionInit({ scope: $scope, list: list, url: url, returnToCaller: 1 });
|
||||||
@@ -69,10 +69,8 @@ function OrganizationsList($routeParams, $scope, $rootScope, $location, $log, Re
|
|||||||
$scope.deleteOrganization = function (id, name) {
|
$scope.deleteOrganization = function (id, name) {
|
||||||
|
|
||||||
var action = function () {
|
var action = function () {
|
||||||
$('#prompt-modal').on('hidden.bs.modal', function () {
|
|
||||||
Wait('start');
|
|
||||||
});
|
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
@@ -102,9 +100,9 @@ OrganizationsList.$inject = ['$routeParams', '$scope', '$rootScope', '$location'
|
|||||||
function OrganizationsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm,
|
function OrganizationsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath,
|
||||||
ReturnToCaller, Wait) {
|
ReturnToCaller, Wait) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
// Inject dynamic view
|
// Inject dynamic view
|
||||||
var generator = GenerateForm,
|
var generator = GenerateForm,
|
||||||
form = OrganizationForm,
|
form = OrganizationForm,
|
||||||
@@ -152,7 +150,7 @@ OrganizationsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$l
|
|||||||
|
|
||||||
function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm, GenerateForm, Rest,
|
function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm, GenerateForm, Rest,
|
||||||
Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, Prompt, ClearScope, GetBasePath, Wait, Stream) {
|
Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, Prompt, ClearScope, GetBasePath, Wait, Stream) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
// Inject dynamic view
|
// Inject dynamic view
|
||||||
|
|||||||
@@ -7,20 +7,20 @@
|
|||||||
* Controller functions for Permissions model.
|
* Controller functions for Permissions model.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function PermissionsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, PermissionList,
|
function PermissionsList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, PermissionList,
|
||||||
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors,
|
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors,
|
||||||
GetBasePath, CheckAccess, Wait) {
|
GetBasePath, CheckAccess, Wait) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
var list = PermissionList,
|
var list = PermissionList,
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||||
defaultUrl = GetBasePath(base),
|
defaultUrl = GetBasePath(base),
|
||||||
generator = GenerateList;
|
generator = GenerateList;
|
||||||
|
|
||||||
generator.inject(list, { mode: 'edit', scope: $scope });
|
generator.inject(list, { mode: 'edit', scope: $scope });
|
||||||
defaultUrl += ($routeParams.user_id !== undefined) ? $routeParams.user_id : $routeParams.team_id;
|
defaultUrl += ($routeParams.user_id !== undefined) ? $routeParams.user_id : $routeParams.team_id;
|
||||||
defaultUrl += '/permissions/';
|
defaultUrl += '/permissions/';
|
||||||
@@ -67,10 +67,8 @@ function PermissionsList($scope, $rootScope, $location, $log, $routeParams, Rest
|
|||||||
|
|
||||||
$scope.deletePermission = function (id, name) {
|
$scope.deletePermission = function (id, name) {
|
||||||
var action = function () {
|
var action = function () {
|
||||||
$('#prompt-modal').on('hidden.bs.modal', function () {
|
|
||||||
Wait('start');
|
|
||||||
});
|
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
|
Wait('start');
|
||||||
var url = GetBasePath('base') + 'permissions/' + id + '/';
|
var url = GetBasePath('base') + 'permissions/' + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
@@ -104,7 +102,7 @@ function PermissionsAdd($scope, $rootScope, $compile, $location, $log, $routePar
|
|||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope,
|
||||||
GetBasePath, ReturnToCaller, InventoryList, ProjectList, LookUpInit, CheckAccess,
|
GetBasePath, ReturnToCaller, InventoryList, ProjectList, LookUpInit, CheckAccess,
|
||||||
Wait, PermissionCategoryChange) {
|
Wait, PermissionCategoryChange) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
// Inject dynamic view
|
// Inject dynamic view
|
||||||
@@ -113,7 +111,7 @@ function PermissionsAdd($scope, $rootScope, $compile, $location, $log, $routePar
|
|||||||
id = ($routeParams.user_id !== undefined) ? $routeParams.user_id : $routeParams.team_id,
|
id = ($routeParams.user_id !== undefined) ? $routeParams.user_id : $routeParams.team_id,
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||||
master = {};
|
master = {};
|
||||||
|
|
||||||
generator.inject(form, { mode: 'add', related: false, scope: $scope });
|
generator.inject(form, { mode: 'add', related: false, scope: $scope });
|
||||||
CheckAccess({ scope: $scope });
|
CheckAccess({ scope: $scope });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
@@ -198,7 +196,7 @@ PermissionsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log
|
|||||||
function PermissionsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, PermissionsForm,
|
function PermissionsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, PermissionsForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, Prompt, GetBasePath,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, Prompt, GetBasePath,
|
||||||
InventoryList, ProjectList, LookUpInit, CheckAccess, Wait, PermissionCategoryChange) {
|
InventoryList, ProjectList, LookUpInit, CheckAccess, Wait, PermissionCategoryChange) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
var generator = GenerateForm,
|
var generator = GenerateForm,
|
||||||
@@ -207,11 +205,11 @@ function PermissionsEdit($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
id = $routeParams.permission_id,
|
id = $routeParams.permission_id,
|
||||||
defaultUrl = GetBasePath('base') + 'permissions/' + id + '/',
|
defaultUrl = GetBasePath('base') + 'permissions/' + id + '/',
|
||||||
master = {};
|
master = {};
|
||||||
|
|
||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
|
|
||||||
|
|
||||||
CheckAccess({ scope: $scope });
|
CheckAccess({ scope: $scope });
|
||||||
|
|
||||||
$scope.selectCategory = function (resetIn) {
|
$scope.selectCategory = function (resetIn) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList, GenerateList, LoadBreadCrumbs,
|
function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList, GenerateList, LoadBreadCrumbs,
|
||||||
Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, ProjectUpdate,
|
Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, SelectionInit, ProjectUpdate,
|
||||||
Refresh, Wait, Stream, GetChoices, Empty, Find, LogViewer, GetProjectIcon, GetProjectToolTip) {
|
Refresh, Wait, Stream, GetChoices, Empty, Find, LogViewer, GetProjectIcon, GetProjectToolTip) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
Wait('start');
|
Wait('start');
|
||||||
@@ -45,10 +45,10 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
}
|
}
|
||||||
$scope.removePostRefresh = $scope.$on('PostRefresh', function () {
|
$scope.removePostRefresh = $scope.$on('PostRefresh', function () {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
|
|
||||||
if ($scope.projects) {
|
if ($scope.projects) {
|
||||||
$scope.projects.forEach(function(project, i) {
|
$scope.projects.forEach(function(project, i) {
|
||||||
|
|
||||||
$scope.projects[i].statusIcon = GetProjectIcon(project.status);
|
$scope.projects[i].statusIcon = GetProjectIcon(project.status);
|
||||||
$scope.projects[i].statusTip = GetProjectToolTip(project.status);
|
$scope.projects[i].statusTip = GetProjectToolTip(project.status);
|
||||||
|
|
||||||
@@ -233,10 +233,8 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
|
|
||||||
$scope.deleteProject = function (id, name) {
|
$scope.deleteProject = function (id, name) {
|
||||||
var action = function () {
|
var action = function () {
|
||||||
$('#prompt-modal').on('hiden.bs.modal', function () {
|
|
||||||
Wait('start');
|
|
||||||
});
|
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
@@ -376,7 +374,7 @@ ProjectsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routePara
|
|||||||
function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm, GenerateForm, Rest, Alert, ProcessErrors,
|
function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm, GenerateForm, Rest, Alert, ProcessErrors,
|
||||||
LoadBreadCrumbs, ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, LookUpInit, OrganizationList,
|
LoadBreadCrumbs, ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, LookUpInit, OrganizationList,
|
||||||
CredentialList, GetChoices, DebugForm, Wait) {
|
CredentialList, GetChoices, DebugForm, Wait) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
// Inject dynamic view
|
// Inject dynamic view
|
||||||
@@ -385,7 +383,7 @@ function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $routeParams
|
|||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||||
defaultUrl = GetBasePath('projects'),
|
defaultUrl = GetBasePath('projects'),
|
||||||
master = {};
|
master = {};
|
||||||
|
|
||||||
generator.inject(form, { mode: 'add', related: false, scope: $scope });
|
generator.inject(form, { mode: 'add', related: false, scope: $scope });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
LoadBreadCrumbs();
|
LoadBreadCrumbs();
|
||||||
@@ -518,7 +516,7 @@ function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, Prompt,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, Prompt,
|
||||||
ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, Authorization, CredentialList, LookUpInit, GetChoices,
|
ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, Authorization, CredentialList, LookUpInit, GetChoices,
|
||||||
Empty, DebugForm, Wait, Stream, SchedulesControllerInit, SchedulesListInit, SchedulesList) {
|
Empty, DebugForm, Wait, Stream, SchedulesControllerInit, SchedulesListInit, SchedulesList) {
|
||||||
|
|
||||||
ClearScope('htmlTemplate');
|
ClearScope('htmlTemplate');
|
||||||
|
|
||||||
// Inject dynamic view
|
// Inject dynamic view
|
||||||
@@ -529,7 +527,7 @@ function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
master = {},
|
master = {},
|
||||||
id = $routeParams.id,
|
id = $routeParams.id,
|
||||||
relatedSets = {};
|
relatedSets = {};
|
||||||
|
|
||||||
SchedulesList.well = false;
|
SchedulesList.well = false;
|
||||||
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
generator.inject(form, { mode: 'edit', related: true, scope: $scope });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
@@ -622,7 +620,7 @@ function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
data.summary_fields[form.fields[fld].sourceModel][form.fields[fld].sourceField];
|
data.summary_fields[form.fields[fld].sourceModel][form.fields[fld].sourceField];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
relatedSets = form.relatedSets(data.related);
|
relatedSets = form.relatedSets(data.related);
|
||||||
|
|
||||||
data.scm_type = (Empty(data.scm_type)) ? '' : data.scm_type;
|
data.scm_type = (Empty(data.scm_type)) ? '' : data.scm_type;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function UsersList($scope, $rootScope, $location, $log, $routeParams, Rest, Aler
|
|||||||
GetBasePath('teams') + $routeParams.team_id + '/users/';
|
GetBasePath('teams') + $routeParams.team_id + '/users/';
|
||||||
|
|
||||||
generator.inject(UserList, { mode: mode, scope: $scope });
|
generator.inject(UserList, { mode: mode, scope: $scope });
|
||||||
|
|
||||||
$scope.selected = [];
|
$scope.selected = [];
|
||||||
|
|
||||||
if (mode === 'select') {
|
if (mode === 'select') {
|
||||||
@@ -70,10 +70,11 @@ function UsersList($scope, $rootScope, $location, $log, $routeParams, Rest, Aler
|
|||||||
$scope.deleteUser = function (id, name) {
|
$scope.deleteUser = function (id, name) {
|
||||||
|
|
||||||
var action = function () {
|
var action = function () {
|
||||||
$('#prompt-modal').on('hidden.bs.modal', function () {
|
//$('#prompt-modal').on('hidden.bs.modal', function () {
|
||||||
Wait('start');
|
// Wait('start');
|
||||||
});
|
//});
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
|
Wait('start');
|
||||||
var url = defaultUrl + id + '/';
|
var url = defaultUrl + id + '/';
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
@@ -102,17 +103,17 @@ UsersList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams'
|
|||||||
|
|
||||||
function UsersAdd($scope, $rootScope, $compile, $location, $log, $routeParams, UserForm, GenerateForm, Rest, Alert, ProcessErrors,
|
function UsersAdd($scope, $rootScope, $compile, $location, $log, $routeParams, UserForm, GenerateForm, Rest, Alert, ProcessErrors,
|
||||||
LoadBreadCrumbs, ReturnToCaller, ClearScope, GetBasePath, LookUpInit, OrganizationList, ResetForm, Wait) {
|
LoadBreadCrumbs, ReturnToCaller, ClearScope, GetBasePath, LookUpInit, OrganizationList, ResetForm, Wait) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
// Inject dynamic view
|
// Inject dynamic view
|
||||||
var defaultUrl = GetBasePath('organizations'),
|
var defaultUrl = GetBasePath('organizations'),
|
||||||
form = UserForm,
|
form = UserForm,
|
||||||
generator = GenerateForm;
|
generator = GenerateForm;
|
||||||
|
|
||||||
generator.inject(form, { mode: 'add', related: false, scope: $scope });
|
generator.inject(form, { mode: 'add', related: false, scope: $scope });
|
||||||
ResetForm();
|
ResetForm();
|
||||||
|
|
||||||
$scope.ldap_user = false;
|
$scope.ldap_user = false;
|
||||||
$scope.not_ldap_user = !$scope.ldap_user;
|
$scope.not_ldap_user = !$scope.ldap_user;
|
||||||
$scope.ldap_dn = null;
|
$scope.ldap_dn = null;
|
||||||
@@ -121,7 +122,7 @@ function UsersAdd($scope, $rootScope, $compile, $location, $log, $routeParams, U
|
|||||||
|
|
||||||
LoadBreadCrumbs();
|
LoadBreadCrumbs();
|
||||||
|
|
||||||
// Configure the lookup dialog. If we're adding a user through the Organizations tab,
|
// Configure the lookup dialog. If we're adding a user through the Organizations tab,
|
||||||
// default the Organization value.
|
// default the Organization value.
|
||||||
LookUpInit({
|
LookUpInit({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
@@ -205,7 +206,7 @@ UsersAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$r
|
|||||||
function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeParams, UserForm, GenerateForm, Rest, Alert,
|
function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeParams, UserForm, GenerateForm, Rest, Alert,
|
||||||
ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, GetBasePath,
|
ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, GetBasePath,
|
||||||
Prompt, CheckAccess, ResetForm, Wait, Stream) {
|
Prompt, CheckAccess, ResetForm, Wait, Stream) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
var defaultUrl = GetBasePath('users'),
|
var defaultUrl = GetBasePath('users'),
|
||||||
@@ -422,7 +423,7 @@ function UsersEdit($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
};
|
};
|
||||||
}); // $scope.$on
|
}); // $scope.$on
|
||||||
|
|
||||||
// Put form back to its original state
|
// Put form back to its original state
|
||||||
ResetForm();
|
ResetForm();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user