-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/fe/consistent initial state #1663
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a90ed64
fix monitorStatusHeader name, safe property access
ajhollid cadb9bb
provide default values for pagination
ajhollid 65c909e
provide default props for Table
ajhollid 6788b56
add ref to stop initial search
ajhollid ef28f8c
simplify UptimeDataTable
ajhollid 12711e8
set initial state explicitly to for consistency
ajhollid a985178
Use MonitorCountHeader, initialze state to undefined'
ajhollid cfb5c7a
Update hooks to use undefined for initial state
ajhollid 4c3b348
safe param access
ajhollid 80a16ef
safe param access
ajhollid 0feb205
remove null return
ajhollid c1fa39f
move fallback css to fallback css file
ajhollid d2d2e87
Add a network fallback component
ajhollid 4559215
add network error state to hooks
ajhollid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { useTheme } from "@emotion/react"; | ||
import { Box, Stack, Typography } from "@mui/material"; | ||
import Skeleton from "../../assets/Images/create-placeholder.svg?react"; | ||
import SkeletonDark from "../../assets/Images/create-placeholder-dark.svg?react"; | ||
import Background from "../../assets/Images/background-grid.svg?react"; | ||
import { useSelector } from "react-redux"; | ||
|
||
/** | ||
* Fallback component to display a fallback UI for network errors | ||
* | ||
* @returns {JSX.Element} The rendered fallback UI. | ||
*/ | ||
|
||
const NetworkErrorFallback = () => { | ||
const theme = useTheme(); | ||
const mode = useSelector((state) => state.ui.mode); | ||
|
||
return ( | ||
<Box | ||
className="page-speed" | ||
position="relative" | ||
border={1} | ||
borderColor={theme.palette.primary.lowContrast} | ||
borderRadius={theme.shape.borderRadius} | ||
backgroundColor={theme.palette.primary.main} | ||
overflow="hidden" | ||
sx={{ | ||
borderStyle: "dashed", | ||
}} | ||
> | ||
<Stack | ||
alignItems="center" | ||
gap={theme.spacing(20)} | ||
sx={{ | ||
width: "fit-content", | ||
margin: "auto", | ||
marginTop: "100px", | ||
}} | ||
> | ||
{mode === "light" ? ( | ||
<Skeleton style={{ zIndex: 1 }} /> | ||
) : ( | ||
<SkeletonDark style={{ zIndex: 1 }} /> | ||
)} | ||
<Box | ||
sx={{ | ||
"& svg g g:last-of-type path": { | ||
stroke: theme.palette.primary.lowContrast, | ||
}, | ||
position: "absolute", | ||
top: "0", | ||
left: "50%", | ||
transform: "translate(-50%, -50%)", | ||
width: "100%", | ||
maxWidth: "800px", | ||
height: "100%", | ||
maxHeight: "800px", | ||
backgroundPosition: "center", | ||
backgroundSize: "cover", | ||
backgroundRepeat: "no-repeat", | ||
}} | ||
> | ||
<Background style={{ width: "100%" }} /> | ||
</Box> | ||
<Stack | ||
gap={theme.spacing(4)} | ||
alignItems="center" | ||
maxWidth={"300px"} | ||
zIndex={1} | ||
> | ||
<Typography | ||
variant="h1" | ||
marginY={theme.spacing(4)} | ||
color={theme.palette.primary.contrastTextTertiary} | ||
> | ||
Network error | ||
</Typography> | ||
<Typography>Please check your connection</Typography> | ||
</Stack> | ||
</Stack> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default NetworkErrorFallback; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Yo dawg, let's make this string parsing more robust! 💪
The current string parsing logic could use some love:
Here's a cleaner approach:
📝 Committable suggestion
🧰 Tools
🪛 Biome (1.9.4)
[error] 37-37: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.
(lint/suspicious/noAssignInExpressions)
[error] 37-37: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.
(lint/suspicious/noAssignInExpressions)