@nyris/nyris-webapp 0.3.22 → 0.3.23

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.22",
3
+ "version": "0.3.23",
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.19",
16
- "@nyris/nyris-react-components": "^0.3.22",
15
+ "@nyris/nyris-api": "^0.3.23",
16
+ "@nyris/nyris-react-components": "^0.3.23",
17
17
  "@reduxjs/toolkit": "^1.6.1",
18
18
  "@splidejs/react-splide": "^0.7.12",
19
19
  "@types/blueimp-load-image": "^2.23.4",
@@ -13,6 +13,7 @@ import { AppState } from 'types';
13
13
  import { useAppSelector } from 'Store/Store';
14
14
  import { prepareImageList } from '../helpers/CommonHelper';
15
15
  import KeyboardArrowUpIcon from '@material-ui/icons/KeyboardArrowUp';
16
+ import NoImage from '../common/assets/images/unnamed.png';
16
17
 
17
18
  interface Props {
18
19
  numberResult?: number;
@@ -87,13 +88,29 @@ function DetailItem(props: Props) {
87
88
  </Button>
88
89
  </Box>
89
90
  <Box style={{ overflowY: 'auto', maxHeight: '90svh' }}>
90
- <Box className="box-carosel">
91
- <ImagePreviewCarousel
92
- imgItem={dataImageCarousel}
93
- onSearchImage={onSearchImage}
94
- handlerCloseModal={() => handlerCloseModal?.()}
95
- />
96
- {!isMobile && (
91
+ <Box
92
+ className="box-carosel"
93
+ style={
94
+ dataImageCarousel.length === 0
95
+ ? { display: 'flex', justifyContent: 'center' }
96
+ : {}
97
+ }
98
+ >
99
+ {dataImageCarousel.length > 0 ? (
100
+ <ImagePreviewCarousel
101
+ imgItem={dataImageCarousel}
102
+ onSearchImage={onSearchImage}
103
+ handlerCloseModal={() => handlerCloseModal?.()}
104
+ />
105
+ ) : (
106
+ <img
107
+ src={NoImage}
108
+ alt="image_item"
109
+ className="img-style"
110
+ style={{ width: '300px', height: '300px', padding: '8px' }}
111
+ />
112
+ )}
113
+ {!isMobile && dataImageCarousel.length > 0 && (
97
114
  <Button
98
115
  className="icon-style"
99
116
  onClick={() => {
@@ -145,7 +145,7 @@ function ItemResult(props: Props) {
145
145
  </Button>
146
146
  </Box>
147
147
  )}
148
- {!isHover && urlImage?.length > 1 && (
148
+ {!isHover && (
149
149
  <Box className="box-icon-modal">
150
150
  <Button
151
151
  style={{ width: '100%', height: '100%', padding: 0, zIndex: 9 }}
@@ -178,7 +178,7 @@ function ItemResult(props: Props) {
178
178
  src={NoImage}
179
179
  alt="image_item"
180
180
  className="img-style"
181
- style={{ width: '100%', height: '100%' }}
181
+ style={{ width: '100%', height: '100%', objectFit: "cover" }}
182
182
  />
183
183
  )}
184
184
  </Button>
@@ -14,15 +14,19 @@ export const prepareImageList = (dataItem: any) => {
14
14
  key?.includes('additional_image_link')
15
15
  ) {
16
16
  if (!isEmpty(newObject[key])) {
17
- valueKey.push({
18
- url: newObject[key],
19
- });
17
+ if (newObject[key]) {
18
+ valueKey.push({
19
+ url: newObject[key],
20
+ });
21
+ }
20
22
  }
21
23
  } else {
22
24
  if (key === 'image(main_similarity)' || key === 'main_image_link') {
23
- valueKey.push({
24
- url: newObject[key],
25
- });
25
+ if (newObject[key]) {
26
+ valueKey.push({
27
+ url: newObject[key],
28
+ });
29
+ }
26
30
  }
27
31
  }
28
32
  }
@@ -54,7 +54,7 @@ export const useVisualSearch = () => {
54
54
  }
55
55
  const preFilter = [
56
56
  {
57
- key: settings.filterType,
57
+ key: settings.visualSearchFilterKey,
58
58
  values: [`${keyFilter}`],
59
59
  },
60
60
  ];
@@ -74,7 +74,7 @@ function ResultComponent(props: Props) {
74
74
  async (canvas: any, r?: RectCoords) => {
75
75
  const preFilter = [
76
76
  {
77
- key: settings.filterType,
77
+ key: settings.visualSearchFilterKey,
78
78
  values: [`${keyFilter}`],
79
79
  },
80
80
  ];
@@ -148,7 +148,7 @@ function ResultComponent(props: Props) {
148
148
  }
149
149
  const preFilter = [
150
150
  {
151
- key: settings.filterType,
151
+ key: settings.visualSearchFilterKey,
152
152
  values: [`${keyFilter}`],
153
153
  },
154
154
  ];