Compare commits
No commits in common. "f180586eb36529b6ba080b236e305f5e6e794793" and "727d55798a061a505c6807a3a27b6a1a653c6c2a" have entirely different histories.
f180586eb3
...
727d55798a
147
src/App.jsx
147
src/App.jsx
@ -10,9 +10,50 @@ import {
|
||||
|
||||
import { getNotification } from "@redux/outstaffingSlice";
|
||||
|
||||
import { MainPage } from "@pages/MainPage/MainPage";
|
||||
import { Article } from "@pages/Article/Article";
|
||||
import { Auth } from "@pages/Auth/Auth";
|
||||
import { AuthForCandidate } from "@pages/AuthForCandidate/AuthForCandidate";
|
||||
import { Blog } from "@pages/Blog/Blog";
|
||||
import CatalogSpecialists from "@pages/CatalogSpecialists/CatalogSpecialists";
|
||||
import { CompanyInfo } from "@pages/CompanyInfo/CompanyInfo";
|
||||
import { FormPage } from "@pages/FormPage/FormPage";
|
||||
import { Forms } from "@pages/Forms/Forms";
|
||||
import { FrequentlyAskedQuestion } from "@pages/FrequentlyAskedQuestion/FrequentlyAskedQuestion";
|
||||
import { FrequentlyAskedQuestions } from "@pages/FrequentlyAskedQuestions/FrequentlyAskedQuestions";
|
||||
import { Home } from "@pages/Home/Home";
|
||||
import { PartnerAddRequest } from "@pages/PartnerAddRequest/PartnerAddRequest";
|
||||
import { PartnerBid } from "@pages/PartnerBid/PartnerBid";
|
||||
import { PartnerEmployeeReport } from "@pages/PartnerEmployeeReport/PartnerEmployeeReport";
|
||||
import { PartnerEmployees } from "@pages/PartnerEmployees/PartnerEmployees";
|
||||
import { PartnerRequests } from "@pages/PartnerRequests/PartnerRequests";
|
||||
import { PartnerSettings } from "@pages/PartnerSettings/PartnerSettings";
|
||||
import { PartnerTreaties } from "@pages/PartnerTreaties/PartnerTreaties";
|
||||
import { PartnerCategories } from "@pages/PartnerСategories/PartnerСategories";
|
||||
import { Payouts } from "@pages/Payouts/Payouts";
|
||||
import { Profile } from "@pages/Profile/Profile";
|
||||
import { ProfileCandidate } from "@pages/ProfileCandidate/ProfileCandidate";
|
||||
import { ProjectTracker } from "@pages/ProjectTracker/ProjectTracker";
|
||||
import { PassingTests } from "@pages/Quiz/PassingTests";
|
||||
import { QuizPage } from "@pages/Quiz/QuizPage";
|
||||
import { QuizReportPage } from "@pages/Quiz/QuizReportPage";
|
||||
import { RegistrationForCandidate } from "@pages/RegistrationForCandidate/RegistrationForCandidate";
|
||||
import { RegistrationSetting } from "@pages/RegistrationSetting/RegistrationSetting";
|
||||
import { SingleReportPage } from "@pages/SingleReportPage/SingleReportPage";
|
||||
import Statistics from "@pages/Statistics/Statistics";
|
||||
import { Summary } from "@pages/Summary/Summary";
|
||||
import { Tracker } from "@pages/Tracker/Tracker";
|
||||
import { TrackerAuth } from "@pages/TrackerAuth/TrackerAuth";
|
||||
import { TrackerIntro } from "@pages/TrackerIntro/TrackerIntro";
|
||||
import { TrackerRegistration } from "@pages/TrackerRegistration/TrackerRegistration";
|
||||
import { ViewReport } from "@pages/ViewReport/ViewReport";
|
||||
|
||||
import { Calendar } from "@components/Calendar/Calendar";
|
||||
import { Candidate } from "@components/Candidate/Candidate";
|
||||
import { FreeDevelopers } from "@components/FreeDevelopers/FreeDevelopers";
|
||||
import { TicketFullScreen } from "@components/Modal/Tracker/TicketFullScreen/TicketFullScreen";
|
||||
import { Notification } from "@components/Notification/Notification";
|
||||
import { ProfileCalendar } from "@components/ProfileCalendar/ProfileCalendar";
|
||||
import { ReportForm } from "@components/ReportForm/ReportForm";
|
||||
|
||||
import "assets/fonts/stylesheet.css";
|
||||
import "assets/global.scss";
|
||||
@ -23,7 +64,109 @@ const App = () => {
|
||||
<>
|
||||
<Router>
|
||||
<Routes>
|
||||
<Route path="*" element={<MainPage />} />
|
||||
<Route exact path="/auth" element={<Auth />} />
|
||||
<Route exact path="/tracker-intro" element={<TrackerIntro />} />
|
||||
<Route exact path="/tracker-auth" element={<TrackerAuth />} />
|
||||
<Route exact path="/forms" element={<Forms />} />
|
||||
<Route
|
||||
exact
|
||||
path="/tracker-registration"
|
||||
element={<TrackerRegistration />}
|
||||
/>
|
||||
<Route exact path="/company" element={<CompanyInfo />} />
|
||||
<Route
|
||||
exact
|
||||
path="/registration-setting"
|
||||
element={<RegistrationSetting />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/catalog-specialists"
|
||||
element={<CatalogSpecialists />}
|
||||
/>
|
||||
|
||||
<Route exact path="/worker/:id" element={<FreeDevelopers />} />
|
||||
<Route
|
||||
exact
|
||||
path="/tracker/task/:id"
|
||||
element={<TicketFullScreen />}
|
||||
></Route>
|
||||
<Route
|
||||
exact
|
||||
path="/tracker/project/:id"
|
||||
element={<ProjectTracker />}
|
||||
/>
|
||||
|
||||
<Route exact path="/auth-candidate" element={<AuthForCandidate />} />
|
||||
<Route
|
||||
exact
|
||||
path="/registration-candidate"
|
||||
element={<RegistrationForCandidate />}
|
||||
/>
|
||||
|
||||
<Route exact path="/blog" element={<Blog />}></Route>
|
||||
<Route exact path="/blog/article/:id" element={<Article />}></Route>
|
||||
<Route
|
||||
exact
|
||||
path="/frequently-asked-questions"
|
||||
element={<FrequentlyAskedQuestions />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/frequently-asked-question/:id"
|
||||
element={<FrequentlyAskedQuestion />}
|
||||
/>
|
||||
|
||||
<Route exact path="/candidate/:id" element={<Candidate />} />
|
||||
<Route exact path="/candidate/:id/form" element={<FormPage />} />
|
||||
<Route path="/:userId/calendar" element={<Calendar />} />
|
||||
|
||||
<Route path="/report/:id" element={<SingleReportPage />} />
|
||||
|
||||
<Route exact path="profile">
|
||||
<Route index element={<Profile />} />
|
||||
<Route exact path="catalog" element={<Home />} />
|
||||
<Route exact path="calendar" element={<ProfileCalendar />} />
|
||||
<Route exact path="calendar/report" element={<ReportForm />} />
|
||||
<Route
|
||||
exact
|
||||
path="calendar/view/:date/:id"
|
||||
element={<ViewReport />}
|
||||
/>
|
||||
<Route exact path="summary" element={<Summary />} />
|
||||
<Route exact path="tracker" element={<Tracker />} />
|
||||
<Route exact path="statistics/:id" element={<Statistics />} />
|
||||
<Route exact path="payouts" element={<Payouts />} />
|
||||
<Route exact path="settings" element={<PartnerSettings />} />
|
||||
<Route exact path="requests" element={<PartnerRequests />} />
|
||||
<Route exact path="requests-add" element={<PartnerAddRequest />} />
|
||||
<Route exact path="requests-edit" element={<PartnerAddRequest />} />
|
||||
<Route exact path="requests-bid" element={<PartnerBid />} />
|
||||
<Route exact path="employees" element={<PartnerCategories />} />
|
||||
<Route
|
||||
exact
|
||||
path="employees/report/:uuid"
|
||||
element={<PartnerEmployeeReport />}
|
||||
/>
|
||||
<Route exact path="treaties" element={<PartnerTreaties />} />
|
||||
<Route exact path="quiz">
|
||||
<Route index element={<QuizPage />} />
|
||||
<Route exact path="test/:uuid" element={<PassingTests />} />
|
||||
<Route exact path="report/:uuid" element={<QuizReportPage />} />
|
||||
</Route>
|
||||
|
||||
<Route
|
||||
exact
|
||||
path="categories/employees"
|
||||
element={<PartnerEmployees />}
|
||||
/>
|
||||
</Route>
|
||||
|
||||
<Route exact path="profile-candidate/:id">
|
||||
<Route index element={<ProfileCandidate />} />
|
||||
</Route>
|
||||
|
||||
<Route path="*" element={<Navigate to="/auth" replace />} />
|
||||
</Routes>
|
||||
</Router>
|
||||
{notification.show && <Notification />}
|
||||
|
@ -41,7 +41,7 @@ export const apiRequest = (
|
||||
if (response.data?.redirect || response.status === 401) {
|
||||
window.location.replace("/auth");
|
||||
localStorage.clear();
|
||||
store.dispatch(auth(false));
|
||||
// dispatch(auth(false));
|
||||
store.dispatch(setProfileInfo({}));
|
||||
}
|
||||
return resolve(response);
|
||||
|
@ -70,7 +70,6 @@ export const AuthBox = ({ title }) => {
|
||||
dispatch(setUserInfo(res));
|
||||
dispatch(loading(false));
|
||||
dispatch(setRole("ROLE_PARTNER"));
|
||||
navigate("/profile");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ export const AuthHeader = () => {
|
||||
<span>Главная</span>
|
||||
</NavLink>
|
||||
</li>
|
||||
{/*<li>*/}
|
||||
{/* <NavLink to={"/profile"}>Кабинет разработчика</NavLink>*/}
|
||||
{/*</li>*/}
|
||||
<li>
|
||||
<NavLink to={"/profile"}>Кабинет разработчика</NavLink>
|
||||
</li>
|
||||
<li>
|
||||
<NavLink to={"/tracker-intro"}>Трекер</NavLink>
|
||||
</li>
|
||||
|
@ -81,7 +81,7 @@ export const Navigation = () => {
|
||||
<NavLink
|
||||
key={index}
|
||||
end
|
||||
to={`/profile${link.path}`}
|
||||
to={link.path === "/quiz" ? link.path : `/profile${link.path}`}
|
||||
className={
|
||||
currentPath.includes(link.path) ||
|
||||
currentPath.includes(link.active)
|
||||
|
@ -91,10 +91,11 @@ export const ProfileHeader = () => {
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handler = (e) => {
|
||||
e.preventDefault();
|
||||
const handler = () => {
|
||||
setIsLoggingOut(true);
|
||||
localStorage.clear();
|
||||
dispatch(auth(false));
|
||||
setIsLoggingOut(false);
|
||||
navigate("/auth");
|
||||
dispatch(setProfileInfo({}));
|
||||
};
|
||||
|
@ -19,16 +19,16 @@ import cross from "assets/images/cross.png";
|
||||
import "./auth.scss";
|
||||
|
||||
export const Auth = () => {
|
||||
// const isAuth = useSelector(selectAuth);
|
||||
// let navigate = useNavigate();
|
||||
//
|
||||
// const getToken = localStorage.getItem("auth_token");
|
||||
const isAuth = useSelector(selectAuth);
|
||||
let navigate = useNavigate();
|
||||
|
||||
// useEffect(() => {
|
||||
// if (isAuth || getToken) {
|
||||
// navigate("/profile");
|
||||
// }
|
||||
// }, [getToken]);
|
||||
const getToken = localStorage.getItem("auth_token");
|
||||
|
||||
useEffect(() => {
|
||||
if (isAuth || getToken) {
|
||||
navigate("/profile");
|
||||
}
|
||||
}, [getToken]);
|
||||
|
||||
return (
|
||||
<section className="auth-partners">
|
||||
|
@ -1,33 +0,0 @@
|
||||
import React from "react";
|
||||
import { useMemo } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
import { selectAuth } from "@redux/outstaffingSlice";
|
||||
|
||||
import { DeveloperPage } from "@pages/roles/DeveloperPage";
|
||||
import { GuestPage } from "@pages/roles/GuestPage";
|
||||
import { PartnerPage } from "@pages/roles/PartnerPage";
|
||||
|
||||
export const MainPage = () => {
|
||||
const roleId = localStorage.getItem("role_status");
|
||||
const isAuth = useSelector(selectAuth);
|
||||
const user_roles = {
|
||||
developer: 4,
|
||||
partner: 18
|
||||
};
|
||||
|
||||
const CurrentRolePage = useMemo(() => getRolePage(Number(roleId)), [isAuth]);
|
||||
|
||||
function getRolePage(roleId) {
|
||||
switch (roleId) {
|
||||
case user_roles.developer:
|
||||
return DeveloperPage;
|
||||
case user_roles.partner:
|
||||
return PartnerPage;
|
||||
default:
|
||||
return GuestPage;
|
||||
}
|
||||
}
|
||||
|
||||
return <CurrentRolePage />;
|
||||
};
|
@ -64,14 +64,6 @@ export const PartnerCategories = () => {
|
||||
},
|
||||
{
|
||||
label: "Резюме",
|
||||
renderCell: (item) => (
|
||||
<Link className="table__link" to={`/candidate/${item.user_id}`}>
|
||||
Резюме
|
||||
</Link>
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "Отчет",
|
||||
renderCell: (item) => (
|
||||
<Link
|
||||
className="table__link"
|
||||
|
@ -1,51 +0,0 @@
|
||||
import React from "react";
|
||||
import { Navigate, Route, Routes } from "react-router-dom";
|
||||
|
||||
import { PartnerSettings } from "@pages/PartnerSettings/PartnerSettings";
|
||||
import { PartnerTreaties } from "@pages/PartnerTreaties/PartnerTreaties";
|
||||
import { Payouts } from "@pages/Payouts/Payouts";
|
||||
import { Profile } from "@pages/Profile/Profile";
|
||||
import { ProjectTracker } from "@pages/ProjectTracker/ProjectTracker";
|
||||
import { PassingTests } from "@pages/Quiz/PassingTests";
|
||||
import { QuizPage } from "@pages/Quiz/QuizPage";
|
||||
import { QuizReportPage } from "@pages/Quiz/QuizReportPage";
|
||||
import Statistics from "@pages/Statistics/Statistics";
|
||||
import { Summary } from "@pages/Summary/Summary";
|
||||
import { Tracker } from "@pages/Tracker/Tracker";
|
||||
import { ViewReport } from "@pages/ViewReport/ViewReport";
|
||||
|
||||
import { TicketFullScreen } from "@components/Modal/Tracker/TicketFullScreen/TicketFullScreen";
|
||||
import { ProfileCalendar } from "@components/ProfileCalendar/ProfileCalendar";
|
||||
import { ReportForm } from "@components/ReportForm/ReportForm";
|
||||
|
||||
export const DeveloperPage = () => {
|
||||
return (
|
||||
<Routes>
|
||||
<Route
|
||||
exact
|
||||
path="/tracker/task/:id"
|
||||
element={<TicketFullScreen />}
|
||||
></Route>
|
||||
<Route exact path="/tracker/project/:id" element={<ProjectTracker />} />
|
||||
|
||||
<Route exact path="profile">
|
||||
<Route index element={<Profile />} />
|
||||
<Route exact path="calendar" element={<ProfileCalendar />} />
|
||||
<Route exact path="calendar/report" element={<ReportForm />} />
|
||||
<Route exact path="calendar/view/:date/:id" element={<ViewReport />} />
|
||||
<Route exact path="summary" element={<Summary />} />
|
||||
<Route exact path="tracker" element={<Tracker />} />
|
||||
<Route exact path="statistics/:id" element={<Statistics />} />
|
||||
<Route exact path="payouts" element={<Payouts />} />
|
||||
<Route exact path="settings" element={<PartnerSettings />} />
|
||||
<Route exact path="treaties" element={<PartnerTreaties />} />
|
||||
<Route exact path="quiz">
|
||||
<Route index element={<QuizPage />} />
|
||||
<Route exact path="test/:uuid" element={<PassingTests />} />
|
||||
<Route exact path="report/:uuid" element={<QuizReportPage />} />
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path="*" element={<Navigate to="/profile" replace />} />
|
||||
</Routes>
|
||||
);
|
||||
};
|
@ -1,74 +0,0 @@
|
||||
import React from "react";
|
||||
import { Navigate, Route, Routes } from "react-router-dom";
|
||||
|
||||
import { Article } from "@pages/Article/Article";
|
||||
import { Auth } from "@pages/Auth/Auth";
|
||||
import { AuthForCandidate } from "@pages/AuthForCandidate/AuthForCandidate";
|
||||
import { Blog } from "@pages/Blog/Blog";
|
||||
import CatalogSpecialists from "@pages/CatalogSpecialists/CatalogSpecialists";
|
||||
import { CompanyInfo } from "@pages/CompanyInfo/CompanyInfo";
|
||||
import { Forms } from "@pages/Forms/Forms";
|
||||
import { FrequentlyAskedQuestion } from "@pages/FrequentlyAskedQuestion/FrequentlyAskedQuestion";
|
||||
import { FrequentlyAskedQuestions } from "@pages/FrequentlyAskedQuestions/FrequentlyAskedQuestions";
|
||||
import { ProfileCandidate } from "@pages/ProfileCandidate/ProfileCandidate";
|
||||
import { RegistrationForCandidate } from "@pages/RegistrationForCandidate/RegistrationForCandidate";
|
||||
import { RegistrationSetting } from "@pages/RegistrationSetting/RegistrationSetting";
|
||||
import { SingleReportPage } from "@pages/SingleReportPage/SingleReportPage";
|
||||
import { TrackerAuth } from "@pages/TrackerAuth/TrackerAuth";
|
||||
import { TrackerIntro } from "@pages/TrackerIntro/TrackerIntro";
|
||||
import { TrackerRegistration } from "@pages/TrackerRegistration/TrackerRegistration";
|
||||
|
||||
import { FreeDevelopers } from "@components/FreeDevelopers/FreeDevelopers";
|
||||
|
||||
export const GuestPage = () => {
|
||||
return (
|
||||
<Routes>
|
||||
<Route exact path="/auth" element={<Auth />} />
|
||||
<Route path="*" element={<Navigate to="/auth" replace />} />
|
||||
<Route exact path="/tracker-intro" element={<TrackerIntro />} />
|
||||
<Route exact path="/tracker-auth" element={<TrackerAuth />} />
|
||||
<Route exact path="/forms" element={<Forms />} />
|
||||
<Route
|
||||
exact
|
||||
path="/tracker-registration"
|
||||
element={<TrackerRegistration />}
|
||||
/>
|
||||
<Route exact path="/company" element={<CompanyInfo />} />
|
||||
<Route
|
||||
exact
|
||||
path="/registration-setting"
|
||||
element={<RegistrationSetting />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/catalog-specialists"
|
||||
element={<CatalogSpecialists />}
|
||||
/>
|
||||
<Route exact path="/worker/:id" element={<FreeDevelopers />} />
|
||||
<Route exact path="/auth-candidate" element={<AuthForCandidate />} />
|
||||
<Route
|
||||
exact
|
||||
path="/registration-candidate"
|
||||
element={<RegistrationForCandidate />}
|
||||
/>
|
||||
|
||||
<Route exact path="/blog" element={<Blog />}></Route>
|
||||
<Route exact path="/blog/article/:id" element={<Article />}></Route>
|
||||
<Route
|
||||
exact
|
||||
path="/frequently-asked-questions"
|
||||
element={<FrequentlyAskedQuestions />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/frequently-asked-question/:id"
|
||||
element={<FrequentlyAskedQuestion />}
|
||||
/>
|
||||
|
||||
<Route path="/report/:id" element={<SingleReportPage />} />
|
||||
<Route exact path="profile-candidate/:id">
|
||||
<Route index element={<ProfileCandidate />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
);
|
||||
};
|
@ -1,65 +0,0 @@
|
||||
import React from "react";
|
||||
import { Navigate, Route, Routes } from "react-router-dom";
|
||||
|
||||
import { FormPage } from "@pages/FormPage/FormPage";
|
||||
import { Home } from "@pages/Home/Home";
|
||||
import { PartnerAddRequest } from "@pages/PartnerAddRequest/PartnerAddRequest";
|
||||
import { PartnerBid } from "@pages/PartnerBid/PartnerBid";
|
||||
import { PartnerEmployeeReport } from "@pages/PartnerEmployeeReport/PartnerEmployeeReport";
|
||||
import { PartnerEmployees } from "@pages/PartnerEmployees/PartnerEmployees";
|
||||
import { PartnerRequests } from "@pages/PartnerRequests/PartnerRequests";
|
||||
import { PartnerSettings } from "@pages/PartnerSettings/PartnerSettings";
|
||||
import { PartnerTreaties } from "@pages/PartnerTreaties/PartnerTreaties";
|
||||
import { PartnerCategories } from "@pages/PartnerСategories/PartnerСategories";
|
||||
import { Profile } from "@pages/Profile/Profile";
|
||||
import { ProjectTracker } from "@pages/ProjectTracker/ProjectTracker";
|
||||
import Statistics from "@pages/Statistics/Statistics";
|
||||
import { Tracker } from "@pages/Tracker/Tracker";
|
||||
import { ViewReport } from "@pages/ViewReport/ViewReport";
|
||||
|
||||
import { Calendar } from "@components/Calendar/Calendar";
|
||||
import { Candidate } from "@components/Candidate/Candidate";
|
||||
import { TicketFullScreen } from "@components/Modal/Tracker/TicketFullScreen/TicketFullScreen";
|
||||
|
||||
export const PartnerPage = () => {
|
||||
return (
|
||||
<Routes>
|
||||
<Route exact path="/candidate/:id" element={<Candidate />} />
|
||||
<Route exact path="/candidate/:id/form" element={<FormPage />} />
|
||||
<Route path="/:userId/calendar" element={<Calendar />} />
|
||||
|
||||
<Route
|
||||
exact
|
||||
path="/tracker/task/:id"
|
||||
element={<TicketFullScreen />}
|
||||
></Route>
|
||||
<Route exact path="/tracker/project/:id" element={<ProjectTracker />} />
|
||||
|
||||
<Route exact path="profile">
|
||||
<Route index element={<Profile />} />
|
||||
<Route exact path="catalog" element={<Home />} />
|
||||
<Route exact path="calendar/view/:date/:id" element={<ViewReport />} />
|
||||
<Route exact path="tracker" element={<Tracker />} />
|
||||
<Route exact path="statistics/:id" element={<Statistics />} />
|
||||
<Route exact path="settings" element={<PartnerSettings />} />
|
||||
<Route exact path="requests" element={<PartnerRequests />} />
|
||||
<Route exact path="requests-add" element={<PartnerAddRequest />} />
|
||||
<Route exact path="requests-edit" element={<PartnerAddRequest />} />
|
||||
<Route exact path="requests-bid" element={<PartnerBid />} />
|
||||
<Route exact path="employees" element={<PartnerCategories />} />
|
||||
<Route
|
||||
exact
|
||||
path="employees/report/:uuid"
|
||||
element={<PartnerEmployeeReport />}
|
||||
/>
|
||||
<Route exact path="treaties" element={<PartnerTreaties />} />
|
||||
<Route
|
||||
exact
|
||||
path="categories/employees"
|
||||
element={<PartnerEmployees />}
|
||||
/>
|
||||
</Route>
|
||||
<Route path="*" element={<Navigate to="/profile" replace />} />
|
||||
</Routes>
|
||||
);
|
||||
};
|
@ -6,7 +6,7 @@ const initialState = {
|
||||
filteredCandidates: null,
|
||||
selectedItems: [],
|
||||
currentCandidate: {},
|
||||
auth: null,
|
||||
auth: false,
|
||||
positionId: null,
|
||||
profileInfo: {},
|
||||
reportsDates: "",
|
||||
|
Loading…
Reference in New Issue
Block a user