@centreon/ui 23.10.57 → 23.10.59
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 +3 -1
- package/src/Graph/Gauge/AnimatedPie.tsx +87 -0
- package/src/Graph/Gauge/Gauge.stories.tsx +45 -0
- package/src/Graph/Gauge/Gauge.tsx +44 -0
- package/src/Graph/Gauge/PieData.tsx +79 -0
- package/src/Graph/Gauge/ResponsiveGauge.tsx +135 -0
- package/src/Graph/Gauge/Thresholds.tsx +87 -0
- package/src/Graph/Gauge/index.ts +1 -0
- package/src/Graph/Gauge/models.ts +20 -0
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Axes/index.tsx +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Axes/models.ts +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Axes/useAxisY.ts +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/RegularLines/index.tsx +2 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/RegularLines/useRegularLines.ts +2 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/StackedLines/index.tsx +2 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/StackedLines/useStackedLines.ts +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/BasicThreshold.tsx +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/ThresholdWithPatternLines.tsx +3 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/ThresholdWithVariation.tsx +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/index.tsx +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/models.ts +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/useScaleThreshold.ts +2 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/index.tsx +6 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/models.ts +3 -3
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/useFilterLines.ts +1 -1
- package/src/Graph/{Header → LineChart/Header}/index.tsx +4 -4
- package/src/Graph/{Icons → LineChart/Icons}/Downtime.tsx +1 -1
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/RegularAnchorPoint.tsx +2 -2
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/StackedAnchorPoint.tsx +2 -2
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/models.ts +1 -1
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/useTickGraph.ts +2 -2
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Tooltip/useGraphTooltip.ts +1 -1
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/index.tsx +2 -2
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/interactionWithGraphAtoms.ts +1 -1
- package/src/Graph/{Legend → LineChart/Legend}/LegendHeader.tsx +1 -1
- package/src/Graph/{Legend → LineChart/Legend}/index.tsx +2 -2
- package/src/Graph/{Legend → LineChart/Legend}/useInteractiveValues.ts +6 -2
- package/src/Graph/{Legend → LineChart/Legend}/useLegend.ts +1 -1
- package/src/Graph/{Graph.tsx → LineChart/LineChart.tsx} +8 -7
- package/src/Graph/{graphAtoms.ts → LineChart/graphAtoms.ts} +1 -1
- package/src/Graph/{helpers → LineChart/helpers}/index.ts +9 -4
- package/src/Graph/{index.stories.tsx → LineChart/index.stories.tsx} +39 -38
- package/src/Graph/{index.tsx → LineChart/index.tsx} +14 -12
- package/src/Graph/{models.ts → LineChart/models.ts} +8 -12
- package/src/Graph/{useGraphData.ts → LineChart/useLineChartData.ts} +5 -3
- package/src/Graph/SingleBar/ResponsiveSingleBar.tsx +163 -0
- package/src/Graph/SingleBar/SingleBar.stories.tsx +45 -0
- package/src/Graph/SingleBar/SingleBar.tsx +25 -0
- package/src/Graph/SingleBar/Thresholds.tsx +100 -0
- package/src/Graph/SingleBar/index.ts +1 -0
- package/src/Graph/SingleBar/models.ts +8 -0
- package/src/Graph/Text/Text.stories.tsx +54 -0
- package/src/Graph/Text/Text.styles.ts +17 -0
- package/src/Graph/Text/Text.tsx +80 -0
- package/src/Graph/Text/index.ts +1 -0
- package/src/Graph/common/margins.ts +1 -0
- package/src/Graph/common/models.ts +7 -0
- package/src/Graph/{timeSeries → common/timeSeries}/index.test.ts +2 -2
- package/src/Graph/{timeSeries → common/timeSeries}/index.ts +22 -6
- package/src/Graph/{timeSeries → common/timeSeries}/models.ts +2 -0
- package/src/Graph/common/utils.ts +20 -0
- package/src/Graph/index.ts +4 -0
- package/src/InputField/Select/Autocomplete/Connected/Multi/MultiConnectedAutocompleteField.cypress.spec.tsx +4 -6
- package/src/Listing/Listing.cypress.spec.tsx +2 -2
- package/src/RichTextEditor/RichTextEditor.cypress.spec.tsx +10 -6
- package/src/TimePeriods/ResolutionTimePeriod.cypress.spec.tsx +1 -1
- package/src/TimePeriods/TimePeriods.cypress.spec.tsx +1 -1
- package/src/api/useGraphQuery/index.ts +7 -4
- package/src/components/CollapsibleItem/useCollapsibleItemStyles.ts +1 -0
- package/src/index.ts +3 -2
- package/src/utils/useLicenseExpirationWarning.cypress.spec.tsx +1 -1
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Axes/UnitLabel.tsx +0 -0
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Grids/index.tsx +0 -0
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/Circle.tsx +0 -0
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/helpers/index.ts +0 -0
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/useCoordinateCircle.ts +0 -0
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/LoadingProgress.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/GuidingLines.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/TooltipAnchorPoint.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/useTooltipAnchorPoint.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Annotation/Area.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Annotation/Line.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Annotation/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Area/Downtime.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/EventAnnotations.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Line/Acknowledgement.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Line/Comments.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/annotationsAtoms.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/models.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/useAnnotation.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Bar.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/TimeShiftZones/TimeShiftIcon.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/TimeShiftZones/TimeShiftZone.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/TimeShiftZones/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/TimeShiftZones/models.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/TimeShiftZones/useTimeShiftZones.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Tooltip/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Tooltip/models.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/models.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/useZoomPreview.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/zoomPreviewAtoms.ts +0 -0
- /package/src/Graph/{Legend → LineChart/Legend}/InteractiveValue.tsx +0 -0
- /package/src/Graph/{Legend → LineChart/Legend}/Legend.styles.ts +0 -0
- /package/src/Graph/{Legend → LineChart/Legend}/LegendContent.tsx +0 -0
- /package/src/Graph/{Legend → LineChart/Legend}/Marker.tsx +0 -0
- /package/src/Graph/{Legend → LineChart/Legend}/models.ts +0 -0
- /package/src/Graph/{Graph.styles.ts → LineChart/LineChart.styles.ts} +0 -0
- /package/src/Graph/{LoadingSkeleton.tsx → LineChart/LoadingSkeleton.tsx} +0 -0
- /package/src/Graph/{common → LineChart/common}/index.ts +0 -0
- /package/src/Graph/{helpers → LineChart/helpers}/doc.ts +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/annotationData.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/exclusionPeriodFirstPeriod.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/exclusionPeriodSecondPeriod.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/exclusionPeriodThirdPeriod.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastDay.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastDayAreaStack.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastDayForward.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastDayThreshold.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastMonth.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastWeek.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/zoomPreview.json +0 -0
- /package/src/Graph/{translatedLabels.ts → LineChart/translatedLabels.ts} +0 -0
- /package/src/Graph/{useGraphIntersection.ts → LineChart/useLineChartIntersection.ts} +0 -0
|
@@ -73,15 +73,13 @@ describe('Multi connected autocomplete', () => {
|
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
cy.
|
|
77
|
-
'displays the list when the user clicks on the input'
|
|
78
|
-
);
|
|
76
|
+
cy.makeSnapshot('displays the list when the user clicks on the input');
|
|
79
77
|
|
|
80
78
|
cy.get('@input').click();
|
|
81
79
|
|
|
82
80
|
cy.get('@listOptions').should('not.exist');
|
|
83
81
|
|
|
84
|
-
cy.
|
|
82
|
+
cy.makeSnapshot('hides the list when the user clicks on the input');
|
|
85
83
|
});
|
|
86
84
|
|
|
87
85
|
it('displays exactly one option on the list when the user types that option', () => {
|
|
@@ -109,7 +107,7 @@ describe('Multi connected autocomplete', () => {
|
|
|
109
107
|
cy.contains(optionOne).should('be.visible');
|
|
110
108
|
});
|
|
111
109
|
|
|
112
|
-
cy.
|
|
110
|
+
cy.makeSnapshot();
|
|
113
111
|
});
|
|
114
112
|
|
|
115
113
|
it('displays all options on the list when the user searches for and selects an option', () => {
|
|
@@ -156,6 +154,6 @@ describe('Multi connected autocomplete', () => {
|
|
|
156
154
|
});
|
|
157
155
|
});
|
|
158
156
|
|
|
159
|
-
cy.
|
|
157
|
+
cy.makeSnapshot();
|
|
160
158
|
});
|
|
161
159
|
});
|
|
@@ -105,7 +105,7 @@ describe('Listing', () => {
|
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
cy.
|
|
108
|
+
cy.makeSnapshot();
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
it('collapses the row when the corresponding icon si clicked', () => {
|
|
@@ -115,6 +115,6 @@ describe('Listing', () => {
|
|
|
115
115
|
|
|
116
116
|
cy.contains('Sub item 100').should('not.exist');
|
|
117
117
|
|
|
118
|
-
cy.
|
|
118
|
+
cy.makeSnapshot();
|
|
119
119
|
});
|
|
120
120
|
});
|
|
@@ -187,9 +187,11 @@ describe('Rich Text Editor', () => {
|
|
|
187
187
|
});
|
|
188
188
|
|
|
189
189
|
it('displays editor when editable props is false and an initialState exist', () => {
|
|
190
|
-
cy.get('[data-testid="RichTextEditor"]')
|
|
191
|
-
.
|
|
192
|
-
|
|
190
|
+
cy.get('[data-testid="RichTextEditor"]').should(
|
|
191
|
+
'have.attr',
|
|
192
|
+
'contenteditable',
|
|
193
|
+
'false'
|
|
194
|
+
);
|
|
193
195
|
cy.findByLabelText('Undo').should('not.exist');
|
|
194
196
|
cy.findByLabelText('Redo').should('not.exist');
|
|
195
197
|
cy.findByLabelText('bold').should('not.exist');
|
|
@@ -214,9 +216,11 @@ describe('Rich Text Editor', () => {
|
|
|
214
216
|
});
|
|
215
217
|
|
|
216
218
|
it('displays editor when editable props is false and an initialState exist', () => {
|
|
217
|
-
cy.get('[data-testid="RichTextEditor"]')
|
|
218
|
-
.
|
|
219
|
-
|
|
219
|
+
cy.get('[data-testid="RichTextEditor"]').should(
|
|
220
|
+
'have.attr',
|
|
221
|
+
'contenteditable',
|
|
222
|
+
'false'
|
|
223
|
+
);
|
|
220
224
|
cy.findByLabelText('Undo').should('be.disabled');
|
|
221
225
|
cy.findByLabelText('Redo').should('be.disabled');
|
|
222
226
|
cy.findByLabelText('bold').should('be.disabled');
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { T, always, cond, flatten, isEmpty, join, pipe, pluck } from 'ramda';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { LineChartData, useFetchQuery } from '../..';
|
|
5
5
|
|
|
6
6
|
import { ServiceMetric } from './models';
|
|
7
7
|
|
|
8
8
|
interface UseMetricsQueryProps {
|
|
9
9
|
baseEndpoint: string;
|
|
10
10
|
metrics: Array<ServiceMetric>;
|
|
11
|
+
refreshInterval?: number | false;
|
|
11
12
|
timePeriod?: TimePeriod;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
interface UseMetricsQueryState {
|
|
15
16
|
end: string;
|
|
16
|
-
graphData:
|
|
17
|
+
graphData: LineChartData | undefined;
|
|
17
18
|
isGraphLoading: boolean;
|
|
18
19
|
isMetricIdsEmpty: boolean;
|
|
19
20
|
start: string;
|
|
@@ -37,14 +38,15 @@ const getStartEndFromTimePeriod = (
|
|
|
37
38
|
])(timePeriod);
|
|
38
39
|
};
|
|
39
40
|
|
|
40
|
-
interface PerformanceGraphData extends Omit<
|
|
41
|
+
interface PerformanceGraphData extends Omit<LineChartData, 'global'> {
|
|
41
42
|
base: number;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
const useGraphQuery = ({
|
|
45
46
|
metrics,
|
|
46
47
|
baseEndpoint,
|
|
47
|
-
timePeriod = TimePeriod.lastDay
|
|
48
|
+
timePeriod = TimePeriod.lastDay,
|
|
49
|
+
refreshInterval = false
|
|
48
50
|
}: UseMetricsQueryProps): UseMetricsQueryState => {
|
|
49
51
|
const metricIds = pipe(
|
|
50
52
|
pluck('metrics'),
|
|
@@ -65,6 +67,7 @@ const useGraphQuery = ({
|
|
|
65
67
|
getQueryKey: () => ['graph', metricIds],
|
|
66
68
|
queryOptions: {
|
|
67
69
|
enabled: !isEmpty(metricIds),
|
|
70
|
+
refetchInterval: refreshInterval,
|
|
68
71
|
suspense: false
|
|
69
72
|
}
|
|
70
73
|
});
|
package/src/index.ts
CHANGED
|
@@ -144,5 +144,6 @@ export type { ResponseError, CatchErrorProps } from './api/customFetch';
|
|
|
144
144
|
export * from './utils';
|
|
145
145
|
export { default as FluidTypography } from './Typography/FluidTypography';
|
|
146
146
|
export * from './Dashboard';
|
|
147
|
-
export
|
|
148
|
-
export type {
|
|
147
|
+
export * from './Graph';
|
|
148
|
+
export type { LineChartData } from './Graph/common/models';
|
|
149
|
+
export * from './Graph/common/timeSeries';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/helpers/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/index.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/index.tsx
RENAMED
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/models.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Tooltip/index.tsx
RENAMED
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Tooltip/models.ts
RENAMED
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/index.tsx
RENAMED
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/models.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|