From e7af44f1a6857ccb4dbe44955d5ef512b00dce3d Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 21 Aug 2018 19:48:06 +0530 Subject: [PATCH] fix: remove items with invalid image --- erpnext/public/js/hub/components/item_card.js | 4 ++-- erpnext/public/js/hub/pages/publish.js | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/hub/components/item_card.js b/erpnext/public/js/hub/components/item_card.js index 9f5a6ef6834..a1b0ae022d1 100644 --- a/erpnext/public/js/hub/components/item_card.js +++ b/erpnext/public/js/hub/components/item_card.js @@ -21,7 +21,7 @@ function get_item_card_html(item) { } const item_html = ` -
+
@@ -74,7 +74,7 @@ function get_local_item_card_html(item) {
`; const item_html = ` -
+
diff --git a/erpnext/public/js/hub/pages/publish.js b/erpnext/public/js/hub/pages/publish.js index 5eb317891cb..f49365833e6 100644 --- a/erpnext/public/js/hub/pages/publish.js +++ b/erpnext/public/js/hub/pages/publish.js @@ -226,7 +226,14 @@ erpnext.hub.Publish = class Publish extends SubPage { items.map(item => { this.fetched_items_dict[item.item_code] = item; - }) + }); + + // remove the items which doesn't have a valid image + setTimeout(() => { + items_container.find('.no-image').each(function() { + $(this).closest('.hub-card-container').remove(); + }); + }, 1000); } get_valid_items() {