Skip to content

Commit

Permalink
fix(frontend): Handle no error case on errors page (#378)
Browse files Browse the repository at this point in the history
fix(frontend): handle no error case on errors page

Co-authored-by: alice.juan <alice.juan@student-cs.fr>
  • Loading branch information
Piv94165 and alice.juan authored Feb 1, 2024
1 parent 444f76d commit 054cf8c
Showing 1 changed file with 40 additions and 26 deletions.
66 changes: 40 additions & 26 deletions taxonomy-editor-frontend/src/pages/errors/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
TableBody,
TableHead,
TableContainer,
Stack,
} from "@mui/material";
import MaterialTable from "@material-table/core";
import { Alert, CircularProgress } from "@mui/material";
Expand Down Expand Up @@ -91,33 +92,46 @@ const Errors = ({ addNavLinks }) => {
</TableBody>
</Table>
</TableContainer>
<Alert severity="warning">
These errors must be fixed manually via Github!
</Alert>
<Box
sx={{
border: "solid",
borderWidth: 1.5,
}}
<Stack
sx={{ display: "flex", flexDirection: "column", alignItems: "center" }}
>
<MaterialTable
data={errors}
columns={[
{
title: "No.",
field: "id",
width: "10%",
},
{ title: "Error", field: "error" },
]}
title="Errors"
options={{
tableLayout: "fixed",
pageSize: 50,
pageSizeOptions: ["20", "50", "100", "200"],
}}
/>
</Box>
{errors.length > 0 && (
<>
<Alert severity="warning">
These errors must be fixed manually via Github!
</Alert>
<Box
sx={{
border: "solid",
borderWidth: 1.5,
}}
>
<MaterialTable
data={errors}
columns={[
{
title: "No.",
field: "id",
width: "10%",
},
{ title: "Error", field: "error" },
]}
title="Errors"
options={{
tableLayout: "fixed",
pageSize: 50,
pageSizeOptions: ["20", "50", "100", "200"],
}}
/>
</Box>
</>
)}
{errors.length === 0 && (
<Typography>
No Error, {toTitleCase(taxonomyName)} can be edited
</Typography>
)}
</Stack>
</Box>
);
};
Expand Down

0 comments on commit 054cf8c

Please sign in to comment.