+
+
import ItemCard from './ItemCard.vue';
+import EmptyState from './EmptyState.vue';
export default {
name: 'item-cards-container',
- props: ['items', 'is_local'],
+ props: {
+ 'items': Array,
+ 'is_local': Boolean,
+
+ 'empty_state_message': String,
+ 'empty_state_height': Number,
+ 'empty_state_bordered': Boolean
+ },
components: {
- ItemCard
+ ItemCard,
+ EmptyState
},
computed: {
item_id() {
diff --git a/erpnext/public/js/hub/components/NotificationMessage.vue b/erpnext/public/js/hub/components/NotificationMessage.vue
new file mode 100644
index 00000000000..c77f15e82fd
--- /dev/null
+++ b/erpnext/public/js/hub/components/NotificationMessage.vue
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
diff --git a/erpnext/public/js/hub/components/PublishPage.vue b/erpnext/public/js/hub/components/PublishPage.vue
index 2b2956f323e..670f0102267 100644
--- a/erpnext/public/js/hub/components/PublishPage.vue
+++ b/erpnext/public/js/hub/components/PublishPage.vue
@@ -3,15 +3,36 @@
class="marketplace-page"
:data-page-name="page_name"
>
+
+
{{ page_title }}
+
+
+
+
+
+
+
+ {{ valid_products_instruction }}
+
+
@@ -27,13 +48,40 @@ export default {
return {
page_name: frappe.get_route()[1],
valid_items: [],
- search_value: ''
+ selected_items: [],
+ search_value: '',
+
+ // Constants
+ page_title: __('Publish Products'),
+ search_placeholder: __('Search Items ...'),
+ empty_state_message: __(`No Items selected yet.
+ Browse and click on products below to publish.`),
+ valid_products_instruction: __(`Only products with an image, description
+ and category can be published. Please update them if an item in your
+ inventory does not appear.`)
};
},
components: {
SearchInput,
ItemCardsContainer
},
+ computed: {
+ no_selected_items() {
+ return this.selected_items.length === 0;
+ },
+
+ publish_button_text() {
+ const number = this.selected_items.length;
+ let text = 'Publish';
+ if(number === 1) {
+ text = 'Publish 1 Product';
+ }
+ if(number > 1) {
+ text = `Publish ${number} Products`;
+ }
+ return __(text);
+ }
+ },
created() {
this.get_valid_items();
},
diff --git a/erpnext/public/js/hub/pages/publish.js b/erpnext/public/js/hub/pages/publish.js
index 7b20907428b..78ca58dc0ce 100644
--- a/erpnext/public/js/hub/pages/publish.js
+++ b/erpnext/public/js/hub/pages/publish.js
@@ -4,6 +4,8 @@ import { get_local_item_card_html } from '../components/item_card';
import { make_search_bar } from '../components/search_bar';
import { get_publishing_header } from '../components/publishing_area';
import { ItemPublishDialog } from '../components/item_publish_dialog';
+
+
import PublishPage from '../components/PublishPage.vue';
erpnext.hub.Publish = class Publish {
diff --git a/erpnext/public/less/hub.less b/erpnext/public/less/hub.less
index 5f497d9712b..71e9534f27a 100644
--- a/erpnext/public/less/hub.less
+++ b/erpnext/public/less/hub.less
@@ -213,14 +213,13 @@ body[data-route^="marketplace/"] {
.empty-state {
height: 500px;
+ margin: 15px 0px;
}
- .empty-items-container {
- height: 80px;
+ .empty-state.bordered {
border-radius: 4px;
border: 1px solid @border-color;
border-style: dashed;
- margin: 15px 0px;
}
.publish-area.filled {