@konfuzio/document-validation-ui 0.1.50 → 0.1.51-dev.1
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/dist/js/chunk-vendors.js +8 -6
- package/dist/js/chunk-vendors.js.map +1 -1
- package/package.json +2 -1
- package/src/assets/scss/annotation_action_buttons.scss +82 -0
- package/src/assets/scss/document_annotations.scss +331 -419
- package/src/assets/scss/document_dashboard.scss +0 -7
- package/src/assets/scss/document_edit.scss +3 -1
- package/src/assets/scss/document_top_bar.scss +72 -68
- package/src/assets/scss/theme.scss +89 -70
- package/src/components/DocumentAnnotations/AnnotationActionButtons.vue +153 -106
- package/src/components/DocumentAnnotations/AnnotationRow.vue +72 -19
- package/src/components/DocumentAnnotations/AnnotationSetActionButtons.vue +4 -4
- package/src/components/DocumentAnnotations/DocumentAnnotations.vue +7 -3
- package/src/components/DocumentAnnotations/DocumentLabel.vue +42 -59
- package/src/components/DocumentAnnotations/ExtractingData.vue +1 -7
- package/src/components/DocumentCategory.vue +0 -5
- package/src/components/DocumentDashboard.vue +12 -3
- package/src/components/DocumentEdit/EditSidebar.vue +1 -1
- package/src/components/DocumentPage/DocumentPage.vue +2 -1
- package/src/components/DocumentPage/EditAnnotation.vue +21 -15
- package/src/components/DocumentPage/ScrollingDocument.vue +1 -13
- package/src/components/DocumentTopBar/DocumentTopBar.vue +42 -40
- package/src/icons.js +6 -0
- package/src/locales/de.json +3 -2
- package/src/locales/en.json +3 -2
- package/src/locales/es.json +3 -2
- package/src/main.js +2 -0
- package/src/store/display.js +12 -10
- package/src/store/document.js +3 -0
- package/src/components/DocumentPage/ActionBar.vue +0 -48
|
@@ -1,162 +1,217 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="action-buttons">
|
|
3
|
-
<!--
|
|
3
|
+
<!-- link button -->
|
|
4
4
|
<b-button
|
|
5
|
-
v-if="
|
|
5
|
+
v-if="showLink"
|
|
6
6
|
id="annotation-link-btn"
|
|
7
7
|
type="is-ghost"
|
|
8
|
-
class="
|
|
9
|
-
@click="
|
|
8
|
+
class="button-action is-button-icon"
|
|
9
|
+
@click.stop="link"
|
|
10
10
|
>
|
|
11
|
-
<b-tooltip
|
|
12
|
-
|
|
11
|
+
<b-tooltip
|
|
12
|
+
:delay="tooltipDelay"
|
|
13
|
+
position="is-left"
|
|
14
|
+
:label="$t('annotation_link')"
|
|
15
|
+
>
|
|
16
|
+
<b-icon icon="link" class="link-icon center-icon button-icon" />
|
|
13
17
|
</b-tooltip>
|
|
14
18
|
</b-button>
|
|
15
|
-
<div v-if="isLoading">
|
|
16
|
-
<b-notification :closable="false" class="loading-background">
|
|
17
|
-
<b-loading :active="isLoading" :is-full-page="false">
|
|
18
|
-
<b-icon icon="spinner" class="fa-spin loading-icon-size spinner" />
|
|
19
|
-
</b-loading>
|
|
20
|
-
</b-notification>
|
|
21
|
-
</div>
|
|
22
19
|
|
|
23
|
-
<!--
|
|
20
|
+
<!-- decline button -->
|
|
24
21
|
<b-button
|
|
25
|
-
v-if="
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
actionBar ? 'tertiary-button' : 'primary-button',
|
|
30
|
-
]"
|
|
31
|
-
type="is-primary"
|
|
32
|
-
@click.stop="save"
|
|
22
|
+
v-if="showDecline"
|
|
23
|
+
class="button-action is-button-icon decline-btn"
|
|
24
|
+
type="is-ghost"
|
|
25
|
+
@click.stop="decline"
|
|
33
26
|
>
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
<b-tooltip
|
|
28
|
+
:delay="tooltipDelay"
|
|
29
|
+
position="is-left"
|
|
30
|
+
:label="$t('decline')"
|
|
31
|
+
>
|
|
32
|
+
<b-icon icon="ban" class="decline-icon center-icon button-icon" />
|
|
37
33
|
</b-tooltip>
|
|
38
34
|
</b-button>
|
|
39
35
|
|
|
40
|
-
<!--
|
|
36
|
+
<!-- accept button -->
|
|
41
37
|
<b-button
|
|
42
|
-
v-if="
|
|
43
|
-
class="
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
:
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
v-if="showAccept"
|
|
39
|
+
:class="`button-action accept-btn ${
|
|
40
|
+
showText ? 'is-button-text' : 'is-button-icon'
|
|
41
|
+
}`"
|
|
42
|
+
:type="showText ? 'is-primary' : 'is-ghost'"
|
|
43
|
+
@click.stop="accept"
|
|
44
|
+
>
|
|
45
|
+
<span v-if="showText" class="button-text">{{ $t("accept") }}</span>
|
|
46
|
+
<b-tooltip
|
|
47
|
+
v-else
|
|
48
|
+
:delay="tooltipDelay"
|
|
49
|
+
position="is-left"
|
|
50
|
+
:label="$t('accept')"
|
|
55
51
|
>
|
|
56
|
-
<b-icon
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
<b-icon
|
|
53
|
+
icon="circle-check"
|
|
54
|
+
class="accept-icon center-icon button-icon"
|
|
55
|
+
/>
|
|
56
|
+
</b-tooltip>
|
|
57
|
+
</b-button>
|
|
58
|
+
|
|
59
|
+
<!-- search button -->
|
|
60
|
+
<b-button
|
|
61
|
+
v-if="showSearch"
|
|
62
|
+
type="is-ghost"
|
|
63
|
+
:class="`button-action ${
|
|
64
|
+
showText ? 'is-button-text-ghost' : 'is-button-icon'
|
|
65
|
+
}`"
|
|
66
|
+
@click.stop="search"
|
|
67
|
+
>
|
|
68
|
+
<span v-if="showText" class="button-text">{{
|
|
69
|
+
$t("search_in_document")
|
|
70
|
+
}}</span>
|
|
71
|
+
<b-tooltip
|
|
72
|
+
v-else
|
|
73
|
+
:delay="tooltipDelay"
|
|
74
|
+
position="is-left"
|
|
75
|
+
:label="$t('search_in_document')"
|
|
64
76
|
>
|
|
65
|
-
<
|
|
66
|
-
</b-
|
|
67
|
-
</
|
|
77
|
+
<b-icon icon="search" class="center-icon button-icon search-icon" />
|
|
78
|
+
</b-tooltip>
|
|
79
|
+
</b-button>
|
|
80
|
+
|
|
68
81
|
<!-- missing button -->
|
|
69
|
-
<
|
|
70
|
-
v-if="
|
|
71
|
-
|
|
82
|
+
<b-button
|
|
83
|
+
v-if="showMissing"
|
|
84
|
+
type="is-ghost"
|
|
85
|
+
:class="`button-action ${
|
|
86
|
+
showText ? 'is-button-text-ghost' : 'is-button-icon'
|
|
87
|
+
}`"
|
|
88
|
+
@click.stop="markAsMissing"
|
|
72
89
|
>
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
class="search-btn"
|
|
82
|
-
@click.stop="searchInDocument"
|
|
90
|
+
<span v-if="showText" class="button-text">{{
|
|
91
|
+
$t("missing_annotation")
|
|
92
|
+
}}</span>
|
|
93
|
+
<b-tooltip
|
|
94
|
+
v-else
|
|
95
|
+
:delay="tooltipDelay"
|
|
96
|
+
position="is-left"
|
|
97
|
+
:label="$t('missing_annotation')"
|
|
83
98
|
>
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
</b-
|
|
89
|
-
</
|
|
99
|
+
<b-icon
|
|
100
|
+
icon="magnifying-glass-minus"
|
|
101
|
+
class="center-icon button-icon missing-icon"
|
|
102
|
+
/>
|
|
103
|
+
</b-tooltip>
|
|
104
|
+
</b-button>
|
|
105
|
+
|
|
106
|
+
<!-- save button -->
|
|
107
|
+
<b-button
|
|
108
|
+
v-if="showSave"
|
|
109
|
+
:class="`button-action ${showText ? 'is-button-text' : 'is-button-icon'}`"
|
|
110
|
+
:type="showText ? 'is-primary' : 'is-ghost'"
|
|
111
|
+
@click.stop="save"
|
|
112
|
+
>
|
|
113
|
+
<span v-if="showText" class="button-text">{{ $t("save") }}</span>
|
|
114
|
+
<b-tooltip
|
|
115
|
+
v-else
|
|
116
|
+
:delay="tooltipDelay"
|
|
117
|
+
position="is-left"
|
|
118
|
+
:label="$t('save')"
|
|
119
|
+
>
|
|
120
|
+
<b-icon icon="floppy-disk" class="button-icon center-icon save-icon" />
|
|
121
|
+
</b-tooltip>
|
|
122
|
+
</b-button>
|
|
90
123
|
|
|
91
124
|
<!-- Restore not found annotations -->
|
|
92
125
|
<b-button
|
|
93
|
-
v-if="
|
|
94
|
-
class="restore-btn
|
|
95
|
-
|
|
126
|
+
v-if="showRestore"
|
|
127
|
+
:class="`button-action restore-btn ${
|
|
128
|
+
showText ? 'is-button-text' : 'is-button-icon'
|
|
129
|
+
}`"
|
|
130
|
+
:type="showText ? 'is-primary' : 'is-ghost'"
|
|
96
131
|
@click.stop="restore"
|
|
97
132
|
>
|
|
98
|
-
<span v-if="showText">{{ $t("restore") }}</span>
|
|
99
|
-
<b-tooltip
|
|
100
|
-
|
|
133
|
+
<span v-if="showText" class="button-text">{{ $t("restore") }}</span>
|
|
134
|
+
<b-tooltip
|
|
135
|
+
v-else
|
|
136
|
+
:delay="tooltipDelay"
|
|
137
|
+
position="is-left"
|
|
138
|
+
:label="$t('restore')"
|
|
139
|
+
>
|
|
140
|
+
<b-icon
|
|
141
|
+
icon="trash-arrow-up"
|
|
142
|
+
class="center-icon button-icon restore-icon"
|
|
143
|
+
/>
|
|
101
144
|
</b-tooltip>
|
|
102
145
|
</b-button>
|
|
146
|
+
|
|
147
|
+
<!-- cancel button -->
|
|
148
|
+
<b-button
|
|
149
|
+
v-if="showCancel"
|
|
150
|
+
class="button-action is-button-icon"
|
|
151
|
+
:title="$t('cancel')"
|
|
152
|
+
type="is-ghost"
|
|
153
|
+
@click.stop="cancel"
|
|
154
|
+
>
|
|
155
|
+
<b-icon icon="xmark" class="cancel-icon center-icon button-icon" />
|
|
156
|
+
</b-button>
|
|
157
|
+
|
|
158
|
+
<!-- loading -->
|
|
159
|
+
<b-icon v-if="isLoading" icon="spinner" class="fa-spin spinner-icon" />
|
|
103
160
|
</div>
|
|
104
161
|
</template>
|
|
105
162
|
<script>
|
|
106
163
|
/* Component for showing actions for each annotation row */
|
|
107
164
|
import { mapGetters, mapState } from "vuex";
|
|
108
|
-
import AcceptedCheckMark from "../../assets/images/AcceptedCheckMark";
|
|
109
165
|
import { TEXT_BREAKPOINT_WIDTH } from "../../constants";
|
|
110
166
|
export default {
|
|
111
167
|
name: "AnnotationActionButtons",
|
|
112
|
-
components: {
|
|
113
|
-
AcceptedCheckMark,
|
|
114
|
-
},
|
|
115
168
|
props: {
|
|
116
169
|
annotation: {
|
|
117
170
|
type: Object,
|
|
118
171
|
default: null,
|
|
119
172
|
},
|
|
120
|
-
|
|
173
|
+
label: {
|
|
174
|
+
type: Object,
|
|
175
|
+
default: null,
|
|
176
|
+
},
|
|
177
|
+
isLoading: {
|
|
121
178
|
type: Boolean,
|
|
122
179
|
},
|
|
123
|
-
|
|
180
|
+
showSave: {
|
|
124
181
|
type: Boolean,
|
|
125
182
|
},
|
|
126
|
-
|
|
183
|
+
showCancel: {
|
|
127
184
|
type: Boolean,
|
|
128
185
|
},
|
|
129
|
-
|
|
186
|
+
showMissing: {
|
|
130
187
|
type: Boolean,
|
|
131
188
|
},
|
|
132
|
-
|
|
189
|
+
showAccept: {
|
|
133
190
|
type: Boolean,
|
|
134
191
|
},
|
|
135
|
-
|
|
192
|
+
showDecline: {
|
|
136
193
|
type: Boolean,
|
|
137
194
|
},
|
|
138
|
-
|
|
195
|
+
showRestore: {
|
|
139
196
|
type: Boolean,
|
|
140
|
-
required: false,
|
|
141
197
|
},
|
|
142
|
-
|
|
198
|
+
showLink: {
|
|
143
199
|
type: Boolean,
|
|
144
|
-
required: false,
|
|
145
200
|
},
|
|
146
|
-
|
|
201
|
+
showSearch: {
|
|
147
202
|
type: Boolean,
|
|
148
|
-
required: false,
|
|
149
203
|
},
|
|
150
204
|
},
|
|
151
205
|
data() {
|
|
152
206
|
return {
|
|
207
|
+
tooltipDelay: 700,
|
|
153
208
|
showText:
|
|
154
209
|
window.innerWidth >
|
|
155
210
|
TEXT_BREAKPOINT_WIDTH(this.$i18n ? this.$i18n.locale : "en"),
|
|
156
211
|
};
|
|
157
212
|
},
|
|
158
213
|
computed: {
|
|
159
|
-
...mapState("document", ["publicView"
|
|
214
|
+
...mapState("document", ["publicView"]),
|
|
160
215
|
...mapGetters("document", ["isDocumentReviewed"]),
|
|
161
216
|
showHoverButton() {
|
|
162
217
|
return (
|
|
@@ -176,21 +231,13 @@ export default {
|
|
|
176
231
|
window.removeEventListener("resize", this.resize);
|
|
177
232
|
},
|
|
178
233
|
methods: {
|
|
179
|
-
copyAnnotationLink(event) {
|
|
180
|
-
if (this.annotation) {
|
|
181
|
-
event.stopPropagation();
|
|
182
|
-
this.$store.dispatch("document/setAnnotationId", this.annotation.id);
|
|
183
|
-
navigator.clipboard.writeText(window.location.href);
|
|
184
|
-
this.$buefy.toast.open({
|
|
185
|
-
container: "#app .dv-ui-app-container",
|
|
186
|
-
message: this.$t("copied"),
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
234
|
resize() {
|
|
191
235
|
this.showText =
|
|
192
236
|
window.innerWidth > TEXT_BREAKPOINT_WIDTH(this.$i18n.locale);
|
|
193
237
|
},
|
|
238
|
+
search() {
|
|
239
|
+
this.$emit("search");
|
|
240
|
+
},
|
|
194
241
|
save() {
|
|
195
242
|
this.$emit("save");
|
|
196
243
|
},
|
|
@@ -209,8 +256,8 @@ export default {
|
|
|
209
256
|
restore() {
|
|
210
257
|
this.$emit("restore");
|
|
211
258
|
},
|
|
212
|
-
|
|
213
|
-
this.$emit("
|
|
259
|
+
link() {
|
|
260
|
+
this.$emit("link");
|
|
214
261
|
},
|
|
215
262
|
},
|
|
216
263
|
};
|
|
@@ -219,5 +266,5 @@ export default {
|
|
|
219
266
|
<style
|
|
220
267
|
scoped
|
|
221
268
|
lang="scss"
|
|
222
|
-
src="../../assets/scss/
|
|
269
|
+
src="../../assets/scss/annotation_action_buttons.scss"
|
|
223
270
|
></style>
|
|
@@ -13,8 +13,21 @@
|
|
|
13
13
|
@mouseover="hoveredAnnotation = currentAnnotationId()"
|
|
14
14
|
@mouseleave="hoveredAnnotation = null"
|
|
15
15
|
>
|
|
16
|
+
<div class="annotations-width-slider">
|
|
17
|
+
<b-slider
|
|
18
|
+
:value="labelWidth"
|
|
19
|
+
type="is-move"
|
|
20
|
+
:min="20"
|
|
21
|
+
:max="80"
|
|
22
|
+
:custom-formatter="(val) => `${$t('label_size')} ${val}%`"
|
|
23
|
+
class="is-full-height show-hover show-line"
|
|
24
|
+
:disabled="isAnnotationInEditMode()"
|
|
25
|
+
@input="setLabelWidth"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
16
28
|
<div
|
|
17
29
|
class="annotation-row-left"
|
|
30
|
+
:style="`width:${labelWidth}%`"
|
|
18
31
|
@mouseenter="onAnnotationHoverEnter(defaultSpan)"
|
|
19
32
|
@mouseleave="onAnnotationHoverLeave"
|
|
20
33
|
>
|
|
@@ -82,7 +95,8 @@
|
|
|
82
95
|
</b-tooltip>
|
|
83
96
|
</div>
|
|
84
97
|
</div>
|
|
85
|
-
|
|
98
|
+
|
|
99
|
+
<div class="annotation-row-right" :style="`width:${annotationWidth}%`">
|
|
86
100
|
<div class="annotation-content">
|
|
87
101
|
<div v-if="annotation" class="annotation-items">
|
|
88
102
|
<b-checkbox
|
|
@@ -144,16 +158,22 @@
|
|
|
144
158
|
/>
|
|
145
159
|
</div>
|
|
146
160
|
</div>
|
|
147
|
-
<div
|
|
161
|
+
<div
|
|
162
|
+
v-if="showAnnotationActions()"
|
|
163
|
+
:class="`buttons-container ${
|
|
164
|
+
isAnnotationInEditMode(currentAnnotationId()) ? 'is-ann-editing' : ''
|
|
165
|
+
}`"
|
|
166
|
+
>
|
|
148
167
|
<AnnotationActionButtons
|
|
149
168
|
:annotation="annotation"
|
|
150
|
-
:cancel
|
|
151
|
-
:accept
|
|
152
|
-
:decline
|
|
153
|
-
:show-missing
|
|
154
|
-
:
|
|
155
|
-
:
|
|
156
|
-
:
|
|
169
|
+
:show-cancel="showCancelButton()"
|
|
170
|
+
:show-accept="showAcceptButton()"
|
|
171
|
+
:show-decline="showDeclineButton()"
|
|
172
|
+
:show-missing="showMissingButton()"
|
|
173
|
+
:show-search="showMissingButton()"
|
|
174
|
+
:show-save="showSaveButton()"
|
|
175
|
+
:show-restore="showRestoreButton()"
|
|
176
|
+
:show-link="showLinkButton()"
|
|
157
177
|
:is-loading="isLoading"
|
|
158
178
|
@mark-as-missing="handleMissingAnnotation"
|
|
159
179
|
@save="handleSaveChanges"
|
|
@@ -161,14 +181,15 @@
|
|
|
161
181
|
@decline="handleSaveChanges(true)"
|
|
162
182
|
@cancel="handleCancelButton"
|
|
163
183
|
@restore="handleRestore"
|
|
164
|
-
@search
|
|
184
|
+
@search="searchLabelInDocument"
|
|
185
|
+
@link="copyAnnotationLink"
|
|
165
186
|
/>
|
|
166
187
|
</div>
|
|
167
188
|
</div>
|
|
168
189
|
</div>
|
|
169
190
|
</template>
|
|
170
191
|
<script>
|
|
171
|
-
import { mapGetters, mapState } from "vuex";
|
|
192
|
+
import { mapActions, mapGetters, mapState } from "vuex";
|
|
172
193
|
import AnnotationDetails from "./AnnotationDetails";
|
|
173
194
|
import AnnotationContent from "./AnnotationContent";
|
|
174
195
|
import EmptyAnnotation from "./EmptyAnnotation";
|
|
@@ -243,6 +264,7 @@ export default {
|
|
|
243
264
|
"elementSelected",
|
|
244
265
|
"selectedEntities",
|
|
245
266
|
]),
|
|
267
|
+
...mapState("display", ["labelWidth", "annotationWidth"]),
|
|
246
268
|
...mapState("project", ["showAnnotationTranslations"]),
|
|
247
269
|
...mapGetters("document", [
|
|
248
270
|
"isAnnotationInEditMode",
|
|
@@ -363,6 +385,7 @@ export default {
|
|
|
363
385
|
this.checkAnnotationSelection(this.annotationId);
|
|
364
386
|
},
|
|
365
387
|
methods: {
|
|
388
|
+
...mapActions("display", ["setLabelWidth"]),
|
|
366
389
|
handleCheckboxChanged(value) {
|
|
367
390
|
this.$store
|
|
368
391
|
.dispatch("document/updateAnnotation", {
|
|
@@ -475,6 +498,20 @@ export default {
|
|
|
475
498
|
return null;
|
|
476
499
|
}
|
|
477
500
|
},
|
|
501
|
+
showAnnotationActions() {
|
|
502
|
+
return (
|
|
503
|
+
!this.publicView &&
|
|
504
|
+
!this.isDocumentReviewed &&
|
|
505
|
+
(this.isLoading ||
|
|
506
|
+
this.showLinkButton() ||
|
|
507
|
+
this.showAcceptButton() ||
|
|
508
|
+
this.showDeclineButton() ||
|
|
509
|
+
this.showMissingButton() ||
|
|
510
|
+
this.showCancelButton() ||
|
|
511
|
+
this.showSaveButton() ||
|
|
512
|
+
this.showRestoreButton())
|
|
513
|
+
);
|
|
514
|
+
},
|
|
478
515
|
showLinkButton() {
|
|
479
516
|
return (
|
|
480
517
|
!this.editAnnotation &&
|
|
@@ -512,18 +549,19 @@ export default {
|
|
|
512
549
|
return (
|
|
513
550
|
!this.editAnnotation &&
|
|
514
551
|
this.hoveredAnnotation &&
|
|
552
|
+
!this.isLoading &&
|
|
515
553
|
!this.isAnnotationInEditMode(this.currentAnnotationId()) &&
|
|
516
554
|
this.annotationIsNotFound(this.annotationSet, this.label)
|
|
517
555
|
);
|
|
518
556
|
},
|
|
519
557
|
showCancelButton() {
|
|
520
|
-
if (!this.editAnnotation || this.isLoading)
|
|
521
|
-
|
|
522
|
-
return true;
|
|
558
|
+
if (!this.editAnnotation || this.isLoading) {
|
|
559
|
+
return false;
|
|
523
560
|
}
|
|
561
|
+
return this.isAnnotationInEditMode(this.currentAnnotationId());
|
|
524
562
|
},
|
|
525
563
|
showSaveButton() {
|
|
526
|
-
if (!this.editAnnotation || this.isLoading) return;
|
|
564
|
+
if (!this.editAnnotation || this.isLoading) return false;
|
|
527
565
|
|
|
528
566
|
// Check if it's an Annotation or Empty Annotation
|
|
529
567
|
if (this.isAnnotation) {
|
|
@@ -590,7 +628,7 @@ export default {
|
|
|
590
628
|
if (showAiWarning) {
|
|
591
629
|
this.$buefy.dialog.confirm({
|
|
592
630
|
container: "#app .dv-ui-app-container",
|
|
593
|
-
canCancel: "button",
|
|
631
|
+
canCancel: ["button"],
|
|
594
632
|
message: this.$t("edit_ann_content_warning"),
|
|
595
633
|
onConfirm: () => this.saveAnnotationChanges(spans, decline),
|
|
596
634
|
onCancel: () => this.handleCancelButton(),
|
|
@@ -632,7 +670,9 @@ export default {
|
|
|
632
670
|
saveAnnotationChanges(spans, isToDecline) {
|
|
633
671
|
// This function deals with declining Annotations
|
|
634
672
|
// or editing an Annotation or a part of it (if multi line)
|
|
635
|
-
|
|
673
|
+
setTimeout(() => {
|
|
674
|
+
this.isLoading = true;
|
|
675
|
+
}, 100);
|
|
636
676
|
|
|
637
677
|
let updatedString; // what will be sent to the API
|
|
638
678
|
let storeAction; // if it will be 'delete' or 'patch'
|
|
@@ -719,6 +759,7 @@ export default {
|
|
|
719
759
|
this.$store.dispatch("selection/disableSelection");
|
|
720
760
|
this.$store.dispatch("selection/setSelectedEntities", null);
|
|
721
761
|
}
|
|
762
|
+
this.isLoading = false;
|
|
722
763
|
},
|
|
723
764
|
enableLoading(annotations) {
|
|
724
765
|
if (annotations && this.annotation && !this.annotation.is_correct) {
|
|
@@ -778,8 +819,20 @@ export default {
|
|
|
778
819
|
window.open(annotationDetailsUrl, "_blank");
|
|
779
820
|
},
|
|
780
821
|
searchLabelInDocument() {
|
|
781
|
-
this
|
|
782
|
-
|
|
822
|
+
if (this.label) {
|
|
823
|
+
this.$store.dispatch("display/enableSearch", true);
|
|
824
|
+
this.$store.dispatch("display/setCurrentSearch", this.label.name);
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
copyAnnotationLink() {
|
|
828
|
+
if (this.annotation) {
|
|
829
|
+
this.$store.dispatch("document/setAnnotationId", this.annotation.id);
|
|
830
|
+
navigator.clipboard.writeText(window.location.href);
|
|
831
|
+
this.$buefy.toast.open({
|
|
832
|
+
container: "#app .dv-ui-app-container",
|
|
833
|
+
message: this.$t("copied"),
|
|
834
|
+
});
|
|
835
|
+
}
|
|
783
836
|
},
|
|
784
837
|
selectAnnotation(event) {
|
|
785
838
|
event.stopPropagation();
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
>
|
|
9
9
|
<b-button
|
|
10
10
|
type="is-ghost"
|
|
11
|
-
class="
|
|
11
|
+
class="button-action is-button-text-ghost"
|
|
12
12
|
:disabled="numberOfEmptyLabelsInAnnotationSet === 0"
|
|
13
13
|
@click="markAllAsMissing"
|
|
14
14
|
>
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
@mouseleave="mouseleaveAnnotationSet"
|
|
26
26
|
>
|
|
27
27
|
<b-button
|
|
28
|
-
type="is-
|
|
29
|
-
class="accept-all-
|
|
28
|
+
type="is-ghost"
|
|
29
|
+
class="button-action is-button-text-ghost accept-all-icon"
|
|
30
30
|
:disabled="numberOfNotCorrectAnnotationsInAnnotationSet === 0"
|
|
31
31
|
@click="acceptAllPending"
|
|
32
32
|
>
|
|
@@ -95,5 +95,5 @@ export default {
|
|
|
95
95
|
<style
|
|
96
96
|
scoped
|
|
97
97
|
lang="scss"
|
|
98
|
-
src="../../assets/scss/
|
|
98
|
+
src="../../assets/scss/annotation_action_buttons.scss"
|
|
99
99
|
></style>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<EmptyState />
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
|
-
<div v-else ref="annotationList"
|
|
31
|
+
<div v-else ref="annotationList" class="annotation-set-list">
|
|
32
32
|
<AnnotationFilters
|
|
33
33
|
v-if="isDocumentEditable"
|
|
34
34
|
@openAll="openAllAccordions"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
>
|
|
44
44
|
<EmptyState :is-search="true" />
|
|
45
45
|
</div>
|
|
46
|
-
<div v-if="annotationSetsAccordion">
|
|
46
|
+
<div v-if="annotationSetsAccordion" class="annotation-sets-accordions">
|
|
47
47
|
<div
|
|
48
48
|
v-for="(
|
|
49
49
|
annotationSet, indexGroup
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
:key="indexGroup"
|
|
52
52
|
:class="[
|
|
53
53
|
'annotation-set-group',
|
|
54
|
+
indexGroup === 0 && 'no-top-margin',
|
|
54
55
|
!isAccordionOpen(annotationSet) && 'annotation-set-collapsed',
|
|
55
56
|
]"
|
|
56
57
|
>
|
|
@@ -105,7 +106,10 @@
|
|
|
105
106
|
</div>
|
|
106
107
|
|
|
107
108
|
<b-collapse :open="isAccordionOpen(annotationSet)">
|
|
108
|
-
<div
|
|
109
|
+
<div
|
|
110
|
+
v-if="annotationSet.labels.length > 0"
|
|
111
|
+
class="annotation-sets-list"
|
|
112
|
+
>
|
|
109
113
|
<div v-for="label in annotationSet.labels" :key="label.id">
|
|
110
114
|
<div
|
|
111
115
|
v-if="!(label.annotations.length === 0 && publicView)"
|