Гант: порядок и цвета этапов из khbuild_stages (ord, color_fill, color_stroke), без константы в коде
All checks were successful
ci / test (push) Successful in 24s
ci / deploy (push) Successful in 1m30s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 09:11:26 +03:00
parent bfe6b4338b
commit 5cd07f709b
4 changed files with 33 additions and 34 deletions

View File

@@ -31,8 +31,8 @@ export interface ProcessRow {
export interface ResponsibleRow { id: string; role: string | null; person: string | null; comment: string | null }
/** Роль (производная от справочника ответственных): имена всех ответственных этой роли. */
export interface RoleRow { id: string; person: string | null; comment: string | null }
/** Этап процесса (справочник `<набор>_stages`): `id` - ключ, на который ссылается `stage` шага, `name` - название для показа. */
export interface StageRow { id: string; name: string; comment: string | null }
/** Этап процесса (справочник `<набор>_stages`): `id` - ключ, на который ссылается `stage` шага, `name` - название для показа; `ord`, `color_fill`, `color_stroke` - порядок и цвета группы на Ганте (необязательные колонки). */
export interface StageRow { id: string; name: string; comment: string | null; /** порядок групп на Ганте (меньше - выше) */ ord: number | null; /** цвета группы: светлый тон и цвет полосы/рамки */ fill: string | null; stroke: string | null }
export interface SystemRow { id: string; name: string | null; comment: string | null }
export interface DataRow { id: string; description: string | null; role: string | null; comment: string | null }
@@ -92,7 +92,7 @@ export function buildModel(set: ProcessSet, raw: RawStar): ProcessModel {
);
const byId = new Map(responsible.map((r) => [r.id, r]));
const stages: StageRow[] = (raw.stages ?? []).map((r) => ({ id: String(r.id), name: str(r.stage_name) ?? String(r.id), comment: str(r.comment) }));
const stages: StageRow[] = (raw.stages ?? []).map((r) => ({ id: String(r.id), name: str(r.stage_name) ?? String(r.id), comment: str(r.comment), ord: r.ord === null || r.ord === undefined ? null : Number(r.ord), fill: str(r.color_fill), stroke: str(r.color_stroke) }));
const stageName = new Map(stages.map((r) => [r.id, r.name]));
const rows = raw.process.map(mapRow).map((row0) => {