@centreon/ui 23.10.56 → 23.10.58
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/RichTextEditor/ContentEditable.tsx +8 -3
- package/src/RichTextEditor/RichTextEditor.cypress.spec.tsx +10 -6
- package/src/RichTextEditor/RichTextEditor.tsx +39 -1
- package/src/RichTextEditor/plugins/ToolbarPlugin/index.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/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
|
@@ -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');
|
|
@@ -63,6 +63,36 @@ const useStyles = makeStyles<{ toolbarPositions: 'start' | 'end' }>()(
|
|
|
63
63
|
paddingLeft: theme.spacing(1.5),
|
|
64
64
|
paddingTop: theme.spacing(0.5)
|
|
65
65
|
},
|
|
66
|
+
h1: {
|
|
67
|
+
fontSize: theme.typography.h1.fontSize,
|
|
68
|
+
fontWeight: theme.typography.h1.fontWeight,
|
|
69
|
+
lineHeight: theme.typography.h1.lineHeight
|
|
70
|
+
},
|
|
71
|
+
h2: {
|
|
72
|
+
fontSize: theme.typography.h2.fontSize,
|
|
73
|
+
fontWeight: theme.typography.h2.fontWeight,
|
|
74
|
+
lineHeight: theme.typography.h2.lineHeight
|
|
75
|
+
},
|
|
76
|
+
h3: {
|
|
77
|
+
fontSize: theme.typography.h3.fontSize,
|
|
78
|
+
fontWeight: theme.typography.h3.fontWeight,
|
|
79
|
+
lineHeight: theme.typography.h3.lineHeight
|
|
80
|
+
},
|
|
81
|
+
h4: {
|
|
82
|
+
fontSize: theme.typography.h4.fontSize,
|
|
83
|
+
fontWeight: theme.typography.h4.fontWeight,
|
|
84
|
+
lineHeight: theme.typography.h4.lineHeight
|
|
85
|
+
},
|
|
86
|
+
h5: {
|
|
87
|
+
fontSize: theme.typography.h5.fontSize,
|
|
88
|
+
fontWeight: theme.typography.h5.fontWeight,
|
|
89
|
+
lineHeight: theme.typography.h5.lineHeight
|
|
90
|
+
},
|
|
91
|
+
h6: {
|
|
92
|
+
fontSize: theme.typography.h6.fontSize,
|
|
93
|
+
fontWeight: theme.typography.h6.fontWeight,
|
|
94
|
+
lineHeight: theme.typography.h6.lineHeight
|
|
95
|
+
},
|
|
66
96
|
italic: {
|
|
67
97
|
fontStyle: 'italic'
|
|
68
98
|
},
|
|
@@ -101,7 +131,7 @@ const RichTextEditor = ({
|
|
|
101
131
|
onBlur,
|
|
102
132
|
contentClassName,
|
|
103
133
|
displayMacrosButton = false,
|
|
104
|
-
disabled
|
|
134
|
+
disabled,
|
|
105
135
|
openLinkInNewTab = true
|
|
106
136
|
}: RichTextEditorProps): JSX.Element => {
|
|
107
137
|
const { classes } = useStyles({ toolbarPositions });
|
|
@@ -117,6 +147,14 @@ const RichTextEditor = ({
|
|
|
117
147
|
nodes: [AutoLinkNode, LinkNode, HeadingNode, ListNode, ListItemNode],
|
|
118
148
|
onError,
|
|
119
149
|
theme: {
|
|
150
|
+
heading: {
|
|
151
|
+
h1: classes.h1,
|
|
152
|
+
h2: classes.h2,
|
|
153
|
+
h3: classes.h3,
|
|
154
|
+
h4: classes.h4,
|
|
155
|
+
h5: classes.h5,
|
|
156
|
+
h6: classes.h6
|
|
157
|
+
},
|
|
120
158
|
link: classes.link,
|
|
121
159
|
text: {
|
|
122
160
|
bold: classes.bold,
|
|
@@ -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
|