Merge pull request #1865 from Owaiseimdad/FIX-1847-Incident-Page-Style-Issues
Fix 1847 incident page style issues
This commit is contained in:
3 files changed
+47
-43
No files matched your search
@@ -20,6 +20,13 @@ const OptionsHeader = ({
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const monitorNames = typeof monitors !== "undefined" ? Object.values(monitors) : [];
|
const monitorNames = typeof monitors !== "undefined" ? Object.values(monitors) : [];
|
||||||
|
|
||||||
|
// The stacks below which are three in number have the same style so
|
||||||
|
const stackStyles = {
|
||||||
|
direction: "row",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: theme.spacing(6),
|
||||||
|
};
|
||||||
|
|
||||||
if (!shouldRender) return <SkeletonLayout />;
|
if (!shouldRender) return <SkeletonLayout />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -27,17 +34,13 @@ const OptionsHeader = ({
|
|||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack {...stackStyles}>
|
||||||
direction="row"
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(6)}
|
|
||||||
>
|
|
||||||
<Typography
|
<Typography
|
||||||
display="inline-block"
|
display="inline-block"
|
||||||
component="h1"
|
component="h1"
|
||||||
color={theme.palette.primary.contrastTextSecondary}
|
color={theme.palette.primary.contrastTextSecondary}
|
||||||
>
|
>
|
||||||
Incidents for
|
Incidents for:
|
||||||
</Typography>
|
</Typography>
|
||||||
<Select
|
<Select
|
||||||
id="incidents-select-monitor"
|
id="incidents-select-monitor"
|
||||||
@@ -49,13 +52,10 @@ const OptionsHeader = ({
|
|||||||
backgroundColor: theme.palette.primary.main,
|
backgroundColor: theme.palette.primary.main,
|
||||||
color: theme.palette.primary.contrastTextSecondary,
|
color: theme.palette.primary.contrastTextSecondary,
|
||||||
}}
|
}}
|
||||||
|
truncate={true}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack
|
<Stack {...stackStyles}>
|
||||||
direction="row"
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(6)}
|
|
||||||
>
|
|
||||||
<Typography
|
<Typography
|
||||||
display="inline-block"
|
display="inline-block"
|
||||||
component="h1"
|
component="h1"
|
||||||
@@ -63,14 +63,7 @@ const OptionsHeader = ({
|
|||||||
>
|
>
|
||||||
Filter by:
|
Filter by:
|
||||||
</Typography>
|
</Typography>
|
||||||
<ButtonGroup
|
<ButtonGroup>
|
||||||
sx={{
|
|
||||||
ml: "auto",
|
|
||||||
"& .MuiButtonBase-root, & .MuiButtonBase-root:hover": {
|
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Button
|
<Button
|
||||||
variant="group"
|
variant="group"
|
||||||
filled={(filter === "all").toString()}
|
filled={(filter === "all").toString()}
|
||||||
@@ -94,11 +87,7 @@ const OptionsHeader = ({
|
|||||||
</Button>
|
</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack
|
<Stack {...stackStyles}>
|
||||||
direction="row"
|
|
||||||
alignItems="center"
|
|
||||||
gap={theme.spacing(6)}
|
|
||||||
>
|
|
||||||
<Typography
|
<Typography
|
||||||
display="inline-block"
|
display="inline-block"
|
||||||
component="h1"
|
component="h1"
|
||||||
@@ -106,14 +95,7 @@ const OptionsHeader = ({
|
|||||||
>
|
>
|
||||||
Show:
|
Show:
|
||||||
</Typography>
|
</Typography>
|
||||||
<ButtonGroup
|
<ButtonGroup>
|
||||||
sx={{
|
|
||||||
ml: "auto",
|
|
||||||
"& .MuiButtonBase-root, & .MuiButtonBase-root:hover": {
|
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Button
|
<Button
|
||||||
variant="group"
|
variant="group"
|
||||||
filled={(dateRange === "hour").toString()}
|
filled={(dateRange === "hour").toString()}
|
||||||
|
|||||||
@@ -382,6 +382,18 @@ const baseTheme = (palette) => ({
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
MuiButtonGroup: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: ({ theme }) => ({
|
||||||
|
ml: "auto",
|
||||||
|
"& .MuiButtonBase-root, & .MuiButtonBase-root:hover": {
|
||||||
|
borderColor: theme.palette.primary.lowContrast,
|
||||||
|
width: "auto",
|
||||||
|
whiteSpace: "nowrap",
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
shape: {
|
shape: {
|
||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
|
|||||||
+21
-11
@@ -4,7 +4,7 @@
|
|||||||
* @returns A string with first letter capitalized
|
* @returns A string with first letter capitalized
|
||||||
*/
|
*/
|
||||||
export const capitalizeFirstLetter = (str) => {
|
export const capitalizeFirstLetter = (str) => {
|
||||||
if (str === null || str === undefined) {
|
if (str === null || str === undefined) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if (typeof str !== "string") {
|
if (typeof str !== "string") {
|
||||||
@@ -24,13 +24,23 @@ export const capitalizeFirstLetter = (str) => {
|
|||||||
|
|
||||||
export const toLowerCaseFirstLetter = (str) => {
|
export const toLowerCaseFirstLetter = (str) => {
|
||||||
if (str === null || str === undefined) {
|
if (str === null || str === undefined) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if (typeof str !== "string") {
|
if (typeof str !== "string") {
|
||||||
throw new TypeError("Input must be a string");
|
throw new TypeError("Input must be a string");
|
||||||
}
|
}
|
||||||
if (str.length === 0) {
|
if (str.length === 0) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return str.charAt(0).toLowerCase() + str.slice(1);
|
return str.charAt(0).toLowerCase() + str.slice(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a string is null, undefined, or empty (including strings with only whitespace).
|
||||||
|
* @param {string} str - The string to check.
|
||||||
|
* @returns {boolean} - Returns true if the string is null, undefined, or empty.
|
||||||
|
*/
|
||||||
|
export const isEmpty = (str) => {
|
||||||
|
// Check if string is null, undefined, or empty (including whitespace only)
|
||||||
|
return str === null || typeof str === "undefined" || str.trim().length === 0;
|
||||||
|
};
|
||||||
Reference in new issue
Block a user