mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 02:50:02 -03:30
Lates UI changes
This commit is contained in:
parent
011545035d
commit
1d19bd9c06
@ -27,6 +27,20 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
var url = (base == 'teams') ? GetBasePath('teams') + $routeParams.team_id + '/projects/' : defaultUrl;
|
||||
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 });
|
||||
PaginateInit({ scope: scope, list: list, url: defaultUrl });
|
||||
scope.search(list.iterator);
|
||||
@ -164,6 +178,7 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
|
||||
scope.scmChange = function() {
|
||||
// When an scm_type is set, path is not required
|
||||
scope.pathRequired = (scope.scm_type) ? false : true;
|
||||
scope.scmBranchLabel = (scope.scm_type.value == 'svn') ? 'Revision #' : 'SCM Branch';
|
||||
}
|
||||
|
||||
// Cancel
|
||||
|
||||
@ -93,7 +93,7 @@ angular.module('ProjectFormDefinition', [])
|
||||
awRequiredWhen: {variable: "scm_type", init: "true" }
|
||||
},
|
||||
scm_branch: {
|
||||
label: 'SCM Branch',
|
||||
labelBind: "scmBranchLabel",
|
||||
type: 'text',
|
||||
ngShow: "scm_type !== '' && scm_type !== null",
|
||||
addRequired: false,
|
||||
|
||||
@ -369,12 +369,10 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
.success( function(data, status, headers, config) {
|
||||
scope.selectedNode = scope.selectedNode.parent().parent();
|
||||
RefreshTree({ scope: scope });
|
||||
Wait('stop');
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
//$('#prompt-modal').modal('hide');
|
||||
RefreshTree({ scope: scope });
|
||||
Wait('stop');
|
||||
ProcessErrors(scope, data, status, null,
|
||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
||||
});
|
||||
|
||||
@ -24,7 +24,7 @@ angular.module('ProjectsListDefinition', [])
|
||||
key: true,
|
||||
label: 'Name',
|
||||
badgeIcon: "\{\{ 'icon-failures-' + project.last_update_failed \}\}",
|
||||
badgePlacement: 'left'
|
||||
badgePlacement: 'left',
|
||||
},
|
||||
description: {
|
||||
label: 'Description'
|
||||
|
||||
@ -352,12 +352,14 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
||||
html += (field.labelNGClass) ? "ng-class=\"" + field.labelNGClass + "\" " : "";
|
||||
html += "class=\"control-label " + getLabelWidth();
|
||||
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.icon) ? this.icon(field.icon) : "";
|
||||
html += field.label + '</label>' + "\n";
|
||||
html += "<div ";
|
||||
html += (field.controlNGClass) ? "ng-class=\"" + field.controlNGClass + "\" " : "";
|
||||
html += (field.controlNGClass) ? "ng-class=\"" + field.controlNGClass + "\" " : "";
|
||||
html += "class=\"" + getFieldWidth() + "\">\n";
|
||||
html += (field.clear || field.genMD5) ? "<div class=\"input-group\">\n" : "";
|
||||
|
||||
|
||||
@ -210,12 +210,13 @@ angular.module('Utilities',[])
|
||||
}
|
||||
}])
|
||||
|
||||
.factory('Wait', [ function() {
|
||||
.factory('Wait', [ '$rootScope', function($rootScope) {
|
||||
return function(directive) {
|
||||
// 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).
|
||||
// Wait('start' | 'stop');
|
||||
if (directive == 'start') {
|
||||
if (directive == 'start' && !$rootScope.waiting) {
|
||||
$rootScope.waiting = true;
|
||||
var docw = $(document).width();
|
||||
var doch = $(document).height();
|
||||
var spinnyw = $('.spinny').width();
|
||||
@ -232,6 +233,7 @@ angular.module('Utilities',[])
|
||||
}).fadeIn(400);
|
||||
}
|
||||
else {
|
||||
$rootScope.waiting = false;
|
||||
$('.spinny, .overlay').fadeOut(1000);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user