From 6c58ec20235cf08c91f667e10060757d489e9eb8 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Fri, 12 Mar 2021 10:52:26 +0900 Subject: [PATCH] Add field to hide approve button --- frontend/models/project.ts | 5 +++++ frontend/services/application/project.service.ts | 2 ++ 2 files changed, 7 insertions(+) diff --git a/frontend/models/project.ts b/frontend/models/project.ts index 51bc5419..06bbe79f 100644 --- a/frontend/models/project.ts +++ b/frontend/models/project.ts @@ -88,6 +88,11 @@ export class ProjectReadItem { return new FormatFactory(this.project_type).createUploadFormat() } + get permitApprove(): Boolean { + const role = this.current_users_role + return role && !role.is_annotator + } + toObject(): Object { return { id: this.id, diff --git a/frontend/services/application/project.service.ts b/frontend/services/application/project.service.ts index 8b550877..c083571c 100644 --- a/frontend/services/application/project.service.ts +++ b/frontend/services/application/project.service.ts @@ -28,6 +28,7 @@ export class ProjectDTO { pageLink: string downloadFormats: FormatDTO[] uploadFormats: FormatDTO[] + permitApprove: Boolean constructor(item: ProjectReadItem) { this.id = item.id @@ -42,6 +43,7 @@ export class ProjectDTO { this.pageLink = item.annotationPageLink this.downloadFormats = item.downloadFormats.map(f => new FormatDTO(f)) this.uploadFormats = item.uploadFormats.map(f => new FormatDTO(f)) + this.permitApprove = item.permitApprove } }