@centreon/ui 23.10.1-MON-21543-implement-top-bottom-widget.2 → 23.10.1-MON-21543-implement-top-bottom-widget.3

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.1-MON-21543-implement-top-bottom-widget.2",
3
+ "version": "23.10.1-MON-21543-implement-top-bottom-widget.3",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
@@ -14,6 +14,7 @@ import {
14
14
  } from '../common/timeSeries';
15
15
  import { Metric } from '../common/timeSeries/models';
16
16
  import { getColorFromDataAndTresholds } from '../common/utils';
17
+ import { margins } from '../common/margins';
17
18
 
18
19
  import { SingleBarProps } from './models';
19
20
  import Thresholds, { groupMargin } from './Thresholds';
@@ -137,7 +138,7 @@ const ResponsiveSingleBar = ({
137
138
  rx={4}
138
139
  style={springStyle}
139
140
  x={0}
140
- y={groupMargin}
141
+ y={groupMargin + (isSmall ? 0 : 2 * margins.top)}
141
142
  />
142
143
  <Bar
143
144
  fill="transparent"
@@ -147,7 +148,7 @@ const ResponsiveSingleBar = ({
147
148
  stroke={alpha(theme.palette.text.primary, 0.3)}
148
149
  width={maxBarWidth}
149
150
  x={0}
150
- y={groupMargin}
151
+ y={groupMargin + (isSmall ? 0 : 2 * margins.top)}
151
152
  />
152
153
  {thresholds.enabled && (
153
154
  <Thresholds
@@ -2,6 +2,8 @@ import { equals } from 'ramda';
2
2
 
3
3
  import { useTheme } from '@mui/material';
4
4
 
5
+ import { margins } from '../common/margins';
6
+
5
7
  import { groupMargin } from './Thresholds';
6
8
 
7
9
  export const barHeights = {
@@ -66,11 +68,15 @@ export const ThresholdLine = ({
66
68
  strokeWidth={2}
67
69
  x1={scaledValue}
68
70
  x2={scaledValue}
69
- y1={isSmall ? groupMargin - lineMargin : groupMargin + 3 * lineMargin}
71
+ y1={
72
+ isSmall
73
+ ? groupMargin - lineMargin
74
+ : groupMargin + lineMargin + margins.top
75
+ }
70
76
  y2={
71
77
  isSmall
72
78
  ? thresholdLineHeight + groupMargin - lineMargin
73
- : groupMargin + 3 * lineMargin
79
+ : thresholdLineHeight + groupMargin + lineMargin + margins.top
74
80
  }
75
81
  />
76
82
  <line
@@ -79,11 +85,15 @@ export const ThresholdLine = ({
79
85
  strokeWidth={5}
80
86
  x1={scaledValue}
81
87
  x2={scaledValue}
82
- y1={isSmall ? groupMargin - lineMargin : groupMargin + 3 * lineMargin}
88
+ y1={
89
+ isSmall
90
+ ? groupMargin - lineMargin
91
+ : groupMargin + lineMargin + margins.top
92
+ }
83
93
  y2={
84
94
  isSmall
85
95
  ? thresholdLineHeight + groupMargin - lineMargin
86
- : groupMargin + 3 * lineMargin
96
+ : thresholdLineHeight + groupMargin + lineMargin + margins.top
87
97
  }
88
98
  onMouseEnter={onMouseEnter(scaledValue)}
89
99
  onMouseLeave={hideTooltip}