From 88fc158d9f0e934dccb6ac116d2f4c18d60d941f Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 24 Feb 2025 14:33:25 -0800 Subject: [PATCH 1/2] merge --- README.md | 6 +- package-lock.json | 4 + package.json | 10 +- src/Components/ActionsMenu/index.jsx | 8 +- src/Components/Subheader/index.jsx | 34 ++--- src/Features/Auth/authSlice.js | 2 +- .../infrastructureMonitorsSlice.js | 10 +- .../PageSpeedMonitor/pageSpeedMonitorSlice.js | 12 +- src/Features/Settings/settingsSlice.js | 2 +- .../UptimeMonitors/uptimeMonitorsSlice.js | 12 +- .../Details/Hooks/useSubscribeToDetails.jsx | 2 + .../Monitors/Hooks/useSubscribeToMonitors.jsx | 2 +- .../DistributedUptimeStatus/Status/index.jsx | 39 +++-- src/Pages/Infrastructure/Create/index.jsx | 4 +- src/Pages/Integrations/index.jsx | 2 +- src/Pages/Uptime/Configure/index.jsx | 26 ++-- src/Pages/Uptime/Create/index.jsx | 25 ++-- .../Uptime/Details/Hooks/useChecksFetch.jsx | 7 +- .../Monitors/Hooks/useMonitorsFetch.jsx | 1 + src/Pages/Uptime/Monitors/index.jsx | 1 - src/Utils/NetworkService.js | 12 +- src/locales/gb.json | 134 +++++++++--------- src/locales/tr.json | 124 ++++++++-------- 23 files changed, 251 insertions(+), 228 deletions(-) diff --git a/README.md b/README.md index 9c65fff7a..d93c4210e 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ If you have any questions, suggestions or comments, please use our [Discord chan ## 🤝 Contributing -We pride ourselves on building strong connections with contributors at every level. Despite being a young project, Checkmate has already earned 3700+ stars and attracted 45+ contributors from around the globe. +We pride ourselves on building strong connections with contributors at every level. Despite being a young project, Checkmate has already earned 3700+ stars and attracted 45+ contributors from around the globe. Our repo is starred by employees from **Google, Microsoft, Intel, Cisco, Tencent, Electronic Arts, ByteDance, JP Morgan Chase, Deloitte, Accenture, Foxconn, Broadcom, China Telecom, Barclays, Capgemini, Wipro, Cloudflare, Dassault Systèmes and NEC**, so don’t hold back — jump in, contribute and learn with us! @@ -138,4 +138,8 @@ Also check other developer and contributor-friendly projects of BlueWave: - [Headcount](https://github.com/bluewave-labs/bluewave-hrm), a complete Human Resource Management platform. - [Guidefox](https://github.com/bluewave-labs/guidefox), an application that helps new users learn how to use your product via hints, tours, popups and banners. - [VerifyWise](https://github.com/bluewave-labs/verifywise), the first open source AI governance platform. + <<<<<<< HEAD +======= + +> > > > > > > prism/develop diff --git a/package-lock.json b/package-lock.json index b51a3750b..48541e825 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,6 +47,10 @@ "react-toastify": "^10.0.5", "recharts": "2.15.1", "redux-persist": "6.0.0", +<<<<<<< HEAD +======= + "swiper": "11.2.4", +>>>>>>> prism/develop "vite-plugin-svgr": "^4.2.0" }, "devDependencies": { diff --git a/package.json b/package.json index 2853123a8..322ec8a8c 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,13 @@ "@emotion/styled": "^11.13.0", "@fontsource/roboto": "^5.0.13", "@hello-pangea/dnd": "^18.0.0", + "@mui/x-charts": "^7.5.1", + "@mui/x-data-grid": "7.27.0", + "@mui/x-date-pickers": "7.27.0", "@mui/icons-material": "6.4.5", "@mui/lab": "6.0.0-beta.28", "@mui/material": "6.4.5", - "@mui/x-charts": "^7.5.1", "@reduxjs/toolkit": "2.6.0", - "@mui/x-data-grid": "7.27.0", - "@mui/x-date-pickers": "7.27.0", "@solana/wallet-adapter-base": "0.9.23", "@solana/wallet-adapter-material-ui": "0.16.34", "@solana/wallet-adapter-react": "0.15.35", @@ -31,12 +31,12 @@ "axios": "^1.7.4", "dayjs": "1.11.13", "flag-icons": "7.3.2", + "jwt-decode": "^4.0.0", "html2canvas": "^1.4.1", - "maplibre-gl": "5.1.1", "i18next": "^24.2.2", "immutability-helper": "^3.1.1", "joi": "17.13.3", - "jwt-decode": "^4.0.0", + "maplibre-gl": "5.1.1", "mui-color-input": "^5.0.1", "react": "18.3.1", "react-dnd": "^16.0.1", diff --git a/src/Components/ActionsMenu/index.jsx b/src/Components/ActionsMenu/index.jsx index 9c0e19596..2f46d6bc0 100644 --- a/src/Components/ActionsMenu/index.jsx +++ b/src/Components/ActionsMenu/index.jsx @@ -31,9 +31,7 @@ const ActionsMenu = ({ event.preventDefault(); event.stopPropagation(); let monitor = { _id: actions.id }; - const action = await dispatch( - deleteUptimeMonitor({ monitor }) - ); + const action = await dispatch(deleteUptimeMonitor({ monitor })); if (action.meta.requestStatus === "fulfilled") { setIsOpen(false); // close modal updateRowCallback(); @@ -46,9 +44,7 @@ const ActionsMenu = ({ const handlePause = async () => { try { setIsLoading(true); - const action = await dispatch( - pauseUptimeMonitor({ monitorId: monitor._id }) - ); + const action = await dispatch(pauseUptimeMonitor({ monitorId: monitor._id })); if (pauseUptimeMonitor.fulfilled.match(action)) { const state = action?.payload?.data.isActive === false ? "paused" : "resumed"; createToast({ body: `Monitor ${state} successfully.` }); diff --git a/src/Components/Subheader/index.jsx b/src/Components/Subheader/index.jsx index 2ec22dcec..cad5c5795 100644 --- a/src/Components/Subheader/index.jsx +++ b/src/Components/Subheader/index.jsx @@ -13,10 +13,8 @@ import { RowContainer } from "../StandardContainer"; * @param {number} props.headerLevel - Font characteristic of the header * @param {string} props.subHeaderText - Subheader text * @param {number} props.subHeaderLevel - Font characteristic of the subheader - * @param {string} props.rightCatagoryTitle - Message for right section - * @param {number} props.rightCatagoryTitleLevel - Font characteristic of the right section header - * @param {string} props.rightDescription - Description for right section - * @param {number} props.rightDescriptionLevel - Font characteristic of the right section description + * @param {string} props.alignItems - Align items + * @param {node} props.children - Children * @returns {JSX.Element} The rendered component */ @@ -25,16 +23,14 @@ const SubHeader = ({ headerLevel = 1, subHeaderText, subHeaderLevel = 1, - rightCatagoryTitle, - rightCatagoryTitleLevel = 2, - rightDescription, - rightDescriptionLevel = 2, + alignItems = "center", + children, }) => { const theme = useTheme(); - return ( @@ -58,19 +54,7 @@ const SubHeader = ({ {subHeaderText} - - {rightCatagoryTitle && ( - - - - {rightCatagoryTitle} - - - {rightDescription} - - - - )} + {children} ); }; @@ -80,10 +64,8 @@ SubHeader.propTypes = { headerLevel: PropTypes.number, subHeaderText: PropTypes.string, subHeaderLevel: PropTypes.number, - rightCatagoryTitle: PropTypes.string, - rightCatagoryTitleLevel: PropTypes.number, - rightDescription: PropTypes.string, - rightDescriptionLevel: PropTypes.number, + alignItems: PropTypes.string, + children: PropTypes.node, }; export default SubHeader; diff --git a/src/Features/Auth/authSlice.js b/src/Features/Auth/authSlice.js index b7f0daef1..2fde49202 100644 --- a/src/Features/Auth/authSlice.js +++ b/src/Features/Auth/authSlice.js @@ -80,7 +80,7 @@ export const deleteUser = createAsyncThunk("auth/delete", async (_, thunkApi) => const user = thunkApi.getState().auth.user; try { - const res = await networkService.deleteUser({ userId: user._id, }); + const res = await networkService.deleteUser({ userId: user._id }); return res.data; } catch (error) { if (error.response && error.response.data) { diff --git a/src/Features/InfrastructureMonitors/infrastructureMonitorsSlice.js b/src/Features/InfrastructureMonitors/infrastructureMonitorsSlice.js index bb783504c..af453a7ee 100644 --- a/src/Features/InfrastructureMonitors/infrastructureMonitorsSlice.js +++ b/src/Features/InfrastructureMonitors/infrastructureMonitorsSlice.js @@ -32,7 +32,9 @@ export const checkInfrastructureEndpointResolution = createAsyncThunk( async (data, thunkApi) => { try { const { monitorURL } = data; - const res = await networkService.checkEndpointResolution({ monitorURL: monitorURL, }); + const res = await networkService.checkEndpointResolution({ + monitorURL: monitorURL, + }); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -127,7 +129,7 @@ export const deleteInfrastructureMonitor = createAsyncThunk( async (data, thunkApi) => { try { const { monitor } = data; - const res = await networkService.deleteMonitorById({ monitorId: monitor._id, }); + const res = await networkService.deleteMonitorById({ monitorId: monitor._id }); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -147,7 +149,7 @@ export const pauseInfrastructureMonitor = createAsyncThunk( async (data, thunkApi) => { try { const { monitorId } = data; - const res = await networkService.pauseMonitorById({ monitorId: monitorId, }); + const res = await networkService.pauseMonitorById({ monitorId: monitorId }); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -167,7 +169,7 @@ export const deleteInfrastructureMonitorChecksByTeamId = createAsyncThunk( async (data, thunkApi) => { try { const { teamId } = data; - const res = await networkService.deleteChecksByTeamId({ teamId: teamId, }); + const res = await networkService.deleteChecksByTeamId({ teamId: teamId }); return res.data; } catch (error) { if (error.response && error.response.data) { diff --git a/src/Features/PageSpeedMonitor/pageSpeedMonitorSlice.js b/src/Features/PageSpeedMonitor/pageSpeedMonitorSlice.js index f7a78c5fd..11cbcb36c 100644 --- a/src/Features/PageSpeedMonitor/pageSpeedMonitorSlice.js +++ b/src/Features/PageSpeedMonitor/pageSpeedMonitorSlice.js @@ -12,7 +12,7 @@ export const createPageSpeed = createAsyncThunk( async (data, thunkApi) => { try { const { monitor } = data; - const res = await networkService.createMonitor({ monitor: monitor, }); + const res = await networkService.createMonitor({ monitor: monitor }); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -32,7 +32,9 @@ export const checkEndpointResolution = createAsyncThunk( async (data, thunkApi) => { try { const { monitorURL } = data; - const res = await networkService.checkEndpointResolution({ monitorURL: monitorURL, }); + const res = await networkService.checkEndpointResolution({ + monitorURL: monitorURL, + }); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -52,7 +54,7 @@ export const getPagespeedMonitorById = createAsyncThunk( async (data, thunkApi) => { try { const { monitorId } = data; - const res = await networkService.getMonitorById({ monitorId: monitorId, }); + const res = await networkService.getMonitorById({ monitorId: monitorId }); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -124,7 +126,7 @@ export const deletePageSpeed = createAsyncThunk( async (data, thunkApi) => { try { const { monitor } = data; - const res = await networkService.deleteMonitorById({ monitorId: monitor._id, }); + const res = await networkService.deleteMonitorById({ monitorId: monitor._id }); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -143,7 +145,7 @@ export const pausePageSpeed = createAsyncThunk( async (data, thunkApi) => { try { const { monitorId } = data; - const res = await networkService.pauseMonitorById({ monitorId: monitorId, }); + const res = await networkService.pauseMonitorById({ monitorId: monitorId }); return res.data; } catch (error) { if (error.response && error.response.data) { diff --git a/src/Features/Settings/settingsSlice.js b/src/Features/Settings/settingsSlice.js index f1bda0163..a3d96ea0e 100644 --- a/src/Features/Settings/settingsSlice.js +++ b/src/Features/Settings/settingsSlice.js @@ -47,7 +47,7 @@ export const updateAppSettings = createAsyncThunk( systemEmailAddress: settings.systemEmailAddress, systemEmailPassword: settings.systemEmailPassword, }; - const res = await networkService.updateAppSettings({ settings: parsedSettings, }); + const res = await networkService.updateAppSettings({ settings: parsedSettings }); return res.data; } catch (error) { if (error.response && error.response.data) { diff --git a/src/Features/UptimeMonitors/uptimeMonitorsSlice.js b/src/Features/UptimeMonitors/uptimeMonitorsSlice.js index 84aac87a6..1679d8f50 100644 --- a/src/Features/UptimeMonitors/uptimeMonitorsSlice.js +++ b/src/Features/UptimeMonitors/uptimeMonitorsSlice.js @@ -32,7 +32,9 @@ export const checkEndpointResolution = createAsyncThunk( async (data, thunkApi) => { try { const { monitorURL } = data; - const res = await networkService.checkEndpointResolution({ monitorURL: monitorURL, }); + const res = await networkService.checkEndpointResolution({ + monitorURL: monitorURL, + }); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -52,7 +54,7 @@ export const getUptimeMonitorById = createAsyncThunk( async (data, thunkApi) => { try { const { monitorId } = data; - const res = await networkService.getMonitorById({ monitorId: monitorId, }); + const res = await networkService.getMonitorById({ monitorId: monitorId }); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -104,7 +106,7 @@ export const deleteUptimeMonitor = createAsyncThunk( async (data, thunkApi) => { try { const { monitor } = data; - const res = await networkService.deleteMonitorById({ monitorId: monitor._id, }); + const res = await networkService.deleteMonitorById({ monitorId: monitor._id }); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -124,7 +126,7 @@ export const pauseUptimeMonitor = createAsyncThunk( async (data, thunkApi) => { try { const { monitorId } = data; - const res = await networkService.pauseMonitorById({ monitorId: monitorId, }); + const res = await networkService.pauseMonitorById({ monitorId: monitorId }); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -144,7 +146,7 @@ export const deleteMonitorChecksByTeamId = createAsyncThunk( async (data, thunkApi) => { try { const { teamId } = data; - const res = await networkService.deleteChecksByTeamId({ teamId: teamId, }); + const res = await networkService.deleteChecksByTeamId({ teamId: teamId }); return res.data; } catch (error) { if (error.response && error.response.data) { diff --git a/src/Pages/DistributedUptime/Details/Hooks/useSubscribeToDetails.jsx b/src/Pages/DistributedUptime/Details/Hooks/useSubscribeToDetails.jsx index e3b4227aa..ad36c91f9 100644 --- a/src/Pages/DistributedUptime/Details/Hooks/useSubscribeToDetails.jsx +++ b/src/Pages/DistributedUptime/Details/Hooks/useSubscribeToDetails.jsx @@ -110,6 +110,8 @@ const useSubscribeToDetails = ({ monitorId, isPublic, isPublished, dateRange }) networkError, devices, isLoading, + isPublic, + isPublished, ]); useEffect(() => { diff --git a/src/Pages/DistributedUptime/Monitors/Hooks/useSubscribeToMonitors.jsx b/src/Pages/DistributedUptime/Monitors/Hooks/useSubscribeToMonitors.jsx index 6fe727efb..7c60b6ca2 100644 --- a/src/Pages/DistributedUptime/Monitors/Hooks/useSubscribeToMonitors.jsx +++ b/src/Pages/DistributedUptime/Monitors/Hooks/useSubscribeToMonitors.jsx @@ -56,7 +56,7 @@ const useSubscribeToMonitors = () => { }); setNetworkError(true); } - }, [user, getMonitorWithPercentage, theme]); + }, [user, getMonitorWithPercentage, theme, isLoading]); return [isLoading, networkError, monitors, monitorsSummary, filteredMonitors]; }; export { useSubscribeToMonitors }; diff --git a/src/Pages/DistributedUptimeStatus/Status/index.jsx b/src/Pages/DistributedUptimeStatus/Status/index.jsx index e0f6d32ae..f9a2cb2b4 100644 --- a/src/Pages/DistributedUptimeStatus/Status/index.jsx +++ b/src/Pages/DistributedUptimeStatus/Status/index.jsx @@ -17,6 +17,7 @@ import PeopleAltOutlinedIcon from "@mui/icons-material/PeopleAltOutlined"; import InfoBox from "../../../Components/InfoBox"; import StatusHeader from "../../DistributedUptime/Details/Components/StatusHeader"; import MonitorsList from "./Components/MonitorsList"; +import { RowContainer } from "../../../Components/StandardContainer"; //Utils import { useTheme } from "@mui/material/styles"; @@ -162,19 +163,27 @@ const DistributedUptimeStatus = () => { url={url} type="distributed" /> - - - + > + + + + {t("distributedRightCatagoryTitle")} + + + {t("distributedRightCatagoryDescription")} + + + + { monitor={monitor} lastUpdateTrigger={lastUpdateTrigger} /> - + + + + + { thresholds, }; - const action = await dispatch( - createInfrastructureMonitor({ monitor: form }) - ); + const action = await dispatch(createInfrastructureMonitor({ monitor: form })); if (action.meta.requestStatus === "fulfilled") { createToast({ body: "Infrastructure monitor created successfully!" }); navigate("/infrastructure"); diff --git a/src/Pages/Integrations/index.jsx b/src/Pages/Integrations/index.jsx index e74a1a450..c088afc8a 100644 --- a/src/Pages/Integrations/index.jsx +++ b/src/Pages/Integrations/index.jsx @@ -132,7 +132,7 @@ const Integrations = () => { > Integrations - Connect Checkmate to your favorite service. + Connect Prism to your favorite service. { const expectedValuePlaceholders = { regex: "^[\w.-]+@gmail.com$", equal: "janet@gmail.com", - include: "@gmail.com" + include: "@gmail.com", }; useEffect(() => { @@ -451,8 +451,8 @@ const Configure = () => { onChange={(event) => handleChange(event, "interval")} items={frequencies} /> - { - monitor.type === "http" && <> + {monitor.type === "http" && ( + <> { id="expected-value" label="Expected value" isOptional={true} - placeholder={expectedValuePlaceholders[monitor.matchMethod || "equal"]} + placeholder={ + expectedValuePlaceholders[monitor.matchMethod || "equal"] + } value={monitor.expectedValue} onChange={(event) => handleChange(event, "expectedValue")} error={errors["expectedValue"] ? true : false} @@ -442,7 +444,8 @@ const CreateMonitor = () => { color={theme.palette.primary.contrastTextTertiary} opacity={0.8} > - The expected value is used to match against response result, and the match determines the status. + The expected value is used to match against response result, and the + match determines the status. @@ -462,15 +465,21 @@ const CreateMonitor = () => { color={theme.palette.primary.contrastTextTertiary} opacity={0.8} > - This expression will be evaluated against the reponse JSON data and the result will be used to match against the expected value. See  - + This expression will be evaluated against the reponse JSON data and + the result will be used to match against the expected value. See  + jmespath.org  for query language documentation. - } + )} { +export const useChecksFetch = ({ monitorId, dateRange, page, rowsPerPage }) => { const [checks, setChecks] = useState(undefined); const [checksCount, setChecksCount] = useState(undefined); const [isLoading, setIsLoading] = useState(false); diff --git a/src/Pages/Uptime/Monitors/Hooks/useMonitorsFetch.jsx b/src/Pages/Uptime/Monitors/Hooks/useMonitorsFetch.jsx index 95782d757..1f1d15212 100644 --- a/src/Pages/Uptime/Monitors/Hooks/useMonitorsFetch.jsx +++ b/src/Pages/Uptime/Monitors/Hooks/useMonitorsFetch.jsx @@ -63,6 +63,7 @@ export const useMonitorFetch = ({ rowsPerPage, theme, triggerUpdate, + getMonitorWithPercentage, ]); return { monitors, diff --git a/src/Pages/Uptime/Monitors/index.jsx b/src/Pages/Uptime/Monitors/index.jsx index 9a5d6756f..625b1920a 100644 --- a/src/Pages/Uptime/Monitors/index.jsx +++ b/src/Pages/Uptime/Monitors/index.jsx @@ -124,7 +124,6 @@ const UptimeMonitors = () => { !monitorsAreLoading && (totalMonitors === 0 || typeof totalMonitors === "undefined") ) { - return ( Date: Mon, 24 Feb 2025 14:35:33 -0800 Subject: [PATCH 2/2] Update README.md --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index d93c4210e..68216c880 100644 --- a/README.md +++ b/README.md @@ -138,8 +138,3 @@ Also check other developer and contributor-friendly projects of BlueWave: - [Headcount](https://github.com/bluewave-labs/bluewave-hrm), a complete Human Resource Management platform. - [Guidefox](https://github.com/bluewave-labs/guidefox), an application that helps new users learn how to use your product via hints, tours, popups and banners. - [VerifyWise](https://github.com/bluewave-labs/verifywise), the first open source AI governance platform. - <<<<<<< HEAD - -======= - -> > > > > > > prism/develop