diff --git a/package-lock.json b/package-lock.json index e3028c0..c7daa7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5511,6 +5511,11 @@ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, + "faker": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/faker/-/faker-4.1.0.tgz", + "integrity": "sha1-HkW7vsxndLPBlfrSg1EJxtdIzD8=" + }, "falafel": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.1.0.tgz", diff --git a/package.json b/package.json index d32402e..e3b3f60 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "decimal.js-light": "^2.3.1", "exenv": "^1.2.2", "express": "^4.16.2", + "faker": "^4.1.0", "feather-icons": "^4.7.3", "feather-icons-react": "^0.2.0", "file-loader": "^1.1.5", diff --git a/src/common/pages/Items/All/index.js b/src/common/pages/Items/All/index.js index 610fa15..7c8e685 100644 --- a/src/common/pages/Items/All/index.js +++ b/src/common/pages/Items/All/index.js @@ -56,6 +56,7 @@ import {Link} from 'react-router-dom'; import {LINKS} from "../../../routes"; import {ItemCard} from '../ItemCard'; import InfiniteScroll from 'react-infinite-scroller'; +import faker from 'faker'; @inject('appstate') @observer @@ -84,6 +85,7 @@ export default class All extends React.Component { } componentDidMount() { + // this.myStoreItem.isSearching = false; // if(this.userData.role == 'store') { // this.myStoreItem.getAll(); @@ -154,10 +156,10 @@ export default class All extends React.Component { description: null, height: "0.00", id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", - images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + images: {main: faker.image.food(250,250,true), gallery: [faker.image.food(250,250,true)]}, item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", length: "0.00", - name: "Silly Oregano Seasoning", + name: faker.company.companyName(), odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, product_id: 205, product_tmpl_id: 291, @@ -171,8 +173,8 @@ export default class All extends React.Component { sale_price: null, seen: 0, sold: 0, - stock: "34.00", - uom: "pack", + stock: 10, + uom: "pcs", updated_at: "2019-01-02T13:00:05.042Z", use_weight_as_stock: false, user_store_id: "959194a0-7067-400c-b354-2e8d03300660", @@ -188,10 +190,10 @@ export default class All extends React.Component { description: null, height: "0.00", id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", - images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + images: {main: faker.image.food(250,250,true), gallery: [faker.image.food(250,250,true)]}, item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", length: "0.00", - name: "Silly Oregano Seasoning", + name: faker.company.companyName(), odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, product_id: 205, product_tmpl_id: 291, @@ -205,8 +207,8 @@ export default class All extends React.Component { sale_price: null, seen: 0, sold: 0, - stock: "34.00", - uom: "pack", + stock: 10, + uom: "pcs", updated_at: "2019-01-02T13:00:05.042Z", use_weight_as_stock: false, user_store_id: "959194a0-7067-400c-b354-2e8d03300660", @@ -222,10 +224,10 @@ export default class All extends React.Component { description: null, height: "0.00", id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", - images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + images: {main: faker.image.food(250,250,true), gallery: [faker.image.food(250,250,true)]}, item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", length: "0.00", - name: "Silly Oregano Seasoning", + name: faker.company.companyName(), odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, product_id: 205, product_tmpl_id: 291, @@ -239,8 +241,8 @@ export default class All extends React.Component { sale_price: null, seen: 0, sold: 0, - stock: "34.00", - uom: "pack", + stock: 10, + uom: "pcs", updated_at: "2019-01-02T13:00:05.042Z", use_weight_as_stock: false, user_store_id: "959194a0-7067-400c-b354-2e8d03300660", @@ -256,10 +258,10 @@ export default class All extends React.Component { description: null, height: "0.00", id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", - images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + images: {main: faker.image.food(250,250,true), gallery: [faker.image.food(250,250,true)]}, item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", length: "0.00", - name: "Silly Oregano Seasoning", + name: faker.company.companyName(), odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, product_id: 205, product_tmpl_id: 291, @@ -273,8 +275,8 @@ export default class All extends React.Component { sale_price: null, seen: 0, sold: 0, - stock: "34.00", - uom: "pack", + stock: 10, + uom: "pcs", updated_at: "2019-01-02T13:00:05.042Z", use_weight_as_stock: false, user_store_id: "959194a0-7067-400c-b354-2e8d03300660", @@ -290,10 +292,10 @@ export default class All extends React.Component { description: null, height: "0.00", id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", - images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + images: {main: faker.image.food(250,250,true), gallery: [faker.image.food(250,250,true)]}, item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", length: "0.00", - name: "Silly Oregano Seasoning", + name: faker.company.companyName(), odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, product_id: 205, product_tmpl_id: 291, @@ -307,8 +309,8 @@ export default class All extends React.Component { sale_price: null, seen: 0, sold: 0, - stock: "34.00", - uom: "pack", + stock: 10, + uom: "pcs", updated_at: "2019-01-02T13:00:05.042Z", use_weight_as_stock: false, user_store_id: "959194a0-7067-400c-b354-2e8d03300660", @@ -324,10 +326,10 @@ export default class All extends React.Component { description: null, height: "0.00", id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", - images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + images: {main: faker.image.food(250,250,true), gallery: [faker.image.food(250,250,true)]}, item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", length: "0.00", - name: "Silly Oregano Seasoning", + name: faker.company.companyName(), odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, product_id: 205, product_tmpl_id: 291, @@ -341,8 +343,8 @@ export default class All extends React.Component { sale_price: null, seen: 0, sold: 0, - stock: "34.00", - uom: "pack", + stock: 10, + uom: "pcs", updated_at: "2019-01-02T13:00:05.042Z", use_weight_as_stock: false, user_store_id: "959194a0-7067-400c-b354-2e8d03300660", @@ -358,10 +360,10 @@ export default class All extends React.Component { description: null, height: "0.00", id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", - images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + images: {main: faker.image.food(250,250,true), gallery: [faker.image.food(250,250,true)]}, item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", length: "0.00", - name: "Silly Oregano Seasoning", + name: faker.company.companyName(), odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, product_id: 205, product_tmpl_id: 291, @@ -375,8 +377,8 @@ export default class All extends React.Component { sale_price: null, seen: 0, sold: 0, - stock: "34.00", - uom: "pack", + stock: 10, + uom: "pcs", updated_at: "2019-01-02T13:00:05.042Z", use_weight_as_stock: false, user_store_id: "959194a0-7067-400c-b354-2e8d03300660", @@ -392,10 +394,10 @@ export default class All extends React.Component { description: null, height: "0.00", id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", - images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + images: {main: faker.image.food(250,250,true), gallery: [faker.image.food(250,250,true)]}, item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", length: "0.00", - name: "Silly Oregano Seasoning", + name: faker.company.companyName(), odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, product_id: 205, product_tmpl_id: 291, @@ -409,8 +411,8 @@ export default class All extends React.Component { sale_price: null, seen: 0, sold: 0, - stock: "34.00", - uom: "pack", + stock: 10, + uom: "pcs", updated_at: "2019-01-02T13:00:05.042Z", use_weight_as_stock: false, user_store_id: "959194a0-7067-400c-b354-2e8d03300660", @@ -426,10 +428,10 @@ export default class All extends React.Component { description: null, height: "0.00", id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", - images: {main: "https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png", gallery: ["https://marketplace-sillyfish-api.asacreative.com/uploads/item_123634.png"]}, + images: {main: faker.image.food(250,250,true), gallery: [faker.image.food(250,250,true)]}, item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540", length: "0.00", - name: "Silly Oregano Seasoning", + name: faker.company.companyName(), odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, product_id: 205, product_tmpl_id: 291, @@ -443,8 +445,8 @@ export default class All extends React.Component { sale_price: null, seen: 0, sold: 0, - stock: "34.00", - uom: "pack", + stock: 10, + uom: "pcs", updated_at: "2019-01-02T13:00:05.042Z", use_weight_as_stock: false, user_store_id: "959194a0-7067-400c-b354-2e8d03300660", diff --git a/src/common/pages/Items/ItemCard/index.js b/src/common/pages/Items/ItemCard/index.js index 9b0214a..74bb1d3 100644 --- a/src/common/pages/Items/ItemCard/index.js +++ b/src/common/pages/Items/ItemCard/index.js @@ -43,7 +43,7 @@ export class ItemCard extends React.Component { {/**/} - {(data.name.length > 25) ? data.name.substring(0,24)+`...` : data.name}} titleStyle={{fontWeight: 'bold', fontSize: 18, lineHeight: '30px', whiteSpace: 'nowrap'}} + {(data.name.length > 22) ? data.name.substring(0,21)+`...` : data.name}} titleStyle={{fontWeight: 'bold', fontSize: 18, lineHeight: '30px', whiteSpace: 'nowrap'}} subtitle={{data.regular_price} Points}/> {/*{(data.name.length > 14) ? data.name.substring(0,13)+`...` : data.name}} titleStyle={{fontWeight: 'bold', fontSize: 18, lineHeight: '30px', whiteSpace: 'nowrap'}}*/} {/*subtitle={