@nyris/nyris-webapp 0.3.31 → 0.3.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyris/nyris-webapp",
3
- "version": "0.3.31",
3
+ "version": "0.3.33",
4
4
  "homepage": "./",
5
5
  "dependencies": {
6
6
  "@algolia/autocomplete-js": "^1.7.1",
@@ -12,8 +12,8 @@
12
12
  "@material-ui/data-grid": "^4.0.0-alpha.37",
13
13
  "@material-ui/icons": "^4.4.1",
14
14
  "@material-ui/lab": "^4.0.0-alpha.60",
15
- "@nyris/nyris-api": "^0.3.31",
16
- "@nyris/nyris-react-components": "^0.3.31",
15
+ "@nyris/nyris-api": "^0.3.33",
16
+ "@nyris/nyris-react-components": "^0.3.33",
17
17
  "@reduxjs/toolkit": "^1.6.1",
18
18
  "@splidejs/react-splide": "^0.7.12",
19
19
  "@types/blueimp-load-image": "^2.23.4",
@@ -40,7 +40,7 @@
40
40
  "qs": "^6.10.3",
41
41
  "react": "^17.0.0",
42
42
  "react-dom": "^16.13.1",
43
- "react-dropzone": "^10.1.8",
43
+ "react-dropzone": "^14.2.3",
44
44
  "react-hook-form": "^7.27.1",
45
45
  "react-hot-toast": "^2.4.0",
46
46
  "react-i18next": "^12.2.0",
@@ -114,7 +114,7 @@ function DetailItem(props: Props) {
114
114
  style={{ width: '300px', height: '300px', padding: '8px' }}
115
115
  />
116
116
  )}
