update: adding faker on shop page

This commit is contained in:
Rifqy Zacky Ariadhy 2019-01-03 22:52:25 +07:00
parent 3b1e76a707
commit 9d220256c6
4 changed files with 45 additions and 37 deletions

5
package-lock.json generated
View File

@ -5511,6 +5511,11 @@
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
}, },
"faker": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/faker/-/faker-4.1.0.tgz",
"integrity": "sha1-HkW7vsxndLPBlfrSg1EJxtdIzD8="
},
"falafel": { "falafel": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/falafel/-/falafel-2.1.0.tgz", "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.1.0.tgz",

View File

@ -48,6 +48,7 @@
"decimal.js-light": "^2.3.1", "decimal.js-light": "^2.3.1",
"exenv": "^1.2.2", "exenv": "^1.2.2",
"express": "^4.16.2", "express": "^4.16.2",
"faker": "^4.1.0",
"feather-icons": "^4.7.3", "feather-icons": "^4.7.3",
"feather-icons-react": "^0.2.0", "feather-icons-react": "^0.2.0",
"file-loader": "^1.1.5", "file-loader": "^1.1.5",

View File

@ -56,6 +56,7 @@ import {Link} from 'react-router-dom';
import {LINKS} from "../../../routes"; import {LINKS} from "../../../routes";
import {ItemCard} from '../ItemCard'; import {ItemCard} from '../ItemCard';
import InfiniteScroll from 'react-infinite-scroller'; import InfiniteScroll from 'react-infinite-scroller';
import faker from 'faker';
@inject('appstate') @inject('appstate')
@observer @observer
@ -84,6 +85,7 @@ export default class All extends React.Component {
} }
componentDidMount() { componentDidMount() {
// this.myStoreItem.isSearching = false; // this.myStoreItem.isSearching = false;
// if(this.userData.role == 'store') { // if(this.userData.role == 'store') {
// this.myStoreItem.getAll(); // this.myStoreItem.getAll();
@ -154,10 +156,10 @@ export default class All extends React.Component {
description: null, description: null,
height: "0.00", height: "0.00",
id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", 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", item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540",
length: "0.00", length: "0.00",
name: "Silly Oregano Seasoning", name: faker.company.companyName(),
odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291},
product_id: 205, product_id: 205,
product_tmpl_id: 291, product_tmpl_id: 291,
@ -171,8 +173,8 @@ export default class All extends React.Component {
sale_price: null, sale_price: null,
seen: 0, seen: 0,
sold: 0, sold: 0,
stock: "34.00", stock: 10,
uom: "pack", uom: "pcs",
updated_at: "2019-01-02T13:00:05.042Z", updated_at: "2019-01-02T13:00:05.042Z",
use_weight_as_stock: false, use_weight_as_stock: false,
user_store_id: "959194a0-7067-400c-b354-2e8d03300660", user_store_id: "959194a0-7067-400c-b354-2e8d03300660",
@ -188,10 +190,10 @@ export default class All extends React.Component {
description: null, description: null,
height: "0.00", height: "0.00",
id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", 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", item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540",
length: "0.00", length: "0.00",
name: "Silly Oregano Seasoning", name: faker.company.companyName(),
odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291},
product_id: 205, product_id: 205,
product_tmpl_id: 291, product_tmpl_id: 291,
@ -205,8 +207,8 @@ export default class All extends React.Component {
sale_price: null, sale_price: null,
seen: 0, seen: 0,
sold: 0, sold: 0,
stock: "34.00", stock: 10,
uom: "pack", uom: "pcs",
updated_at: "2019-01-02T13:00:05.042Z", updated_at: "2019-01-02T13:00:05.042Z",
use_weight_as_stock: false, use_weight_as_stock: false,
user_store_id: "959194a0-7067-400c-b354-2e8d03300660", user_store_id: "959194a0-7067-400c-b354-2e8d03300660",
@ -222,10 +224,10 @@ export default class All extends React.Component {
description: null, description: null,
height: "0.00", height: "0.00",
id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", 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", item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540",
length: "0.00", length: "0.00",
name: "Silly Oregano Seasoning", name: faker.company.companyName(),
odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291},
product_id: 205, product_id: 205,
product_tmpl_id: 291, product_tmpl_id: 291,
@ -239,8 +241,8 @@ export default class All extends React.Component {
sale_price: null, sale_price: null,
seen: 0, seen: 0,
sold: 0, sold: 0,
stock: "34.00", stock: 10,
uom: "pack", uom: "pcs",
updated_at: "2019-01-02T13:00:05.042Z", updated_at: "2019-01-02T13:00:05.042Z",
use_weight_as_stock: false, use_weight_as_stock: false,
user_store_id: "959194a0-7067-400c-b354-2e8d03300660", user_store_id: "959194a0-7067-400c-b354-2e8d03300660",
@ -256,10 +258,10 @@ export default class All extends React.Component {
description: null, description: null,
height: "0.00", height: "0.00",
id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", 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", item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540",
length: "0.00", length: "0.00",
name: "Silly Oregano Seasoning", name: faker.company.companyName(),
odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291},
product_id: 205, product_id: 205,
product_tmpl_id: 291, product_tmpl_id: 291,
@ -273,8 +275,8 @@ export default class All extends React.Component {
sale_price: null, sale_price: null,
seen: 0, seen: 0,
sold: 0, sold: 0,
stock: "34.00", stock: 10,
uom: "pack", uom: "pcs",
updated_at: "2019-01-02T13:00:05.042Z", updated_at: "2019-01-02T13:00:05.042Z",
use_weight_as_stock: false, use_weight_as_stock: false,
user_store_id: "959194a0-7067-400c-b354-2e8d03300660", user_store_id: "959194a0-7067-400c-b354-2e8d03300660",
@ -290,10 +292,10 @@ export default class All extends React.Component {
description: null, description: null,
height: "0.00", height: "0.00",
id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", 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", item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540",
length: "0.00", length: "0.00",
name: "Silly Oregano Seasoning", name: faker.company.companyName(),
odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291},
product_id: 205, product_id: 205,
product_tmpl_id: 291, product_tmpl_id: 291,
@ -307,8 +309,8 @@ export default class All extends React.Component {
sale_price: null, sale_price: null,
seen: 0, seen: 0,
sold: 0, sold: 0,
stock: "34.00", stock: 10,
uom: "pack", uom: "pcs",
updated_at: "2019-01-02T13:00:05.042Z", updated_at: "2019-01-02T13:00:05.042Z",
use_weight_as_stock: false, use_weight_as_stock: false,
user_store_id: "959194a0-7067-400c-b354-2e8d03300660", user_store_id: "959194a0-7067-400c-b354-2e8d03300660",
@ -324,10 +326,10 @@ export default class All extends React.Component {
description: null, description: null,
height: "0.00", height: "0.00",
id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", 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", item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540",
length: "0.00", length: "0.00",
name: "Silly Oregano Seasoning", name: faker.company.companyName(),
odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291},
product_id: 205, product_id: 205,
product_tmpl_id: 291, product_tmpl_id: 291,
@ -341,8 +343,8 @@ export default class All extends React.Component {
sale_price: null, sale_price: null,
seen: 0, seen: 0,
sold: 0, sold: 0,
stock: "34.00", stock: 10,
uom: "pack", uom: "pcs",
updated_at: "2019-01-02T13:00:05.042Z", updated_at: "2019-01-02T13:00:05.042Z",
use_weight_as_stock: false, use_weight_as_stock: false,
user_store_id: "959194a0-7067-400c-b354-2e8d03300660", user_store_id: "959194a0-7067-400c-b354-2e8d03300660",
@ -358,10 +360,10 @@ export default class All extends React.Component {
description: null, description: null,
height: "0.00", height: "0.00",
id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", 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", item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540",
length: "0.00", length: "0.00",
name: "Silly Oregano Seasoning", name: faker.company.companyName(),
odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291},
product_id: 205, product_id: 205,
product_tmpl_id: 291, product_tmpl_id: 291,
@ -375,8 +377,8 @@ export default class All extends React.Component {
sale_price: null, sale_price: null,
seen: 0, seen: 0,
sold: 0, sold: 0,
stock: "34.00", stock: 10,
uom: "pack", uom: "pcs",
updated_at: "2019-01-02T13:00:05.042Z", updated_at: "2019-01-02T13:00:05.042Z",
use_weight_as_stock: false, use_weight_as_stock: false,
user_store_id: "959194a0-7067-400c-b354-2e8d03300660", user_store_id: "959194a0-7067-400c-b354-2e8d03300660",
@ -392,10 +394,10 @@ export default class All extends React.Component {
description: null, description: null,
height: "0.00", height: "0.00",
id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", 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", item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540",
length: "0.00", length: "0.00",
name: "Silly Oregano Seasoning", name: faker.company.companyName(),
odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291},
product_id: 205, product_id: 205,
product_tmpl_id: 291, product_tmpl_id: 291,
@ -409,8 +411,8 @@ export default class All extends React.Component {
sale_price: null, sale_price: null,
seen: 0, seen: 0,
sold: 0, sold: 0,
stock: "34.00", stock: 10,
uom: "pack", uom: "pcs",
updated_at: "2019-01-02T13:00:05.042Z", updated_at: "2019-01-02T13:00:05.042Z",
use_weight_as_stock: false, use_weight_as_stock: false,
user_store_id: "959194a0-7067-400c-b354-2e8d03300660", user_store_id: "959194a0-7067-400c-b354-2e8d03300660",
@ -426,10 +428,10 @@ export default class All extends React.Component {
description: null, description: null,
height: "0.00", height: "0.00",
id: "7e3072c1-9bfd-4b52-af38-9c6e30456c73", 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", item_status_id: "2b1a2598-8333-4b19-ae7b-c054bec87540",
length: "0.00", length: "0.00",
name: "Silly Oregano Seasoning", name: faker.company.companyName(),
odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291}, odoo_additional_data: {product_id: 205, product_uom: 21, product_tmpl_id: 291},
product_id: 205, product_id: 205,
product_tmpl_id: 291, product_tmpl_id: 291,
@ -443,8 +445,8 @@ export default class All extends React.Component {
sale_price: null, sale_price: null,
seen: 0, seen: 0,
sold: 0, sold: 0,
stock: "34.00", stock: 10,
uom: "pack", uom: "pcs",
updated_at: "2019-01-02T13:00:05.042Z", updated_at: "2019-01-02T13:00:05.042Z",
use_weight_as_stock: false, use_weight_as_stock: false,
user_store_id: "959194a0-7067-400c-b354-2e8d03300660", user_store_id: "959194a0-7067-400c-b354-2e8d03300660",

View File

@ -43,7 +43,7 @@ export class ItemCard extends React.Component {
</CardMedia> </CardMedia>
{/*<CardTitle style={{padding:8}} subtitleStyle={{display:'none'}} title={data.name} titleStyle={{fontSize: 12}}/>*/} {/*<CardTitle style={{padding:8}} subtitleStyle={{display:'none'}} title={data.name} titleStyle={{fontSize: 12}}/>*/}
<CardTitle title={<Link to={`${LINKS.FORM_ITEMS}/${data.id}`}>{(data.name.length > 25) ? data.name.substring(0,24)+`...` : data.name}</Link>} titleStyle={{fontWeight: 'bold', fontSize: 18, lineHeight: '30px', whiteSpace: 'nowrap'}} <CardTitle title={<Link to={`${LINKS.FORM_ITEMS}/${data.id}`}>{(data.name.length > 22) ? data.name.substring(0,21)+`...` : data.name}</Link>} titleStyle={{fontWeight: 'bold', fontSize: 18, lineHeight: '30px', whiteSpace: 'nowrap'}}
subtitle={<span style={{fontWeight: 'bold', color: 'orangered'}}>{data.regular_price} Points</span>}/> subtitle={<span style={{fontWeight: 'bold', color: 'orangered'}}>{data.regular_price} Points</span>}/>
{/*<CardTitle title={<Link to={`${LINKS.FORM_ITEMS}/${data.id}`}>{(data.name.length > 14) ? data.name.substring(0,13)+`...` : data.name}</Link>} titleStyle={{fontWeight: 'bold', fontSize: 18, lineHeight: '30px', whiteSpace: 'nowrap'}}*/} {/*<CardTitle title={<Link to={`${LINKS.FORM_ITEMS}/${data.id}`}>{(data.name.length > 14) ? data.name.substring(0,13)+`...` : data.name}</Link>} titleStyle={{fontWeight: 'bold', fontSize: 18, lineHeight: '30px', whiteSpace: 'nowrap'}}*/}
{/*subtitle={<NumberFormat style={{fontWeight: 'bold', color: 'orangered'}}*/} {/*subtitle={<NumberFormat style={{fontWeight: 'bold', color: 'orangered'}}*/}