From d05821e95e1059f4640a21dc22952478fb818b3f Mon Sep 17 00:00:00 2001 From: Renato Date: Sat, 8 Mar 2025 20:43:29 +0100 Subject: [PATCH 1/3] fix: add on "status pages" table --- .../StatusPages/Components/StatusPagesTable/index.jsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx b/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx index 7c951d420..fd9b27cb1 100644 --- a/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx +++ b/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx @@ -1,7 +1,7 @@ import DataTable from "../../../../../Components/Table"; import { useTheme } from "@emotion/react"; import { useNavigate } from "react-router-dom"; -import { ColoredLabel } from "../../../../../Components/Label"; +import { StatusLabel } from "../../../../../Components/Label"; import ArrowOutwardIcon from "@mui/icons-material/ArrowOutward"; import { Stack, Typography } from "@mui/material"; const StatusPagesTable = ({ data }) => { @@ -66,12 +66,11 @@ const StatusPagesTable = ({ data }) => { id: "status", content: "Status", render: (row) => { + const status = row.isPublished ? "up" : "down"; return ( - ); }, From 85e899b7db36eeaa10888195ff4495e9193b8f7f Mon Sep 17 00:00:00 2001 From: Renato Date: Sun, 9 Mar 2025 09:50:05 +0100 Subject: [PATCH 2/3] fix: add PropTypes values --- src/Components/Label/index.jsx | 4 +++- .../StatusPages/Components/StatusPagesTable/index.jsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Components/Label/index.jsx b/src/Components/Label/index.jsx index c651b93e7..354331543 100644 --- a/src/Components/Label/index.jsx +++ b/src/Components/Label/index.jsx @@ -128,6 +128,8 @@ const statusToTheme = { paused: "warning", pending: "warning", "cannot resolve": "error", + published: "success", + unpublished: "error", }; const StatusLabel = ({ status, text, customStyles }) => { @@ -156,7 +158,7 @@ const StatusLabel = ({ status, text, customStyles }) => { }; StatusLabel.propTypes = { - status: PropTypes.oneOf(["up", "down", "paused", "pending", "cannot resolve"]), + status: PropTypes.oneOf(["up", "down", "paused", "pending", "cannot resolve", "published", "unpublished"]), text: PropTypes.string, customStyles: PropTypes.object, }; diff --git a/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx b/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx index fd9b27cb1..7bee4be8f 100644 --- a/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx +++ b/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx @@ -66,7 +66,7 @@ const StatusPagesTable = ({ data }) => { id: "status", content: "Status", render: (row) => { - const status = row.isPublished ? "up" : "down"; + const status = row.isPublished ? "published" : "unpublished"; return ( Date: Sun, 9 Mar 2025 09:58:21 +0100 Subject: [PATCH 3/3] fix: add missing statuses to component typing --- src/Components/Label/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Label/index.jsx b/src/Components/Label/index.jsx index 354331543..6ba55e81c 100644 --- a/src/Components/Label/index.jsx +++ b/src/Components/Label/index.jsx @@ -114,7 +114,7 @@ ColoredLabel.propTypes = { /** * @component * @param {Object} props - * @param { 'up' | 'down' | 'cannot resolve'} props.status - The status for the label + * @param {'up' | 'down' | 'paused' | 'pending' | 'cannot resolve' | 'published' | 'unpublished'} props.status - The status for the label * @param {string} props.text - The text of the label * @returns {JSX.Element} * @example