@jetshop/core 5.10.0 → 5.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChannelHandler/ChannelHandler.d.ts +9 -13
- package/ChannelHandler/ChannelHandler.js +16 -63
- package/ChannelHandler/ChannelHandler.js.map +1 -1
- package/ChannelHandler/channelUtils.d.ts +13 -0
- package/ChannelHandler/channelUtils.js +26 -15
- package/ChannelHandler/channelUtils.js.map +1 -1
- package/ChannelHandler/redirectUtils.d.ts +3 -0
- package/ChannelHandler/redirectUtils.js +48 -0
- package/ChannelHandler/redirectUtils.js.map +1 -0
- package/ChannelHandler/redirectUtils.test.js +8 -0
- package/analytics/AnalyticsProvider.js +1 -1
- package/analytics/AnalyticsProvider.js.map +1 -1
- package/boot/SharedTree.js +1 -1
- package/boot/SharedTree.js.map +1 -1
- package/boot/apollo.d.ts +5 -3
- package/boot/apollo.js +9 -13
- package/boot/apollo.js.map +1 -1
- package/boot/client/startClient.js +5 -10
- package/boot/client/startClient.js.map +1 -1
- package/boot/server/createRenderer.js +8 -7
- package/boot/server/createRenderer.js.map +1 -1
- package/boot/server/index.js +2 -2
- package/boot/server/index.js.map +1 -1
- package/boot/server/persistedQueries/__tests__/getPersistedQueriesForRequest.test.js +53 -39
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.js +2 -2
- package/boot/server/persistedQueries/getPersistedQueriesForRequest.js.map +1 -1
- package/components/Auth/CustomerUpdateForm.js +7 -7
- package/components/Auth/CustomerUpdateForm.js.map +1 -1
- package/components/ChannelContext/ChannelProvider.d.ts +1 -3
- package/components/ChannelContext/ChannelProvider.js +6 -13
- package/components/ChannelContext/ChannelProvider.js.map +1 -1
- package/components/ChannelContext/ChannelProvider.test.js +110 -0
- package/components/Mutation/cartMutationUtils.js +7 -6
- package/components/Mutation/cartMutationUtils.js.map +1 -1
- package/components/Query/CartProvider.js +31 -21
- package/components/Query/CartProvider.js.map +1 -1
- package/components/StructuredData/StructuredBreadcrumbData.js +4 -3
- package/components/StructuredData/StructuredBreadcrumbData.js.map +1 -1
- package/hooks/ProductList/ProductListContext.js +37 -14
- package/hooks/ProductList/ProductListContext.js.map +1 -1
- package/hooks/ProductList/action-creators.d.ts +20 -7
- package/hooks/ProductList/action-creators.js +125 -31
- package/hooks/ProductList/action-creators.js.map +1 -1
- package/hooks/ProductList/index.d.ts +34 -8
- package/hooks/ProductList/index.js +19 -0
- package/hooks/ProductList/index.js.map +1 -1
- package/hooks/ProductList/list-transforms.d.ts +2 -2
- package/hooks/ProductList/list-transforms.js +22 -22
- package/hooks/ProductList/list-transforms.js.map +1 -1
- package/hooks/ProductList/list-transforms.test.js +103 -100
- package/hooks/ProductList/product-list-reducer.d.ts +37 -14
- package/hooks/ProductList/product-list-reducer.js +106 -43
- package/hooks/ProductList/product-list-reducer.js.map +1 -1
- package/hooks/ProductList/product-list-reducer.test.js +144 -82
- package/hooks/ProductList/useProductList.d.ts +2 -2
- package/hooks/ProductList/useProductList.js +12 -5
- package/hooks/ProductList/useProductList.js.map +1 -1
- package/hooks/ProductList/useProductListItems.d.ts +1 -1
- package/hooks/ProductList/useProductListItems.js +8 -6
- package/hooks/ProductList/useProductListItems.js.map +1 -1
- package/package.json +1 -1
- package/resolvers/index.d.ts +3 -0
- package/resolvers/index.js +3 -0
- package/resolvers/index.js.map +1 -1
- package/sentry/client.js +1 -1
- package/sentry/client.js.map +1 -1
- package/time.d.ts +1 -0
- package/time.js +6 -0
- package/time.js.map +1 -0
@@ -1,12 +1,16 @@
|
|
1
1
|
import { act, renderHook } from '@testing-library/react-hooks';
|
2
2
|
import { useReducer } from 'react';
|
3
3
|
import { reducer, init } from './product-list-reducer';
|
4
|
+
import {
|
5
|
+
productListMapToArray,
|
6
|
+
PRODUCT_LISTS_KEY
|
7
|
+
} from '@jetshop/core/hooks/ProductList';
|
4
8
|
import { LocalStorageMock } from '@react-mock/localstorage';
|
5
9
|
import { render } from '@testing-library/react';
|
6
10
|
import React from 'react';
|
7
11
|
|
8
|
-
const
|
9
|
-
|
12
|
+
const MOCK_LIST_ITEMS = {
|
13
|
+
6952315: {
|
10
14
|
options: { quantity: 1 },
|
11
15
|
variants: {
|
12
16
|
'6952315-170-white': {
|
@@ -17,7 +21,7 @@ const MOCK_LIST = {
|
|
17
21
|
}
|
18
22
|
}
|
19
23
|
},
|
20
|
-
|
24
|
+
502935480: {
|
21
25
|
variants: null,
|
22
26
|
options: {
|
23
27
|
quantity: 1
|
@@ -47,22 +51,25 @@ describe('reducer init method', () => {
|
|
47
51
|
const obj = {
|
48
52
|
key: 'value'
|
49
53
|
};
|
54
|
+
const listId = 'test';
|
50
55
|
|
51
56
|
function Parent({ children }) {
|
52
|
-
const mockList =
|
57
|
+
const mockList = new Map([[listId, obj]]);
|
58
|
+
const localStorage = {};
|
59
|
+
localStorage[PRODUCT_LISTS_KEY] = JSON.stringify(
|
60
|
+
productListMapToArray(mockList)
|
61
|
+
);
|
53
62
|
return (
|
54
|
-
<LocalStorageMock items={{
|
55
|
-
{children}
|
56
|
-
</LocalStorageMock>
|
63
|
+
<LocalStorageMock items={localStorage}>{children}</LocalStorageMock>
|
57
64
|
);
|
58
65
|
}
|
59
66
|
function Child() {
|
60
|
-
const initialState = { loggedIn: false,
|
67
|
+
const initialState = { loggedIn: false, lists: new Map() };
|
61
68
|
const state = init(initialState);
|
62
69
|
|
63
70
|
return (
|
64
71
|
<div>
|
65
|
-
<span>{state.
|
72
|
+
<span>{state.lists.get(listId).key}</span>
|
66
73
|
<span>{state.loggedIn ? 'logged in' : 'not logged in'}</span>
|
67
74
|
</div>
|
68
75
|
);
|
@@ -80,21 +87,45 @@ describe('reducer init method', () => {
|
|
80
87
|
});
|
81
88
|
|
82
89
|
describe('reducer', () => {
|
90
|
+
const initialState = {
|
91
|
+
loggedIn: false,
|
92
|
+
lists: new Map([[null, { name: null, items: MOCK_LIST_ITEMS }]])
|
93
|
+
};
|
94
|
+
|
83
95
|
it('sets logged in and payload when LOGIN is called', () => {
|
84
96
|
const { result, dispatch } = setup();
|
85
|
-
|
97
|
+
|
98
|
+
// We should only test listId null, logged out users shouldn't have lists with IDs.
|
99
|
+
// We could remove the listId from the payload to make null implicit
|
100
|
+
const payload = {
|
101
|
+
listId: null,
|
102
|
+
list: {
|
103
|
+
name: null,
|
104
|
+
items: {
|
105
|
+
test: 'one'
|
106
|
+
}
|
107
|
+
}
|
108
|
+
};
|
86
109
|
|
87
110
|
act(() => dispatch({ type: 'LOGIN', payload }));
|
88
111
|
|
89
112
|
const [state] = result.current;
|
90
113
|
|
91
114
|
expect(state.loggedIn).toBe(true);
|
92
|
-
expect(state.
|
115
|
+
expect(state.lists.get(null).items).toMatchObject(payload.list.items);
|
93
116
|
});
|
94
117
|
it('sets loggedIn and resets list on LOGOUT', () => {
|
95
118
|
const initialState = {
|
96
119
|
loggedIn: true,
|
97
|
-
|
120
|
+
lists: new Map([
|
121
|
+
[
|
122
|
+
null,
|
123
|
+
{
|
124
|
+
name: null,
|
125
|
+
items: { 234523423: { options: { quantity: 1, description: '' } } }
|
126
|
+
}
|
127
|
+
]
|
128
|
+
])
|
98
129
|
};
|
99
130
|
|
100
131
|
const { result, dispatch } = setup(initialState);
|
@@ -109,21 +140,19 @@ describe('reducer', () => {
|
|
109
140
|
const [state] = result.current;
|
110
141
|
|
111
142
|
expect(state.loggedIn).toBe(false);
|
112
|
-
expect(state.
|
143
|
+
expect(state.lists).toMatchObject(
|
144
|
+
new Map([[null, { name: null, items: {} }]])
|
145
|
+
);
|
113
146
|
});
|
114
147
|
describe('UPDATE action', () => {
|
115
148
|
it('can replace a base product with one of its variants', () => {
|
116
|
-
const initialState = {
|
117
|
-
loggedIn: false,
|
118
|
-
list: MOCK_LIST
|
119
|
-
};
|
120
|
-
|
121
149
|
const { result, dispatch } = setup(initialState);
|
122
150
|
|
123
151
|
act(() =>
|
124
152
|
dispatch({
|
125
153
|
type: 'UPDATE',
|
126
154
|
payload: {
|
155
|
+
listId: null,
|
127
156
|
articleNumber: '502935480',
|
128
157
|
variantArticleNumber: '502935480-sparkles',
|
129
158
|
options: {
|
@@ -135,7 +164,7 @@ describe('reducer', () => {
|
|
135
164
|
|
136
165
|
const [state] = result.current;
|
137
166
|
|
138
|
-
const baseProduct = state.
|
167
|
+
const baseProduct = state.lists.get(null).items['502935480'];
|
139
168
|
|
140
169
|
expect(baseProduct.variants['502935480-sparkles'].options.quantity).toBe(
|
141
170
|
1
|
@@ -144,17 +173,13 @@ describe('reducer', () => {
|
|
144
173
|
expect(baseProduct.options).toBe(null);
|
145
174
|
});
|
146
175
|
it('can replace a variant with another variant', () => {
|
147
|
-
const initialState = {
|
148
|
-
loggedIn: false,
|
149
|
-
list: MOCK_LIST
|
150
|
-
};
|
151
|
-
|
152
176
|
const { result, dispatch } = setup(initialState);
|
153
177
|
|
154
178
|
act(() =>
|
155
179
|
dispatch({
|
156
180
|
type: 'UPDATE',
|
157
181
|
payload: {
|
182
|
+
listId: null,
|
158
183
|
articleNumber: '6952315',
|
159
184
|
variantArticleNumber: '6952315-170-pink',
|
160
185
|
options: {
|
@@ -166,28 +191,25 @@ describe('reducer', () => {
|
|
166
191
|
);
|
167
192
|
|
168
193
|
const [state] = result.current;
|
194
|
+
const list = state.lists.get(null);
|
169
195
|
|
170
196
|
expect(
|
171
|
-
|
197
|
+
list.items['6952315'].variants['6952315-170-pink'].options.quantity
|
172
198
|
).toBe(1);
|
173
199
|
expect(
|
174
|
-
|
200
|
+
list.items['6952315'].variants['6952315-170-white']
|
175
201
|
).not.toBeDefined();
|
176
202
|
});
|
177
203
|
});
|
178
204
|
describe('ADD action', () => {
|
179
205
|
it('can add a base product to the list', () => {
|
180
|
-
const initialState = {
|
181
|
-
loggedIn: false,
|
182
|
-
list: MOCK_LIST
|
183
|
-
};
|
184
|
-
|
185
206
|
const { result, dispatch } = setup(initialState);
|
186
207
|
|
187
208
|
act(() =>
|
188
209
|
dispatch({
|
189
210
|
type: 'ADD',
|
190
211
|
payload: {
|
212
|
+
listId: null,
|
191
213
|
articleNumber: 'boogie',
|
192
214
|
options: {
|
193
215
|
quantity: 1
|
@@ -198,20 +220,16 @@ describe('reducer', () => {
|
|
198
220
|
|
199
221
|
const [state] = result.current;
|
200
222
|
|
201
|
-
expect(state.
|
223
|
+
expect(state.lists.get(null).items['boogie'].options.quantity).toBe(1);
|
202
224
|
});
|
203
225
|
it('can add a variant to the list when there is no existing base product', () => {
|
204
|
-
const initialState = {
|
205
|
-
loggedIn: false,
|
206
|
-
list: MOCK_LIST
|
207
|
-
};
|
208
|
-
|
209
226
|
const { result, dispatch } = setup(initialState);
|
210
227
|
|
211
228
|
act(() =>
|
212
229
|
dispatch({
|
213
230
|
type: 'ADD',
|
214
231
|
payload: {
|
232
|
+
listId: null,
|
215
233
|
articleNumber: 'boogie',
|
216
234
|
variantArticleNumber: 'boogie-woogie',
|
217
235
|
options: {
|
@@ -222,24 +240,21 @@ describe('reducer', () => {
|
|
222
240
|
);
|
223
241
|
|
224
242
|
const [state] = result.current;
|
243
|
+
const list = state.lists.get(null);
|
225
244
|
|
226
|
-
expect(
|
245
|
+
expect(list.items['boogie'].options).toBe(null);
|
227
246
|
expect(
|
228
|
-
|
247
|
+
list.items['boogie'].variants['boogie-woogie'].options.quantity
|
229
248
|
).toBe(1);
|
230
249
|
});
|
231
250
|
it('can add a variant to the list when there is an existing base product', () => {
|
232
|
-
const initialState = {
|
233
|
-
loggedIn: false,
|
234
|
-
list: MOCK_LIST
|
235
|
-
};
|
236
|
-
|
237
251
|
const { result, dispatch } = setup(initialState);
|
238
252
|
|
239
253
|
act(() =>
|
240
254
|
dispatch({
|
241
255
|
type: 'ADD',
|
242
256
|
payload: {
|
257
|
+
listId: null,
|
243
258
|
articleNumber: '502935480',
|
244
259
|
variantArticleNumber: 'boogie-woogie',
|
245
260
|
options: {
|
@@ -250,24 +265,21 @@ describe('reducer', () => {
|
|
250
265
|
);
|
251
266
|
|
252
267
|
const [state] = result.current;
|
268
|
+
const list = state.lists.get(null);
|
253
269
|
|
254
|
-
expect(
|
270
|
+
expect(list.items['502935480'].options).not.toBe(null);
|
255
271
|
expect(
|
256
|
-
|
272
|
+
list.items['502935480'].variants['boogie-woogie'].options.quantity
|
257
273
|
).toBe(1);
|
258
274
|
});
|
259
275
|
it('can add a variant to the list when there is a base product with variants', () => {
|
260
|
-
const initialState = {
|
261
|
-
loggedIn: false,
|
262
|
-
list: MOCK_LIST
|
263
|
-
};
|
264
|
-
|
265
276
|
const { result, dispatch } = setup(initialState);
|
266
277
|
|
267
278
|
act(() =>
|
268
279
|
dispatch({
|
269
280
|
type: 'ADD',
|
270
281
|
payload: {
|
282
|
+
listId: null,
|
271
283
|
articleNumber: '6952315',
|
272
284
|
variantArticleNumber: 'boogie-woogie',
|
273
285
|
options: {
|
@@ -278,50 +290,44 @@ describe('reducer', () => {
|
|
278
290
|
);
|
279
291
|
|
280
292
|
const [state] = result.current;
|
293
|
+
const list = state.lists.get(null);
|
281
294
|
|
282
|
-
expect(
|
295
|
+
expect(list.items['6952315'].options).not.toBe(null);
|
283
296
|
expect(
|
284
|
-
|
297
|
+
list.items['6952315'].variants['boogie-woogie'].options.quantity
|
285
298
|
).toBe(1);
|
286
|
-
expect(
|
287
|
-
|
299
|
+
expect(list.items['6952315'].variants['6952315-170-white']).toMatchObject(
|
300
|
+
MOCK_LIST_ITEMS['6952315'].variants['6952315-170-white']
|
288
301
|
);
|
289
302
|
});
|
290
303
|
});
|
291
304
|
describe('REMOVE action', () => {
|
292
305
|
it('will entirely remove a base product with no variants', () => {
|
293
|
-
const initialState = {
|
294
|
-
loggedIn: false,
|
295
|
-
list: MOCK_LIST
|
296
|
-
};
|
297
|
-
|
298
306
|
const { result, dispatch } = setup(initialState);
|
299
307
|
|
300
308
|
act(() =>
|
301
309
|
dispatch({
|
302
310
|
type: 'REMOVE',
|
303
311
|
payload: {
|
312
|
+
listId: null,
|
304
313
|
articleNumber: '502935480'
|
305
314
|
}
|
306
315
|
})
|
307
316
|
);
|
308
317
|
|
309
318
|
const [state] = result.current;
|
319
|
+
const list = state.lists.get(null);
|
310
320
|
|
311
|
-
expect(
|
321
|
+
expect(list.items['502935480']).not.toBeDefined();
|
312
322
|
});
|
313
323
|
it('will entirely remove an item if the variant is removed and there is no base product', () => {
|
314
|
-
const initialState = {
|
315
|
-
loggedIn: false,
|
316
|
-
list: MOCK_LIST
|
317
|
-
};
|
318
|
-
|
319
324
|
const { result, dispatch } = setup(initialState);
|
320
325
|
|
321
326
|
act(() =>
|
322
327
|
dispatch({
|
323
328
|
type: 'REMOVE',
|
324
329
|
payload: {
|
330
|
+
listId: null,
|
325
331
|
articleNumber: 'without-base',
|
326
332
|
variantArticleNumber: 'with-variant'
|
327
333
|
}
|
@@ -329,15 +335,11 @@ describe('reducer', () => {
|
|
329
335
|
);
|
330
336
|
|
331
337
|
const [state] = result.current;
|
338
|
+
const list = state.lists.get(null);
|
332
339
|
|
333
|
-
expect(
|
340
|
+
expect(list['without-base']).not.toBeDefined();
|
334
341
|
});
|
335
342
|
it('will keep the variant if one exists', () => {
|
336
|
-
const initialState = {
|
337
|
-
loggedIn: false,
|
338
|
-
list: MOCK_LIST
|
339
|
-
};
|
340
|
-
|
341
343
|
const { result, dispatch } = setup(initialState);
|
342
344
|
const articleToRemove = '6952315';
|
343
345
|
|
@@ -345,22 +347,19 @@ describe('reducer', () => {
|
|
345
347
|
dispatch({
|
346
348
|
type: 'REMOVE',
|
347
349
|
payload: {
|
350
|
+
listId: null,
|
348
351
|
articleNumber: articleToRemove
|
349
352
|
}
|
350
353
|
})
|
351
354
|
);
|
352
355
|
|
353
356
|
const [state] = result.current;
|
357
|
+
const list = state.lists.get(null);
|
354
358
|
|
355
|
-
expect(
|
356
|
-
expect(
|
359
|
+
expect(list.items[articleToRemove].options).toBe(null);
|
360
|
+
expect(list.items[articleToRemove].variants).toBeDefined();
|
357
361
|
});
|
358
362
|
it('will remove the variant but keep the base product', () => {
|
359
|
-
const initialState = {
|
360
|
-
loggedIn: false,
|
361
|
-
list: MOCK_LIST
|
362
|
-
};
|
363
|
-
|
364
363
|
const { result, dispatch } = setup(initialState);
|
365
364
|
|
366
365
|
const parent = '6952315';
|
@@ -370,6 +369,7 @@ describe('reducer', () => {
|
|
370
369
|
dispatch({
|
371
370
|
type: 'REMOVE',
|
372
371
|
payload: {
|
372
|
+
listId: null,
|
373
373
|
articleNumber: parent,
|
374
374
|
variantArticleNumber: articleToRemove
|
375
375
|
}
|
@@ -377,9 +377,71 @@ describe('reducer', () => {
|
|
377
377
|
);
|
378
378
|
|
379
379
|
const [state] = result.current;
|
380
|
+
const list = state.lists.get(null);
|
381
|
+
|
382
|
+
expect(list.items[parent].variants[articleToRemove]).not.toBeDefined();
|
383
|
+
expect(list.items[parent].options).toBeDefined();
|
384
|
+
});
|
385
|
+
});
|
386
|
+
|
387
|
+
describe('DELETE_LIST action', () => {
|
388
|
+
it('can delete a product list', () => {
|
389
|
+
const listId = '12345';
|
390
|
+
const initialState = {
|
391
|
+
loggedIn: false,
|
392
|
+
lists: new Map([[listId, MOCK_LIST_ITEMS]])
|
393
|
+
};
|
394
|
+
|
395
|
+
const { result, dispatch } = setup(initialState);
|
396
|
+
const [state] = result.current;
|
397
|
+
|
398
|
+
expect(state.lists.get(listId)).toBeDefined;
|
399
|
+
|
400
|
+
act(() =>
|
401
|
+
dispatch({
|
402
|
+
type: 'DELETE_LIST',
|
403
|
+
payload: { listId }
|
404
|
+
})
|
405
|
+
);
|
406
|
+
|
407
|
+
expect(state.lists.get(listId)).toBeUndefined;
|
408
|
+
});
|
409
|
+
});
|
410
|
+
|
411
|
+
describe('CREATE_LIST action', () => {
|
412
|
+
it('can create a new product list', () => {
|
413
|
+
const listId = '12345';
|
414
|
+
const { result, dispatch } = setup();
|
415
|
+
const name = 'My Stuff';
|
416
|
+
|
417
|
+
act(() =>
|
418
|
+
dispatch({
|
419
|
+
type: 'CREATE_LIST',
|
420
|
+
payload: { listId, list: { name } }
|
421
|
+
})
|
422
|
+
);
|
423
|
+
|
424
|
+
const [state] = result.current;
|
425
|
+
expect(state.lists.has(listId)).toBe(true);
|
426
|
+
expect(state.lists.get(listId).name).toBe(name);
|
427
|
+
});
|
428
|
+
});
|
429
|
+
|
430
|
+
describe('CLEAR_ITEMS action', () => {
|
431
|
+
it('can clear items on a product list', () => {
|
432
|
+
const { result, dispatch } = setup(initialState);
|
433
|
+
const listId = null;
|
434
|
+
|
435
|
+
act(() =>
|
436
|
+
dispatch({
|
437
|
+
type: 'CLEAR_ITEMS',
|
438
|
+
payload: { listId }
|
439
|
+
})
|
440
|
+
);
|
380
441
|
|
381
|
-
|
382
|
-
|
442
|
+
const [state] = result.current;
|
443
|
+
const list = state.lists.get(listId);
|
444
|
+
expect(list.items).toMatchObject({});
|
383
445
|
});
|
384
446
|
});
|
385
447
|
});
|
@@ -395,7 +457,7 @@ function setup(initialState) {
|
|
395
457
|
function useProductListReducer({ initialState }) {
|
396
458
|
const [state, dispatch] = useReducer(
|
397
459
|
reducer,
|
398
|
-
initialState || { loggedIn: false,
|
460
|
+
initialState || { loggedIn: false, lists: new Map() }
|
399
461
|
);
|
400
462
|
|
401
463
|
return [state, dispatch];
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { UpdateListInput } from '.';
|
2
|
-
export declare function useProductList(): {
|
1
|
+
import { ProductListId, UpdateListInput } from '.';
|
2
|
+
export declare function useProductList(listId?: ProductListId): {
|
3
3
|
toggle: (articleNumber: string, { variantArticleNumber, quantity, description, productName }: UpdateListInput) => void;
|
4
4
|
add: (articleNumber: string, { variantArticleNumber, quantity, description, productName }: UpdateListInput) => void;
|
5
5
|
remove: (articleNumber: string, { variantArticleNumber }: UpdateListInput) => void;
|
@@ -5,8 +5,12 @@ import { flattenList } from './list-transforms';
|
|
5
5
|
import { ProductListContext } from './ProductListContext';
|
6
6
|
import { trackAddToWishListEvent } from '../../analytics/tracking';
|
7
7
|
import { useTracker } from '../../analytics/Analytics';
|
8
|
-
export function useProductList() {
|
9
|
-
const {
|
8
|
+
export function useProductList(listId = null) {
|
9
|
+
const {
|
10
|
+
// XXX
|
11
|
+
//state: { list = {} },
|
12
|
+
state, dispatch, queries, usingLocalList } = React.useContext(ProductListContext);
|
13
|
+
const list = state.lists.get(listId);
|
10
14
|
const [hydrated, setHydrated] = useState(!usingLocalList);
|
11
15
|
const updateAPI = !usingLocalList;
|
12
16
|
const removeMutation = useMutation(queries.remove);
|
@@ -27,6 +31,7 @@ export function useProductList() {
|
|
27
31
|
}
|
28
32
|
function remove(articleNumber, { variantArticleNumber }) {
|
29
33
|
dispatch(removeAction({
|
34
|
+
listId,
|
30
35
|
articleNumber,
|
31
36
|
variantArticleNumber,
|
32
37
|
removeMutation,
|
@@ -39,6 +44,7 @@ export function useProductList() {
|
|
39
44
|
productName
|
40
45
|
}));
|
41
46
|
dispatch(addAction({
|
47
|
+
listId,
|
42
48
|
updateAPI,
|
43
49
|
articleNumber,
|
44
50
|
variantArticleNumber,
|
@@ -48,6 +54,7 @@ export function useProductList() {
|
|
48
54
|
}
|
49
55
|
function update(articleNumber, { variantArticleNumber, quantity, description, variantToReplace }) {
|
50
56
|
dispatch(updateAction({
|
57
|
+
listId,
|
51
58
|
updateAPI,
|
52
59
|
articleNumber,
|
53
60
|
variantArticleNumber,
|
@@ -58,16 +65,16 @@ export function useProductList() {
|
|
58
65
|
}));
|
59
66
|
}
|
60
67
|
function clear() {
|
61
|
-
dispatch(clearAction({ removeMutation, updateAPI }));
|
68
|
+
dispatch(clearAction({ listId, removeMutation, updateAPI }));
|
62
69
|
}
|
63
70
|
function inList(articleNumber, { variantArticleNumber }) {
|
64
71
|
var _a;
|
65
72
|
if (!hydrated)
|
66
73
|
return false;
|
67
|
-
if (list && articleNumber in list) {
|
74
|
+
if (list && articleNumber in list.items) {
|
68
75
|
if (!variantArticleNumber)
|
69
76
|
return true;
|
70
|
-
const variantInList = !!((_a = list[articleNumber].variants) === null || _a === void 0 ? void 0 : _a[variantArticleNumber]);
|
77
|
+
const variantInList = !!((_a = list.items[articleNumber].variants) === null || _a === void 0 ? void 0 : _a[variantArticleNumber]);
|
71
78
|
return variantInList;
|
72
79
|
}
|
73
80
|
else {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useProductList.js","sourceRoot":"","sources":["useProductList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"useProductList.js","sourceRoot":"","sources":["useProductList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAO3C,OAAO,EACL,SAAS,EACT,WAAW,EACX,YAAY,EACZ,YAAY,EACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,MAAM,UAAU,cAAc,CAAC,SAAwB,IAAI;IACzD,MAAM;IACJ,MAAM;IACN,uBAAuB;IACvB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,cAAc,EACf,GAAG,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAEzC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAErC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,cAAc,CAAC,CAAC;IAE1D,MAAM,SAAS,GAAG,CAAC,cAAc,CAAC;IAElC,MAAM,cAAc,GAA2B,WAAW,CAAC,OAA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retrieve the default product list */
|
7
|
-
|
7
|
+
listId?: string | null, options?: {
|
8
8
|
/** Limit how many items are returned */
|
9
9
|
limit?: number;
|
10
10
|
}): ProductListDetail;
|
@@ -8,10 +8,9 @@ import getErrorDetail from '../../helpers/getErrorDetail';
|
|
8
8
|
*/
|
9
9
|
export function useProductListItems(
|
10
10
|
/** Passing null for id will retrieve the default product list */
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
const { state: { list }, queries, dispatch, usingLocalList } = useContext(ProductListContext);
|
11
|
+
listId = null, options = {}) {
|
12
|
+
const { state: { lists }, queries, dispatch, usingLocalList } = useContext(ProductListContext);
|
13
|
+
const list = lists.get(listId);
|
15
14
|
const [hydrated, setHydrated] = useState(!usingLocalList);
|
16
15
|
const flattenedList = useMemo(() => flattenList(list), [list]);
|
17
16
|
// Make a `products` query containing every item in the list
|
@@ -20,7 +19,7 @@ id = null, options = {}) {
|
|
20
19
|
errorPolicy: 'all',
|
21
20
|
variables: {
|
22
21
|
articleNumbers: flattenedList
|
23
|
-
.map(listItem => listItem.articleNumber)
|
22
|
+
.map((listItem) => listItem.articleNumber)
|
24
23
|
.slice(0, options.limit)
|
25
24
|
}
|
26
25
|
});
|
@@ -29,7 +28,10 @@ id = null, options = {}) {
|
|
29
28
|
const { codes, data } = getErrorDetail(productQueryResult.error);
|
30
29
|
if (codes.includes('ProductNotFound')) {
|
31
30
|
for (const item of data) {
|
32
|
-
dispatch({
|
31
|
+
dispatch({
|
32
|
+
type: 'REMOVE',
|
33
|
+
payload: { listId, articleNumber: item.argument }
|
34
|
+
});
|
33
35
|
}
|
34
36
|
}
|
35
37
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useProductListItems.js","sourceRoot":"","sources":["useProductListItems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAA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AK;QAClB,SAAS,EAAE;YACT,cAAc,EAAE,aAAa;iBAC1B,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;iBACzC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC;SAC3B;KACF,CAAC,CAAC;IAEH,qEAAqE;IACrE,IAAI,kBAAkB,CAAC,KAAK,EAAE;QAC5B,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAEjE,IAAI,KAAK,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE;YACrC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;gBACvB,QAAQ,CAAC;oBACP,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE;iBAClD,CAAC,CAAC;aACJ;SACF;KACF;IAED,0EAA0E;IAC1E,4EAA4E;IAC5E,SAAS,CAAC,GAAG,EAAE;QACb,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,MAAM,GAAG;QACb,QAAQ,EAAE,uCAAuC,CAC/C,aAAa,EACb,kBAAkB,CACnB;QACD,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;KACtD,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
package/resolvers/index.d.ts
CHANGED
package/resolvers/index.js
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
import { boolFilterValue, clearAllFilters, clearListFilter, clearMultiListFilter, clearMultiListFilterList, clearRangeFilter, isListFilterActive, isMultiFilterActive, isMultiFilterListActive, isRangeFilterActive, listFilterHasActiveItems, rangeFilterValue, setBoolFilter, setMultiListFilter, setRangeFilter, toggleListFilterItem, toggleMultiListFilterItem } from './filters';
|
2
2
|
export const resolvers = (searchParams) => ({
|
3
|
+
Cart: {
|
4
|
+
__optimistic: () => false
|
5
|
+
},
|
3
6
|
ListFilterItem: {
|
4
7
|
isActive: (parent) => isListFilterActive(parent)(searchParams)
|
5
8
|
},
|
package/resolvers/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,WAAW,CAAC;AAEnB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,YAAoB,EAAE,EAAE,CAAC,CAAC;IAClD,cAAc,EAAE;QACd,QAAQ,EAAE,CAAC,MAAW,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;KACpE;IACD,UAAU,EAAE;QACV,cAAc,EAAE,CAAC,MAAW,EAAE,EAAE,CAC9B,wBAAwB,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;KACjD;IACD,aAAa,EAAE;QACb,KAAK,EAAE,CAAC,MAAW,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;KAC9D;IACD,kBAAkB,EAAE;QAClB,QAAQ,EAAE,CAAC,MAAW,EAAE,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;QACpE,KAAK,EAAE,CAAC,MAAW,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;KAC/D;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,CAAC,MAAW,EAAE,EAA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mBAAmB,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;QACpE,KAAK,EAAE,CAAC,MAAW,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;KAC/D;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,CAAC,MAAW,EAAE,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;KACrE;IACD,mBAAmB,EAAE;QACnB,cAAc,EAAE,CAAC,MAAW,EAAE,EAAE,CAC9B,uBAAuB,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;KAChD;IACD,QAAQ,EAAE;QACR,oBAAoB;QACpB,eAAe;QACf,eAAe;QACf,aAAa;QACb,cAAc;QACd,gBAAgB;QAChB,wBAAwB;QACxB,oBAAoB;QACpB,kBAAkB;QAClB,yBAAyB;KAC1B;CACF,CAAC,CAAC"}
|
package/sentry/client.js
CHANGED
@@ -18,7 +18,7 @@ export function init(dsn, ignoreErrors = []) {
|
|
18
18
|
'TypeError: Netværksforbindelsen gik tabt.',
|
19
19
|
'TypeError: Verkkoyhteys katkesi.',
|
20
20
|
'Failed to fetch',
|
21
|
-
'ResizeObserver loop
|
21
|
+
'ResizeObserver loop',
|
22
22
|
'Unauthorized'
|
23
23
|
].concat(ignoreErrors)
|
24
24
|
});
|
package/sentry/client.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9D,MAAM,UAAU,IAAI,CAClB,GAAY,EACZ,eAAoC,EAAE;IAEtC,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC;YACV,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,SAAS;YAC/C,GAAG;YACH,YAAY,EAAE;gBACZ,GAAG,kBAAkB;gBACrB,wBAAwB;gBACxB,2BAA2B;gBAC3B,gDAAgD;gBAChD,0BAA0B;gBAC1B,iBAAiB;gBACjB,4DAA4D;gBAC5D,6CAA6C;gBAC7C,2CAA2C;gBAC3C,kCAAkC;gBAClC,iBAAiB;gBACjB,
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9D,MAAM,UAAU,IAAI,CAClB,GAAY,EACZ,eAAoC,EAAE;IAEtC,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC;YACV,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,SAAS;YAC/C,GAAG;YACH,YAAY,EAAE;gBACZ,GAAG,kBAAkB;gBACrB,wBAAwB;gBACxB,2BAA2B;gBAC3B,gDAAgD;gBAChD,0BAA0B;gBAC1B,iBAAiB;gBACjB,4DAA4D;gBAC5D,6CAA6C;gBAC7C,2CAA2C;gBAC3C,kCAAkC;gBAClC,iBAAiB;gBACjB,qBAAqB;gBACrB,cAAc;aACf,CAAC,MAAM,CAAC,YAAY,CAAC;SACvB,CAAC,CAAC;QACH,MAAM,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9B,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;KACJ;AACH,CAAC"}
|
package/time.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export declare function measure(name: string): void;
|