Limited filter on Job Events page to only those fields that make sense: Host and Status

This commit is contained in:
chouseknecht
2013-06-19 10:22:23 -04:00
parent 85a483a6fb
commit 964a523daf
3 changed files with 24 additions and 5 deletions

View File

@@ -33,7 +33,10 @@ angular.module('ChildrenHelper', ['RestServices', 'Utilities'])
// Expand or collapse children based on clicked element's icon // Expand or collapse children based on clicked element's icon
if (set[clicked]['ngicon'] == 'icon-expand-alt') { if (set[clicked]['ngicon'] == 'icon-expand-alt') {
// Expand: lookup and display children // Expand: lookup and display children
Rest.setUrl(children); var url = children;
var search = scope[list.iterator + 'SearchParams'].replace(/^\&/,'').replace(/^\?/,'');
url += (search) ? '?' + search : "";
Rest.setUrl(url);
Rest.get() Rest.get()
.success( function(data, status, headers, config) { .success( function(data, status, headers, config) {
var found = false; var found = false;

View File

@@ -37,11 +37,25 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
else { else {
sort_order = (list.fields[fld].desc) ? '-' + fld : fld; sort_order = (list.fields[fld].desc) ? '-' + fld : fld;
} }
scope[iterator + 'SearchField'] = fld if (list.fields[fld].notSearchable == undefined || list.fields[fld].notSearchable == false) {
scope[iterator + 'SearchFieldLabel'] = list.fields[fld].label; scope[iterator + 'SearchField'] = fld;
scope[iterator + 'SearchFieldLabel'] = list.fields[fld].label;
}
break; break;
} }
} }
if (!scope[iterator + 'SearchField']) {
// A field marked as key may also be notSearchable
for (fld in list.fields) {
if (list.fields[fld].notSearchable == undefined || list.fields[fld].notSearchable == false) {
scope[iterator + 'SearchField'] = fld;
scope[iterator + 'SearchFieldLabel'] = list.fields[fld].label;
break;
}
}
}
scope[iterator + 'SearchType'] = 'icontains'; scope[iterator + 'SearchType'] = 'icontains';
scope[iterator + 'SearchTypeLabel'] = 'Contains'; scope[iterator + 'SearchTypeLabel'] = 'Contains';
scope[iterator + 'SearchParams'] = ''; scope[iterator + 'SearchParams'] = '';

View File

@@ -21,13 +21,15 @@ angular.module('JobEventsListDefinition', [])
created: { created: {
label: 'Creation Date', label: 'Creation Date',
key: true, key: true,
nosort: true nosort: true,
notSearchable: true
}, },
event_display: { event_display: {
label: 'Event', label: 'Event',
hasChildren: true, hasChildren: true,
link: true, link: true,
nosort: true nosort: true,
notSearchable: true
}, },
host: { host: {
label: 'Host', label: 'Host',