mirror of
https://github.com/ansible/awx.git
synced 2026-03-16 00:17:29 -02:30
Lates UI changes
This commit is contained in:
@@ -27,6 +27,20 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
var url = (base == 'teams') ? GetBasePath('teams') + $routeParams.team_id + '/projects/' : defaultUrl;
|
var url = (base == 'teams') ? GetBasePath('teams') + $routeParams.team_id + '/projects/' : defaultUrl;
|
||||||
SelectionInit({ scope: scope, list: list, url: url, returnToCaller: 1 });
|
SelectionInit({ scope: scope, list: list, url: url, returnToCaller: 1 });
|
||||||
|
|
||||||
|
if (scope.postRefreshRemove) {
|
||||||
|
scope.postRefereshRemove();
|
||||||
|
}
|
||||||
|
scope.postRefreshRemove = scope.$on('PostRefresh', function() {
|
||||||
|
for (var i=0; i < scope.projects.length; i++) {
|
||||||
|
if (scope.projects[i].scm_type == null) {
|
||||||
|
// override the last_update_failed on manual projects- it should be false so we get a
|
||||||
|
// green badge. if projet scm_type changed from something to manual, last_update_failed
|
||||||
|
// will contain status of last update, which is not what we want.
|
||||||
|
scope.projects[i].last_update_failed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
SearchInit({ scope: scope, set: 'projects', list: list, url: defaultUrl });
|
SearchInit({ scope: scope, set: 'projects', 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);
|
||||||
@@ -164,6 +178,7 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
scope.scmChange = function() {
|
scope.scmChange = function() {
|
||||||
// When an scm_type is set, path is not required
|
// When an scm_type is set, path is not required
|
||||||
scope.pathRequired = (scope.scm_type) ? false : true;
|
scope.pathRequired = (scope.scm_type) ? false : true;
|
||||||
|
scope.scmBranchLabel = (scope.scm_type.value == 'svn') ? 'Revision #' : 'SCM Branch';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cancel
|
// Cancel
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ angular.module('ProjectFormDefinition', [])
|
|||||||
awRequiredWhen: {variable: "scm_type", init: "true" }
|
awRequiredWhen: {variable: "scm_type", init: "true" }
|
||||||
},
|
},
|
||||||
scm_branch: {
|
scm_branch: {
|
||||||
label: 'SCM Branch',
|
labelBind: "scmBranchLabel",
|
||||||
type: 'text',
|
type: 'text',
|
||||||
ngShow: "scm_type !== '' && scm_type !== null",
|
ngShow: "scm_type !== '' && scm_type !== null",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
|
|||||||
@@ -369,12 +369,10 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
scope.selectedNode = scope.selectedNode.parent().parent();
|
scope.selectedNode = scope.selectedNode.parent().parent();
|
||||||
RefreshTree({ scope: scope });
|
RefreshTree({ scope: scope });
|
||||||
Wait('stop');
|
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
//$('#prompt-modal').modal('hide');
|
//$('#prompt-modal').modal('hide');
|
||||||
RefreshTree({ scope: scope });
|
RefreshTree({ scope: scope });
|
||||||
Wait('stop');
|
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ angular.module('ProjectsListDefinition', [])
|
|||||||
key: true,
|
key: true,
|
||||||
label: 'Name',
|
label: 'Name',
|
||||||
badgeIcon: "\{\{ 'icon-failures-' + project.last_update_failed \}\}",
|
badgeIcon: "\{\{ 'icon-failures-' + project.last_update_failed \}\}",
|
||||||
badgePlacement: 'left'
|
badgePlacement: 'left',
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description'
|
label: 'Description'
|
||||||
|
|||||||
@@ -352,7 +352,9 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
|||||||
html += (field.labelNGClass) ? "ng-class=\"" + field.labelNGClass + "\" " : "";
|
html += (field.labelNGClass) ? "ng-class=\"" + field.labelNGClass + "\" " : "";
|
||||||
html += "class=\"control-label " + getLabelWidth();
|
html += "class=\"control-label " + getLabelWidth();
|
||||||
html += (field.labelClass) ? " " + field.labelClass : "";
|
html += (field.labelClass) ? " " + field.labelClass : "";
|
||||||
html += "\" for=\"" + fld + '">';
|
html += "\" ";
|
||||||
|
html += (field.labelBind) ? "ng-bind=\"" + field.labelBind + "\" " : "";
|
||||||
|
html += "for=\"" + fld + '">';
|
||||||
html += (field.awPopOver) ? this.attr(field, 'awPopOver', fld) : "";
|
html += (field.awPopOver) ? this.attr(field, 'awPopOver', fld) : "";
|
||||||
html += (field.icon) ? this.icon(field.icon) : "";
|
html += (field.icon) ? this.icon(field.icon) : "";
|
||||||
html += field.label + '</label>' + "\n";
|
html += field.label + '</label>' + "\n";
|
||||||
|
|||||||
@@ -210,12 +210,13 @@ angular.module('Utilities',[])
|
|||||||
}
|
}
|
||||||
}])
|
}])
|
||||||
|
|
||||||
.factory('Wait', [ function() {
|
.factory('Wait', [ '$rootScope', function($rootScope) {
|
||||||
return function(directive) {
|
return function(directive) {
|
||||||
// Display a spinning icon in the center of the screen to freeze the
|
// Display a spinning icon in the center of the screen to freeze the
|
||||||
// UI while waiting on async things to complete (i.e. API calls).
|
// UI while waiting on async things to complete (i.e. API calls).
|
||||||
// Wait('start' | 'stop');
|
// Wait('start' | 'stop');
|
||||||
if (directive == 'start') {
|
if (directive == 'start' && !$rootScope.waiting) {
|
||||||
|
$rootScope.waiting = true;
|
||||||
var docw = $(document).width();
|
var docw = $(document).width();
|
||||||
var doch = $(document).height();
|
var doch = $(document).height();
|
||||||
var spinnyw = $('.spinny').width();
|
var spinnyw = $('.spinny').width();
|
||||||
@@ -232,6 +233,7 @@ angular.module('Utilities',[])
|
|||||||
}).fadeIn(400);
|
}).fadeIn(400);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$rootScope.waiting = false;
|
||||||
$('.spinny, .overlay').fadeOut(1000);
|
$('.spinny, .overlay').fadeOut(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user