Merge branch 'develop' into 1067-fe-hardware-monitoring-create-hardware-monitor

This commit is contained in:
Shemy Gan
2024-11-18 09:17:53 -05:00
13 changed files with 85 additions and 431 deletions

View File

@@ -37,6 +37,7 @@ const Checkbox = ({
onChange,
isDisabled,
}) => {
/* TODO move sizes to theme */
const sizes = { small: "14px", medium: "16px", large: "18px" };
const theme = useTheme();
const checkBoxPosition = typeof label === "string" ? {} : { pb: "65px" };
@@ -79,6 +80,10 @@ const Checkbox = ({
fontSize: 13,
color: theme.palette.text.tertiary,
},
".MuiFormControlLabel-label.Mui-disabled": {
color: theme.palette.text.tertiary,
opacity: 0.25,
},
}}
/>
);

View File

@@ -68,7 +68,7 @@ const Field = forwardRef(
borderColor: theme.palette.border.dark,
},
"&:has(.input-error) .MuiOutlinedInput-root fieldset": {
borderColor: theme.palette.error.contrastText,
borderColor: theme.palette.error.main,
},
display: hidden ? "none" : "",
}}
@@ -84,7 +84,7 @@ const Field = forwardRef(
<Typography
component="span"
ml={theme.spacing(1)}
color={theme.palette.error.contrastText}
color={theme.palette.error.main}
>
*
</Typography>
@@ -191,7 +191,7 @@ const Field = forwardRef(
component="span"
className="input-error"
hidden={className? true: false}
color={theme.palette.error.contrastText}
color={theme.palette.error.main}
mt={theme.spacing(2)}
sx={{
opacity: 0.8,

View File

@@ -340,7 +340,8 @@ const CreateInfrastructureMonitor = () => {
fieldValue={infrastructureMonitor[THRESHOLD_FIELD_PREFIX + type] ?? ""}
onFieldChange={handleChange}
onFieldBlur={handleBlur}
alertUnit="%"
// TODO: need BE, maybe in another PR
alertUnit={type == "temperature" ? "°C" : "%"}
infrastructureMonitor={infrastructureMonitor}
errors={errors}
/>
@@ -349,7 +350,7 @@ const CreateInfrastructureMonitor = () => {
<Typography
component="span"
className="input-error"
color={theme.palette.error.text}
color={theme.palette.error.main}
mt={theme.spacing(2)}
sx={{
opacity: 0.8,