@konfuzio/document-validation-ui 0.1.8-pre-release-2 → 0.1.8-pre-release-3
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/.DS_Store +0 -0
- package/src/assets/scss/categorize_modal.scss +1 -1
- package/src/assets/scss/choose_label_set_modal.scss +1 -1
- package/src/assets/scss/document_category.scss +11 -6
- package/src/assets/scss/document_edit.scss +1 -1
- package/src/assets/scss/main.scss +19 -5
- package/src/assets/scss/variables.scss +1 -0
- package/src/components/DocumentAnnotations/AnnotationActionButtons.vue +9 -12
- package/src/components/DocumentAnnotations/AnnotationContent.vue +5 -5
- package/src/components/DocumentAnnotations/AnnotationRow.vue +2 -2
- package/src/components/DocumentAnnotations/AnnotationSetActionButtons.vue +7 -4
- package/src/components/DocumentAnnotations/CategorizeModal.vue +5 -3
- package/src/components/DocumentAnnotations/DocumentAnnotations.vue +4 -4
- package/src/components/DocumentAnnotations/EmptyAnnotation.vue +5 -5
- package/src/components/DocumentAnnotations/MultiAnnotationTableOverlay.vue +42 -10
- package/src/components/DocumentCategory.vue +5 -1
- package/src/components/DocumentEdit/DocumentEdit.vue +4 -10
- package/src/components/DocumentModals/SplittingSuggestionsModal.vue +15 -3
- package/src/components/DocumentPage/DocumentPage.vue +6 -6
- package/src/components/DocumentPage/DocumentToolbar.vue +16 -14
- package/src/components/DocumentPage/MultiAnnSelection.vue +4 -2
- package/src/components/DocumentTopBar/DocumentName.vue +3 -3
- package/src/components/DocumentTopBar/DocumentTopBar.vue +8 -8
- package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +10 -25
- package/src/components/DocumentTopBar/KeyboardActionsDescription.vue +4 -7
- package/src/store/document.js +6 -26
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
@@ -4,25 +4,30 @@
|
|
|
4
4
|
cursor: pointer;
|
|
5
5
|
|
|
6
6
|
&.split-mode {
|
|
7
|
-
border: 1px solid $grey-
|
|
7
|
+
border: 1px solid $grey-outline;
|
|
8
8
|
border-radius: 4px;
|
|
9
9
|
background-color: $white;
|
|
10
|
+
|
|
11
|
+
&:hover {
|
|
12
|
+
border-color: $grey-outline-dark;
|
|
13
|
+
background-color: transparent;
|
|
14
|
+
}
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
&.disabled {
|
|
13
18
|
cursor: not-allowed;
|
|
14
19
|
}
|
|
15
20
|
|
|
21
|
+
&:not(.split-mode) {
|
|
22
|
+
.category-drop-down {
|
|
23
|
+
border-right: $component-border;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
16
26
|
.category-drop-down {
|
|
17
27
|
display: flex;
|
|
18
28
|
height: 100%;
|
|
19
29
|
align-items: center;
|
|
20
30
|
padding: 0 8px 0 14px;
|
|
21
|
-
border-right: $component-border;
|
|
22
|
-
|
|
23
|
-
&:hover {
|
|
24
|
-
background-color: $background;
|
|
25
|
-
}
|
|
26
31
|
|
|
27
32
|
.caret-section {
|
|
28
33
|
padding-top: 5px;
|
|
@@ -245,14 +245,19 @@ body {
|
|
|
245
245
|
|
|
246
246
|
.dropdown-menu {
|
|
247
247
|
padding-top: 0px;
|
|
248
|
+
min-width: 40px;
|
|
248
249
|
}
|
|
249
250
|
|
|
250
|
-
a.dropdown-item
|
|
251
|
-
|
|
252
|
-
}
|
|
251
|
+
a.dropdown-item {
|
|
252
|
+
padding-right: 16px;
|
|
253
253
|
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
&.is-active {
|
|
255
|
+
background-color: $primary;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
&.is-disabled {
|
|
259
|
+
color: $grey-blue !important;
|
|
260
|
+
}
|
|
256
261
|
}
|
|
257
262
|
|
|
258
263
|
&.dropdown-menu-animation {
|
|
@@ -296,6 +301,8 @@ body {
|
|
|
296
301
|
}
|
|
297
302
|
|
|
298
303
|
&.modal-400 {
|
|
304
|
+
position: absolute !important;
|
|
305
|
+
|
|
299
306
|
.modal-content {
|
|
300
307
|
max-width: 400px !important;
|
|
301
308
|
|
|
@@ -528,6 +535,12 @@ body {
|
|
|
528
535
|
}
|
|
529
536
|
}
|
|
530
537
|
|
|
538
|
+
&.full-height-tooltip {
|
|
539
|
+
.tooltip-trigger {
|
|
540
|
+
height: 100%;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
531
544
|
&.width-184 {
|
|
532
545
|
.tooltip-content {
|
|
533
546
|
width: 184px !important;
|
|
@@ -619,6 +632,7 @@ body {
|
|
|
619
632
|
&.split-mode {
|
|
620
633
|
.dropdown-trigger {
|
|
621
634
|
font-size: 14px;
|
|
635
|
+
height: 38px;
|
|
622
636
|
}
|
|
623
637
|
}
|
|
624
638
|
|
|
@@ -19,6 +19,7 @@ $grey-low-opacity: rgba(133, 140, 154, 0.4);
|
|
|
19
19
|
$grey-lighter-low-opacity: rgba(223, 224, 228, 0.5);
|
|
20
20
|
$grey-lightest: #f0f0f0;
|
|
21
21
|
$grey-outline: #d0d5dd;
|
|
22
|
+
$grey-outline-dark: #b5b5b5;
|
|
22
23
|
$grey-detail: #e1e1e1;
|
|
23
24
|
$subtle-grey: #f2f4f7;
|
|
24
25
|
$subtlest-grey: #e3e4e5;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
<!-- save button -->
|
|
13
13
|
<b-button
|
|
14
|
-
v-if="saveBtn && !isLoading && !publicView && !
|
|
14
|
+
v-if="saveBtn && !isLoading && !publicView && !isDocumentReviewed"
|
|
15
15
|
:class="[
|
|
16
16
|
'annotation-save-btn text-btn',
|
|
17
17
|
actionBar && 'action-bar-save-btn',
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
<!-- cancel button -->
|
|
27
27
|
<b-button
|
|
28
|
-
v-if="cancelBtn && !isLoading && !
|
|
28
|
+
v-if="cancelBtn && !isLoading && !isDocumentReviewed"
|
|
29
29
|
class="is-small annotation-cancel-btn"
|
|
30
30
|
icon-left="xmark"
|
|
31
31
|
@click.stop="cancel"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
!saveBtn &&
|
|
40
40
|
!cancelBtn &&
|
|
41
41
|
!publicView &&
|
|
42
|
-
!
|
|
42
|
+
!isDocumentReviewed
|
|
43
43
|
"
|
|
44
44
|
class="missing-decline-button-container"
|
|
45
45
|
>
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
!saveBtn &&
|
|
61
61
|
!cancelBtn &&
|
|
62
62
|
!publicView &&
|
|
63
|
-
!
|
|
63
|
+
!isDocumentReviewed
|
|
64
64
|
"
|
|
65
65
|
class="annotation-accept-btn primary-button"
|
|
66
66
|
type="is-primary"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
!cancelBtn &&
|
|
78
78
|
!saveBtn &&
|
|
79
79
|
!publicView &&
|
|
80
|
-
!
|
|
80
|
+
!isDocumentReviewed
|
|
81
81
|
"
|
|
82
82
|
class="missing-decline-button-container"
|
|
83
83
|
>
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
|
|
93
93
|
<!-- Restore not found annotations -->
|
|
94
94
|
<b-button
|
|
95
|
-
v-if="restoreBtn && !isLoading && !publicView && !
|
|
95
|
+
v-if="restoreBtn && !isLoading && !publicView && !isDocumentReviewed"
|
|
96
96
|
class="restore-btn"
|
|
97
97
|
type="is-primary"
|
|
98
98
|
@click.stop="restore"
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
</template>
|
|
104
104
|
<script>
|
|
105
105
|
/* Component for showing actions for each annotation row */
|
|
106
|
-
import { mapState } from "vuex";
|
|
106
|
+
import { mapGetters, mapState } from "vuex";
|
|
107
107
|
export default {
|
|
108
108
|
name: "AnnotationActionButtons",
|
|
109
109
|
props: {
|
|
@@ -135,11 +135,8 @@ export default {
|
|
|
135
135
|
},
|
|
136
136
|
},
|
|
137
137
|
computed: {
|
|
138
|
-
...mapState("document", [
|
|
139
|
-
|
|
140
|
-
"missingAnnotations",
|
|
141
|
-
"documentIsReviewed",
|
|
142
|
-
]),
|
|
138
|
+
...mapState("document", ["publicView", "missingAnnotations"]),
|
|
139
|
+
...mapGetters("document", ["isDocumentReviewed"]),
|
|
143
140
|
},
|
|
144
141
|
methods: {
|
|
145
142
|
save() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :id="annotation.id" ref="annotation" class="annotation">
|
|
3
3
|
<span
|
|
4
|
-
v-if="!publicView || !
|
|
4
|
+
v-if="!publicView || !isDocumentReviewed"
|
|
5
5
|
:id="annotation.id"
|
|
6
6
|
ref="contentEditable"
|
|
7
7
|
:class="[
|
|
@@ -71,6 +71,7 @@ export default {
|
|
|
71
71
|
"isAnnotationInEditMode",
|
|
72
72
|
"pageAtIndex",
|
|
73
73
|
"getTextFromEntities",
|
|
74
|
+
"isDocumentReviewed",
|
|
74
75
|
]),
|
|
75
76
|
...mapGetters("display", ["bboxToRect"]),
|
|
76
77
|
...mapGetters("selection", ["isValueArray"]),
|
|
@@ -82,7 +83,6 @@ export default {
|
|
|
82
83
|
"newAcceptedAnnotations",
|
|
83
84
|
"selectedEntities",
|
|
84
85
|
"showActionError",
|
|
85
|
-
"documentIsReviewed",
|
|
86
86
|
]),
|
|
87
87
|
annotationText() {
|
|
88
88
|
if (this.isAnnotationBeingEdited) {
|
|
@@ -156,7 +156,7 @@ export default {
|
|
|
156
156
|
this.$refs.contentEditable.textContent = text;
|
|
157
157
|
},
|
|
158
158
|
handleEditAnnotation(event) {
|
|
159
|
-
if (this.publicView || this.
|
|
159
|
+
if (this.publicView || this.isDocumentReviewed) return;
|
|
160
160
|
|
|
161
161
|
if (event) {
|
|
162
162
|
event.preventDefault();
|
|
@@ -164,7 +164,7 @@ export default {
|
|
|
164
164
|
|
|
165
165
|
if (
|
|
166
166
|
!this.publicView &&
|
|
167
|
-
!this.
|
|
167
|
+
!this.isDocumentReviewed &&
|
|
168
168
|
!this.isAnnotationBeingEdited &&
|
|
169
169
|
!this.isLoading
|
|
170
170
|
) {
|
|
@@ -228,7 +228,7 @@ export default {
|
|
|
228
228
|
event.preventDefault();
|
|
229
229
|
},
|
|
230
230
|
saveAnnotationChanges(event) {
|
|
231
|
-
if (this.publicView || this.
|
|
231
|
+
if (this.publicView || this.isDocumentReviewed) return;
|
|
232
232
|
|
|
233
233
|
if (event) {
|
|
234
234
|
event.preventDefault();
|
|
@@ -168,12 +168,12 @@ export default {
|
|
|
168
168
|
"documentId",
|
|
169
169
|
"showActionError",
|
|
170
170
|
"missingAnnotations",
|
|
171
|
-
"documentIsReviewed",
|
|
172
171
|
]),
|
|
173
172
|
...mapState("selection", ["spanSelection", "elementSelected"]),
|
|
174
173
|
...mapGetters("document", [
|
|
175
174
|
"isAnnotationInEditMode",
|
|
176
175
|
"annotationIsNotFound",
|
|
176
|
+
"isDocumentReviewed",
|
|
177
177
|
]),
|
|
178
178
|
...mapGetters("selection", ["isValueArray"]),
|
|
179
179
|
defaultSpan() {
|
|
@@ -426,7 +426,7 @@ export default {
|
|
|
426
426
|
);
|
|
427
427
|
},
|
|
428
428
|
handleSaveChanges(decline) {
|
|
429
|
-
if (this.publicView || this.
|
|
429
|
+
if (this.publicView || this.isDocumentReviewed) return;
|
|
430
430
|
|
|
431
431
|
if (
|
|
432
432
|
this.showAcceptButton() ||
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="action-buttons">
|
|
3
3
|
<!-- mark all empty labels as missing -->
|
|
4
4
|
<div
|
|
5
|
-
v-if="!publicView && !
|
|
5
|
+
v-if="!publicView && !isDocumentReviewed"
|
|
6
6
|
class="missing-decline-button-container all-missing"
|
|
7
7
|
@mouseenter="mouseenterAnnotationSet('missing')"
|
|
8
8
|
@mouseleave="mouseleaveAnnotationSet"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
<!-- accept all pending annotations -->
|
|
21
21
|
<div
|
|
22
|
-
v-if="!publicView && !
|
|
22
|
+
v-if="!publicView && !isDocumentReviewed"
|
|
23
23
|
class="accept-all"
|
|
24
24
|
@mouseenter="mouseenterAnnotationSet('accept')"
|
|
25
25
|
@mouseleave="mouseleaveAnnotationSet"
|
|
@@ -40,20 +40,23 @@
|
|
|
40
40
|
<script>
|
|
41
41
|
/* Component for showing actions for each Annotation Set */
|
|
42
42
|
|
|
43
|
-
import { mapState } from "vuex";
|
|
43
|
+
import { mapGetters, mapState } from "vuex";
|
|
44
44
|
|
|
45
45
|
export default {
|
|
46
46
|
name: "AnnotationSetActionButtons",
|
|
47
47
|
props: {
|
|
48
48
|
numberOfEmptyLabelsInAnnotationSet: {
|
|
49
49
|
type: Number,
|
|
50
|
+
default: 0,
|
|
50
51
|
},
|
|
51
52
|
numberOfPendingAnnotationsInAnnotationSet: {
|
|
52
53
|
type: Number,
|
|
54
|
+
default: 0,
|
|
53
55
|
},
|
|
54
56
|
},
|
|
55
57
|
computed: {
|
|
56
|
-
...mapState("document", ["publicView"
|
|
58
|
+
...mapState("document", ["publicView"]),
|
|
59
|
+
...mapGetters("document", ["isDocumentReviewed"]),
|
|
57
60
|
},
|
|
58
61
|
methods: {
|
|
59
62
|
mouseenterAnnotationSet(type) {
|
|
@@ -110,10 +110,12 @@ export default {
|
|
|
110
110
|
"categorizeModalIsActive",
|
|
111
111
|
"splittingSuggestions",
|
|
112
112
|
"publicView",
|
|
113
|
-
"documentIsReviewed",
|
|
114
113
|
]),
|
|
115
114
|
...mapGetters("category", ["category", "projectHasSingleCategory"]),
|
|
116
|
-
...mapGetters("document", [
|
|
115
|
+
...mapGetters("document", [
|
|
116
|
+
"categorizationIsConfirmed",
|
|
117
|
+
"isDocumentReviewed",
|
|
118
|
+
]),
|
|
117
119
|
|
|
118
120
|
singleCategoryInProject() {
|
|
119
121
|
// if only 1 category in the project, we don't enable the dropdown
|
|
@@ -185,7 +187,7 @@ export default {
|
|
|
185
187
|
(!category || (category && !this.splittingSuggestions)) &&
|
|
186
188
|
!this.categorizationIsConfirmed &&
|
|
187
189
|
!this.publicView &&
|
|
188
|
-
!this.
|
|
190
|
+
!this.isDocumentReviewed;
|
|
189
191
|
}
|
|
190
192
|
},
|
|
191
193
|
canCloseModal() {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<CategorizeModal
|
|
18
18
|
v-if="
|
|
19
19
|
!publicView &&
|
|
20
|
-
!
|
|
20
|
+
!isDocumentReviewed &&
|
|
21
21
|
!waitingForSplittingConfirmation(selectedDocument)
|
|
22
22
|
"
|
|
23
23
|
/>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</div>
|
|
26
26
|
|
|
27
27
|
<div v-else :class="['annotation-set-list']">
|
|
28
|
-
<CategorizeModal v-if="!publicView || !
|
|
28
|
+
<CategorizeModal v-if="!publicView || !isDocumentReviewed" />
|
|
29
29
|
<div
|
|
30
30
|
v-if="Object.entries(annotationSetsInTable()).length > 0"
|
|
31
31
|
class="annotation-set-group"
|
|
@@ -148,7 +148,6 @@ export default {
|
|
|
148
148
|
"labels",
|
|
149
149
|
"selectedDocument",
|
|
150
150
|
"splittingSuggestions",
|
|
151
|
-
"documentIsReviewed",
|
|
152
151
|
]),
|
|
153
152
|
...mapGetters("category", ["category"]),
|
|
154
153
|
...mapGetters("document", [
|
|
@@ -158,6 +157,7 @@ export default {
|
|
|
158
157
|
"waitingForSplittingConfirmation",
|
|
159
158
|
"annotationSetsToShowInList",
|
|
160
159
|
"annotationSetsInTable",
|
|
160
|
+
"isDocumentReviewed",
|
|
161
161
|
]),
|
|
162
162
|
isAnnotationBeingEdited() {
|
|
163
163
|
return this.editAnnotation && this.editAnnotation.id;
|
|
@@ -231,7 +231,7 @@ export default {
|
|
|
231
231
|
|
|
232
232
|
keyDownHandler(event) {
|
|
233
233
|
// only allow keyboard navigation if we are not in public view mode
|
|
234
|
-
if (this.publicView || this.
|
|
234
|
+
if (this.publicView || this.isDocumentReviewed) return;
|
|
235
235
|
|
|
236
236
|
// get out of edit mode and navigation
|
|
237
237
|
if (event.key === "Escape") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="empty-annotation">
|
|
3
3
|
<span
|
|
4
|
-
v-if="!publicView && !
|
|
4
|
+
v-if="!publicView && !isDocumentReviewed"
|
|
5
5
|
:id="emptyAnnotationId()"
|
|
6
6
|
ref="emptyAnnotation"
|
|
7
7
|
:class="[
|
|
@@ -76,6 +76,7 @@ export default {
|
|
|
76
76
|
"isAnnotationInEditMode",
|
|
77
77
|
"getTextFromEntities",
|
|
78
78
|
"annotationIsNotFound",
|
|
79
|
+
"isDocumentReviewed",
|
|
79
80
|
]),
|
|
80
81
|
...mapGetters("selection", ["isValueArray"]),
|
|
81
82
|
...mapState("selection", ["spanSelection", "elementSelected"]),
|
|
@@ -84,7 +85,6 @@ export default {
|
|
|
84
85
|
"publicView",
|
|
85
86
|
"selectedEntities",
|
|
86
87
|
"showActionError",
|
|
87
|
-
"documentIsReviewed",
|
|
88
88
|
]),
|
|
89
89
|
},
|
|
90
90
|
watch: {
|
|
@@ -159,14 +159,14 @@ export default {
|
|
|
159
159
|
handleEditEmptyAnnotation() {
|
|
160
160
|
if (
|
|
161
161
|
this.publicView ||
|
|
162
|
-
this.
|
|
162
|
+
this.isDocumentReviewed ||
|
|
163
163
|
this.annotationIsNotFound(this.annotationSet, this.label)
|
|
164
164
|
)
|
|
165
165
|
return;
|
|
166
166
|
|
|
167
167
|
if (
|
|
168
168
|
!this.publicView &&
|
|
169
|
-
!this.
|
|
169
|
+
!this.isDocumentReviewed &&
|
|
170
170
|
!this.isLoading &&
|
|
171
171
|
this.elementSelected !== this.emptyAnnotationId()
|
|
172
172
|
) {
|
|
@@ -221,7 +221,7 @@ export default {
|
|
|
221
221
|
}
|
|
222
222
|
},
|
|
223
223
|
saveEmptyAnnotationChanges(event) {
|
|
224
|
-
if (this.publicView || this.
|
|
224
|
+
if (this.publicView || this.isDocumentReviewed) return;
|
|
225
225
|
|
|
226
226
|
if (event) {
|
|
227
227
|
event.preventDefault();
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
@columndragleave="columndragleave"
|
|
22
22
|
>
|
|
23
23
|
<b-table-column
|
|
24
|
-
v-for="(item, index) in columns"
|
|
24
|
+
v-for="(item, index) in isLoading ? [columns[0]] : columns"
|
|
25
25
|
:key="index"
|
|
26
26
|
:field="item.field"
|
|
27
27
|
:label="item.label.name"
|
|
@@ -31,14 +31,17 @@
|
|
|
31
31
|
:ref="getDropdownReference(item)"
|
|
32
32
|
aria-role="list"
|
|
33
33
|
class="header-dropdown"
|
|
34
|
-
position="is-top-
|
|
34
|
+
position="is-top-right"
|
|
35
35
|
:close-on-click="false"
|
|
36
36
|
@active-change="(e) => onDropdownChange(item, e)"
|
|
37
37
|
>
|
|
38
38
|
<template #trigger="{ active }">
|
|
39
|
-
<DraggableIcon class="draggable" />
|
|
40
|
-
<span :class="active ? 'active' : ''"
|
|
39
|
+
<DraggableIcon v-if="!isLoading" class="draggable" />
|
|
40
|
+
<span v-if="!isLoading" :class="active ? 'active' : ''"
|
|
41
|
+
>{{ column.label }}
|
|
42
|
+
</span>
|
|
41
43
|
<b-icon
|
|
44
|
+
v-if="!isLoading"
|
|
42
45
|
:icon="active ? 'angle-up' : 'angle-down'"
|
|
43
46
|
size="is-small"
|
|
44
47
|
class="arrow"
|
|
@@ -63,7 +66,7 @@
|
|
|
63
66
|
:key="label.id"
|
|
64
67
|
aria-role="listitem"
|
|
65
68
|
:disabled="label.disabled"
|
|
66
|
-
><span @click="changeLabel(item, label)">{{
|
|
69
|
+
><span @click="!label.disabled && changeLabel(item, label)">{{
|
|
67
70
|
label.name
|
|
68
71
|
}}</span></b-dropdown-item
|
|
69
72
|
>
|
|
@@ -73,7 +76,9 @@
|
|
|
73
76
|
|
|
74
77
|
<template #default="props">
|
|
75
78
|
<div class="annotations-table">
|
|
79
|
+
<b-skeleton v-if="isLoading" width="98%" height="90%" />
|
|
76
80
|
<AnnotationRow
|
|
81
|
+
v-if="!isLoading"
|
|
77
82
|
:annotation="props.row[item.field]"
|
|
78
83
|
:label="item.label"
|
|
79
84
|
:annotation-set="item.annotationSet"
|
|
@@ -120,6 +125,7 @@ export default {
|
|
|
120
125
|
editingLabels: [],
|
|
121
126
|
openDropdown: null,
|
|
122
127
|
draggingColumnIndex: null,
|
|
128
|
+
isLoading: false,
|
|
123
129
|
};
|
|
124
130
|
},
|
|
125
131
|
computed: {
|
|
@@ -136,6 +142,13 @@ export default {
|
|
|
136
142
|
this.handleColumns();
|
|
137
143
|
this.handleRows();
|
|
138
144
|
},
|
|
145
|
+
columns(columns) {
|
|
146
|
+
if (!columns || (columns && columns.length === 0)) {
|
|
147
|
+
this.$store.dispatch("selection/disableSelection");
|
|
148
|
+
this.$store.dispatch("document/resetEditAnnotation");
|
|
149
|
+
this.$store.dispatch("display/showAnnSetTable", null);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
139
152
|
},
|
|
140
153
|
mounted() {
|
|
141
154
|
this.handleColumns();
|
|
@@ -212,6 +225,8 @@ export default {
|
|
|
212
225
|
},
|
|
213
226
|
|
|
214
227
|
async changeLabel(column, label) {
|
|
228
|
+
this.isLoading = true;
|
|
229
|
+
this.closeDropdown(column);
|
|
215
230
|
for (let i = 0; i < this.rows.length; i++) {
|
|
216
231
|
const annotationToUpdate = this.rows[i][column.label.id];
|
|
217
232
|
await this.$store
|
|
@@ -227,12 +242,22 @@ export default {
|
|
|
227
242
|
});
|
|
228
243
|
});
|
|
229
244
|
}
|
|
230
|
-
this.
|
|
245
|
+
this.isLoading = false;
|
|
231
246
|
},
|
|
232
247
|
|
|
233
248
|
async deleteColumn(column) {
|
|
249
|
+
this.isLoading = true;
|
|
250
|
+
this.closeDropdown(column);
|
|
251
|
+
|
|
252
|
+
const annotationsToDelete = [];
|
|
234
253
|
for (let i = 0; i < this.rows.length; i++) {
|
|
235
254
|
const annotationToDelete = this.rows[i][column.label.id];
|
|
255
|
+
if (annotationToDelete && annotationToDelete.id) {
|
|
256
|
+
annotationsToDelete.push(annotationToDelete);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
annotationsToDelete.forEach(async (annotationToDelete) => {
|
|
236
261
|
await this.$store
|
|
237
262
|
.dispatch("document/deleteAnnotation", {
|
|
238
263
|
annotationId: annotationToDelete.id,
|
|
@@ -244,8 +269,9 @@ export default {
|
|
|
244
269
|
defaultErrorMessage: this.$t("edit_error"),
|
|
245
270
|
});
|
|
246
271
|
});
|
|
247
|
-
}
|
|
248
|
-
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
this.isLoading = false;
|
|
249
275
|
},
|
|
250
276
|
|
|
251
277
|
onDropdownChange(column, open) {
|
|
@@ -253,7 +279,10 @@ export default {
|
|
|
253
279
|
this.$store.dispatch("selection/disableSelection");
|
|
254
280
|
this.$store.dispatch("document/resetEditAnnotation");
|
|
255
281
|
if (open) {
|
|
256
|
-
if (
|
|
282
|
+
if (
|
|
283
|
+
this.openDropdown &&
|
|
284
|
+
this.$refs[this.getDropdownReference(column)].length > 0
|
|
285
|
+
) {
|
|
257
286
|
this.$refs[this.openDropdown][0].toggle();
|
|
258
287
|
}
|
|
259
288
|
this.openDropdown = this.getDropdownReference(column);
|
|
@@ -265,7 +294,10 @@ export default {
|
|
|
265
294
|
},
|
|
266
295
|
|
|
267
296
|
closeDropdown(column) {
|
|
268
|
-
if (
|
|
297
|
+
if (
|
|
298
|
+
this.openDropdown &&
|
|
299
|
+
this.$refs[this.getDropdownReference(column)].length > 0
|
|
300
|
+
) {
|
|
269
301
|
this.$refs[this.getDropdownReference(column)][0].toggle();
|
|
270
302
|
this.openDropdown = null;
|
|
271
303
|
}
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
:active="tooltipIsShown || dropdownIsDisabled"
|
|
5
5
|
size="is-large"
|
|
6
6
|
position="is-bottom"
|
|
7
|
-
:class="[
|
|
7
|
+
:class="[
|
|
8
|
+
editMode
|
|
9
|
+
? 'right-aligned full-height-tooltip'
|
|
10
|
+
: 'left-aligned full-height-tooltip',
|
|
11
|
+
]"
|
|
8
12
|
:close-delay="tooltipCloseDelay"
|
|
9
13
|
>
|
|
10
14
|
<template #content>
|
|
@@ -184,17 +184,11 @@ export default {
|
|
|
184
184
|
if (!this.splittingSuggestions) return;
|
|
185
185
|
|
|
186
186
|
this.splittingSuggestions.map((item) => {
|
|
187
|
-
const
|
|
188
|
-
(page) => page.id === item.pages[
|
|
187
|
+
const lastPage = this.selectedDocument.pages.find(
|
|
188
|
+
(page) => page.id === item.pages[item.pages.length - 1].id
|
|
189
189
|
);
|
|
190
190
|
|
|
191
|
-
|
|
192
|
-
// only add the active splitting line from the 1st page of the second document
|
|
193
|
-
// since it's the first splitting point
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
this.handleSplittingLines(firstPage.number, "AI");
|
|
191
|
+
this.handleSplittingLines(lastPage.number, "AI");
|
|
198
192
|
});
|
|
199
193
|
},
|
|
200
194
|
applySplittingSuggestions(value) {
|
|
@@ -342,7 +336,7 @@ export default {
|
|
|
342
336
|
);
|
|
343
337
|
|
|
344
338
|
const singleSplittingSuggestion = this.splittingSuggestions.find(
|
|
345
|
-
(item) => item.pages[
|
|
339
|
+
(item) => item.pages[item.pages.length - 1].id === foundPage.id
|
|
346
340
|
);
|
|
347
341
|
|
|
348
342
|
return this.splittingSuggestions.indexOf(singleSplittingSuggestion);
|
|
@@ -52,6 +52,7 @@ export default {
|
|
|
52
52
|
},
|
|
53
53
|
computed: {
|
|
54
54
|
...mapState("document", ["splittingSuggestions", "selectedDocument"]),
|
|
55
|
+
...mapState("edit", ["editMode"]),
|
|
55
56
|
...mapGetters("document", ["waitingForSplittingConfirmation"]),
|
|
56
57
|
},
|
|
57
58
|
watch: {
|
|
@@ -60,6 +61,11 @@ export default {
|
|
|
60
61
|
this.isModalActive = true;
|
|
61
62
|
}
|
|
62
63
|
},
|
|
64
|
+
editMode(newValue) {
|
|
65
|
+
if (!newValue) {
|
|
66
|
+
this.showModal();
|
|
67
|
+
}
|
|
68
|
+
},
|
|
63
69
|
isModalActive(newValue) {
|
|
64
70
|
if (newValue) {
|
|
65
71
|
this.$nextTick(() => {
|
|
@@ -80,9 +86,7 @@ export default {
|
|
|
80
86
|
},
|
|
81
87
|
},
|
|
82
88
|
mounted() {
|
|
83
|
-
|
|
84
|
-
this.isModalActive = true;
|
|
85
|
-
}
|
|
89
|
+
this.showModal();
|
|
86
90
|
|
|
87
91
|
this.$nextTick(() => {
|
|
88
92
|
if (this.recommended) {
|
|
@@ -91,6 +95,14 @@ export default {
|
|
|
91
95
|
});
|
|
92
96
|
},
|
|
93
97
|
methods: {
|
|
98
|
+
showModal() {
|
|
99
|
+
if (
|
|
100
|
+
this.splittingSuggestions &&
|
|
101
|
+
this.waitingForSplittingConfirmation(this.selectedDocument)
|
|
102
|
+
) {
|
|
103
|
+
this.isModalActive = true;
|
|
104
|
+
}
|
|
105
|
+
},
|
|
94
106
|
closeModal() {
|
|
95
107
|
const updatedDocument = [
|
|
96
108
|
{
|