AC-351 last bits of SCM Integration. Refresh button, and status and last_updated fields added.

This commit is contained in:
chouseknecht
2013-09-05 07:17:34 -04:00
parent fb8212b063
commit 567aef5d1e
6 changed files with 55 additions and 6 deletions

View File

@@ -12,7 +12,8 @@
function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList, function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
ClearScope, ProcessErrors, GetBasePath, SelectionInit, SCMUpdate, ProjectStatus) ClearScope, ProcessErrors, GetBasePath, SelectionInit, SCMUpdate, ProjectStatus,
FormatDate)
{ {
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
//scope. //scope.
@@ -38,6 +39,7 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
// will contain status of last update, which is not what we want. // will contain status of last update, which is not what we want.
scope.projects[i].last_update_failed = false; scope.projects[i].last_update_failed = false;
} }
scope.projects[i].last_updated = FormatDate(new Date(scope.projects[i].last_updated));
} }
}); });
@@ -101,12 +103,25 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
}); });
} }
scope.refresh = function() {
scope.search(list.iterator);
}
if (scope.removeUpdateSubmitted) {
scope.removeUpdateSubmitted();
}
scope.removeUpdateSubmitted = scope.$on('UpdateSubmitted', function() {
scope.search(list.iterator);
});
scope.SCMUpdate = function(project_id) { scope.SCMUpdate = function(project_id) {
for (var i=0; i < scope.projects.length; i++) { for (var i=0; i < scope.projects.length; i++) {
if (scope.projects[i].id == project_id) { if (scope.projects[i].id == project_id) {
if (scope.projects[i].scm_type == "") { if (scope.projects[i].scm_type == "") {
Alert('Missing SCM Setup', 'Before running an SCM update, edit the project and provide the SCM access information.', 'alert-info'); Alert('Missing SCM Setup', 'Before running an SCM update, edit the project and provide the SCM access information.', 'alert-info');
} }
else if (scope.projects[i].status == 'updating') {
Alert('Update in Progress', 'The SCM update process is running. Use the Refresh button to monitor the status.', 'alert-info');
}
else { else {
SCMUpdate({ scope: scope, project_id: project_id }); SCMUpdate({ scope: scope, project_id: project_id });
} }
@@ -118,7 +133,7 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
ProjectsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'ProjectList', 'GenerateList', ProjectsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'ProjectList', 'GenerateList',
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
'GetBasePath', 'SelectionInit', 'SCMUpdate', 'ProjectStatus']; 'GetBasePath', 'SelectionInit', 'SCMUpdate', 'ProjectStatus', 'FormatDate'];
function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm, function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm,

View File

@@ -72,6 +72,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
Rest.setUrl(start_url); Rest.setUrl(start_url);
Rest.post(pswd) Rest.post(pswd)
.success( function(data, status, headers, config) { .success( function(data, status, headers, config) {
scope.$emit('UpdateSubmitted');
if (form.name == 'credential') { if (form.name == 'credential') {
navigate(false); navigate(false);
} }

View File

@@ -63,7 +63,7 @@ angular.module('JobEventsListDefinition', [])
icon: 'icon-refresh', icon: 'icon-refresh',
label: 'Refresh', label: 'Refresh',
awToolTip: 'Refresh the page', awToolTip: 'Refresh the page',
"class": 'btn-sm btn-success', "class": 'btn-sm btn-primary',
mode: 'all' mode: 'all'
}, },
edit: { edit: {

View File

@@ -67,7 +67,7 @@ angular.module('JobHostDefinition', [])
label: 'Refresh', label: 'Refresh',
icon: 'icon-refresh', icon: 'icon-refresh',
ngClick: "refresh()", ngClick: "refresh()",
"class": 'btn-success btn-sm', "class": 'btn-primary btn-sm',
awToolTip: 'Refresh the page', awToolTip: 'Refresh the page',
mode: 'all' mode: 'all'
}, },

View File

@@ -57,7 +57,7 @@ angular.module('JobsListDefinition', [])
actions: { actions: {
refresh: { refresh: {
label: 'Refresh', label: 'Refresh',
"class": 'btn-success btn-sm', "class": 'btn-primary btn-sm',
ngClick: "refreshJob(\{\{ job.id \}\})", ngClick: "refreshJob(\{\{ job.id \}\})",
icon: 'icon-refresh', icon: 'icon-refresh',
awToolTip: 'Refresh the page', awToolTip: 'Refresh the page',

View File

@@ -28,6 +28,13 @@ angular.module('ProjectsListDefinition', [])
}, },
description: { description: {
label: 'Description' label: 'Description'
},
last_updated: {
label: 'Last Updated',
type: 'date'
},
status: {
label: 'Status'
} }
}, },
@@ -39,6 +46,32 @@ angular.module('ProjectsListDefinition', [])
ngClick: 'addProject()', ngClick: 'addProject()',
"class": 'btn-success btn-sm', "class": 'btn-success btn-sm',
awToolTip: 'Create a new project' awToolTip: 'Create a new project'
},
refresh: {
label: 'Refresh',
"class": 'btn-primary btn-sm',
ngClick: "refresh(\{\{ job.id \}\})",
icon: 'icon-refresh',
awToolTip: 'Refresh the page',
mode: 'all'
},
help: {
awPopOver: "<dl>\n<dt>Updating</dt><dd>An SCM update is in progress.</dd>\n" +
"<dt>Never Updated</dt><dd>No SCM update has ever run for the project.</dd>\n" +
"<dt>Failed</dt><dd>An error occurred during the most recent SCM update.</dd>\n" +
"<dt>Successful</dt><dd>The latest SCM update ran to completion without incident.</dd>\n" +
"<dt>Missing</dt><dd>The local project directory is missing.</dd>\n" +
"<dt>OK</dt><dd>The project does not use SCM, and the directory is present.</dd>\n" +
"</dl>\n",
dataPlacement: 'left',
dataContainer: 'body',
icon: "icon-question-sign",
mode: 'all',
'class': 'btn-xs btn-info btn-help',
awToolTip: 'Click for help',
dataTitle: 'Project Status',
iconSize: 'large',
id: 'project-help-button'
} }
}, },