@konfuzio/document-validation-ui 0.1.55-dev.1 → 0.1.56-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/dist/js/chunk-vendors.js +23 -66
- package/dist/js/chunk-vendors.js.map +1 -1
- package/jest.config.js +2 -22
- package/package.json +37 -31
- package/src/assets/scss/ann_set_table_options.scss +4 -4
- package/src/assets/scss/annotation_action_buttons.scss +7 -7
- package/src/assets/scss/annotation_details.scss +9 -9
- package/src/assets/scss/choose_label_set_modal.scss +5 -5
- package/src/assets/scss/document_action_bar.scss +3 -3
- package/src/assets/scss/document_annotations.scss +38 -40
- package/src/assets/scss/document_category.scss +8 -8
- package/src/assets/scss/document_dashboard.scss +1 -1
- package/src/assets/scss/document_edit.scss +28 -29
- package/src/assets/scss/document_error.scss +6 -6
- package/src/assets/scss/document_name.scss +6 -6
- package/src/assets/scss/document_page.scss +3 -3
- package/src/assets/scss/document_search_bar.scss +7 -7
- package/src/assets/scss/document_set_chooser.scss +3 -2
- package/src/assets/scss/document_thumbnails.scss +7 -7
- package/src/assets/scss/document_toolbar.scss +10 -10
- package/src/assets/scss/document_top_bar.scss +21 -10
- package/src/assets/scss/document_viewport_modal.scss +3 -3
- package/src/assets/scss/documents_list.scss +12 -11
- package/src/assets/scss/edit_page_thumbnail.scss +6 -6
- package/src/assets/scss/empty_state.scss +4 -4
- package/src/assets/scss/error_page.scss +2 -2
- package/src/assets/scss/extracting_data.scss +3 -3
- package/src/assets/scss/imports.scss +1 -0
- package/src/assets/scss/multi_ann_table_overlay.scss +3 -3
- package/src/assets/scss/multi_ann_table_popup.scss +1 -1
- package/src/assets/scss/new_annotation.scss +14 -21
- package/src/assets/scss/scrolling_document.scss +1 -1
- package/src/assets/scss/theme.scss +52 -63
- package/src/assets/scss/variables.scss +0 -2
- package/src/components/App.vue +28 -9
- package/src/components/DocumentAnnotations/AnnotationActionButtons.vue +5 -2
- package/src/components/DocumentAnnotations/AnnotationRow.vue +2 -9
- package/src/components/DocumentAnnotations/ChooseLabelSetModal.vue +8 -2
- package/src/components/DocumentAnnotations/DocumentAnnotations.vue +10 -11
- package/src/components/DocumentDashboard.vue +16 -11
- package/src/components/DocumentEdit/EditPages.vue +48 -48
- package/src/components/DocumentModals/DocumentErrorModal.vue +5 -0
- package/src/components/DocumentPage/DocumentPage.vue +15 -5
- package/src/components/DocumentPage/EditAnnotation.vue +23 -14
- package/src/components/DocumentPage/NewAnnotation.vue +27 -27
- package/src/components/DocumentTopBar/DocumentTopBar.vue +13 -1
- package/src/components/DocumentsList/DocumentsList.vue +2 -1
- package/src/components/ErrorMessage.vue +6 -1
- package/src/constants.js +7 -1
- package/src/i18n.js +5 -2
- package/src/locales/de.json +5 -2
- package/src/locales/en.json +5 -2
- package/src/locales/es.json +5 -2
- package/src/main.js +16 -13
- package/src/store/display.js +30 -33
- package/src/store/index.js +8 -5
|
@@ -205,7 +205,9 @@ export default {
|
|
|
205
205
|
data() {
|
|
206
206
|
return {
|
|
207
207
|
tooltipDelay: 700,
|
|
208
|
-
showText:
|
|
208
|
+
showText:
|
|
209
|
+
window.innerWidth >
|
|
210
|
+
TEXT_BREAKPOINT_WIDTH(this.$i18n ? this.$i18n.locale : "en"),
|
|
209
211
|
};
|
|
210
212
|
},
|
|
211
213
|
computed: {
|
|
@@ -230,7 +232,8 @@ export default {
|
|
|
230
232
|
},
|
|
231
233
|
methods: {
|
|
232
234
|
resize() {
|
|
233
|
-
this.showText =
|
|
235
|
+
this.showText =
|
|
236
|
+
window.innerWidth > TEXT_BREAKPOINT_WIDTH(this.$i18n.locale);
|
|
234
237
|
},
|
|
235
238
|
search() {
|
|
236
239
|
this.$emit("search");
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
>
|
|
16
16
|
<div class="annotations-width-slider">
|
|
17
17
|
<b-slider
|
|
18
|
-
|
|
18
|
+
:value="labelWidth"
|
|
19
19
|
type="is-move"
|
|
20
20
|
:min="20"
|
|
21
21
|
:max="80"
|
|
22
22
|
:custom-formatter="(val) => `${$t('label_size')} ${val}%`"
|
|
23
23
|
class="is-full-height show-hover show-line"
|
|
24
24
|
:disabled="isAnnotationInEditMode()"
|
|
25
|
+
@input="setLabelWidth"
|
|
25
26
|
/>
|
|
26
27
|
</div>
|
|
27
28
|
<div
|
|
@@ -243,7 +244,6 @@ export default {
|
|
|
243
244
|
checkboxDefaultValue: checkboxValue,
|
|
244
245
|
isCheckboxAvailable: false,
|
|
245
246
|
isChecked: checkboxValue,
|
|
246
|
-
labelContainerWidth: 0,
|
|
247
247
|
};
|
|
248
248
|
},
|
|
249
249
|
computed: {
|
|
@@ -319,12 +319,6 @@ export default {
|
|
|
319
319
|
},
|
|
320
320
|
},
|
|
321
321
|
watch: {
|
|
322
|
-
labelWidth(width) {
|
|
323
|
-
this.labelContainerWidth = width;
|
|
324
|
-
},
|
|
325
|
-
labelContainerWidth(width) {
|
|
326
|
-
this.setLabelWidth(width);
|
|
327
|
-
},
|
|
328
322
|
annotationId(newAnnotationId) {
|
|
329
323
|
this.checkAnnotationSelection(newAnnotationId);
|
|
330
324
|
},
|
|
@@ -389,7 +383,6 @@ export default {
|
|
|
389
383
|
},
|
|
390
384
|
mounted() {
|
|
391
385
|
this.checkAnnotationSelection(this.annotationId);
|
|
392
|
-
this.labelContainerWidth = this.labelWidth;
|
|
393
386
|
},
|
|
394
387
|
methods: {
|
|
395
388
|
...mapActions("display", ["setLabelWidth"]),
|
|
@@ -15,7 +15,12 @@
|
|
|
15
15
|
</h3>
|
|
16
16
|
<div>
|
|
17
17
|
<div v-if="labelSetsFilteredForAnnotationSetCreation.length === 0">
|
|
18
|
-
<p
|
|
18
|
+
<p
|
|
19
|
+
v-html="
|
|
20
|
+
`${$t('no_multi_ann_labelset_model')}
|
|
21
|
+
${showBranding ? $t('no_multi_ann_labelset_model_link') : ''}`
|
|
22
|
+
"
|
|
23
|
+
/>
|
|
19
24
|
</div>
|
|
20
25
|
<div v-else>
|
|
21
26
|
<p>
|
|
@@ -68,7 +73,7 @@
|
|
|
68
73
|
* This component shows a modal to choose a label set from the project
|
|
69
74
|
*/
|
|
70
75
|
|
|
71
|
-
import { mapGetters } from "vuex";
|
|
76
|
+
import { mapGetters, mapState } from "vuex";
|
|
72
77
|
|
|
73
78
|
export default {
|
|
74
79
|
name: "CreateAnnotationSetModal",
|
|
@@ -78,6 +83,7 @@ export default {
|
|
|
78
83
|
};
|
|
79
84
|
},
|
|
80
85
|
computed: {
|
|
86
|
+
...mapState("display", ["showBranding"]),
|
|
81
87
|
...mapGetters("document", [
|
|
82
88
|
"numberOfLabelSetGroup",
|
|
83
89
|
"labelSetsFilteredForAnnotationSetCreation",
|
|
@@ -105,10 +105,7 @@
|
|
|
105
105
|
</div>
|
|
106
106
|
</div>
|
|
107
107
|
|
|
108
|
-
<b-collapse
|
|
109
|
-
:model-value="isAccordionOpen(annotationSet)"
|
|
110
|
-
animation="slide"
|
|
111
|
-
>
|
|
108
|
+
<b-collapse :open="isAccordionOpen(annotationSet)">
|
|
112
109
|
<div
|
|
113
110
|
v-if="annotationSet.labels.length > 0"
|
|
114
111
|
class="annotation-sets-list"
|
|
@@ -142,7 +139,11 @@
|
|
|
142
139
|
>
|
|
143
140
|
<!-- eslint-disable vue/no-v-html -->
|
|
144
141
|
<span
|
|
145
|
-
v-if="
|
|
142
|
+
v-if="
|
|
143
|
+
showBranding &&
|
|
144
|
+
isDocumentEditable &&
|
|
145
|
+
!isSearchingAnnotationList
|
|
146
|
+
"
|
|
146
147
|
v-html="$t('link_to_add_labels')"
|
|
147
148
|
/>
|
|
148
149
|
</div>
|
|
@@ -192,7 +193,7 @@ export default {
|
|
|
192
193
|
},
|
|
193
194
|
|
|
194
195
|
computed: {
|
|
195
|
-
...mapState("display", ["showAnnSetTable"]),
|
|
196
|
+
...mapState("display", ["showAnnSetTable", "showBranding"]),
|
|
196
197
|
...mapState("document", [
|
|
197
198
|
"annotationSets",
|
|
198
199
|
"documentId",
|
|
@@ -403,11 +404,9 @@ export default {
|
|
|
403
404
|
},
|
|
404
405
|
|
|
405
406
|
createArray(className) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
);
|
|
410
|
-
}
|
|
407
|
+
return Array.from(
|
|
408
|
+
this.$refs.annotationList.getElementsByClassName(className)
|
|
409
|
+
);
|
|
411
410
|
},
|
|
412
411
|
|
|
413
412
|
keyDownHandler(event) {
|
|
@@ -3,19 +3,24 @@
|
|
|
3
3
|
<DocumentTopBar />
|
|
4
4
|
<div :class="['dashboard-viewer', renameAndCategorize ? 'edit-mode' : '']">
|
|
5
5
|
<DocumentThumbnails v-if="!editMode" ref="documentPages" />
|
|
6
|
-
<
|
|
7
|
-
<
|
|
6
|
+
<Split>
|
|
7
|
+
<SplitArea :size="50" :min-size="350">
|
|
8
8
|
<ScrollingDocument
|
|
9
9
|
ref="scrollingDocument"
|
|
10
10
|
class="dashboard-document"
|
|
11
11
|
/>
|
|
12
|
-
</
|
|
13
|
-
<
|
|
12
|
+
</SplitArea>
|
|
13
|
+
<SplitArea :size="50" style="overflow-y: auto">
|
|
14
14
|
<DocumentAnnotations v-if="!editMode" ref="annotations" />
|
|
15
15
|
<DocumentEdit v-else ref="editView" />
|
|
16
|
-
</
|
|
17
|
-
</
|
|
16
|
+
</SplitArea>
|
|
17
|
+
</Split>
|
|
18
18
|
|
|
19
|
+
<MultiAnnotationTableOverlay
|
|
20
|
+
v-if="showAnnSetTable"
|
|
21
|
+
:left="documentContainerLeftPadding"
|
|
22
|
+
:width="documentContainerWidth"
|
|
23
|
+
/>
|
|
19
24
|
<ChooseLabelSetModal
|
|
20
25
|
v-if="showChooseLabelSetModal && showChooseLabelSetModal.show"
|
|
21
26
|
:is-multiple-annotations="showChooseLabelSetModal.isMultipleAnnotations"
|
|
@@ -54,15 +59,16 @@ import { mapGetters, mapState } from "vuex";
|
|
|
54
59
|
import { DocumentTopBar } from "./DocumentTopBar";
|
|
55
60
|
import { ScrollingDocument } from "./DocumentPage";
|
|
56
61
|
import { DocumentThumbnails } from "./DocumentThumbnails";
|
|
57
|
-
import {
|
|
62
|
+
import {
|
|
63
|
+
DocumentAnnotations,
|
|
64
|
+
MultiAnnotationTableOverlay,
|
|
65
|
+
} from "./DocumentAnnotations";
|
|
58
66
|
import { DocumentEdit } from "./DocumentEdit";
|
|
59
67
|
import ErrorMessage from "./ErrorMessage";
|
|
60
68
|
import NotOptimizedViewportModal from "../components/DocumentModals/NotOptimizedViewportModal";
|
|
61
69
|
import AnnotationDeletedModal from "../components/DocumentModals/AnnotationDeletedModal";
|
|
62
70
|
import DocumentErrorModal from "../components/DocumentModals/DocumentErrorModal";
|
|
63
71
|
import ChooseLabelSetModal from "../components/DocumentAnnotations/ChooseLabelSetModal";
|
|
64
|
-
import { Splitpanes, Pane } from "splitpanes";
|
|
65
|
-
import "splitpanes/dist/splitpanes.css";
|
|
66
72
|
|
|
67
73
|
/**
|
|
68
74
|
* This component shows the PDF pages in a scrolling component and
|
|
@@ -71,8 +77,6 @@ import "splitpanes/dist/splitpanes.css";
|
|
|
71
77
|
export default {
|
|
72
78
|
name: "DocumentDashboard",
|
|
73
79
|
components: {
|
|
74
|
-
Splitpanes,
|
|
75
|
-
Pane,
|
|
76
80
|
DocumentTopBar,
|
|
77
81
|
ScrollingDocument,
|
|
78
82
|
DocumentThumbnails,
|
|
@@ -81,6 +85,7 @@ export default {
|
|
|
81
85
|
ErrorMessage,
|
|
82
86
|
NotOptimizedViewportModal,
|
|
83
87
|
DocumentErrorModal,
|
|
88
|
+
MultiAnnotationTableOverlay,
|
|
84
89
|
ChooseLabelSetModal,
|
|
85
90
|
AnnotationDeletedModal,
|
|
86
91
|
},
|
|
@@ -7,64 +7,60 @@
|
|
|
7
7
|
v-model="editPages"
|
|
8
8
|
class="document-grid"
|
|
9
9
|
easing="cubic-bezier(0.37, 0, 0.63, 1)"
|
|
10
|
-
item-key="id"
|
|
11
|
-
:move="checkMove"
|
|
12
10
|
@start="dragging = true"
|
|
13
11
|
@end="handleDragEnd"
|
|
12
|
+
@move="checkMove"
|
|
14
13
|
>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
>
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
<div
|
|
15
|
+
v-for="(page, index) in editPages"
|
|
16
|
+
:key="page.id"
|
|
17
|
+
class="image-section"
|
|
18
|
+
tabindex="0"
|
|
19
|
+
>
|
|
20
|
+
<div class="top-section">
|
|
21
|
+
<EditPageThumbnail
|
|
22
|
+
:page="page"
|
|
23
|
+
:index="index"
|
|
24
|
+
:rotation="getRotation(page.id)"
|
|
25
|
+
/>
|
|
26
|
+
<div
|
|
27
|
+
:class="[
|
|
28
|
+
'splitting-lines',
|
|
29
|
+
splittingLines &&
|
|
30
|
+
splittingLines[index].page === page.number &&
|
|
31
|
+
'active-split',
|
|
32
|
+
]"
|
|
33
|
+
@click="handleSplittingLines(page.number, 'manual')"
|
|
34
|
+
>
|
|
35
|
+
<div class="scissors-icon">
|
|
36
|
+
<b-icon icon="scissors" class="is-small" />
|
|
37
|
+
</div>
|
|
28
38
|
<div
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'active-split',
|
|
34
|
-
]"
|
|
35
|
-
@click="handleSplittingLines(element.number, 'manual')"
|
|
39
|
+
v-if="
|
|
40
|
+
splittingLines && splittingLines[index].page === page.number
|
|
41
|
+
"
|
|
42
|
+
class="lines active-split"
|
|
36
43
|
>
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
</div>
|
|
40
|
-
<div
|
|
41
|
-
v-if="
|
|
44
|
+
<SplitZigZag
|
|
45
|
+
:color="
|
|
42
46
|
splittingLines &&
|
|
43
|
-
splittingLines[index].
|
|
47
|
+
splittingLines[index].origin &&
|
|
48
|
+
splittingLines[index].origin === 'AI' &&
|
|
49
|
+
splitSuggestionsEnabled
|
|
50
|
+
? 'green'
|
|
51
|
+
: 'dark'
|
|
44
52
|
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
splittingLines &&
|
|
50
|
-
splittingLines[index].origin &&
|
|
51
|
-
splittingLines[index].origin === 'AI' &&
|
|
52
|
-
splitSuggestionsEnabled
|
|
53
|
-
? 'green'
|
|
54
|
-
: 'dark'
|
|
55
|
-
"
|
|
56
|
-
/>
|
|
57
|
-
</div>
|
|
58
|
-
<div v-else class="lines not-active-split">
|
|
59
|
-
<SplitLines />
|
|
60
|
-
</div>
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
<div v-else class="lines not-active-split">
|
|
56
|
+
<SplitLines />
|
|
61
57
|
</div>
|
|
62
|
-
</div>
|
|
63
|
-
<div class="bottom-section">
|
|
64
|
-
<span class="page-number">{{ element.number }}</span>
|
|
65
58
|
</div>
|
|
66
59
|
</div>
|
|
67
|
-
|
|
60
|
+
<div class="bottom-section">
|
|
61
|
+
<span class="page-number">{{ page.number }}</span>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
68
64
|
</draggable>
|
|
69
65
|
</div>
|
|
70
66
|
</template>
|
|
@@ -79,6 +75,7 @@ import { mapState } from "vuex";
|
|
|
79
75
|
import SplitLines from "../../assets/images/SplitLines";
|
|
80
76
|
import SplitZigZag from "../../assets/images/SplitZigZag";
|
|
81
77
|
import EditPageThumbnail from "./EditPageThumbnail";
|
|
78
|
+
|
|
82
79
|
import draggable from "vuedraggable";
|
|
83
80
|
|
|
84
81
|
export default {
|
|
@@ -135,6 +132,9 @@ export default {
|
|
|
135
132
|
}
|
|
136
133
|
},
|
|
137
134
|
},
|
|
135
|
+
mounted() {
|
|
136
|
+
this.editPages = this.pagesForPostprocess;
|
|
137
|
+
},
|
|
138
138
|
methods: {
|
|
139
139
|
deselect() {
|
|
140
140
|
this.$store.dispatch("edit/setSelectedPages");
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
</section>
|
|
20
20
|
<footer class="modal-card-foot">
|
|
21
21
|
<b-button
|
|
22
|
+
v-if="showBranding"
|
|
22
23
|
type="is-primary"
|
|
23
24
|
class="primary-button"
|
|
24
25
|
@click="handleContactSupport"
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
</template>
|
|
32
33
|
|
|
33
34
|
<script>
|
|
35
|
+
import { mapState } from "vuex";
|
|
34
36
|
import ErrorIcon from "../../assets/images/ErrorIcon";
|
|
35
37
|
|
|
36
38
|
export default {
|
|
@@ -43,6 +45,9 @@ export default {
|
|
|
43
45
|
isModalActive: true,
|
|
44
46
|
};
|
|
45
47
|
},
|
|
48
|
+
computed: {
|
|
49
|
+
...mapState("display", ["showBranding"]),
|
|
50
|
+
},
|
|
46
51
|
methods: {
|
|
47
52
|
handleContactSupport() {
|
|
48
53
|
const documentError = "Document error";
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
(bbox) => bbox.page_index + 1 == page.number
|
|
87
87
|
)"
|
|
88
88
|
>
|
|
89
|
-
<v-group>
|
|
89
|
+
<v-group :key="'ann' + annotation.id + '-' + index">
|
|
90
90
|
<v-rect
|
|
91
91
|
v-if="!isAnnotationInEditMode(annotation.id)"
|
|
92
92
|
:config="annotationRect(bbox, annotation.id)"
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
<template
|
|
100
100
|
v-if="annotation.metadata && annotation.metadata.checkbox"
|
|
101
101
|
>
|
|
102
|
-
<v-group>
|
|
102
|
+
<v-group :key="'ann' + annotation.id + '-checkbox'">
|
|
103
103
|
<v-rect
|
|
104
104
|
v-if="!isAnnotationInEditMode(annotation.id)"
|
|
105
105
|
:config="
|
|
@@ -303,13 +303,11 @@ export default {
|
|
|
303
303
|
scale() {
|
|
304
304
|
this.closePopups();
|
|
305
305
|
},
|
|
306
|
-
|
|
306
|
+
selectedEntities(newValue) {
|
|
307
307
|
if (!newValue) {
|
|
308
308
|
this.$store.dispatch("selection/setSpanSelection", null);
|
|
309
309
|
this.closePopups();
|
|
310
310
|
}
|
|
311
|
-
|
|
312
|
-
await this.$store.dispatch("selection/getTextFromEntities", newValue);
|
|
313
311
|
},
|
|
314
312
|
page(newValue, oldValue) {
|
|
315
313
|
if (newValue.image_url !== oldValue.image_url) {
|
|
@@ -439,6 +437,10 @@ export default {
|
|
|
439
437
|
"selection/setSelectedEntities",
|
|
440
438
|
this.newAnnotation
|
|
441
439
|
);
|
|
440
|
+
this.$store.dispatch(
|
|
441
|
+
"selection/getTextFromEntities",
|
|
442
|
+
this.newAnnotation
|
|
443
|
+
);
|
|
442
444
|
} else {
|
|
443
445
|
this.$store.dispatch("selection/setSelectedEntities", null);
|
|
444
446
|
}
|
|
@@ -458,6 +460,10 @@ export default {
|
|
|
458
460
|
"selection/setSelectedEntities",
|
|
459
461
|
normalizedEntities
|
|
460
462
|
);
|
|
463
|
+
this.$store.dispatch(
|
|
464
|
+
"selection/getTextFromEntities",
|
|
465
|
+
normalizedEntities
|
|
466
|
+
);
|
|
461
467
|
} else {
|
|
462
468
|
this.$store.dispatch("selection/setSelectedEntities", null);
|
|
463
469
|
}
|
|
@@ -503,6 +509,10 @@ export default {
|
|
|
503
509
|
"selection/setSelectedEntities",
|
|
504
510
|
this.newAnnotation
|
|
505
511
|
);
|
|
512
|
+
this.$store.dispatch(
|
|
513
|
+
"selection/getTextFromEntities",
|
|
514
|
+
this.newAnnotation
|
|
515
|
+
);
|
|
506
516
|
} else {
|
|
507
517
|
this.$store.dispatch("selection/setSelectedEntities", null);
|
|
508
518
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/no-v-html -->
|
|
1
2
|
<template>
|
|
2
3
|
<div
|
|
3
4
|
v-if="annotation && !hide"
|
|
@@ -24,19 +25,17 @@
|
|
|
24
25
|
]"
|
|
25
26
|
type="is-text"
|
|
26
27
|
>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
selectedSet
|
|
30
|
-
|
|
31
|
-
selectedSet
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}}</span
|
|
39
|
-
>
|
|
28
|
+
{{
|
|
29
|
+
selectedSet
|
|
30
|
+
? `${selectedSet.label_set.name} ${
|
|
31
|
+
selectedSet.id
|
|
32
|
+
? numberOfAnnotationSetGroup(selectedSet)
|
|
33
|
+
: `${numberOfLabelSetGroup(selectedSet.label_set)} (${$t(
|
|
34
|
+
"new"
|
|
35
|
+
)})`
|
|
36
|
+
}`
|
|
37
|
+
: $t("select_annotation_set")
|
|
38
|
+
}}
|
|
40
39
|
<span class="caret-icon">
|
|
41
40
|
<b-icon icon="angle-down" size="is-small" class="caret" />
|
|
42
41
|
</span>
|
|
@@ -73,6 +72,15 @@
|
|
|
73
72
|
class="bottom-aligned"
|
|
74
73
|
:close-delay="5000"
|
|
75
74
|
>
|
|
75
|
+
<template #content>
|
|
76
|
+
<div
|
|
77
|
+
v-html="
|
|
78
|
+
`${$t('no_labels_available')} ${
|
|
79
|
+
showBranding ? $t('no_labels_available_link') : ''
|
|
80
|
+
}`
|
|
81
|
+
"
|
|
82
|
+
></div>
|
|
83
|
+
</template>
|
|
76
84
|
<b-dropdown
|
|
77
85
|
v-if="selectedLabel"
|
|
78
86
|
v-model="selectedLabel"
|
|
@@ -87,7 +95,7 @@
|
|
|
87
95
|
:disabled="!labelsFiltered"
|
|
88
96
|
type="is-text"
|
|
89
97
|
>
|
|
90
|
-
|
|
98
|
+
{{ selectedLabel.name }}
|
|
91
99
|
<span class="caret-icon">
|
|
92
100
|
<b-icon icon="angle-down" size="is-small" class="caret" />
|
|
93
101
|
</span>
|
|
@@ -175,6 +183,7 @@ export default {
|
|
|
175
183
|
"numberOfLabelSetGroup",
|
|
176
184
|
"labelsFilteredForAnnotationCreation",
|
|
177
185
|
]),
|
|
186
|
+
...mapState("display", ["showBranding"]),
|
|
178
187
|
...mapGetters("display", ["bboxToRect"]),
|
|
179
188
|
...mapState("selection", ["selection", "spanSelection"]),
|
|
180
189
|
top() {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/no-v-html -->
|
|
1
2
|
<template>
|
|
2
3
|
<div class="annotation-popup" :style="{ left: `${left}px`, top: `${top}px` }">
|
|
3
4
|
<div v-if="!textFromEntities" class="popup-input">
|
|
@@ -26,19 +27,17 @@
|
|
|
26
27
|
]"
|
|
27
28
|
type="is-text"
|
|
28
29
|
>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
selectedSet
|
|
32
|
-
|
|
33
|
-
selectedSet
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}}</span
|
|
41
|
-
>
|
|
30
|
+
{{
|
|
31
|
+
selectedSet
|
|
32
|
+
? `${selectedSet.label_set.name} ${
|
|
33
|
+
selectedSet.id
|
|
34
|
+
? numberOfAnnotationSetGroup(selectedSet)
|
|
35
|
+
: `${numberOfLabelSetGroup(selectedSet.label_set)} (${$t(
|
|
36
|
+
"new"
|
|
37
|
+
)})`
|
|
38
|
+
}`
|
|
39
|
+
: $t("select_annotation_set")
|
|
40
|
+
}}
|
|
42
41
|
<span class="caret-icon">
|
|
43
42
|
<b-icon icon="angle-down" size="is-small" class="caret" />
|
|
44
43
|
</span>
|
|
@@ -73,9 +72,16 @@
|
|
|
73
72
|
size="is-large"
|
|
74
73
|
position="is-bottom"
|
|
75
74
|
class="bottom-aligned"
|
|
75
|
+
:close-delay="5000"
|
|
76
76
|
>
|
|
77
77
|
<template #content>
|
|
78
|
-
<div
|
|
78
|
+
<div
|
|
79
|
+
v-html="
|
|
80
|
+
`${$t('no_labels_available')} ${
|
|
81
|
+
showBranding ? $t('no_labels_available_link') : ''
|
|
82
|
+
}`
|
|
83
|
+
"
|
|
84
|
+
></div>
|
|
79
85
|
</template>
|
|
80
86
|
<b-dropdown
|
|
81
87
|
v-model="selectedLabel"
|
|
@@ -93,13 +99,13 @@
|
|
|
93
99
|
]"
|
|
94
100
|
type="is-text"
|
|
95
101
|
>
|
|
96
|
-
|
|
102
|
+
{{
|
|
97
103
|
selectedLabel
|
|
98
104
|
? selectedLabel.name
|
|
99
105
|
: labels && labels.length === 0
|
|
100
106
|
? $t("no_labels_to_choose")
|
|
101
107
|
: $t("select_label")
|
|
102
|
-
}}
|
|
108
|
+
}}
|
|
103
109
|
<span class="caret-icon">
|
|
104
110
|
<b-icon icon="angle-down" size="is-small" class="caret" />
|
|
105
111
|
</span>
|
|
@@ -180,6 +186,7 @@ export default {
|
|
|
180
186
|
"numberOfLabelSetGroup",
|
|
181
187
|
"labelsFilteredForAnnotationCreation",
|
|
182
188
|
]),
|
|
189
|
+
...mapState("display", ["showBranding"]),
|
|
183
190
|
...mapGetters("display", ["clientToBbox"]),
|
|
184
191
|
...mapState("selection", ["spanSelection", "selection"]),
|
|
185
192
|
top() {
|
|
@@ -227,13 +234,12 @@ export default {
|
|
|
227
234
|
textFromEntities() {
|
|
228
235
|
if (!this.spanSelection) return;
|
|
229
236
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
237
|
+
let text = "";
|
|
238
|
+
this.spanSelection.forEach((span) => {
|
|
239
|
+
text = `${text} ${span.offset_string}`;
|
|
233
240
|
});
|
|
234
241
|
|
|
235
|
-
|
|
236
|
-
return text.join().split(",").join(" ");
|
|
242
|
+
return text.trim();
|
|
237
243
|
},
|
|
238
244
|
},
|
|
239
245
|
watch: {
|
|
@@ -255,8 +261,6 @@ export default {
|
|
|
255
261
|
// prevent click propagation when opening the popup
|
|
256
262
|
document.body.addEventListener("click", this.clickOutside);
|
|
257
263
|
}, 200);
|
|
258
|
-
|
|
259
|
-
this.setTooltipText();
|
|
260
264
|
},
|
|
261
265
|
destroyed() {
|
|
262
266
|
document.body.removeEventListener("click", this.clickOutside);
|
|
@@ -343,10 +347,6 @@ export default {
|
|
|
343
347
|
finish: this.chooseLabelSet,
|
|
344
348
|
});
|
|
345
349
|
},
|
|
346
|
-
setTooltipText() {
|
|
347
|
-
// Text set from innerHTML vs 'label' due to html tag in locales file string
|
|
348
|
-
this.$refs.tooltipContent.innerHTML = this.$t("no_labels_available");
|
|
349
|
-
},
|
|
350
350
|
},
|
|
351
351
|
};
|
|
352
352
|
</script>
|
|
@@ -8,6 +8,17 @@
|
|
|
8
8
|
<DocumentSetChooser
|
|
9
9
|
v-if="!publicView && !recalculatingAnnotations && !editMode"
|
|
10
10
|
/>
|
|
11
|
+
<a
|
|
12
|
+
v-if="
|
|
13
|
+
showBranding &&
|
|
14
|
+
!(selectedDocument.documentSet !== null && documentSet === null)
|
|
15
|
+
"
|
|
16
|
+
class="app-info"
|
|
17
|
+
target="_blank"
|
|
18
|
+
href="https://konfuzio.com"
|
|
19
|
+
>
|
|
20
|
+
<span>{{ $t("powered_by") }}</span>
|
|
21
|
+
</a>
|
|
11
22
|
</div>
|
|
12
23
|
|
|
13
24
|
<div
|
|
@@ -121,12 +132,13 @@ export default {
|
|
|
121
132
|
computed: {
|
|
122
133
|
...mapState("document", [
|
|
123
134
|
"selectedDocument",
|
|
135
|
+
"documentSet",
|
|
124
136
|
"publicView",
|
|
125
137
|
"loading",
|
|
126
138
|
"recalculatingAnnotations",
|
|
127
139
|
]),
|
|
128
140
|
...mapState("edit", ["editMode"]),
|
|
129
|
-
...mapState("display", ["showDocumentsNavigation"]),
|
|
141
|
+
...mapState("display", ["showDocumentsNavigation", "showBranding"]),
|
|
130
142
|
...mapGetters("document", [
|
|
131
143
|
"isDocumentReviewed",
|
|
132
144
|
"isDocumentReadyToBeReviewed",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
</div>
|
|
13
13
|
<div class="documents-list-top-right">
|
|
14
|
-
<div class="action-box">
|
|
14
|
+
<div v-if="showBranding" class="action-box">
|
|
15
15
|
<span>{{ $t("upload_documents") }}</span>
|
|
16
16
|
<b-button
|
|
17
17
|
class="action-button primary-button"
|
|
@@ -98,6 +98,7 @@ export default {
|
|
|
98
98
|
computed: {
|
|
99
99
|
...mapState("document", ["selectedDocument"]),
|
|
100
100
|
...mapState("category", ["documentsAvailableToReview"]),
|
|
101
|
+
...mapState("display", ["showBranding"]),
|
|
101
102
|
...mapGetters("category", ["category"]),
|
|
102
103
|
...mapGetters("document", ["documentHadErrorDuringExtraction"]),
|
|
103
104
|
},
|