AC-351 latest SCM changes. Added 'Authentication Required' checkbox. Enabled SCM password prompting on job submission.

This commit is contained in:
chouseknecht
2013-09-08 17:17:35 -04:00
parent 7b57189eca
commit 5afa79a11a
5 changed files with 60 additions and 21 deletions

View File

@@ -202,7 +202,7 @@ function CredentialsEdit ($scope, $rootScope, $compile, $location, $log, $routeP
scope[fld + '_ask'] = false;
$("#" + fld + "-clear-btn").removeAttr("disabled");
}
master[fld + '_ask'] = scope[fld + '_ask'];
}
}

View File

@@ -33,11 +33,13 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
scope[ngc] = "";
});
// Convert created date to local time zone
var cDate;
for (var i=0; i < scope[list.name].length; i++) {
cDate = new Date(scope[list.name][i].created);
scope[list.name][i].created = FormatDate(cDate);
if (scope[list.name]) {
// Convert created date to local time zone
var cDate;
for (var i=0; i < scope[list.name].length; i++) {
cDate = new Date(scope[list.name][i].created);
scope[list.name][i].created = FormatDate(cDate);
}
}
});

View File

@@ -39,7 +39,8 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
// will contain status of last update, which is not what we want.
scope.projects[i].last_update_failed = false;
}
scope.projects[i].last_updated = FormatDate(new Date(scope.projects[i].last_updated));
scope.projects[i].last_updated = (scope.projects[i].last_updated !== null) ?
FormatDate(new Date(scope.projects[i].last_updated)) : null;
}
});
@@ -233,6 +234,18 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
scope.scmBranchLabel = (scope.scm_type.value == 'svn') ? 'Revision #' : 'SCM Branch';
}
scope.authChange = function() {
if (!scope.auth_required) {
scope.scm_username = null;
scope.scm_password = null;
scope.scm_password_confirm = null;
scope.scm_key_data = null;
scope.scm_key_unlock = null;
scope.scm_key_unlock_confirm = null;
scope.scm_password_ask = false;
}
}
// Cancel
scope.formReset = function() {
$rootScope.flashMessage = null;
@@ -288,6 +301,7 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
scope[fld + '_ask'] = false;
$("#" + fld + "-clear-btn").removeAttr("disabled");
}
master[fld + '_ask'] = scope[fld + '_ask'];
}
}
@@ -308,6 +322,8 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
scope.project_local_paths = opts;
scope.base_dir = 'You do not have access to view this property';
}
scope.auth_required = (scope.scm_type && (scope.scm_username || scope.scm_key_unlock)) ? true : false;
master.auth_required = scope.auth_required;
});
// Retrieve detail record and prepopulate the form
@@ -403,6 +419,18 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
}
};
scope.authChange = function() {
if (!scope.auth_required) {
scope.scm_username = null;
scope.scm_password = null;
scope.scm_password_confirm = null;
scope.scm_key_data = null;
scope.scm_key_unlock = null;
scope.scm_key_unlock_confirm = null;
scope.scm_password_ask = false;
}
}
// Related set: Add button
scope.add = function(set) {
$rootScope.flashMessage = null;