Modified search widget heper to no longer include 'row' element in the returned html. Callers will now controll the row definition. Moved breadcrumb generation from list-generator to generator-helpers so that it can be called from anywhere, including the inventory edit controller. Breadcrumbs now appear on inventory edit page. Changed search to check if searchPlaceholer field property is a scope variable. If it is, use the scope variable's value. Now clicking on a group name highlights it, searches for hosts and changes the search filed placeholder value to include the group name.

This commit is contained in:
Chris Houseknecht
2013-12-31 06:56:01 +00:00
parent 156652d60b
commit a4098a6df7
11 changed files with 336 additions and 454 deletions

View File

@@ -177,15 +177,16 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper'])
var inventory_id = params.inventory_id;
var scope = params.scope;
//var selected_id = params.
var groups = [];
var id = 1;
var id = 0;
function buildGroups(tree_data, parent, level) {
var sorted = SortNodes(tree_data);
for (var i=0; i < sorted.length; i++) {
var currentId= id;
var stat = UpdateStatusMsg({ status: sorted[i].status });
var currentId = id;
var stat = UpdateStatusMsg({ status: sorted[i].summary_fields.inventory_source.status });
var group = {
name: sorted[i].name,
has_active_failures: sorted[i].has_active_failures,
@@ -203,7 +204,8 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper'])
related: { children: (sorted[i].children.length > 0) ? sorted[i].related.children : '' },
status: sorted[i].summary_fields.inventory_source.status,
status_badge_class: stat['class'],
status_badge_tooltip: stat['tooltip']
status_badge_tooltip: stat['tooltip'],
selected_class: ''
}
groups.push(group);
id++;
@@ -266,6 +268,12 @@ angular.module('InventoryTree', ['Utilities', 'RestServices', 'GroupsHelper'])
scope.groups[i][p] = properties[p];
}
}
if (scope.groups[i].id == scope.selected_tree_id) {
//Make sure potential group name change gets reflected throughout the page
scope.selected_group_name = scope.groups[i].name;
scope.search_place_holder = 'Search ' + scope.groups[i].name;
scope.hostSearchPlaceholder = 'Search ' + scope.groups[i].name;
}
}
}
}])