diff --git a/frontend/src/layouts/dashboard/sidebar/Sidebar.tsx b/frontend/src/layouts/dashboard/sidebar/Sidebar.tsx index aa9669f..61f9d84 100644 --- a/frontend/src/layouts/dashboard/sidebar/Sidebar.tsx +++ b/frontend/src/layouts/dashboard/sidebar/Sidebar.tsx @@ -19,15 +19,15 @@ const sidebarItems: SidebarEntryProps[] = [ { label: 'My Reports', icon: IconReport, - link: '/myreports', + link: '/user/reports', }, { label: 'Browse', icon: IconSearch, initiallyOpened: true, links: [ - { label: 'Reports', link: '/reports' }, - { label: 'Users', link: '/users' }, + { label: 'Reports', link: '/browse/reports' }, + { label: 'Users', link: '/browse/users' }, ], }, { @@ -49,8 +49,8 @@ const sidebarItems: SidebarEntryProps[] = [ label: 'About', icon: IconInfoCircle, links: [ - { label: 'FAQ', link: '/faq' }, - { label: 'Thesis', link: '/thesis' }, + { label: 'FAQ', link: '/about/faq' }, + { label: 'Thesis', link: '/about/thesis' }, ], }, ]; diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 29bdbb3..c133091 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -7,7 +7,7 @@ import { RouterProvider } from 'react-router-dom'; import router from './routes/router.tsx'; import Providers from './providers/Providers.tsx'; import { ErrorBoundary } from 'react-error-boundary'; -import { MainFallback } from './routes/fallbacks/MainFallback.tsx'; +import { MainFallback } from './routes/MainFallback.tsx'; createRoot(document.getElementById('root')!).render( diff --git a/frontend/src/routes/fallbacks/MainFallback.tsx b/frontend/src/routes/MainFallback.tsx similarity index 100% rename from frontend/src/routes/fallbacks/MainFallback.tsx rename to frontend/src/routes/MainFallback.tsx diff --git a/frontend/src/routes/fallbacks/PageFallback.tsx b/frontend/src/routes/PageFallback.tsx similarity index 92% rename from frontend/src/routes/fallbacks/PageFallback.tsx rename to frontend/src/routes/PageFallback.tsx index 81740c1..edd6edf 100644 --- a/frontend/src/routes/fallbacks/PageFallback.tsx +++ b/frontend/src/routes/PageFallback.tsx @@ -1,4 +1,4 @@ -import { Center, Stack, Title, Text, Card } from '@mantine/core'; +import { Card, Center, Stack, Text, Title } from '@mantine/core'; import { IconAlertCircle } from '@tabler/icons-react'; export const PageFallback = ({ error }) => { diff --git a/frontend/src/routes/about/Section.tsx b/frontend/src/routes/about/faq/Section.tsx similarity index 100% rename from frontend/src/routes/about/Section.tsx rename to frontend/src/routes/about/faq/Section.tsx diff --git a/frontend/src/routes/about/page.tsx b/frontend/src/routes/about/faq/page.tsx similarity index 96% rename from frontend/src/routes/about/page.tsx rename to frontend/src/routes/about/faq/page.tsx index 5c89fe4..58d9cc8 100644 --- a/frontend/src/routes/about/page.tsx +++ b/frontend/src/routes/about/faq/page.tsx @@ -1,7 +1,7 @@ -import Section from './Section'; +import Section from './Section.tsx'; import { Box } from '@mantine/core'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../../PageFallback.tsx'; /** * About page, contains information about the project and the team. diff --git a/frontend/src/routes/about/thesis/page.tsx b/frontend/src/routes/about/thesis/page.tsx new file mode 100644 index 0000000..8d81465 --- /dev/null +++ b/frontend/src/routes/about/thesis/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../../PageFallback'; + +const ThesisPage = () => { + return ( + + Thesis + + ); +}; + +export default function () { + return ( + + + + ); +} diff --git a/frontend/src/routes/browse/reports/page.tsx b/frontend/src/routes/browse/reports/page.tsx new file mode 100644 index 0000000..e6ade1d --- /dev/null +++ b/frontend/src/routes/browse/reports/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../../PageFallback'; + +const BrowseReportsPage = () => { + return ( + + Browse Reports + + ); +}; + +export default function () { + return ( + + + + ); +} diff --git a/frontend/src/routes/browse/users/page.tsx b/frontend/src/routes/browse/users/page.tsx new file mode 100644 index 0000000..73f07db --- /dev/null +++ b/frontend/src/routes/browse/users/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../../PageFallback'; + +const BrowseUsersPage = () => { + return ( + + Browse Users + + ); +}; + +export default function () { + return ( + + + + ); +} diff --git a/frontend/src/routes/dashboard/page.tsx b/frontend/src/routes/dashboard/page.tsx index 55f9d2b..a4d5d84 100644 --- a/frontend/src/routes/dashboard/page.tsx +++ b/frontend/src/routes/dashboard/page.tsx @@ -1,6 +1,6 @@ import { Title } from '@mantine/core'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../PageFallback.tsx'; /** * Dashboard page, gets user info asynchronously diff --git a/frontend/src/routes/login/page.tsx b/frontend/src/routes/login/page.tsx index adaea42..62e90b6 100644 --- a/frontend/src/routes/login/page.tsx +++ b/frontend/src/routes/login/page.tsx @@ -1,13 +1,13 @@ import { useGoogleLogin } from '@react-oauth/google'; -import GoogleSignInButton from './googleSignInButton/GoogleSignInButton.tsx'; +import GoogleSignInButton from './ui/googleSignInButton/GoogleSignInButton.tsx'; import { useSetAtom } from 'jotai'; import Cookies from 'js-cookie'; import { userInfoAtom } from '../../atoms'; import { useNavigate } from 'react-router-dom'; -import { Center, Stack, Title, Box, Card } from '@mantine/core'; +import { Box, Card, Center, Stack, Title } from '@mantine/core'; import { notifications } from '@mantine/notifications'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../PageFallback.tsx'; /** * Login card with Google sign in button diff --git a/frontend/src/routes/login/googleSignInButton/GoogleSignInButton.module.scss b/frontend/src/routes/login/ui/googleSignInButton/GoogleSignInButton.module.scss similarity index 100% rename from frontend/src/routes/login/googleSignInButton/GoogleSignInButton.module.scss rename to frontend/src/routes/login/ui/googleSignInButton/GoogleSignInButton.module.scss diff --git a/frontend/src/routes/login/googleSignInButton/GoogleSignInButton.tsx b/frontend/src/routes/login/ui/googleSignInButton/GoogleSignInButton.tsx similarity index 90% rename from frontend/src/routes/login/googleSignInButton/GoogleSignInButton.tsx rename to frontend/src/routes/login/ui/googleSignInButton/GoogleSignInButton.tsx index 79671f0..23334ef 100644 --- a/frontend/src/routes/login/googleSignInButton/GoogleSignInButton.tsx +++ b/frontend/src/routes/login/ui/googleSignInButton/GoogleSignInButton.tsx @@ -1,4 +1,4 @@ -import { Button, Image, Center, Box } from '@mantine/core'; +import { Box, Button, Center, Image } from '@mantine/core'; import classes from './GoogleSignInButton.module.scss'; export default function GoogleSignInButton({ diff --git a/frontend/src/routes/page.tsx b/frontend/src/routes/page.tsx index 7f503a3..acd442c 100644 --- a/frontend/src/routes/page.tsx +++ b/frontend/src/routes/page.tsx @@ -1,7 +1,7 @@ import Demo from '../components/Demo'; import { Center, Container, Title } from '@mantine/core'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from './fallbacks/PageFallback.tsx'; +import { PageFallback } from './PageFallback.tsx'; const Root = () => { return ( diff --git a/frontend/src/routes/releases/page.tsx b/frontend/src/routes/releases/page.tsx new file mode 100644 index 0000000..f4bf4fa --- /dev/null +++ b/frontend/src/routes/releases/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../PageFallback.tsx'; + +const ReleasesPage = () => { + return ( + + Releases + + ); +}; + +export default function () { + return ( + + + + ); +} diff --git a/frontend/src/routes/report/page.tsx b/frontend/src/routes/report/page.tsx index 6171904..059aa28 100644 --- a/frontend/src/routes/report/page.tsx +++ b/frontend/src/routes/report/page.tsx @@ -16,18 +16,13 @@ import { } from '@mantine/core'; import { useForm } from '@mantine/form'; import { useEffect, useState } from 'react'; -import { DataSource } from './schema.ts'; +import { DataSource, ReportFormValidationSchema, ReportFormValues, RowWrapper } from './schema.ts'; import { zodResolver } from 'mantine-form-zod-resolver'; import { DataSourceTable } from './DataSourceTable.tsx'; -import { - ReportFormValidationSchema, - ReportFormValues, - RowWrapper, -} from './schema.ts'; import { transformJson } from './transformJson.ts'; import { RMoodsClient } from '../../rmoods/client/RMoodsClient.ts'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../PageFallback.tsx'; import { IconLock, IconWorld } from '@tabler/icons-react'; /** diff --git a/frontend/src/routes/router.tsx b/frontend/src/routes/router.tsx index 4d12906..39755b5 100644 --- a/frontend/src/routes/router.tsx +++ b/frontend/src/routes/router.tsx @@ -1,15 +1,21 @@ import { createHashRouter } from 'react-router-dom'; -import About from './about/page.tsx'; +import Faq from './about/faq/page.tsx'; import Dashboard from './dashboard/page.tsx'; import Login from './login/page.tsx'; import Root from './page.tsx'; -import UserPage from './user/userPage/page.tsx'; +import UserPage from './user/page.tsx'; import Report from './report/page.tsx'; import Layout from '../layouts/standard/layout/Layout.tsx'; import ProtectedRoute from './ProtectedRoute.tsx'; import DashboardLayout from '../layouts/dashboard/layout/DashboardLayout.tsx'; import Settings from './settings/page.tsx'; import WebsocketProvider from '../providers/WebsocketProvider.tsx'; +import Releases from './releases/page.tsx'; +import Thesis from './about/thesis/page.tsx'; +import BrowseReports from './browse/reports/page.tsx'; +import BrowseUsers from './browse/users/page.tsx'; +import Sandbox from './sandbox/page.tsx'; +import UserReports from './user/reports/page.tsx'; const router = createHashRouter([ { @@ -33,10 +39,30 @@ const router = createHashRouter([ path: '/user', element: , }, + { + path: '/user/reports', + element: , + }, { path: '/settings', element: , }, + { + path: '/browse/reports', + element: , + }, + { + path: '/browse/users', + element: , + }, + { + path: '/sandbox', + element: , + }, + { + path: '/releases', + element: , + }, ], }, { @@ -47,8 +73,12 @@ const router = createHashRouter([ element: , }, { - path: '/about', - element: , + path: '/about/faq', + element: , + }, + { + path: '/about/thesis', + element: , }, { path: '/login', diff --git a/frontend/src/routes/sandbox/page.tsx b/frontend/src/routes/sandbox/page.tsx new file mode 100644 index 0000000..875c8c7 --- /dev/null +++ b/frontend/src/routes/sandbox/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../PageFallback.tsx'; + +const SandboxPage = () => { + return ( + + NLP Sandbox + + ); +}; + +export default function () { + return ( + + + + ); +} diff --git a/frontend/src/routes/settings/page.tsx b/frontend/src/routes/settings/page.tsx index 23e5c05..1da79e5 100644 --- a/frontend/src/routes/settings/page.tsx +++ b/frontend/src/routes/settings/page.tsx @@ -1,9 +1,13 @@ -import { Box } from '@mantine/core'; +import { Box, Title } from '@mantine/core'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../PageFallback.tsx'; const Settings = () => { - return Work in progress; + return ( + + Settings + + ); }; export default function () { diff --git a/frontend/src/routes/user/userPage/page.module.scss b/frontend/src/routes/user/page.module.scss similarity index 100% rename from frontend/src/routes/user/userPage/page.module.scss rename to frontend/src/routes/user/page.module.scss diff --git a/frontend/src/routes/user/userPage/page.tsx b/frontend/src/routes/user/page.tsx similarity index 90% rename from frontend/src/routes/user/userPage/page.tsx rename to frontend/src/routes/user/page.tsx index 4db6756..f6928c0 100644 --- a/frontend/src/routes/user/userPage/page.tsx +++ b/frontend/src/routes/user/page.tsx @@ -1,14 +1,15 @@ -import { Box, Text, Loader, Flex } from '@mantine/core'; +import { Box, Flex, Loader, Text } from '@mantine/core'; import Cookies from 'js-cookie'; import { jwtDecode } from 'jwt-decode'; -import UserCard from '../userCard/UserCard.tsx'; -import StatisticItem from '../statisticItem/StatisticItem.tsx'; -import { JwtClaims } from '../../../rmoods/jwt.ts'; -import authFetch from '../../../rmoods/client/authFetch.ts'; +import UserCard from './ui/userCard/UserCard.tsx'; +import StatisticItem from './ui/statisticItem/StatisticItem.tsx'; +import { JwtClaims } from '../../rmoods/jwt.ts'; +import authFetch from '../../rmoods/client/authFetch.ts'; import { useQuery } from '@tanstack/react-query'; import { ErrorBoundary } from 'react-error-boundary'; -import { PageFallback } from '../../fallbacks/PageFallback.tsx'; +import { PageFallback } from '../PageFallback.tsx'; import classes from './page.module.scss'; + /** * User interface representing the user data. */ diff --git a/frontend/src/routes/user/reports/page.tsx b/frontend/src/routes/user/reports/page.tsx new file mode 100644 index 0000000..4320070 --- /dev/null +++ b/frontend/src/routes/user/reports/page.tsx @@ -0,0 +1,19 @@ +import { Box, Title } from '@mantine/core'; +import { ErrorBoundary } from 'react-error-boundary'; +import { PageFallback } from '../../PageFallback'; + +const UserReportsPage = () => { + return ( + + My Reports + + ); +}; + +export default function () { + return ( + + + + ); +} diff --git a/frontend/src/routes/user/profilePicture/ProfilePicture.module.scss b/frontend/src/routes/user/ui/profilePicture/ProfilePicture.module.scss similarity index 100% rename from frontend/src/routes/user/profilePicture/ProfilePicture.module.scss rename to frontend/src/routes/user/ui/profilePicture/ProfilePicture.module.scss diff --git a/frontend/src/routes/user/profilePicture/ProfilePicture.tsx b/frontend/src/routes/user/ui/profilePicture/ProfilePicture.tsx similarity index 93% rename from frontend/src/routes/user/profilePicture/ProfilePicture.tsx rename to frontend/src/routes/user/ui/profilePicture/ProfilePicture.tsx index c124840..d3aba3b 100644 --- a/frontend/src/routes/user/profilePicture/ProfilePicture.tsx +++ b/frontend/src/routes/user/ui/profilePicture/ProfilePicture.tsx @@ -1,9 +1,10 @@ import React from 'react'; -import { Image, Box, Flex } from '@mantine/core'; -import { changeDefaultGoogleProfilePictureSize } from '../../../utility/changeDefaultGoogleProfilePictureSize.ts'; +import { Flex, Image } from '@mantine/core'; +import { changeDefaultGoogleProfilePictureSize } from '../../../../utility/changeDefaultGoogleProfilePictureSize.ts'; import { ErrorBoundary } from 'react-error-boundary'; import { ProfilePictureFallback } from '../profilePictureFallback/ProfilePictureFallback.tsx'; import classes from './ProfilePicture.module.scss'; + /** * Props for the ProfilePicture component. */ diff --git a/frontend/src/routes/user/profilePictureFallback/ProfilePictureFallback.module.scss b/frontend/src/routes/user/ui/profilePictureFallback/ProfilePictureFallback.module.scss similarity index 100% rename from frontend/src/routes/user/profilePictureFallback/ProfilePictureFallback.module.scss rename to frontend/src/routes/user/ui/profilePictureFallback/ProfilePictureFallback.module.scss diff --git a/frontend/src/routes/user/profilePictureFallback/ProfilePictureFallback.tsx b/frontend/src/routes/user/ui/profilePictureFallback/ProfilePictureFallback.tsx similarity index 100% rename from frontend/src/routes/user/profilePictureFallback/ProfilePictureFallback.tsx rename to frontend/src/routes/user/ui/profilePictureFallback/ProfilePictureFallback.tsx diff --git a/frontend/src/routes/user/statisticItem/StatisticItem.module.scss b/frontend/src/routes/user/ui/statisticItem/StatisticItem.module.scss similarity index 100% rename from frontend/src/routes/user/statisticItem/StatisticItem.module.scss rename to frontend/src/routes/user/ui/statisticItem/StatisticItem.module.scss diff --git a/frontend/src/routes/user/statisticItem/StatisticItem.tsx b/frontend/src/routes/user/ui/statisticItem/StatisticItem.tsx similarity index 99% rename from frontend/src/routes/user/statisticItem/StatisticItem.tsx rename to frontend/src/routes/user/ui/statisticItem/StatisticItem.tsx index 0425d6c..a465ab0 100644 --- a/frontend/src/routes/user/statisticItem/StatisticItem.tsx +++ b/frontend/src/routes/user/ui/statisticItem/StatisticItem.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Box, Text } from '@mantine/core'; import classes from './StatisticItem.module.scss'; + /** * Props for the StatisticItem component. */ diff --git a/frontend/src/routes/user/userCard/UserCard.module.scss b/frontend/src/routes/user/ui/userCard/UserCard.module.scss similarity index 100% rename from frontend/src/routes/user/userCard/UserCard.module.scss rename to frontend/src/routes/user/ui/userCard/UserCard.module.scss diff --git a/frontend/src/routes/user/userCard/UserCard.tsx b/frontend/src/routes/user/ui/userCard/UserCard.tsx similarity index 96% rename from frontend/src/routes/user/userCard/UserCard.tsx rename to frontend/src/routes/user/ui/userCard/UserCard.tsx index d517e50..a6f14ac 100644 --- a/frontend/src/routes/user/userCard/UserCard.tsx +++ b/frontend/src/routes/user/ui/userCard/UserCard.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { Box, Divider, Flex, Text, Title } from '@mantine/core'; import ProfilePicture from '../profilePicture/ProfilePicture.tsx'; -import { User } from '../userPage/page.tsx'; +import { User } from '../../page.tsx'; import classes from './UserCard.module.scss'; + /** * Props for the UserCard component. */