@konfuzio/document-validation-ui 0.1.10-dev.9 → 0.1.11-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/app.css +1 -1
- package/dist/index.html +1 -1
- package/dist/js/app.js +1 -1
- package/dist/js/app.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/scss/document_edit.scss +2 -0
- package/src/assets/scss/document_name.scss +0 -2
- package/src/assets/scss/document_top_bar.scss +22 -0
- package/src/assets/scss/new_annotation.scss +3 -0
- package/src/assets/scss/theme.scss +533 -523
- package/src/components/App.vue +23 -8
- package/src/components/DocumentAnnotations/AnnotationContent.vue +33 -18
- package/src/components/DocumentAnnotations/AnnotationRow.vue +21 -60
- package/src/components/DocumentAnnotations/ChooseLabelSetModal.vue +3 -2
- package/src/components/DocumentAnnotations/EmptyAnnotation.vue +1 -5
- package/src/components/DocumentAnnotations/MultiAnnotationTableOverlay.vue +1 -1
- package/src/components/DocumentDashboard.vue +8 -0
- package/src/components/DocumentEdit/DocumentEdit.vue +20 -11
- package/src/components/DocumentEdit/EditConfirmationModal.vue +1 -0
- package/src/components/DocumentEdit/EditPageThumbnail.vue +1 -3
- package/src/components/DocumentEdit/EditSidebar.vue +8 -3
- package/src/components/DocumentPage/DocumentPage.vue +0 -18
- package/src/components/DocumentPage/DocumentToolbar.vue +1 -0
- package/src/components/DocumentPage/MultiAnnSelection.vue +4 -26
- package/src/components/DocumentPage/NewAnnotation.vue +4 -22
- package/src/components/DocumentTopBar/DocumentName.vue +3 -1
- package/src/components/DocumentTopBar/DocumentTopBar.vue +81 -2
- package/src/components/DocumentsList/DocumentsList.vue +1 -6
- package/src/locales/de.json +3 -2
- package/src/locales/en.json +2 -1
- package/src/locales/es.json +2 -1
- package/src/store/category.js +19 -35
- package/src/store/display.js +7 -0
- package/src/store/document.js +29 -5
- package/src/store/edit.js +27 -15
- package/src/store/project.js +31 -1
- package/src/utils/utils.js +18 -1
- package/src/components/DocumentPage/MultiAnnotationTablePopup.vue +0 -226
package/src/components/App.vue
CHANGED
|
@@ -66,18 +66,24 @@ export default {
|
|
|
66
66
|
required: false,
|
|
67
67
|
default: "",
|
|
68
68
|
},
|
|
69
|
+
// eslint-disable-next-line vue/require-default-prop
|
|
69
70
|
locale: {
|
|
70
71
|
type: String,
|
|
71
72
|
required: false,
|
|
72
|
-
|
|
73
|
+
},
|
|
74
|
+
// eslint-disable-next-line vue/prop-name-casing
|
|
75
|
+
documents_list_path: {
|
|
76
|
+
type: String,
|
|
77
|
+
required: false,
|
|
78
|
+
default: "",
|
|
73
79
|
},
|
|
74
80
|
},
|
|
75
81
|
computed: {
|
|
76
82
|
documentId() {
|
|
77
83
|
if (getURLQueryParam("document")) {
|
|
78
84
|
return getURLQueryParam("document");
|
|
79
|
-
} else if (getURLPath("
|
|
80
|
-
return getURLPath("
|
|
85
|
+
} else if (getURLPath("d")) {
|
|
86
|
+
return getURLPath("d");
|
|
81
87
|
} else if (process.env.VUE_APP_DOCUMENT_ID) {
|
|
82
88
|
return process.env.VUE_APP_DOCUMENT_ID;
|
|
83
89
|
} else if (this.document) {
|
|
@@ -105,11 +111,7 @@ export default {
|
|
|
105
111
|
}
|
|
106
112
|
},
|
|
107
113
|
isPublicView() {
|
|
108
|
-
if (
|
|
109
|
-
process.env.VUE_APP_GUEST_USER_TOKEN ||
|
|
110
|
-
this.user_token ||
|
|
111
|
-
(this.full_mode && this.full_mode === "true")
|
|
112
|
-
) {
|
|
114
|
+
if (this.userToken || (this.full_mode && this.full_mode === "true")) {
|
|
113
115
|
return false;
|
|
114
116
|
} else {
|
|
115
117
|
return true;
|
|
@@ -118,6 +120,15 @@ export default {
|
|
|
118
120
|
showDocumentsList() {
|
|
119
121
|
return process.env.VUE_APP_SHOW_DOCUMENTS_LIST;
|
|
120
122
|
},
|
|
123
|
+
documentsListPath() {
|
|
124
|
+
if (process.env.VUE_APP_DOCUMENTS_LIST_PATH) {
|
|
125
|
+
return process.env.VUE_APP_DOCUMENTS_LIST_PATH;
|
|
126
|
+
} else if (this.documents_list_path && this.documents_list_path !== "") {
|
|
127
|
+
return this.documents_list_path;
|
|
128
|
+
} else {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
},
|
|
121
132
|
},
|
|
122
133
|
created() {
|
|
123
134
|
// Sentry config
|
|
@@ -160,6 +171,10 @@ export default {
|
|
|
160
171
|
this.$store.dispatch("project/setProjectId", this.projectId),
|
|
161
172
|
this.$store.dispatch("document/setDocId", this.documentId),
|
|
162
173
|
this.$store.dispatch("document/setPublicView", this.isPublicView),
|
|
174
|
+
this.$store.dispatch(
|
|
175
|
+
"project/setDocumentsListPath",
|
|
176
|
+
this.documentsListPath
|
|
177
|
+
),
|
|
163
178
|
]).finally(() => {
|
|
164
179
|
this.$store.dispatch("document/fetchDocument");
|
|
165
180
|
});
|
|
@@ -53,10 +53,6 @@ export default {
|
|
|
53
53
|
type: Object,
|
|
54
54
|
required: true,
|
|
55
55
|
},
|
|
56
|
-
saveChanges: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
required: false,
|
|
59
|
-
},
|
|
60
56
|
},
|
|
61
57
|
data() {
|
|
62
58
|
return {
|
|
@@ -70,7 +66,6 @@ export default {
|
|
|
70
66
|
"isDocumentReviewed",
|
|
71
67
|
]),
|
|
72
68
|
...mapGetters("display", ["bboxToRect"]),
|
|
73
|
-
...mapState("selection", ["spanSelection"]),
|
|
74
69
|
...mapState("document", [
|
|
75
70
|
"editAnnotation",
|
|
76
71
|
"publicView",
|
|
@@ -107,12 +102,6 @@ export default {
|
|
|
107
102
|
this.handleCancel(true);
|
|
108
103
|
}
|
|
109
104
|
},
|
|
110
|
-
|
|
111
|
-
saveChanges(newValue) {
|
|
112
|
-
if (newValue) {
|
|
113
|
-
this.saveAnnotationChanges();
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
105
|
},
|
|
117
106
|
methods: {
|
|
118
107
|
setText(text) {
|
|
@@ -205,14 +194,40 @@ export default {
|
|
|
205
194
|
index = this.spanIndex;
|
|
206
195
|
}
|
|
207
196
|
|
|
197
|
+
let spans = [];
|
|
198
|
+
|
|
199
|
+
// Validate if we are deleting an Annotation that it's not multi-lined
|
|
200
|
+
let isToDelete =
|
|
201
|
+
this.annotationText.length === 0 &&
|
|
202
|
+
(!isElementArray(this.annotation.span) ||
|
|
203
|
+
this.annotation.span.length === 1);
|
|
204
|
+
|
|
205
|
+
if (!isToDelete) {
|
|
206
|
+
const span = this.createSpan();
|
|
207
|
+
|
|
208
|
+
spans = [...annotation.span];
|
|
209
|
+
|
|
210
|
+
spans[index] = span;
|
|
211
|
+
|
|
212
|
+
if (this.annotationText.length === 0) {
|
|
213
|
+
spans.splice(index, 1);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
208
216
|
// API call handled in parent component - AnnotationRow
|
|
209
|
-
this.$emit(
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
this.annotationText
|
|
215
|
-
|
|
217
|
+
this.$emit("save-annotation-changes", spans, isToDelete);
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
createSpan() {
|
|
221
|
+
return {
|
|
222
|
+
offset_string: this.annotationText,
|
|
223
|
+
page_index: this.span.page_index,
|
|
224
|
+
x0: this.span.x0,
|
|
225
|
+
x1: this.span.x1,
|
|
226
|
+
y0: this.span.y0,
|
|
227
|
+
y1: this.span.y1,
|
|
228
|
+
start_offset: this.span.start_offset,
|
|
229
|
+
end_offset: this.span.end_offset,
|
|
230
|
+
};
|
|
216
231
|
},
|
|
217
232
|
},
|
|
218
233
|
};
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
@mouseleave="onAnnotationHoverLeave"
|
|
50
50
|
>
|
|
51
51
|
<AnnotationContent
|
|
52
|
+
:ref="`span_${annotation.id}_${index}`"
|
|
52
53
|
:annotation="annotation"
|
|
53
54
|
:span="span"
|
|
54
55
|
:span-index="index"
|
|
55
56
|
:label="label"
|
|
56
57
|
:annotation-set="annotationSet"
|
|
57
58
|
:is-hovered="hoveredAnnotation"
|
|
58
|
-
|
|
59
|
-
@save-annotation-changes="handleSaveAnnotationChanges"
|
|
59
|
+
@save-annotation-changes="saveAnnotationChanges"
|
|
60
60
|
/>
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
@@ -70,7 +70,6 @@
|
|
|
70
70
|
:label="label"
|
|
71
71
|
:annotation-set="annotationSet"
|
|
72
72
|
:is-hovered="hoveredAnnotation"
|
|
73
|
-
:save-changes="saveChanges"
|
|
74
73
|
:is-missing-annotation="
|
|
75
74
|
annotationIsNotFound(annotationSet, label)
|
|
76
75
|
"
|
|
@@ -82,7 +81,6 @@
|
|
|
82
81
|
:label="label"
|
|
83
82
|
:annotation-set="annotationSet"
|
|
84
83
|
:is-hovered="hoveredAnnotation"
|
|
85
|
-
:save-changes="saveChanges"
|
|
86
84
|
:is-missing-annotation="annotationIsNotFound(annotationSet, label)"
|
|
87
85
|
@save-empty-annotation-changes="saveEmptyAnnotationChanges"
|
|
88
86
|
/>
|
|
@@ -156,8 +154,6 @@ export default {
|
|
|
156
154
|
isSelected: false,
|
|
157
155
|
annotationAnimationTimeout: null,
|
|
158
156
|
hoveredAnnotation: null,
|
|
159
|
-
saveChanges: false,
|
|
160
|
-
toDecline: false,
|
|
161
157
|
};
|
|
162
158
|
},
|
|
163
159
|
computed: {
|
|
@@ -261,7 +257,6 @@ export default {
|
|
|
261
257
|
},
|
|
262
258
|
editAnnotation(newValue) {
|
|
263
259
|
if (!newValue) {
|
|
264
|
-
this.saveChanges = false;
|
|
265
260
|
this.isLoading = false;
|
|
266
261
|
}
|
|
267
262
|
},
|
|
@@ -451,20 +446,24 @@ export default {
|
|
|
451
446
|
if (this.publicView || this.isDocumentReviewed) return;
|
|
452
447
|
|
|
453
448
|
if (
|
|
454
|
-
this.
|
|
455
|
-
this.
|
|
456
|
-
|
|
457
|
-
this.
|
|
458
|
-
|
|
459
|
-
|
|
449
|
+
this.annotation &&
|
|
450
|
+
(this.showAcceptButton() ||
|
|
451
|
+
this.showDeclineButton() ||
|
|
452
|
+
this.isAnnotationInEditMode(
|
|
453
|
+
this.annotationId(),
|
|
454
|
+
this.editAnnotation.index
|
|
455
|
+
))
|
|
460
456
|
) {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
457
|
+
// retrieve all edited spans from every AnnotationContent component
|
|
458
|
+
let spans = [];
|
|
459
|
+
Object.keys(this.$refs).forEach((ref) => {
|
|
460
|
+
if (ref.includes(`span_${this.annotation.id}`)) {
|
|
461
|
+
// call child component createSpan method
|
|
462
|
+
spans.push(this.$refs[ref][0].createSpan());
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
this.saveAnnotationChanges(spans, decline);
|
|
466
|
+
} else if (
|
|
468
467
|
!this.annotation &&
|
|
469
468
|
this.isAnnotationInEditMode(this.annotationId())
|
|
470
469
|
) {
|
|
@@ -495,12 +494,7 @@ export default {
|
|
|
495
494
|
this.closedTag = null;
|
|
496
495
|
});
|
|
497
496
|
},
|
|
498
|
-
|
|
499
|
-
annotation,
|
|
500
|
-
index,
|
|
501
|
-
annotationSpan,
|
|
502
|
-
annotationContent
|
|
503
|
-
) {
|
|
497
|
+
saveAnnotationChanges(spans, isToDeleteOrDecline) {
|
|
504
498
|
// This function deals with declining Annotations
|
|
505
499
|
// or editing an Annotation or a part of it (if multi line)
|
|
506
500
|
this.isLoading = true;
|
|
@@ -508,29 +502,14 @@ export default {
|
|
|
508
502
|
let updatedString; // what will be sent to the API
|
|
509
503
|
let storeAction; // if it will be 'delete' or 'patch'
|
|
510
504
|
|
|
511
|
-
// Validate if we are deleting an Annotation that it's not multi-lined
|
|
512
|
-
let isToDelete =
|
|
513
|
-
annotationContent.length === 0 &&
|
|
514
|
-
(!isElementArray(annotation.span) || annotation.span.length === 1);
|
|
515
|
-
|
|
516
505
|
// Verify if we delete the entire Annotation or a part of the text
|
|
517
|
-
if (
|
|
506
|
+
if (isToDeleteOrDecline) {
|
|
518
507
|
storeAction = "document/deleteAnnotation";
|
|
519
508
|
} else {
|
|
520
509
|
// Editing the Annotation
|
|
521
510
|
// Deleting part of multi-line Annotation
|
|
522
511
|
storeAction = "document/updateAnnotation";
|
|
523
512
|
|
|
524
|
-
let spans = [...annotation.span];
|
|
525
|
-
|
|
526
|
-
const span = this.createSpan(annotationSpan, annotationContent);
|
|
527
|
-
|
|
528
|
-
spans[index] = span;
|
|
529
|
-
|
|
530
|
-
if (annotationContent.length === 0) {
|
|
531
|
-
spans.splice(index, 1);
|
|
532
|
-
}
|
|
533
|
-
|
|
534
513
|
updatedString = {
|
|
535
514
|
is_correct: true,
|
|
536
515
|
revised: true,
|
|
@@ -555,21 +534,8 @@ export default {
|
|
|
555
534
|
this.$store.dispatch("document/resetEditAnnotation");
|
|
556
535
|
this.$store.dispatch("selection/disableSelection");
|
|
557
536
|
this.$store.dispatch("selection/setSelectedEntities", null);
|
|
558
|
-
this.toDecline = false;
|
|
559
537
|
});
|
|
560
538
|
},
|
|
561
|
-
createSpan(span, annotationContent) {
|
|
562
|
-
return {
|
|
563
|
-
offset_string: annotationContent,
|
|
564
|
-
page_index: span.page_index,
|
|
565
|
-
x0: span.x0,
|
|
566
|
-
x1: span.x1,
|
|
567
|
-
y0: span.y0,
|
|
568
|
-
y1: span.y1,
|
|
569
|
-
start_offset: span.start_offset,
|
|
570
|
-
end_offset: span.end_offset,
|
|
571
|
-
};
|
|
572
|
-
},
|
|
573
539
|
saveEmptyAnnotationChanges() {
|
|
574
540
|
let annotationToCreate;
|
|
575
541
|
|
|
@@ -624,12 +590,10 @@ export default {
|
|
|
624
590
|
|
|
625
591
|
if (found) {
|
|
626
592
|
this.isLoading = true;
|
|
627
|
-
this.saveChanges = false;
|
|
628
593
|
return;
|
|
629
594
|
}
|
|
630
595
|
|
|
631
596
|
this.isLoading = false;
|
|
632
|
-
this.saveChanges = false;
|
|
633
597
|
return;
|
|
634
598
|
}
|
|
635
599
|
|
|
@@ -637,7 +601,6 @@ export default {
|
|
|
637
601
|
// while waiting for it to be removed from the row
|
|
638
602
|
if (!this.annotationsMarkedAsMissing) {
|
|
639
603
|
this.isLoading = false;
|
|
640
|
-
this.saveChanges = false;
|
|
641
604
|
return;
|
|
642
605
|
}
|
|
643
606
|
|
|
@@ -652,7 +615,6 @@ export default {
|
|
|
652
615
|
// Check if we wanna add loading to all empty annotations
|
|
653
616
|
if (this.hoveredAnnotationSet) {
|
|
654
617
|
this.isLoading = true;
|
|
655
|
-
this.saveChanges = false;
|
|
656
618
|
return;
|
|
657
619
|
}
|
|
658
620
|
|
|
@@ -662,7 +624,6 @@ export default {
|
|
|
662
624
|
annotation.label === this.label.id
|
|
663
625
|
) {
|
|
664
626
|
this.isLoading = true;
|
|
665
|
-
this.saveChanges = false;
|
|
666
627
|
return;
|
|
667
628
|
}
|
|
668
629
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
ref="modal"
|
|
5
5
|
v-model="show"
|
|
6
6
|
:can-cancel="['x', 'outside']"
|
|
7
|
-
class="modal-absolute modal-400 modal-no-footer"
|
|
7
|
+
class="modal-absolute modal-400 modal-no-footer model-overflow-visible"
|
|
8
8
|
:on-cancel="close"
|
|
9
9
|
>
|
|
10
10
|
<section class="modal-card-body">
|
|
@@ -149,7 +149,7 @@ export default {
|
|
|
149
149
|
}
|
|
150
150
|
);
|
|
151
151
|
|
|
152
|
-
this.$emit("
|
|
152
|
+
this.$emit("finish", this.selectedLabelSet);
|
|
153
153
|
this.close();
|
|
154
154
|
},
|
|
155
155
|
setSelectedLabelSet(labelSet) {
|
|
@@ -157,6 +157,7 @@ export default {
|
|
|
157
157
|
this.selectedLabelSet = labelSet;
|
|
158
158
|
},
|
|
159
159
|
close() {
|
|
160
|
+
this.$store.dispatch("display/showChooseLabelSetModal", null);
|
|
160
161
|
this.$emit("close");
|
|
161
162
|
},
|
|
162
163
|
createLabelsList(labels) {
|
|
@@ -67,10 +67,6 @@ export default {
|
|
|
67
67
|
required: false,
|
|
68
68
|
default: 0,
|
|
69
69
|
},
|
|
70
|
-
saveChanges: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
required: false,
|
|
73
|
-
},
|
|
74
70
|
isMissingAnnotation: {
|
|
75
71
|
type: Boolean,
|
|
76
72
|
required: true,
|
|
@@ -111,7 +107,7 @@ export default {
|
|
|
111
107
|
spanSelection(newValue) {
|
|
112
108
|
if (!newValue) return;
|
|
113
109
|
|
|
114
|
-
//
|
|
110
|
+
// Check if the bbox has no string
|
|
115
111
|
if (newValue[0] && !newValue[0].offset_string) {
|
|
116
112
|
this.$store.dispatch("document/resetEditAnnotation");
|
|
117
113
|
this.$store.dispatch("selection/disableSelection");
|
|
@@ -100,7 +100,7 @@ import AnnotationRow from "../DocumentAnnotations/AnnotationRow";
|
|
|
100
100
|
import DraggableIcon from "../../assets/images/DraggableIcon";
|
|
101
101
|
|
|
102
102
|
export default {
|
|
103
|
-
name: "
|
|
103
|
+
name: "MultiAnnotationTableOverlay",
|
|
104
104
|
components: {
|
|
105
105
|
AnnotationRow,
|
|
106
106
|
DraggableIcon,
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
:left="documentContainerLeftPadding"
|
|
13
13
|
:width="documentContainerWidth"
|
|
14
14
|
/>
|
|
15
|
+
<ChooseLabelSetModal
|
|
16
|
+
v-if="showChooseLabelSetModal && showChooseLabelSetModal.show"
|
|
17
|
+
:is-multiple-annotations="showChooseLabelSetModal.isMultipleAnnotations"
|
|
18
|
+
@finish="showChooseLabelSetModal.finish"
|
|
19
|
+
/>
|
|
15
20
|
|
|
16
21
|
<transition name="slide-fade">
|
|
17
22
|
<div
|
|
@@ -50,6 +55,7 @@ import { DocumentEdit } from "./DocumentEdit";
|
|
|
50
55
|
import ErrorMessage from "./ErrorMessage";
|
|
51
56
|
import NotOptimizedViewportModal from "../components/DocumentModals/NotOptimizedViewportModal";
|
|
52
57
|
import DocumentErrorModal from "../components/DocumentModals/DocumentErrorModal";
|
|
58
|
+
import ChooseLabelSetModal from "../components/DocumentAnnotations/ChooseLabelSetModal";
|
|
53
59
|
|
|
54
60
|
/**
|
|
55
61
|
* This component shows the PDF pages in a scrolling component and
|
|
@@ -67,6 +73,7 @@ export default {
|
|
|
67
73
|
NotOptimizedViewportModal,
|
|
68
74
|
DocumentErrorModal,
|
|
69
75
|
MultiAnnotationTableOverlay,
|
|
76
|
+
ChooseLabelSetModal,
|
|
70
77
|
},
|
|
71
78
|
data() {
|
|
72
79
|
return {
|
|
@@ -84,6 +91,7 @@ export default {
|
|
|
84
91
|
"pageWidthScale",
|
|
85
92
|
"currentPage",
|
|
86
93
|
"showAnnSetTable",
|
|
94
|
+
"showChooseLabelSetModal",
|
|
87
95
|
]),
|
|
88
96
|
...mapState("document", [
|
|
89
97
|
"showActionError",
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
<div v-if="!renameAndCategorize" class="sidebar">
|
|
28
28
|
<EditSidebar
|
|
29
29
|
:split-suggestions-enabled="splitSuggestionsEnabled"
|
|
30
|
-
@rotate
|
|
31
|
-
@rotate-right="rotatePage"
|
|
30
|
+
@rotate="rotatePage"
|
|
32
31
|
@rotate-all-left="handleRotationsToTheLeft"
|
|
33
32
|
@rotate-all-right="handleRotationsToTheRight"
|
|
34
33
|
@handle-splitting-suggestions="applySplittingSuggestions"
|
|
@@ -46,6 +45,7 @@ import RenameAndCategorize from "./RenameAndCategorize";
|
|
|
46
45
|
import EditPages from "./EditPages";
|
|
47
46
|
import SplitInfoBar from "./SplitInfoBar";
|
|
48
47
|
import EditConfirmationModal from "./EditConfirmationModal";
|
|
48
|
+
import { navigateToDocumentsList } from "../../utils/utils";
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* This component shows a document thumbnail grid view and sidebar, to be able to edit the document.
|
|
@@ -85,7 +85,9 @@ export default {
|
|
|
85
85
|
"selectedPages",
|
|
86
86
|
"submitEditChanges",
|
|
87
87
|
]),
|
|
88
|
+
...mapState("project", ["projectId", "documentsListPath", "currentUser"]),
|
|
88
89
|
...mapGetters("edit", ["documentShouldBePostprocessed"]),
|
|
90
|
+
...mapGetters("document", ["waitingForSplittingConfirmation"]),
|
|
89
91
|
},
|
|
90
92
|
watch: {
|
|
91
93
|
renameAndCategorize(newValue) {
|
|
@@ -169,13 +171,11 @@ export default {
|
|
|
169
171
|
|
|
170
172
|
/** ROTATE */
|
|
171
173
|
rotatePage(direction) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
page,
|
|
178
|
-
direction,
|
|
174
|
+
this.selectedPages.forEach((page) => {
|
|
175
|
+
this.$store.dispatch("edit/rotatePage", {
|
|
176
|
+
page,
|
|
177
|
+
direction,
|
|
178
|
+
});
|
|
179
179
|
});
|
|
180
180
|
},
|
|
181
181
|
handleRotationsToTheLeft() {
|
|
@@ -376,7 +376,10 @@ export default {
|
|
|
376
376
|
// Send update request to the backend
|
|
377
377
|
saveEditChanges() {
|
|
378
378
|
// Verify if there was splitting, rotating and/or reordering
|
|
379
|
-
if (
|
|
379
|
+
if (
|
|
380
|
+
this.documentShouldBePostprocessed ||
|
|
381
|
+
this.waitingForSplittingConfirmation(this.selectedDocument)
|
|
382
|
+
) {
|
|
380
383
|
this.$store
|
|
381
384
|
.dispatch("edit/editDocument", this.updatedDocument)
|
|
382
385
|
.catch((error) => {
|
|
@@ -386,8 +389,14 @@ export default {
|
|
|
386
389
|
defaultErrorMessage: this.$t("edit_error"),
|
|
387
390
|
});
|
|
388
391
|
});
|
|
392
|
+
|
|
393
|
+
navigateToDocumentsList(
|
|
394
|
+
this.documentsListPath,
|
|
395
|
+
this.projectId,
|
|
396
|
+
this.currentUser.id
|
|
397
|
+
);
|
|
389
398
|
} else {
|
|
390
|
-
// Check if only the category changes:
|
|
399
|
+
// Check if only the category and/or name changes:
|
|
391
400
|
const newCategory = this.updatedDocument[0].category;
|
|
392
401
|
const newName = this.updatedDocument[0].name;
|
|
393
402
|
let category = {};
|
|
@@ -11,9 +11,7 @@
|
|
|
11
11
|
isVisible && 'visible',
|
|
12
12
|
checkboxValue && 'selected',
|
|
13
13
|
]"
|
|
14
|
-
:style="{
|
|
15
|
-
transform: `rotate(${rotation}deg)`,
|
|
16
|
-
}"
|
|
14
|
+
:style="`rotate:${rotation}deg`"
|
|
17
15
|
@click="selectPage()"
|
|
18
16
|
>
|
|
19
17
|
<ServerImage :image-url="`${page.thumbnail_url}?${page.updated_at}`">
|
|
@@ -96,7 +96,7 @@ export default {
|
|
|
96
96
|
};
|
|
97
97
|
},
|
|
98
98
|
computed: {
|
|
99
|
-
...mapState("edit", ["selectedPages"]),
|
|
99
|
+
...mapState("edit", ["selectedPages", "updatedDocument"]),
|
|
100
100
|
...mapState("document", ["splittingSuggestions", "selectedDocument"]),
|
|
101
101
|
...mapGetters("document", ["documentHasProposedSplit"]),
|
|
102
102
|
},
|
|
@@ -117,6 +117,11 @@ export default {
|
|
|
117
117
|
this.switchStatus = false;
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
|
+
updatedDocument(newValue) {
|
|
121
|
+
if (newValue && newValue.length === 1) {
|
|
122
|
+
this.switchStatus = false;
|
|
123
|
+
}
|
|
124
|
+
},
|
|
120
125
|
},
|
|
121
126
|
mounted() {
|
|
122
127
|
this.$nextTick(() => {
|
|
@@ -129,10 +134,10 @@ export default {
|
|
|
129
134
|
},
|
|
130
135
|
methods: {
|
|
131
136
|
rotateLeft() {
|
|
132
|
-
this.$emit("rotate
|
|
137
|
+
this.$emit("rotate", "left");
|
|
133
138
|
},
|
|
134
139
|
rotateRight() {
|
|
135
|
-
this.$emit("rotate
|
|
140
|
+
this.$emit("rotate", "right");
|
|
136
141
|
},
|
|
137
142
|
rotateAllLeft() {
|
|
138
143
|
this.$emit("rotate-all-left");
|
|
@@ -18,14 +18,6 @@
|
|
|
18
18
|
:container-height="scaledViewport.height"
|
|
19
19
|
@close="closePopups"
|
|
20
20
|
/>
|
|
21
|
-
<MultiAnnotationTablePopup
|
|
22
|
-
v-if="newMultiAnnotationSetTable"
|
|
23
|
-
:table-position="newMultiAnnotationSetTable.position"
|
|
24
|
-
:page-size="scaledViewport"
|
|
25
|
-
:label-set="newMultiAnnotationSetTable.labelSet"
|
|
26
|
-
:grouped-entities="newMultiAnnotationSetTable.entities"
|
|
27
|
-
@close="closePopups"
|
|
28
|
-
/>
|
|
29
21
|
|
|
30
22
|
<AnnSetTableOptions v-if="showAnnSetTable" :page="page" />
|
|
31
23
|
|
|
@@ -117,7 +109,6 @@
|
|
|
117
109
|
:page="page"
|
|
118
110
|
@buttonEnter="onElementEnter"
|
|
119
111
|
@buttonLeave="onElementLeave"
|
|
120
|
-
@finished="handleMultiAnnSelectionFinished"
|
|
121
112
|
/>
|
|
122
113
|
</v-layer>
|
|
123
114
|
</v-stage>
|
|
@@ -136,7 +127,6 @@ import api from "../../api";
|
|
|
136
127
|
import BoxSelection from "./BoxSelection";
|
|
137
128
|
import MultiAnnSelection from "./MultiAnnSelection";
|
|
138
129
|
import NewAnnotation from "./NewAnnotation";
|
|
139
|
-
import MultiAnnotationTablePopup from "./MultiAnnotationTablePopup";
|
|
140
130
|
import AnnSetTableOptions from "./AnnSetTableOptions";
|
|
141
131
|
|
|
142
132
|
export default {
|
|
@@ -145,7 +135,6 @@ export default {
|
|
|
145
135
|
BoxSelection,
|
|
146
136
|
MultiAnnSelection,
|
|
147
137
|
NewAnnotation,
|
|
148
|
-
MultiAnnotationTablePopup,
|
|
149
138
|
AnnSetTableOptions,
|
|
150
139
|
},
|
|
151
140
|
|
|
@@ -160,7 +149,6 @@ export default {
|
|
|
160
149
|
return {
|
|
161
150
|
image: null,
|
|
162
151
|
newAnnotation: [],
|
|
163
|
-
newMultiAnnotationSetTable: null,
|
|
164
152
|
};
|
|
165
153
|
},
|
|
166
154
|
|
|
@@ -393,7 +381,6 @@ export default {
|
|
|
393
381
|
},
|
|
394
382
|
|
|
395
383
|
handleFocusedAnnotation(annotation, trigger) {
|
|
396
|
-
this.$store.dispatch("document/resetEditAnnotation");
|
|
397
384
|
this.$store.dispatch("document/setSidebarAnnotationSelected", {
|
|
398
385
|
annotation,
|
|
399
386
|
trigger,
|
|
@@ -461,10 +448,6 @@ export default {
|
|
|
461
448
|
this.$refs.stage.$el.style.cursor = "inherit";
|
|
462
449
|
},
|
|
463
450
|
|
|
464
|
-
handleMultiAnnSelectionFinished(newMultiAnnotationSetTable) {
|
|
465
|
-
this.newMultiAnnotationSetTable = newMultiAnnotationSetTable;
|
|
466
|
-
},
|
|
467
|
-
|
|
468
451
|
/**
|
|
469
452
|
* Konva draws pages like this.
|
|
470
453
|
*/
|
|
@@ -557,7 +540,6 @@ export default {
|
|
|
557
540
|
};
|
|
558
541
|
},
|
|
559
542
|
closePopups(closeNewAnnotaton) {
|
|
560
|
-
this.newMultiAnnotationSetTable = null;
|
|
561
543
|
if (closeNewAnnotaton) {
|
|
562
544
|
this.newAnnotation = [];
|
|
563
545
|
}
|
|
@@ -132,34 +132,12 @@ export default {
|
|
|
132
132
|
},
|
|
133
133
|
methods: {
|
|
134
134
|
openMultiAnnotationModal() {
|
|
135
|
-
this.$
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
trapFocus: true,
|
|
140
|
-
canCancel: false,
|
|
141
|
-
customClass: "dv-ui-theme invisible-parent-modal",
|
|
142
|
-
props: { isMultipleAnnotations: true },
|
|
143
|
-
events: {
|
|
144
|
-
labelSet: this.submitAnnotations,
|
|
145
|
-
},
|
|
135
|
+
this.$store.dispatch("display/showChooseLabelSetModal", {
|
|
136
|
+
show: true,
|
|
137
|
+
isMultipleAnnotations: true,
|
|
138
|
+
finish: this.submitAnnotations,
|
|
146
139
|
});
|
|
147
140
|
},
|
|
148
|
-
chooseLabelSet(labelSet) {
|
|
149
|
-
// TODO: deprecated with new multi ann set table
|
|
150
|
-
const tableSelection = {
|
|
151
|
-
labelSet,
|
|
152
|
-
position: {
|
|
153
|
-
x: this.selection.start.x,
|
|
154
|
-
y: this.selection.start.y,
|
|
155
|
-
width: this.selection.end.x - this.selection.start.x,
|
|
156
|
-
height: this.selection.end.y - this.selection.start.y,
|
|
157
|
-
},
|
|
158
|
-
entities: this.entities,
|
|
159
|
-
};
|
|
160
|
-
this.$store.dispatch("selection/disableSelection");
|
|
161
|
-
this.$emit("finished", tableSelection);
|
|
162
|
-
},
|
|
163
141
|
|
|
164
142
|
async submitAnnotations(labelSet) {
|
|
165
143
|
const columns = labelSet.labels.map((label) => {
|