fix(frontend): keep candidate progress beside forms
This commit is contained in:
1 parent
e4be4a3956
commit
6dd5a0d54a
10 files changed
+81
-28
No files matched your search
@@ -133,6 +133,14 @@ test("shows the populated specialization catalog on desktop and mobile", async (
|
|||||||
).toHaveCount(1);
|
).toHaveCount(1);
|
||||||
await specialization.selectOption("backend");
|
await specialization.selectOption("backend");
|
||||||
await expect(page.getByText(/Проверка опубликована для уровней:/)).toBeVisible();
|
await expect(page.getByText(/Проверка опубликована для уровней:/)).toBeVisible();
|
||||||
|
const progress = page.getByRole("region", { name: "Профиль, анкета и тест", exact: true });
|
||||||
|
const answers = page.getByRole("region", { name: "Ответы кандидата", exact: true });
|
||||||
|
await expect(progress).toBeVisible();
|
||||||
|
await expect(answers).toBeVisible();
|
||||||
|
const desktopProgress = await progress.boundingBox();
|
||||||
|
const desktopAnswers = await answers.boundingBox();
|
||||||
|
if (!desktopProgress || !desktopAnswers) throw new Error("Candidate sections must be visible");
|
||||||
|
expect(desktopProgress.x + desktopProgress.width).toBeLessThanOrEqual(desktopAnswers.x);
|
||||||
await page.screenshot({
|
await page.screenshot({
|
||||||
path: testInfo.outputPath("questionnaire-catalog-desktop.png"),
|
path: testInfo.outputPath("questionnaire-catalog-desktop.png"),
|
||||||
fullPage: true,
|
fullPage: true,
|
||||||
@@ -140,6 +148,10 @@ test("shows the populated specialization catalog on desktop and mobile", async (
|
|||||||
|
|
||||||
await page.setViewportSize({ width: 390, height: 844 });
|
await page.setViewportSize({ width: 390, height: 844 });
|
||||||
await expect(specialization).toBeVisible();
|
await expect(specialization).toBeVisible();
|
||||||
|
const mobileProgress = await progress.boundingBox();
|
||||||
|
const mobileAnswers = await answers.boundingBox();
|
||||||
|
if (!mobileProgress || !mobileAnswers) throw new Error("Candidate sections must be visible");
|
||||||
|
expect(mobileProgress.y + mobileProgress.height).toBeLessThanOrEqual(mobileAnswers.y);
|
||||||
await page.screenshot({
|
await page.screenshot({
|
||||||
path: testInfo.outputPath("questionnaire-catalog-mobile.png"),
|
path: testInfo.outputPath("questionnaire-catalog-mobile.png"),
|
||||||
fullPage: true,
|
fullPage: true,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (width >= 64rem) {
|
@media (width >= 80rem) {
|
||||||
.layout {
|
.layout {
|
||||||
grid-template-columns: minmax(0, 1fr) 20rem;
|
grid-template-columns: minmax(0, 1fr) 20rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,10 @@ import {
|
|||||||
useAssessmentQuestionnaire,
|
useAssessmentQuestionnaire,
|
||||||
} from "../../../entities/assessment";
|
} from "../../../entities/assessment";
|
||||||
import { newIdempotencyKey } from "../../../features/answer-assessment";
|
import { newIdempotencyKey } from "../../../features/answer-assessment";
|
||||||
import { CandidateJourneyProgress } from "../../../widgets/candidate-next-step";
|
import {
|
||||||
|
CandidateJourneyLayout,
|
||||||
|
CandidateJourneyProgress,
|
||||||
|
} from "../../../widgets/candidate-next-step";
|
||||||
import {
|
import {
|
||||||
SignalNoticeDialog,
|
SignalNoticeDialog,
|
||||||
SignalNoticeSummary,
|
SignalNoticeSummary,
|
||||||
@@ -490,9 +493,14 @@ export function AssessmentPage() {
|
|||||||
lead="Выберите доступную проверку. Уровень из анкеты - это ваша самооценка; результат определяет только сервер после прохождения."
|
lead="Выберите доступную проверку. Уровень из анкеты - это ваша самооценка; результат определяет только сервер после прохождения."
|
||||||
width="wide"
|
width="wide"
|
||||||
>
|
>
|
||||||
<CandidateJourneyProgress />
|
<CandidateJourneyLayout progress={<CandidateJourneyProgress />}>
|
||||||
<div className={styles.layout}>
|
<div className={styles.layout}>
|
||||||
<Card as="section" tone="panel" labelledBy="assessment-full-title" className={styles.main}>
|
<Card
|
||||||
|
as="section"
|
||||||
|
tone="panel"
|
||||||
|
labelledBy="assessment-full-title"
|
||||||
|
className={styles.main}
|
||||||
|
>
|
||||||
<header className={styles["block-header"]}>
|
<header className={styles["block-header"]}>
|
||||||
<p className={styles.kicker}>Полная проверка</p>
|
<p className={styles.kicker}>Полная проверка</p>
|
||||||
<h2 id="assessment-full-title" className={styles["block-title"]}>
|
<h2 id="assessment-full-title" className={styles["block-title"]}>
|
||||||
@@ -596,7 +604,9 @@ export function AssessmentPage() {
|
|||||||
) : grade.status === "available" ? (
|
) : grade.status === "available" ? (
|
||||||
<Button
|
<Button
|
||||||
isBusy={createBusy}
|
isBusy={createBusy}
|
||||||
disabled={!taskLanguageReady || pendingCreate?.body.kind === "demo_express"}
|
disabled={
|
||||||
|
!taskLanguageReady || pendingCreate?.body.kind === "demo_express"
|
||||||
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (taskLanguageReady) handleStartReal();
|
if (taskLanguageReady) handleStartReal();
|
||||||
}}
|
}}
|
||||||
@@ -675,6 +685,7 @@ export function AssessmentPage() {
|
|||||||
</Card>
|
</Card>
|
||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
|
</CandidateJourneyLayout>
|
||||||
<SignalNoticeDialog {...signalNotice.dialog} />
|
<SignalNoticeDialog {...signalNotice.dialog} />
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
.summary {
|
|
||||||
display: grid;
|
|
||||||
gap: var(--space-5);
|
|
||||||
align-items: start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.summary > * {
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (width >= 64rem) {
|
|
||||||
.summary {
|
|
||||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
import { EditProfile } from "../../../features/edit-profile";
|
import { EditProfile } from "../../../features/edit-profile";
|
||||||
import { Page } from "../../../shared/ui";
|
import { Page } from "../../../shared/ui";
|
||||||
import { CandidateJourneyProgress } from "../../../widgets/candidate-next-step";
|
import {
|
||||||
|
CandidateJourneyLayout,
|
||||||
|
CandidateJourneyProgress,
|
||||||
|
} from "../../../widgets/candidate-next-step";
|
||||||
import { CandidateProfilePreview } from "../../../widgets/candidate-profile-preview";
|
import { CandidateProfilePreview } from "../../../widgets/candidate-profile-preview";
|
||||||
import styles from "./profile-page.module.css";
|
|
||||||
|
|
||||||
export function ProfilePage() {
|
export function ProfilePage() {
|
||||||
return (
|
return (
|
||||||
@@ -11,11 +13,10 @@ export function ProfilePage() {
|
|||||||
lead="Управляйте своими сведениями и проверяйте, какие данные подтверждены оценкой."
|
lead="Управляйте своими сведениями и проверяйте, какие данные подтверждены оценкой."
|
||||||
width="wide"
|
width="wide"
|
||||||
>
|
>
|
||||||
<div className={styles.summary}>
|
<CandidateJourneyLayout progress={<CandidateJourneyProgress />}>
|
||||||
<CandidateJourneyProgress />
|
|
||||||
<CandidateProfilePreview />
|
<CandidateProfilePreview />
|
||||||
</div>
|
|
||||||
<EditProfile />
|
<EditProfile />
|
||||||
|
</CandidateJourneyLayout>
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
import { FillQuestionnaire } from "../../../features/fill-questionnaire";
|
import { FillQuestionnaire } from "../../../features/fill-questionnaire";
|
||||||
import { Page } from "../../../shared/ui";
|
import { Page } from "../../../shared/ui";
|
||||||
import { CandidateJourneyProgress } from "../../../widgets/candidate-next-step";
|
import {
|
||||||
|
CandidateJourneyLayout,
|
||||||
|
CandidateJourneyProgress,
|
||||||
|
} from "../../../widgets/candidate-next-step";
|
||||||
|
|
||||||
export function QuestionnairePage() {
|
export function QuestionnairePage() {
|
||||||
return (
|
return (
|
||||||
@@ -9,8 +12,9 @@ export function QuestionnairePage() {
|
|||||||
lead="Укажите специализации и условия поиска. Самооценка не становится подтвержденной категорией."
|
lead="Укажите специализации и условия поиска. Самооценка не становится подтвержденной категорией."
|
||||||
width="wide"
|
width="wide"
|
||||||
>
|
>
|
||||||
<CandidateJourneyProgress />
|
<CandidateJourneyLayout progress={<CandidateJourneyProgress />}>
|
||||||
<FillQuestionnaire />
|
<FillQuestionnaire />
|
||||||
|
</CandidateJourneyLayout>
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
export { CandidateNextStep } from "./ui/candidate-next-step";
|
export { CandidateNextStep } from "./ui/candidate-next-step";
|
||||||
export { CandidateJourneyProgress } from "./ui/candidate-journey-progress";
|
export { CandidateJourneyProgress } from "./ui/candidate-journey-progress";
|
||||||
|
export { CandidateJourneyLayout } from "./ui/candidate-journey-layout";
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
.layout {
|
||||||
|
display: grid;
|
||||||
|
gap: var(--space-5);
|
||||||
|
align-items: start;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress,
|
||||||
|
.content {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
display: grid;
|
||||||
|
gap: var(--space-5);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (width >= 64rem) {
|
||||||
|
.layout {
|
||||||
|
grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import type { ReactNode } from "react";
|
||||||
|
import styles from "./candidate-journey-layout.module.css";
|
||||||
|
|
||||||
|
export function CandidateJourneyLayout({
|
||||||
|
progress,
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
progress: ReactNode;
|
||||||
|
children: ReactNode;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<div className={styles.layout}>
|
||||||
|
<aside className={styles.progress}>{progress}</aside>
|
||||||
|
<div className={styles.content}>{children}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -70,7 +70,7 @@ export function CandidateJourneyProgress() {
|
|||||||
: 2;
|
: 2;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card as="section" tone="panel" labelledBy="candidate-journey-progress-title">
|
<Card as="section" tone="raised" labelledBy="candidate-journey-progress-title">
|
||||||
<h2 id="candidate-journey-progress-title" className={styles.title}>
|
<h2 id="candidate-journey-progress-title" className={styles.title}>
|
||||||
Профиль, анкета и тест
|
Профиль, анкета и тест
|
||||||
</h2>
|
</h2>
|
||||||
|
|||||||
Reference in new issue
Block a user