feat(demo): add the jury guide and demonstration markers to the demo stand build
This commit is contained in:
1 parent
d365a05c96
commit
41206abbcf
32 files changed
+1096
-141
No files matched your search
+128
-117
@@ -12,6 +12,7 @@ import { PrivacyPage } from "../../pages/privacy";
|
||||
import { SessionGate } from "../../entities/session";
|
||||
import { MatchesPage } from "../../pages/matches";
|
||||
import { InvitationComposePage } from "../../pages/invitation-compose";
|
||||
import { JuryGuidePage } from "../../pages/jury-guide";
|
||||
import { NotFoundPage } from "../../pages/not-found";
|
||||
import { NeedEditorPage } from "../../pages/need-editor";
|
||||
import { NeedListPage } from "../../pages/needs";
|
||||
@@ -27,7 +28,7 @@ import {
|
||||
SupportCasesPage,
|
||||
} from "../../pages/support-cases";
|
||||
import { WelcomePage } from "../../pages/welcome";
|
||||
import { paths } from "../../shared/config";
|
||||
import { paths, standMode, type StandMode } from "../../shared/config";
|
||||
import { CandidateShell } from "../../widgets/candidate-shell";
|
||||
import { EmployerShell } from "../../widgets/employer-shell";
|
||||
import { PublicShell } from "../../widgets/public-shell";
|
||||
@@ -38,120 +39,130 @@ import { SupportRoute } from "./support-route";
|
||||
|
||||
/**
|
||||
* Route tree with public pages and role-specific cabinets. Protected shells
|
||||
* restore the server session before they render any cabinet child.
|
||||
* restore the server session before they render any cabinet child. The jury
|
||||
* guide and the demonstration banner exist only in a demo build; elsewhere
|
||||
* the guide path answers with the not-found page.
|
||||
*/
|
||||
export const routes: RouteObject[] = [
|
||||
{
|
||||
element: <RootLayout />,
|
||||
errorElement: <RouteErrorPage />,
|
||||
children: [
|
||||
{
|
||||
element: <PublicShell />,
|
||||
children: [
|
||||
{ index: true, element: <WelcomePage /> },
|
||||
{ path: paths.login, element: <LoginPage /> },
|
||||
{ path: paths.register, element: <RegisterPage /> },
|
||||
{ path: paths.verifyEmail, element: <VerifyEmailPage /> },
|
||||
{ path: paths.support, element: <SupportRoute /> },
|
||||
{ path: paths.status, element: <StatusPage /> },
|
||||
{ path: "*", element: <NotFoundPage /> },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: paths.candidate.root,
|
||||
element: <CandidateShell />,
|
||||
children: [
|
||||
{
|
||||
element: <SessionGate scenario="candidate" />,
|
||||
children: [
|
||||
{ index: true, element: <CandidateHomeRoute /> },
|
||||
{ path: paths.candidate.onboarding, element: <CandidateOnboardingPage /> },
|
||||
{
|
||||
path: paths.candidate.profile,
|
||||
element: <ProfilePage />,
|
||||
},
|
||||
{
|
||||
path: paths.candidate.questionnaire,
|
||||
element: <QuestionnairePage />,
|
||||
},
|
||||
{
|
||||
path: paths.candidate.assessment,
|
||||
element: <AssessmentPage />,
|
||||
},
|
||||
{
|
||||
path: `${paths.candidate.assessment}/:attemptId`,
|
||||
element: <AssessmentAttemptPage />,
|
||||
},
|
||||
{ path: paths.candidate.results, element: <AssessmentResultsPage /> },
|
||||
{ path: `${paths.candidate.results}/:attemptId`, element: <AssessmentResultPage /> },
|
||||
{ path: paths.candidate.invitations, element: <CandidateInvitationsPage /> },
|
||||
{
|
||||
path: `${paths.candidate.invitations}/:invitationId`,
|
||||
element: <CandidateInvitationPage />,
|
||||
},
|
||||
{ path: paths.candidate.notifications, element: <CandidateNotificationsPage /> },
|
||||
{
|
||||
path: paths.candidate.privacy,
|
||||
element: <PrivacyPage />,
|
||||
},
|
||||
{ path: paths.candidate.supportCases, element: <SupportCasesPage /> },
|
||||
{ path: paths.candidate.supportNew, element: <CreateSupportCasePage /> },
|
||||
{ path: paths.candidate.supportManual, element: <ManualAssessmentPage /> },
|
||||
{
|
||||
path: `${paths.candidate.supportCases}/:caseId`,
|
||||
element: <SupportCaseDetailPage />,
|
||||
},
|
||||
{
|
||||
path: "*",
|
||||
element: (
|
||||
<NotFoundPage homePath={paths.candidate.root} homeLabel="В кабинет кандидата" />
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: paths.employer.root,
|
||||
element: <EmployerShell />,
|
||||
children: [
|
||||
{
|
||||
element: <SessionGate scenario="employer" />,
|
||||
children: [
|
||||
{ index: true, loader: () => redirect(paths.employer.company) },
|
||||
{
|
||||
path: paths.employer.company,
|
||||
element: <CompanyPage />,
|
||||
},
|
||||
{ path: paths.employer.needs, element: <NeedListPage /> },
|
||||
{ path: `${paths.employer.needs}/new`, element: <NeedEditorPage /> },
|
||||
{ path: `${paths.employer.needs}/:needId`, element: <NeedEditorPage /> },
|
||||
{ path: paths.employer.supportCases, element: <SupportCasesPage /> },
|
||||
{ path: paths.employer.supportNew, element: <CreateSupportCasePage /> },
|
||||
{
|
||||
path: `${paths.employer.supportCases}/:caseId`,
|
||||
element: <SupportCaseDetailPage />,
|
||||
},
|
||||
{ path: paths.employer.candidates, element: <MatchesPage /> },
|
||||
{
|
||||
path: paths.employer.invitations,
|
||||
element: <PlaceholderPage screen="employerInvitations" />,
|
||||
},
|
||||
{ path: paths.employer.invitationNew, element: <InvitationComposePage /> },
|
||||
{ path: paths.employer.notifications, element: <EmployerNotificationsPage /> },
|
||||
{
|
||||
path: "*",
|
||||
element: (
|
||||
<NotFoundPage
|
||||
homePath={paths.employer.company}
|
||||
homeLabel="В кабинет работодателя"
|
||||
/>
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
export function createRoutes(stand: StandMode = standMode): RouteObject[] {
|
||||
return [
|
||||
{
|
||||
element: <RootLayout demoStand={stand.demo} />,
|
||||
errorElement: <RouteErrorPage />,
|
||||
children: [
|
||||
{
|
||||
element: <PublicShell />,
|
||||
children: [
|
||||
{ index: true, element: <WelcomePage demoStand={stand.demo} /> },
|
||||
{ path: paths.login, element: <LoginPage /> },
|
||||
{ path: paths.register, element: <RegisterPage /> },
|
||||
{ path: paths.verifyEmail, element: <VerifyEmailPage /> },
|
||||
{ path: paths.support, element: <SupportRoute /> },
|
||||
{ path: paths.status, element: <StatusPage /> },
|
||||
...(stand.demo ? [{ path: paths.demoGuide, element: <JuryGuidePage /> }] : []),
|
||||
{ path: "*", element: <NotFoundPage /> },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: paths.candidate.root,
|
||||
element: <CandidateShell />,
|
||||
children: [
|
||||
{
|
||||
element: <SessionGate scenario="candidate" />,
|
||||
children: [
|
||||
{ index: true, element: <CandidateHomeRoute /> },
|
||||
{ path: paths.candidate.onboarding, element: <CandidateOnboardingPage /> },
|
||||
{
|
||||
path: paths.candidate.profile,
|
||||
element: <ProfilePage />,
|
||||
},
|
||||
{
|
||||
path: paths.candidate.questionnaire,
|
||||
element: <QuestionnairePage />,
|
||||
},
|
||||
{
|
||||
path: paths.candidate.assessment,
|
||||
element: <AssessmentPage />,
|
||||
},
|
||||
{
|
||||
path: `${paths.candidate.assessment}/:attemptId`,
|
||||
element: <AssessmentAttemptPage />,
|
||||
},
|
||||
{ path: paths.candidate.results, element: <AssessmentResultsPage /> },
|
||||
{
|
||||
path: `${paths.candidate.results}/:attemptId`,
|
||||
element: <AssessmentResultPage />,
|
||||
},
|
||||
{ path: paths.candidate.invitations, element: <CandidateInvitationsPage /> },
|
||||
{
|
||||
path: `${paths.candidate.invitations}/:invitationId`,
|
||||
element: <CandidateInvitationPage />,
|
||||
},
|
||||
{ path: paths.candidate.notifications, element: <CandidateNotificationsPage /> },
|
||||
{
|
||||
path: paths.candidate.privacy,
|
||||
element: <PrivacyPage />,
|
||||
},
|
||||
{ path: paths.candidate.supportCases, element: <SupportCasesPage /> },
|
||||
{ path: paths.candidate.supportNew, element: <CreateSupportCasePage /> },
|
||||
{ path: paths.candidate.supportManual, element: <ManualAssessmentPage /> },
|
||||
{
|
||||
path: `${paths.candidate.supportCases}/:caseId`,
|
||||
element: <SupportCaseDetailPage />,
|
||||
},
|
||||
{
|
||||
path: "*",
|
||||
element: (
|
||||
<NotFoundPage homePath={paths.candidate.root} homeLabel="В кабинет кандидата" />
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: paths.employer.root,
|
||||
element: <EmployerShell />,
|
||||
children: [
|
||||
{
|
||||
element: <SessionGate scenario="employer" />,
|
||||
children: [
|
||||
{ index: true, loader: () => redirect(paths.employer.company) },
|
||||
{
|
||||
path: paths.employer.company,
|
||||
element: <CompanyPage />,
|
||||
},
|
||||
{ path: paths.employer.needs, element: <NeedListPage /> },
|
||||
{ path: `${paths.employer.needs}/new`, element: <NeedEditorPage /> },
|
||||
{ path: `${paths.employer.needs}/:needId`, element: <NeedEditorPage /> },
|
||||
{ path: paths.employer.supportCases, element: <SupportCasesPage /> },
|
||||
{ path: paths.employer.supportNew, element: <CreateSupportCasePage /> },
|
||||
{
|
||||
path: `${paths.employer.supportCases}/:caseId`,
|
||||
element: <SupportCaseDetailPage />,
|
||||
},
|
||||
{ path: paths.employer.candidates, element: <MatchesPage /> },
|
||||
{
|
||||
path: paths.employer.invitations,
|
||||
element: <PlaceholderPage screen="employerInvitations" />,
|
||||
},
|
||||
{ path: paths.employer.invitationNew, element: <InvitationComposePage /> },
|
||||
{ path: paths.employer.notifications, element: <EmployerNotificationsPage /> },
|
||||
{
|
||||
path: "*",
|
||||
element: (
|
||||
<NotFoundPage
|
||||
homePath={paths.employer.company}
|
||||
homeLabel="В кабинет работодателя"
|
||||
/>
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
export const routes: RouteObject[] = createRoutes();
|
||||
Reference in new issue
Block a user