mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 04:25:03 +02:00
UBERF-6001: Roles management (#4994)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user