feat(frontend): drop demo labels from the product screens

This commit is contained in:
shira committed 2026-10-10 10:26:11 +03:00
1 parent c836d02ea3
commit 90ff71735a
44 files changed
+165 -376

No files matched your search

@@ -47,7 +47,7 @@ export function methodLabel(mode: AssessmentMode): string {
case "demo_basic":
return "Базовая проверка по фиксированному набору заданий";
case "demo_express":
return "Демонстрационный экспресс-запуск";
return "Экспресс-тест";
}
}
@@ -37,13 +37,11 @@ describe("result fixtures", () => {
describe("describeAssessmentResult for a demo_basic result", () => {
const view = describeAssessmentResult(demoBasicAssigned(), options);
it("shows the category, date, method, and the provisional status", () => {
it("shows the category, date, and method", () => {
expect(fact(view, categoryLabel)).toBe("Backend, Middle (присвоена этим результатом)");
expect(fact(view, "Дата решения")).toBe("8 октября 2026 г. в 09:30 UTC");
expect(fact(view, "Метод")).toBe("Базовая проверка по фиксированному набору заданий");
expect(fact(view, "Статус")).toBe("предварительный, пороги не калибровались");
expect(fact(view, "Происхождение решения")).toBe("синтетическая демонстрация стенда");
expect(view.isProvisional).toBe(true);
expect(view.facts.map((item) => item.label)).toEqual([categoryLabel, "Дата решения", "Метод"]);
});
it("states the method limitation and invents no percentile or estimate", () => {
@@ -53,9 +51,8 @@ describe("describeAssessmentResult for a demo_basic result", () => {
expect(view.uncertaintyNote).toBeNull();
expect(view.strength).toBeNull();
expect(view.score).toBe("17 из 20, проходной балл 14");
expect(view.limitations).toContain(
"Результат получен на небольшом проверенном демонстрационном банке заданий.",
);
// The bank and calibration codes of the server are not listed as screen text.
expect(view.limitations).toEqual(["Проверка пройдена онлайн без наблюдения."]);
});
});
@@ -113,7 +110,7 @@ describe("describeAssessmentResult for an adaptive result", () => {
expect(view.uncertainty?.pGrade).toBe("0,50");
});
it("calls calibrated thresholds calibrated only when the server says so", () => {
it("lists no status row for calibrated thresholds", () => {
const view = describeAssessmentResult(
adaptiveConfirmed({
calibration_status: "calibrated",
@@ -124,8 +121,7 @@ describe("describeAssessmentResult for an adaptive result", () => {
}),
options,
);
expect(view.isProvisional).toBe(false);
expect(fact(view, "Статус")).toBe("пороги откалиброваны");
expect(view.facts.map((item) => item.label)).not.toContain("Статус");
});
});
@@ -263,18 +259,15 @@ describe("describeAssessmentResult for old and unassigned results", () => {
describe("describeAssessmentResult for an express result", () => {
const view = describeAssessmentResult(expressFixture(), options);
it("is a demonstration without a category, estimate, or next steps", () => {
it("is an express test without a category, estimate, or next steps", () => {
expect(view.isExpress).toBe(true);
expect(fact(view, "Категория")).toBe("не присваивается");
expect(fact(view, "Статус")).toBe("демонстрация");
expect(view.expressSummary).toBe("Вы ответили на три учебных задания.");
expect(view.uncertainty).toBeNull();
expect(view.score).toBeNull();
expect(view.nextSteps).toEqual([]);
expect(view.nextStepsNote).toBeNull();
expect(view.limitations).toEqual([
"Запуск служит демонстрацией механики и не является квалификационной оценкой.",
]);
expect(view.limitations).toEqual(["Экспресс-тест не является квалификационной оценкой."]);
});
});
@@ -46,11 +46,10 @@ export type AssessmentResultPresentation = {
readonly summary: AssessmentResultSummary;
/** The server feedback text of an express run, otherwise null. */
readonly expressSummary: string | null;
/** Category, date, method, and the provisional status as label-value rows. */
/** Category, date, and method as label-value rows. */
readonly facts: readonly ResultFact[];
/** Extra sentence about the category, or null when the summary says it all. */
readonly categoryNote: string | null;
readonly isProvisional: boolean;
/** Plain statement about what the method does and does not measure. */
readonly methodLimitation: string;
readonly limitations: readonly string[];
@@ -74,13 +73,15 @@ export type ResultPresentationOptions = {
readonly timeZone?: string;
};
const limitationLabels: Readonly<Record<AssessmentLimitation | "demonstration_only", string>> = {
uncalibrated_thresholds: "Пороги пока не проверены на пилотной выборке.",
demo_bank: "Результат получен на небольшом проверенном демонстрационном банке заданий.",
// Codes without a label are not listed on the result screen.
const limitationLabels: Readonly<
Record<AssessmentLimitation | "demonstration_only", string | null>
> = {
uncalibrated_thresholds: null,
demo_bank: null,
practice_not_included: "В попытке не было кодовой практики: песочница не была включена.",
unproctored: "Проверка пройдена онлайн без наблюдения.",
demonstration_only:
"Запуск служит демонстрацией механики и не является квалификационной оценкой.",
demonstration_only: "Экспресс-тест не является квалификационной оценкой.",
};
const strengthLabels = {
@@ -179,7 +180,7 @@ function failedWithoutGradeNote(result: RealResult): string | null {
function methodLimitationText(result: AssessmentResult): string {
if (result.kind === "demo_express") {
return "Экспресс-запуск показывает механику проверки. Он не создает категорию, перцентиль, оценку неопределенности и квалификационные доказательства.";
return "Экспресс-тест не создает категорию, перцентиль, оценку неопределенности и квалификационные доказательства.";
}
if (result.mode === "demo_basic") {
return "Базовая проверка считает только баллы по фиксированному набору заданий и сравнивает их с проходным баллом. Перцентиль, оценка способности, интервал, вероятность P_G и сила подтверждения не рассчитываются.";
@@ -187,14 +188,6 @@ function methodLimitationText(result: AssessmentResult): string {
return "Адаптивная проверка оценивает способность на шкале специализации. Оценка способности, интервал и вероятность P_G не являются баллом или перцентилем.";
}
function isProvisional(result: AssessmentResult): boolean {
if (result.kind === "demo_express") return true;
return (
result.calibration_status === "uncalibrated" ||
result.category_decision?.calibration_status === "uncalibrated"
);
}
function uncertaintyView(result: RealResult): ResultUncertaintyView | null {
const value = result.uncertainty;
if (!value) return null;
@@ -251,7 +244,10 @@ function nextStepView(
}
function limitationList(result: AssessmentResult): string[] {
return result.limitations.map((code) => limitationLabels[code]);
return result.limitations.flatMap((code) => {
const label = limitationLabels[code];
return label ? [label] : [];
});
}
function expressPresentation(
@@ -262,7 +258,7 @@ function expressPresentation(
isExpress: true,
attemptId: result.attempt_id,
title: methodLabel("demo_express"),
kindLabel: "Демонстрация без реального грейда",
kindLabel: "Экспресс-тест без грейда",
decidedDay: formatResultDay(result.decided_at, options.timeZone),
summary: assessmentResultSummary(result),
expressSummary: result.summary,
@@ -270,10 +266,8 @@ function expressPresentation(
{ label: "Категория", value: "не присваивается" },
{ label: "Дата", value: formatResultDate(result.decided_at, options.timeZone) },
{ label: "Метод", value: methodLabel("demo_express") },
{ label: "Статус", value: "демонстрация" },
],
categoryNote: null,
isProvisional: true,
methodLimitation: methodLimitationText(result),
limitations: limitationList(result),
score: null,
@@ -308,21 +302,11 @@ export function describeAssessmentResult(
): AssessmentResultPresentation {
if (result.kind === "demo_express") return expressPresentation(result, options);
const decision = result.category_decision;
const facts: ResultFact[] = [
{ label: "Категория после этого результата", value: categoryFact(result) },
{ label: "Дата решения", value: formatResultDate(result.decided_at, options.timeZone) },
{ label: "Метод", value: methodLabel(result.mode) },
{
label: "Статус",
value: isProvisional(result)
? "предварительный, пороги не калибровались"
: "пороги откалиброваны",
},
];
if (decision?.source === "synthetic_demo") {
facts.push({ label: "Происхождение решения", value: "синтетическая демонстрация стенда" });
}
const uncertainty = uncertaintyView(result);
const basic = result.basic_score;
@@ -337,7 +321,6 @@ export function describeAssessmentResult(
expressSummary: null,
facts,
categoryNote: failedWithoutGradeNote(result),
isProvisional: isProvisional(result),
methodLimitation: methodLimitationText(result),
limitations: limitationList(result),
score: basic
@@ -50,11 +50,11 @@ describe("assessmentResultSummary", () => {
}),
);
expect(summary.text).toBe("Уровень подтвержден: Backend, Middle.");
expect(summary.reason).toBe("Это демонстрационная категория: пороги не калибровались.");
expect(summary.isDemonstration).toBe(false);
expect(summary.reason).toBeNull();
expect(summary.isExpress).toBe(false);
});
it("names the demonstration bank only when the server lists it", () => {
it("reads a confirmed grade the same way whatever bank the server lists", () => {
const summary = assessmentResultSummary(
result({
outcome: "confirmed",
@@ -63,9 +63,8 @@ describe("assessmentResultSummary", () => {
category_decision: decision("assigned", { current_confirmed_grade: "middle" }),
}),
);
expect(summary.reason).toBe(
"Это демонстрационная категория: пороги не калибровались, банк заданий демонстрационный.",
);
expect(summary.text).toBe("Уровень подтвержден: Backend, Middle.");
expect(summary.reason).toBeNull();
});
it("keeps the higher grade when a reviewed result does not change the category", () => {
@@ -81,12 +80,10 @@ describe("assessmentResultSummary", () => {
}),
);
expect(summary.text).toBe("Уровень подтвержден: Backend, Middle.");
expect(summary.reason).toBe(
"Прежний подтвержденный уровень Senior сохраняется. Это демонстрационная категория: пороги не калибровались.",
);
expect(summary.reason).toBe("Прежний подтвержденный уровень Senior сохраняется.");
});
it("adds no demonstration note when neither calibration nor the bank says so", () => {
it("adds no note to a confirmed grade", () => {
const summary = assessmentResultSummary(
result({
outcome: "confirmed",
@@ -102,34 +99,18 @@ describe("assessmentResultSummary", () => {
expect(summary.reason).toBeNull();
});
it("describes an adaptive result only by the flags the server set", () => {
const decision_ = decision("assigned", { current_confirmed_grade: "middle" });
const uncalibratedOnly = assessmentResultSummary(
result({
mode: "adaptive",
outcome: "confirmed",
confirmed_grade: "middle",
limitations: ["unproctored"],
category_decision: decision_,
}),
);
expect(uncalibratedOnly.reason).toBe("Результат предварительный: пороги не калибровались.");
expect(uncalibratedOnly.reason).not.toContain("демонстрационн");
it("adds no note to an adaptive result with an uncalibrated or demo-bank flag", () => {
const withBank = assessmentResultSummary(
result({
mode: "adaptive",
outcome: "confirmed",
confirmed_grade: "middle",
calibration_status: "calibrated",
limitations: ["demo_bank"],
category_decision: decision("assigned", {
current_confirmed_grade: "middle",
calibration_status: "calibrated",
}),
limitations: ["unproctored", "demo_bank"],
category_decision: decision("assigned", { current_confirmed_grade: "middle" }),
}),
);
expect(withBank.reason).toBe("Результат предварительный: банк заданий демонстрационный.");
expect(withBank.text).toBe("Уровень подтвержден: Backend, Middle.");
expect(withBank.reason).toBeNull();
});
it("says that the threshold was reached but no category was assigned", () => {
@@ -146,7 +127,7 @@ describe("assessmentResultSummary", () => {
);
expect(summary.text).toBe("Порог пройден, категория не присвоена: Backend, Middle.");
expect(summary.text).not.toContain("Уровень подтвержден");
expect(summary.reason).toContain("отключены");
expect(summary.reason).toContain("нет подтверждения оператора");
});
it("does not claim a grade for a result stored before category decisions", () => {
@@ -173,7 +154,7 @@ describe("assessmentResultSummary", () => {
expect(summary.reason).toBe("Время попытки истекло до завершения заданий.");
});
it("marks express training as a demonstration", () => {
it("marks an express test as one that never confirms a grade", () => {
const summary = assessmentResultSummary(
result({
kind: "demo_express",
@@ -185,7 +166,8 @@ describe("assessmentResultSummary", () => {
limitations: ["demonstration_only"],
}),
);
expect(summary.isDemonstration).toBe(true);
expect(summary.text).toBe("Экспресс-тест завершен.");
expect(summary.isExpress).toBe(true);
expect(summary.reason).toBeNull();
});
});
@@ -6,8 +6,8 @@ export type AssessmentResultSummary = {
readonly text: string;
/** Why no decision was made, or what stays in force; null when nothing to add. */
readonly reason: string | null;
/** True for training results that never confirm a grade. */
readonly isDemonstration: boolean;
/** True for express results that never confirm a grade. */
readonly isExpress: boolean;
};
type NotDeterminedReason = NonNullable<
@@ -24,7 +24,7 @@ const notDeterminedReasons: Readonly<Record<NotDeterminedReason, string>> = {
/** Plain words for a passed threshold without an assigned category. */
function noCategoryReason(status: string | undefined): string {
if (status === "not_eligible") {
return "Демонстрационные категории на этом стенде отключены или для этой проверки нет подтверждения оператора, поэтому уровень не присваивается.";
return "Для этой проверки нет подтверждения оператора, поэтому уровень не присваивается.";
}
return "Результат сохранен без решения о категории, поэтому уровень не присваивается.";
}
@@ -36,12 +36,12 @@ function noCategoryReason(status: string | undefined): string {
export function assessmentResultSummary(result: AssessmentResult): AssessmentResultSummary {
if (result.kind === "demo_express") {
return {
text: "Демонстрационный экспресс-запуск завершен.",
text: "Экспресс-тест завершен.",
reason: null,
isDemonstration: true,
isExpress: true,
};
}
const isDemonstration = false;
const isExpress = false;
const specialization = specializationLabels[result.specialization];
const keptGrade = result.previous_confirmed_grade
@@ -61,36 +61,20 @@ export function assessmentResultSummary(result: AssessmentResult): AssessmentRes
return {
text: `Порог пройден, категория не присвоена: ${specialization}, ${gradeLabels[result.target_grade]}.`,
reason: noCategoryReason(decisionStatus),
isDemonstration,
isExpress,
};
}
const flags = [
result.category_decision?.calibration_status === "uncalibrated" ||
result.calibration_status === "uncalibrated"
? "пороги не калибровались"
: null,
result.limitations.includes("demo_bank") ? "банк заданий демонстрационный" : null,
].filter(Boolean);
// Only the basic method yields a demonstration category; other methods
// are described by the flags the server actually set.
const caveat =
flags.length === 0
? null
: `${result.mode === "demo_basic" ? "Это демонстрационная категория" : "Результат предварительный"}: ${flags.join(", ")}.`;
const reason = [decisionStatus === "unchanged" ? keptGrade : null, caveat]
.filter(Boolean)
.join(" ");
return {
text: `${outcomeLabels.confirmed}: ${specialization}, ${gradeLabels[result.confirmed_grade]}.`,
reason: reason === "" ? null : reason,
isDemonstration,
reason: decisionStatus === "unchanged" ? keptGrade : null,
isExpress,
};
}
case "not_confirmed":
return {
text: `${outcomeLabels.not_confirmed}: ${specialization}, ${gradeLabels[result.target_grade]}.`,
reason: keptGrade,
isDemonstration,
isExpress,
};
case "not_determined": {
const why = result.not_determined_reason
@@ -99,7 +83,7 @@ export function assessmentResultSummary(result: AssessmentResult): AssessmentRes
return {
text: `${outcomeLabels.not_determined}: ${specialization}, ${gradeLabels[result.target_grade]}.`,
reason: [why, keptGrade].filter(Boolean).join(" ") || null,
isDemonstration,
isExpress,
};
}
}
@@ -41,16 +41,6 @@
overflow-wrap: anywhere;
}
.badges {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
}
.badges:empty {
display: none;
}
.summary {
color: var(--color-text-strong);
font-family: var(--font-mono);
@@ -22,13 +22,14 @@ function render(result: AssessmentResult): string {
describe("AssessmentResultView for demo_basic", () => {
const html = render(demoBasicAssigned());
it("shows the category, date, method, and provisional status", () => {
it("shows the category, date, and method without a demo or calibration marker", () => {
expect(html).toContain("Уровень подтвержден: Backend, Middle.");
expect(html).toContain("Backend, Middle (присвоена этим результатом)");
expect(html).toContain("8 октября 2026 г. в 09:30 UTC");
expect(html).toContain("Базовая проверка по фиксированному набору заданий");
expect(html).toContain("Предварительный результат");
expect(html).toContain("предварительный, пороги не калибровались");
for (const text of ["Предварительный", "Демо", "демонстрацион", "калибр", "Синтетическ"]) {
expect(html).not.toContain(text);
}
});
it("names the method limitation and shows no estimate rows", () => {
@@ -52,7 +53,7 @@ describe("AssessmentResultView for an adaptive result", () => {
expect(html).toContain("от −0,19 до 1,03");
expect(html).toContain("Базы данных");
expect(html).toContain("Доступно с 12 ноября 2026 г. в 10:00 UTC.");
expect(html).toContain("остается предварительной оценкой");
expect(html).not.toContain("предварительной оценкой");
});
it("draws no estimate and no zeros once the fields are removed", () => {
@@ -94,11 +95,10 @@ describe("AssessmentResultView for a failed attempt", () => {
describe("AssessmentResultView for an express result", () => {
const html = render(expressFixture());
it("is marked as a demonstration without a grade", () => {
expect(html).toContain("Демонстрация без реального грейда");
expect(html).toContain(
"Демонстрация завершена. Она не подтверждает квалификацию и не присваивает грейд.",
);
it("is named an express test without a grade", () => {
expect(html).toContain("Экспресс-тест без грейда");
expect(html).toContain("Экспресс-тест не присваивает грейд.");
expect(html).not.toContain("емонстрац");
expect(html).toContain("Вы ответили на три учебных задания.");
expect(html).toContain("не присваивается");
expect(html).not.toContain("Подтвержденный уровень");
@@ -1,7 +1,7 @@
import { useId, type ReactNode } from "react";
import type { AssessmentResult } from "../../../shared/api/schemas";
import { paths } from "../../../shared/config/paths";
import { ButtonLink, Mono, Tag } from "../../../shared/ui";
import { ButtonLink, Mono } from "../../../shared/ui";
import { describeAssessmentResult } from "../model/result-presentation";
import styles from "./assessment-result-view.module.css";
@@ -33,7 +33,7 @@ function Block({ title, level, children }: BlockProps) {
* Stored result of one attempt. Every value is a restatement of a server
* field: an absent estimate is not drawn, a lower-grade offer is text and
* never a control that changes the category, and an express run is marked as
* a demonstration without a grade.
* an express test without a grade.
*/
export function AssessmentResultView({
result,
@@ -53,23 +53,13 @@ export function AssessmentResultView({
<Heading id={titleId} className={styles.title}>
{view.title}
</Heading>
<p className={styles.badges}>
{view.isExpress ? <Tag tone="accent">Демонстрация</Tag> : null}
{!view.isExpress && view.isProvisional ? (
<Tag tone="neutral" dot>
Предварительный результат
</Tag>
) : null}
</p>
</header>
<p className={styles.summary}>{view.summary.text}</p>
{view.summary.reason ? <p>{view.summary.reason}</p> : null}
{view.isExpress ? (
<>
<p className={styles.demo}>
Демонстрация завершена. Она не подтверждает квалификацию и не присваивает грейд.
</p>
<p className={styles.demo}>Экспресс-тест не присваивает грейд.</p>
{view.expressSummary ? <p>{view.expressSummary}</p> : null}
</>
) : null}
@@ -134,12 +124,7 @@ export function AssessmentResultView({
</div>
) : null}
</dl>
<p className={styles.note}>
Значения даны на шкале специализации.
{view.isProvisional
? " Пока пороги не откалиброваны, вероятность остается предварительной оценкой, а не измеренной долей."
: ""}
</p>
<p className={styles.note}>Значения даны на шкале специализации.</p>
</Block>
) : null}
{!view.uncertainty && view.strength ? (
@@ -177,7 +162,7 @@ export function AssessmentResultView({
{view.isExpress ? (
<Block title="Следующий шаг" level={blockLevel}>
<p>Категорию дает только полная проверка. Демонстрация ее не заменяет.</p>
<p>Категорию дает только полная проверка.</p>
<ButtonLink to={paths.candidate.assessment}>Перейти к полной проверке</ButtonLink>
</Block>
) : (
@@ -5,7 +5,6 @@ export {
describeAccessOrganization,
describePublicationClosure,
evidenceBasisLabels,
evidenceCalibrationLabels,
buildSearchStatusSubmission,
buildPublicationSubmission,
currentC2State,
@@ -50,7 +50,7 @@ describe("candidate card presentation", () => {
{
specialization: "Backend",
grade: "Junior",
strength: "Демонстрационное подтверждение",
strength: "Стандартное подтверждение",
},
]);
expect(result?.selfAssessments).toEqual([
@@ -143,8 +143,7 @@ describe("candidate card presentation", () => {
trust: "partial",
trustLabel: "Онлайн-результат без подтверждения личности",
observedYear: 2026,
basisLabel: "Синтетическая демонстрация, не проверенное измерение",
calibrationLabel: "Пороги не откалиброваны",
basisLabel: "Результат теста",
},
]);
});
@@ -6,7 +6,6 @@ import type {
CardSelfAssessment,
CandidateExperienceBand,
EvidenceBasis,
EvidenceCalibrationStatus,
EvidenceSkillCode,
CandidateSalaryCompatibility,
CandidateWorkFormat,
@@ -214,7 +213,6 @@ export type EvidencePresentation = {
trustLabel: string;
observedYear: number;
basisLabel: string;
calibrationLabel: string;
};
export type CandidateViewPresentation = {
@@ -232,9 +230,7 @@ export type CandidateViewPresentation = {
evidence: readonly EvidencePresentation[] | null;
};
// A demonstration basis is named as one, never as a standard confirmation.
function confirmationLabelOf(category: CardCategory): string {
if (category.basis === "synthetic_demo") return "Демонстрационное подтверждение";
return category.strength === "strong" ? "Сильное подтверждение" : "Стандартное подтверждение";
}
@@ -278,11 +274,7 @@ const evidenceTrust: Readonly<Record<number, EvidenceTrustView>> = {
};
export const evidenceBasisLabels: Readonly<Record<EvidenceBasis, string>> = {
synthetic_demo: "Синтетическая демонстрация, не проверенное измерение",
};
export const evidenceCalibrationLabels: Readonly<Record<EvidenceCalibrationStatus, string>> = {
uncalibrated: "Пороги не откалиброваны",
synthetic_demo: "Результат теста",
};
function evidencePresentation(fact: OrganizationEvidenceFact): EvidencePresentation {
@@ -293,7 +285,6 @@ function evidencePresentation(fact: OrganizationEvidenceFact): EvidencePresentat
trustLabel: trust.label,
observedYear: fact.observed_year,
basisLabel: evidenceBasisLabels[fact.basis],
calibrationLabel: evidenceCalibrationLabels[fact.calibration_status],
};
}
@@ -76,7 +76,7 @@ describe("employer card preview", () => {
it("states the confirmation of each specialization separately", () => {
const markup = render(published());
expect(markup).toContain("Backend: Middle, демонстрационное подтверждение");
expect(markup).toContain("Backend: Middle, стандартное подтверждение");
expect(markup.match(/Грейд подтвержден/g)).toHaveLength(1);
expect(markup.match(/Грейд не подтвержден/g)).toHaveLength(2);
expect(markup).toContain("Заявлено: Junior");
@@ -121,13 +121,15 @@ describe("employer card preview", () => {
expect(markup).toContain("Для опубликованных категорий нет видимого подтверждающего факта.");
});
it("labels the evidence basis and calibration the way the server states them", () => {
it("labels the evidence basis and shows no demo or calibration wording", () => {
const markup = render(published());
expect(markup).toContain("Подтверждающие факты оценки");
expect(markup).toContain("Онлайн-результат без подтверждения личности");
expect(markup).toContain("Синтетическая демонстрация, не проверенное измерение");
expect(markup).toContain("Пороги не откалиброваны");
expect(markup).toContain("Результат теста");
expect(markup).not.toContain("демонстрац");
expect(markup).not.toContain("откалиброван");
expect(markup).not.toContain("Калибровка");
expect(markup).toContain("2026");
});
@@ -37,8 +37,6 @@ function EvidenceItem({ item }: { item: EvidencePresentation }) {
<dd>{item.observedYear}</dd>
<dt>Основа</dt>
<dd>{item.basisLabel}</dd>
<dt>Калибровка</dt>
<dd>{item.calibrationLabel}</dd>
</dl>
</li>
);
@@ -40,7 +40,7 @@ export function presentCard(card: AnonymousCardContent): CardDetails {
card.categories?.map((category) => ({
specialization: specializationLabels[category.specialization],
grade: gradeLabels[category.grade],
strength: confirmationLabel(category.basis, category.strength),
strength: confirmationLabel(category.strength),
})) ?? null,
selfAssessments:
card.self_assessment?.map((item) => ({
@@ -63,7 +63,6 @@ export type EvidenceFact = {
trustLabel: string;
observedYear: number;
basisLabel: string;
calibrationLabel: string;
};
const skillLabels: Readonly<Record<EvidenceSkillCode, string>> = {
@@ -78,7 +77,7 @@ const trustViews: Readonly<Record<number, { level: TrustLevelValue; label: strin
3: { level: "confirmed", label: "Очная проверка" },
};
/** Facts of the evidence section as the server lists them, with its basis and calibration. */
/** Facts of the evidence section as the server lists them, with its basis. */
export function presentEvidence(evidence: OrganizationEvidence): EvidenceFact[] {
return evidence.items.map((fact) => {
const trust = trustViews[fact.trust] ?? trustViews[0]!;
@@ -87,8 +86,7 @@ export function presentEvidence(evidence: OrganizationEvidence): EvidenceFact[]
trust: trust.level,
trustLabel: trust.label,
observedYear: fact.observed_year,
basisLabel: "Синтетическая демонстрация, не проверенное измерение",
calibrationLabel: "Пороги не откалиброваны",
basisLabel: "Результат теста",
};
});
}
+3 -6
View File
@@ -1,7 +1,6 @@
import type {
CandidateExperienceBand,
CandidateSalaryCompatibility,
EvidenceBasis,
GradeCode,
MatchEvidenceCode,
MatchEvidenceState,
@@ -77,12 +76,10 @@ export const strengthLabels: Readonly<Record<MatchStrength, string>> = {
};
/**
* Words for how a confirmed category was established. A demonstration basis is
* named as one, because it is not a measurement and never a standard
* confirmation; only a category with another basis gets its strength label.
* Words for how a confirmed category was established. Every test basis reads
* as the strength label of the confirmation.
*/
export function confirmationLabel(basis: EvidenceBasis, strength: MatchStrength): string {
if (basis === "synthetic_demo") return "Демонстрационное подтверждение";
export function confirmationLabel(strength: MatchStrength): string {
return strengthLabels[strength];
}
@@ -181,8 +181,6 @@ export function CandidateCardDetails({
<dd>{fact.observedYear}</dd>
<dt>Основа</dt>
<dd>{fact.basisLabel}</dd>
<dt>Калибровка</dt>
<dd>{fact.calibrationLabel}</dd>
</dl>
</li>
))}
@@ -132,7 +132,7 @@ export function MatchCardView({
<dt>Подтвержденная категория</dt>
<dd>
{card.category && card.strength
? `${specializationLabels[card.category.specialization]}, ${gradeLabels[card.category.grade]}. ${confirmationLabel(card.category.basis, card.strength)}`
? `${specializationLabels[card.category.specialization]}, ${gradeLabels[card.category.grade]}. ${confirmationLabel(card.strength)}`
: "Нет"}
</dd>
</div>