Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

740 frontendtech debt structure improvements #746

Merged
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
53a2519
Correct TermsAndConditionsComponent naming with camel case
AlexanderSychev2005 Aug 28, 2024
2f91ace
Format directories for components by CamelCase style
AlexanderSychev2005 Aug 29, 2024
9862593
Moved components tests to component folders
AlexanderSychev2005 Aug 29, 2024
1326c49
Define navigation logic for the client and admin app in the 'routes' …
AlexanderSychev2005 Aug 29, 2024
1d46c9a
Define entry points of React pages in the pages folder.
AlexanderSychev2005 Aug 29, 2024
43f597a
Fixed router
AlexanderSychev2005 Aug 29, 2024
e90a591
Merge remote-tracking branch 'origin/740-frontendtech-debt-structure-…
AlexanderSychev2005 Aug 29, 2024
a5f38d8
Fixed pages
AlexanderSychev2005 Aug 29, 2024
9899922
Format settings
AlexanderSychev2005 Aug 30, 2024
14ce1fc
Format settings
AlexanderSychev2005 Aug 30, 2024
91556b7
Fixed conflicts
AlexanderSychev2005 Aug 30, 2024
a1fa37a
Moved SignUp pages to Basic Page folder
AlexanderSychev2005 Aug 31, 2024
d6df32a
Fixed Header component on Admin Page
AlexanderSychev2005 Aug 31, 2024
be290ad
Moved Admin Page and Basic Page to routes directory
AlexanderSychev2005 Aug 31, 2024
0f78c91
Moved table component from Admin Page
AlexanderSychev2005 Aug 31, 2024
fb3abc4
Merge branch 'refs/heads/develop' into 740-frontendtech-debt-structur…
AlexanderSychev2005 Sep 11, 2024
f1966b2
Merge branch 'refs/heads/develop' into 740-frontendtech-debt-structur…
AlexanderSychev2005 Sep 11, 2024
82f4636
Fixed conflicts
AlexanderSychev2005 Sep 11, 2024
33c84f2
Defined AdminRouter and ClientRouter
AlexanderSychev2005 Sep 11, 2024
2534034
Moved pages in relevant folders
AlexanderSychev2005 Sep 13, 2024
614c7e2
Moved pages in relevant folders
AlexanderSychev2005 Sep 14, 2024
7aaac47
Merge branch 'refs/heads/develop' into 740-frontendtech-debt-structur…
AlexanderSychev2005 Sep 14, 2024
f0ecc27
Fixed Conflicts
AlexanderSychev2005 Sep 14, 2024
42fb2a3
Fixed Conflicts
AlexanderSychev2005 Sep 14, 2024
abaac87
Merge branch 'refs/heads/develop' into 740-frontendtech-debt-structur…
AlexanderSychev2005 Sep 15, 2024
37cef52
Fixed Conflicts
AlexanderSychev2005 Sep 15, 2024
d617073
Fixed Admin header
AlexanderSychev2005 Sep 20, 2024
4c1ed60
Fixed Sign Up and Custom Themes
AlexanderSychev2005 Sep 20, 2024
d1c06d8
Renamed page for tables
AlexanderSychev2005 Sep 20, 2024
df3b246
Moved pages
AlexanderSychev2005 Sep 20, 2024
35402e2
Fixed Conflicts
AlexanderSychev2005 Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions FrontEnd/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
import React from 'react';
import './App.css';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import AdminPage from './components/adminPage/AdminPage';
import BasicPage from './components/basicPage/BasicPage';
import { AuthProvider } from './context';
import { RouterProvider } from 'react-router-dom';
import router from './routes/Router';

