|
|
@ -25,22 +25,51 @@ export class ProjectReadItem { |
|
|
|
readonly name: string, |
|
|
|
readonly description: string, |
|
|
|
readonly guideline: string, |
|
|
|
readonly users: number[], |
|
|
|
readonly tags: Object[], |
|
|
|
readonly projectType: ProjectType, |
|
|
|
readonly createdAt: string, |
|
|
|
readonly updatedAt: string, |
|
|
|
readonly author: string, |
|
|
|
readonly randomOrder: boolean, |
|
|
|
readonly collaborativeAnnotation: boolean, |
|
|
|
readonly exclusiveCategories: boolean, |
|
|
|
readonly resourceType: string, |
|
|
|
readonly allowOverlapping: boolean, |
|
|
|
readonly graphemeMode: boolean, |
|
|
|
readonly useRelation: boolean, |
|
|
|
readonly isTextProject: boolean |
|
|
|
readonly tags: Object[], |
|
|
|
readonly users: number[] = [], |
|
|
|
readonly createdAt: string = '', |
|
|
|
readonly updatedAt: string = '', |
|
|
|
readonly author: string = '', |
|
|
|
readonly isTextProject: boolean = false |
|
|
|
) {} |
|
|
|
|
|
|
|
static create( |
|
|
|
id: number, |
|
|
|
name: string, |
|
|
|
description: string, |
|
|
|
guideline: string, |
|
|
|
projectType: ProjectType, |
|
|
|
randomOrder: boolean, |
|
|
|
collaborativeAnnotation: boolean, |
|
|
|
exclusiveCategories: boolean, |
|
|
|
allowOverlapping: boolean, |
|
|
|
graphemeMode: boolean, |
|
|
|
useRelation: boolean, |
|
|
|
tags: Object[] |
|
|
|
) { |
|
|
|
return new ProjectReadItem( |
|
|
|
id, |
|
|
|
name, |
|
|
|
description, |
|
|
|
guideline, |
|
|
|
projectType, |
|
|
|
randomOrder, |
|
|
|
collaborativeAnnotation, |
|
|
|
exclusiveCategories, |
|
|
|
allowOverlapping, |
|
|
|
graphemeMode, |
|
|
|
useRelation, |
|
|
|
tags |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
get canDefineLabel(): boolean { |
|
|
|
return this.canDefineCategory || this.canDefineSpan |
|
|
|
} |
|
|
@ -72,23 +101,6 @@ export class ProjectReadItem { |
|
|
|
} |
|
|
|
return [this.projectType] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
export class ProjectWriteItem { |
|
|
|
constructor( |
|
|
|
public id: number, |
|
|
|
public name: string, |
|
|
|
public description: string, |
|
|
|
public guideline: string, |
|
|
|
public projectType: ProjectType, |
|
|
|
public randomOrder: boolean, |
|
|
|
public collaborativeAnnotation: boolean, |
|
|
|
public exclusiveCategories: boolean, |
|
|
|
public allowOverlapping: boolean, |
|
|
|
public graphemeMode: boolean, |
|
|
|
public useRelation: boolean, |
|
|
|
public tags: string[] |
|
|
|
) {} |
|
|
|
|
|
|
|
get resourceType(): string { |
|
|
|
const mapping = { |
|
|
|