From 6ee4e4190e1714ec488a26b7d9e95c54f89e3910 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Fri, 12 Feb 2016 14:38:13 +1100 Subject: [PATCH] New product count for inventory takes permissions into account --- .../filters/inventory_products_filter.js.coffee | 2 +- app/views/admin/variant_overrides/_new_products_alert.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/variant_overrides/filters/inventory_products_filter.js.coffee b/app/assets/javascripts/admin/variant_overrides/filters/inventory_products_filter.js.coffee index 6025e43826..95b8786902 100644 --- a/app/assets/javascripts/admin/variant_overrides/filters/inventory_products_filter.js.coffee +++ b/app/assets/javascripts/admin/variant_overrides/filters/inventory_products_filter.js.coffee @@ -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) diff --git a/app/views/admin/variant_overrides/_new_products_alert.html.haml b/app/views/admin/variant_overrides/_new_products_alert.html.haml index 2d060033c5..8892e6484d 100644 --- a/app/views/admin/variant_overrides/_new_products_alert.html.haml +++ b/app/views/admin/variant_overrides/_new_products_alert.html.haml @@ -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",