mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 13:55:04 -02:30
AC-175 dynamically set Event link color and cursor for each row. Used ng-class to dynamically set a css class. Now child rows that cannot be expanded appear to have no link -the text color is charcoal and the cursor is the default arrow.
This commit is contained in:
@@ -386,6 +386,11 @@
|
|||||||
margin-top: 25px;
|
margin-top: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.child-event a {
|
||||||
|
color: #36454F;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
/* End Jobs Page */
|
/* End Jobs Page */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
scope.selected = [];
|
scope.selected = [];
|
||||||
scope.expand = true; //on load, automatically expand all nodes
|
scope.expand = true; //on load, automatically expand all nodes
|
||||||
|
|
||||||
|
scope.parentNode = 'parent-event'; // used in ngClass to dynamicall set row level class and control
|
||||||
|
scope.childNode = 'child-event'; // link color and cursor
|
||||||
|
|
||||||
if (scope.RemovePostRefresh) {
|
if (scope.RemovePostRefresh) {
|
||||||
scope.RemovePostRefresh();
|
scope.RemovePostRefresh();
|
||||||
}
|
}
|
||||||
@@ -44,6 +47,7 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
set[i]['ngicon'] = 'icon-expand-alt';
|
set[i]['ngicon'] = 'icon-expand-alt';
|
||||||
set[i]['level'] = 0;
|
set[i]['level'] = 0;
|
||||||
set[i]['spaces'] = 0;
|
set[i]['spaces'] = 0;
|
||||||
|
set[i]['class'] = 'parentNode';
|
||||||
}
|
}
|
||||||
scope.jobevents[i].status = (scope.jobevents[i].failed) ? 'error' : 'success';
|
scope.jobevents[i].status = (scope.jobevents[i].failed) ? 'error' : 'success';
|
||||||
cDate = new Date(set[i].created);
|
cDate = new Date(set[i].created);
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ angular.module('ChildrenHelper', ['RestServices', 'Utilities'])
|
|||||||
if (data.results[j].related.children) {
|
if (data.results[j].related.children) {
|
||||||
data.results[j]['ngclick'] = "toggleChildren(" + data.results[j].id + ", \"" + data.results[j].related.children + "\")";
|
data.results[j]['ngclick'] = "toggleChildren(" + data.results[j].id + ", \"" + data.results[j].related.children + "\")";
|
||||||
data.results[j]['ngicon'] = 'icon-expand-alt';
|
data.results[j]['ngicon'] = 'icon-expand-alt';
|
||||||
|
data.results[j]['class'] = 'parentNode';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
data.results[j]['class'] = 'childNode';
|
||||||
}
|
}
|
||||||
if (clicked == (set.length - 1)) {
|
if (clicked == (set.length - 1)) {
|
||||||
set.push(data.results[j]);
|
set.push(data.results[j]);
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ angular.module('JobEventsListDefinition', [])
|
|||||||
hasChildren: true,
|
hasChildren: true,
|
||||||
ngClick: "toggleChildren(\{\{ jobevent.id \}\}, '\{\{ jobevent.related.children \}\}')",
|
ngClick: "toggleChildren(\{\{ jobevent.id \}\}, '\{\{ jobevent.related.children \}\}')",
|
||||||
nosort: true,
|
nosort: true,
|
||||||
searchable: false
|
searchable: false,
|
||||||
|
ngClass: '\{\{ jobevent.class \}\}'
|
||||||
},
|
},
|
||||||
host: {
|
host: {
|
||||||
label: 'Host',
|
label: 'Host',
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
|
|||||||
html += "<td class=\"" + fld + "-column";
|
html += "<td class=\"" + fld + "-column";
|
||||||
html += (field['class']) ? " " + field['class'] : "";
|
html += (field['class']) ? " " + field['class'] : "";
|
||||||
html += "\" ";
|
html += "\" ";
|
||||||
html += (field.ngClass) ? this.attr(field, 'ngClass') : "";
|
html += (field.ngClass) ? Attr(field, 'ngClass') : "";
|
||||||
html += ">\n";
|
html += ">\n";
|
||||||
|
|
||||||
// Add ngShow
|
// Add ngShow
|
||||||
|
|||||||
Reference in New Issue
Block a user