feat: add search in category
diff --git a/erpnext/public/js/hub/pages/Category.vue b/erpnext/public/js/hub/pages/Category.vue
index 3a0e6bf..a1d5d72 100644
--- a/erpnext/public/js/hub/pages/Category.vue
+++ b/erpnext/public/js/hub/pages/Category.vue
@@ -3,6 +3,12 @@
class="marketplace-page"
:data-page-name="page_name"
>
+ <search-input
+ :placeholder="search_placeholder"
+ :on_search="set_search_route"
+ v-model="search_value"
+ />
+
<h5>{{ page_title }}</h5>
<item-cards-container
@@ -26,7 +32,13 @@
item_id_fieldname: 'name',
// Constants
- empty_state_message: __(`No items in this category yet.`)
+ empty_state_message: __(`No items in this category yet.`),
+
+ search_value: '',
+
+ // Constants
+ search_placeholder: __('Search for anything ...'),
+
};
},
computed: {
@@ -35,6 +47,7 @@
}
},
created() {
+ this.search_value = '';
this.get_items();
},
methods: {
@@ -51,7 +64,11 @@
go_to_item_details_page(hub_item_name) {
frappe.set_route(`marketplace/item/${hub_item_name}`);
- }
+ },
+
+ set_search_route() {
+ frappe.set_route('marketplace', 'search', this.search_value);
+ },
}
}
</script>