Skip to content

Commit a7fd89c

Browse files
sample usage app included
1 parent 3269eff commit a7fd89c

File tree

5 files changed

+162
-0
lines changed

5 files changed

+162
-0
lines changed

public/rep.csv

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Order Date,Order ID,Title,Category,ASIN/ISBN,UNSPSC Code,Website,Release Date,Condition,Seller,Seller Credentials,List Price Per Unit,Purchase Price Per Unit,Quantity,Payment Instrument Type,Purchase Order Number,PO Line Number,Ordering Customer Email,Shipment Date,Shipping Address Name,Shipping Address Street 1,Shipping Address Street 2,Shipping Address City,Shipping Address State,Shipping Address Zip,Order Status,Carrier Name & Tracking Number,Item Subtotal,Item Subtotal Tax,Item Total,Tax Exemption Applied,Tax Exemption Type,Exemption Opt-Out,Buyer Name,Currency,Group Name
2+
02/01/19,113-9993452-6938625,Product A1,HEALTH_PERSONAL_CARE,B004U429AQ,26111702,Amazon.com,,new,Amazon.com,,$28.61,$14.09,1,Visa - 0958,,,[email protected],02/02/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,AMZN_US(TBA760711872000),$14.09,$1.20,$15.29,,,,Kelly Palladino,USD,
3+
02/01/19,113-9993452-6938625,Product A2,SCREWS,B01FCZ8I3I,31160000,Amazon.com,,new,Ez_Shop,,$9.99,$7.89,1,Visa - 0958,,,[email protected],02/02/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,AMZN_US(TBA761213726000),$7.89,$0.00,$7.89,,,,Kelly Palladino,USD,
4+
02/01/19,113-9993452-6938625,Product A3,HEALTH_PERSONAL_CARE,B00MH4QI21,26111702,Amazon.com,,new,Amazon.com,,$11.99,$11.99,1,Visa - 0958,,,[email protected],02/02/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,AMZN_US(TBA761213726000),$11.99,$1.02,$13.01,,,,Kelly Palladino,USD,
5+
02/01/19,113-9993452-6938625,Product A4,TOOLS,B01YTFHOEI,27110000,Amazon.com,,new,Amazon.com,,$24.99,$24.99,1,Visa - 0958,,,[email protected],02/02/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,AMZN_US(TBA761213726000),$24.99,$2.12,$27.11,,,,Kelly Palladino,USD,
6+
02/01/19,113-9993452-6938625,Product A5,ABIS_BOOK,385142641,55101500,Amazon.com,1985-10-01T00:00:01,new,Amazon.com,,$50.00,$34.47,1,Visa - 0958,,,[email protected],02/02/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,AMZN_US(TBA761213726000),$34.47,$2.93,$37.40,,,,Kelly Palladino,USD,
7+
02/01/19,113-9993452-6938625,Product A6,TOOLS,385142631,27110000,Amazon.com,,new,Amazon.com,,$8.00,$6.53,1,Visa - 0958,,,[email protected],02/02/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,AMZN_US(TBA760711872000),$6.53,$0.56,$7.09,,,,Kelly Palladino,USD,
8+
02/01/19,113-9993452-6938625,Product A7,HEALTH_PERSONAL_CARE,385142621,26111702,Amazon.com,,new,Amazon.com,,$9.99,$9.99,1,Visa - 0958,,,[email protected],02/02/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,AMZN_US(TBA761213726000),$9.99,$0.85,$10.84,,,,Kelly Palladino,USD,
9+
02/01/19,113-9991452-6938625,Product A8,BATTERY,385142611,26111700,Amazon.com,,new,Bee Neat,,$24.99,$24.99,1,Visa - 0958,,,[email protected],02/02/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,AMZN_US(TBA761213726000),$24.99,$0.00,$24.99,,,,Kelly Palladino,USD,
10+
02/01/19,113-9993452-6938625,Product A9,HEALTH_PERSONAL_CARE,385142601,26111701,Amazon.com,,new,Amazon.com,,$12.99,$10.99,1,Visa - 0958,,,[email protected],02/02/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,AMZN_US(TBA760711872000),$10.99,$0.93,$11.92,,,,Kelly Palladino,USD,
11+
02/02/19,113-3853823-9740251,Product A10,OFFICE_PRODUCTS,385142591,44000000,Amazon.com,,new,Amazon.com,,$39.99,$37.82,1,Visa - 0958,,,[email protected],02/03/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,UPS(1Z9766AX0341972126),$37.82,$3.21,$41.03,,,,Kelly Palladino,USD,
12+
02/02/19,113-5152482-3621867,Product A11,MARKING_PEN,385142581,44121708,Amazon.com,,new,The Mega Deals,,$11.99,$4.21,1,Visa - 0958,,,[email protected],02/07/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,AMZN_US(TBA779013141000),$4.21,$0.00,$4.21,,,,Kelly Palladino,USD,
13+
02/02/19,113-6713490-4112215,Product A12,STORAGE_BOX,385142571,44111515,Amazon.com,,new,Amazon.com,,"$4,000.00",$74.01,1,Visa - 0958,,,[email protected],02/04/19,Walter A. Haas III,2030 GOUGH ST APT 1,,SAN FRANCISCO,CA,94109-3440,Shipped,FEDEX(9611804423654303732389),$74.01,$6.29,$80.30,,,,Kelly Palladino,USD,

