Skip to content

Commit

Permalink
fix(inventory): link groups to registry
Browse files Browse the repository at this point in the history
This commit fixes the inventory registry by linking the inventory groups
to the inventory registry.

Closes #2122.
  • Loading branch information
jniles committed Sep 26, 2017
1 parent 146c85b commit 8a5fd76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
<td>{{ group.code }}</td>
<td>{{ group.name }}</td>
<td>
<a
ui-sref="inventory.list({ filters : [{ key : \'group_uuid\', value : groud.uuid, displayValue: group.name }] })"
href>
<a ui-sref="inventory.list({ filters : [{ key : 'group_uuid', value : group.uuid, displayValue: group.name }] })" href>
{{ group.inventory_counted }} <span class="text-lowercase" translate> INVENTORY.ELEMENT</span>(s)
</a>
</td>
Expand Down
14 changes: 4 additions & 10 deletions client/src/modules/inventory/configuration/groups/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ function InventoryGroupsController($translate, InventoryGroup, Account, Notify,
vm.created = false;
vm.updated = false;

/** paths in the headercrumb */
vm.bcPaths = [
{ label : 'TREE.INVENTORY' },
{ label : 'TREE.INVENTORY_GROUP' }
];

// expose to the view
vm.editInventoryGroup = editInventoryGroup;
vm.addInventoryGroup = addInventoryGroup;
Expand Down Expand Up @@ -84,10 +78,10 @@ function InventoryGroupsController($translate, InventoryGroup, Account, Notify,

// initializes inventory group list with associate accounts
Account.read()
.then(handleAccountList)
.then(readInventoryGroup)
.then(handleGroupList)
.catch(Notify.handleError);
.then(handleAccountList)
.then(readInventoryGroup)
.then(handleGroupList)
.catch(Notify.handleError);

// handle the list of accounts
function handleAccountList(list) {
Expand Down
4 changes: 2 additions & 2 deletions client/src/modules/inventory/list/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ function InventoryListController(

function startup() {
// if parameters are passed through the $state object, use them.
if ($state.params.filters.length) {
Inventory.filters.replaceFilters(angular.copy($state.params.filters));
if ($state.params.filters.length > 0) {
Inventory.filters.replaceFilters($state.params.filters);
}

load(Inventory.filters.formatHTTP(true));
Expand Down

0 comments on commit 8a5fd76

Please sign in to comment.