function App() {
const router = createBrowserRouter([
{
path: '/*',
element: (
<AuthProvider>
<BasicPage />
</AuthProvider>
),
},
{
path: '/customadmin/*',
element: (
<AuthProvider>
<AdminPage />
</AuthProvider>
),
},
]);

return (
<div className="App">
<h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Login from '../authorization/Login';
import Login from './/Login';
import classes from './AuthorizationPage.module.css';

const AuthorizationPage = () => {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import EyeInvisible from './EyeInvisible';
import classes from './LoginPage.module.css';
import { useAuth } from '../../hooks/';
import checkIfStaff from '../adminPage/checkIfStaff';
import checkIfStaff from '../../pages/AdminPage/checkIfStaff';

const LoginContent = () => {
const { login } = useAuth();
Expand Down Expand Up @@ -76,7 +76,7 @@
clearErrors('unspecifiedError');
clearErrors('rateError');
clearErrors('blockedUserError');
}, [getValues('email'), getValues('password'), clearErrors]);

Check warning on line 79 in FrontEnd/src/components/Authorization/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / Linting

React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked

Check warning on line 79 in FrontEnd/src/components/Authorization/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / Linting

React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked

const disabled = !isValid || (isRunning && minutes < 10);

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen, cleanup } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';

import CompanyCard from '../components/CompanyCard/CompanyCard';
import CompanyCard from '../CompanyCard';

const mockedUser = {
email: 'test@test.com',
Expand All @@ -10,7 +10,7 @@ const mockedUser = {
profile_id: 1,
surname: 'Test',
};
jest.mock('../hooks/useAuth', () => ({
jest.mock('../../../hooks/useAuth', () => ({
useAuth: () => {
return mockedUser;
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Link } from 'react-router-dom';
import { useCookies } from 'react-cookie';
import styles from './CookieMod.module.css';
import cookiesimage from './cookieimg/homecookies.png';
import cookiesimage from './CookieImg/homecookies.png';
import { useState } from 'react';

const CookieMod = ({ active, setActive }) => {

Check warning on line 7 in FrontEnd/src/components/CookieAcception/CookieMod.jsx

View workflow job for this annotation

GitHub Actions / Linting

'active' is missing in props validation
const [cookies, setCookie] = useCookies();
const [detailsVisible, setDetailsVisible] = useState(false);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen, cleanup } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';

import CookieMod from '../components/cookieacception/CookieMod';
import CookieMod from '../CookieMod';

afterEach(cleanup);

Expand Down
AlexanderSychev2005 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import FooterTop from './top/FooterTop';
import FooterBottom from './bottom/FooterBottom';
import ShortFooter from './short/ShortFooter';
import FooterTop from './Top/FooterTop';
import FooterBottom from './Bottom/FooterBottom';
import ShortFooter from './Short/ShortFooter';
import css from './Footer.module.css';

const UNSUITABLE_PAGES = ['login', 'register'];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import css from './Header.module.css';
import HeaderMenu from './menu/HeaderMenu';
import Navbar from './navbar/Navbar';
import HeaderMenu from './Menu/HeaderMenu';
import Navbar from './Navbar/Navbar';

function Header(props) {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import './About.css';
import React from 'react';
import AboutSectionCards from './cards/AboutCards';
import AboutSectionText from './about-text/AboutText';
import AboutSectionCards from './Cards/AboutCards';
import AboutSectionText from './AboutText/AboutText';
import AboutTextContent from './AboutMainText.js';

const MainAboutSection = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import MainCompanies from '../components/landing-page/companies/Companies';
import MainCompanies from '../Companies';

afterEach(() => {
jest.resetAllMocks();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useState } from 'react';
import MainBanner from './banner/Banner';
import MainBanner from './Banner/Banner';
// import MainPartners from './partners/Partners';
import MainCompanies from './companies/Companies';
import MainLoginBanner from './login-banner/LoginBanner';
import MainAboutSection from './about-section/About';
import CookieMod from '../cookieacception/CookieMod';
import MainCompanies from './Companies/Companies';
import MainLoginBanner from './LoginBanner/LoginBanner';
import MainAboutSection from './AboutSection/About';
import CookieMod from '../CookieAcception/CookieMod';
import css from './MainPage.module.css';
import PropTypes from 'prop-types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios';
import{ useState, useEffect } from 'react';
import { useParams, useSearchParams } from 'react-router-dom';
import MainPage from '../landing-page/MainPage';
import MainPage from '../LandingPage/MainPage';
import MyModal from '../ProfilePage/UI/MyModal/MyModal';
import classes from './ModerationModal.module.css';

Expand Down
4 changes: 2 additions & 2 deletions FrontEnd/src/components/ProfileDetail/ProfileDetailPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useState } from 'react';
import { useParams } from 'react-router-dom';
import { PropTypes } from 'prop-types';

import Loader from '../loader/Loader';
import ErrorPage404 from '../errorPages/ErrorPage404';
import Loader from '../Loader/Loader';
import ErrorPage404 from '../ErrorPages/ErrorPage404';
import MainInfoSection from './MainInfo/MainInfoSection';
import DetailedInfoSection from './DetailedInfo/DetailedInfoSection';
import BannerImage from './BannerImage';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import axios from 'axios';
import { Radio } from 'antd';
import useSWR from 'swr';

import ErrorPage404 from '../errorPages/ErrorPage404';
import Loader from '../loader/Loader';
import ErrorPage404 from '../ErrorPages/ErrorPage404';
import Loader from '../Loader/Loader';
import ProfileList from './ProfileList';

import css from './ProfileListPage.module.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import checkFormIsDirty from '../../../utils/checkFormIsDirty';
import defineChanges from '../../../utils/defineChanges';
import { useAuth, useProfile } from '../../../hooks';
import HalfFormField from './FormFields/HalfFormField';
import Loader from '../../loader/Loader';
import Loader from '../../Loader/Loader';
import css from './FormComponents.module.css';

const LABELS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useContext } from 'react';
import { useForm } from 'react-hook-form';
import { DirtyFormContext } from '../../../context/DirtyFormContext';
import PasswordField from './FormFields/PasswordField';
import Loader from '../../loader/Loader';
import Loader from '../../Loader/Loader';
import css from './ChangePassword.module.css';

export default function ChangePassword(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import defineChanges from '../../../utils/defineChanges';
import { formatPhoneNumber } from '../../../utils/formatPhoneNumber';
import FullField from './FormFields/FullField';
import HalfFormField from './FormFields/HalfFormField';
import Loader from '../../loader/Loader';
import Loader from '../../Loader/Loader';
import css from './FormComponents.module.css';
import { useMask } from '@react-input/mask';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { PropTypes } from 'prop-types';
import EyeInvisible from '../../../authorization/EyeInvisible';
import EyeVisible from '../../../authorization/EyeVisible';
import EyeInvisible from '../../../Authorization/EyeInvisible';
import EyeVisible from '../../../Authorization/EyeVisible';
import preventEnterSubmit from '../../../../utils/preventEnterSubmit';
import css from './PasswordField.module.css';
import { PASSWORD_PATTERN } from '../../../../constants/constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import HalfFormField from './FormFields/HalfFormField';
import ImageField from './FormFields/ImageField';
import MultipleSelectChip from './FormFields/MultipleSelectChip';
import TextField from './FormFields/TextField';
import Loader from '../../loader/Loader';
import Loader from '../../Loader/Loader';
import validateEdrpou from '../../../utils/validateEdrpou';
import validateRnokpp from '../../../utils/validateRnokpp';
import BanerModeration from './BanerModeration';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import checkFormIsDirty from '../../../utils/checkFormIsDirty';
import defineChanges from '../../../utils/defineChanges';
import { useAuth, useProfile } from '../../../hooks';
import TextField from './FormFields/TextField';
import Loader from '../../loader/Loader';
import Loader from '../../Loader/Loader';
import css from './FormComponents.module.css';

const LABELS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import checkFormIsDirty from '../../../utils/checkFormIsDirty';
import defineChanges from '../../../utils/defineChanges';
import { useAuth, useProfile } from '../../../hooks';
import TextField from './FormFields/TextField';
import Loader from '../../loader/Loader';
import Loader from '../../Loader/Loader';
import css from './FormComponents.module.css';

const LABELS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useAuth, useProfile } from '../../../hooks';
import checkFormIsDirty from '../../../utils/checkFormIsDirty';
import defineChanges from '../../../utils/defineChanges';
import HalfFormField from './FormFields/HalfFormField';
import Loader from '../../loader/Loader';
import Loader from '../../Loader/Loader';
import css from './FormComponents.module.css';

const LABELS = {
Expand Down
2 changes: 1 addition & 1 deletion FrontEnd/src/components/ProfilePage/ProfilePage.jsx
AlexanderSychev2005 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Description from './ProfilePageComponents/Description';
import ProfileContent from './ProfilePageComponents/ProfileContent';
import { useState } from 'react';
import BreadCrumbs from '../BreadCrumbs/BreadCrumbs';
import Loader from '../loader/Loader';
import Loader from '../Loader/Loader';
import { useAuth, useProfile } from '../../hooks';

const ProfilePage = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { Link } from 'react-router-dom';
import { RestorePasswordFormContentComponent } from './restorepassword-form/RestorePasswordFormContent';
import { RestorePasswordFormContentComponent } from './RestorePasswordForm/RestorePasswordFormContent';
import styles from './RestorePasswordForm.module.css';


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { useNavigate } from 'react-router-dom';
import { useParams } from 'react-router-dom';
import { PropTypes } from 'prop-types';
import { PASSWORD_PATTERN } from '../../../../../constants/constants';
import EyeInvisible from '../../../../authorization/EyeInvisible';
import EyeVisible from '../../../../authorization/EyeVisible';
import EyeInvisible from '../../../../Authorization/EyeInvisible';
import EyeVisible from '../../../../Authorization/EyeVisible';
import styles from './RestorePasswordFormContent.module.css';

export function RestorePasswordFormContentComponent({ setIsValid }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styles from './SendEmailForm.module.css';
import { SendEmailRestorePasswordFormContentComponent } from './restorepassword-form/EmailFormContent';
import { SendEmailRestorePasswordFormContentComponent } from './RestorePasswordForm/EmailFormContent';
import { useState } from 'react';
import { Link } from 'react-router-dom';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Link } from 'react-router-dom';
import styles from './RestorePasswordPage.module.css';
import { RestorePasswordFormComponent } from '../components/restorepassword/RestorePasswordForm';
import { RestorePasswordFormComponent } from '../Components/RestorePassword/RestorePasswordForm';

export function RestorePasswordPage() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Link } from 'react-router-dom';
import styles from './SendEmailRestorePassword.module.css';
import { SendEmailRestorePasswordFormComponent } from '../components/restorepassword/SendEmailForm';
import { SendEmailRestorePasswordFormComponent } from '../Components/RestorePassword/SendEmailForm';

export function SendEmailRestorePasswordPage() {
return (
Expand Down
2 changes: 1 addition & 1 deletion FrontEnd/src/components/SearchPage/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios';
import { useState, useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import BreadCrumbs from '../BreadCrumbs/BreadCrumbs';
import SearchResults from './search_field/SearchResults';
import SearchResults from './SearchField/SearchResults';
import link_to_left from './img/link_to_left.svg';
import link_to_right from './img/link_to_right.svg';
import styles from './search.module.css';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen, cleanup } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';

import SearchResults from '../components/SearchPage/search_field/SearchResults';
import SearchResults from '../SearchResults';

const mockedUser = {
email: 'test@test.com',
Expand All @@ -10,7 +10,7 @@ const mockedUser = {
profile_id: 1,
surname: 'Test'
};
jest.mock('../hooks/useAuth', () => ({
jest.mock('../../../../hooks/useAuth', () => ({
useAuth: () => {
return mockedUser;
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';

import Search from '../components/SearchPage/Search';
import Search from '../Search';

afterEach(() => {
jest.resetAllMocks();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useNavigate } from 'react-router-dom';
import { toast } from 'react-toastify';
import axios from 'axios';
import { Tooltip } from 'antd';
import EyeInvisible from '../../../../authorization/EyeInvisible';
import EyeVisible from '../../../../authorization/EyeVisible';
import EyeInvisible from '../../../../Authorization/EyeInvisible';
import EyeVisible from '../../../../Authorization/EyeVisible';
import styles from './SignUpFormContent.module.css';
import PropTypes from 'prop-types';
import {
Expand Down
AlexanderSychev2005 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import { useParams } from 'react-router-dom';
import AuthorizationPage from '../../authorization/AuthorizationPage';
import AuthorizationPage from '../../Authorization/AuthorizationPage';
import styles from './ActivateProfileModal.module.css';

export function ActivationProfilePage() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { ToastContainer } from 'react-toastify';
import './AdminGlobal.css';
import Header from './header/Header';
import Menu from './menu/Menu';
import UserDetail from './detail-view/UserDetail';
import UserTable from './table/UserTable';
import ProfilesTable from './table/ProfilesTable';
import ProfileDetail from './detail-view/ProfileDetail';
import Header from './Header/Header';
import Menu from './Menu/Menu';
import UserDetail from './DetailView/UserDetail';
import UserTable from './Table/UserTable';
import ProfilesTable from './Table/ProfilesTable';
import ProfileDetail from './DetailView/ProfileDetail';
import css from './AdminPage.module.css';
import { Routes, Route } from 'react-router-dom';
import MainPage from './mainPage/MainPage';
import MainPage from './MainPage/MainPage';
import { useAuth } from '../../hooks';
import Loader from '../loader/Loader';
import AutoApproveDelay from './auto-approve-delay/AutoApproveDelay';
import Loader from '../../components/Loader/Loader';
import AutoApproveDelay from './AutoApproveDelay/AutoApproveDelay';

function AdminPage() {
const { isLoading, isAuth, isStaff } = useAuth();
Expand Down
AlexanderSychev2005 marked this conversation as resolved.
Show resolved Hide resolved
File renamed without changes.
AlexanderSychev2005 marked this conversation as resolved.
Show resolved Hide resolved
File renamed without changes.
Loading