Browse Source
Merge pull request #2199 from doccano/enhancement/add-fields-to-project
Add fields to project model
pull/2200/head
Hiroki Nakayama
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
13 additions and
12 deletions
-
frontend/domain/models/project/project.ts
-
frontend/pages/projects/_id/dataset/index.vue
|
|
@ -138,4 +138,14 @@ export class Project { |
|
|
|
} |
|
|
|
return `${this.projectType}Project` |
|
|
|
} |
|
|
|
|
|
|
|
get isImageProject(): boolean { |
|
|
|
return [ImageClassification, ImageCaptioning, BoundingBox, Segmentation].includes( |
|
|
|
this.projectType |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
get isAudioProject(): boolean { |
|
|
|
return [Speech2text].includes(this.projectType) |
|
|
|
} |
|
|
|
} |
|
|
@ -35,7 +35,7 @@ |
|
|
|
</v-dialog> |
|
|
|
</v-card-title> |
|
|
|
<image-list |
|
|
|
v-if="isImageTask" |
|
|
|
v-if="project.isImageProject" |
|
|
|
v-model="selected" |
|
|
|
:items="item.items" |
|
|
|
:is-loading="isLoading" |
|
|
@ -44,7 +44,7 @@ |
|
|
|
@click:labeling="movePage" |
|
|
|
/> |
|
|
|
<audio-list |
|
|
|
v-else-if="isAudioTask" |
|
|
|
v-else-if="project.isAudioProject" |
|
|
|
v-model="selected" |
|
|
|
:items="item.items" |
|
|
|
:is-loading="isLoading" |
|
|
@ -122,17 +122,8 @@ export default Vue.extend({ |
|
|
|
return this.$route.params.id |
|
|
|
}, |
|
|
|
|
|
|
|
isImageTask(): boolean { |
|
|
|
const imageTasks = ['ImageClassification', 'ImageCaptioning', 'BoundingBox', 'Segmentation'] |
|
|
|
return imageTasks.includes(this.project.projectType) |
|
|
|
}, |
|
|
|
|
|
|
|
isAudioTask(): boolean { |
|
|
|
return this.project.projectType === 'Speech2text' |
|
|
|
}, |
|
|
|
|
|
|
|
itemKey(): string { |
|
|
|
if (this.isImageTask || this.isAudioTask) { |
|
|
|
if (this.project.isImageProject || this.project.isAudioProject) { |
|
|
|
return 'filename' |
|
|
|
} else { |
|
|
|
return 'text' |
|
|
|