feat(fields): мягкое удаление полей формы — архив удалённых с восстановлением и блок «Удалённые поля» в задаче
This commit is contained in:
@@ -21,6 +21,8 @@ export class TasksStorage extends TasksCoreStorage {
|
||||
users: Array<SafeUser & { fullName: string }>;
|
||||
hasRelations: boolean;
|
||||
assignees: Array<TaskAssignee & { user: { id: number; firstName: string | null; lastName: string | null; email: string } }>;
|
||||
/** Удалённые (мягко) поля формы со значениями в fieldValues — блок «Удалённые поля» */
|
||||
deletedFields: FormField[];
|
||||
} | null> {
|
||||
const taskResult = await db
|
||||
.select()
|
||||
@@ -34,7 +36,7 @@ export class TasksStorage extends TasksCoreStorage {
|
||||
const task = result.tasks;
|
||||
const form = result.forms;
|
||||
|
||||
const [fields, statuses, tabs, transitions, fieldValues, subtasks, messages, orgUsers, orgRoles, relationsCheck, assignees] = await Promise.all([
|
||||
const [fields, statuses, tabs, transitions, fieldValues, subtasks, messages, orgUsers, orgRoles, relationsCheck, assignees, deletedFields] = await Promise.all([
|
||||
this.getFormFields(form.id, organizationId),
|
||||
this.getFormStatuses(form.id, organizationId),
|
||||
this.getFormTabs(form.id, organizationId),
|
||||
@@ -51,6 +53,7 @@ export class TasksStorage extends TasksCoreStorage {
|
||||
))
|
||||
.limit(1),
|
||||
this.getTaskAssignees(task.id, organizationId),
|
||||
this.getDeletedFormFields(form.id, organizationId),
|
||||
]);
|
||||
|
||||
const usersWithFullName = orgUsers.map((u: SafeUser) => ({
|
||||
@@ -235,6 +238,7 @@ export class TasksStorage extends TasksCoreStorage {
|
||||
users: usersWithFullName,
|
||||
hasRelations: relationsCheck.length > 0,
|
||||
assignees,
|
||||
deletedFields,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user