@centreon/ui 23.10.49 → 23.10.51

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": "@centreon/ui",
3
- "version": "23.10.49",
3
+ "version": "23.10.51",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
@@ -22,6 +22,10 @@ interface Props {
22
22
 
23
23
  const useStyles = makeStyles<Pick<Props, 'width' | 'height' | 'variant'>>()(
24
24
  (_, { width, height, variant }) => ({
25
+ fallbackContainer: {
26
+ height: '100%',
27
+ width: '100%'
28
+ },
25
29
  imageContent: {
26
30
  height,
27
31
  objectFit: variant,
@@ -41,14 +45,20 @@ const ImageContent = ({
41
45
  }: Props): JSX.Element => {
42
46
  const { classes, cx } = useStyles({ height, variant, width });
43
47
  const isImageLoaded = useLoadImage({ alt, imageSrc: imagePath });
48
+
44
49
  if (!isImageLoaded) {
45
- return fallback;
50
+ return (
51
+ <div className={classes.fallbackContainer} data-testid={alt}>
52
+ {fallback}
53
+ </div>
54
+ );
46
55
  }
47
56
 
48
57
  return (
49
58
  <img
50
59
  alt={alt}
51
60
  className={cx(classes.imageContent, className)}
61
+ data-testid={alt}
52
62
  src={imagePath}
53
63
  />
54
64
  );
@@ -226,7 +226,9 @@ const Panel = React.forwardRef(
226
226
  className={classes.contentContainer}
227
227
  ref={ref as React.RefObject<HTMLDivElement>}
228
228
  >
229
- <div className={classes.content}>{selectedTab}</div>
229
+ <div className={classes.content} id="panel-content">
230
+ {selectedTab}
231
+ </div>
230
232
  </div>
231
233
  </div>
232
234
  </Paper>