Skip to content

Commit d86d378

Browse files
committed
add unit tests for the frontend (more to be added), small styling improvements, complete types for OrdersPagination
1 parent b47538f commit d86d378

File tree

11 files changed

+10569
-3413
lines changed

11 files changed

+10569
-3413
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
21
# Change Log
32
All notable changes to this project will be documented in this file.
43

54
The format is based on [Keep a Changelog](http://keepachangelog.com/)
65
and this project adheres to [Semantic Versioning](http://semver.org/).
76

7+
## [2.0.1] - 2022-06-19
8+
9+
### Added
10+
11+
- unit tests for the frontend (more to be added)
12+
- small styling improvements
13+
- complete types for [OrdersPagination](./types/OrdersPagination.ts)
14+
815
## [2.0.0] - 2022-06-18
916

1017
### Changed

mocks/ordersMapped.ts

Lines changed: 353 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,353 @@
1+
export const ordersMapped = {
2+
series: [
3+
[1536139985000, 6.3],
4+
[1541016524000, 3.63],
5+
[1545002327000, 17.72],
6+
[1547932530000, 7.27],
7+
[1549127305000, 7.27],
8+
],
9+
seriesItems: [
10+
{
11+
id: '3442871-2',
12+
created: 1536139985000,
13+
resourceUrl: 'https://api.discogs.com/marketplace/orders/3442871-2',
14+
total: 7,
15+
fee: 0.7,
16+
items: [
17+
{
18+
id: 677267257,
19+
price: {
20+
value: 2,
21+
currency: 'EUR',
22+
},
23+
media_condition: 'Very Good Plus (VG+)',
24+
sleeve_condition: 'Generic',
25+
condition_comments: '',
26+
item_location: '',
27+
private_comments: '',
28+
release: {
29+
id: 822281,
30+
resource_url: 'https://api.discogs.com/releases/822281',
31+
description:
32+
'Cassino & Laben* Feat. Marina Puglisi - Lasting Memories (12")',
33+
thumbnail:
34+
'https://i.discogs.com/qux7GkBDmaT7KL2J-hhrFbICz8URzFozI3Jm5K5paLk/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTgyMjI4/MS0xMjExMTI3NjU5/LmpwZWc.jpeg',
35+
},
36+
},
37+
{
38+
id: 677269800,
39+
price: {
40+
value: 1,
41+
currency: 'EUR',
42+
},
43+
media_condition: 'Very Good (VG)',
44+
sleeve_condition: 'Good (G)',
45+
condition_comments: '',
46+
item_location: '',
47+
private_comments: '',
48+
release: {
49+
id: 405634,
50+
resource_url: 'https://api.discogs.com/releases/405634',
51+
description: 'Eelke Kleijn - Deeper Depths EP (12", EP)',
52+
thumbnail:
53+
'https://i.discogs.com/FHVsEWrqsXjNWxBLwHw8_jh_mveF_s6r1xImiIucuDs/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTQwNTYz/NC0xMTEzMjA5MTM5/LmpwZw.jpeg',
54+
},
55+
},
56+
{
57+
id: 677269823,
58+
price: {
59+
value: 3,
60+
currency: 'EUR',
61+
},
62+
media_condition: 'Very Good (VG)',
63+
sleeve_condition: 'Generic',
64+
condition_comments: '',
65+
item_location: '',
66+
private_comments: '',
67+
release: {
68+
id: 471344,
69+
resource_url: 'https://api.discogs.com/releases/471344',
70+
description: 'Eelke Kleijn - Consequences / We Resist (12")',
71+
thumbnail:
72+
'https://i.discogs.com/u7-JJq6qP6gh1M6r0_1d5IdngsUo1XlkXTczKyEDTEQ/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTQ3MTM0/NC0xNTIyMDA2MDU4/LTU0MzQuanBlZw.jpeg',
73+
},
74+
},
75+
{
76+
id: 677270529,
77+
price: {
78+
value: 1,
79+
currency: 'EUR',
80+
},
81+
media_condition: 'Very Good (VG)',
82+
sleeve_condition: 'Very Good Plus (VG+)',
83+
condition_comments: '',
84+
item_location: '',
85+
private_comments: '',
86+
release: {
87+
id: 442231,
88+
resource_url: 'https://api.discogs.com/releases/442231',
89+
description: 'Peter McCowan - EP (12")',
90+
thumbnail:
91+
'https://i.discogs.com/3_GqY_kPFq2NM1QUn3KSbaNPs2-uc6r6WOwFzKZQlJY/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTQ0MjIz/MS0xMzI4Mjc5MjMz/LmpwZWc.jpeg',
92+
},
93+
},
94+
],
95+
},
96+
{
97+
id: '3442871-4',
98+
created: 1541016524000,
99+
resourceUrl: 'https://api.discogs.com/marketplace/orders/3442871-4',
100+
total: 4,
101+
fee: 0.37,
102+
items: [
103+
{
104+
id: 677270574,
105+
price: {
106+
value: 4,
107+
currency: 'EUR',
108+
},
109+
media_condition: 'Very Good Plus (VG+)',
110+
sleeve_condition: 'Very Good (VG)',
111+
condition_comments: '',
112+
item_location: '',
113+
private_comments: '',
114+
release: {
115+
id: 523940,
116+
resource_url: 'https://api.discogs.com/releases/523940',
117+
description: 'The Quasar* - October + Remixes (12")',
118+
thumbnail:
119+
'https://i.discogs.com/zFJdxdIOCT8v4xNdAKa_J_B4F4pkG11Hqnhm_TvNS64/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTUyMzk0/MC0xMTg5MDE0OTMy/LmpwZWc.jpeg',
120+
},
121+
},
122+
],
123+
},
124+
{
125+
id: '3442871-5',
126+
created: 1545002327000,
127+
resourceUrl: 'https://api.discogs.com/marketplace/orders/3442871-5',
128+
total: 19.5,
129+
fee: 1.78,
130+
items: [
131+
{
132+
id: 677268073,
133+
price: {
134+
value: 3,
135+
currency: 'EUR',
136+
},
137+
media_condition: 'Very Good Plus (VG+)',
138+
sleeve_condition: 'Generic',
139+
condition_comments: '',
140+
item_location: '',
141+
private_comments: '',
142+
release: {
143+
id: 560488,
144+
resource_url: 'https://api.discogs.com/releases/560488',
145+
description: 'Dousk - Wrist Slap / Estrange (12")',
146+
thumbnail:
147+
'https://i.discogs.com/nGPFJeyMlp3h2Oad2UptKTse0yzgkzZ-9QhOCRqj6go/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTU2MDQ4/OC0xMzc1NDU5ODY5/LTQ1MjQuanBlZw.jpeg',
148+
},
149+
},
150+
{
151+
id: 677270418,
152+
price: {
153+
value: 1,
154+
currency: 'EUR',
155+
},
156+
media_condition: 'Very Good Plus (VG+)',
157+
sleeve_condition: 'Very Good Plus (VG+)',
158+
condition_comments: '',
159+
item_location: '',
160+
private_comments: '',
161+
release: {
162+
id: 349900,
163+
resource_url: 'https://api.discogs.com/releases/349900',
164+
description: 'Orchid - Everlasting E.P. (12", EP)',
165+
thumbnail:
166+
'https://i.discogs.com/bcZebCiPF-UABI_S0KW7Yjyz4BDO5Z5tHcqb0S8jJLY/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTM0OTkw/MC0xMTA4NzU5NTkz/LmpwZw.jpeg',
167+
},
168+
},
169+
{
170+
id: 677270437,
171+
price: {
172+
value: 2,
173+
currency: 'EUR',
174+
},
175+
media_condition: 'Very Good Plus (VG+)',
176+
sleeve_condition: 'Very Good Plus (VG+)',
177+
condition_comments: '',
178+
item_location: '',
179+
private_comments: '',
180+
release: {
181+
id: 464878,
182+
resource_url: 'https://api.discogs.com/releases/464878',
183+
description: 'Orchid - Technicolour EP (Part 1) (12")',
184+
thumbnail:
185+
'https://i.discogs.com/kfrsVvr43VhEGP3qI3Y_C_0qo6KIKWxxX8fjLwCqAs4/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTQ2NDg3/OC0xMTg5MzczODE4/LmpwZWc.jpeg',
186+
},
187+
},
188+
{
189+
id: 677270719,
190+
price: {
191+
value: 1.5,
192+
currency: 'EUR',
193+
},
194+
media_condition: 'Very Good Plus (VG+)',
195+
sleeve_condition: 'Generic',
196+
condition_comments: '',
197+
item_location: '',
198+
private_comments: '',
199+
release: {
200+
id: 299663,
201+
resource_url: 'https://api.discogs.com/releases/299663',
202+
description:
203+
'Subsky / Muzo* - Let It Flow / Particular People (12")',
204+
thumbnail:
205+
'https://i.discogs.com/b71_EoP2pH5bftgCPkpMpRSpvf0OKBaidjM3jGAPBx4/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTI5OTY2/My0xNjQ1NzE5NDU1/LTc5MjMuanBlZw.jpeg',
206+
},
207+
},
208+
{
209+
id: 677270993,
210+
price: {
211+
value: 3,
212+
currency: 'EUR',
213+
},
214+
media_condition: 'Very Good Plus (VG+)',
215+
sleeve_condition: 'Generic',
216+
condition_comments: '',
217+
item_location: '',
218+
private_comments: '',
219+
release: {
220+
id: 749562,
221+
resource_url: 'https://api.discogs.com/releases/749562',
222+
description: 'V-Sag - Thespian (12")',
223+
thumbnail:
224+
'https://i.discogs.com/mxllCoQFinDXthqUwyD0Pg3JvxrPojiTSMaZTPLp4Xs/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTc0OTU2/Mi0xMTkwNDYwMzgw/LmpwZWc.jpeg',
225+
},
226+
},
227+
{
228+
id: 677271057,
229+
price: {
230+
value: 2.5,
231+
currency: 'EUR',
232+
},
233+
media_condition: 'Very Good Plus (VG+)',
234+
sleeve_condition: 'Very Good Plus (VG+)',
235+
condition_comments: '',
236+
item_location: '',
237+
private_comments: '',
238+
release: {
239+
id: 700650,
240+
resource_url: 'https://api.discogs.com/releases/700650',
241+
description: 'V-Sag Meets dPen - Dark Inside (12")',
242+
thumbnail:
243+
'https://i.discogs.com/WA_QSebcaP-6BqecuDshS3KusMU_0DxAQGnRi3Npgsk/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTcwMDY1/MC0xNTU5OTI4Mjc2/LTMyMTUuanBlZw.jpeg',
244+
},
245+
},
246+
{
247+
id: 677271090,
248+
price: {
249+
value: 2.5,
250+
currency: 'EUR',
251+
},
252+
media_condition: 'Very Good Plus (VG+)',
253+
sleeve_condition: 'Generic',
254+
condition_comments: '',
255+
item_location: '',
256+
private_comments: '',
257+
release: {
258+
id: 651168,
259+
resource_url: 'https://api.discogs.com/releases/651168',
260+
description:
261+
'Various - Back To Back Sessions Vol.1 (Sampler) (Disc One) (12", Smplr)',
262+
thumbnail:
263+
'https://i.discogs.com/scG4zTNhfy8IwHRueSIp_6irNS6Xa3U_-9pZhsBGKs4/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTY1MTE2/OC0xMjM2MjY5OTcw/LmpwZWc.jpeg',
264+
},
265+
},
266+
{
267+
id: 843927416,
268+
price: {
269+
value: 4,
270+
currency: 'EUR',
271+
},
272+
media_condition: 'Near Mint (NM or M-)',
273+
sleeve_condition: 'Generic',
274+
condition_comments: '',
275+
item_location: '',
276+
private_comments: '',
277+
release: {
278+
id: 520920,
279+
resource_url: 'https://api.discogs.com/releases/520920',
280+
description:
281+
'Hawaii / Plastique Vision - Setting Up / Barely Away (12")',
282+
thumbnail:
283+
'https://i.discogs.com/zhreT-Zy2XexGiTpCUnQcUFl2U6tk0bQKesQqz_GCPI/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTUyMDky/MC0xMTg5MDE0MDY2/LmpwZWc.jpeg',
284+
},
285+
},
286+
],
287+
},
288+
{
289+
id: '3442871-6',
290+
created: 1547932530000,
291+
resourceUrl: 'https://api.discogs.com/marketplace/orders/3442871-6',
292+
total: 8,
293+
fee: 0.73,
294+
items: [
295+
{
296+
id: 854025605,
297+
price: {
298+
value: 8,
299+
currency: 'EUR',
300+
},
301+
media_condition: 'Near Mint (NM or M-)',
302+
sleeve_condition: 'Near Mint (NM or M-)',
303+
condition_comments: '',
304+
item_location: '',
305+
private_comments: '',
306+
release: {
307+
id: 377926,
308+
resource_url: 'https://api.discogs.com/releases/377926',
309+
description: 'Ridgewalkers Feat. El - Find (12", Pic)',
310+
thumbnail:
311+
'https://i.discogs.com/gDXin9-g6M6BpzMl59cFJSr0_LlpdQ6Nt7NYTGr_fdY/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTM3Nzky/Ni0xNTUwMzM5Njc4/LTkzNjcuanBlZw.jpeg',
312+
},
313+
},
314+
],
315+
},
316+
{
317+
id: '3442871-7',
318+
created: 1549127305000,
319+
resourceUrl: 'https://api.discogs.com/marketplace/orders/3442871-7',
320+
total: 8,
321+
fee: 0.73,
322+
items: [
323+
{
324+
id: 854025439,
325+
price: {
326+
value: 8,
327+
currency: 'EUR',
328+
},
329+
media_condition: 'Very Good (VG)',
330+
sleeve_condition: 'Very Good Plus (VG+)',
331+
condition_comments: '',
332+
item_location: '',
333+
private_comments: '',
334+
release: {
335+
id: 43284,
336+
resource_url: 'https://api.discogs.com/releases/43284',
337+
description:
338+
'Madonna - What It Feels Like For A Girl (12", Single)',
339+
thumbnail:
340+
'https://i.discogs.com/xBPWXV8yKimCFqkLmfGZTr-NrhVtsW51aJLpjMXmpTA/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTQzMjg0/LTE1ODkxMTI0MzMt/MjU2OS5qcGVn.jpeg',
341+
},
342+
},
343+
],
344+
},
345+
],
346+
ordersTotal: 101,
347+
ordersSent: 10,
348+
ordersCancelled: 5,
349+
ordersRefund: 1,
350+
itemsSold: 100,
351+
totalAmount: 100,
352+
username: 'testuser',
353+
}

modules/Orders.module.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
width: 100%;
33
margin-bottom: 20px;
44

5+
// overwrites highcharts defaults
56
:global(.highcharts-subtitle) {
67
font-size: 14px !important;
78
font-weight: 400;
@@ -51,12 +52,12 @@
5152
}
5253

5354
.loader {
54-
border: 16px solid #f3f3f3;
55-
border-top: 16px solid #3498db;
56-
border-radius: 50%;
5755
width: 120px;
5856
height: 120px;
5957
margin: 25px auto 0;
58+
border: 16px solid #f3f3f3;
59+
border-top: 16px solid #3498db;
60+
border-radius: 50%;
6061
animation: spin 2s linear infinite;
6162
}
6263

0 commit comments

Comments
 (0)