diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index 8417b823f..4d2de7041 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -1,9 +1,26 @@ -name: Build Check ( Server) +name: Build Check (Client & Server) on: pull_request: workflow_dispatch: jobs: + build-client: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install client dependencies + working-directory: client + run: npm install + + - name: Check client build + working-directory: client + run: npm run build build-server: runs-on: ubuntu-latest steps: diff --git a/client/package.json b/client/package.json index 3108f7121..9ebc99647 100644 --- a/client/package.json +++ b/client/package.json @@ -5,8 +5,8 @@ "type": "module", "scripts": { "dev": "vite", - "build": "vite build", - "build-dev": "vite build --mode development", + "build": "tsc -b && vite build", + "build-dev": "tsc -b && vite build --mode development", "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "format": "prettier --write .", diff --git a/client/src/Components/ActionsMenu/index.jsx b/client/src/Components/ActionsMenu/index.jsx index 1b590a471..78d86e1b2 100644 --- a/client/src/Components/ActionsMenu/index.jsx +++ b/client/src/Components/ActionsMenu/index.jsx @@ -12,7 +12,7 @@ import { useNavigate } from "react-router-dom"; import { createToast } from "../../Utils/toastUtils"; import PropTypes from "prop-types"; -import { usePauseMonitor, useDeleteMonitor } from "../../Hooks/monitorHooks"; +import { usePauseMonitor, useDeleteMonitor } from "../../Hooks/v1/monitorHooks.js"; const ActionsMenu = ({ monitor, diff --git a/client/src/Components/MonitorActions/index.jsx b/client/src/Components/MonitorActions/index.jsx index ac5d89a47..9e88e26c5 100644 --- a/client/src/Components/MonitorActions/index.jsx +++ b/client/src/Components/MonitorActions/index.jsx @@ -11,7 +11,7 @@ import MenuList from "@mui/material/MenuList"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { createToast } from "../../Utils/toastUtils"; -import { useExportMonitors } from "../../Hooks/monitorHooks"; +import { useExportMonitors } from "../../Hooks/v1/monitorHooks.js"; const MonitorActions = ({ isLoading }) => { const [open, setOpen] = React.useState(false); diff --git a/client/src/Components/MonitorDetailsControlHeader/index.jsx b/client/src/Components/MonitorDetailsControlHeader/index.jsx index 4674a1fb7..cd56394f4 100644 --- a/client/src/Components/MonitorDetailsControlHeader/index.jsx +++ b/client/src/Components/MonitorDetailsControlHeader/index.jsx @@ -12,10 +12,10 @@ import EmailIcon from "@mui/icons-material/Email"; import PropTypes from "prop-types"; import { useNavigate } from "react-router-dom"; import { useTheme } from "@mui/material/styles"; -import { usePauseMonitor } from "../../Hooks/monitorHooks"; -import { useSendTestEmail } from "../../Hooks/useSendTestEmail"; +import { usePauseMonitor } from "../../Hooks/v1/monitorHooks.js"; +import { useSendTestEmail } from "../../Hooks/v1/useSendTestEmail.js"; import { useTranslation } from "react-i18next"; -import { useTestAllNotifications } from "../../Hooks/useNotifications"; +import { useTestAllNotifications } from "../../Hooks/v1/useNotifications.js"; /** * MonitorDetailsControlHeader component displays the control header for monitor details. * It includes status display, pause/resume button, and a configure button for admins. diff --git a/client/src/Components/MonitorDetailsControlHeader/status.jsx b/client/src/Components/MonitorDetailsControlHeader/status.jsx index 65671a609..2cf749861 100644 --- a/client/src/Components/MonitorDetailsControlHeader/status.jsx +++ b/client/src/Components/MonitorDetailsControlHeader/status.jsx @@ -7,7 +7,7 @@ import Dot from "../../Components/Dot"; import { formatDurationRounded } from "../../Utils/timeUtils"; import PropTypes from "prop-types"; import { useTheme } from "@emotion/react"; -import { useMonitorUtils } from "../../Hooks/useMonitorUtils"; +import { useMonitorUtils } from "../../Hooks/v1/useMonitorUtils.js"; import { formatMonitorUrl } from "../../Utils/utils"; /** * Status component displays the status information of a monitor. diff --git a/client/src/Components/PageStateWrapper/index.jsx b/client/src/Components/PageStateWrapper/index.jsx index f971b2c9c..c335fcbb3 100644 --- a/client/src/Components/PageStateWrapper/index.jsx +++ b/client/src/Components/PageStateWrapper/index.jsx @@ -3,7 +3,7 @@ import Fallback from "../Fallback"; import { Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; -import { useIsAdmin } from "../../Hooks/useIsAdmin"; +import { useIsAdmin } from "../../Hooks/v1/useIsAdmin.js"; import PropTypes from "prop-types"; const PageStateWrapper = ({ networkError, diff --git a/client/src/Components/StatBox/index.jsx b/client/src/Components/StatBox/index.jsx index 7d093de60..15eb61f74 100644 --- a/client/src/Components/StatBox/index.jsx +++ b/client/src/Components/StatBox/index.jsx @@ -2,7 +2,7 @@ import { Stack, Typography } from "@mui/material"; import Image from "../Image"; import { useTheme } from "@mui/material/styles"; import PropTypes from "prop-types"; -import { useMonitorUtils } from "../../Hooks/useMonitorUtils"; +import { useMonitorUtils } from "../../Hooks/v1/useMonitorUtils.js"; /** * StatBox Component diff --git a/client/src/Hooks/checkHooks.js b/client/src/Hooks/v1/checkHooks.js similarity index 97% rename from client/src/Hooks/checkHooks.js rename to client/src/Hooks/v1/checkHooks.js index bdb1a73b7..96fd1fe1c 100644 --- a/client/src/Hooks/checkHooks.js +++ b/client/src/Hooks/v1/checkHooks.js @@ -1,6 +1,6 @@ import { useState, useEffect } from "react"; -import { networkService } from "../main"; -import { createToast } from "../Utils/toastUtils"; +import { networkService } from "../../main.jsx"; +import { createToast } from "../../Utils/toastUtils.jsx"; import { useTranslation } from "react-i18next"; const useFetchChecksTeam = ({ diff --git a/client/src/Hooks/inviteHooks.js b/client/src/Hooks/v1/inviteHooks.js similarity index 97% rename from client/src/Hooks/inviteHooks.js rename to client/src/Hooks/v1/inviteHooks.js index fb577272a..b6a0851af 100644 --- a/client/src/Hooks/inviteHooks.js +++ b/client/src/Hooks/v1/inviteHooks.js @@ -1,5 +1,5 @@ import { useState } from "react"; -import { networkService } from "../main"; +import { networkService } from "../../main.jsx"; import { useTranslation } from "react-i18next"; const CLIENT_HOST = import.meta.env.VITE_APP_CLIENT_HOST; diff --git a/client/src/Hooks/logHooks.js b/client/src/Hooks/v1/logHooks.js similarity index 96% rename from client/src/Hooks/logHooks.js rename to client/src/Hooks/v1/logHooks.js index 989870eea..ff4d13872 100644 --- a/client/src/Hooks/logHooks.js +++ b/client/src/Hooks/v1/logHooks.js @@ -1,6 +1,6 @@ import { useState, useEffect } from "react"; -import { networkService } from "../main"; -import { createToast } from "../Utils/toastUtils"; +import { networkService } from "../../main.jsx"; +import { createToast } from "../../Utils/toastUtils.jsx"; import { useTranslation } from "react-i18next"; const useFetchLogs = () => { diff --git a/client/src/Hooks/monitorHooks.js b/client/src/Hooks/v1/monitorHooks.js similarity index 98% rename from client/src/Hooks/monitorHooks.js rename to client/src/Hooks/v1/monitorHooks.js index eb1e7acdc..e6b4b5261 100644 --- a/client/src/Hooks/monitorHooks.js +++ b/client/src/Hooks/v1/monitorHooks.js @@ -1,8 +1,8 @@ import { useEffect, useState } from "react"; -import { networkService } from "../main"; -import { createToast } from "../Utils/toastUtils"; +import { networkService } from "../../main.jsx"; +import { createToast } from "../../Utils/toastUtils.jsx"; import { useTheme } from "@emotion/react"; -import { useMonitorUtils } from "./useMonitorUtils"; +import { useMonitorUtils } from "./useMonitorUtils.js"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Hooks/settingsHooks.js b/client/src/Hooks/v1/settingsHooks.js similarity index 95% rename from client/src/Hooks/settingsHooks.js rename to client/src/Hooks/v1/settingsHooks.js index 98a21c1fa..787e46ff9 100644 --- a/client/src/Hooks/settingsHooks.js +++ b/client/src/Hooks/v1/settingsHooks.js @@ -1,6 +1,6 @@ import { useState, useEffect } from "react"; -import { networkService } from "../main"; -import { createToast } from "../Utils/toastUtils"; +import { networkService } from "../../main.jsx"; +import { createToast } from "../../Utils/toastUtils.jsx"; import { useTranslation } from "react-i18next"; const useFetchSettings = ({ setSettingsData, setIsApiKeySet, setIsEmailPasswordSet }) => { diff --git a/client/src/Hooks/useIsAdmin.js b/client/src/Hooks/v1/useIsAdmin.js similarity index 100% rename from client/src/Hooks/useIsAdmin.js rename to client/src/Hooks/v1/useIsAdmin.js diff --git a/client/src/Hooks/useMonitorUtils.js b/client/src/Hooks/v1/useMonitorUtils.js similarity index 100% rename from client/src/Hooks/useMonitorUtils.js rename to client/src/Hooks/v1/useMonitorUtils.js diff --git a/client/src/Hooks/useNotifications.js b/client/src/Hooks/v1/useNotifications.js similarity index 96% rename from client/src/Hooks/useNotifications.js rename to client/src/Hooks/v1/useNotifications.js index 539725958..d1b4a6652 100644 --- a/client/src/Hooks/useNotifications.js +++ b/client/src/Hooks/v1/useNotifications.js @@ -1,9 +1,9 @@ import { useState, useEffect, useCallback } from "react"; -import { createToast } from "../Utils/toastUtils"; -import { networkService } from "../main"; +import { createToast } from "../../Utils/toastUtils.jsx"; +import { networkService } from "../../main.jsx"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { NOTIFICATION_TYPES } from "../Pages/Notifications/utils"; +import { NOTIFICATION_TYPES } from "../../Pages/v1/Notifications/utils.js"; const useCreateNotification = () => { const navigate = useNavigate(); diff --git a/client/src/Hooks/useSendTestEmail.js b/client/src/Hooks/v1/useSendTestEmail.js similarity index 93% rename from client/src/Hooks/useSendTestEmail.js rename to client/src/Hooks/v1/useSendTestEmail.js index e280b1f99..0be77954a 100644 --- a/client/src/Hooks/useSendTestEmail.js +++ b/client/src/Hooks/v1/useSendTestEmail.js @@ -1,7 +1,7 @@ import { useState } from "react"; -import { networkService } from "../main"; +import { networkService } from "../../main.jsx"; import { useSelector } from "react-redux"; -import { createToast } from "../Utils/toastUtils"; +import { createToast } from "../../Utils/toastUtils.jsx"; import { useTranslation } from "react-i18next"; const useSendTestEmail = () => { diff --git a/client/src/Hooks/userHooks.js b/client/src/Hooks/v1/userHooks.js similarity index 92% rename from client/src/Hooks/userHooks.js rename to client/src/Hooks/v1/userHooks.js index 8be32a082..71b156594 100644 --- a/client/src/Hooks/userHooks.js +++ b/client/src/Hooks/v1/userHooks.js @@ -1,6 +1,6 @@ import { useEffect, useState, useCallback } from "react"; -import { networkService } from "../main"; -import { createToast } from "../Utils/toastUtils"; +import { networkService } from "../../main.jsx"; +import { createToast } from "../../Utils/toastUtils.jsx"; import { useTranslation } from "react-i18next"; export const useGetUser = (userId) => { diff --git a/client/src/Pages/About/index.jsx b/client/src/Pages/v1/About/index.jsx similarity index 67% rename from client/src/Pages/About/index.jsx rename to client/src/Pages/v1/About/index.jsx index 97040b2e3..0e68089d3 100644 --- a/client/src/Pages/About/index.jsx +++ b/client/src/Pages/v1/About/index.jsx @@ -1,6 +1,6 @@ import React from "react"; -import AppBar from "../../Components/Common/AppBar"; -import Footer from "../../Components/Common/Footer"; +import AppBar from "../../../Components/Common/AppBar.jsx"; +import Footer from "../../../Components/Common/Footer.jsx"; import { useTranslation } from "react-i18next"; const AboutUs = () => { diff --git a/client/src/Pages/Account/EditUser/hooks/editUser.js b/client/src/Pages/v1/Account/EditUser/hooks/editUser.js similarity index 91% rename from client/src/Pages/Account/EditUser/hooks/editUser.js rename to client/src/Pages/v1/Account/EditUser/hooks/editUser.js index 2ffa914a0..00660aead 100644 --- a/client/src/Pages/Account/EditUser/hooks/editUser.js +++ b/client/src/Pages/v1/Account/EditUser/hooks/editUser.js @@ -1,8 +1,8 @@ import { useState, useEffect } from "react"; -import { ROLES } from "../../../../Utils/roleUtils"; -import { editUserValidation } from "../../../../Validation/validation"; +import { ROLES } from "../../../../../Utils/roleUtils.js"; +import { editUserValidation } from "../../../../../Validation/validation.js"; import Joi from "joi"; -import { createToast } from "../../../../Utils/toastUtils"; +import { createToast } from "../../../../../Utils/toastUtils.jsx"; import { useTranslation } from "react-i18next"; export const useEditUserForm = (user) => { const [searchInput, setSearchInput] = useState(""); diff --git a/client/src/Pages/Account/EditUser/index.jsx b/client/src/Pages/v1/Account/EditUser/index.jsx similarity index 86% rename from client/src/Pages/Account/EditUser/index.jsx rename to client/src/Pages/v1/Account/EditUser/index.jsx index e1eeead9d..658de5144 100644 --- a/client/src/Pages/Account/EditUser/index.jsx +++ b/client/src/Pages/v1/Account/EditUser/index.jsx @@ -2,19 +2,19 @@ import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import TextInput from "../../../Components/Inputs/TextInput"; -import Search from "../../../Components/Inputs/Search"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import TextInput from "../../../../Components/Inputs/TextInput/index.jsx"; +import Search from "../../../../Components/Inputs/Search/index.jsx"; import Button from "@mui/material/Button"; -import RoleTable from "../components/RoleTable"; +import RoleTable from "../components/RoleTable/index.jsx"; // Utils import { useParams } from "react-router-dom"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; -import { useGetUser, useEditUser } from "../../../Hooks/userHooks"; -import { EDITABLE_ROLES, ROLES } from "../../../Utils/roleUtils"; -import { useEditUserForm, useValidateEditUserForm } from "./hooks/editUser"; +import { useGetUser, useEditUser } from "../../../../Hooks/v1/userHooks.js"; +import { EDITABLE_ROLES, ROLES } from "../../../../Utils/roleUtils.js"; +import { useEditUserForm, useValidateEditUserForm } from "./hooks/editUser.js"; const EditUser = () => { const { userId } = useParams(); diff --git a/client/src/Pages/Account/components/AddMemberMenu/index.jsx b/client/src/Pages/v1/Account/components/AddMemberMenu/index.jsx similarity index 100% rename from client/src/Pages/Account/components/AddMemberMenu/index.jsx rename to client/src/Pages/v1/Account/components/AddMemberMenu/index.jsx diff --git a/client/src/Pages/Account/components/AddTeamMember/hooks/useAddTeamMember.jsx b/client/src/Pages/v1/Account/components/AddTeamMember/hooks/useAddTeamMember.jsx similarity index 93% rename from client/src/Pages/Account/components/AddTeamMember/hooks/useAddTeamMember.jsx rename to client/src/Pages/v1/Account/components/AddTeamMember/hooks/useAddTeamMember.jsx index e42c504b2..58db019a3 100644 --- a/client/src/Pages/Account/components/AddTeamMember/hooks/useAddTeamMember.jsx +++ b/client/src/Pages/v1/Account/components/AddTeamMember/hooks/useAddTeamMember.jsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { newOrChangedCredentials } from "../../../../../Validation/validation"; +import { newOrChangedCredentials } from "../../../../../../Validation/validation.js"; import { useTranslation } from "react-i18next"; const useAddTeamMember = () => { const { t } = useTranslation(); diff --git a/client/src/Pages/Account/components/AddTeamMember/index.jsx b/client/src/Pages/v1/Account/components/AddTeamMember/index.jsx similarity index 91% rename from client/src/Pages/Account/components/AddTeamMember/index.jsx rename to client/src/Pages/v1/Account/components/AddTeamMember/index.jsx index 2df8fb226..e17ed433b 100644 --- a/client/src/Pages/Account/components/AddTeamMember/index.jsx +++ b/client/src/Pages/v1/Account/components/AddTeamMember/index.jsx @@ -1,16 +1,16 @@ import { Button, Stack } from "@mui/material"; -import { GenericDialog } from "../../../../Components/Dialog/genericDialog"; -import TextInput from "../../../../Components/Inputs/TextInput"; -import Select from "../../../../Components/Inputs/Select"; -import { useGetInviteToken } from "../../../../Hooks/inviteHooks"; +import { GenericDialog } from "../../../../../Components/Dialog/genericDialog.jsx"; +import TextInput from "../../../../../Components/Inputs/TextInput/index.jsx"; +import Select from "../../../../../Components/Inputs/Select/index.jsx"; +import { useGetInviteToken } from "../../../../../Hooks/v1/inviteHooks.js"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; -import { createToast } from "../../../../Utils/toastUtils"; +import { createToast } from "../../../../../Utils/toastUtils.jsx"; import { useState } from "react"; -import PasswordTooltip from "../../../Auth/components/PasswordTooltip"; -import useAddTeamMember from "./hooks/useAddTeamMember"; -import usePasswordFeedback from "../../../Auth/hooks/usePasswordFeedback"; -import { PasswordEndAdornment } from "../../../../Components/Inputs/TextInput/Adornments"; +import PasswordTooltip from "../../../Auth/components/PasswordTooltip.jsx"; +import useAddTeamMember from "./hooks/useAddTeamMember.jsx"; +import usePasswordFeedback from "../../../Auth/hooks/usePasswordFeedback.jsx"; +import { PasswordEndAdornment } from "../../../../../Components/Inputs/TextInput/Adornments/index.jsx"; import PropTypes from "prop-types"; const INITIAL_FORM_STATE = { diff --git a/client/src/Pages/Account/components/PasswordPanel.jsx b/client/src/Pages/v1/Account/components/PasswordPanel.jsx similarity index 92% rename from client/src/Pages/Account/components/PasswordPanel.jsx rename to client/src/Pages/v1/Account/components/PasswordPanel.jsx index dabd67706..11961bf58 100644 --- a/client/src/Pages/Account/components/PasswordPanel.jsx +++ b/client/src/Pages/v1/Account/components/PasswordPanel.jsx @@ -2,14 +2,14 @@ import TabPanel from "@mui/lab/TabPanel"; import { useState } from "react"; import { useTheme } from "@emotion/react"; import { Box, Stack, Typography, Button } from "@mui/material"; -import { PasswordEndAdornment } from "../../../Components/Inputs/TextInput/Adornments"; -import TextInput from "../../../Components/Inputs/TextInput"; -import { newOrChangedCredentials } from "../../../Validation/validation"; -import Alert from "../../../Components/Alert"; -import { update } from "../../../Features/Auth/authSlice"; +import { PasswordEndAdornment } from "../../../../Components/Inputs/TextInput/Adornments/index.jsx"; +import TextInput from "../../../../Components/Inputs/TextInput/index.jsx"; +import { newOrChangedCredentials } from "../../../../Validation/validation.js"; +import Alert from "../../../../Components/Alert/index.jsx"; +import { update } from "../../../../Features/Auth/authSlice.js"; import { useDispatch, useSelector } from "react-redux"; -import { createToast } from "../../../Utils/toastUtils"; -import { getTouchedFieldErrors } from "../../../Validation/error"; +import { createToast } from "../../../../Utils/toastUtils.jsx"; +import { getTouchedFieldErrors } from "../../../../Validation/error.js"; import { useTranslation } from "react-i18next"; const defaultPasswordsState = { diff --git a/client/src/Pages/Account/components/ProfilePanel.jsx b/client/src/Pages/v1/Account/components/ProfilePanel.jsx similarity index 93% rename from client/src/Pages/Account/components/ProfilePanel.jsx rename to client/src/Pages/v1/Account/components/ProfilePanel.jsx index 7c73e7aa3..1ce1d34da 100644 --- a/client/src/Pages/Account/components/ProfilePanel.jsx +++ b/client/src/Pages/v1/Account/components/ProfilePanel.jsx @@ -2,16 +2,20 @@ import { useTheme } from "@emotion/react"; import { useState } from "react"; import TabPanel from "@mui/lab/TabPanel"; import { Box, Button, Divider, Stack, Typography } from "@mui/material"; -import Avatar from "../../../Components/Avatar"; -import TextInput from "../../../Components/Inputs/TextInput"; -import ImageUpload from "../../../Components/Inputs/ImageUpload"; -import { newOrChangedCredentials } from "../../../Validation/validation"; +import Avatar from "../../../../Components/Avatar/index.jsx"; +import TextInput from "../../../../Components/Inputs/TextInput/index.jsx"; +import ImageUpload from "../../../../Components/Inputs/ImageUpload/index.jsx"; +import { newOrChangedCredentials } from "../../../../Validation/validation.js"; import { useDispatch, useSelector } from "react-redux"; -import { clearAuthState, deleteUser, update } from "../../../Features/Auth/authSlice"; -import { createToast } from "../../../Utils/toastUtils"; -import { logger } from "../../../Utils/Logger"; -import { GenericDialog } from "../../../Components/Dialog/genericDialog"; -import Dialog from "../../../Components/Dialog"; +import { + clearAuthState, + deleteUser, + update, +} from "../../../../Features/Auth/authSlice.js"; +import { createToast } from "../../../../Utils/toastUtils.jsx"; +import { logger } from "../../../../Utils/Logger.js"; +import { GenericDialog } from "../../../../Components/Dialog/genericDialog.jsx"; +import Dialog from "../../../../Components/Dialog/index.jsx"; import { useTranslation } from "react-i18next"; /** diff --git a/client/src/Pages/Account/components/RoleTable/index.jsx b/client/src/Pages/v1/Account/components/RoleTable/index.jsx similarity index 87% rename from client/src/Pages/Account/components/RoleTable/index.jsx rename to client/src/Pages/v1/Account/components/RoleTable/index.jsx index 9d6ba3a16..c42be7bcd 100644 --- a/client/src/Pages/Account/components/RoleTable/index.jsx +++ b/client/src/Pages/v1/Account/components/RoleTable/index.jsx @@ -1,9 +1,9 @@ import Typography from "@mui/material/Typography"; -import DataTable from "../../../../Components/Table"; +import DataTable from "../../../../../Components/Table/index.jsx"; import DeleteOutlineRoundedIcon from "@mui/icons-material/DeleteOutlineRounded"; import { useTranslation } from "react-i18next"; -import { ROLES } from "../../../../Utils/roleUtils"; +import { ROLES } from "../../../../../Utils/roleUtils.js"; const RoleTable = ({ roles, handleDeleteRole }) => { const { t } = useTranslation(); diff --git a/client/src/Pages/Account/components/TeamPanel.jsx b/client/src/Pages/v1/Account/components/TeamPanel.jsx similarity index 92% rename from client/src/Pages/Account/components/TeamPanel.jsx rename to client/src/Pages/v1/Account/components/TeamPanel.jsx index fc1768642..8964cd277 100644 --- a/client/src/Pages/Account/components/TeamPanel.jsx +++ b/client/src/Pages/v1/Account/components/TeamPanel.jsx @@ -3,18 +3,18 @@ import TabPanel from "@mui/lab/TabPanel"; import { Button, ButtonGroup, Stack, Typography } from "@mui/material"; import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; -import TextInput from "../../../Components/Inputs/TextInput"; -import { newOrChangedCredentials } from "../../../Validation/validation"; -import { networkService } from "../../../main"; -import { createToast } from "../../../Utils/toastUtils"; -import Select from "../../../Components/Inputs/Select"; -import { GenericDialog } from "../../../Components/Dialog/genericDialog"; -import AddTeamMember from "../components/AddTeamMember"; -import DataTable from "../../../Components/Table"; -import { useGetInviteToken } from "../../../Hooks/inviteHooks"; +import TextInput from "../../../../Components/Inputs/TextInput/index.jsx"; +import { newOrChangedCredentials } from "../../../../Validation/validation.js"; +import { networkService } from "../../../../main.jsx"; +import { createToast } from "../../../../Utils/toastUtils.jsx"; +import Select from "../../../../Components/Inputs/Select/index.jsx"; +import { GenericDialog } from "../../../../Components/Dialog/genericDialog.jsx"; +import AddTeamMember from "./AddTeamMember/index.jsx"; +import DataTable from "../../../../Components/Table/index.jsx"; +import { useGetInviteToken } from "../../../../Hooks/v1/inviteHooks.js"; import { useNavigate } from "react-router-dom"; -import { useIsSuperAdmin } from "../../../Hooks/useIsAdmin"; -import AddMemberMenu from "./AddMemberMenu"; +import { useIsSuperAdmin } from "../../../../Hooks/v1/useIsAdmin.js"; +import AddMemberMenu from "./AddMemberMenu/index.jsx"; /** * TeamPanel component manages the organization and team members, * providing functionalities like renaming the organization, managing team members, diff --git a/client/src/Pages/Account/index.jsx b/client/src/Pages/v1/Account/index.jsx similarity index 91% rename from client/src/Pages/Account/index.jsx rename to client/src/Pages/v1/Account/index.jsx index 37c64aca6..a496858b7 100644 --- a/client/src/Pages/Account/index.jsx +++ b/client/src/Pages/v1/Account/index.jsx @@ -3,11 +3,11 @@ import PropTypes from "prop-types"; import { useNavigate } from "react-router-dom"; import { useSelector } from "react-redux"; import { Box, Tab, useTheme } from "@mui/material"; -import CustomTabList from "../../Components/Tab"; +import CustomTabList from "../../../Components/Tab/index.jsx"; import TabContext from "@mui/lab/TabContext"; -import ProfilePanel from "./components/ProfilePanel"; -import PasswordPanel from "./components/PasswordPanel"; -import TeamPanel from "./components/TeamPanel"; +import ProfilePanel from "./components/ProfilePanel.jsx"; +import PasswordPanel from "./components/PasswordPanel.jsx"; +import TeamPanel from "./components/TeamPanel.jsx"; import { useTranslation } from "react-i18next"; /** diff --git a/client/src/Pages/Auth/CheckEmail.jsx b/client/src/Pages/v1/Auth/CheckEmail.jsx similarity index 93% rename from client/src/Pages/Auth/CheckEmail.jsx rename to client/src/Pages/v1/Auth/CheckEmail.jsx index e1f5e43ed..95217bcb5 100644 --- a/client/src/Pages/Auth/CheckEmail.jsx +++ b/client/src/Pages/v1/Auth/CheckEmail.jsx @@ -3,13 +3,13 @@ import { useEffect, useState } from "react"; import { useTheme } from "@emotion/react"; import { useDispatch } from "react-redux"; import { useNavigate } from "react-router-dom"; -import { createToast } from "../../Utils/toastUtils"; -import { forgotPassword } from "../../Features/Auth/authSlice"; +import { createToast } from "../../../Utils/toastUtils.jsx"; +import { forgotPassword } from "../../../Features/Auth/authSlice.js"; import { Trans, useTranslation } from "react-i18next"; -import Background from "../../assets/Images/background-grid.svg?react"; -import EmailIcon from "../../assets/icons/email.svg?react"; -import Logo from "../../assets/icons/checkmate-icon.svg?react"; -import IconBox from "../../Components/IconBox"; +import Background from "../../../assets/Images/background-grid.svg?react"; +import EmailIcon from "../../../assets/icons/email.svg?react"; +import Logo from "../../../assets/icons/checkmate-icon.svg?react"; +import IconBox from "../../../Components/IconBox/index.jsx"; import "./index.css"; const CheckEmail = () => { diff --git a/client/src/Pages/Auth/ForgotPassword.jsx b/client/src/Pages/v1/Auth/ForgotPassword.jsx similarity index 91% rename from client/src/Pages/Auth/ForgotPassword.jsx rename to client/src/Pages/v1/Auth/ForgotPassword.jsx index 2a887756e..9836f5d77 100644 --- a/client/src/Pages/Auth/ForgotPassword.jsx +++ b/client/src/Pages/v1/Auth/ForgotPassword.jsx @@ -1,16 +1,16 @@ import { Box, Stack, Typography, Button } from "@mui/material"; import { useTheme } from "@emotion/react"; -import { createToast } from "../../Utils/toastUtils"; +import { createToast } from "../../../Utils/toastUtils.jsx"; import { useDispatch, useSelector } from "react-redux"; -import { forgotPassword } from "../../Features/Auth/authSlice"; +import { forgotPassword } from "../../../Features/Auth/authSlice.js"; import { useEffect, useState } from "react"; -import { newOrChangedCredentials } from "../../Validation/validation"; +import { newOrChangedCredentials } from "../../../Validation/validation.js"; import { useNavigate } from "react-router-dom"; -import TextInput from "../../Components/Inputs/TextInput"; -import Logo from "../../assets/icons/checkmate-icon.svg?react"; -import Key from "../../assets/icons/key.svg?react"; -import Background from "../../assets/Images/background-grid.svg?react"; -import IconBox from "../../Components/IconBox"; +import TextInput from "../../../Components/Inputs/TextInput/index.jsx"; +import Logo from "../../../assets/icons/checkmate-icon.svg?react"; +import Key from "../../../assets/icons/key.svg?react"; +import Background from "../../../assets/Images/background-grid.svg?react"; +import IconBox from "../../../Components/IconBox/index.jsx"; import { Trans, useTranslation } from "react-i18next"; import "./index.css"; diff --git a/client/src/Pages/Auth/Login/hooks/useLoadingSubmit.jsx b/client/src/Pages/v1/Auth/Login/hooks/useLoadingSubmit.jsx similarity index 100% rename from client/src/Pages/Auth/Login/hooks/useLoadingSubmit.jsx rename to client/src/Pages/v1/Auth/Login/hooks/useLoadingSubmit.jsx diff --git a/client/src/Pages/Auth/Login/hooks/useLoginForm.jsx b/client/src/Pages/v1/Auth/Login/hooks/useLoginForm.jsx similarity index 100% rename from client/src/Pages/Auth/Login/hooks/useLoginForm.jsx rename to client/src/Pages/v1/Auth/Login/hooks/useLoginForm.jsx diff --git a/client/src/Pages/Auth/Login/hooks/useLoginSubmit.jsx b/client/src/Pages/v1/Auth/Login/hooks/useLoginSubmit.jsx similarity index 87% rename from client/src/Pages/Auth/Login/hooks/useLoginSubmit.jsx rename to client/src/Pages/v1/Auth/Login/hooks/useLoginSubmit.jsx index 6bc5716ff..0eed9bd07 100644 --- a/client/src/Pages/Auth/Login/hooks/useLoginSubmit.jsx +++ b/client/src/Pages/v1/Auth/Login/hooks/useLoginSubmit.jsx @@ -1,7 +1,7 @@ import { useDispatch } from "react-redux"; -import { login } from "../../../../Features/Auth/authSlice"; +import { login } from "../../../../../Features/Auth/authSlice.js"; import { useNavigate } from "react-router-dom"; -import { createToast } from "../../../../Utils/toastUtils"; +import { createToast } from "../../../../../Utils/toastUtils.jsx"; import { useTranslation } from "react-i18next"; const useLoginSubmit = () => { diff --git a/client/src/Pages/Auth/Login/hooks/useValidateLoginForm.jsx b/client/src/Pages/v1/Auth/Login/hooks/useValidateLoginForm.jsx similarity index 90% rename from client/src/Pages/Auth/Login/hooks/useValidateLoginForm.jsx rename to client/src/Pages/v1/Auth/Login/hooks/useValidateLoginForm.jsx index e5d045be8..ca9bef879 100644 --- a/client/src/Pages/Auth/Login/hooks/useValidateLoginForm.jsx +++ b/client/src/Pages/v1/Auth/Login/hooks/useValidateLoginForm.jsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { loginCredentials } from "../../../../Validation/validation"; +import { loginCredentials } from "../../../../../Validation/validation.js"; const useValidateLoginForm = () => { const [errors, setErrors] = useState({ diff --git a/client/src/Pages/Auth/Login/index.jsx b/client/src/Pages/v1/Auth/Login/index.jsx similarity index 82% rename from client/src/Pages/Auth/Login/index.jsx rename to client/src/Pages/v1/Auth/Login/index.jsx index d06ecef6d..901edcd8b 100644 --- a/client/src/Pages/Auth/Login/index.jsx +++ b/client/src/Pages/v1/Auth/Login/index.jsx @@ -1,17 +1,17 @@ // Components import Stack from "@mui/material/Stack"; import Button from "@mui/material/Button"; -import TextInput from "../../../Components/Inputs/TextInput"; -import { PasswordEndAdornment } from "../../../Components/Inputs/TextInput/Adornments"; -import TextLink from "../../../Components/TextLink"; -import AuthPageWrapper from "../components/AuthPageWrapper"; +import TextInput from "../../../../Components/Inputs/TextInput/index.jsx"; +import { PasswordEndAdornment } from "../../../../Components/Inputs/TextInput/Adornments/index.jsx"; +import TextLink from "../../../../Components/TextLink/index.jsx"; +import AuthPageWrapper from "../components/AuthPageWrapper.jsx"; // Utils import { useTheme } from "@mui/material/styles"; import { useTranslation } from "react-i18next"; -import useLoginForm from "./hooks/useLoginForm"; -import useValidateLoginForm from "./hooks/useValidateLoginForm"; -import useLoginSubmit from "./hooks/useLoginSubmit"; -import useLoadingSubmit from "./hooks/useLoadingSubmit"; +import useLoginForm from "./hooks/useLoginForm.jsx"; +import useValidateLoginForm from "./hooks/useValidateLoginForm.jsx"; +import useLoginSubmit from "./hooks/useLoginSubmit.jsx"; +import useLoadingSubmit from "./hooks/useLoadingSubmit.jsx"; const Login = () => { // Hooks diff --git a/client/src/Pages/Auth/NewPasswordConfirmed.jsx b/client/src/Pages/v1/Auth/NewPasswordConfirmed.jsx similarity index 90% rename from client/src/Pages/Auth/NewPasswordConfirmed.jsx rename to client/src/Pages/v1/Auth/NewPasswordConfirmed.jsx index 7ace77abc..2bede1ae4 100644 --- a/client/src/Pages/Auth/NewPasswordConfirmed.jsx +++ b/client/src/Pages/v1/Auth/NewPasswordConfirmed.jsx @@ -2,11 +2,11 @@ import { Box, Button, Stack, Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; import { useNavigate } from "react-router-dom"; import { useDispatch } from "react-redux"; -import { clearAuthState } from "../../Features/Auth/authSlice"; -import Background from "../../assets/Images/background-grid.svg?react"; -import ConfirmIcon from "../../assets/icons/check-outlined.svg?react"; -import Logo from "../../assets/icons/checkmate-icon.svg?react"; -import IconBox from "../../Components/IconBox"; +import { clearAuthState } from "../../../Features/Auth/authSlice.js"; +import Background from "../../../assets/Images/background-grid.svg?react"; +import ConfirmIcon from "../../../assets/icons/check-outlined.svg?react"; +import Logo from "../../../assets/icons/checkmate-icon.svg?react"; +import IconBox from "../../../Components/IconBox/index.jsx"; import { Trans, useTranslation } from "react-i18next"; import "./index.css"; diff --git a/client/src/Pages/Auth/Register/index.jsx b/client/src/Pages/v1/Auth/Register/index.jsx similarity index 94% rename from client/src/Pages/Auth/Register/index.jsx rename to client/src/Pages/v1/Auth/Register/index.jsx index 2b45d2d15..a903602d4 100644 --- a/client/src/Pages/Auth/Register/index.jsx +++ b/client/src/Pages/v1/Auth/Register/index.jsx @@ -1,10 +1,10 @@ // Components import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import TextInput from "../../../Components/Inputs/TextInput"; +import TextInput from "../../../../Components/Inputs/TextInput/index.jsx"; import Button from "@mui/material/Button"; import Box from "@mui/material/Box"; -import PasswordTooltip from "../components/PasswordTooltip"; +import PasswordTooltip from "../components/PasswordTooltip.jsx"; // Utils import { useTheme } from "@emotion/react"; @@ -13,11 +13,11 @@ import { useState, useEffect } from "react"; import { useNavigate } from "react-router-dom"; import { useDispatch, useSelector } from "react-redux"; import { useParams } from "react-router-dom"; -import { networkService } from "../../../main"; -import { newOrChangedCredentials } from "../../../Validation/validation"; -import { register } from "../../../Features/Auth/authSlice"; -import AuthPageWrapper from "../components/AuthPageWrapper"; -import { createToast } from "../../../Utils/toastUtils"; +import { networkService } from "../../../../main.jsx"; +import { newOrChangedCredentials } from "../../../../Validation/validation.js"; +import { register } from "../../../../Features/Auth/authSlice.js"; +import AuthPageWrapper from "../components/AuthPageWrapper.jsx"; +import { createToast } from "../../../../Utils/toastUtils.jsx"; import PropTypes from "prop-types"; const getFeedbackStatus = (form, errors, field, criteria) => { diff --git a/client/src/Pages/Auth/SetNewPassword.jsx b/client/src/Pages/v1/Auth/SetNewPassword.jsx similarity index 91% rename from client/src/Pages/Auth/SetNewPassword.jsx rename to client/src/Pages/v1/Auth/SetNewPassword.jsx index b4899f47c..e9df89d88 100644 --- a/client/src/Pages/Auth/SetNewPassword.jsx +++ b/client/src/Pages/v1/Auth/SetNewPassword.jsx @@ -4,18 +4,18 @@ import { useNavigate } from "react-router-dom"; import { useParams } from "react-router-dom"; import { useTheme } from "@emotion/react"; import { Box, Stack, Typography, Button } from "@mui/material"; -import { setNewPassword } from "../../Features/Auth/authSlice"; -import { createToast } from "../../Utils/toastUtils"; -import { newOrChangedCredentials } from "../../Validation/validation"; -import Check from "../../Components/Check/Check"; -import TextInput from "../../Components/Inputs/TextInput"; -import { PasswordEndAdornment } from "../../Components/Inputs/TextInput/Adornments"; -import IconBox from "../../Components/IconBox"; -import LockIcon from "../../assets/icons/lock.svg?react"; -import Logo from "../../assets/icons/checkmate-icon.svg?react"; -import Background from "../../assets/Images/background-grid.svg?react"; +import { setNewPassword } from "../../../Features/Auth/authSlice.js"; +import { createToast } from "../../../Utils/toastUtils.jsx"; +import { newOrChangedCredentials } from "../../../Validation/validation.js"; +import Check from "../../../Components/Check/Check.jsx"; +import TextInput from "../../../Components/Inputs/TextInput/index.jsx"; +import { PasswordEndAdornment } from "../../../Components/Inputs/TextInput/Adornments/index.jsx"; +import IconBox from "../../../Components/IconBox/index.jsx"; +import LockIcon from "../../../assets/icons/lock.svg?react"; +import Logo from "../../../assets/icons/checkmate-icon.svg?react"; +import Background from "../../../assets/Images/background-grid.svg?react"; import "./index.css"; -import { useValidatePassword } from "./hooks/useValidatePassword"; +import { useValidatePassword } from "./hooks/useValidatePassword.jsx"; import { Trans, useTranslation } from "react-i18next"; const SetNewPassword = () => { diff --git a/client/src/Pages/Auth/components/AuthHeader.jsx b/client/src/Pages/v1/Auth/components/AuthHeader.jsx similarity index 81% rename from client/src/Pages/Auth/components/AuthHeader.jsx rename to client/src/Pages/v1/Auth/components/AuthHeader.jsx index ce454c065..067c47d92 100644 --- a/client/src/Pages/Auth/components/AuthHeader.jsx +++ b/client/src/Pages/v1/Auth/components/AuthHeader.jsx @@ -1,9 +1,9 @@ // Components import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import Logo from "../../../assets/icons/checkmate-icon.svg?react"; -import LanguageSelector from "../../../Components/LanguageSelector"; -import ThemeSwitch from "../../../Components/ThemeSwitch"; +import Logo from "../../../../assets/icons/checkmate-icon.svg?react"; +import LanguageSelector from "../../../../Components/LanguageSelector.jsx"; +import ThemeSwitch from "../../../../Components/ThemeSwitch/index.jsx"; // Utils import { useTheme } from "@mui/material/styles"; diff --git a/client/src/Pages/Auth/components/AuthPageWrapper.jsx b/client/src/Pages/v1/Auth/components/AuthPageWrapper.jsx similarity index 92% rename from client/src/Pages/Auth/components/AuthPageWrapper.jsx rename to client/src/Pages/v1/Auth/components/AuthPageWrapper.jsx index b83be19c5..7e358e6ab 100644 --- a/client/src/Pages/Auth/components/AuthPageWrapper.jsx +++ b/client/src/Pages/v1/Auth/components/AuthPageWrapper.jsx @@ -1,10 +1,10 @@ -import Background from "../../../assets/Images/background-grid.svg?react"; +import Background from "../../../../assets/Images/background-grid.svg?react"; import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; -import AuthHeader from "../components/AuthHeader"; +import AuthHeader from "./AuthHeader.jsx"; import { useTheme } from "@mui/material/styles"; -import Logo from "../../../assets/icons/checkmate-icon.svg?react"; +import Logo from "../../../../assets/icons/checkmate-icon.svg?react"; import PropTypes from "prop-types"; const AuthPageWrapper = ({ children, heading, welcome }) => { diff --git a/client/src/Pages/Auth/components/PasswordTooltip.jsx b/client/src/Pages/v1/Auth/components/PasswordTooltip.jsx similarity index 98% rename from client/src/Pages/Auth/components/PasswordTooltip.jsx rename to client/src/Pages/v1/Auth/components/PasswordTooltip.jsx index bc2f28ec7..ff3c2f385 100644 --- a/client/src/Pages/Auth/components/PasswordTooltip.jsx +++ b/client/src/Pages/v1/Auth/components/PasswordTooltip.jsx @@ -1,4 +1,4 @@ -import Check from "../../../Components/Check/Check"; +import Check from "../../../../Components/Check/Check.jsx"; import Stack from "@mui/material/Stack"; import { Tooltip, useTheme } from "@mui/material"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Auth/hooks/usePasswordFeedback.jsx b/client/src/Pages/v1/Auth/hooks/usePasswordFeedback.jsx similarity index 96% rename from client/src/Pages/Auth/hooks/usePasswordFeedback.jsx rename to client/src/Pages/v1/Auth/hooks/usePasswordFeedback.jsx index 4159e6166..3c199e25f 100644 --- a/client/src/Pages/Auth/hooks/usePasswordFeedback.jsx +++ b/client/src/Pages/v1/Auth/hooks/usePasswordFeedback.jsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { newOrChangedCredentials } from "../../../Validation/validation"; +import { newOrChangedCredentials } from "../../../../Validation/validation.js"; const usePasswordFeedback = () => { const [feedback, setFeedback] = useState({}); diff --git a/client/src/Pages/Auth/hooks/useValidatePassword.jsx b/client/src/Pages/v1/Auth/hooks/useValidatePassword.jsx similarity index 96% rename from client/src/Pages/Auth/hooks/useValidatePassword.jsx rename to client/src/Pages/v1/Auth/hooks/useValidatePassword.jsx index 102d8d73e..231b8eeb8 100644 --- a/client/src/Pages/Auth/hooks/useValidatePassword.jsx +++ b/client/src/Pages/v1/Auth/hooks/useValidatePassword.jsx @@ -1,5 +1,5 @@ import { useMemo, useState } from "react"; -import { newOrChangedCredentials } from "../../../Validation/validation"; +import { newOrChangedCredentials } from "../../../../Validation/validation.js"; const getFeedbackStatus = (form, errors, field, criteria) => { const fieldErrors = errors[field]; diff --git a/client/src/Pages/Auth/index.css b/client/src/Pages/v1/Auth/index.css similarity index 100% rename from client/src/Pages/Auth/index.css rename to client/src/Pages/v1/Auth/index.css diff --git a/client/src/Pages/Incidents/Components/IncidentTable/index.jsx b/client/src/Pages/v1/Incidents/Components/IncidentTable/index.jsx similarity index 88% rename from client/src/Pages/Incidents/Components/IncidentTable/index.jsx rename to client/src/Pages/v1/Incidents/Components/IncidentTable/index.jsx index df9174290..e204d7167 100644 --- a/client/src/Pages/Incidents/Components/IncidentTable/index.jsx +++ b/client/src/Pages/v1/Incidents/Components/IncidentTable/index.jsx @@ -1,26 +1,26 @@ //Components import Stack from "@mui/material/Stack"; -import DataTable from "../../../../Components/Table"; +import DataTable from "../../../../../Components/Table/index.jsx"; import Table from "@mui/material/Table"; import TableBody from "@mui/material/TableBody"; import TableRow from "@mui/material/TableRow"; import TableCell from "@mui/material/TableCell"; -import TableSkeleton from "../../../../Components/Table/skeleton"; -import Pagination from "../../../../Components/Table/TablePagination"; -import { StatusLabel } from "../../../../Components/Label"; -import { HttpStatusLabel } from "../../../../Components/HttpStatusLabel"; -import GenericFallback from "../../../../Components/GenericFallback"; -import NetworkError from "../../../../Components/GenericFallback/NetworkError"; +import TableSkeleton from "../../../../../Components/Table/skeleton.jsx"; +import Pagination from "../../../../../Components/Table/TablePagination/index.jsx"; +import { StatusLabel } from "../../../../../Components/Label/index.jsx"; +import { HttpStatusLabel } from "../../../../../Components/HttpStatusLabel/index.jsx"; +import GenericFallback from "../../../../../Components/GenericFallback/index.jsx"; +import NetworkError from "../../../../../Components/GenericFallback/NetworkError.jsx"; //Utils -import { formatDateWithTz } from "../../../../Utils/timeUtils"; +import { formatDateWithTz } from "../../../../../Utils/timeUtils.js"; import { useSelector } from "react-redux"; import { useState } from "react"; import PropTypes from "prop-types"; import { useTranslation } from "react-i18next"; -import { useFetchChecksTeam } from "../../../../Hooks/checkHooks"; -import { useFetchChecksByMonitor } from "../../../../Hooks/checkHooks"; -import { useResolveIncident } from "../../../../Hooks/checkHooks"; +import { useFetchChecksTeam } from "../../../../../Hooks/v1/checkHooks.js"; +import { useFetchChecksByMonitor } from "../../../../../Hooks/v1/checkHooks.js"; +import { useResolveIncident } from "../../../../../Hooks/v1/checkHooks.js"; import { Button, Typography, useTheme } from "@mui/material"; import { lighten } from "@mui/material/styles"; diff --git a/client/src/Pages/Incidents/Components/OptionsHeader/index.jsx b/client/src/Pages/v1/Incidents/Components/OptionsHeader/index.jsx similarity index 96% rename from client/src/Pages/Incidents/Components/OptionsHeader/index.jsx rename to client/src/Pages/v1/Incidents/Components/OptionsHeader/index.jsx index 259880223..b1bde1175 100644 --- a/client/src/Pages/Incidents/Components/OptionsHeader/index.jsx +++ b/client/src/Pages/v1/Incidents/Components/OptionsHeader/index.jsx @@ -1,11 +1,11 @@ // Components import { Stack, Typography, Button, ButtonGroup } from "@mui/material"; -import Select from "../../../../Components/Inputs/Select"; +import Select from "../../../../../Components/Inputs/Select/index.jsx"; import PropTypes from "prop-types"; //Utils import { useTheme } from "@emotion/react"; -import SkeletonLayout from "./skeleton"; +import SkeletonLayout from "./skeleton.jsx"; import { useTranslation } from "react-i18next"; const OptionsHeader = ({ diff --git a/client/src/Pages/Incidents/Components/OptionsHeader/skeleton.jsx b/client/src/Pages/v1/Incidents/Components/OptionsHeader/skeleton.jsx similarity index 100% rename from client/src/Pages/Incidents/Components/OptionsHeader/skeleton.jsx rename to client/src/Pages/v1/Incidents/Components/OptionsHeader/skeleton.jsx diff --git a/client/src/Pages/Incidents/Components/StatusBoxes/StatusBox.jsx b/client/src/Pages/v1/Incidents/Components/StatusBoxes/StatusBox.jsx similarity index 87% rename from client/src/Pages/Incidents/Components/StatusBoxes/StatusBox.jsx rename to client/src/Pages/v1/Incidents/Components/StatusBoxes/StatusBox.jsx index 7b20e3d51..cd7078e6c 100644 --- a/client/src/Pages/Incidents/Components/StatusBoxes/StatusBox.jsx +++ b/client/src/Pages/v1/Incidents/Components/StatusBoxes/StatusBox.jsx @@ -1,11 +1,11 @@ import PropTypes from "prop-types"; import { useTheme } from "@emotion/react"; import { Box, Stack, Typography } from "@mui/material"; -import Background from "../../../../assets/Images/background-grid.svg?react"; -import AlertIcon from "../../../../assets/icons/alert-icon.svg?react"; -import CheckIcon from "../../../../assets/icons/check-icon.svg?react"; -import CloseIcon from "../../../../assets/icons/close-icon.svg?react"; -import WarningIcon from "../../../../assets/icons/warning-icon.svg?react"; +import Background from "../../../../../assets/Images/background-grid.svg?react"; +import AlertIcon from "../../../../../assets/icons/alert-icon.svg?react"; +import CheckIcon from "../../../../../assets/icons/check-icon.svg?react"; +import CloseIcon from "../../../../../assets/icons/close-icon.svg?react"; +import WarningIcon from "../../../../../assets/icons/warning-icon.svg?react"; const StatusBox = ({ title, value, status }) => { const theme = useTheme(); diff --git a/client/src/Pages/Incidents/Components/StatusBoxes/index.jsx b/client/src/Pages/v1/Incidents/Components/StatusBoxes/index.jsx similarity index 92% rename from client/src/Pages/Incidents/Components/StatusBoxes/index.jsx rename to client/src/Pages/v1/Incidents/Components/StatusBoxes/index.jsx index 6ba2f1820..3bcd3fd3a 100644 --- a/client/src/Pages/Incidents/Components/StatusBoxes/index.jsx +++ b/client/src/Pages/v1/Incidents/Components/StatusBoxes/index.jsx @@ -1,9 +1,9 @@ import PropTypes from "prop-types"; import { Stack } from "@mui/material"; -import StatusBox from "./StatusBox"; +import StatusBox from "./StatusBox.jsx"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; -import SkeletonLayout from "./skeleton"; +import SkeletonLayout from "./skeleton.jsx"; const StatusBoxes = ({ isLoading, summary }) => { const theme = useTheme(); diff --git a/client/src/Pages/Incidents/Components/StatusBoxes/skeleton.jsx b/client/src/Pages/v1/Incidents/Components/StatusBoxes/skeleton.jsx similarity index 100% rename from client/src/Pages/Incidents/Components/StatusBoxes/skeleton.jsx rename to client/src/Pages/v1/Incidents/Components/StatusBoxes/skeleton.jsx diff --git a/client/src/Pages/Incidents/index.jsx b/client/src/Pages/v1/Incidents/index.jsx similarity index 81% rename from client/src/Pages/Incidents/index.jsx rename to client/src/Pages/v1/Incidents/index.jsx index 7696c453b..b9281f97c 100644 --- a/client/src/Pages/Incidents/index.jsx +++ b/client/src/Pages/v1/Incidents/index.jsx @@ -1,19 +1,19 @@ // Components import { Stack } from "@mui/material"; -import Breadcrumbs from "../../Components/Breadcrumbs"; -import GenericFallback from "../../Components/GenericFallback"; -import IncidentTable from "./Components/IncidentTable"; -import OptionsHeader from "./Components/OptionsHeader"; -import StatusBoxes from "./Components/StatusBoxes"; +import Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx"; +import GenericFallback from "../../../Components/GenericFallback/index.jsx"; +import IncidentTable from "./Components/IncidentTable/index.jsx"; +import OptionsHeader from "./Components/OptionsHeader/index.jsx"; +import StatusBoxes from "./Components/StatusBoxes/index.jsx"; import { Box, Button } from "@mui/material"; //Utils import { useTheme } from "@emotion/react"; -import { useFetchMonitorsByTeamId } from "../../Hooks/monitorHooks"; -import { useFetchChecksSummaryByTeamId } from "../../Hooks/checkHooks"; -import { useAcknowledgeChecks } from "../../Hooks/checkHooks"; +import { useFetchMonitorsByTeamId } from "../../../Hooks/v1/monitorHooks.js"; +import { useFetchChecksSummaryByTeamId } from "../../../Hooks/v1/checkHooks.js"; +import { useAcknowledgeChecks } from "../../../Hooks/v1/checkHooks.js"; import { useState, useEffect } from "react"; -import NetworkError from "../../Components/GenericFallback/NetworkError"; +import NetworkError from "../../../Components/GenericFallback/NetworkError.jsx"; import { useTranslation } from "react-i18next"; import { useParams } from "react-router-dom"; diff --git a/client/src/Pages/Infrastructure/Create/Components/CustomAlertsSection.jsx b/client/src/Pages/v1/Infrastructure/Create/Components/CustomAlertsSection.jsx similarity index 91% rename from client/src/Pages/Infrastructure/Create/Components/CustomAlertsSection.jsx rename to client/src/Pages/v1/Infrastructure/Create/Components/CustomAlertsSection.jsx index 5a6f5e981..299331a79 100644 --- a/client/src/Pages/Infrastructure/Create/Components/CustomAlertsSection.jsx +++ b/client/src/Pages/v1/Infrastructure/Create/Components/CustomAlertsSection.jsx @@ -1,7 +1,7 @@ -import ConfigBox from "../../../../Components/ConfigBox"; +import ConfigBox from "../../../../../Components/ConfigBox/index.jsx"; import { Box, Stack, Typography } from "@mui/material"; -import { CustomThreshold } from "../Components/CustomThreshold"; -import { capitalizeFirstLetter } from "../../../../Utils/stringUtils"; +import { CustomThreshold } from "./CustomThreshold/index.jsx"; +import { capitalizeFirstLetter } from "../../../../../Utils/stringUtils.js"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; import PropTypes from "prop-types"; diff --git a/client/src/Pages/Infrastructure/Create/Components/CustomThreshold/index.jsx b/client/src/Pages/v1/Infrastructure/Create/Components/CustomThreshold/index.jsx similarity index 95% rename from client/src/Pages/Infrastructure/Create/Components/CustomThreshold/index.jsx rename to client/src/Pages/v1/Infrastructure/Create/Components/CustomThreshold/index.jsx index 865698f44..4edc0b766 100644 --- a/client/src/Pages/Infrastructure/Create/Components/CustomThreshold/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Create/Components/CustomThreshold/index.jsx @@ -1,6 +1,6 @@ import { Box, Stack, Typography } from "@mui/material"; -import TextInput from "../../../../../Components/Inputs/TextInput"; -import Checkbox from "../../../../../Components/Inputs/Checkbox"; +import TextInput from "../../../../../../Components/Inputs/TextInput/index.jsx"; +import Checkbox from "../../../../../../Components/Inputs/Checkbox/index.jsx"; import { useTheme } from "@emotion/react"; import PropTypes from "prop-types"; diff --git a/client/src/Pages/Infrastructure/Create/Components/MonitorActionButtons.jsx b/client/src/Pages/v1/Infrastructure/Create/Components/MonitorActionButtons.jsx similarity index 96% rename from client/src/Pages/Infrastructure/Create/Components/MonitorActionButtons.jsx rename to client/src/Pages/v1/Infrastructure/Create/Components/MonitorActionButtons.jsx index becda3e3a..16df8ad01 100644 --- a/client/src/Pages/Infrastructure/Create/Components/MonitorActionButtons.jsx +++ b/client/src/Pages/v1/Infrastructure/Create/Components/MonitorActionButtons.jsx @@ -4,7 +4,7 @@ import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; import PauseCircleOutlineIcon from "@mui/icons-material/PauseCircleOutline"; import PlayCircleOutlineRoundedIcon from "@mui/icons-material/PlayCircleOutlineRounded"; -import Dialog from "../../../../Components/Dialog"; +import Dialog from "../../../../../Components/Dialog/index.jsx"; import PropTypes from "prop-types"; const MonitorActionButtons = ({ monitor, isBusy, handlePause, handleRemove }) => { diff --git a/client/src/Pages/Infrastructure/Create/Components/MonitorStatusHeader.jsx b/client/src/Pages/v1/Infrastructure/Create/Components/MonitorStatusHeader.jsx similarity index 91% rename from client/src/Pages/Infrastructure/Create/Components/MonitorStatusHeader.jsx rename to client/src/Pages/v1/Infrastructure/Create/Components/MonitorStatusHeader.jsx index 2ed48bf64..4313c34c0 100644 --- a/client/src/Pages/Infrastructure/Create/Components/MonitorStatusHeader.jsx +++ b/client/src/Pages/v1/Infrastructure/Create/Components/MonitorStatusHeader.jsx @@ -1,8 +1,8 @@ import { Box, Stack, Tooltip, Typography } from "@mui/material"; -import { useMonitorUtils } from "../../../../Hooks/useMonitorUtils"; +import { useMonitorUtils } from "../../../../../Hooks/v1/useMonitorUtils.js"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; -import PulseDot from "../../../../Components/Animated/PulseDot"; +import PulseDot from "../../../../../Components/Animated/PulseDot.jsx"; import PropTypes from "prop-types"; const MonitorStatusHeader = ({ monitor, infrastructureMonitor }) => { const theme = useTheme(); diff --git a/client/src/Pages/Infrastructure/Create/hooks/useInfrastructureMonitorForm.jsx b/client/src/Pages/v1/Infrastructure/Create/hooks/useInfrastructureMonitorForm.jsx similarity index 100% rename from client/src/Pages/Infrastructure/Create/hooks/useInfrastructureMonitorForm.jsx rename to client/src/Pages/v1/Infrastructure/Create/hooks/useInfrastructureMonitorForm.jsx diff --git a/client/src/Pages/Infrastructure/Create/hooks/useInfrastructureSubmit.jsx b/client/src/Pages/v1/Infrastructure/Create/hooks/useInfrastructureSubmit.jsx similarity index 96% rename from client/src/Pages/Infrastructure/Create/hooks/useInfrastructureSubmit.jsx rename to client/src/Pages/v1/Infrastructure/Create/hooks/useInfrastructureSubmit.jsx index 9b3ee0d04..8a97486c7 100644 --- a/client/src/Pages/Infrastructure/Create/hooks/useInfrastructureSubmit.jsx +++ b/client/src/Pages/v1/Infrastructure/Create/hooks/useInfrastructureSubmit.jsx @@ -1,4 +1,7 @@ -import { useCreateMonitor, useUpdateMonitor } from "../../../../Hooks/monitorHooks"; +import { + useCreateMonitor, + useUpdateMonitor, +} from "../../../../../Hooks/v1/monitorHooks.js"; const useInfrastructureSubmit = () => { const [createMonitor, isCreating] = useCreateMonitor(); const [updateMonitor, isUpdating] = useUpdateMonitor(); diff --git a/client/src/Pages/Infrastructure/Create/hooks/useValidateInfrastructureForm.jsx b/client/src/Pages/v1/Infrastructure/Create/hooks/useValidateInfrastructureForm.jsx similarity index 85% rename from client/src/Pages/Infrastructure/Create/hooks/useValidateInfrastructureForm.jsx rename to client/src/Pages/v1/Infrastructure/Create/hooks/useValidateInfrastructureForm.jsx index 080f441c4..73097d0d8 100644 --- a/client/src/Pages/Infrastructure/Create/hooks/useValidateInfrastructureForm.jsx +++ b/client/src/Pages/v1/Infrastructure/Create/hooks/useValidateInfrastructureForm.jsx @@ -1,6 +1,6 @@ import { useState } from "react"; -import { infrastructureMonitorValidation } from "../../../../Validation/validation"; -import { createToast } from "../../../../Utils/toastUtils"; +import { infrastructureMonitorValidation } from "../../../../../Validation/validation.js"; +import { createToast } from "../../../../../Utils/toastUtils.jsx"; const useValidateInfrastructureForm = () => { const [errors, setErrors] = useState({}); diff --git a/client/src/Pages/Infrastructure/Create/index.jsx b/client/src/Pages/v1/Infrastructure/Create/index.jsx similarity index 92% rename from client/src/Pages/Infrastructure/Create/index.jsx rename to client/src/Pages/v1/Infrastructure/Create/index.jsx index a9d16c926..06ecdff6c 100644 --- a/client/src/Pages/Infrastructure/Create/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Create/index.jsx @@ -1,18 +1,18 @@ //Components -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import ConfigBox from "../../../Components/ConfigBox"; -import FieldWrapper from "../../../Components/Inputs/FieldWrapper"; -import Link from "../../../Components/Link"; -import Select from "../../../Components/Inputs/Select"; -import TextInput from "../../../Components/Inputs/TextInput"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import ConfigBox from "../../../../Components/ConfigBox/index.jsx"; +import FieldWrapper from "../../../../Components/Inputs/FieldWrapper/index.jsx"; +import Link from "../../../../Components/Link/index.jsx"; +import Select from "../../../../Components/Inputs/Select/index.jsx"; +import TextInput from "../../../../Components/Inputs/TextInput/index.jsx"; import { Box, Stack, Typography, Button, ButtonGroup } from "@mui/material"; -import { HttpAdornment } from "../../../Components/Inputs/TextInput/Adornments"; -import MonitorStatusHeader from "./Components/MonitorStatusHeader"; -import MonitorActionButtons from "./Components/MonitorActionButtons"; -import CustomAlertsSection from "./Components/CustomAlertsSection"; +import { HttpAdornment } from "../../../../Components/Inputs/TextInput/Adornments/index.jsx"; +import MonitorStatusHeader from "./Components/MonitorStatusHeader.jsx"; +import MonitorActionButtons from "./Components/MonitorActionButtons.jsx"; +import CustomAlertsSection from "./Components/CustomAlertsSection.jsx"; // Utils -import NotificationsConfig from "../../../Components/NotificationConfig"; -import { useGetNotificationsByTeamId } from "../../../Hooks/useNotifications"; +import NotificationsConfig from "../../../../Components/NotificationConfig/index.jsx"; +import { useGetNotificationsByTeamId } from "../../../../Hooks/v1/useNotifications.js"; import { useParams } from "react-router-dom"; import { useState, useEffect } from "react"; import { useTheme } from "@emotion/react"; @@ -22,10 +22,10 @@ import { useFetchGlobalSettings, useFetchHardwareMonitorById, usePauseMonitor, -} from "../../../Hooks/monitorHooks"; -import useInfrastructureMonitorForm from "./hooks/useInfrastructureMonitorForm"; -import useValidateInfrastructureForm from "./hooks/useValidateInfrastructureForm"; -import useInfrastructureSubmit from "./hooks/useInfrastructureSubmit"; +} from "../../../../Hooks/v1/monitorHooks.js"; +import useInfrastructureMonitorForm from "./hooks/useInfrastructureMonitorForm.jsx"; +import useValidateInfrastructureForm from "./hooks/useValidateInfrastructureForm.jsx"; +import useInfrastructureSubmit from "./hooks/useInfrastructureSubmit.jsx"; const CreateInfrastructureMonitor = () => { const { monitorId } = useParams(); diff --git a/client/src/Pages/Infrastructure/Details/Components/AreaChartBoxes/InfraAreaChart.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/AreaChartBoxes/InfraAreaChart.jsx similarity index 79% rename from client/src/Pages/Infrastructure/Details/Components/AreaChartBoxes/InfraAreaChart.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/AreaChartBoxes/InfraAreaChart.jsx index 9544bcf2a..47f33a5e6 100644 --- a/client/src/Pages/Infrastructure/Details/Components/AreaChartBoxes/InfraAreaChart.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/Components/AreaChartBoxes/InfraAreaChart.jsx @@ -1,10 +1,10 @@ // Components import { Typography } from "@mui/material"; -import BaseContainer from "../BaseContainer"; -import AreaChart from "../../../../../Components/Charts/AreaChart"; +import BaseContainer from "../BaseContainer/index.jsx"; +import AreaChart from "../../../../../../Components/Charts/AreaChart/index.jsx"; // Utils import { useTheme } from "@emotion/react"; -import { useHardwareUtils } from "../../Hooks/useHardwareUtils"; +import { useHardwareUtils } from "../../Hooks/useHardwareUtils.jsx"; const InfraAreaChart = ({ config }) => { const theme = useTheme(); const { getDimensions } = useHardwareUtils(); diff --git a/client/src/Pages/Infrastructure/Details/Components/AreaChartBoxes/index.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/AreaChartBoxes/index.jsx similarity index 93% rename from client/src/Pages/Infrastructure/Details/Components/AreaChartBoxes/index.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/AreaChartBoxes/index.jsx index 0eb3aa36d..3dfb4edd8 100644 --- a/client/src/Pages/Infrastructure/Details/Components/AreaChartBoxes/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/Components/AreaChartBoxes/index.jsx @@ -1,7 +1,7 @@ // Components import { Stack } from "@mui/material"; -import InfraAreaChart from "./InfraAreaChart"; -import SkeletonLayout from "./skeleton"; +import InfraAreaChart from "./InfraAreaChart.jsx"; +import SkeletonLayout from "./skeleton.jsx"; // Utils import { @@ -9,9 +9,9 @@ import { TzTick, InfrastructureTooltip, TemperatureTooltip, -} from "../../../../../Components/Charts/Utils/chartUtils"; +} from "../../../../../../Components/Charts/Utils/chartUtils.jsx"; import { useTheme } from "@emotion/react"; -import { useHardwareUtils } from "../../Hooks/useHardwareUtils"; +import { useHardwareUtils } from "../../Hooks/useHardwareUtils.jsx"; import { useTranslation } from "react-i18next"; const AreaChartBoxes = ({ shouldRender, monitor, dateRange }) => { const theme = useTheme(); diff --git a/client/src/Pages/Infrastructure/Details/Components/AreaChartBoxes/skeleton.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/AreaChartBoxes/skeleton.jsx similarity index 100% rename from client/src/Pages/Infrastructure/Details/Components/AreaChartBoxes/skeleton.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/AreaChartBoxes/skeleton.jsx diff --git a/client/src/Pages/Infrastructure/Details/Components/BaseContainer/index.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/BaseContainer/index.jsx similarity index 94% rename from client/src/Pages/Infrastructure/Details/Components/BaseContainer/index.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/BaseContainer/index.jsx index 246769751..dd73d1a65 100644 --- a/client/src/Pages/Infrastructure/Details/Components/BaseContainer/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/Components/BaseContainer/index.jsx @@ -11,7 +11,7 @@ import { Box } from "@mui/material"; // Utils import { useTheme } from "@emotion/react"; -import { useHardwareUtils } from "../../Hooks/useHardwareUtils"; +import { useHardwareUtils } from "../../Hooks/useHardwareUtils.jsx"; import PropTypes from "prop-types"; const BaseContainer = ({ children, sx = {} }) => { diff --git a/client/src/Pages/Infrastructure/Details/Components/GaugeBoxes/Gauge.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/Gauge.jsx similarity index 93% rename from client/src/Pages/Infrastructure/Details/Components/GaugeBoxes/Gauge.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/Gauge.jsx index 70d36bd00..5c55119ad 100644 --- a/client/src/Pages/Infrastructure/Details/Components/GaugeBoxes/Gauge.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/Gauge.jsx @@ -1,6 +1,6 @@ // Components -import CustomGauge from "../../../../../Components/Charts/CustomGauge"; -import BaseContainer from "../BaseContainer"; +import CustomGauge from "../../../../../../Components/Charts/CustomGauge/index.jsx"; +import BaseContainer from "../BaseContainer/index.jsx"; import { Stack, Typography, Box } from "@mui/material"; // Utils import { useTheme } from "@emotion/react"; diff --git a/client/src/Pages/Infrastructure/Details/Components/GaugeBoxes/index.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/index.jsx similarity index 93% rename from client/src/Pages/Infrastructure/Details/Components/GaugeBoxes/index.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/index.jsx index 3c1c68f8b..432881e7e 100644 --- a/client/src/Pages/Infrastructure/Details/Components/GaugeBoxes/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/index.jsx @@ -1,11 +1,11 @@ // Components import { Stack } from "@mui/material"; -import Gauge from "./Gauge"; -import SkeletonLayout from "./skeleton"; +import Gauge from "./Gauge.jsx"; +import SkeletonLayout from "./skeleton.jsx"; import PropTypes from "prop-types"; // Utils -import { useHardwareUtils } from "../../Hooks/useHardwareUtils"; +import { useHardwareUtils } from "../../Hooks/useHardwareUtils.jsx"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Infrastructure/Details/Components/GaugeBoxes/skeleton.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/skeleton.jsx similarity index 100% rename from client/src/Pages/Infrastructure/Details/Components/GaugeBoxes/skeleton.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/GaugeBoxes/skeleton.jsx diff --git a/client/src/Pages/Infrastructure/Details/Components/NetworkStats/NetworkCharts.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/NetworkStats/NetworkCharts.jsx similarity index 93% rename from client/src/Pages/Infrastructure/Details/Components/NetworkStats/NetworkCharts.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/NetworkStats/NetworkCharts.jsx index 9157a3432..5cfdba350 100644 --- a/client/src/Pages/Infrastructure/Details/Components/NetworkStats/NetworkCharts.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/Components/NetworkStats/NetworkCharts.jsx @@ -1,15 +1,15 @@ import PropTypes from "prop-types"; import { Stack, Typography } from "@mui/material"; -import InfraAreaChart from "../../../../../Pages/Infrastructure/Details/Components/AreaChartBoxes/InfraAreaChart"; +import InfraAreaChart from "../AreaChartBoxes/InfraAreaChart.jsx"; import { TzTick, InfrastructureTooltip, NetworkTick, -} from "../../../../../Components/Charts/Utils/chartUtils"; +} from "../../../../../../Components/Charts/Utils/chartUtils.jsx"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; -import { useHardwareUtils } from "../../Hooks/useHardwareUtils"; +import { useHardwareUtils } from "../../Hooks/useHardwareUtils.jsx"; const NetworkCharts = ({ ethernetData, dateRange }) => { const theme = useTheme(); diff --git a/client/src/Pages/Infrastructure/Details/Components/NetworkStats/NetworkStatBoxes.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/NetworkStats/NetworkStatBoxes.jsx similarity index 90% rename from client/src/Pages/Infrastructure/Details/Components/NetworkStats/NetworkStatBoxes.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/NetworkStats/NetworkStatBoxes.jsx index 98ba90dae..52ccf0805 100644 --- a/client/src/Pages/Infrastructure/Details/Components/NetworkStats/NetworkStatBoxes.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/Components/NetworkStats/NetworkStatBoxes.jsx @@ -1,9 +1,9 @@ import PropTypes from "prop-types"; -import StatusBoxes from "../../../../../Components/StatusBoxes"; -import StatBox from "../../../../../Components/StatBox"; +import StatusBoxes from "../../../../../../Components/StatusBoxes/index.jsx"; +import StatBox from "../../../../../../Components/StatBox/index.jsx"; import { Typography } from "@mui/material"; import { useTranslation } from "react-i18next"; -import { useHardwareUtils } from "../../Hooks/useHardwareUtils"; +import { useHardwareUtils } from "../../Hooks/useHardwareUtils.jsx"; function formatNumber(num) { return num != null ? num.toLocaleString() : "0"; diff --git a/client/src/Pages/Infrastructure/Details/Components/NetworkStats/index.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/NetworkStats/index.jsx similarity index 90% rename from client/src/Pages/Infrastructure/Details/Components/NetworkStats/index.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/NetworkStats/index.jsx index 41d2b0a87..e0d6986e1 100644 --- a/client/src/Pages/Infrastructure/Details/Components/NetworkStats/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/Components/NetworkStats/index.jsx @@ -3,10 +3,10 @@ import { useState, useEffect } from "react"; import { Box } from "@mui/material"; import { useTranslation } from "react-i18next"; import { useTheme } from "@emotion/react"; -import Select from "../../../../../Components/Inputs/Select"; -import NetworkStatBoxes from "./NetworkStatBoxes"; -import NetworkCharts from "./NetworkCharts"; -import MonitorTimeFrameHeader from "../../../../../Components/MonitorTimeFrameHeader"; +import Select from "../../../../../../Components/Inputs/Select/index.jsx"; +import NetworkStatBoxes from "./NetworkStatBoxes.jsx"; +import NetworkCharts from "./NetworkCharts.jsx"; +import MonitorTimeFrameHeader from "../../../../../../Components/MonitorTimeFrameHeader/index.jsx"; const getAvailableInterfaces = (net) => { return (net || []).map((iface) => iface.name).filter(Boolean); diff --git a/client/src/Pages/Infrastructure/Details/Components/NetworkStats/skeleton.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/NetworkStats/skeleton.jsx similarity index 100% rename from client/src/Pages/Infrastructure/Details/Components/NetworkStats/skeleton.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/NetworkStats/skeleton.jsx diff --git a/client/src/Pages/Infrastructure/Details/Components/StatusBoxes/index.jsx b/client/src/Pages/v1/Infrastructure/Details/Components/StatusBoxes/index.jsx similarity index 90% rename from client/src/Pages/Infrastructure/Details/Components/StatusBoxes/index.jsx rename to client/src/Pages/v1/Infrastructure/Details/Components/StatusBoxes/index.jsx index 6c11e7c82..47862449e 100644 --- a/client/src/Pages/Infrastructure/Details/Components/StatusBoxes/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/Components/StatusBoxes/index.jsx @@ -1,11 +1,11 @@ // Components import { Stack, Typography } from "@mui/material"; -import StatusBoxes from "../../../../../Components/StatusBoxes"; -import StatBox from "../../../../../Components/StatBox"; +import StatusBoxes from "../../../../../../Components/StatusBoxes/index.jsx"; +import StatBox from "../../../../../../Components/StatBox/index.jsx"; //Utils -import { useMonitorUtils } from "../../../../../Hooks/useMonitorUtils"; -import { useHardwareUtils } from "../../Hooks/useHardwareUtils"; +import { useMonitorUtils } from "../../../../../../Hooks/v1/useMonitorUtils.js"; +import { useHardwareUtils } from "../../Hooks/useHardwareUtils.jsx"; import { useTranslation } from "react-i18next"; const InfraStatBoxes = ({ shouldRender, monitor }) => { diff --git a/client/src/Pages/Infrastructure/Details/Hooks/useHardwareUtils.jsx b/client/src/Pages/v1/Infrastructure/Details/Hooks/useHardwareUtils.jsx similarity index 100% rename from client/src/Pages/Infrastructure/Details/Hooks/useHardwareUtils.jsx rename to client/src/Pages/v1/Infrastructure/Details/Hooks/useHardwareUtils.jsx diff --git a/client/src/Pages/Infrastructure/Details/index.jsx b/client/src/Pages/v1/Infrastructure/Details/index.jsx similarity index 79% rename from client/src/Pages/Infrastructure/Details/index.jsx rename to client/src/Pages/v1/Infrastructure/Details/index.jsx index a16f3906b..04691d985 100644 --- a/client/src/Pages/Infrastructure/Details/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Details/index.jsx @@ -1,20 +1,20 @@ // Components import { Stack, Typography, Tab } from "@mui/material"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import MonitorDetailsControlHeader from "../../../Components/MonitorDetailsControlHeader"; -import MonitorTimeFrameHeader from "../../../Components/MonitorTimeFrameHeader"; -import StatusBoxes from "./Components/StatusBoxes"; -import GaugeBoxes from "./Components/GaugeBoxes"; -import AreaChartBoxes from "./Components/AreaChartBoxes"; -import GenericFallback from "../../../Components/GenericFallback"; -import NetworkStats from "./Components/NetworkStats"; -import CustomTabList from "../../../Components/Tab"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import MonitorDetailsControlHeader from "../../../../Components/MonitorDetailsControlHeader/index.jsx"; +import MonitorTimeFrameHeader from "../../../../Components/MonitorTimeFrameHeader/index.jsx"; +import StatusBoxes from "./Components/StatusBoxes/index.jsx"; +import GaugeBoxes from "./Components/GaugeBoxes/index.jsx"; +import AreaChartBoxes from "./Components/AreaChartBoxes/index.jsx"; +import GenericFallback from "../../../../Components/GenericFallback/index.jsx"; +import NetworkStats from "./Components/NetworkStats/index.jsx"; +import CustomTabList from "../../../../Components/Tab/index.jsx"; import TabContext from "@mui/lab/TabContext"; // Utils import { useTheme } from "@emotion/react"; -import { useIsAdmin } from "../../../Hooks/useIsAdmin"; -import { useFetchHardwareMonitorById } from "../../../Hooks/monitorHooks"; +import { useIsAdmin } from "../../../../Hooks/v1/useIsAdmin.js"; +import { useFetchHardwareMonitorById } from "../../../../Hooks/v1/monitorHooks.js"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { useParams } from "react-router-dom"; diff --git a/client/src/Pages/Infrastructure/Monitors/Components/Filters/index.jsx b/client/src/Pages/v1/Infrastructure/Monitors/Components/Filters/index.jsx similarity index 96% rename from client/src/Pages/Infrastructure/Monitors/Components/Filters/index.jsx rename to client/src/Pages/v1/Infrastructure/Monitors/Components/Filters/index.jsx index 3c2511c2f..bef632e88 100644 --- a/client/src/Pages/Infrastructure/Monitors/Components/Filters/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Monitors/Components/Filters/index.jsx @@ -1,6 +1,6 @@ import { useTheme } from "@emotion/react"; import PropTypes from "prop-types"; -import FilterHeader from "../../../../../Components/FilterHeader"; +import FilterHeader from "../../../../../../Components/FilterHeader/index.jsx"; import { useMemo } from "react"; import { Box, Button } from "@mui/material"; import ClearIcon from "@mui/icons-material/Clear"; diff --git a/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTable/index.jsx b/client/src/Pages/v1/Infrastructure/Monitors/Components/MonitorsTable/index.jsx similarity index 86% rename from client/src/Pages/Infrastructure/Monitors/Components/MonitorsTable/index.jsx rename to client/src/Pages/v1/Infrastructure/Monitors/Components/MonitorsTable/index.jsx index 7ee603ef7..801a9bc6a 100644 --- a/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTable/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Monitors/Components/MonitorsTable/index.jsx @@ -1,18 +1,18 @@ // Components import { Box } from "@mui/material"; -import DataTable from "../../../../../Components/Table"; -import Host from "../../../../../Components/Host"; -import { StatusLabel } from "../../../../../Components/Label"; +import DataTable from "../../../../../../Components/Table/index.jsx"; +import Host from "../../../../../../Components/Host/index.jsx"; +import { StatusLabel } from "../../../../../../Components/Label/index.jsx"; import { Stack } from "@mui/material"; -import { InfrastructureMenu } from "../MonitorsTableMenu"; -import LoadingSpinner from "../../../../Uptime/Monitors/Components/LoadingSpinner"; +import { InfrastructureMenu } from "../MonitorsTableMenu/index.jsx"; +import LoadingSpinner from "../../../../Uptime/Monitors/Components/LoadingSpinner/index.jsx"; // Assets -import CPUChipIcon from "../../../../../assets/icons/cpu-chip.svg?react"; -import CustomGauge from "../../../../../Components/Charts/CustomGauge"; +import CPUChipIcon from "../../../../../../assets/icons/cpu-chip.svg?react"; +import CustomGauge from "../../../../../../Components/Charts/CustomGauge/index.jsx"; // Utils import { useTheme } from "@emotion/react"; -import { useMonitorUtils } from "../../../../../Hooks/useMonitorUtils"; +import { useMonitorUtils } from "../../../../../../Hooks/v1/useMonitorUtils.js"; import { useNavigate } from "react-router-dom"; import PropTypes from "prop-types"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTableMenu/index.jsx b/client/src/Pages/v1/Infrastructure/Monitors/Components/MonitorsTableMenu/index.jsx similarity index 93% rename from client/src/Pages/Infrastructure/Monitors/Components/MonitorsTableMenu/index.jsx rename to client/src/Pages/v1/Infrastructure/Monitors/Components/MonitorsTableMenu/index.jsx index 147f1c297..c2270c691 100644 --- a/client/src/Pages/Infrastructure/Monitors/Components/MonitorsTableMenu/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Monitors/Components/MonitorsTableMenu/index.jsx @@ -3,13 +3,13 @@ import { useRef, useState } from "react"; import { useTheme } from "@emotion/react"; import { useNavigate } from "react-router-dom"; -import { createToast } from "../../../../../Utils/toastUtils"; +import { createToast } from "../../../../../../Utils/toastUtils.jsx"; import { IconButton, Menu, MenuItem } from "@mui/material"; -import Settings from "../../../../../assets/icons/settings-bold.svg?react"; +import Settings from "../../../../../../assets/icons/settings-bold.svg?react"; import PropTypes from "prop-types"; -import Dialog from "../../../../../Components/Dialog"; -import { networkService } from "../../../../../Utils/NetworkService.js"; -import { usePauseMonitor } from "../../../../../Hooks/monitorHooks"; +import Dialog from "../../../../../../Components/Dialog/index.jsx"; +import { networkService } from "../../../../../../Utils/NetworkService.js"; +import { usePauseMonitor } from "../../../../../../Hooks/v1/monitorHooks.js"; import { useTranslation } from "react-i18next"; /** diff --git a/client/src/Pages/Infrastructure/Monitors/index.jsx b/client/src/Pages/v1/Infrastructure/Monitors/index.jsx similarity index 80% rename from client/src/Pages/Infrastructure/Monitors/index.jsx rename to client/src/Pages/v1/Infrastructure/Monitors/index.jsx index bfd2270fe..7fbfa1167 100644 --- a/client/src/Pages/Infrastructure/Monitors/index.jsx +++ b/client/src/Pages/v1/Infrastructure/Monitors/index.jsx @@ -1,21 +1,21 @@ // Components import { Stack } from "@mui/material"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import MonitorCountHeader from "../../../Components/MonitorCountHeader"; -import MonitorCreateHeader from "../../../Components/MonitorCreateHeader"; -import MonitorsTable from "./Components/MonitorsTable"; -import Pagination from "../../..//Components/Table/TablePagination"; -import PageStateWrapper from "../../../Components/PageStateWrapper"; -import Filter from "./Components/Filters"; -import SearchComponent from "../../Uptime/Monitors/Components/SearchComponent"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import MonitorCountHeader from "../../../../Components/MonitorCountHeader/index.jsx"; +import MonitorCreateHeader from "../../../../Components/MonitorCreateHeader/index.jsx"; +import MonitorsTable from "./Components/MonitorsTable/index.jsx"; +import Pagination from "../../../../Components/Table/TablePagination/index.jsx"; +import PageStateWrapper from "../../../../Components/PageStateWrapper/index.jsx"; +import Filter from "./Components/Filters/index.jsx"; +import SearchComponent from "../../Uptime/Monitors/Components/SearchComponent/index.jsx"; // Utils import { useTheme } from "@emotion/react"; import { useEffect, useState } from "react"; -import { useIsAdmin } from "../../../Hooks/useIsAdmin"; +import { useIsAdmin } from "../../../../Hooks/v1/useIsAdmin.js"; import { useTranslation } from "react-i18next"; -import { useFetchMonitorsByTeamId } from "../../../Hooks/monitorHooks"; +import { useFetchMonitorsByTeamId } from "../../../../Hooks/v1/monitorHooks.js"; import { useDispatch, useSelector } from "react-redux"; -import { setRowsPerPage } from "../../../Features/UI/uiSlice"; +import { setRowsPerPage } from "../../../../Features/UI/uiSlice.js"; // Constants const TYPES = ["hardware"]; const BREADCRUMBS = [{ name: `infrastructure`, path: "/infrastructure" }]; diff --git a/client/src/Pages/Integrations/index.css b/client/src/Pages/v1/Integrations/index.css similarity index 100% rename from client/src/Pages/Integrations/index.css rename to client/src/Pages/v1/Integrations/index.css diff --git a/client/src/Pages/Integrations/index.jsx b/client/src/Pages/v1/Integrations/index.jsx similarity index 94% rename from client/src/Pages/Integrations/index.jsx rename to client/src/Pages/v1/Integrations/index.jsx index fe0faa5cf..dde6b52ee 100644 --- a/client/src/Pages/Integrations/index.jsx +++ b/client/src/Pages/v1/Integrations/index.jsx @@ -1,9 +1,9 @@ import PropTypes from "prop-types"; import { Stack, Typography, Grid, Button } from "@mui/material"; import { useTheme } from "@emotion/react"; -import Discord from "../../assets/icons/discord-icon.svg?react"; -import Slack from "../../assets/icons/slack-icon.svg?react"; -import Zapier from "../../assets/icons/zapier-icon.svg?react"; +import Discord from "../../../assets/icons/discord-icon.svg?react"; +import Slack from "../../../assets/icons/slack-icon.svg?react"; +import Zapier from "../../../assets/icons/zapier-icon.svg?react"; import { useTranslation } from "react-i18next"; import "./index.css"; diff --git a/client/src/Pages/Logs/Diagnostics/components/gauges/index.jsx b/client/src/Pages/v1/Logs/Diagnostics/components/gauges/index.jsx similarity index 96% rename from client/src/Pages/Logs/Diagnostics/components/gauges/index.jsx rename to client/src/Pages/v1/Logs/Diagnostics/components/gauges/index.jsx index 5bb227b7c..082be2587 100644 --- a/client/src/Pages/Logs/Diagnostics/components/gauges/index.jsx +++ b/client/src/Pages/v1/Logs/Diagnostics/components/gauges/index.jsx @@ -1,11 +1,11 @@ import Stack from "@mui/material/Stack"; -import CustomGauge from "../../../../../Components/Charts/CustomGauge"; +import CustomGauge from "../../../../../../Components/Charts/CustomGauge/index.jsx"; import Typography from "@mui/material/Typography"; // Utils import { useTheme } from "@emotion/react"; import PropTypes from "prop-types"; -import { getPercentage, formatBytes } from "../../utils/utils"; +import { getPercentage, formatBytes } from "../../utils/utils.js"; import { useTranslation } from "react-i18next"; import { Box } from "@mui/material"; diff --git a/client/src/Pages/Logs/Diagnostics/components/stats/index.jsx b/client/src/Pages/v1/Logs/Diagnostics/components/stats/index.jsx similarity index 94% rename from client/src/Pages/Logs/Diagnostics/components/stats/index.jsx rename to client/src/Pages/v1/Logs/Diagnostics/components/stats/index.jsx index 103d1c698..b99f34506 100644 --- a/client/src/Pages/Logs/Diagnostics/components/stats/index.jsx +++ b/client/src/Pages/v1/Logs/Diagnostics/components/stats/index.jsx @@ -7,8 +7,8 @@ import CircularProgress from "@mui/material/CircularProgress"; import { useTheme } from "@emotion/react"; import PropTypes from "prop-types"; -import { getHumanReadableDuration } from "../../../../../Utils/timeUtils"; -import { formatBytes } from "../../utils/utils"; +import { getHumanReadableDuration } from "../../../../../../Utils/timeUtils.js"; +import { formatBytes } from "../../utils/utils.js"; import { useTranslation } from "react-i18next"; const StatsCard = ({ title, value, unit = "", isLoading }) => { diff --git a/client/src/Pages/Logs/Diagnostics/index.jsx b/client/src/Pages/v1/Logs/Diagnostics/index.jsx similarity index 82% rename from client/src/Pages/Logs/Diagnostics/index.jsx rename to client/src/Pages/v1/Logs/Diagnostics/index.jsx index 72ee47f48..d7a1a8a7c 100644 --- a/client/src/Pages/Logs/Diagnostics/index.jsx +++ b/client/src/Pages/v1/Logs/Diagnostics/index.jsx @@ -1,14 +1,14 @@ import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; -import Gauges from "./components/gauges"; +import Gauges from "./components/gauges/index.jsx"; import Button from "@mui/material/Button"; -import StatBox from "../../../Components/StatBox"; -import StatusBoxes from "../../../Components/StatusBoxes"; +import StatBox from "../../../../Components/StatBox/index.jsx"; +import StatusBoxes from "../../../../Components/StatusBoxes/index.jsx"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; -import { useFetchDiagnostics } from "../../../Hooks/logHooks"; -import { getHumanReadableDuration } from "../../../Utils/timeUtils"; -import { formatBytes, getPercentage } from "./utils/utils"; +import { useFetchDiagnostics } from "../../../../Hooks/v1/logHooks.js"; +import { getHumanReadableDuration } from "../../../../Utils/timeUtils.js"; +import { formatBytes, getPercentage } from "./utils/utils.js"; const Diagnostics = () => { // Local state diff --git a/client/src/Pages/Logs/Diagnostics/utils/utils.js b/client/src/Pages/v1/Logs/Diagnostics/utils/utils.js similarity index 100% rename from client/src/Pages/Logs/Diagnostics/utils/utils.js rename to client/src/Pages/v1/Logs/Diagnostics/utils/utils.js diff --git a/client/src/Pages/Logs/Logs/index.jsx b/client/src/Pages/v1/Logs/Logs/index.jsx similarity index 94% rename from client/src/Pages/Logs/Logs/index.jsx rename to client/src/Pages/v1/Logs/Logs/index.jsx index b44b3fd1a..5c7ad9fa9 100644 --- a/client/src/Pages/Logs/Logs/index.jsx +++ b/client/src/Pages/v1/Logs/Logs/index.jsx @@ -1,10 +1,10 @@ import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; -import Select from "../../../Components/Inputs/Select"; +import Select from "../../../../Components/Inputs/Select/index.jsx"; import Typography from "@mui/material/Typography"; import Divider from "@mui/material/Divider"; -import { useFetchLogs } from "../../../Hooks/logHooks"; +import { useFetchLogs } from "../../../../Hooks/v1/logHooks.js"; import { useTheme } from "@emotion/react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Logs/Queue/components/FailedJobTable/index.jsx b/client/src/Pages/v1/Logs/Queue/components/FailedJobTable/index.jsx similarity index 92% rename from client/src/Pages/Logs/Queue/components/FailedJobTable/index.jsx rename to client/src/Pages/v1/Logs/Queue/components/FailedJobTable/index.jsx index 94fc2f5c3..46be9520c 100644 --- a/client/src/Pages/Logs/Queue/components/FailedJobTable/index.jsx +++ b/client/src/Pages/v1/Logs/Queue/components/FailedJobTable/index.jsx @@ -1,10 +1,10 @@ import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import DataTable from "../../../../../Components/Table"; +import DataTable from "../../../../../../Components/Table/index.jsx"; import { useNavigate } from "react-router-dom"; import { useTheme } from "@emotion/react"; -import { TypeToPathMap } from "../../../../../Utils/monitorUtils"; +import { TypeToPathMap } from "../../../../../../Utils/monitorUtils.js"; import PropTypes from "prop-types"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Logs/Queue/components/JobTable/index.jsx b/client/src/Pages/v1/Logs/Queue/components/JobTable/index.jsx similarity index 92% rename from client/src/Pages/Logs/Queue/components/JobTable/index.jsx rename to client/src/Pages/v1/Logs/Queue/components/JobTable/index.jsx index fab85ec5d..4ac4069bd 100644 --- a/client/src/Pages/Logs/Queue/components/JobTable/index.jsx +++ b/client/src/Pages/v1/Logs/Queue/components/JobTable/index.jsx @@ -1,13 +1,13 @@ import Stack from "@mui/material/Stack"; -import DataTable from "../../../../../Components/Table"; +import DataTable from "../../../../../../Components/Table/index.jsx"; import Typography from "@mui/material/Typography"; // Utils import PropTypes from "prop-types"; import { useTheme } from "@emotion/react"; import { useNavigate } from "react-router-dom"; -import { TypeToPathMap } from "../../../../../Utils/monitorUtils"; +import { TypeToPathMap } from "../../../../../../Utils/monitorUtils.js"; import { useTranslation } from "react-i18next"; -import { createHeaderFactory } from "../../../../../Components/Table/TableUtils"; +import { createHeaderFactory } from "../../../../../../Components/Table/TableUtils.js"; const JobTable = ({ jobs = [] }) => { const theme = useTheme(); diff --git a/client/src/Pages/Logs/Queue/components/Metrics/index.jsx b/client/src/Pages/v1/Logs/Queue/components/Metrics/index.jsx similarity index 84% rename from client/src/Pages/Logs/Queue/components/Metrics/index.jsx rename to client/src/Pages/v1/Logs/Queue/components/Metrics/index.jsx index b0112fa99..dd9fdcc6a 100644 --- a/client/src/Pages/Logs/Queue/components/Metrics/index.jsx +++ b/client/src/Pages/v1/Logs/Queue/components/Metrics/index.jsx @@ -1,6 +1,6 @@ import Stack from "@mui/material/Stack"; -import StatBox from "../../../../../Components/StatBox"; -import StatusBoxes from "../../../../../Components/StatusBoxes"; +import StatBox from "../../../../../../Components/StatBox/index.jsx"; +import StatusBoxes from "../../../../../../Components/StatusBoxes/index.jsx"; import { useTranslation } from "react-i18next"; import { useTheme } from "@emotion/react"; diff --git a/client/src/Pages/Logs/Queue/components/MetricsTable/index.jsx b/client/src/Pages/v1/Logs/Queue/components/MetricsTable/index.jsx similarity index 94% rename from client/src/Pages/Logs/Queue/components/MetricsTable/index.jsx rename to client/src/Pages/v1/Logs/Queue/components/MetricsTable/index.jsx index 204b90035..58f13fd5d 100644 --- a/client/src/Pages/Logs/Queue/components/MetricsTable/index.jsx +++ b/client/src/Pages/v1/Logs/Queue/components/MetricsTable/index.jsx @@ -1,6 +1,6 @@ import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import DataTable from "../../../../../Components/Table"; +import DataTable from "../../../../../../Components/Table/index.jsx"; // Utils import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Logs/Queue/index.jsx b/client/src/Pages/v1/Logs/Queue/index.jsx similarity index 86% rename from client/src/Pages/Logs/Queue/index.jsx rename to client/src/Pages/v1/Logs/Queue/index.jsx index fde9073fc..10eca4d3b 100644 --- a/client/src/Pages/Logs/Queue/index.jsx +++ b/client/src/Pages/v1/Logs/Queue/index.jsx @@ -1,8 +1,8 @@ // Components import Stack from "@mui/material/Stack"; -import JobTable from "./components/JobTable"; -import Metrics from "./components/Metrics"; -import FailedJobTable from "./components/FailedJobTable"; +import JobTable from "./components/JobTable/index.jsx"; +import Metrics from "./components/Metrics/index.jsx"; +import FailedJobTable from "./components/FailedJobTable/index.jsx"; import ButtonGroup from "@mui/material/ButtonGroup"; import Button from "@mui/material/Button"; import Typography from "@mui/material/Typography"; @@ -10,7 +10,7 @@ import Divider from "@mui/material/Divider"; // Utils import { useState } from "react"; -import { useFetchQueueData, useFlushQueue } from "../../../Hooks/logHooks"; +import { useFetchQueueData, useFlushQueue } from "../../../../Hooks/v1/logHooks.js"; import { useTranslation } from "react-i18next"; import { useTheme } from "@emotion/react"; diff --git a/client/src/Pages/Logs/index.jsx b/client/src/Pages/v1/Logs/index.jsx similarity index 84% rename from client/src/Pages/Logs/index.jsx rename to client/src/Pages/v1/Logs/index.jsx index 79c89f282..c6dfe4d99 100644 --- a/client/src/Pages/Logs/index.jsx +++ b/client/src/Pages/v1/Logs/index.jsx @@ -1,10 +1,10 @@ import Stack from "@mui/material/Stack"; -import Breadcrumbs from "../../Components/Breadcrumbs"; +import Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx"; import Tabs from "@mui/material/Tabs"; import Tab from "@mui/material/Tab"; -import Queue from "./Queue"; -import LogsComponent from "./Logs"; -import Diagnostics from "./Diagnostics"; +import Queue from "./Queue/index.jsx"; +import LogsComponent from "./Logs/index.jsx"; +import Diagnostics from "./Diagnostics/index.jsx"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Maintenance/CreateMaintenance/Components/ConfigSelect/index.jsx b/client/src/Pages/v1/Maintenance/CreateMaintenance/Components/ConfigSelect/index.jsx similarity index 92% rename from client/src/Pages/Maintenance/CreateMaintenance/Components/ConfigSelect/index.jsx rename to client/src/Pages/v1/Maintenance/CreateMaintenance/Components/ConfigSelect/index.jsx index 1627ef3d5..b43bcbfc7 100644 --- a/client/src/Pages/Maintenance/CreateMaintenance/Components/ConfigSelect/index.jsx +++ b/client/src/Pages/v1/Maintenance/CreateMaintenance/Components/ConfigSelect/index.jsx @@ -1,4 +1,4 @@ -import Select from "../../../../../Components/Inputs/Select"; +import Select from "../../../../../../Components/Inputs/Select/index.jsx"; import PropTypes from "prop-types"; const ConfigSelect = ({ configSelection, valueSelect, onChange, ...props }) => { const getValueById = (config, id) => { diff --git a/client/src/Pages/Maintenance/CreateMaintenance/Components/MonitorList/index.jsx b/client/src/Pages/v1/Maintenance/CreateMaintenance/Components/MonitorList/index.jsx similarity index 100% rename from client/src/Pages/Maintenance/CreateMaintenance/Components/MonitorList/index.jsx rename to client/src/Pages/v1/Maintenance/CreateMaintenance/Components/MonitorList/index.jsx diff --git a/client/src/Pages/Maintenance/CreateMaintenance/Components/MonitorsConfig/index.jsx b/client/src/Pages/v1/Maintenance/CreateMaintenance/Components/MonitorsConfig/index.jsx similarity index 93% rename from client/src/Pages/Maintenance/CreateMaintenance/Components/MonitorsConfig/index.jsx rename to client/src/Pages/v1/Maintenance/CreateMaintenance/Components/MonitorsConfig/index.jsx index e792734ff..91e6a1531 100644 --- a/client/src/Pages/Maintenance/CreateMaintenance/Components/MonitorsConfig/index.jsx +++ b/client/src/Pages/v1/Maintenance/CreateMaintenance/Components/MonitorsConfig/index.jsx @@ -1,7 +1,7 @@ import PropTypes from "prop-types"; -import Search from "../../../../../Components/Inputs/Search"; +import Search from "../../../../../../Components/Inputs/Search/index.jsx"; import { useState } from "react"; -import ConfigRow from "../../../../../Components/ConfigRow"; +import ConfigRow from "../../../../../../Components/ConfigRow/index.jsx"; /** * MonitorsConfig is a component that allows users to select and apply a maintenance window to a list of monitors. diff --git a/client/src/Pages/Maintenance/CreateMaintenance/hooks/useMaintenanceActions.jsx b/client/src/Pages/v1/Maintenance/CreateMaintenance/hooks/useMaintenanceActions.jsx similarity index 93% rename from client/src/Pages/Maintenance/CreateMaintenance/hooks/useMaintenanceActions.jsx rename to client/src/Pages/v1/Maintenance/CreateMaintenance/hooks/useMaintenanceActions.jsx index 84333a14f..a75cbe206 100644 --- a/client/src/Pages/Maintenance/CreateMaintenance/hooks/useMaintenanceActions.jsx +++ b/client/src/Pages/v1/Maintenance/CreateMaintenance/hooks/useMaintenanceActions.jsx @@ -1,4 +1,4 @@ -import { networkService } from "../../../../main"; +import { networkService } from "../../../../../main.jsx"; import dayjs from "dayjs"; import { MS_PER_SECOND, @@ -6,7 +6,7 @@ import { MS_PER_HOUR, MS_PER_DAY, MS_PER_WEEK, -} from "../../../../Utils/timeUtils"; +} from "../../../../../Utils/timeUtils.js"; const useMaintenanceActions = () => { const MS_LOOKUP = { diff --git a/client/src/Pages/Maintenance/CreateMaintenance/hooks/useMaintenanceData.jsx b/client/src/Pages/v1/Maintenance/CreateMaintenance/hooks/useMaintenanceData.jsx similarity index 95% rename from client/src/Pages/Maintenance/CreateMaintenance/hooks/useMaintenanceData.jsx rename to client/src/Pages/v1/Maintenance/CreateMaintenance/hooks/useMaintenanceData.jsx index 8ba9b5e80..d21906e41 100644 --- a/client/src/Pages/Maintenance/CreateMaintenance/hooks/useMaintenanceData.jsx +++ b/client/src/Pages/v1/Maintenance/CreateMaintenance/hooks/useMaintenanceData.jsx @@ -1,4 +1,4 @@ -import { networkService } from "../../../../main"; +import { networkService } from "../../../../../main.jsx"; import dayjs from "dayjs"; import { MS_PER_SECOND, @@ -6,7 +6,7 @@ import { MS_PER_HOUR, MS_PER_DAY, MS_PER_WEEK, -} from "../../../../Utils/timeUtils"; +} from "../../../../../Utils/timeUtils.js"; const useMaintenanceData = () => { const REVERSE_REPEAT_LOOKUP = { 0: "none", diff --git a/client/src/Pages/Maintenance/CreateMaintenance/index.css b/client/src/Pages/v1/Maintenance/CreateMaintenance/index.css similarity index 100% rename from client/src/Pages/Maintenance/CreateMaintenance/index.css rename to client/src/Pages/v1/Maintenance/CreateMaintenance/index.css diff --git a/client/src/Pages/Maintenance/CreateMaintenance/index.jsx b/client/src/Pages/v1/Maintenance/CreateMaintenance/index.jsx similarity index 93% rename from client/src/Pages/Maintenance/CreateMaintenance/index.jsx rename to client/src/Pages/v1/Maintenance/CreateMaintenance/index.jsx index 9dbf9d4aa..da3e72d8a 100644 --- a/client/src/Pages/Maintenance/CreateMaintenance/index.jsx +++ b/client/src/Pages/v1/Maintenance/CreateMaintenance/index.jsx @@ -2,27 +2,27 @@ import { Box, Button, Stack, Typography } from "@mui/material"; import { useSelector } from "react-redux"; import { useTheme } from "@emotion/react"; import { useEffect, useState } from "react"; -import ConfigBox from "../../../Components/ConfigBox"; +import ConfigBox from "../../../../Components/ConfigBox/index.jsx"; import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; import { LocalizationProvider } from "@mui/x-date-pickers"; import { DatePicker } from "@mui/x-date-pickers/DatePicker"; import { MobileTimePicker } from "@mui/x-date-pickers/MobileTimePicker"; -import { maintenanceWindowValidation } from "../../../Validation/validation"; -import { createToast } from "../../../Utils/toastUtils"; -import MonitorList from "./Components/MonitorList"; -import ConfigSelect from "./Components/ConfigSelect"; -import useMaintenanceData from "./hooks/useMaintenanceData"; -import useMaintenanceActions from "./hooks/useMaintenanceActions"; +import { maintenanceWindowValidation } from "../../../../Validation/validation.js"; +import { createToast } from "../../../../Utils/toastUtils.jsx"; +import MonitorList from "./Components/MonitorList/index.jsx"; +import ConfigSelect from "./Components/ConfigSelect/index.jsx"; +import useMaintenanceData from "./hooks/useMaintenanceData.jsx"; +import useMaintenanceActions from "./hooks/useMaintenanceActions.jsx"; -import TextInput from "../../../Components/Inputs/TextInput"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import CalendarIcon from "../../../assets/icons/calendar.svg?react"; +import TextInput from "../../../../Components/Inputs/TextInput/index.jsx"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import CalendarIcon from "../../../../assets/icons/calendar.svg?react"; import "./index.css"; -import Search from "../../../Components/Inputs/Search"; -import { logger } from "../../../Utils/Logger"; +import Search from "../../../../Components/Inputs/Search/index.jsx"; +import { logger } from "../../../../Utils/Logger.js"; import { useNavigate, useParams } from "react-router-dom"; -import { buildErrors, hasValidationErrors } from "../../../Validation/error"; +import { buildErrors, hasValidationErrors } from "../../../../Validation/error.js"; import { useTranslation } from "react-i18next"; import dayjs from "dayjs"; diff --git a/client/src/Pages/Maintenance/MaintenanceTable/ActionsMenu/index.jsx b/client/src/Pages/v1/Maintenance/MaintenanceTable/ActionsMenu/index.jsx similarity index 91% rename from client/src/Pages/Maintenance/MaintenanceTable/ActionsMenu/index.jsx rename to client/src/Pages/v1/Maintenance/MaintenanceTable/ActionsMenu/index.jsx index aa1c48433..cc51697f7 100644 --- a/client/src/Pages/Maintenance/MaintenanceTable/ActionsMenu/index.jsx +++ b/client/src/Pages/v1/Maintenance/MaintenanceTable/ActionsMenu/index.jsx @@ -3,14 +3,14 @@ import { useTheme } from "@emotion/react"; import { useNavigate } from "react-router-dom"; import { useSelector } from "react-redux"; import { IconButton, Menu, MenuItem } from "@mui/material"; -import { logger } from "../../../../Utils/Logger"; -import Settings from "../../../../assets/icons/settings-bold.svg?react"; +import { logger } from "../../../../../Utils/Logger.js"; +import Settings from "../../../../../assets/icons/settings-bold.svg?react"; import PropTypes from "prop-types"; -import { networkService } from "../../../../main"; -import { createToast } from "../../../../Utils/toastUtils"; +import { networkService } from "../../../../../main.jsx"; +import { createToast } from "../../../../../Utils/toastUtils.jsx"; import { useTranslation } from "react-i18next"; -import Dialog from "../../../../Components/Dialog"; +import Dialog from "../../../../../Components/Dialog/index.jsx"; const ActionsMenu = ({ /* isAdmin, */ maintenanceWindow, updateCallback }) => { maintenanceWindow; diff --git a/client/src/Pages/Maintenance/MaintenanceTable/index.jsx b/client/src/Pages/v1/Maintenance/MaintenanceTable/index.jsx similarity index 92% rename from client/src/Pages/Maintenance/MaintenanceTable/index.jsx rename to client/src/Pages/v1/Maintenance/MaintenanceTable/index.jsx index bb5842e9f..fb18cd380 100644 --- a/client/src/Pages/Maintenance/MaintenanceTable/index.jsx +++ b/client/src/Pages/v1/Maintenance/MaintenanceTable/index.jsx @@ -1,15 +1,15 @@ import PropTypes from "prop-types"; import { Box } from "@mui/material"; -import DataTable from "../../../Components/Table"; -import Pagination from "../../../Components/Table/TablePagination"; +import DataTable from "../../../../Components/Table/index.jsx"; +import Pagination from "../../../../Components/Table/TablePagination/index.jsx"; import ArrowDownwardRoundedIcon from "@mui/icons-material/ArrowDownwardRounded"; import ArrowUpwardRoundedIcon from "@mui/icons-material/ArrowUpwardRounded"; -import ActionsMenu from "./ActionsMenu"; +import ActionsMenu from "./ActionsMenu/index.jsx"; import { memo } from "react"; import { useDispatch, useSelector } from "react-redux"; -import { formatDurationRounded } from "../../../Utils/timeUtils"; -import { StatusLabel } from "../../../Components/Label"; -import { setRowsPerPage } from "../../../Features/UI/uiSlice"; +import { formatDurationRounded } from "../../../../Utils/timeUtils.js"; +import { StatusLabel } from "../../../../Components/Label/index.jsx"; +import { setRowsPerPage } from "../../../../Features/UI/uiSlice.js"; import { useTranslation } from "react-i18next"; import { useTheme } from "@emotion/react"; import { useNavigate } from "react-router-dom"; diff --git a/client/src/Pages/Maintenance/index.css b/client/src/Pages/v1/Maintenance/index.css similarity index 100% rename from client/src/Pages/Maintenance/index.css rename to client/src/Pages/v1/Maintenance/index.css diff --git a/client/src/Pages/Maintenance/index.jsx b/client/src/Pages/v1/Maintenance/index.jsx similarity index 91% rename from client/src/Pages/Maintenance/index.jsx rename to client/src/Pages/v1/Maintenance/index.jsx index ee142f524..a993c153f 100644 --- a/client/src/Pages/Maintenance/index.jsx +++ b/client/src/Pages/v1/Maintenance/index.jsx @@ -2,13 +2,13 @@ import { Stack, Button } from "@mui/material"; import { useTheme } from "@emotion/react"; import { useState, useEffect } from "react"; import "./index.css"; -import MaintenanceTable from "./MaintenanceTable"; +import MaintenanceTable from "./MaintenanceTable/index.jsx"; import { useSelector } from "react-redux"; -import { networkService } from "../../main"; -import Breadcrumbs from "../../Components/Breadcrumbs"; +import { networkService } from "../../../main.jsx"; +import Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import PageStateWrapper from "../../Components/PageStateWrapper"; +import PageStateWrapper from "../../../Components/PageStateWrapper/index.jsx"; const Maintenance = () => { const theme = useTheme(); diff --git a/client/src/Pages/NotFound/index.jsx b/client/src/Pages/v1/NotFound/index.jsx similarity index 96% rename from client/src/Pages/NotFound/index.jsx rename to client/src/Pages/v1/NotFound/index.jsx index fdae92cb5..48825c9f6 100644 --- a/client/src/Pages/NotFound/index.jsx +++ b/client/src/Pages/v1/NotFound/index.jsx @@ -1,5 +1,5 @@ import PropTypes from "prop-types"; -import NotFoundSvg from "../../../src/assets/Images/sushi_404.svg"; +import NotFoundSvg from "../../../assets/Images/sushi_404.svg"; import { Button, Stack, Typography } from "@mui/material"; import { useNavigate } from "react-router-dom"; import { useTheme } from "@emotion/react"; diff --git a/client/src/Pages/Notifications/components/ActionMenu.jsx b/client/src/Pages/v1/Notifications/components/ActionMenu.jsx similarity index 100% rename from client/src/Pages/Notifications/components/ActionMenu.jsx rename to client/src/Pages/v1/Notifications/components/ActionMenu.jsx diff --git a/client/src/Pages/Notifications/create/index.jsx b/client/src/Pages/v1/Notifications/create/index.jsx similarity index 92% rename from client/src/Pages/Notifications/create/index.jsx rename to client/src/Pages/v1/Notifications/create/index.jsx index 6d8afe665..0d541736d 100644 --- a/client/src/Pages/Notifications/create/index.jsx +++ b/client/src/Pages/v1/Notifications/create/index.jsx @@ -1,13 +1,13 @@ // Components import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; import Button from "@mui/material/Button"; -import ConfigBox from "../../../Components/ConfigBox"; +import ConfigBox from "../../../../Components/ConfigBox/index.jsx"; import Box from "@mui/material/Box"; -import Select from "../../../Components/Inputs/Select"; -import TextInput from "../../../Components/Inputs/TextInput"; -import Dialog from "../../../Components/Dialog"; +import Select from "../../../../Components/Inputs/Select/index.jsx"; +import TextInput from "../../../../Components/Inputs/TextInput/index.jsx"; +import Dialog from "../../../../Components/Dialog/index.jsx"; // Utils import { useState } from "react"; @@ -18,9 +18,9 @@ import { useEditNotification, useTestNotification, useDeleteNotification, -} from "../../../Hooks/useNotifications"; -import { notificationValidation } from "../../../Validation/validation"; -import { createToast } from "../../../Utils/toastUtils"; +} from "../../../../Hooks/v1/useNotifications.js"; +import { notificationValidation } from "../../../../Validation/validation.js"; +import { createToast } from "../../../../Utils/toastUtils.jsx"; import { useTranslation } from "react-i18next"; import { useParams, useNavigate } from "react-router-dom"; import { @@ -29,7 +29,7 @@ import { DESCRIPTION_MAP, LABEL_MAP, PLACEHOLDER_MAP, -} from "../utils"; +} from "../utils.js"; // Setup diff --git a/client/src/Pages/Notifications/index.jsx b/client/src/Pages/v1/Notifications/index.jsx similarity index 89% rename from client/src/Pages/Notifications/index.jsx rename to client/src/Pages/v1/Notifications/index.jsx index 910fbf1fc..5649224b6 100644 --- a/client/src/Pages/Notifications/index.jsx +++ b/client/src/Pages/v1/Notifications/index.jsx @@ -1,11 +1,11 @@ // Components import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import Breadcrumbs from "../../Components/Breadcrumbs"; +import Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx"; import Button from "@mui/material/Button"; -import DataTable from "../../Components/Table"; -import ActionMenu from "./components/ActionMenu"; -import PageStateWrapper from "../../Components/PageStateWrapper"; +import DataTable from "../../../Components/Table/index.jsx"; +import ActionMenu from "./components/ActionMenu.jsx"; +import PageStateWrapper from "../../../Components/PageStateWrapper/index.jsx"; // Utils import { useState } from "react"; @@ -14,7 +14,7 @@ import { useNavigate } from "react-router-dom"; import { useGetNotificationsByTeamId, useDeleteNotification, -} from "../../Hooks/useNotifications"; +} from "../../../Hooks/v1/useNotifications.js"; import { useTranslation } from "react-i18next"; const Notifications = () => { diff --git a/client/src/Pages/Notifications/utils.js b/client/src/Pages/v1/Notifications/utils.js similarity index 100% rename from client/src/Pages/Notifications/utils.js rename to client/src/Pages/v1/Notifications/utils.js diff --git a/client/src/Pages/PageSpeed/Create/index.css b/client/src/Pages/v1/PageSpeed/Create/index.css similarity index 100% rename from client/src/Pages/PageSpeed/Create/index.css rename to client/src/Pages/v1/PageSpeed/Create/index.css diff --git a/client/src/Pages/PageSpeed/Create/index.jsx b/client/src/Pages/v1/PageSpeed/Create/index.jsx similarity index 91% rename from client/src/Pages/PageSpeed/Create/index.jsx rename to client/src/Pages/v1/PageSpeed/Create/index.jsx index 46bc7f977..7cc244848 100644 --- a/client/src/Pages/PageSpeed/Create/index.jsx +++ b/client/src/Pages/v1/PageSpeed/Create/index.jsx @@ -1,37 +1,37 @@ // Components import { Box, Stack, Tooltip, Typography, Button, ButtonGroup } from "@mui/material"; -import ConfigBox from "../../../Components/ConfigBox"; -import Select from "../../../Components/Inputs/Select"; -import TextInput from "../../../Components/Inputs/TextInput"; +import ConfigBox from "../../../../Components/ConfigBox/index.jsx"; +import Select from "../../../../Components/Inputs/Select/index.jsx"; +import TextInput from "../../../../Components/Inputs/TextInput/index.jsx"; import PauseCircleOutlineIcon from "@mui/icons-material/PauseCircleOutline"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import PulseDot from "../../../Components/Animated/PulseDot"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import PulseDot from "../../../../Components/Animated/PulseDot.jsx"; import PlayCircleOutlineRoundedIcon from "@mui/icons-material/PlayCircleOutlineRounded"; -import SkeletonLayout from "./skeleton"; -import NotificationsConfig from "../../../Components/NotificationConfig"; -import Dialog from "../../../Components/Dialog"; -import { HttpAdornment } from "../../../Components/Inputs/TextInput/Adornments"; -import Radio from "../../../Components/Inputs/Radio"; +import SkeletonLayout from "./skeleton.jsx"; +import NotificationsConfig from "../../../../Components/NotificationConfig/index.jsx"; +import Dialog from "../../../../Components/Dialog/index.jsx"; +import { HttpAdornment } from "../../../../Components/Inputs/TextInput/Adornments/index.jsx"; +import Radio from "../../../../Components/Inputs/Radio/index.jsx"; // Utils import { useState, useEffect } from "react"; import { useSelector } from "react-redux"; -import { monitorValidation } from "../../../Validation/validation"; -import { parseDomainName } from "../../../Utils/monitorUtils"; +import { monitorValidation } from "../../../../Validation/validation.js"; +import { parseDomainName } from "../../../../Utils/monitorUtils.js"; import { useTranslation } from "react-i18next"; -import { useGetNotificationsByTeamId } from "../../../Hooks/useNotifications"; +import { useGetNotificationsByTeamId } from "../../../../Hooks/v1/useNotifications.js"; import { useTheme } from "@emotion/react"; -import { createToast } from "../../../Utils/toastUtils"; +import { createToast } from "../../../../Utils/toastUtils.jsx"; import { useParams } from "react-router"; -import { useMonitorUtils } from "../../../Hooks/useMonitorUtils"; +import { useMonitorUtils } from "../../../../Hooks/v1/useMonitorUtils.js"; import { useCreateMonitor, useFetchMonitorById, useDeleteMonitor, useUpdateMonitor, usePauseMonitor, -} from "../../../Hooks/monitorHooks"; +} from "../../../../Hooks/v1/monitorHooks.js"; const PageSpeedSetup = () => { const { monitorId } = useParams(); diff --git a/client/src/Pages/PageSpeed/Create/skeleton.jsx b/client/src/Pages/v1/PageSpeed/Create/skeleton.jsx similarity index 100% rename from client/src/Pages/PageSpeed/Create/skeleton.jsx rename to client/src/Pages/v1/PageSpeed/Create/skeleton.jsx diff --git a/client/src/Pages/PageSpeed/Details/Components/Charts/AreaChart.jsx b/client/src/Pages/v1/PageSpeed/Details/Components/Charts/AreaChart.jsx similarity index 99% rename from client/src/Pages/PageSpeed/Details/Components/Charts/AreaChart.jsx rename to client/src/Pages/v1/PageSpeed/Details/Components/Charts/AreaChart.jsx index 40fec0ab6..5c79cc06c 100644 --- a/client/src/Pages/PageSpeed/Details/Components/Charts/AreaChart.jsx +++ b/client/src/Pages/v1/PageSpeed/Details/Components/Charts/AreaChart.jsx @@ -11,7 +11,7 @@ import { import { useTheme } from "@emotion/react"; import { useMemo, useState } from "react"; import { Box, Stack, Typography } from "@mui/material"; -import { formatDateWithTz } from "../../../../../Utils/timeUtils"; +import { formatDateWithTz } from "../../../../../../Utils/timeUtils.js"; import { useSelector } from "react-redux"; const config = { diff --git a/client/src/Pages/PageSpeed/Details/Components/Charts/AreaChartLegend.jsx b/client/src/Pages/v1/PageSpeed/Details/Components/Charts/AreaChartLegend.jsx similarity index 84% rename from client/src/Pages/PageSpeed/Details/Components/Charts/AreaChartLegend.jsx rename to client/src/Pages/v1/PageSpeed/Details/Components/Charts/AreaChartLegend.jsx index 72811fa2a..cb6f18bd2 100644 --- a/client/src/Pages/PageSpeed/Details/Components/Charts/AreaChartLegend.jsx +++ b/client/src/Pages/v1/PageSpeed/Details/Components/Charts/AreaChartLegend.jsx @@ -1,7 +1,7 @@ import { Box, Typography, Divider } from "@mui/material"; -import Checkbox from "../../../../../Components/Inputs/Checkbox"; -import MetricsIcon from "../../../../../assets/icons/ruler-icon.svg?react"; -import LegendBox from "../../../../../Components/Charts/LegendBox"; +import Checkbox from "../../../../../../Components/Inputs/Checkbox/index.jsx"; +import MetricsIcon from "../../../../../../assets/icons/ruler-icon.svg?react"; +import LegendBox from "../../../../../../Components/Charts/LegendBox/index.jsx"; import { useTranslation } from "react-i18next"; import { useTheme } from "@emotion/react"; diff --git a/client/src/Pages/PageSpeed/Details/Components/Charts/PieChart.jsx b/client/src/Pages/v1/PageSpeed/Details/Components/Charts/PieChart.jsx similarity index 100% rename from client/src/Pages/PageSpeed/Details/Components/Charts/PieChart.jsx rename to client/src/Pages/v1/PageSpeed/Details/Components/Charts/PieChart.jsx diff --git a/client/src/Pages/PageSpeed/Details/Components/Charts/PieChartLegend.jsx b/client/src/Pages/v1/PageSpeed/Details/Components/Charts/PieChartLegend.jsx similarity index 92% rename from client/src/Pages/PageSpeed/Details/Components/Charts/PieChartLegend.jsx rename to client/src/Pages/v1/PageSpeed/Details/Components/Charts/PieChartLegend.jsx index 18ca0733c..fc4b190d8 100644 --- a/client/src/Pages/PageSpeed/Details/Components/Charts/PieChartLegend.jsx +++ b/client/src/Pages/v1/PageSpeed/Details/Components/Charts/PieChartLegend.jsx @@ -1,7 +1,7 @@ import { Stack, Box, Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; -import LegendBox from "../../../../../Components/Charts/LegendBox"; -import SpeedometerIcon from "../../../../../assets/icons/speedometer-icon.svg?react"; +import LegendBox from "../../../../../../Components/Charts/LegendBox/index.jsx"; +import SpeedometerIcon from "../../../../../../assets/icons/speedometer-icon.svg?react"; import PropTypes from "prop-types"; const PieChartLegend = ({ audits }) => { diff --git a/client/src/Pages/PageSpeed/Details/Components/PageSpeedAreaChart/index.jsx b/client/src/Pages/v1/PageSpeed/Details/Components/PageSpeedAreaChart/index.jsx similarity index 75% rename from client/src/Pages/PageSpeed/Details/Components/PageSpeedAreaChart/index.jsx rename to client/src/Pages/v1/PageSpeed/Details/Components/PageSpeedAreaChart/index.jsx index 582648e23..bb45117fe 100644 --- a/client/src/Pages/PageSpeed/Details/Components/PageSpeedAreaChart/index.jsx +++ b/client/src/Pages/v1/PageSpeed/Details/Components/PageSpeedAreaChart/index.jsx @@ -1,8 +1,8 @@ -import ChartBox from "../../../../../Components/Charts/ChartBox"; -import AreaChart from "../Charts/AreaChart"; -import AreaChartLegend from "../Charts/AreaChartLegend"; -import SkeletonLayout from "./skeleton"; -import ScoreIcon from "../../../../../assets/icons/monitor-graph-line.svg?react"; +import ChartBox from "../../../../../../Components/Charts/ChartBox/index.jsx"; +import AreaChart from "../Charts/AreaChart.jsx"; +import AreaChartLegend from "../Charts/AreaChartLegend.jsx"; +import SkeletonLayout from "./skeleton.jsx"; +import ScoreIcon from "../../../../../../assets/icons/monitor-graph-line.svg?react"; import { Stack } from "@mui/material"; import PropTypes from "prop-types"; diff --git a/client/src/Pages/PageSpeed/Details/Components/PageSpeedAreaChart/skeleton.jsx b/client/src/Pages/v1/PageSpeed/Details/Components/PageSpeedAreaChart/skeleton.jsx similarity index 100% rename from client/src/Pages/PageSpeed/Details/Components/PageSpeedAreaChart/skeleton.jsx rename to client/src/Pages/v1/PageSpeed/Details/Components/PageSpeedAreaChart/skeleton.jsx diff --git a/client/src/Pages/PageSpeed/Details/Components/PageSpeedStatusBoxes/index.jsx b/client/src/Pages/v1/PageSpeed/Details/Components/PageSpeedStatusBoxes/index.jsx similarity index 76% rename from client/src/Pages/PageSpeed/Details/Components/PageSpeedStatusBoxes/index.jsx rename to client/src/Pages/v1/PageSpeed/Details/Components/PageSpeedStatusBoxes/index.jsx index cb79198e9..0811ae707 100644 --- a/client/src/Pages/PageSpeed/Details/Components/PageSpeedStatusBoxes/index.jsx +++ b/client/src/Pages/v1/PageSpeed/Details/Components/PageSpeedStatusBoxes/index.jsx @@ -1,7 +1,7 @@ -import StatusBoxes from "../../../../../Components/StatusBoxes"; -import StatBox from "../../../../../Components/StatBox"; +import StatusBoxes from "../../../../../../Components/StatusBoxes/index.jsx"; +import StatBox from "../../../../../../Components/StatBox/index.jsx"; import { Typography } from "@mui/material"; -import { getHumanReadableDuration } from "../../../../../Utils/timeUtils"; +import { getHumanReadableDuration } from "../../../../../../Utils/timeUtils.js"; import { useTranslation } from "react-i18next"; const PageSpeedStatusBoxes = ({ shouldRender, monitor }) => { diff --git a/client/src/Pages/PageSpeed/Details/Components/PerformanceReport/index.jsx b/client/src/Pages/v1/PageSpeed/Details/Components/PerformanceReport/index.jsx similarity index 78% rename from client/src/Pages/PageSpeed/Details/Components/PerformanceReport/index.jsx rename to client/src/Pages/v1/PageSpeed/Details/Components/PerformanceReport/index.jsx index 2f809ebbb..ce4704144 100644 --- a/client/src/Pages/PageSpeed/Details/Components/PerformanceReport/index.jsx +++ b/client/src/Pages/v1/PageSpeed/Details/Components/PerformanceReport/index.jsx @@ -1,10 +1,10 @@ -import ChartBox from "../../../../../Components/Charts/ChartBox"; -import PerformanceIcon from "../../../../../assets/icons/performance-report.svg?react"; -import PieChart from "../Charts/PieChart"; +import ChartBox from "../../../../../../Components/Charts/ChartBox/index.jsx"; +import PerformanceIcon from "../../../../../../assets/icons/performance-report.svg?react"; +import PieChart from "../Charts/PieChart.jsx"; import { Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; -import PieChartLegend from "../Charts/PieChartLegend"; -import SkeletonLayout from "./skeleton"; +import PieChartLegend from "../Charts/PieChartLegend.jsx"; +import SkeletonLayout from "./skeleton.jsx"; import { useTranslation } from "react-i18next"; const PerformanceReport = ({ shouldRender, audits }) => { diff --git a/client/src/Pages/PageSpeed/Details/Components/PerformanceReport/skeleton.jsx b/client/src/Pages/v1/PageSpeed/Details/Components/PerformanceReport/skeleton.jsx similarity index 100% rename from client/src/Pages/PageSpeed/Details/Components/PerformanceReport/skeleton.jsx rename to client/src/Pages/v1/PageSpeed/Details/Components/PerformanceReport/skeleton.jsx diff --git a/client/src/Pages/PageSpeed/Details/index.jsx b/client/src/Pages/v1/PageSpeed/Details/index.jsx similarity index 81% rename from client/src/Pages/PageSpeed/Details/index.jsx rename to client/src/Pages/v1/PageSpeed/Details/index.jsx index cfc799b36..cf9652bce 100644 --- a/client/src/Pages/PageSpeed/Details/index.jsx +++ b/client/src/Pages/v1/PageSpeed/Details/index.jsx @@ -1,17 +1,17 @@ // Components import { Stack, Typography } from "@mui/material"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import MonitorTimeFrameHeader from "../../../Components/MonitorTimeFrameHeader"; -import PageSpeedStatusBoxes from "./Components/PageSpeedStatusBoxes"; -import MonitorDetailsControlHeader from "../../../Components/MonitorDetailsControlHeader"; -import PageSpeedAreaChart from "./Components/PageSpeedAreaChart"; -import PerformanceReport from "./Components/PerformanceReport"; -import GenericFallback from "../../../Components/GenericFallback"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import MonitorTimeFrameHeader from "../../../../Components/MonitorTimeFrameHeader/index.jsx"; +import PageSpeedStatusBoxes from "./Components/PageSpeedStatusBoxes/index.jsx"; +import MonitorDetailsControlHeader from "../../../../Components/MonitorDetailsControlHeader/index.jsx"; +import PageSpeedAreaChart from "./Components/PageSpeedAreaChart/index.jsx"; +import PerformanceReport from "./Components/PerformanceReport/index.jsx"; +import GenericFallback from "../../../../Components/GenericFallback/index.jsx"; // Utils import { useTheme } from "@emotion/react"; -import { useIsAdmin } from "../../../Hooks/useIsAdmin"; +import { useIsAdmin } from "../../../../Hooks/v1/useIsAdmin.js"; import { useParams } from "react-router-dom"; -import { useFetchStatsByMonitorId } from "../../../Hooks/monitorHooks"; +import { useFetchStatsByMonitorId } from "../../../../Hooks/v1/monitorHooks.js"; import { useState } from "react"; import { useTranslation } from "react-i18next"; // Constants diff --git a/client/src/Pages/PageSpeed/Monitors/Components/Card/index.jsx b/client/src/Pages/v1/PageSpeed/Monitors/Components/Card/index.jsx similarity index 95% rename from client/src/Pages/PageSpeed/Monitors/Components/Card/index.jsx rename to client/src/Pages/v1/PageSpeed/Monitors/Components/Card/index.jsx index 94d6b137b..5857a7a7e 100644 --- a/client/src/Pages/PageSpeed/Monitors/Components/Card/index.jsx +++ b/client/src/Pages/v1/PageSpeed/Monitors/Components/Card/index.jsx @@ -1,17 +1,20 @@ import PropTypes from "prop-types"; // import PageSpeedIcon from "../../../../assets/icons/page-speed.svg?react"; -import PageSpeedIcon from "../../../../../assets/icons/page-speed.svg?react"; -import { StatusLabel } from "../../../../../Components/Label"; +import PageSpeedIcon from "../../../../../../assets/icons/page-speed.svg?react"; +import { StatusLabel } from "../../../../../../Components/Label/index.jsx"; import { Box, Grid, Stack, Typography } from "@mui/material"; import { useNavigate } from "react-router-dom"; import { useTheme } from "@emotion/react"; import { Area, AreaChart, CartesianGrid, ResponsiveContainer, Tooltip } from "recharts"; import { useSelector } from "react-redux"; -import { formatDateWithTz, formatDurationSplit } from "../../../../../Utils/timeUtils"; -import { useMonitorUtils } from "../../../../../Hooks/useMonitorUtils"; +import { + formatDateWithTz, + formatDurationSplit, +} from "../../../../../../Utils/timeUtils.js"; +import { useMonitorUtils } from "../../../../../../Hooks/v1/useMonitorUtils.js"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import IconBox from "../../../../../Components/IconBox"; +import IconBox from "../../../../../../Components/IconBox/index.jsx"; /** * CustomToolTip displays a tooltip with formatted date and score information. * @param {Object} props diff --git a/client/src/Pages/PageSpeed/Monitors/Components/MonitorGrid/index.jsx b/client/src/Pages/v1/PageSpeed/Monitors/Components/MonitorGrid/index.jsx similarity index 88% rename from client/src/Pages/PageSpeed/Monitors/Components/MonitorGrid/index.jsx rename to client/src/Pages/v1/PageSpeed/Monitors/Components/MonitorGrid/index.jsx index 6266ebdc9..6b0a800fb 100644 --- a/client/src/Pages/PageSpeed/Monitors/Components/MonitorGrid/index.jsx +++ b/client/src/Pages/v1/PageSpeed/Monitors/Components/MonitorGrid/index.jsx @@ -1,5 +1,5 @@ import { Grid, Grid2 } from "@mui/material"; -import Card from "../Card"; +import Card from "../Card/index.jsx"; const MonitorGrid = ({ shouldRender, monitors }) => { return ( diff --git a/client/src/Pages/PageSpeed/Monitors/index.jsx b/client/src/Pages/v1/PageSpeed/Monitors/index.jsx similarity index 69% rename from client/src/Pages/PageSpeed/Monitors/index.jsx rename to client/src/Pages/v1/PageSpeed/Monitors/index.jsx index b5b13ba6e..e568e8d82 100644 --- a/client/src/Pages/PageSpeed/Monitors/index.jsx +++ b/client/src/Pages/v1/PageSpeed/Monitors/index.jsx @@ -1,18 +1,18 @@ // Components import { useState } from "react"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; import { Stack } from "@mui/material"; -import CreateMonitorHeader from "../../../Components/MonitorCreateHeader"; -import MonitorCountHeader from "../../../Components/MonitorCountHeader"; -import MonitorGrid from "./Components/MonitorGrid"; -import PageStateWrapper from "../../../Components/PageStateWrapper"; -import FallbackPageSpeedWarning from "../../../Components/Fallback/FallbackPageSpeedWarning"; +import CreateMonitorHeader from "../../../../Components/MonitorCreateHeader/index.jsx"; +import MonitorCountHeader from "../../../../Components/MonitorCountHeader/index.jsx"; +import MonitorGrid from "./Components/MonitorGrid/index.jsx"; +import PageStateWrapper from "../../../../Components/PageStateWrapper/index.jsx"; +import FallbackPageSpeedWarning from "../../../../Components/Fallback/FallbackPageSpeedWarning.jsx"; // Utils import { useTheme } from "@emotion/react"; -import { useIsAdmin } from "../../../Hooks/useIsAdmin"; -import { useFetchMonitorsByTeamId } from "../../../Hooks/monitorHooks"; -import { useFetchSettings } from "../../../Hooks/settingsHooks"; +import { useIsAdmin } from "../../../../Hooks/v1/useIsAdmin.js"; +import { useFetchMonitorsByTeamId } from "../../../../Hooks/v1/monitorHooks.js"; +import { useFetchSettings } from "../../../../Hooks/v1/settingsHooks.js"; // Constants const BREADCRUMBS = [{ name: `pagespeed`, path: "/pagespeed" }]; const TYPES = ["pagespeed"]; diff --git a/client/src/Pages/ServerUnreachable.jsx b/client/src/Pages/v1/ServerUnreachable.jsx similarity index 90% rename from client/src/Pages/ServerUnreachable.jsx rename to client/src/Pages/v1/ServerUnreachable.jsx index 466633144..0db697543 100644 --- a/client/src/Pages/ServerUnreachable.jsx +++ b/client/src/Pages/v1/ServerUnreachable.jsx @@ -2,14 +2,14 @@ import React, { useState } from "react"; import { Box, Typography, Button, Stack } from "@mui/material"; import { useTheme } from "@emotion/react"; import { useNavigate } from "react-router-dom"; -import { networkService } from "../Utils/NetworkService"; -import Alert from "../Components/Alert"; -import { createToast } from "../Utils/toastUtils"; +import { networkService } from "../../Utils/NetworkService.js"; +import Alert from "../../Components/Alert/index.jsx"; +import { createToast } from "../../Utils/toastUtils.jsx"; import { useTranslation } from "react-i18next"; -import Background from "../assets/Images/background-grid.svg?react"; -import Logo from "../assets/icons/checkmate-icon.svg?react"; -import ThemeSwitch from "../Components/ThemeSwitch"; -import LanguageSelector from "../Components/LanguageSelector"; +import Background from "../../assets/Images/background-grid.svg?react"; +import Logo from "../../assets/icons/checkmate-icon.svg?react"; +import ThemeSwitch from "../../Components/ThemeSwitch/index.jsx"; +import LanguageSelector from "../../Components/LanguageSelector.jsx"; const ServerUnreachable = () => { const theme = useTheme(); diff --git a/client/src/Pages/Settings/SettingsAbout.jsx b/client/src/Pages/v1/Settings/SettingsAbout.jsx similarity index 88% rename from client/src/Pages/Settings/SettingsAbout.jsx rename to client/src/Pages/v1/Settings/SettingsAbout.jsx index a80351393..3d5f5224e 100644 --- a/client/src/Pages/Settings/SettingsAbout.jsx +++ b/client/src/Pages/v1/Settings/SettingsAbout.jsx @@ -1,10 +1,10 @@ import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; -import ConfigBox from "../../Components/ConfigBox"; +import ConfigBox from "../../../Components/ConfigBox/index.jsx"; // Utils import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; -import Link from "../../Components/Link"; +import Link from "../../../Components/Link/index.jsx"; const SettingsAbout = () => { const theme = useTheme(); diff --git a/client/src/Pages/Settings/SettingsDemoMonitors.jsx b/client/src/Pages/v1/Settings/SettingsDemoMonitors.jsx similarity index 95% rename from client/src/Pages/Settings/SettingsDemoMonitors.jsx rename to client/src/Pages/v1/Settings/SettingsDemoMonitors.jsx index 13e93421e..96f907970 100644 --- a/client/src/Pages/Settings/SettingsDemoMonitors.jsx +++ b/client/src/Pages/v1/Settings/SettingsDemoMonitors.jsx @@ -1,12 +1,12 @@ import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import Button from "@mui/material/Button"; -import ConfigBox from "../../Components/ConfigBox"; +import ConfigBox from "../../../Components/ConfigBox/index.jsx"; // Utils import { useTheme } from "@emotion/react"; import { PropTypes } from "prop-types"; import { useTranslation } from "react-i18next"; -import Dialog from "../../Components/Dialog"; +import Dialog from "../../../Components/Dialog/index.jsx"; import { useState } from "react"; const SettingsDemoMonitors = ({ isAdmin, HEADER_SX, handleChange, isLoading }) => { diff --git a/client/src/Pages/Settings/SettingsEmail.jsx b/client/src/Pages/v1/Settings/SettingsEmail.jsx similarity index 94% rename from client/src/Pages/Settings/SettingsEmail.jsx rename to client/src/Pages/v1/Settings/SettingsEmail.jsx index 1f86b1984..c2389b277 100644 --- a/client/src/Pages/Settings/SettingsEmail.jsx +++ b/client/src/Pages/v1/Settings/SettingsEmail.jsx @@ -1,19 +1,19 @@ import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; -import ConfigBox from "../../Components/ConfigBox"; -import TextInput from "../../Components/Inputs/TextInput"; +import ConfigBox from "../../../Components/ConfigBox/index.jsx"; +import TextInput from "../../../Components/Inputs/TextInput/index.jsx"; import Button from "@mui/material/Button"; import Stack from "@mui/material/Stack"; import { Switch } from "@mui/material"; -import TextLink from "../../Components/TextLink"; +import TextLink from "../../../Components/TextLink/index.jsx"; // Utils import { useTheme } from "@emotion/react"; import { PropTypes } from "prop-types"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { PasswordEndAdornment } from "../../Components/Inputs/TextInput/Adornments"; -import { useSendTestEmail } from "../../Hooks/useSendTestEmail"; -import { createToast } from "../../Utils/toastUtils"; +import { PasswordEndAdornment } from "../../../Components/Inputs/TextInput/Adornments/index.jsx"; +import { useSendTestEmail } from "../../../Hooks/v1/useSendTestEmail.js"; +import { createToast } from "../../../Utils/toastUtils.jsx"; const SettingsEmail = ({ isAdmin, diff --git a/client/src/Pages/Settings/SettingsGlobalThresholds.jsx b/client/src/Pages/v1/Settings/SettingsGlobalThresholds.jsx similarity index 94% rename from client/src/Pages/Settings/SettingsGlobalThresholds.jsx rename to client/src/Pages/v1/Settings/SettingsGlobalThresholds.jsx index acc101ab4..e238c6475 100644 --- a/client/src/Pages/Settings/SettingsGlobalThresholds.jsx +++ b/client/src/Pages/v1/Settings/SettingsGlobalThresholds.jsx @@ -1,8 +1,8 @@ import Box from "@mui/material/Box"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import ConfigBox from "../../Components/ConfigBox"; -import TextInput from "../../Components/Inputs/TextInput"; +import ConfigBox from "../../../Components/ConfigBox/index.jsx"; +import TextInput from "../../../Components/Inputs/TextInput/index.jsx"; import { useTheme } from "@emotion/react"; import { PropTypes } from "prop-types"; diff --git a/client/src/Pages/Settings/SettingsPagespeed.jsx b/client/src/Pages/v1/Settings/SettingsPagespeed.jsx similarity index 91% rename from client/src/Pages/Settings/SettingsPagespeed.jsx rename to client/src/Pages/v1/Settings/SettingsPagespeed.jsx index 157c75dac..83b2e23c7 100644 --- a/client/src/Pages/Settings/SettingsPagespeed.jsx +++ b/client/src/Pages/v1/Settings/SettingsPagespeed.jsx @@ -2,9 +2,9 @@ import Box from "@mui/material/Box"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import Button from "@mui/material/Button"; -import ConfigBox from "../../Components/ConfigBox"; -import TextInput from "../../Components/Inputs/TextInput"; -import { PasswordEndAdornment } from "../../Components/Inputs/TextInput/Adornments"; +import ConfigBox from "../../../Components/ConfigBox/index.jsx"; +import TextInput from "../../../Components/Inputs/TextInput/index.jsx"; +import { PasswordEndAdornment } from "../../../Components/Inputs/TextInput/Adornments/index.jsx"; // Utils import { useTheme } from "@emotion/react"; import { PropTypes } from "prop-types"; diff --git a/client/src/Pages/Settings/SettingsStats.jsx b/client/src/Pages/v1/Settings/SettingsStats.jsx similarity index 92% rename from client/src/Pages/Settings/SettingsStats.jsx rename to client/src/Pages/v1/Settings/SettingsStats.jsx index 740ac3a37..52f739ecf 100644 --- a/client/src/Pages/Settings/SettingsStats.jsx +++ b/client/src/Pages/v1/Settings/SettingsStats.jsx @@ -2,9 +2,9 @@ import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import Button from "@mui/material/Button"; import Stack from "@mui/material/Stack"; -import ConfigBox from "../../Components/ConfigBox"; -import TextInput from "../../Components/Inputs/TextInput"; -import Dialog from "../../Components/Dialog"; +import ConfigBox from "../../../Components/ConfigBox/index.jsx"; +import TextInput from "../../../Components/Inputs/TextInput/index.jsx"; +import Dialog from "../../../Components/Dialog/index.jsx"; // Utils import { useTheme } from "@emotion/react"; diff --git a/client/src/Pages/Settings/SettingsTimeZone.jsx b/client/src/Pages/v1/Settings/SettingsTimeZone.jsx similarity index 90% rename from client/src/Pages/Settings/SettingsTimeZone.jsx rename to client/src/Pages/v1/Settings/SettingsTimeZone.jsx index ee5cf48de..59b2008f4 100644 --- a/client/src/Pages/Settings/SettingsTimeZone.jsx +++ b/client/src/Pages/v1/Settings/SettingsTimeZone.jsx @@ -1,9 +1,9 @@ import Box from "@mui/material/Box"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import ConfigBox from "../../Components/ConfigBox"; -import Search from "../../Components/Inputs/Search"; -import timezones from "../../Utils/timezones.json"; +import ConfigBox from "../../../Components/ConfigBox/index.jsx"; +import Search from "../../../Components/Inputs/Search/index.jsx"; +import timezones from "../../../Utils/timezones.json"; // Utils import { useTheme } from "@emotion/react"; diff --git a/client/src/Pages/Settings/SettingsUI.jsx b/client/src/Pages/v1/Settings/SettingsUI.jsx similarity index 91% rename from client/src/Pages/Settings/SettingsUI.jsx rename to client/src/Pages/v1/Settings/SettingsUI.jsx index aab5f863d..91f4cea3c 100644 --- a/client/src/Pages/Settings/SettingsUI.jsx +++ b/client/src/Pages/v1/Settings/SettingsUI.jsx @@ -1,8 +1,8 @@ import Box from "@mui/material/Box"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import ConfigBox from "../../Components/ConfigBox"; -import Select from "../../Components/Inputs/Select"; +import ConfigBox from "../../../Components/ConfigBox/index.jsx"; +import Select from "../../../Components/Inputs/Select/index.jsx"; // Utils import { useTheme } from "@emotion/react"; diff --git a/client/src/Pages/Settings/SettingsURL.jsx b/client/src/Pages/v1/Settings/SettingsURL.jsx similarity index 90% rename from client/src/Pages/Settings/SettingsURL.jsx rename to client/src/Pages/v1/Settings/SettingsURL.jsx index 24c49cad1..105658d4f 100644 --- a/client/src/Pages/Settings/SettingsURL.jsx +++ b/client/src/Pages/v1/Settings/SettingsURL.jsx @@ -1,8 +1,8 @@ import Box from "@mui/material/Box"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import ConfigBox from "../../Components/ConfigBox"; -import Select from "../../Components/Inputs/Select"; +import ConfigBox from "../../../Components/ConfigBox/index.jsx"; +import Select from "../../../Components/Inputs/Select/index.jsx"; // Utils import { useTheme } from "@emotion/react"; diff --git a/client/src/Pages/Settings/index.jsx b/client/src/Pages/v1/Settings/index.jsx similarity index 88% rename from client/src/Pages/Settings/index.jsx rename to client/src/Pages/v1/Settings/index.jsx index 92f58b4c0..d1788eddf 100644 --- a/client/src/Pages/Settings/index.jsx +++ b/client/src/Pages/v1/Settings/index.jsx @@ -1,31 +1,36 @@ import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; -import Breadcrumbs from "../../Components/Breadcrumbs"; -import SettingsTimeZone from "./SettingsTimeZone"; -import SettingsUI from "./SettingsUI"; -import SettingsURL from "./SettingsURL"; -import SettingsPagespeed from "./SettingsPagespeed"; -import SettingsDemoMonitors from "./SettingsDemoMonitors"; -import SettingsAbout from "./SettingsAbout"; -import SettingsEmail from "./SettingsEmail"; -import SettingsGlobalThresholds from "./SettingsGlobalThresholds"; +import Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx"; +import SettingsTimeZone from "./SettingsTimeZone.jsx"; +import SettingsUI from "./SettingsUI.jsx"; +import SettingsURL from "./SettingsURL.jsx"; +import SettingsPagespeed from "./SettingsPagespeed.jsx"; +import SettingsDemoMonitors from "./SettingsDemoMonitors.jsx"; +import SettingsAbout from "./SettingsAbout.jsx"; +import SettingsEmail from "./SettingsEmail.jsx"; +import SettingsGlobalThresholds from "./SettingsGlobalThresholds.jsx"; import Button from "@mui/material/Button"; // Utils -import { settingsValidation } from "../../Validation/validation"; +import { settingsValidation } from "../../../Validation/validation.js"; import { useState } from "react"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; import { useSelector, useDispatch } from "react-redux"; -import { setTimezone, setMode, setLanguage, setShowURL } from "../../Features/UI/uiSlice"; -import SettingsStats from "./SettingsStats"; +import { + setTimezone, + setMode, + setLanguage, + setShowURL, +} from "../../../Features/UI/uiSlice.js"; +import SettingsStats from "./SettingsStats.jsx"; -import { useFetchSettings, useSaveSettings } from "../../Hooks/settingsHooks"; -import { useIsAdmin } from "../../Hooks/useIsAdmin"; +import { useFetchSettings, useSaveSettings } from "../../../Hooks/v1/settingsHooks.js"; +import { useIsAdmin } from "../../../Hooks/v1/useIsAdmin.js"; import { useAddDemoMonitors, useDeleteAllMonitors, useDeleteMonitorStats, -} from "../../Hooks/monitorHooks"; +} from "../../../Hooks/v1/monitorHooks.js"; // Constants const BREADCRUMBS = [{ name: `Settings`, path: "/settings" }]; diff --git a/client/src/Pages/StatusPage/Create/Components/MonitorList/index.jsx b/client/src/Pages/v1/StatusPage/Create/Components/MonitorList/index.jsx similarity index 100% rename from client/src/Pages/StatusPage/Create/Components/MonitorList/index.jsx rename to client/src/Pages/v1/StatusPage/Create/Components/MonitorList/index.jsx diff --git a/client/src/Pages/StatusPage/Create/Components/Progress/index.jsx b/client/src/Pages/v1/StatusPage/Create/Components/Progress/index.jsx similarity index 83% rename from client/src/Pages/StatusPage/Create/Components/Progress/index.jsx rename to client/src/Pages/v1/StatusPage/Create/Components/Progress/index.jsx index 14c4ce0f5..c9f7d5f8f 100644 --- a/client/src/Pages/StatusPage/Create/Components/Progress/index.jsx +++ b/client/src/Pages/v1/StatusPage/Create/Components/Progress/index.jsx @@ -1,8 +1,8 @@ import { Button, Box } from "@mui/material"; -import ProgressUpload from "../../../../../Components/ProgressBars"; +import ProgressUpload from "../../../../../../Components/ProgressBars/index.jsx"; import ImageIcon from "@mui/icons-material/Image"; import { useTranslation } from "react-i18next"; -import { formatBytes } from "../../../../../Utils/fileUtils"; +import { formatBytes } from "../../../../../../Utils/fileUtils.js"; const Progress = ({ isLoading, progressValue, logo, logoType, removeLogo, errors }) => { const { t } = useTranslation(); if (isLoading) { diff --git a/client/src/Pages/StatusPage/Create/Components/Skeleton/index.jsx b/client/src/Pages/v1/StatusPage/Create/Components/Skeleton/index.jsx similarity index 100% rename from client/src/Pages/StatusPage/Create/Components/Skeleton/index.jsx rename to client/src/Pages/v1/StatusPage/Create/Components/Skeleton/index.jsx diff --git a/client/src/Pages/StatusPage/Create/Components/Tabs/ConfigStack.jsx b/client/src/Pages/v1/StatusPage/Create/Components/Tabs/ConfigStack.jsx similarity index 91% rename from client/src/Pages/StatusPage/Create/Components/Tabs/ConfigStack.jsx rename to client/src/Pages/v1/StatusPage/Create/Components/Tabs/ConfigStack.jsx index e313f0e85..fb5278c4e 100644 --- a/client/src/Pages/StatusPage/Create/Components/Tabs/ConfigStack.jsx +++ b/client/src/Pages/v1/StatusPage/Create/Components/Tabs/ConfigStack.jsx @@ -1,5 +1,5 @@ import { Stack, Typography } from "@mui/material"; -import ConfigBox from "../../../../../Components/ConfigBox"; +import ConfigBox from "../../../../../../Components/ConfigBox/index.jsx"; import PropTypes from "prop-types"; import { useTheme } from "@emotion/react"; diff --git a/client/src/Pages/StatusPage/Create/Components/Tabs/Content.jsx b/client/src/Pages/v1/StatusPage/Create/Components/Tabs/Content.jsx similarity index 90% rename from client/src/Pages/StatusPage/Create/Components/Tabs/Content.jsx rename to client/src/Pages/v1/StatusPage/Create/Components/Tabs/Content.jsx index 327a2fb0a..23e713c5a 100644 --- a/client/src/Pages/StatusPage/Create/Components/Tabs/Content.jsx +++ b/client/src/Pages/v1/StatusPage/Create/Components/Tabs/Content.jsx @@ -1,14 +1,14 @@ // Components import { Stack, Typography } from "@mui/material"; import { TabPanel } from "@mui/lab"; -import MonitorList from "../MonitorList"; -import Search from "../../../../../Components/Inputs/Search"; -import Checkbox from "../../../../../Components/Inputs/Checkbox"; +import MonitorList from "../MonitorList/index.jsx"; +import Search from "../../../../../../Components/Inputs/Search/index.jsx"; +import Checkbox from "../../../../../../Components/Inputs/Checkbox/index.jsx"; // Utils import { useState } from "react"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; -import ConfigStack from "./ConfigStack"; +import ConfigStack from "./ConfigStack.jsx"; const Content = ({ tabValue, form, diff --git a/client/src/Pages/StatusPage/Create/Components/Tabs/Settings.jsx b/client/src/Pages/v1/StatusPage/Create/Components/Tabs/Settings.jsx similarity index 87% rename from client/src/Pages/StatusPage/Create/Components/Tabs/Settings.jsx rename to client/src/Pages/v1/StatusPage/Create/Components/Tabs/Settings.jsx index dd4345158..a4612e3da 100644 --- a/client/src/Pages/StatusPage/Create/Components/Tabs/Settings.jsx +++ b/client/src/Pages/v1/StatusPage/Create/Components/Tabs/Settings.jsx @@ -1,17 +1,17 @@ // Components import { Stack, Typography } from "@mui/material"; import { TabPanel } from "@mui/lab"; -import ConfigBox from "../../../../../Components/ConfigBox"; -import Checkbox from "../../../../../Components/Inputs/Checkbox"; -import TextInput from "../../../../../Components/Inputs/TextInput"; -import Search from "../../../../../Components/Inputs/Search"; -import ImageUpload from "../../../../../Components/Inputs/ImageUpload"; -import ColorPicker from "../../../../../Components/Inputs/ColorPicker"; -import Progress from "../Progress"; +import ConfigBox from "../../../../../../Components/ConfigBox/index.jsx"; +import Checkbox from "../../../../../../Components/Inputs/Checkbox/index.jsx"; +import TextInput from "../../../../../../Components/Inputs/TextInput/index.jsx"; +import Search from "../../../../../../Components/Inputs/Search/index.jsx"; +import ImageUpload from "../../../../../../Components/Inputs/ImageUpload/index.jsx"; +import ColorPicker from "../../../../../../Components/Inputs/ColorPicker/index.jsx"; +import Progress from "../Progress/index.jsx"; // Utils import { useTheme } from "@emotion/react"; -import timezones from "../../../../../Utils/timezones.json"; +import timezones from "../../../../../../Utils/timezones.json"; import PropTypes from "prop-types"; import { useTranslation } from "react-i18next"; import { useMemo, useState, useCallback } from "react"; diff --git a/client/src/Pages/StatusPage/Create/Components/Tabs/index.jsx b/client/src/Pages/v1/StatusPage/Create/Components/Tabs/index.jsx similarity index 93% rename from client/src/Pages/StatusPage/Create/Components/Tabs/index.jsx rename to client/src/Pages/v1/StatusPage/Create/Components/Tabs/index.jsx index 60d86e1c9..971b8d85c 100644 --- a/client/src/Pages/StatusPage/Create/Components/Tabs/index.jsx +++ b/client/src/Pages/v1/StatusPage/Create/Components/Tabs/index.jsx @@ -1,12 +1,12 @@ // Components import { TabContext } from "@mui/lab"; import { Tab } from "@mui/material"; -import Settings from "./Settings"; -import Content from "./Content"; +import Settings from "./Settings.jsx"; +import Content from "./Content.jsx"; // Utils import PropTypes from "prop-types"; -import CustomTabList from "../../../../../Components/Tab"; +import CustomTabList from "../../../../../../Components/Tab/index.jsx"; const Tabs = ({ isCreate, diff --git a/client/src/Pages/StatusPage/Create/Hooks/useCreateStatusPage.jsx b/client/src/Pages/v1/StatusPage/Create/Hooks/useCreateStatusPage.jsx similarity index 83% rename from client/src/Pages/StatusPage/Create/Hooks/useCreateStatusPage.jsx rename to client/src/Pages/v1/StatusPage/Create/Hooks/useCreateStatusPage.jsx index a2ac5f55d..808598052 100644 --- a/client/src/Pages/StatusPage/Create/Hooks/useCreateStatusPage.jsx +++ b/client/src/Pages/v1/StatusPage/Create/Hooks/useCreateStatusPage.jsx @@ -1,6 +1,6 @@ import { useState } from "react"; -import { networkService } from "../../../../main"; -import { createToast } from "../../../../Utils/toastUtils"; +import { networkService } from "../../../../../main.jsx"; +import { createToast } from "../../../../../Utils/toastUtils.jsx"; const useCreateStatusPage = (isCreate, url) => { const [isLoading, setIsLoading] = useState(false); diff --git a/client/src/Pages/StatusPage/Create/Hooks/useMonitorsFetch.jsx b/client/src/Pages/v1/StatusPage/Create/Hooks/useMonitorsFetch.jsx similarity index 88% rename from client/src/Pages/StatusPage/Create/Hooks/useMonitorsFetch.jsx rename to client/src/Pages/v1/StatusPage/Create/Hooks/useMonitorsFetch.jsx index f380bed9a..2a7db202a 100644 --- a/client/src/Pages/StatusPage/Create/Hooks/useMonitorsFetch.jsx +++ b/client/src/Pages/v1/StatusPage/Create/Hooks/useMonitorsFetch.jsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; -import { networkService } from "../../../../main"; +import { networkService } from "../../../../../main.jsx"; import { useSelector } from "react-redux"; -import { createToast } from "../../../../Utils/toastUtils"; +import { createToast } from "../../../../../Utils/toastUtils.jsx"; const useMonitorsFetch = () => { const { user } = useSelector((state) => state.auth); diff --git a/client/src/Pages/StatusPage/Create/index.jsx b/client/src/Pages/v1/StatusPage/Create/index.jsx similarity index 92% rename from client/src/Pages/StatusPage/Create/index.jsx rename to client/src/Pages/v1/StatusPage/Create/index.jsx index d4cbc0fd5..674a158ac 100644 --- a/client/src/Pages/StatusPage/Create/index.jsx +++ b/client/src/Pages/v1/StatusPage/Create/index.jsx @@ -1,23 +1,23 @@ // Components import { Stack, Button, Typography } from "@mui/material"; -import Tabs from "./Components/Tabs"; -import GenericFallback from "../../../Components/GenericFallback"; -import SkeletonLayout from "./Components/Skeleton"; -import Dialog from "../../../Components/Dialog"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; +import Tabs from "./Components/Tabs/index.jsx"; +import GenericFallback from "../../../../Components/GenericFallback/index.jsx"; +import SkeletonLayout from "./Components/Skeleton/index.jsx"; +import Dialog from "../../../../Components/Dialog/index.jsx"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; //Utils import { useTheme } from "@emotion/react"; import { useState, useEffect, useRef, useCallback } from "react"; -import { statusPageValidation } from "../../../Validation/validation"; -import { buildErrors } from "../../../Validation/error"; -import { useMonitorsFetch } from "./Hooks/useMonitorsFetch"; -import { useCreateStatusPage } from "./Hooks/useCreateStatusPage"; -import { createToast } from "../../../Utils/toastUtils"; +import { statusPageValidation } from "../../../../Validation/validation.js"; +import { buildErrors } from "../../../../Validation/error.js"; +import { useMonitorsFetch } from "./Hooks/useMonitorsFetch.jsx"; +import { useCreateStatusPage } from "./Hooks/useCreateStatusPage.jsx"; +import { createToast } from "../../../../Utils/toastUtils.jsx"; import { useNavigate } from "react-router-dom"; -import { useStatusPageFetch } from "../Status/Hooks/useStatusPageFetch"; +import { useStatusPageFetch } from "../Status/Hooks/useStatusPageFetch.jsx"; import { useParams } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { useStatusPageDelete } from "../Status/Hooks/useStatusPageDelete"; +import { useStatusPageDelete } from "../Status/Hooks/useStatusPageDelete.jsx"; //Constants const ERROR_TAB_MAPPING = [ ["companyName", "url", "timezone", "color", "isPublished", "logo"], diff --git a/client/src/Pages/StatusPage/Status/Components/AdminLink/index.jsx b/client/src/Pages/v1/StatusPage/Status/Components/AdminLink/index.jsx similarity index 100% rename from client/src/Pages/StatusPage/Status/Components/AdminLink/index.jsx rename to client/src/Pages/v1/StatusPage/Status/Components/AdminLink/index.jsx diff --git a/client/src/Pages/StatusPage/Status/Components/ControlsHeader/index.jsx b/client/src/Pages/v1/StatusPage/Status/Components/ControlsHeader/index.jsx similarity index 92% rename from client/src/Pages/StatusPage/Status/Components/ControlsHeader/index.jsx rename to client/src/Pages/v1/StatusPage/Status/Components/ControlsHeader/index.jsx index beac3b0d2..fa5ed71f1 100644 --- a/client/src/Pages/StatusPage/Status/Components/ControlsHeader/index.jsx +++ b/client/src/Pages/v1/StatusPage/Status/Components/ControlsHeader/index.jsx @@ -1,8 +1,8 @@ // Components import { Box, Stack, Typography, Button } from "@mui/material"; -import Image from "../../../../../Components/Image"; -import SettingsIcon from "../../../../../assets/icons/settings-bold.svg?react"; -import ThemeSwitch from "../../../../../Components/ThemeSwitch"; +import Image from "../../../../../../Components/Image/index.jsx"; +import SettingsIcon from "../../../../../../assets/icons/settings-bold.svg?react"; +import ThemeSwitch from "../../../../../../Components/ThemeSwitch/index.jsx"; import ArrowOutwardIcon from "@mui/icons-material/ArrowOutward"; //Utils import { useTheme } from "@mui/material/styles"; diff --git a/client/src/Pages/StatusPage/Status/Components/MonitorsList/index.jsx b/client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx similarity index 82% rename from client/src/Pages/StatusPage/Status/Components/MonitorsList/index.jsx rename to client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx index 545974c57..fd04dae66 100644 --- a/client/src/Pages/StatusPage/Status/Components/MonitorsList/index.jsx +++ b/client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx @@ -1,12 +1,12 @@ // Components import { Stack, Box } from "@mui/material"; -import Host from "../../../../../Components/Host"; -import StatusPageBarChart from "../../../../../Components/Charts/StatusPageBarChart"; -import { StatusLabel } from "../../../../../Components/Label"; +import Host from "../../../../../../Components/Host/index.jsx"; +import StatusPageBarChart from "../../../../../../Components/Charts/StatusPageBarChart/index.jsx"; +import { StatusLabel } from "../../../../../../Components/Label/index.jsx"; //Utils import { useTheme } from "@mui/material/styles"; -import { useMonitorUtils } from "../../../../../Hooks/useMonitorUtils"; +import { useMonitorUtils } from "../../../../../../Hooks/v1/useMonitorUtils.js"; import PropTypes from "prop-types"; import { useSelector } from "react-redux"; diff --git a/client/src/Pages/StatusPage/Status/Components/Skeleton/index.jsx b/client/src/Pages/v1/StatusPage/Status/Components/Skeleton/index.jsx similarity index 100% rename from client/src/Pages/StatusPage/Status/Components/Skeleton/index.jsx rename to client/src/Pages/v1/StatusPage/Status/Components/Skeleton/index.jsx diff --git a/client/src/Pages/StatusPage/Status/Components/StatusBar/index.jsx b/client/src/Pages/v1/StatusPage/Status/Components/StatusBar/index.jsx similarity index 100% rename from client/src/Pages/StatusPage/Status/Components/StatusBar/index.jsx rename to client/src/Pages/v1/StatusPage/Status/Components/StatusBar/index.jsx diff --git a/client/src/Pages/StatusPage/Status/Hooks/useStatusPageDelete.jsx b/client/src/Pages/v1/StatusPage/Status/Hooks/useStatusPageDelete.jsx similarity index 89% rename from client/src/Pages/StatusPage/Status/Hooks/useStatusPageDelete.jsx rename to client/src/Pages/v1/StatusPage/Status/Hooks/useStatusPageDelete.jsx index 2c39c70b3..038a771ba 100644 --- a/client/src/Pages/StatusPage/Status/Hooks/useStatusPageDelete.jsx +++ b/client/src/Pages/v1/StatusPage/Status/Hooks/useStatusPageDelete.jsx @@ -1,6 +1,6 @@ import { useState } from "react"; -import { networkService } from "../../../../Utils/NetworkService"; -import { createToast } from "../../../../Utils/toastUtils"; +import { networkService } from "../../../../../Utils/NetworkService.js"; +import { createToast } from "../../../../../Utils/toastUtils.jsx"; import { useTranslation } from "react-i18next"; /** diff --git a/client/src/Pages/StatusPage/Status/Hooks/useStatusPageFetch.jsx b/client/src/Pages/v1/StatusPage/Status/Hooks/useStatusPageFetch.jsx similarity index 87% rename from client/src/Pages/StatusPage/Status/Hooks/useStatusPageFetch.jsx rename to client/src/Pages/v1/StatusPage/Status/Hooks/useStatusPageFetch.jsx index ae9c7b579..506082887 100644 --- a/client/src/Pages/StatusPage/Status/Hooks/useStatusPageFetch.jsx +++ b/client/src/Pages/v1/StatusPage/Status/Hooks/useStatusPageFetch.jsx @@ -1,9 +1,9 @@ import { useEffect, useState, useCallback } from "react"; -import { networkService } from "../../../../main"; +import { networkService } from "../../../../../main.jsx"; import { useSelector } from "react-redux"; -import { createToast } from "../../../../Utils/toastUtils"; +import { createToast } from "../../../../../Utils/toastUtils.jsx"; import { useTheme } from "@emotion/react"; -import { useMonitorUtils } from "../../../../Hooks/useMonitorUtils"; +import { useMonitorUtils } from "../../../../../Hooks/v1/useMonitorUtils.js"; const useStatusPageFetch = (isCreate = false, url) => { const [isLoading, setIsLoading] = useState(true); diff --git a/client/src/Pages/StatusPage/Status/index.jsx b/client/src/Pages/v1/StatusPage/Status/index.jsx similarity index 85% rename from client/src/Pages/StatusPage/Status/index.jsx rename to client/src/Pages/v1/StatusPage/Status/index.jsx index a77f2a380..48fc44fc9 100644 --- a/client/src/Pages/StatusPage/Status/index.jsx +++ b/client/src/Pages/v1/StatusPage/Status/index.jsx @@ -1,18 +1,18 @@ // Components import { Typography, Stack } from "@mui/material"; -import GenericFallback from "../../../Components/GenericFallback"; -import AdminLink from "./Components/AdminLink"; -import ControlsHeader from "./Components/ControlsHeader"; -import SkeletonLayout from "./Components/Skeleton"; -import StatusBar from "./Components/StatusBar"; -import MonitorsList from "./Components/MonitorsList"; -import Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx"; -import TextLink from "../../../Components/TextLink"; +import GenericFallback from "../../../../Components/GenericFallback/index.jsx"; +import AdminLink from "./Components/AdminLink/index.jsx"; +import ControlsHeader from "./Components/ControlsHeader/index.jsx"; +import SkeletonLayout from "./Components/Skeleton/index.jsx"; +import StatusBar from "./Components/StatusBar/index.jsx"; +import MonitorsList from "./Components/MonitorsList/index.jsx"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import TextLink from "../../../../Components/TextLink/index.jsx"; // Utils -import { useStatusPageFetch } from "./Hooks/useStatusPageFetch"; +import { useStatusPageFetch } from "./Hooks/useStatusPageFetch.jsx"; import { useTheme } from "@emotion/react"; -import { useIsAdmin } from "../../../Hooks/useIsAdmin"; +import { useIsAdmin } from "../../../../Hooks/v1/useIsAdmin.js"; import { useLocation } from "react-router-dom"; import { useParams } from "react-router-dom"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx b/client/src/Pages/v1/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx similarity index 93% rename from client/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx rename to client/src/Pages/v1/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx index 04d7a6cfb..d8d68fb2e 100644 --- a/client/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx +++ b/client/src/Pages/v1/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx @@ -1,7 +1,7 @@ -import DataTable from "../../../../../Components/Table"; +import DataTable from "../../../../../../Components/Table/index.jsx"; import { useTheme } from "@emotion/react"; import { useNavigate } from "react-router-dom"; -import { StatusLabel } from "../../../../../Components/Label"; +import { StatusLabel } from "../../../../../../Components/Label/index.jsx"; import ArrowOutwardIcon from "@mui/icons-material/ArrowOutward"; import { Stack, Typography } from "@mui/material"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/StatusPage/StatusPages/Hooks/useStatusPagesFetch.jsx b/client/src/Pages/v1/StatusPage/StatusPages/Hooks/useStatusPagesFetch.jsx similarity index 86% rename from client/src/Pages/StatusPage/StatusPages/Hooks/useStatusPagesFetch.jsx rename to client/src/Pages/v1/StatusPage/StatusPages/Hooks/useStatusPagesFetch.jsx index b236368c8..89df1b84d 100644 --- a/client/src/Pages/StatusPage/StatusPages/Hooks/useStatusPagesFetch.jsx +++ b/client/src/Pages/v1/StatusPage/StatusPages/Hooks/useStatusPagesFetch.jsx @@ -1,7 +1,7 @@ import { useState, useEffect } from "react"; -import { networkService } from "../../../../main"; +import { networkService } from "../../../../../main.jsx"; import { useSelector } from "react-redux"; -import { createToast } from "../../../../Utils/toastUtils"; +import { createToast } from "../../../../../Utils/toastUtils.jsx"; const useStatusPagesFetch = () => { const { user } = useSelector((state) => state.auth); diff --git a/client/src/Pages/StatusPage/StatusPages/index.jsx b/client/src/Pages/v1/StatusPage/StatusPages/index.jsx similarity index 70% rename from client/src/Pages/StatusPage/StatusPages/index.jsx rename to client/src/Pages/v1/StatusPage/StatusPages/index.jsx index fa26c2b81..8e0c89ce3 100644 --- a/client/src/Pages/StatusPage/StatusPages/index.jsx +++ b/client/src/Pages/v1/StatusPage/StatusPages/index.jsx @@ -1,13 +1,13 @@ // Components import { Stack } from "@mui/material"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import MonitorCreateHeader from "../../../Components/MonitorCreateHeader"; -import StatusPagesTable from "./Components/StatusPagesTable"; -import PageStateWrapper from "../../../Components/PageStateWrapper"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import MonitorCreateHeader from "../../../../Components/MonitorCreateHeader/index.jsx"; +import StatusPagesTable from "./Components/StatusPagesTable/index.jsx"; +import PageStateWrapper from "../../../../Components/PageStateWrapper/index.jsx"; // Utils import { useTheme } from "@emotion/react"; -import { useStatusPagesFetch } from "./Hooks/useStatusPagesFetch"; -import { useIsAdmin } from "../../../Hooks/useIsAdmin"; +import { useStatusPagesFetch } from "./Hooks/useStatusPagesFetch.jsx"; +import { useIsAdmin } from "../../../../Hooks/v1/useIsAdmin.js"; const BREADCRUMBS = [{ name: `Status Pages`, path: "" }]; const StatusPages = () => { diff --git a/client/src/Pages/Uptime/BulkImport/Upload.jsx b/client/src/Pages/v1/Uptime/BulkImport/Upload.jsx similarity index 100% rename from client/src/Pages/Uptime/BulkImport/Upload.jsx rename to client/src/Pages/v1/Uptime/BulkImport/Upload.jsx diff --git a/client/src/Pages/Uptime/BulkImport/index.jsx b/client/src/Pages/v1/Uptime/BulkImport/index.jsx similarity index 89% rename from client/src/Pages/Uptime/BulkImport/index.jsx rename to client/src/Pages/v1/Uptime/BulkImport/index.jsx index 9490b4eab..412ba0f97 100644 --- a/client/src/Pages/Uptime/BulkImport/index.jsx +++ b/client/src/Pages/v1/Uptime/BulkImport/index.jsx @@ -5,14 +5,14 @@ import { useState } from "react"; import { Box, Stack, Typography, Button, Link } from "@mui/material"; //Components -import { createToast } from "../../../Utils/toastUtils"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import ConfigBox from "../../../Components/ConfigBox"; -import UploadFile from "./Upload"; +import { createToast } from "../../../../Utils/toastUtils.jsx"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import ConfigBox from "../../../../Components/ConfigBox/index.jsx"; +import UploadFile from "./Upload.jsx"; import { useSelector } from "react-redux"; import { useNavigate } from "react-router-dom"; import { Trans, useTranslation } from "react-i18next"; -import { useCreateBulkMonitors } from "../../../Hooks/monitorHooks"; +import { useCreateBulkMonitors } from "../../../../Hooks/v1/monitorHooks.js"; const BulkImport = () => { const theme = useTheme(); diff --git a/client/src/Pages/Uptime/Create/index.css b/client/src/Pages/v1/Uptime/Create/index.css similarity index 100% rename from client/src/Pages/Uptime/Create/index.css rename to client/src/Pages/v1/Uptime/Create/index.css diff --git a/client/src/Pages/Uptime/Create/index.jsx b/client/src/Pages/v1/Uptime/Create/index.jsx similarity index 94% rename from client/src/Pages/Uptime/Create/index.jsx rename to client/src/Pages/v1/Uptime/Create/index.jsx index 3f905fa11..6bb2a3b33 100644 --- a/client/src/Pages/Uptime/Create/index.jsx +++ b/client/src/Pages/v1/Uptime/Create/index.jsx @@ -9,31 +9,31 @@ import { Tooltip, Typography, } from "@mui/material"; -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import TextInput from "../../../Components/Inputs/TextInput"; -import { HttpAdornment } from "../../../Components/Inputs/TextInput/Adornments"; -import Radio from "../../../Components/Inputs/Radio"; -import Select from "../../../Components/Inputs/Select"; -import ConfigBox from "../../../Components/ConfigBox"; -import NotificationsConfig from "../../../Components/NotificationConfig"; -import Checkbox from "../../../Components/Inputs/Checkbox"; -import Dialog from "../../../Components/Dialog"; -import PulseDot from "../../../Components/Animated/PulseDot"; -import SkeletonLayout from "./skeleton"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import TextInput from "../../../../Components/Inputs/TextInput/index.jsx"; +import { HttpAdornment } from "../../../../Components/Inputs/TextInput/Adornments/index.jsx"; +import Radio from "../../../../Components/Inputs/Radio/index.jsx"; +import Select from "../../../../Components/Inputs/Select/index.jsx"; +import ConfigBox from "../../../../Components/ConfigBox/index.jsx"; +import NotificationsConfig from "../../../../Components/NotificationConfig/index.jsx"; +import Checkbox from "../../../../Components/Inputs/Checkbox/index.jsx"; +import Dialog from "../../../../Components/Dialog/index.jsx"; +import PulseDot from "../../../../Components/Animated/PulseDot.jsx"; +import SkeletonLayout from "./skeleton.jsx"; // Utils import PropTypes from "prop-types"; import { useTheme } from "@emotion/react"; import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; -import { monitorValidation } from "../../../Validation/validation"; -import { createToast } from "../../../Utils/toastUtils"; +import { monitorValidation } from "../../../../Validation/validation.js"; +import { createToast } from "../../../../Utils/toastUtils.jsx"; import { PauseOutlined as PauseOutlinedIcon, PlayArrowOutlined as PlayArrowOutlinedIcon, } from "@mui/icons-material"; -import { useMonitorUtils } from "../../../Hooks/useMonitorUtils"; -import { useGetNotificationsByTeamId } from "../../../Hooks/useNotifications"; +import { useMonitorUtils } from "../../../../Hooks/v1/useMonitorUtils.js"; +import { useGetNotificationsByTeamId } from "../../../../Hooks/v1/useNotifications.js"; import { useParams } from "react-router-dom"; import { useCreateMonitor, @@ -42,7 +42,7 @@ import { usePauseMonitor, useFetchMonitorById, useFetchMonitorGames, -} from "../../../Hooks/monitorHooks"; +} from "../../../../Hooks/v1/monitorHooks.js"; /** * Create page renders monitor creation or configuration views. diff --git a/client/src/Pages/Uptime/Create/skeleton.jsx b/client/src/Pages/v1/Uptime/Create/skeleton.jsx similarity index 100% rename from client/src/Pages/Uptime/Create/skeleton.jsx rename to client/src/Pages/v1/Uptime/Create/skeleton.jsx diff --git a/client/src/Pages/Uptime/Details/Components/ChartBoxes/index.jsx b/client/src/Pages/v1/Uptime/Details/Components/ChartBoxes/index.jsx similarity index 86% rename from client/src/Pages/Uptime/Details/Components/ChartBoxes/index.jsx rename to client/src/Pages/v1/Uptime/Details/Components/ChartBoxes/index.jsx index b60a4dd04..c6b76c289 100644 --- a/client/src/Pages/Uptime/Details/Components/ChartBoxes/index.jsx +++ b/client/src/Pages/v1/Uptime/Details/Components/ChartBoxes/index.jsx @@ -1,15 +1,15 @@ // Components import { Stack, Typography, Box } from "@mui/material"; -import ChartBox from "../../../../../Components/Charts/ChartBox"; -import UptimeIcon from "../../../../../assets/icons/uptime-icon.svg?react"; -import IncidentsIcon from "../../../../../assets/icons/incidents.svg?react"; -import AverageResponseIcon from "../../../../../assets/icons/average-response-icon.svg?react"; -import UpBarChart from "../Charts/UpBarChart"; -import DownBarChart from "../Charts/DownBarChart"; -import ResponseGaugeChart from "../Charts/ResponseGaugeChart"; -import SkeletonLayout from "./skeleton"; +import ChartBox from "../../../../../../Components/Charts/ChartBox/index.jsx"; +import UptimeIcon from "../../../../../../assets/icons/uptime-icon.svg?react"; +import IncidentsIcon from "../../../../../../assets/icons/incidents.svg?react"; +import AverageResponseIcon from "../../../../../../assets/icons/average-response-icon.svg?react"; +import UpBarChart from "../Charts/UpBarChart.jsx"; +import DownBarChart from "../Charts/DownBarChart.jsx"; +import ResponseGaugeChart from "../Charts/ResponseGaugeChart.jsx"; +import SkeletonLayout from "./skeleton.jsx"; // Utils -import { formatDateWithTz } from "../../../../../Utils/timeUtils"; +import { formatDateWithTz } from "../../../../../../Utils/timeUtils.js"; import PropTypes from "prop-types"; import { useTheme } from "@emotion/react"; import { useState } from "react"; diff --git a/client/src/Pages/Uptime/Details/Components/ChartBoxes/skeleton.jsx b/client/src/Pages/v1/Uptime/Details/Components/ChartBoxes/skeleton.jsx similarity index 100% rename from client/src/Pages/Uptime/Details/Components/ChartBoxes/skeleton.jsx rename to client/src/Pages/v1/Uptime/Details/Components/ChartBoxes/skeleton.jsx diff --git a/client/src/Pages/Uptime/Details/Components/Charts/CustomLabels.jsx b/client/src/Pages/v1/Uptime/Details/Components/Charts/CustomLabels.jsx similarity index 93% rename from client/src/Pages/Uptime/Details/Components/Charts/CustomLabels.jsx rename to client/src/Pages/v1/Uptime/Details/Components/Charts/CustomLabels.jsx index 8df33953f..c9c1ff58d 100644 --- a/client/src/Pages/Uptime/Details/Components/Charts/CustomLabels.jsx +++ b/client/src/Pages/v1/Uptime/Details/Components/Charts/CustomLabels.jsx @@ -1,6 +1,6 @@ import PropTypes from "prop-types"; import { useSelector } from "react-redux"; -import { formatDateWithTz } from "../../../../../Utils/timeUtils"; +import { formatDateWithTz } from "../../../../../../Utils/timeUtils.js"; const CustomLabels = ({ x, width, height, firstDataPoint, lastDataPoint, type }) => { const uiTimezone = useSelector((state) => state.ui.timezone); diff --git a/client/src/Pages/Uptime/Details/Components/Charts/DownBarChart.jsx b/client/src/Pages/v1/Uptime/Details/Components/Charts/DownBarChart.jsx similarity index 97% rename from client/src/Pages/Uptime/Details/Components/Charts/DownBarChart.jsx rename to client/src/Pages/v1/Uptime/Details/Components/Charts/DownBarChart.jsx index 662abc831..c5e08ecca 100644 --- a/client/src/Pages/Uptime/Details/Components/Charts/DownBarChart.jsx +++ b/client/src/Pages/v1/Uptime/Details/Components/Charts/DownBarChart.jsx @@ -2,7 +2,7 @@ import { memo, useState } from "react"; import { useTheme } from "@mui/material"; import { ResponsiveContainer, BarChart, XAxis, Bar, Cell } from "recharts"; import PropTypes from "prop-types"; -import CustomLabels from "./CustomLabels"; +import CustomLabels from "./CustomLabels.jsx"; const DownBarChart = memo(({ groupedDownChecks = [], type, onBarHover }) => { const theme = useTheme(); diff --git a/client/src/Pages/Uptime/Details/Components/Charts/ResponseGaugeChart.jsx b/client/src/Pages/v1/Uptime/Details/Components/Charts/ResponseGaugeChart.jsx similarity index 100% rename from client/src/Pages/Uptime/Details/Components/Charts/ResponseGaugeChart.jsx rename to client/src/Pages/v1/Uptime/Details/Components/Charts/ResponseGaugeChart.jsx diff --git a/client/src/Pages/Uptime/Details/Components/Charts/ResponseTimeChart.jsx b/client/src/Pages/v1/Uptime/Details/Components/Charts/ResponseTimeChart.jsx similarity index 60% rename from client/src/Pages/Uptime/Details/Components/Charts/ResponseTimeChart.jsx rename to client/src/Pages/v1/Uptime/Details/Components/Charts/ResponseTimeChart.jsx index e2d8dea80..f306dfd76 100644 --- a/client/src/Pages/Uptime/Details/Components/Charts/ResponseTimeChart.jsx +++ b/client/src/Pages/v1/Uptime/Details/Components/Charts/ResponseTimeChart.jsx @@ -1,7 +1,7 @@ -import ChartBox from "../../../../../Components/Charts/ChartBox"; -import MonitorDetailsAreaChart from "../../../../../Components/Charts/MonitorDetailsAreaChart"; -import ResponseTimeIcon from "../../../../../assets/icons/response-time-icon.svg?react"; -import SkeletonLayout from "./ResponseTimeChartSkeleton"; +import ChartBox from "../../../../../../Components/Charts/ChartBox/index.jsx"; +import MonitorDetailsAreaChart from "../../../../../../Components/Charts/MonitorDetailsAreaChart/index.jsx"; +import ResponseTimeIcon from "../../../../../../assets/icons/response-time-icon.svg?react"; +import SkeletonLayout from "./ResponseTimeChartSkeleton.jsx"; import PropTypes from "prop-types"; const ResponseTImeChart = ({ isLoading = false, groupedChecks = [], dateRange }) => { diff --git a/client/src/Pages/Uptime/Details/Components/Charts/ResponseTimeChartSkeleton.jsx b/client/src/Pages/v1/Uptime/Details/Components/Charts/ResponseTimeChartSkeleton.jsx similarity index 100% rename from client/src/Pages/Uptime/Details/Components/Charts/ResponseTimeChartSkeleton.jsx rename to client/src/Pages/v1/Uptime/Details/Components/Charts/ResponseTimeChartSkeleton.jsx diff --git a/client/src/Pages/Uptime/Details/Components/Charts/UpBarChart.jsx b/client/src/Pages/v1/Uptime/Details/Components/Charts/UpBarChart.jsx similarity index 98% rename from client/src/Pages/Uptime/Details/Components/Charts/UpBarChart.jsx rename to client/src/Pages/v1/Uptime/Details/Components/Charts/UpBarChart.jsx index 317147b74..8f1af8912 100644 --- a/client/src/Pages/Uptime/Details/Components/Charts/UpBarChart.jsx +++ b/client/src/Pages/v1/Uptime/Details/Components/Charts/UpBarChart.jsx @@ -2,7 +2,7 @@ import { memo, useState } from "react"; import { useTheme } from "@mui/material"; import { ResponsiveContainer, BarChart, XAxis, Bar, Cell } from "recharts"; import PropTypes from "prop-types"; -import CustomLabels from "./CustomLabels"; +import CustomLabels from "./CustomLabels.jsx"; const getThemeColor = (responseTime) => { if (responseTime < 200) { diff --git a/client/src/Pages/Uptime/Details/Components/ResponseTable/index.jsx b/client/src/Pages/v1/Uptime/Details/Components/ResponseTable/index.jsx similarity index 76% rename from client/src/Pages/Uptime/Details/Components/ResponseTable/index.jsx rename to client/src/Pages/v1/Uptime/Details/Components/ResponseTable/index.jsx index 4d482aa07..cc5745a26 100644 --- a/client/src/Pages/Uptime/Details/Components/ResponseTable/index.jsx +++ b/client/src/Pages/v1/Uptime/Details/Components/ResponseTable/index.jsx @@ -1,12 +1,12 @@ -import ChartBox from "../../../../../Components/Charts/ChartBox"; +import ChartBox from "../../../../../../Components/Charts/ChartBox/index.jsx"; import PropTypes from "prop-types"; -import HistoryIcon from "../../../../../assets/icons/history-icon.svg?react"; -import Table from "../../../../../Components/Table"; -import TablePagination from "../../../../../Components/Table/TablePagination"; -import { StatusLabel } from "../../../../../Components/Label"; +import HistoryIcon from "../../../../../../assets/icons/history-icon.svg?react"; +import Table from "../../../../../../Components/Table/index.jsx"; +import TablePagination from "../../../../../../Components/Table/TablePagination/index.jsx"; +import { StatusLabel } from "../../../../../../Components/Label/index.jsx"; import { useTranslation } from "react-i18next"; -import { formatDateWithTz } from "../../../../../Utils/timeUtils"; -import SkeletonLayout from "./skeleton"; +import { formatDateWithTz } from "../../../../../../Utils/timeUtils.js"; +import SkeletonLayout from "./skeleton.jsx"; const ResponseTable = ({ isLoading = false, checks = [], diff --git a/client/src/Pages/Uptime/Details/Components/ResponseTable/skeleton.jsx b/client/src/Pages/v1/Uptime/Details/Components/ResponseTable/skeleton.jsx similarity index 100% rename from client/src/Pages/Uptime/Details/Components/ResponseTable/skeleton.jsx rename to client/src/Pages/v1/Uptime/Details/Components/ResponseTable/skeleton.jsx diff --git a/client/src/Pages/Uptime/Details/Components/UptimeStatusBoxes/index.jsx b/client/src/Pages/v1/Uptime/Details/Components/UptimeStatusBoxes/index.jsx similarity index 85% rename from client/src/Pages/Uptime/Details/Components/UptimeStatusBoxes/index.jsx rename to client/src/Pages/v1/Uptime/Details/Components/UptimeStatusBoxes/index.jsx index abeb251fe..f0988466c 100644 --- a/client/src/Pages/Uptime/Details/Components/UptimeStatusBoxes/index.jsx +++ b/client/src/Pages/v1/Uptime/Details/Components/UptimeStatusBoxes/index.jsx @@ -1,11 +1,11 @@ -import StatusBoxes from "../../../../../Components/StatusBoxes"; -import StatBox from "../../../../../Components/StatBox"; +import StatusBoxes from "../../../../../../Components/StatusBoxes/index.jsx"; +import StatBox from "../../../../../../Components/StatBox/index.jsx"; import PropTypes from "prop-types"; -import { getHumanReadableDuration } from "../../../../../Utils/timeUtils"; +import { getHumanReadableDuration } from "../../../../../../Utils/timeUtils.js"; import { useTheme } from "@mui/material/styles"; import { Typography } from "@mui/material"; -import { useMonitorUtils } from "../../../../../Hooks/useMonitorUtils"; +import { useMonitorUtils } from "../../../../../../Hooks/v1/useMonitorUtils.js"; const UptimeStatusBoxes = ({ isLoading = false, diff --git a/client/src/Pages/Uptime/Details/Hooks/useCertificateFetch.jsx b/client/src/Pages/v1/Uptime/Details/Hooks/useCertificateFetch.jsx similarity index 84% rename from client/src/Pages/Uptime/Details/Hooks/useCertificateFetch.jsx rename to client/src/Pages/v1/Uptime/Details/Hooks/useCertificateFetch.jsx index ad0db6f70..f85111f97 100644 --- a/client/src/Pages/Uptime/Details/Hooks/useCertificateFetch.jsx +++ b/client/src/Pages/v1/Uptime/Details/Hooks/useCertificateFetch.jsx @@ -1,7 +1,7 @@ -import { logger } from "../../../../Utils/Logger"; +import { logger } from "../../../../../Utils/Logger.js"; import { useEffect, useState } from "react"; -import { networkService } from "../../../../main"; -import { formatDateWithTz } from "../../../../Utils/timeUtils"; +import { networkService } from "../../../../../main.jsx"; +import { formatDateWithTz } from "../../../../../Utils/timeUtils.js"; const useCertificateFetch = ({ monitor, diff --git a/client/src/Pages/Uptime/Details/index.jsx b/client/src/Pages/v1/Uptime/Details/index.jsx similarity index 83% rename from client/src/Pages/Uptime/Details/index.jsx rename to client/src/Pages/v1/Uptime/Details/index.jsx index c72a5756f..4e773dc2b 100644 --- a/client/src/Pages/Uptime/Details/index.jsx +++ b/client/src/Pages/v1/Uptime/Details/index.jsx @@ -1,12 +1,12 @@ // Components -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import MonitorDetailsControlHeader from "../../../Components/MonitorDetailsControlHeader"; -import MonitorTimeFrameHeader from "../../../Components/MonitorTimeFrameHeader"; -import ChartBoxes from "./Components/ChartBoxes"; -import ResponseTimeChart from "./Components/Charts/ResponseTimeChart"; -import ResponseTable from "./Components/ResponseTable"; -import UptimeStatusBoxes from "./Components/UptimeStatusBoxes"; -import GenericFallback from "../../../Components/GenericFallback"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import MonitorDetailsControlHeader from "../../../../Components/MonitorDetailsControlHeader/index.jsx"; +import MonitorTimeFrameHeader from "../../../../Components/MonitorTimeFrameHeader/index.jsx"; +import ChartBoxes from "./Components/ChartBoxes/index.jsx"; +import ResponseTimeChart from "./Components/Charts/ResponseTimeChart.jsx"; +import ResponseTable from "./Components/ResponseTable/index.jsx"; +import UptimeStatusBoxes from "./Components/UptimeStatusBoxes/index.jsx"; +import GenericFallback from "../../../../Components/GenericFallback/index.jsx"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; @@ -15,10 +15,10 @@ import { useState } from "react"; import { useParams } from "react-router-dom"; import { useSelector } from "react-redux"; import { useTheme } from "@emotion/react"; -import { useIsAdmin } from "../../../Hooks/useIsAdmin"; -import { useFetchUptimeMonitorById } from "../../../Hooks/monitorHooks"; -import useCertificateFetch from "./Hooks/useCertificateFetch"; -import { useFetchChecksByMonitor } from "../../../Hooks/checkHooks"; +import { useIsAdmin } from "../../../../Hooks/v1/useIsAdmin.js"; +import { useFetchUptimeMonitorById } from "../../../../Hooks/v1/monitorHooks.js"; +import useCertificateFetch from "./Hooks/useCertificateFetch.jsx"; +import { useFetchChecksByMonitor } from "../../../../Hooks/v1/checkHooks.js"; import { useTranslation } from "react-i18next"; // Constants diff --git a/client/src/Pages/Uptime/Monitors/Components/Filter/index.jsx b/client/src/Pages/v1/Uptime/Monitors/Components/Filter/index.jsx similarity index 98% rename from client/src/Pages/Uptime/Monitors/Components/Filter/index.jsx rename to client/src/Pages/v1/Uptime/Monitors/Components/Filter/index.jsx index 0efb06b6c..85c4a8540 100644 --- a/client/src/Pages/Uptime/Monitors/Components/Filter/index.jsx +++ b/client/src/Pages/v1/Uptime/Monitors/Components/Filter/index.jsx @@ -1,6 +1,6 @@ import { useTheme } from "@emotion/react"; import PropTypes from "prop-types"; -import FilterHeader from "../../../../../Components/FilterHeader"; +import FilterHeader from "../../../../../../Components/FilterHeader/index.jsx"; import { useMemo } from "react"; import { Box, Button } from "@mui/material"; import ClearIcon from "@mui/icons-material/Clear"; diff --git a/client/src/Pages/Uptime/Monitors/Components/LoadingSpinner/index.jsx b/client/src/Pages/v1/Uptime/Monitors/Components/LoadingSpinner/index.jsx similarity index 100% rename from client/src/Pages/Uptime/Monitors/Components/LoadingSpinner/index.jsx rename to client/src/Pages/v1/Uptime/Monitors/Components/LoadingSpinner/index.jsx diff --git a/client/src/Pages/Uptime/Monitors/Components/SearchComponent/index.jsx b/client/src/Pages/v1/Uptime/Monitors/Components/SearchComponent/index.jsx similarity index 89% rename from client/src/Pages/Uptime/Monitors/Components/SearchComponent/index.jsx rename to client/src/Pages/v1/Uptime/Monitors/Components/SearchComponent/index.jsx index 0c6eec854..3339102a2 100644 --- a/client/src/Pages/Uptime/Monitors/Components/SearchComponent/index.jsx +++ b/client/src/Pages/v1/Uptime/Monitors/Components/SearchComponent/index.jsx @@ -1,7 +1,7 @@ import { useState } from "react"; -import Search from "../../../../../Components/Inputs/Search"; +import Search from "../../../../../../Components/Inputs/Search/index.jsx"; import { Box } from "@mui/material"; -import useDebounce from "../../Hooks/useDebounce"; +import useDebounce from "../../Hooks/useDebounce.jsx"; import { useEffect, useRef } from "react"; import PropTypes from "prop-types"; diff --git a/client/src/Pages/Uptime/Monitors/Components/Skeleton/index.jsx b/client/src/Pages/v1/Uptime/Monitors/Components/Skeleton/index.jsx similarity index 100% rename from client/src/Pages/Uptime/Monitors/Components/Skeleton/index.jsx rename to client/src/Pages/v1/Uptime/Monitors/Components/Skeleton/index.jsx diff --git a/client/src/Pages/Uptime/Monitors/Components/StatusBoxes/index.jsx b/client/src/Pages/v1/Uptime/Monitors/Components/StatusBoxes/index.jsx similarity index 91% rename from client/src/Pages/Uptime/Monitors/Components/StatusBoxes/index.jsx rename to client/src/Pages/v1/Uptime/Monitors/Components/StatusBoxes/index.jsx index 9cd29c4ca..5cba9e3b1 100644 --- a/client/src/Pages/Uptime/Monitors/Components/StatusBoxes/index.jsx +++ b/client/src/Pages/v1/Uptime/Monitors/Components/StatusBoxes/index.jsx @@ -1,9 +1,9 @@ import PropTypes from "prop-types"; import { Stack } from "@mui/material"; -import StatusBox from "./statusBox"; +import StatusBox from "./statusBox.jsx"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; -import SkeletonLayout from "./skeleton"; +import SkeletonLayout from "./skeleton.jsx"; const StatusBoxes = ({ shouldRender, monitorsSummary }) => { const theme = useTheme(); diff --git a/client/src/Pages/Uptime/Monitors/Components/StatusBoxes/skeleton.jsx b/client/src/Pages/v1/Uptime/Monitors/Components/StatusBoxes/skeleton.jsx similarity index 100% rename from client/src/Pages/Uptime/Monitors/Components/StatusBoxes/skeleton.jsx rename to client/src/Pages/v1/Uptime/Monitors/Components/StatusBoxes/skeleton.jsx diff --git a/client/src/Pages/Uptime/Monitors/Components/StatusBoxes/statusBox.jsx b/client/src/Pages/v1/Uptime/Monitors/Components/StatusBoxes/statusBox.jsx similarity index 90% rename from client/src/Pages/Uptime/Monitors/Components/StatusBoxes/statusBox.jsx rename to client/src/Pages/v1/Uptime/Monitors/Components/StatusBoxes/statusBox.jsx index 78d555409..c745e7935 100644 --- a/client/src/Pages/Uptime/Monitors/Components/StatusBoxes/statusBox.jsx +++ b/client/src/Pages/v1/Uptime/Monitors/Components/StatusBoxes/statusBox.jsx @@ -1,9 +1,9 @@ import PropTypes from "prop-types"; import { useTheme } from "@emotion/react"; import { Box, Stack, Typography } from "@mui/material"; -import Arrow from "../../../../../assets/icons/top-right-arrow.svg?react"; -import Background from "../../../../../assets/Images/background-grid.svg?react"; -import ClockSnooze from "../../../../../assets/icons/clock-snooze.svg?react"; +import Arrow from "../../../../../../assets/icons/top-right-arrow.svg?react"; +import Background from "../../../../../../assets/Images/background-grid.svg?react"; +import ClockSnooze from "../../../../../../assets/icons/clock-snooze.svg?react"; const StatusBox = ({ title, value, status }) => { const theme = useTheme(); diff --git a/client/src/Pages/Uptime/Monitors/Components/UptimeDataTable/index.jsx b/client/src/Pages/v1/Uptime/Monitors/Components/UptimeDataTable/index.jsx similarity index 90% rename from client/src/Pages/Uptime/Monitors/Components/UptimeDataTable/index.jsx rename to client/src/Pages/v1/Uptime/Monitors/Components/UptimeDataTable/index.jsx index 63a40f85a..575647eab 100644 --- a/client/src/Pages/Uptime/Monitors/Components/UptimeDataTable/index.jsx +++ b/client/src/Pages/v1/Uptime/Monitors/Components/UptimeDataTable/index.jsx @@ -1,19 +1,19 @@ // Components import { Box, Stack } from "@mui/material"; -import DataTable from "../../../../../Components/Table"; +import DataTable from "../../../../../../Components/Table/index.jsx"; import ArrowDownwardRoundedIcon from "@mui/icons-material/ArrowDownwardRounded"; import ArrowUpwardRoundedIcon from "@mui/icons-material/ArrowUpwardRounded"; -import Host from "../../../../../Components/Host"; -import { StatusLabel } from "../../../../../Components/Label"; -import BarChart from "../../../../../Components/Charts/BarChart"; -import ActionsMenu from "../../../../../Components/ActionsMenu"; +import Host from "../../../../../../Components/Host/index.jsx"; +import { StatusLabel } from "../../../../../../Components/Label/index.jsx"; +import BarChart from "../../../../../../Components/Charts/BarChart/index.jsx"; +import ActionsMenu from "../../../../../../Components/ActionsMenu/index.jsx"; -import LoadingSpinner from "../LoadingSpinner"; -import TableSkeleton from "../../../../../Components/Table/skeleton"; +import LoadingSpinner from "../LoadingSpinner/index.jsx"; +import TableSkeleton from "../../../../../../Components/Table/skeleton.jsx"; // Utils import { useTheme } from "@emotion/react"; -import { useMonitorUtils } from "../../../../../Hooks/useMonitorUtils"; +import { useMonitorUtils } from "../../../../../../Hooks/v1/useMonitorUtils.js"; import { useNavigate } from "react-router-dom"; import PropTypes from "prop-types"; import { useTranslation } from "react-i18next"; diff --git a/client/src/Pages/Uptime/Monitors/Hooks/useDebounce.jsx b/client/src/Pages/v1/Uptime/Monitors/Hooks/useDebounce.jsx similarity index 100% rename from client/src/Pages/Uptime/Monitors/Hooks/useDebounce.jsx rename to client/src/Pages/v1/Uptime/Monitors/Hooks/useDebounce.jsx diff --git a/client/src/Pages/Uptime/Monitors/index.jsx b/client/src/Pages/v1/Uptime/Monitors/index.jsx similarity index 86% rename from client/src/Pages/Uptime/Monitors/index.jsx rename to client/src/Pages/v1/Uptime/Monitors/index.jsx index 7f28c1cd7..dae0bc2d5 100644 --- a/client/src/Pages/Uptime/Monitors/index.jsx +++ b/client/src/Pages/v1/Uptime/Monitors/index.jsx @@ -4,32 +4,32 @@ // 2a.List of monitors must have the total number of monitors that match. // Components -import Breadcrumbs from "../../../Components/Breadcrumbs"; -import Greeting from "../../../Utils/greeting"; -import StatusBoxes from "./Components/StatusBoxes"; -import UptimeDataTable from "./Components/UptimeDataTable"; -import Pagination from "../../../Components/Table/TablePagination"; -import CreateMonitorHeader from "../../../Components/MonitorCreateHeader"; -import SearchComponent from "./Components/SearchComponent"; -import Filter from "./Components/Filter"; -import PageStateWrapper from "../../../Components/PageStateWrapper"; +import Breadcrumbs from "../../../../Components/Breadcrumbs/index.jsx"; +import Greeting from "../../../../Utils/greeting.jsx"; +import StatusBoxes from "./Components/StatusBoxes/index.jsx"; +import UptimeDataTable from "./Components/UptimeDataTable/index.jsx"; +import Pagination from "../../../../Components/Table/TablePagination/index.jsx"; +import CreateMonitorHeader from "../../../../Components/MonitorCreateHeader/index.jsx"; +import SearchComponent from "./Components/SearchComponent/index.jsx"; +import Filter from "./Components/Filter/index.jsx"; +import PageStateWrapper from "../../../../Components/PageStateWrapper/index.jsx"; -import MonitorCountHeader from "../../../Components/MonitorCountHeader"; +import MonitorCountHeader from "../../../../Components/MonitorCountHeader/index.jsx"; // MUI Components import { Stack, Box, Button } from "@mui/material"; // Utils import { useState, useCallback, useEffect } from "react"; -import { useIsAdmin } from "../../../Hooks/useIsAdmin"; +import { useIsAdmin } from "../../../../Hooks/v1/useIsAdmin.js"; import { useTheme } from "@emotion/react"; import { useNavigate } from "react-router-dom"; import { useSelector, useDispatch } from "react-redux"; -import { setRowsPerPage } from "../../../Features/UI/uiSlice"; +import { setRowsPerPage } from "../../../../Features/UI/uiSlice.js"; import PropTypes from "prop-types"; import { useFetchMonitorsWithSummary, useFetchMonitorsWithChecks, -} from "../../../Hooks/monitorHooks"; +} from "../../../../Hooks/v1/monitorHooks.js"; import { useTranslation } from "react-i18next"; const TYPES = ["http", "ping", "docker", "port", "game"]; diff --git a/client/src/Routes/index.jsx b/client/src/Routes/index.jsx index 7ddcd7e3c..0de847cb7 100644 --- a/client/src/Routes/index.jsx +++ b/client/src/Routes/index.jsx @@ -1,57 +1,57 @@ import { Navigate, Route, Routes as LibRoutes } from "react-router"; import HomeLayout from "../Components/Layouts/HomeLayout"; -import NotFound from "../Pages/NotFound"; +import NotFound from "../Pages/v1/NotFound"; // Auth -import AuthLogin from "../Pages/Auth/Login"; -import AuthRegister from "../Pages/Auth/Register/"; -import AuthForgotPassword from "../Pages/Auth/ForgotPassword"; -import AuthCheckEmail from "../Pages/Auth/CheckEmail"; -import AuthSetNewPassword from "../Pages/Auth/SetNewPassword"; -import AuthNewPasswordConfirmed from "../Pages/Auth/NewPasswordConfirmed"; +import AuthLogin from "../Pages/v1/Auth/Login"; +import AuthRegister from "../Pages/v1/Auth/Register/"; +import AuthForgotPassword from "../Pages/v1/Auth/ForgotPassword"; +import AuthCheckEmail from "../Pages/v1/Auth/CheckEmail"; +import AuthSetNewPassword from "../Pages/v1/Auth/SetNewPassword"; +import AuthNewPasswordConfirmed from "../Pages/v1/Auth/NewPasswordConfirmed"; // Uptime -import Uptime from "../Pages/Uptime/Monitors"; -import UptimeDetails from "../Pages/Uptime/Details"; -import UptimeCreate from "../Pages/Uptime/Create"; +import Uptime from "../Pages/v1/Uptime/Monitors"; +import UptimeDetails from "../Pages/v1/Uptime/Details"; +import UptimeCreate from "../Pages/v1/Uptime/Create"; // PageSpeed -import PageSpeed from "../Pages/PageSpeed/Monitors"; -import PageSpeedDetails from "../Pages/PageSpeed/Details"; -import PageSpeedCreate from "../Pages/PageSpeed/Create"; +import PageSpeed from "../Pages/v1/PageSpeed/Monitors"; +import PageSpeedDetails from "../Pages/v1/PageSpeed/Details"; +import PageSpeedCreate from "../Pages/v1/PageSpeed/Create"; // Infrastructure -import Infrastructure from "../Pages/Infrastructure/Monitors"; -import InfrastructureCreate from "../Pages/Infrastructure/Create"; -import InfrastructureDetails from "../Pages/Infrastructure/Details"; +import Infrastructure from "../Pages/v1/Infrastructure/Monitors"; +import InfrastructureCreate from "../Pages/v1/Infrastructure/Create"; +import InfrastructureDetails from "../Pages/v1/Infrastructure/Details"; // Server Status -import ServerUnreachable from "../Pages/ServerUnreachable"; +import ServerUnreachable from "../Pages/v1/ServerUnreachable.jsx"; // Incidents -import Incidents from "../Pages/Incidents"; +import Incidents from "../Pages/v1/Incidents"; // Status pages -import CreateStatus from "../Pages/StatusPage/Create"; -import StatusPages from "../Pages/StatusPage/StatusPages"; -import Status from "../Pages/StatusPage/Status"; +import CreateStatus from "../Pages/v1/StatusPage/Create"; +import StatusPages from "../Pages/v1/StatusPage/StatusPages"; +import Status from "../Pages/v1/StatusPage/Status"; -import Notifications from "../Pages/Notifications"; -import CreateNotifications from "../Pages/Notifications/create"; +import Notifications from "../Pages/v1/Notifications"; +import CreateNotifications from "../Pages/v1/Notifications/create"; // Settings -import Account from "../Pages/Account"; -import EditUser from "../Pages/Account/EditUser"; -import Settings from "../Pages/Settings"; +import Account from "../Pages/v1/Account"; +import EditUser from "../Pages/v1/Account/EditUser"; +import Settings from "../Pages/v1/Settings"; -import Maintenance from "../Pages/Maintenance"; +import Maintenance from "../Pages/v1/Maintenance"; import ProtectedRoute from "../Components/ProtectedRoute"; import RoleProtectedRoute from "../Components/RoleProtectedRoute"; -import CreateNewMaintenanceWindow from "../Pages/Maintenance/CreateMaintenance"; +import CreateNewMaintenanceWindow from "../Pages/v1/Maintenance/CreateMaintenance"; import withAdminCheck from "../Components/HOC/withAdminCheck"; -import BulkImport from "../Pages/Uptime/BulkImport"; -import Logs from "../Pages/Logs"; +import BulkImport from "../Pages/v1/Uptime/BulkImport"; +import Logs from "../Pages/v1/Logs"; const Routes = () => { const AdminCheckedRegister = withAdminCheck(AuthRegister); diff --git a/client/tsconfig.app.json b/client/tsconfig.app.json new file mode 100644 index 000000000..f44839e9f --- /dev/null +++ b/client/tsconfig.app.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2022", + "useDefineForClassFields": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true, + "paths": { + "@/*": ["./src/*"] + }, + "allowJs": true, + "checkJs": false + }, + "include": ["src"] +} diff --git a/client/tsconfig.json b/client/tsconfig.json new file mode 100644 index 000000000..a1a0f47d0 --- /dev/null +++ b/client/tsconfig.json @@ -0,0 +1,14 @@ +{ + "files": [], + "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }], + "compilerOptions": { + "module": "ESNext", + "moduleResolution": "Bundler", + "skipLibCheck": true, + "paths": { + "@/*": ["./src/*"] + }, + "allowJs": true, + "checkJs": false + } +} diff --git a/client/tsconfig.node.json b/client/tsconfig.node.json new file mode 100644 index 000000000..bbd18d2b2 --- /dev/null +++ b/client/tsconfig.node.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2023", + "lib": ["ES2023"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true, + "allowJs": true, + "checkJs": false + }, + "include": ["vite.config.ts"] +} diff --git a/client/vite.config.js b/client/vite.config.ts similarity index 63% rename from client/vite.config.js rename to client/vite.config.ts index 07b5de748..66630e88c 100644 --- a/client/vite.config.js +++ b/client/vite.config.ts @@ -1,10 +1,8 @@ -import { defineConfig, loadEnv } from "vite"; +import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import svgr from "vite-plugin-svgr"; -import { execSync } from "child_process"; -export default defineConfig(({ mode }) => { - const env = loadEnv(mode, process.cwd(), ""); +export default defineConfig(({}) => { let version = "3.2.0"; return {