diff --git a/frontend/composables/useExampleItem.ts b/frontend/composables/useExampleItem.ts index f903f2f7..b814bfd3 100644 --- a/frontend/composables/useExampleItem.ts +++ b/frontend/composables/useExampleItem.ts @@ -29,17 +29,16 @@ export const useExampleItem = () => { state.example = await exampleService.findById(projectId, state.example.id) } - const approve = async( + const confirm = async( projectId: string, ) => { - const approved = !state.example.isApproved - await exampleService.approve(projectId, state.example.id, approved) + await exampleService.confirm(projectId, state.example.id) await getExampleById(projectId) } return { state, - approve, + confirm, getExample, } } diff --git a/frontend/domain/models/example/example.ts b/frontend/domain/models/example/example.ts index e7626d68..1084ce39 100644 --- a/frontend/domain/models/example/example.ts +++ b/frontend/domain/models/example/example.ts @@ -49,13 +49,22 @@ export class ExampleItem { public annotationApprover: boolean | null, public commentCount: number, public fileUrl: string, + public isConfirmed: boolean ) {} static valueOf( - { id, text, meta, annotation_approver, comment_count, filename }: - { id: number, text: string, meta: object, annotation_approver: boolean | null, comment_count: number, filename: string } + { id, text, meta, annotation_approver, comment_count, filename, is_confirmed }: + { + id: number, + text: string, + meta: object, + annotation_approver: boolean | null, + comment_count: number, + filename: string, + is_confirmed: boolean + } ): ExampleItem { - return new ExampleItem(id, text, meta, annotation_approver, comment_count, filename) + return new ExampleItem(id, text, meta, annotation_approver, comment_count, filename, is_confirmed) } get url() { diff --git a/frontend/domain/models/example/exampleRepository.ts b/frontend/domain/models/example/exampleRepository.ts index d775766d..37512d08 100644 --- a/frontend/domain/models/example/exampleRepository.ts +++ b/frontend/domain/models/example/exampleRepository.ts @@ -16,4 +16,6 @@ export interface ExampleRepository { findById(projectId: string, exampleId: number): Promise approve(projectId: string, docId: number, approved: boolean): Promise + + confirm(projectId: string, exampleId: number): Promise } diff --git a/frontend/pages/projects/_id/image-classification/index.vue b/frontend/pages/projects/_id/image-classification/index.vue index 400e5f43..a6e194b8 100644 --- a/frontend/pages/projects/_id/image-classification/index.vue +++ b/frontend/pages/projects/_id/image-classification/index.vue @@ -5,12 +5,12 @@ :doc-id="image.id" :enable-auto-labeling.sync="enableAutoLabeling" :guideline-text="project.guideline" - :is-reviewd="image.isApproved" + :is-reviewd="image.isConfirmed" :show-approve-button="project.permitApprove" :total="images.count" class="d-none d-sm-block" @click:clear-label="clear" - @click:review="approve" + @click:review="confirm" > { + const url = `/projects/${projectId}/examples/${exampleId}/states` + await this.request.post(url) + } } diff --git a/frontend/services/application/example/exampleApplicationService.ts b/frontend/services/application/example/exampleApplicationService.ts index 0f90bda0..d57f1296 100644 --- a/frontend/services/application/example/exampleApplicationService.ts +++ b/frontend/services/application/example/exampleApplicationService.ts @@ -62,6 +62,10 @@ export class ExampleApplicationService { await this.repository.approve(projectId, docId, approved) } + public async confirm(projectId: string, exampleId: number): Promise { + await this.repository.confirm(projectId, exampleId) + } + private toModel(item: ExampleDTO): ExampleItem { return new ExampleItem( item.id, @@ -69,7 +73,8 @@ export class ExampleApplicationService { item.meta, item.annotationApprover, item.commentCount, - item.fileUrl + item.fileUrl, + item.isConfirmed ) } } diff --git a/frontend/services/application/example/exampleData.ts b/frontend/services/application/example/exampleData.ts index c7291834..d368bd05 100644 --- a/frontend/services/application/example/exampleData.ts +++ b/frontend/services/application/example/exampleData.ts @@ -11,6 +11,7 @@ export class ExampleDTO { fileUrl: string; filename: string; url: string; + isConfirmed: boolean; constructor(item: ExampleItem) { this.id = item.id @@ -22,6 +23,7 @@ export class ExampleDTO { this.fileUrl = item.fileUrl this.filename = item.filename this.url = item.url + this.isConfirmed = item.isConfirmed } }