Continuing work on new Jobs page. Increased pop-over width. Added a footer explaning how to close. Added close-on-click behavior in addition to esc key.

This commit is contained in:
Chris Houseknecht
2014-03-22 17:49:22 -04:00
parent bec301c2a8
commit eea41e3401
12 changed files with 277 additions and 992 deletions

View File

@@ -10,11 +10,12 @@
'use strict';
function JobsList($scope, $compile, ClearScope, Breadcrumbs, LoadScope, RunningJobsList, CompletedJobsList, QueuedJobsList) {
function JobsList($scope, $compile, ClearScope, Breadcrumbs, LoadScope, RunningJobsList, CompletedJobsList, QueuedJobsList,
GetChoices, GetBasePath, Wait) {
ClearScope();
var e, completed_scope, running_scope, queued_scope;
var e, completed_scope, running_scope, queued_scope, choicesCount = 0, listsCount = 0;
// schedule_scope;
// Add breadcrumbs
@@ -22,33 +23,96 @@ function JobsList($scope, $compile, ClearScope, Breadcrumbs, LoadScope, RunningJ
e.html(Breadcrumbs({ list: { editTitle: 'Jobs' } , mode: 'edit' }));
$compile(e)($scope);
completed_scope = $scope.$new();
LoadScope({
scope: completed_scope,
list: CompletedJobsList,
id: 'completed-jobs',
url: '/static/sample/data/jobs/completed/data.json'
// After all the lists are loaded
if ($scope.removeListLoaded) {
$scope.removeListLoaded();
}
$scope.removeListLoaded = $scope.$on('listLoaded', function() {
listsCount++;
if (listsCount === 3) {
Wait('stop');
}
});
// After all choices are ready, load up the lists and populate the page
if ($scope.removeBuildJobsList) {
$scope.removeBuildJobsList();
}
$scope.removeBuildJobsList = $scope.$on('buildJobsList', function() {
completed_scope = $scope.$new();
LoadScope({
parent_scope: $scope,
scope: completed_scope,
list: CompletedJobsList,
id: 'completed-jobs',
url: '/static/sample/data/jobs/completed/data.json'
});
running_scope = $scope.$new();
LoadScope({
parent_scope: $scope,
scope: running_scope,
list: RunningJobsList,
id: 'active-jobs',
url: '/static/sample/data/jobs/running/data.json'
});
queued_scope = $scope.$new();
LoadScope({
parent_scope: $scope,
scope: queued_scope,
list: QueuedJobsList,
id: 'queued-jobs',
url: '/static/sample/data/jobs/queued/data.json'
});
});
running_scope = $scope.$new();
LoadScope({
scope: running_scope,
list: RunningJobsList,
id: 'active-jobs',
url: '/static/sample/data/jobs/running/data.json'
if ($scope.removeChoicesReady) {
$scope.removeChoicesReady();
}
$scope.removeChoicesReady = $scope.$on('choicesReady', function() {
choicesCount++;
if (choicesCount === 2) {
$scope.$emit('buildJobsList');
}
});
queued_scope = $scope.$new();
LoadScope({
scope: queued_scope,
list: QueuedJobsList,
id: 'queued-jobs',
url: '/static/sample/data/jobs/queued/data.json'
});
Wait('start');
GetChoices({
scope: $scope,
url: GetBasePath('jobs'),
field: 'status',
variable: 'status_choices',
callback: 'choicesReady'
});
/* Use for types later
GetChoices({
scope: $scope,
url: GetBasePath('jobs'),
field: 'type',
variable: 'types',
callback: ''
});
*/
$scope.type_choices = [{
label: 'Inventory sync',
value: 'inventory_sync',
name: 'inventory_sync'
},{
label: 'Project sync',
value: 'scm_sync',
name: 'scm_sync'
},{
label: 'Playbook run',
value: 'playbook_run',
name: 'playbook_run'
}];
$scope.$emit('choicesReady');
}
JobsList.$inject = ['$scope', '$compile', 'ClearScope', 'Breadcrumbs', 'LoadScope', 'RunningJobsList', 'CompletedJobsList', 'QueuedJobsList'];
JobsList.$inject = ['$scope', '$compile', 'ClearScope', 'Breadcrumbs', 'LoadScope', 'RunningJobsList', 'CompletedJobsList',
'QueuedJobsList', 'GetChoices', 'GetBasePath', 'Wait'];