UBERF-6001: Roles management (#4994)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev
2024-03-27 13:49:36 +05:00
committed by GitHub
parent bee1986299
commit 418b4b1bbd
112 changed files with 3448 additions and 874 deletions
+6 -6
View File
@@ -168,7 +168,7 @@ export type TaskTypeWithFactory = Omit<Data<TaskType>, 'statuses' | 'parent' | '
factory: Data<Status>[]
} & Partial<Pick<TaskType, 'targetClass'>>
type ProjectData = Omit<Data<ProjectType>, 'statuses' | 'private' | 'members' | 'archived' | 'targetClass'>
type ProjectData = Omit<Data<ProjectType>, 'statuses' | 'targetClass'>
async function createStates (
client: TxOperations,
@@ -212,16 +212,14 @@ export async function createProjectType (
const targetProjectClassId: Ref<Class<Doc>> = generateId()
const tmpl = await client.createDoc(
task.class.ProjectType,
core.space.Space,
core.space.Model,
{
description: data.description,
shortDescription: data.shortDescription,
descriptor: data.descriptor,
roles: 0,
tasks: _tasks,
name: data.name,
private: false,
members: [],
archived: false,
statuses: calculateStatuses({ tasks: _tasks, statuses: [] }, tasksData, []),
targetClass: targetProjectClassId,
classic: data.classic
@@ -229,6 +227,7 @@ export async function createProjectType (
_id
)
// Mixin to hold custom fields of this project type
await client.createDoc(
core.class.Mixin,
core.space.Model,
@@ -241,6 +240,7 @@ export async function createProjectType (
targetProjectClassId
)
// TODO: not needed ???
await client.createMixin(targetProjectClassId, core.class.Mixin, core.space.Model, task.mixin.ProjectTypeClass, {
projectType: _id
})
@@ -344,7 +344,7 @@ async function createTaskTypes (
projectType: _id
})
}
await client.createDoc(task.class.TaskType, _id, tdata as Data<TaskType>, taskId)
await client.createDoc(task.class.TaskType, core.space.Model, tdata as Data<TaskType>, taskId)
tasksData.set(taskId, tdata as Data<TaskType>)
_tasks.push(taskId)
}