различные доработки

This commit is contained in:
gorbenko.pavel
2026-08-14 12:36:42 +05:00
parent 2eb63b5077
commit 10f70609ad
11 changed files with 361 additions and 73 deletions
@@ -19,7 +19,7 @@ export function detectExecutorKind(step: {
export interface StepExecutorDisplay {
primary: string;
/** Email под ФИО — только когда исполнитель задан конкретным сотрудником и тот найден в справочнике. */
/** Должность и email под ФИО — когда исполнитель задан конкретным сотрудником и тот найден в справочнике. */
secondary?: string;
}
@@ -27,7 +27,10 @@ export interface StepExecutorDisplay {
export function describeStepExecutor(step: TemplateRouteStep, employees: Employee[]): StepExecutorDisplay {
if (step.executorEmail) {
const employee = findEmployeeByEmail(employees, step.executorEmail ?? undefined);
return employee ? { primary: employee.fio, secondary: employee.email } : { primary: step.executorEmail };
if (!employee) return { primary: step.executorEmail };
// Должность рядом с email: по одному ФИО не видно, тот ли это человек, что
// задумывался при настройке маршрута (в справочнике есть однофамильцы).
return { primary: employee.fio, secondary: [employee.position, employee.email].filter(Boolean).join(' · ') };
}
if (step.position) return { primary: step.position };
if (step.projectRole && step.projectRole !== ProjectRole.None) {