diff --git a/app/api/views.py b/app/api/views.py index 20dd1ce2..37a10c59 100644 --- a/app/api/views.py +++ b/app/api/views.py @@ -184,6 +184,12 @@ class DocumentList(generics.ListCreateAPIView): project = get_object_or_404(Project, pk=self.kwargs['project_id']) serializer.save(project=project) + def delete(self, request, *args, **kwargs): + project = get_object_or_404(Project, pk=self.kwargs['project_id']) + queryset = project.documents + queryset.all().delete() + return Response(status=status.HTTP_204_NO_CONTENT) + class DocumentDetail(generics.RetrieveUpdateDestroyAPIView): queryset = Document.objects.all() @@ -221,6 +227,11 @@ class AnnotationList(generics.ListCreateAPIView): def perform_create(self, serializer): serializer.save(document_id=self.kwargs['doc_id'], user=self.request.user) + def delete(self, request, *args, **kwargs): + queryset = self.get_queryset() + queryset.all().delete() + return Response(status=status.HTTP_204_NO_CONTENT) + @staticmethod def check_single_class_classification(project_id, doc_id, user): project = get_object_or_404(Project, pk=project_id) diff --git a/frontend/components/containers/annotation/ApproveButton.vue b/frontend/components/containers/annotation/ApproveButton.vue index de02ac7d..2c67616f 100644 --- a/frontend/components/containers/annotation/ApproveButton.vue +++ b/frontend/components/containers/annotation/ApproveButton.vue @@ -6,7 +6,7 @@ :disabled="disabled" class="text-capitalize ps-1 pe-1" min-width="36" - outlined + icon v-on="on" @shortkey="approveNextPage" @click="approveDocument" diff --git a/frontend/components/containers/annotation/ClearAnnotationsButton.vue b/frontend/components/containers/annotation/ClearAnnotationsButton.vue new file mode 100644 index 00000000..e8792a12 --- /dev/null +++ b/frontend/components/containers/annotation/ClearAnnotationsButton.vue @@ -0,0 +1,58 @@ + + + diff --git a/frontend/components/containers/annotation/EntityItemBox.vue b/frontend/components/containers/annotation/EntityItemBox.vue index bab9c557..71d99b4f 100644 --- a/frontend/components/containers/annotation/EntityItemBox.vue +++ b/frontend/components/containers/annotation/EntityItemBox.vue @@ -1,13 +1,15 @@ diff --git a/frontend/components/organisms/utils/ConfirmForm.vue b/frontend/components/organisms/utils/ConfirmForm.vue index f3f424fe..27ee2d50 100644 --- a/frontend/components/organisms/utils/ConfirmForm.vue +++ b/frontend/components/organisms/utils/ConfirmForm.vue @@ -41,12 +41,12 @@ export default { items: { type: Array, default: () => [], - required: true + required: false }, itemKey: { type: String, default: '', - required: true + required: false }, buttonTrueText: { type: String, diff --git a/frontend/i18n/en/generic.js b/frontend/i18n/en/generic.js index e3d0b0eb..309f098c 100644 --- a/frontend/i18n/en/generic.js +++ b/frontend/i18n/en/generic.js @@ -10,6 +10,7 @@ export default { upload: 'Upload', add: 'Add', delete: 'Delete', + deleteAll: 'Delete All', search: 'Search', name: 'Name', import: 'Import', diff --git a/frontend/i18n/en/projects/dataset.js b/frontend/i18n/en/projects/dataset.js index 276daf4e..2d7959df 100644 --- a/frontend/i18n/en/projects/dataset.js +++ b/frontend/i18n/en/projects/dataset.js @@ -16,5 +16,7 @@ export default { exportDataMessage2: 'Select a file name', deleteDocumentsTitle: 'Delete Document', deleteDocumentsMessage: 'Are you sure you want to delete these documents from this project?', + deleteBulkDocumentsTitle: 'Delete All Documents', + deleteBulkDocumentsMessage: 'Are you sure you want to delete all documents from this project?', pageText: '{0}-{1} of {2}' } diff --git a/frontend/layouts/annotation.vue b/frontend/layouts/annotation.vue index 0a2b86e8..a49f76d8 100644 --- a/frontend/layouts/annotation.vue +++ b/frontend/layouts/annotation.vue @@ -39,6 +39,7 @@ v-model="filterOption" /> + @@ -73,6 +74,7 @@