mirror of https://github.com/doccano/doccano.git
Browse Source
Merge pull request #1115 from prabd/feature/bulk_delete_and_clear_annotations
Merge pull request #1115 from prabd/feature/bulk_delete_and_clear_annotations
Clear annotations and bulk delete functionality. (Fix #523 and #631)pull/1120/head
Hiroki Nakayama
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 180 additions and 19 deletions
Split View
Diff Options
-
11app/api/views.py
-
2frontend/components/containers/annotation/ApproveButton.vue
-
58frontend/components/containers/annotation/ClearAnnotationsButton.vue
-
20frontend/components/containers/annotation/EntityItemBox.vue
-
2frontend/components/containers/annotation/FilterButton.vue
-
2frontend/components/containers/annotation/GuidelineButton.vue
-
50frontend/components/containers/documents/DocumentBulkDeletionButton.vue
-
4frontend/components/organisms/utils/ConfirmForm.vue
-
1frontend/i18n/en/generic.js
-
2frontend/i18n/en/projects/dataset.js
-
5frontend/layouts/annotation.vue
-
2frontend/nuxt.config.js
-
6frontend/pages/projects/_id/dataset/index.vue
-
4frontend/services/annotation.service.js
-
4frontend/services/document.service.js
-
26frontend/store/documents.js
@ -0,0 +1,58 @@ |
|||
<template> |
|||
<v-tooltip bottom> |
|||
<template v-slot:activator="{ on }"> |
|||
<v-btn |
|||
class="text-capitalize ps-1 pe-1" |
|||
color="error" |
|||
min-width="36" |
|||
icon |
|||
v-on="on" |
|||
@click="dialog=true" |
|||
> |
|||
<v-icon> |
|||
mdi-delete-outline |
|||
</v-icon> |
|||
</v-btn> |
|||
</template> |
|||
<span>Clear Annotations</span> |
|||
<v-dialog |
|||
v-model="dialog" |
|||
width="800" |
|||
> |
|||
<confirm-form |
|||
title="Clear annotations" |
|||
message="Are you sure you want to delete all annotations?" |
|||
:button-true-text="$t('generic.yes')" |
|||
:button-false-text="$t('generic.cancel')" |
|||
@ok="handleClear();dialog=false" |
|||
@cancel="dialog=false" |
|||
/> |
|||
</v-dialog> |
|||
</v-tooltip> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapActions } from 'vuex' |
|||
import ConfirmForm from '@/components/organisms/utils/ConfirmForm' |
|||
|
|||
export default { |
|||
components: { |
|||
ConfirmForm |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
dialog: false |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
...mapActions('documents', ['clearAnnotations']), |
|||
|
|||
handleClear() { |
|||
const projectId = this.$route.params.id |
|||
this.clearAnnotations(projectId) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,50 @@ |
|||
<template> |
|||
<div> |
|||
<v-btn |
|||
:disabled="!total" |
|||
class="text-capitalize" |
|||
color="error" |
|||
@click="dialog=true" |
|||
> |
|||
{{ $t('generic.deleteAll') }} |
|||
</v-btn> |
|||
<v-dialog |
|||
v-model="dialog" |
|||
width="800" |
|||
> |
|||
<confirm-form |
|||
:title="$t('dataset.deleteBulkDocumentsTitle')" |
|||
:message="$t('dataset.deleteBulkDocumentsMessage')" |
|||
:button-true-text="$t('generic.yes')" |
|||
:button-false-text="$t('generic.cancel')" |
|||
@ok="deleteAllDocuments($route.params.id);dialog=false" |
|||
@cancel="dialog=false" |
|||
/> |
|||
</v-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapState, mapActions } from 'vuex' |
|||
import ConfirmForm from '@/components/organisms/utils/ConfirmForm' |
|||
|
|||
export default { |
|||
components: { |
|||
ConfirmForm |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
dialog: false |
|||
} |
|||
}, |
|||
|
|||
computed: { |
|||
...mapState('documents', ['total']) |
|||
}, |
|||
|
|||
methods: { |
|||
...mapActions('documents', ['deleteAllDocuments']) |
|||
} |
|||
} |
|||
</script> |
Write
Preview
Loading…
Cancel
Save