@centreon/ui 23.10.79 → 23.10.80
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
|
@@ -70,6 +70,7 @@ export const useDashboardItemStyles = makeStyles<{ hasHeader: boolean }>()(
|
|
|
70
70
|
(theme, { hasHeader }) => ({
|
|
71
71
|
widgetContainer: {
|
|
72
72
|
height: '100%',
|
|
73
|
+
paddingBottom: theme.spacing(2),
|
|
73
74
|
width: '100%'
|
|
74
75
|
},
|
|
75
76
|
widgetContent: {
|
|
@@ -89,7 +90,7 @@ export const useDashboardItemStyles = makeStyles<{ hasHeader: boolean }>()(
|
|
|
89
90
|
},
|
|
90
91
|
widgetPadding: {
|
|
91
92
|
overflowX: 'auto',
|
|
92
|
-
padding: hasHeader ? theme.spacing(1, 2,
|
|
93
|
+
padding: hasHeader ? theme.spacing(1, 2, 0) : theme.spacing(1, 2)
|
|
93
94
|
}
|
|
94
95
|
})
|
|
95
96
|
);
|
|
@@ -134,7 +134,7 @@ const ResponsiveGauge = ({
|
|
|
134
134
|
...baseStyles,
|
|
135
135
|
backgroundColor: theme.palette.background.paper,
|
|
136
136
|
color: theme.palette.text.primary,
|
|
137
|
-
transform: 'translate(-50%,
|
|
137
|
+
transform: 'translate(-50%, -24px)'
|
|
138
138
|
}}
|
|
139
139
|
top={(tooltipTop || 0) - svgTop + 20}
|
|
140
140
|
>
|
|
@@ -127,47 +127,54 @@ const ResponsiveSingleBar = ({
|
|
|
127
127
|
const springStyle = useSpring({ width: metricBarWidth });
|
|
128
128
|
|
|
129
129
|
return (
|
|
130
|
-
<
|
|
131
|
-
|
|
130
|
+
<div
|
|
131
|
+
style={{
|
|
132
132
|
height: '100%',
|
|
133
|
-
|
|
134
|
-
position: 'relative',
|
|
135
|
-
width: '100%'
|
|
133
|
+
position: 'relative'
|
|
136
134
|
}}
|
|
137
135
|
>
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
136
|
+
<Box
|
|
137
|
+
sx={{
|
|
138
|
+
height: '100%',
|
|
139
|
+
overflow: 'hidden',
|
|
140
|
+
position: 'relative',
|
|
141
|
+
width: '100%'
|
|
142
|
+
}}
|
|
143
|
+
>
|
|
144
|
+
<svg height={height} ref={svgRef} width={width}>
|
|
145
|
+
<Group.Group>
|
|
146
|
+
{text}
|
|
147
|
+
<animated.rect
|
|
148
|
+
data-testid={`${latestMetricData}-bar-${barColor}`}
|
|
149
|
+
fill={barColor}
|
|
150
|
+
height={barHeights[size]}
|
|
151
|
+
rx={4}
|
|
152
|
+
style={springStyle}
|
|
153
|
+
x={0}
|
|
154
|
+
y={groupMargin + (isSmall ? 0 : 2 * margins.top)}
|
|
155
|
+
/>
|
|
156
|
+
<Bar
|
|
157
|
+
fill="transparent"
|
|
158
|
+
height={barHeights[size]}
|
|
159
|
+
rx={4}
|
|
160
|
+
ry={4}
|
|
161
|
+
stroke={alpha(theme.palette.text.primary, 0.3)}
|
|
162
|
+
width={maxBarWidth}
|
|
163
|
+
x={0}
|
|
164
|
+
y={groupMargin + (isSmall ? 0 : 2 * margins.top)}
|
|
167
165
|
/>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
{thresholds.enabled && (
|
|
167
|
+
<Thresholds
|
|
168
|
+
hideTooltip={hideTooltip}
|
|
169
|
+
showTooltip={showTooltip}
|
|
170
|
+
size={size}
|
|
171
|
+
thresholds={thresholds}
|
|
172
|
+
xScale={xScale}
|
|
173
|
+
/>
|
|
174
|
+
)}
|
|
175
|
+
</Group.Group>
|
|
176
|
+
</svg>
|
|
177
|
+
</Box>
|
|
171
178
|
<Fade in={tooltipOpen}>
|
|
172
179
|
<Tooltip.Tooltip
|
|
173
180
|
left={tooltipLeft}
|
|
@@ -175,7 +182,7 @@ const ResponsiveSingleBar = ({
|
|
|
175
182
|
...baseStyles,
|
|
176
183
|
backgroundColor: theme.palette.background.paper,
|
|
177
184
|
color: theme.palette.text.primary,
|
|
178
|
-
transform: `translate(-50%, ${isSmall ? -
|
|
185
|
+
transform: `translate(-50%, ${isSmall ? -100 : -120}px)`,
|
|
179
186
|
zIndex: theme.zIndex.tooltip
|
|
180
187
|
}}
|
|
181
188
|
top={tooltipTop}
|
|
@@ -183,7 +190,7 @@ const ResponsiveSingleBar = ({
|
|
|
183
190
|
{tooltipData}
|
|
184
191
|
</Tooltip.Tooltip>
|
|
185
192
|
</Fade>
|
|
186
|
-
</
|
|
193
|
+
</div>
|
|
187
194
|
);
|
|
188
195
|
};
|
|
189
196
|
|
|
@@ -16,9 +16,6 @@ interface StyleProps {
|
|
|
16
16
|
const useStyles = makeStyles<StyleProps>()(
|
|
17
17
|
(theme, { minInputHeight, editable, error }) => ({
|
|
18
18
|
container: {
|
|
19
|
-
'& p': {
|
|
20
|
-
margin: 0
|
|
21
|
-
},
|
|
22
19
|
backgroundColor: theme.palette.background.paper,
|
|
23
20
|
border: error
|
|
24
21
|
? `1px solid ${theme.palette.error.main}`
|
|
@@ -41,6 +38,11 @@ const useStyles = makeStyles<StyleProps>()(
|
|
|
41
38
|
placeholder: {
|
|
42
39
|
color: theme.palette.grey[500],
|
|
43
40
|
pointerEvents: 'none'
|
|
41
|
+
},
|
|
42
|
+
root: {
|
|
43
|
+
'& p,h1,h2,h3,h4,h5,h6,span': {
|
|
44
|
+
margin: 0
|
|
45
|
+
}
|
|
44
46
|
}
|
|
45
47
|
})
|
|
46
48
|
);
|
|
@@ -121,11 +123,13 @@ const ContentEditable = ({
|
|
|
121
123
|
const shouldResetEditorToInitialState =
|
|
122
124
|
resetEditorToInitialStateCondition?.();
|
|
123
125
|
|
|
124
|
-
if (!shouldResetEditorToInitialState
|
|
126
|
+
if (!shouldResetEditorToInitialState) {
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
127
129
|
|
|
128
|
-
const newEditorState = editor.parseEditorState(
|
|
130
|
+
const newEditorState = editor.parseEditorState(
|
|
131
|
+
initialEditorState || defaultState
|
|
132
|
+
);
|
|
129
133
|
|
|
130
134
|
editor.setEditorState(newEditorState);
|
|
131
135
|
}, [editorState]);
|
|
@@ -156,7 +160,8 @@ const ContentEditable = ({
|
|
|
156
160
|
return (
|
|
157
161
|
<div
|
|
158
162
|
className={cx(
|
|
159
|
-
classes.
|
|
163
|
+
classes.root,
|
|
164
|
+
editable && classes.container,
|
|
160
165
|
className,
|
|
161
166
|
isFocused && classes.inputFocused
|
|
162
167
|
)}
|
|
@@ -67,6 +67,13 @@ withEditableFalse.args = {
|
|
|
67
67
|
initialEditorState: JSON.stringify(initialEditorState)
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
+
export const Disabled = Template.bind({});
|
|
71
|
+
Disabled.args = {
|
|
72
|
+
disabled: true,
|
|
73
|
+
editable: false,
|
|
74
|
+
editorState: JSON.stringify(initialEditorState)
|
|
75
|
+
};
|
|
76
|
+
|
|
70
77
|
const StoryWithEditableFalseLikePreview = (): JSX.Element => {
|
|
71
78
|
const [editorState, setEditorState] =
|
|
72
79
|
useState<EditorState>(initialEditorState);
|