diff --git a/erpnext/public/js/hub/marketplace.js b/erpnext/public/js/hub/marketplace.js
index 448ca42547..0438d6f133 100644
--- a/erpnext/public/js/hub/marketplace.js
+++ b/erpnext/public/js/hub/marketplace.js
@@ -2,7 +2,6 @@ import Vue from 'vue/dist/vue.js';
// pages
import './pages/home';
-import './pages/search';
import './pages/item';
import './pages/seller';
import './pages/profile';
@@ -13,6 +12,7 @@ import './pages/not_found';
import SavedProducts from './pages/SavedProducts.vue';
import Publish from './pages/Publish.vue';
import Category from './pages/Category.vue';
+import Search from './pages/Search.vue';
import PublishedProducts from './pages/PublishedProducts.vue';
// components
@@ -340,3 +340,20 @@ erpnext.hub.PublishedProductsPage = class {
}
}
+erpnext.hub.SearchPage = class {
+ constructor(parent) {
+ this.$wrapper = $(`
`).appendTo($(parent));
+
+ new Vue({
+ render: h => h(Search)
+ }).$mount('#vue-area-search');
+ }
+
+ show() {
+ $('[data-page-name="search"]').show();
+ }
+
+ hide() {
+ $('[data-page-name="search"]').hide();
+ }
+}
diff --git a/erpnext/public/js/hub/pages/Search.vue b/erpnext/public/js/hub/pages/Search.vue
new file mode 100644
index 0000000000..54aa58a7d7
--- /dev/null
+++ b/erpnext/public/js/hub/pages/Search.vue
@@ -0,0 +1,77 @@
+
+
+
+
+
+
{{ page_title }}
+
+
+
+
+
+
+
+
+
diff --git a/erpnext/public/js/hub/pages/search.js b/erpnext/public/js/hub/pages/search.js
deleted file mode 100644
index 1cdacb6db6..0000000000
--- a/erpnext/public/js/hub/pages/search.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import SubPage from './subpage';
-import { make_search_bar } from '../components/search_bar';
-import { get_item_card_container_html } from '../components/items_container';
-
-erpnext.hub.SearchPage = class SearchPage extends SubPage {
- make_wrapper() {
- super.make_wrapper();
-
- make_search_bar({
- wrapper: this.$wrapper,
- on_search: keyword => {
- frappe.set_route('marketplace', 'search', keyword);
- }
- });
- }
-
- refresh() {
- this.keyword = frappe.get_route()[2] || '';
- this.$wrapper.find('input').val(this.keyword);
-
- this.get_items_by_keyword(this.keyword)
- .then(items => this.render(items));
- }
-
- get_items_by_keyword(keyword) {
- return hub.call('get_items', { keyword });
- }
-
- render(items) {
- this.$wrapper.find('.hub-items-container').remove();
- const title = !items.length
- ? __('No results found')
- : this.keyword
- ? __('Search results for "{0}"', [this.keyword])
- : '';
-
- const html = get_item_card_container_html(items, title);
- this.$wrapper.append(html);
- }
-}