diff --git a/frontend/models/project.ts b/frontend/models/project.ts index 2b917b17..4c5e29d5 100644 --- a/frontend/models/project.ts +++ b/frontend/models/project.ts @@ -69,6 +69,16 @@ export class ProjectReadItem { ) } + get annotationPageLink(): string { + const mapping = { + DocumentClassification: 'text-classification', + SequenceLabeling : 'sequence-labeling', + Seq2seq : 'sequence-to-sequence' + } + const url = `/projects/${this.id}/${mapping[this.project_type]}` + return url + } + toObject(): Object { return { id: this.id, diff --git a/frontend/services/application/project.service.ts b/frontend/services/application/project.service.ts index 00324fb2..59839e33 100644 --- a/frontend/services/application/project.service.ts +++ b/frontend/services/application/project.service.ts @@ -71,6 +71,11 @@ export class ProjectApplicationService { return this.repository.bulkDelete(ids) } + public async getPageLink(id: string) { + const item = await this.repository.findById(id) + return item.annotationPageLink + } + private toWriteModel(item: ProjectWriteDTO): ProjectWriteItem { return new ProjectWriteItem( item.id,