@konfuzio/document-validation-ui 0.1.10-dev.4 → 0.1.10-dev.6
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 +27 -7
- package/src/assets/scss/document_name.scss +1 -1
- package/src/assets/scss/document_top_bar.scss +4 -0
- package/src/assets/scss/main.scss +1 -1
- package/src/assets/scss/variables.scss +1 -0
- package/src/components/DocumentAnnotations/DocumentAnnotations.vue +0 -11
- package/src/components/DocumentCategory.vue +2 -2
- package/src/components/DocumentDashboard.vue +3 -15
- package/src/components/DocumentEdit/DocumentEdit.vue +80 -25
- package/src/components/DocumentEdit/EditPages.vue +5 -3
- package/src/components/DocumentEdit/{SplitOverview.vue → RenameAndCategorize.vue} +9 -8
- package/src/components/DocumentEdit/index.js +1 -1
- package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +66 -30
- package/src/locales/de.json +5 -5
- package/src/locales/en.json +5 -5
- package/src/locales/es.json +18 -18
- package/src/store/document.js +14 -12
- package/src/store/edit.js +30 -14
- package/src/assets/scss/categorize_modal.scss +0 -45
- package/src/assets/scss/splitting_confirmation_modal.scss +0 -41
- package/src/components/DocumentAnnotations/CategorizeModal.vue +0 -247
- package/src/components/DocumentModals/SplittingSuggestionsModal.vue +0 -132
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
.document-edit {
|
|
4
4
|
display: flex;
|
|
5
5
|
flex: 1;
|
|
6
|
-
background-color: $background;
|
|
6
|
+
background-color: $light-grey-background;
|
|
7
7
|
|
|
8
8
|
.pages-section {
|
|
9
9
|
width: 100%;
|
|
@@ -14,6 +14,22 @@
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
justify-content: space-between;
|
|
16
16
|
|
|
17
|
+
.grid-header {
|
|
18
|
+
height: 60px;
|
|
19
|
+
background-color: $background;
|
|
20
|
+
border-bottom: $component-border;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
|
|
24
|
+
.header-title {
|
|
25
|
+
color: $text-color;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
font-size: 18px;
|
|
28
|
+
line-height: 18px;
|
|
29
|
+
padding-left: 28px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
17
33
|
.document-grid {
|
|
18
34
|
padding: 32px;
|
|
19
35
|
display: flex;
|
|
@@ -236,18 +252,18 @@
|
|
|
236
252
|
}
|
|
237
253
|
}
|
|
238
254
|
|
|
239
|
-
&.
|
|
255
|
+
&.rename-and-categorize-component {
|
|
240
256
|
background-color: $background;
|
|
241
257
|
min-width: 600px;
|
|
242
258
|
|
|
243
|
-
.
|
|
259
|
+
.rename-and-categorize-section {
|
|
244
260
|
padding-left: 30px;
|
|
245
261
|
padding-right: 10px;
|
|
246
262
|
overflow-y: scroll;
|
|
247
263
|
width: 100%;
|
|
248
264
|
}
|
|
249
265
|
|
|
250
|
-
.
|
|
266
|
+
.rename-and-categorize {
|
|
251
267
|
margin-top: 20px;
|
|
252
268
|
img {
|
|
253
269
|
height: 30px !important;
|
|
@@ -263,7 +279,7 @@
|
|
|
263
279
|
cursor: pointer;
|
|
264
280
|
|
|
265
281
|
.back-btn-section {
|
|
266
|
-
padding-top:
|
|
282
|
+
padding-top: 4px;
|
|
267
283
|
}
|
|
268
284
|
|
|
269
285
|
.back-text {
|
|
@@ -274,7 +290,7 @@
|
|
|
274
290
|
}
|
|
275
291
|
}
|
|
276
292
|
|
|
277
|
-
.
|
|
293
|
+
.rename-and-categorize-title {
|
|
278
294
|
color: $text-color;
|
|
279
295
|
font-size: 16px;
|
|
280
296
|
font-weight: 600;
|
|
@@ -291,7 +307,7 @@
|
|
|
291
307
|
gap: 20px;
|
|
292
308
|
padding-bottom: 40px;
|
|
293
309
|
|
|
294
|
-
.
|
|
310
|
+
.rename-and-categorize-thumbnails {
|
|
295
311
|
display: flex;
|
|
296
312
|
align-items: center;
|
|
297
313
|
justify-content: center;
|
|
@@ -318,6 +334,10 @@
|
|
|
318
334
|
5px 5px $white, 6px 6px $detail;
|
|
319
335
|
}
|
|
320
336
|
}
|
|
337
|
+
|
|
338
|
+
&:hover {
|
|
339
|
+
cursor: pointer;
|
|
340
|
+
}
|
|
321
341
|
}
|
|
322
342
|
}
|
|
323
343
|
}
|
|
@@ -14,18 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
<!-- When there's no annotations in the label -->
|
|
16
16
|
<div v-else-if="annotationSets.length === 0">
|
|
17
|
-
<CategorizeModal
|
|
18
|
-
v-if="
|
|
19
|
-
!publicView &&
|
|
20
|
-
!isDocumentReviewed &&
|
|
21
|
-
!waitingForSplittingConfirmation(selectedDocument)
|
|
22
|
-
"
|
|
23
|
-
/>
|
|
24
17
|
<EmptyState />
|
|
25
18
|
</div>
|
|
26
19
|
|
|
27
20
|
<div v-else :class="['annotation-set-list']">
|
|
28
|
-
<CategorizeModal v-if="!publicView || !isDocumentReviewed" />
|
|
29
21
|
<div
|
|
30
22
|
v-if="Object.entries(annotationSetsInTable()).length > 0"
|
|
31
23
|
class="annotation-set-group"
|
|
@@ -114,7 +106,6 @@ import ExtractingData from "./ExtractingData";
|
|
|
114
106
|
import AnnotationSetActionButtons from "./AnnotationSetActionButtons";
|
|
115
107
|
import DocumentLabel from "./DocumentLabel";
|
|
116
108
|
import LoadingAnnotations from "./LoadingAnnotations";
|
|
117
|
-
import CategorizeModal from "./CategorizeModal";
|
|
118
109
|
import GridIcon from "../../assets/images/GridIcon";
|
|
119
110
|
|
|
120
111
|
/**
|
|
@@ -127,7 +118,6 @@ export default {
|
|
|
127
118
|
AnnotationSetActionButtons,
|
|
128
119
|
DocumentLabel,
|
|
129
120
|
LoadingAnnotations,
|
|
130
|
-
CategorizeModal,
|
|
131
121
|
GridIcon,
|
|
132
122
|
},
|
|
133
123
|
data() {
|
|
@@ -157,7 +147,6 @@ export default {
|
|
|
157
147
|
"numberOfAnnotationSetGroup",
|
|
158
148
|
"emptyLabelsLength",
|
|
159
149
|
"annotationsWithPendingReviewLength",
|
|
160
|
-
"waitingForSplittingConfirmation",
|
|
161
150
|
"annotationSetsToShowInList",
|
|
162
151
|
"annotationSetsInTable",
|
|
163
152
|
"isDocumentReviewed",
|
|
@@ -168,7 +168,7 @@ export default {
|
|
|
168
168
|
|
|
169
169
|
handleChangeCategory(category) {
|
|
170
170
|
// handling the category change will be different based on
|
|
171
|
-
// the dropdown being on the topbar or the
|
|
171
|
+
// the dropdown being on the topbar or the Rename and Categorize view
|
|
172
172
|
const updatedCategory = {
|
|
173
173
|
category: category.id,
|
|
174
174
|
};
|
|
@@ -192,7 +192,7 @@ export default {
|
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
// Send the category ID to the
|
|
195
|
+
// Send the category ID to the Rename and Categorize view
|
|
196
196
|
// to update the new document category
|
|
197
197
|
this.$emit("category-change", this.page, category.id);
|
|
198
198
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="dashboard">
|
|
3
3
|
<DocumentTopBar />
|
|
4
|
-
<div :class="['dashboard-viewer',
|
|
4
|
+
<div :class="['dashboard-viewer', renameAndCategorize ? 'edit-mode' : '']">
|
|
5
5
|
<DocumentThumbnails v-if="!editMode" ref="documentPages" />
|
|
6
6
|
<ScrollingDocument ref="scrollingDocument" class="dashboard-document" />
|
|
7
7
|
<DocumentAnnotations v-if="!editMode" ref="annotations" />
|
|
8
|
-
<DocumentEdit v-
|
|
8
|
+
<DocumentEdit v-if="editMode" ref="editView" />
|
|
9
9
|
|
|
10
10
|
<MultiAnnotationTableOverlay
|
|
11
11
|
v-if="showAnnSetTable"
|
|
@@ -34,15 +34,6 @@
|
|
|
34
34
|
{{ $t("resolution_not_supported") }}
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
|
-
<div
|
|
38
|
-
v-if="
|
|
39
|
-
selectedDocument &&
|
|
40
|
-
waitingForSplittingConfirmation(selectedDocument) &&
|
|
41
|
-
!documentBeingSplit
|
|
42
|
-
"
|
|
43
|
-
>
|
|
44
|
-
<SplittingSuggestionsModal />
|
|
45
|
-
</div>
|
|
46
37
|
</div>
|
|
47
38
|
</template>
|
|
48
39
|
|
|
@@ -59,7 +50,6 @@ import { DocumentEdit } from "./DocumentEdit";
|
|
|
59
50
|
import ErrorMessage from "./ErrorMessage";
|
|
60
51
|
import NotOptimizedViewportModal from "../components/DocumentModals/NotOptimizedViewportModal";
|
|
61
52
|
import DocumentErrorModal from "../components/DocumentModals/DocumentErrorModal";
|
|
62
|
-
import SplittingSuggestionsModal from "../components/DocumentModals/SplittingSuggestionsModal";
|
|
63
53
|
|
|
64
54
|
/**
|
|
65
55
|
* This component shows the PDF pages in a scrolling component and
|
|
@@ -76,7 +66,6 @@ export default {
|
|
|
76
66
|
ErrorMessage,
|
|
77
67
|
NotOptimizedViewportModal,
|
|
78
68
|
DocumentErrorModal,
|
|
79
|
-
SplittingSuggestionsModal,
|
|
80
69
|
MultiAnnotationTableOverlay,
|
|
81
70
|
},
|
|
82
71
|
data() {
|
|
@@ -103,9 +92,8 @@ export default {
|
|
|
103
92
|
"selectedDocument",
|
|
104
93
|
"splittingSuggestions",
|
|
105
94
|
]),
|
|
106
|
-
...mapState("edit", ["editMode", "
|
|
95
|
+
...mapState("edit", ["editMode", "renameAndCategorize"]),
|
|
107
96
|
...mapGetters("display", ["isMinimumWidth"]),
|
|
108
|
-
...mapGetters("document", ["waitingForSplittingConfirmation"]),
|
|
109
97
|
},
|
|
110
98
|
|
|
111
99
|
watch: {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
:class="[
|
|
4
|
+
'document-edit',
|
|
5
|
+
renameAndCategorize && 'rename-and-categorize-component',
|
|
6
|
+
]"
|
|
7
|
+
>
|
|
8
|
+
<div v-if="!renameAndCategorize" class="pages-section">
|
|
4
9
|
<EditPages
|
|
5
10
|
:splitting-lines="splittingLines"
|
|
6
11
|
:split-suggestions-enabled="splitSuggestionsEnabled"
|
|
@@ -12,14 +17,14 @@
|
|
|
12
17
|
<SplitInfoBar v-if="splitSuggestionsEnabled" />
|
|
13
18
|
</div>
|
|
14
19
|
</div>
|
|
15
|
-
<div v-else class="
|
|
16
|
-
<
|
|
20
|
+
<div v-else class="rename-and-categorize-section">
|
|
21
|
+
<RenameAndCategorize
|
|
17
22
|
:file-name="fileName"
|
|
18
23
|
:file-extension="fileExtension"
|
|
19
24
|
@change-page="changePage"
|
|
20
25
|
/>
|
|
21
26
|
</div>
|
|
22
|
-
<div v-if="!
|
|
27
|
+
<div v-if="!renameAndCategorize" class="sidebar">
|
|
23
28
|
<EditSidebar
|
|
24
29
|
:split-suggestions-enabled="splitSuggestionsEnabled"
|
|
25
30
|
@rotate-left="rotatePage"
|
|
@@ -35,9 +40,9 @@
|
|
|
35
40
|
</div>
|
|
36
41
|
</template>
|
|
37
42
|
<script>
|
|
38
|
-
import { mapState } from "vuex";
|
|
43
|
+
import { mapState, mapGetters } from "vuex";
|
|
39
44
|
import EditSidebar from "./EditSidebar";
|
|
40
|
-
import
|
|
45
|
+
import RenameAndCategorize from "./RenameAndCategorize";
|
|
41
46
|
import EditPages from "./EditPages";
|
|
42
47
|
import SplitInfoBar from "./SplitInfoBar";
|
|
43
48
|
import EditConfirmationModal from "./EditConfirmationModal";
|
|
@@ -49,7 +54,7 @@ export default {
|
|
|
49
54
|
name: "DocumentEdit",
|
|
50
55
|
components: {
|
|
51
56
|
EditSidebar,
|
|
52
|
-
|
|
57
|
+
RenameAndCategorize,
|
|
53
58
|
EditPages,
|
|
54
59
|
SplitInfoBar,
|
|
55
60
|
EditConfirmationModal,
|
|
@@ -69,28 +74,26 @@ export default {
|
|
|
69
74
|
"recalculatingAnnotations",
|
|
70
75
|
"selectedDocument",
|
|
71
76
|
"splittingSuggestions",
|
|
77
|
+
"pages",
|
|
72
78
|
]),
|
|
73
79
|
...mapState("display", ["currentPage"]),
|
|
74
80
|
...mapState("edit", [
|
|
75
81
|
"editMode",
|
|
76
82
|
"pagesForPostprocess",
|
|
77
83
|
"updatedDocument",
|
|
78
|
-
"
|
|
84
|
+
"renameAndCategorize",
|
|
79
85
|
"selectedPages",
|
|
86
|
+
"submitEditChanges",
|
|
80
87
|
]),
|
|
88
|
+
...mapGetters("edit", ["documentShouldBePostprocessed"]),
|
|
81
89
|
},
|
|
82
90
|
watch: {
|
|
83
|
-
|
|
84
|
-
if (!this.selectedDocument) return;
|
|
85
|
-
|
|
86
|
-
this.setPages();
|
|
87
|
-
},
|
|
88
|
-
splitOverview(newValue) {
|
|
91
|
+
renameAndCategorize(newValue) {
|
|
89
92
|
if (newValue) {
|
|
90
93
|
this.splitFileNameFromExtension();
|
|
91
94
|
}
|
|
92
95
|
},
|
|
93
|
-
pagesForPostprocess(newValue) {
|
|
96
|
+
pagesForPostprocess(newValue, oldValue) {
|
|
94
97
|
if (newValue) {
|
|
95
98
|
this.saveUpdatedDocuments();
|
|
96
99
|
}
|
|
@@ -104,6 +107,11 @@ export default {
|
|
|
104
107
|
this.splitSuggestionsEnabled = false;
|
|
105
108
|
}
|
|
106
109
|
},
|
|
110
|
+
submitEditChanges(newValue) {
|
|
111
|
+
if (!newValue) return;
|
|
112
|
+
|
|
113
|
+
this.saveEditChanges();
|
|
114
|
+
},
|
|
107
115
|
},
|
|
108
116
|
mounted() {
|
|
109
117
|
this.setPages();
|
|
@@ -367,24 +375,71 @@ export default {
|
|
|
367
375
|
/** SUBMIT CHANGES */
|
|
368
376
|
// Send update request to the backend
|
|
369
377
|
saveEditChanges() {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
378
|
+
// Verify if there was splitting, rotating and/or reordering
|
|
379
|
+
if (this.documentShouldBePostprocessed) {
|
|
380
|
+
this.$store
|
|
381
|
+
.dispatch("edit/editDocument", this.updatedDocument)
|
|
382
|
+
.catch((error) => {
|
|
383
|
+
this.$store.dispatch("document/createErrorMessage", {
|
|
384
|
+
error,
|
|
385
|
+
serverErrorMessage: this.$t("server_error"),
|
|
386
|
+
defaultErrorMessage: this.$t("edit_error"),
|
|
387
|
+
});
|
|
377
388
|
});
|
|
378
|
-
|
|
389
|
+
} else {
|
|
390
|
+
// Check if only the category changes:
|
|
391
|
+
const newCategory = this.updatedDocument[0].category;
|
|
392
|
+
const newName = this.updatedDocument[0].name;
|
|
393
|
+
let category = {};
|
|
394
|
+
let name = {};
|
|
395
|
+
let revisedCategory = {};
|
|
396
|
+
|
|
397
|
+
if (this.selectedDocument.category !== newCategory) {
|
|
398
|
+
Object.assign(category, {
|
|
399
|
+
category: newCategory,
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
this.$store.dispatch("document/startLoading");
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
if (!this.selectedDocument.category_is_revised && newCategory) {
|
|
406
|
+
Object.assign(revisedCategory, {
|
|
407
|
+
category_is_revised: true,
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
if (this.selectedDocument.data_file_name !== newName) {
|
|
412
|
+
Object.assign(name, { data_file_name: newName });
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if (!category && !name) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
const updatedValues = Object.assign(category, revisedCategory, name);
|
|
420
|
+
|
|
421
|
+
this.$store
|
|
422
|
+
.dispatch("document/updateDocument", updatedValues)
|
|
423
|
+
.catch((error) => {
|
|
424
|
+
this.$store.dispatch("document/endLoading");
|
|
425
|
+
this.$store.dispatch("document/createErrorMessage", {
|
|
426
|
+
error,
|
|
427
|
+
serverErrorMessage: this.$t("server_error"),
|
|
428
|
+
defaultErrorMessage: this.$t("edit_error"),
|
|
429
|
+
});
|
|
430
|
+
});
|
|
431
|
+
}
|
|
379
432
|
|
|
380
433
|
this.closeEditMode();
|
|
381
434
|
},
|
|
382
435
|
|
|
383
436
|
closeEditMode() {
|
|
384
437
|
this.$store.dispatch("edit/disableEditMode");
|
|
385
|
-
this.$store.dispatch("edit/
|
|
438
|
+
this.$store.dispatch("edit/setRenameAndCategorize", false);
|
|
386
439
|
this.$store.dispatch("edit/setUpdatedDocument", null);
|
|
387
440
|
this.$store.dispatch("edit/setSelectedPages", null);
|
|
441
|
+
this.$store.dispatch("edit/setSubmitEditChanges", false);
|
|
442
|
+
this.$store.dispatch("edit/setShowEditConfirmationModal", false);
|
|
388
443
|
this.$nextTick(() => {
|
|
389
444
|
// reset to first page
|
|
390
445
|
this.$store.dispatch("display/updateCurrentPage", 1);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="edit-pages">
|
|
3
|
+
<div class="grid-header">
|
|
4
|
+
<span class="header-title">{{ $t("rotate_split_reorder") }}</span>
|
|
5
|
+
</div>
|
|
3
6
|
<draggable
|
|
4
7
|
v-model="editPages"
|
|
5
8
|
class="document-grid"
|
|
@@ -109,8 +112,7 @@ export default {
|
|
|
109
112
|
...mapState("edit", [
|
|
110
113
|
"editMode",
|
|
111
114
|
"pagesForPostprocess",
|
|
112
|
-
"
|
|
113
|
-
"splitOverview",
|
|
115
|
+
"renameAndCategorize",
|
|
114
116
|
]),
|
|
115
117
|
},
|
|
116
118
|
watch: {
|
|
@@ -124,7 +126,7 @@ export default {
|
|
|
124
126
|
this.$store.dispatch("edit/setPagesForPostprocess", newValue);
|
|
125
127
|
}
|
|
126
128
|
},
|
|
127
|
-
|
|
129
|
+
renameAndCategorize(newValue) {
|
|
128
130
|
if (newValue) {
|
|
129
131
|
this.editPages = this.pagesForPostprocess;
|
|
130
132
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="rename-and-categorize">
|
|
3
3
|
<div class="back-section" @click="handleBackButton">
|
|
4
4
|
<div class="back-btn-section">
|
|
5
5
|
<b-icon
|
|
6
6
|
icon="arrow-left"
|
|
7
7
|
class="is-small arrow"
|
|
8
|
-
:style="{ color: '#
|
|
8
|
+
:style="{ color: '#1a1a1a', cursor: 'pointer' }"
|
|
9
9
|
/>
|
|
10
10
|
</div>
|
|
11
11
|
<div class="back-text">
|
|
12
|
-
{{ $t("
|
|
12
|
+
{{ $t("rotate_split_reorder") }}
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
|
-
<div class="
|
|
16
|
-
{{ $t("
|
|
15
|
+
<div class="rename-and-categorize-title">
|
|
16
|
+
{{ $t("rename_and_categorize") }}
|
|
17
17
|
</div>
|
|
18
18
|
<div class="new-documents-container">
|
|
19
19
|
<div
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
:key="index"
|
|
22
22
|
class="document-details"
|
|
23
23
|
>
|
|
24
|
-
<div class="
|
|
24
|
+
<div class="rename-and-categorize-thumbnails">
|
|
25
25
|
<div class="split-documents">
|
|
26
26
|
<div
|
|
27
27
|
class="image-container"
|
|
@@ -88,7 +88,7 @@ import ServerImage from "../../assets/images/ServerImage";
|
|
|
88
88
|
import EyeIcon from "../../assets/images/EyeIcon";
|
|
89
89
|
|
|
90
90
|
export default {
|
|
91
|
-
name: "
|
|
91
|
+
name: "RenameAndCategorize",
|
|
92
92
|
components: {
|
|
93
93
|
DocumentCategory,
|
|
94
94
|
ServerImage,
|
|
@@ -114,9 +114,10 @@ export default {
|
|
|
114
114
|
...mapState("document", ["selectedDocument", "pages"]),
|
|
115
115
|
...mapState("edit", ["updatedDocument", "pagesForPostprocess"]),
|
|
116
116
|
},
|
|
117
|
+
|
|
117
118
|
methods: {
|
|
118
119
|
handleBackButton() {
|
|
119
|
-
this.$store.dispatch("edit/
|
|
120
|
+
this.$store.dispatch("edit/setRenameAndCategorize", false);
|
|
120
121
|
},
|
|
121
122
|
handlePaste(event) {
|
|
122
123
|
// TODO: modify to only paste plain text
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as DocumentEdit } from "./DocumentEdit";
|
|
2
2
|
export { default as EditSidebar } from "./EditSidebar";
|
|
3
3
|
export { default as EditPages } from "./EditPages";
|
|
4
|
-
export { default as
|
|
4
|
+
export { default as RenameAndCategorize } from "./RenameAndCategorize";
|
|
@@ -2,24 +2,30 @@
|
|
|
2
2
|
<div class="buttons">
|
|
3
3
|
<div v-if="editMode" class="edit-mode-buttons">
|
|
4
4
|
<b-button
|
|
5
|
-
:label="$t('
|
|
6
|
-
class="button-cancel primary-button"
|
|
5
|
+
:label="$t('back_to_annotations')"
|
|
6
|
+
class="button-cancel primary-button edit-mode-btn"
|
|
7
7
|
type="is-default"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
:label="
|
|
12
|
-
editMode &&
|
|
13
|
-
updatedDocument &&
|
|
14
|
-
updatedDocument.length > 1 &&
|
|
15
|
-
!splitOverview
|
|
16
|
-
? $t('next')
|
|
17
|
-
: $t('submit')
|
|
8
|
+
:disabled="
|
|
9
|
+
!documentHasCategory ||
|
|
10
|
+
waitingForSplittingConfirmation(selectedDocument)
|
|
18
11
|
"
|
|
19
|
-
|
|
20
|
-
class="button-next primary-button"
|
|
21
|
-
@click="handleButton"
|
|
12
|
+
@click="closeEditMode"
|
|
22
13
|
/>
|
|
14
|
+
|
|
15
|
+
<b-tooltip
|
|
16
|
+
:active="!enableSubmit"
|
|
17
|
+
position="is-bottom"
|
|
18
|
+
:label="$t('select_category')"
|
|
19
|
+
class="right-aligned no-right-margin"
|
|
20
|
+
>
|
|
21
|
+
<b-button
|
|
22
|
+
:label="editMode && !renameAndCategorize ? $t('next') : $t('submit')"
|
|
23
|
+
type="is-primary"
|
|
24
|
+
class="button-next primary-button edit-mode-btn"
|
|
25
|
+
:disabled="renameAndCategorize && !enableSubmit"
|
|
26
|
+
@click="handleButton"
|
|
27
|
+
/>
|
|
28
|
+
</b-tooltip>
|
|
23
29
|
</div>
|
|
24
30
|
|
|
25
31
|
<div
|
|
@@ -30,7 +36,7 @@
|
|
|
30
36
|
:active="!isReviewButtonActive"
|
|
31
37
|
position="is-bottom"
|
|
32
38
|
multilined
|
|
33
|
-
class="right-aligned
|
|
39
|
+
class="right-aligned no-right-margin"
|
|
34
40
|
>
|
|
35
41
|
<b-button
|
|
36
42
|
:class="['finish-review-btn', 'text-btn', 'primary-button']"
|
|
@@ -69,6 +75,7 @@ export default {
|
|
|
69
75
|
return {
|
|
70
76
|
emptyLabels: null,
|
|
71
77
|
isLoading: false,
|
|
78
|
+
enableSubmit: false,
|
|
72
79
|
};
|
|
73
80
|
},
|
|
74
81
|
|
|
@@ -77,20 +84,50 @@ export default {
|
|
|
77
84
|
"selectedDocument",
|
|
78
85
|
"publicView",
|
|
79
86
|
"annotationSets",
|
|
87
|
+
"thumbnailIsLoaded",
|
|
80
88
|
]),
|
|
81
|
-
...mapState("edit", ["editMode", "
|
|
89
|
+
...mapState("edit", ["editMode", "renameAndCategorize", "updatedDocument"]),
|
|
82
90
|
...mapGetters("document", [
|
|
83
91
|
"isDocumentReadyToFinishReview",
|
|
84
92
|
"isDocumentReviewed",
|
|
93
|
+
"waitingForSplittingConfirmation",
|
|
85
94
|
]),
|
|
95
|
+
...mapGetters("edit", ["documentShouldBePostprocessed"]),
|
|
86
96
|
isReviewButtonActive() {
|
|
87
97
|
return this.isDocumentReadyToFinishReview;
|
|
88
98
|
},
|
|
99
|
+
documentHasCategory() {
|
|
100
|
+
return this.selectedDocument.category;
|
|
101
|
+
},
|
|
89
102
|
},
|
|
103
|
+
|
|
104
|
+
watch: {
|
|
105
|
+
updatedDocument(newValue) {
|
|
106
|
+
if (!newValue) return;
|
|
107
|
+
|
|
108
|
+
this.submitValidation(newValue);
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
mounted() {
|
|
113
|
+
if (this.updatedDocument) {
|
|
114
|
+
this.submitValidation(this.updatedDocument);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
|
|
90
118
|
methods: {
|
|
119
|
+
submitValidation(document) {
|
|
120
|
+
const found = document.find((item) => !item.category);
|
|
121
|
+
|
|
122
|
+
if (!found) {
|
|
123
|
+
this.enableSubmit = true;
|
|
124
|
+
} else {
|
|
125
|
+
this.enableSubmit = false;
|
|
126
|
+
}
|
|
127
|
+
},
|
|
91
128
|
closeEditMode() {
|
|
92
129
|
this.$store.dispatch("edit/disableEditMode");
|
|
93
|
-
this.$store.dispatch("edit/
|
|
130
|
+
this.$store.dispatch("edit/setRenameAndCategorize", false);
|
|
94
131
|
this.$store.dispatch("edit/setUpdatedDocument", null);
|
|
95
132
|
this.$store.dispatch("edit/setSelectedPages", null);
|
|
96
133
|
this.$nextTick(() => {
|
|
@@ -99,21 +136,20 @@ export default {
|
|
|
99
136
|
});
|
|
100
137
|
},
|
|
101
138
|
handleButton() {
|
|
102
|
-
// Check if we are not in the
|
|
139
|
+
// Check if we are not in the Rename and Categorize view
|
|
103
140
|
// and if we have a split document
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
this.
|
|
107
|
-
this.updatedDocument.length > 1
|
|
108
|
-
) {
|
|
109
|
-
// Enable the "next" button to go to the overview
|
|
110
|
-
this.$store.dispatch("edit/setSplitOverview", true);
|
|
141
|
+
if (!this.renameAndCategorize) {
|
|
142
|
+
// Enable the "next" button
|
|
143
|
+
this.$store.dispatch("edit/setRenameAndCategorize", true);
|
|
111
144
|
this.$store.dispatch("edit/setSelectedPages", null);
|
|
112
|
-
} else
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
145
|
+
} else if (
|
|
146
|
+
this.selectedDocument.category_is_revised &&
|
|
147
|
+
this.documentShouldBePostprocessed
|
|
148
|
+
) {
|
|
149
|
+
// Show confirmation modal to user if the document was split, reordered or rotated
|
|
116
150
|
this.$store.dispatch("edit/setShowEditConfirmationModal", true);
|
|
151
|
+
} else {
|
|
152
|
+
this.$store.dispatch("edit/setSubmitEditChanges", true);
|
|
117
153
|
}
|
|
118
154
|
},
|
|
119
155
|
handleFinishReview() {
|