New product count for inventory takes permissions into account

This commit is contained in:
Rob Harrington
2016-02-12 14:38:13 +11:00
parent f280b96215
commit 6ee4e4190e
2 changed files with 2 additions and 2 deletions

View File

@@ -13,5 +13,5 @@ angular.module("admin.variantOverrides").filter "inventoryProducts", ($filter, I
else
# Important to only return if true, as other variants for this product might be visible
return true if views.new.visible
false
false
, true)

View File

@@ -1,4 +1,4 @@
%div{ ng: { show: '(newProductCount = (products | newInventoryProducts:hub_id).length) > 0 && !views.new.visible && !alertDismissed' } }
%div{ ng: { show: '(newProductCount = (products | hubPermissions:hubPermissions:hub.id | newInventoryProducts:hub_id).length) > 0 && !views.new.visible && !alertDismissed' } }
%hr.divider.sixteen.columns.alpha.omega
%alert-row{ message: "#{t('admin.inventory.new_products_alert_message', new_product_count: '{{ newProductCount }}')}",
dismissed: "alertDismissed",