src/components/Mock/Mock.js

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import React, { useState, useEffect } from 'react';
2+
import './style.scss';
3+
export const Mock = (props) => {
4+
const [status, setStatus] = useState('Processing');
5+
const [delay] = useState(parseInt(localStorage.getItem('DELAY') || 10));
6+
useEffect(() => {
7+
const timer = setTimeout(() => {
8+
setStatus('Complete')
9+
}, delay * 1000);
10+
return () => clearTimeout(timer);
11+
}, [delay]);
12+
useEffect(() => {
13+
let inc = 0;
14+
let timer;
15+
timer = setInterval(() => {
16+
if (inc < 98) {
17+
setStatus(`Processing(${inc++})`)
18+
} else {
19+
clearTimeout(timer);
20+
}
21+
}, delay*10);
22+
return () => clearTimeout(timer);
23+
}, [delay]);
24+
25+
return (
26+
<div>
27+
<h1>
28+
{`Delay is ${delay} seconds`}
29+
</h1>
30+
31+
<table className="order-hist-submitted paleBlueRows">
32+
<tr>
33+
<th width="20"><strong>&nbsp;</strong></th>
34+
<th width="13%"><strong>Creation Date</strong></th>
35+
<th width="16%"><strong>Report Type</strong></th>
36+
<th width="16%"><strong>Date Range</strong></th>
37+
<th width="*"><strong>Report Name</strong></th>
38+
<th width="14%"><strong>Status</strong></th>
39+
<th width="11%"><strong>Actions</strong></th>
40+
</tr>
41+
<tr className="">
42+
<td className="tiny">
43+
<div id="report-close-div-A3KUK3EBU11MEZ" className="close-button">
44+
<span>X</span>
45+
</div>
46+
</td>
47+
48+
<td className="tiny">06/18/20</td>
49+
<td className="tiny">Items</td>
50+
<td className="tiny">
51+
12/31/15 -
52+
06/18/20
53+
</td>
54+
<td className="tiny">Gist Report - 1592471315205
55+
</td>
56+
<td className="tiny" id="status-cell-A3KUK3EBU11MEZ">
57+
{status}
58+
</td>
59+
<td className="tiny" id="download-cell-A3KUK3EBU11MEZ">
60+
{status==='Complete' && <a href="/rep.csv">Download</a>}
61+
</td>
62+
</tr>
63+
<tr className="">
64+
<td className="tiny">
65+
<div id="report-close-div-A3KUK3EBU11MEZ" className="close-button">
66+
<span>X</span>
67+
</div>
68+
</td>
69+
70+
<td className="tiny">06/18/20</td>
71+
<td className="tiny">Items</td>
72+
<td className="tiny">
73+
12/31/15 -
74+
06/18/20
75+
</td>
76+
<td className="tiny">Gist Report - 1592471315205
77+
</td>
78+
<td className="tiny" id="status-cell-A3KUK3EBU11MEZ">
79+
Complete
80+
</td>
81+
<td className="tiny" id="download-cell-A3KUK3EBU11MEZ">
82+
<a href="/rep.csv">Download</a>
83+
</td>
84+
</tr>
85+
<tr className="">
86+
<td className="tiny">
87+
<div id="report-close-div-A3KUK3EBU11MEZ" className="close-button">
88+
<span>X</span>
89+
</div>
90+
</td>
91+
92+
<td className="tiny">06/18/20</td>
93+
<td className="tiny">Items</td>
94+
<td className="tiny">
95+
12/31/15 -
96+
06/18/20
97+
</td>
98+
<td className="tiny">Gist Report - 1592471315205
99+
</td>
100+
<td className="tiny" id="status-cell-A3KUK3EBU11MEZ">
101+
Complete
102+
</td>
103+
<td className="tiny" id="download-cell-A3KUK3EBU11MEZ">
104+
<a href="/rep.csv">Download</a>
105+
</td>
106+
</tr>
107+
</table>
108+
</div>
109+
)
110+
}
111+

src/components/Mock/MockInit.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
import { Link } from 'react-router-dom';
3+
4+
const MockInit = () => {
5+
return (
6+
<div>
7+
<Link to="/mock-downloader">
8+
<button id="btn-navigate">navigate</button>
9+
</Link>
10+
</div>
11+
);
12+
}
13+
14+
export default MockInit;

src/components/Mock/style.scss

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
table {
2+
border-collapse: collapse;
3+
width: 100%;
4+
}
5+
6+
th, td {
7+
padding: 8px;
8+
text-align: left;
9+
border-bottom: 1px solid #ddd;
10+
}
11+
12+
tr:nth-child(even) {background-color: #efefef;}

src/router/router-config.js

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Login } from "../components/Login/Login";
22
import NotFound from "../components/404/NotFound";
33
import { Home } from "../components/Home/Home";
4+
import { Mock } from "../components/Mock/Mock";
5+
import MockInit from "../components/Mock/MockInit";
46

57
export const routes = [
68
{
@@ -23,6 +25,16 @@ export const routes = [
2325
// }
2426
// ]
2527
},
28+
{
29+
path: "/mock",
30+
exact: true,
31+
component: MockInit
32+
},
33+
{
34+
path: "/mock-downloader",
35+
exact: true,
36+
component: Mock
37+
},
2638
{
2739
path: '*',
2840
component: NotFound

0 commit comments

Comments
 (0)