117
- {!isMobile && dataImageCarousel.length > 0 && (
117
+ {dataImageCarousel.length > 0 && (
118
118
  <Button
119
119
  className="icon-style"
120
120
  onClick={() => {
@@ -314,36 +314,42 @@ function DetailItem(props: Props) {
314
314
  style={{ color: '#2B2C46', marginTop: 12 }}
315
315
  gridGap={20}
316
316
  >
317
- <Box
318
- style={{
319
- backgroundColor: `${settings.theme?.secondaryColor}26`,
320
- padding: '5px 10px',
321
- borderRadius: 4,
322
- width: '100%',
323
- }}
324
- >
325
- <div style={{ fontSize: 15, fontWeight: 500 }}>
326
- {dataItem[settings.field.warehouseNumber]}
327
- </div>
328
- <div style={{ fontSize: 17, fontWeight: 700 }}>
329
- {dataItem[settings.field.warehouseNumberValue] || 'N/A'}
330
- </div>
331
- </Box>
332
- <Box
333
- style={{
334
- backgroundColor: `${settings.theme?.secondaryColor}26`,
335
- padding: '5px 10px',
336
- borderRadius: 4,
337
- width: '100%',
338
- }}
339
- >
340
- <div style={{ fontSize: 15, fontWeight: 500 }}>
341
- {dataItem[settings.field.warehouseShelfNumber]}
342
- </div>
343
- <div style={{ fontSize: 17, fontWeight: 700 }}>
344
- {dataItem[settings.field.warehouseShelfNumberValue] || 'N/A'}
345
- </div>
346
- </Box>
317
+ {settings.field.warehouseNumber && (
318
+ <Box
319
+ style={{
320
+ backgroundColor: `${settings.theme?.secondaryColor}26`,
321
+ padding: '5px 10px',
322
+ borderRadius: 4,
323
+ width: '100%',
324
+ }}
325
+ >
326
+ <div style={{ fontSize: 15, fontWeight: 500 }}>
327
+ {dataItem[settings.field.warehouseNumber]}
328
+ </div>
329
+ <div style={{ fontSize: 17, fontWeight: 700 }}>
330
+ {dataItem[settings.field.warehouseNumberValue] || 'N/A'}
331
+ </div>
332
+ </Box>
333
+ )}
334
+
335
+ {settings.field.warehouseShelfNumber && (
336
+ <Box
337
+ style={{
338
+ backgroundColor: `${settings.theme?.secondaryColor}26`,
339
+ padding: '5px 10px',
340
+ borderRadius: 4,
341
+ width: '100%',
342
+ }}
343
+ >
344
+ <div style={{ fontSize: 15, fontWeight: 500 }}>
345
+ {dataItem[settings.field.warehouseShelfNumber]}
346
+ </div>
347
+ <div style={{ fontSize: 17, fontWeight: 700 }}>
348
+ {dataItem[settings.field.warehouseShelfNumberValue] ||
349
+ 'N/A'}
350
+ </div>
351
+ </Box>
352
+ )}
347
353
  </Box>
348
354
  )}
349
355
 
@@ -1,6 +1,6 @@
1
1
  import { Box } from '@material-ui/core';
2
2
  import ItemResult from 'components/results/ItemResult';
3
- import { groupBy } from 'lodash';
3
+ import { groupBy, uniqueId } from 'lodash';
4
4
  import React, { memo, useEffect, useMemo, useState } from 'react';
5
5
  import { connectStateResults } from 'react-instantsearch-dom';
6
6
  import { useAppSelector } from 'Store/Store';
@@ -52,9 +52,13 @@ function ProductListComponent({
52
52
  let newArrayShowGroup: any = [];
53
53
  let newArrayShowItem: any = [];
54
54
 
55
- const groupHits = hits.filter(
56
- (hit: { group_id: string }) => hit.group_id && hit.group_id !== '',
57
- );
55
+ const groupHits = hits.map((hit: { group_id: string }) => {
56
+ if (!hit.group_id) {
57
+ return { ...hit, group_id: uniqueId('random-group-id') };
58
+ }
59
+ return hit;
60
+ });
61
+
58
62
  const groups = groupBy(groupHits, 'group_id');
59
63
  setHitGroups(groups);
60
64
  newArrayShowGroup = Object.values(groups);
@@ -79,6 +83,7 @@ function ProductListComponent({
79
83
  newArrayShowItem.push(payload);
80
84
  }
81
85
  });
86
+
82
87
  return newArrayShowItem;
83
88
  };
84
89
 
@@ -2,9 +2,9 @@ import { Box, Button, Grid, Tooltip, Typography } from '@material-ui/core';
2
2
  import ChevronRightOutlinedIcon from '@material-ui/icons/ChevronRightOutlined';
3
3
  import IconOpenLink from 'common/assets/icons/Union.svg';
4
4
  import { ReactComponent as IconShare } from 'common/assets/icons/Fill.svg';
5
- import { ReactComponent as Expand } from 'common/assets/icons/expand.svg';
6
5
  import { ReactComponent as IconDisLike } from 'common/assets/icons/icon_dislike.svg';
7
6
  import { ReactComponent as IconLike } from 'common/assets/icons/icon_like.svg';
7
+ import { ReactComponent as IconSearchImage } from 'common/assets/icons/icon_search_image2.svg';
8
8
  import React, { memo, useEffect, useState } from 'react';
9
9
  import NoImage from 'common/assets/images/unnamed.png';
10
10
  import { AppState } from 'types';
@@ -143,13 +143,17 @@ function ItemResult(props: Props) {
143
143
  </Button>
144
144
  </Box>
145
145
  )}
146
- {!isHover && (
146
+ {!isHover && main_image_link && (
147
147
  <Box className="box-icon-modal">
148
148
  <Button
149
149
  style={{ width: '100%', height: '100%', padding: 0, zIndex: 9 }}
150
- onClick={() => handlerToggleModal(dataItem)}
150
+ onClick={() => {
151
+ if (urlImage.length > 1) {
152
+ onSearchImage(main_image_link);
153
+ }
154
+ }}
151
155
  >
152
- <Expand color={settings.theme?.secondaryColor} />
156
+ <IconSearchImage color={settings.theme?.secondaryColor} />
153
157
  </Button>
154
158
  </Box>
155
159
  )}
@@ -158,9 +162,7 @@ function ItemResult(props: Props) {
158
162
  style={{ width: '100%', height: '100%' }}
159
163
  onClick={(e: any) => {
160
164
  e.preventDefault();
161
- if (urlImage.length > 1) {
162
- onSearchImage(main_image_link);
163
- }
165
+ handlerToggleModal(dataItem);
164
166
  }}
165
167
  >
166
168
  {main_image_link ? (
@@ -367,53 +369,58 @@ function ItemResult(props: Props) {
367
369
  style={{ color: '#2B2C46', marginTop: '12px' }}
368
370
  gridGap={10}
369
371
  >
370
- <Box
371
- style={{
372
- backgroundColor: `${settings.theme?.secondaryColor}26`,
373
- padding: '5px 10px',
374
- borderRadius: 4,
375
- width: '100%',
376
- }}
377
- >
378
- <div style={{ fontSize: 10, fontWeight: 500 }}>
379
- {dataItem.custom_id_key_2}
380
- </div>
381
- <div
372
+ {settings.field.warehouseNumber && (
373
+ <Box
382
374
  style={{
383
- fontSize: 13,
384
- fontWeight: 700,
385
- whiteSpace: 'nowrap',
386
- overflow: 'hidden',
387
- textOverflow: 'ellipsis',
375
+ backgroundColor: `${settings.theme?.secondaryColor}26`,
376
+ padding: '5px 10px',
377
+ borderRadius: 4,
378
+ width: '100%',
388
379
  }}
389
380
  >
390
- {dataItem.custom_id_value_2 || 'N/A'}
391
- </div>
392
- </Box>
381
+ <div style={{ fontSize: 10, fontWeight: 500 }}>
382
+ {dataItem[settings.field.warehouseNumber]}
383
+ </div>
384
+ <div
385
+ style={{
386
+ fontSize: 13,
387
+ fontWeight: 700,
388
+ whiteSpace: 'nowrap',
389
+ overflow: 'hidden',
390
+ textOverflow: 'ellipsis',
391
+ }}
392
+ >
393
+ {dataItem[settings.field.warehouseNumberValue] || 'N/A'}
394
+ </div>
395
+ </Box>
396
+ )}
393
397
 
394
- <Box
395
- style={{
396
- backgroundColor: `${settings.theme?.secondaryColor}26`,
397
- padding: '5px 10px',
398
- borderRadius: 4,
399
- width: '100%',
400
- }}
401
- >
402
- <div style={{ fontSize: 10, fontWeight: 500 }}>
403
- {dataItem.custom_id_key_1}
404
- </div>
405
- <div
398
+ {settings.field.warehouseShelfNumber && (
399
+ <Box
406
400
  style={{
407
- fontSize: 13,
408
- fontWeight: 700,
409
- whiteSpace: 'nowrap',
410
- overflow: 'hidden',
411
- textOverflow: 'ellipsis',
401
+ backgroundColor: `${settings.theme?.secondaryColor}26`,
402
+ padding: '5px 10px',
403
+ borderRadius: 4,
404
+ width: '100%',
412
405
  }}
413
406
  >
414
- {dataItem.custom_id_value_1 || 'N/A'}
415
- </div>
416
- </Box>
407
+ <div style={{ fontSize: 10, fontWeight: 500 }}>
408
+ {dataItem[settings.field.warehouseShelfNumber]}
409
+ </div>
410
+ <div
411
+ style={{
412
+ fontSize: 13,
413
+ fontWeight: 700,
414
+ whiteSpace: 'nowrap',
415
+ overflow: 'hidden',
416
+ textOverflow: 'ellipsis',
417
+ }}
418
+ >
419
+ {dataItem[settings.field.warehouseShelfNumberValue] ||
420
+ 'N/A'}
421
+ </div>
422
+ </Box>
423
+ )}
417
424
  </Box>
418
425
  )}
419
426
 
@@ -478,25 +485,6 @@ function ItemResult(props: Props) {
478
485
  </Box>
479
486
  </Grid>
480
487
  )}
481
- {/* <Grid item>
482
- <Box display={'flex'} alignItems={'center'}>
483
- <Button className="btn-item">
484
- <Box
485
- className=""
486
- display={'flex'}
487
- justifyContent={'center'}
488
- alignItems={'center'}
489
- >
490
- <img
491
- src={IconShare}
492
- alt="image_item"
493
- className="icon_support"
494
- style={{ width: '1rem' }}
495
- />
496
- </Box>
497
- </Button>
498
- </Box>
499
- </Grid> */}
500
488
  </Grid>
501
489
  </Box>
502
490
  )}