@centreon/ui 25.10.29 → 25.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui",
3
- "version": "25.10.29",
3
+ "version": "25.11.0",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "update:deps": "pnpx npm-check-updates -i --format group",
@@ -46,7 +46,7 @@ export const getYAnchorPoint = ({
46
46
  return null;
47
47
  }
48
48
 
49
- return yScale(timeValue[1] as number);
49
+ return yScale(timeValue[0] as number);
50
50
  };
51
51
 
52
52
  const StackedAnchorPoint = ({
@@ -9,9 +9,11 @@ import {
9
9
  find,
10
10
  isEmpty,
11
11
  isNil,
12
+ isNotNil,
12
13
  keys,
13
14
  map,
14
15
  negate,
16
+ omit,
15
17
  pick,
16
18
  pipe,
17
19
  pluck,
@@ -212,6 +214,39 @@ const InteractionWithGraph = ({
212
214
  yScalesPerUnit
213
215
  });
214
216
 
217
+ if (isNotNil(lineData?.stackOrder)) {
218
+ const test = Object.entries(omit(['timeTick'], timeValue)).reduce(
219
+ (acc, [key, value]) => {
220
+ const line = getLineForMetric({
221
+ lines,
222
+ metric_id: Number(key)
223
+ });
224
+
225
+ const isBelowStackOrder =
226
+ isNotNil(line?.stackOrder) &&
227
+ (line?.stackOrder as number) >= (lineData.stackOrder as number);
228
+
229
+ if (isBelowStackOrder) {
230
+ return acc + value;
231
+ }
232
+
233
+ return acc;
234
+ },
235
+ 0
236
+ );
237
+
238
+ const y0 = yScale(test);
239
+
240
+ const diffBetweenY0AndPointPosition = Math.abs(
241
+ y0 - margin.top - (graphHeight - pointPosition[1])
242
+ );
243
+
244
+ return {
245
+ ...acc,
246
+ [metricId]: diffBetweenY0AndPointPosition
247
+ };
248
+ }
249
+
215
250
  const y0 = yScale(value);
216
251
 
217
252
  const diffBetweenY0AndPointPosition = Math.abs(
@@ -107,14 +107,16 @@ const PickersStartEndDate = ({
107
107
  const maxEnd = rangeEndDate?.max;
108
108
  const minEnd = rangeEndDate?.min || startDate;
109
109
 
110
- const isColumn = equals(direction, PickersStartEndDateDirection.column)
110
+ const isColumn = equals(direction, PickersStartEndDateDirection.column);
111
111
 
112
112
  return (
113
113
  <LocalizationProvider
114
114
  adapterLocale={locale.substring(0, 2)}
115
115
  dateAdapter={AdapterDayjs}
116
116
  >
117
- <div className={`flex ${isColumn ? 'flex-col justify-center' : 'flex-row items-center py-2 px-4'} gap-2 ${className}`}>
117
+ <div
118
+ className={`flex ${isColumn ? 'flex-col justify-center' : 'flex-row items-center py-2 px-4'} gap-2 ${className}`}
119
+ >
118
120
  <PickerDateWithLabel
119
121
  changeDate={changeDate}
120
122
  date={startDate}