@konfuzio/document-validation-ui 0.1.10-dev.1 → 0.1.10-dev.11
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 +1 -1
- package/package.json +1 -1
- package/src/api.js +10 -0
- package/src/assets/scss/document_category.scss +1 -0
- 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/new_annotation.scss +14 -3
- package/src/assets/scss/{main.scss → theme.scss} +26 -17
- package/src/assets/scss/variables.scss +1 -7
- package/src/components/App.vue +56 -2
- 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/DocumentPage/NewAnnotation.vue +2 -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/main.js +0 -24
- package/src/store/document.js +14 -12
- package/src/store/edit.js +30 -14
- package/dist/css/chunk-vendors.css +0 -5
- 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/src/store/document.js
CHANGED
|
@@ -502,17 +502,6 @@ const getters = {
|
|
|
502
502
|
);
|
|
503
503
|
},
|
|
504
504
|
|
|
505
|
-
documentHasNoCorrectAnnotations: (state) => () => {
|
|
506
|
-
if (
|
|
507
|
-
state.annotations &&
|
|
508
|
-
state.annotations.filter((ann) => ann.is_correct).length > 0
|
|
509
|
-
) {
|
|
510
|
-
return false;
|
|
511
|
-
} else {
|
|
512
|
-
return true;
|
|
513
|
-
}
|
|
514
|
-
},
|
|
515
|
-
|
|
516
505
|
/**
|
|
517
506
|
* If automatic splitting is enabled for the project
|
|
518
507
|
*/
|
|
@@ -746,12 +735,25 @@ const actions = {
|
|
|
746
735
|
});
|
|
747
736
|
|
|
748
737
|
if (!state.publicView) {
|
|
749
|
-
dispatch("fetchMissingAnnotations");
|
|
738
|
+
await dispatch("fetchMissingAnnotations");
|
|
750
739
|
|
|
751
740
|
await dispatch("project/fetchCurrentUser", null, {
|
|
752
741
|
root: true,
|
|
753
742
|
});
|
|
754
743
|
|
|
744
|
+
// Check if we first open the document dashboard or the edit mode
|
|
745
|
+
if (
|
|
746
|
+
!state.selectedDocument.category ||
|
|
747
|
+
(!state.selectedDocument.category_is_revised &&
|
|
748
|
+
!getters.documentHasCorrectAnnotations() &&
|
|
749
|
+
state.missingAnnotations.length === 0)
|
|
750
|
+
) {
|
|
751
|
+
dispatch("edit/enableEditMode", null, {
|
|
752
|
+
root: true,
|
|
753
|
+
});
|
|
754
|
+
dispatch("edit/setRenameAndCategorize", true, { root: true });
|
|
755
|
+
}
|
|
756
|
+
|
|
755
757
|
if (projectId) {
|
|
756
758
|
await dispatch("category/fetchCategories", projectId, {
|
|
757
759
|
root: true,
|
package/src/store/edit.js
CHANGED
|
@@ -9,19 +9,37 @@ const HTTP = myImports.HTTP;
|
|
|
9
9
|
|
|
10
10
|
const state = {
|
|
11
11
|
editMode: false,
|
|
12
|
-
|
|
12
|
+
renameAndCategorize: false,
|
|
13
13
|
isMultipleSelection: false,
|
|
14
14
|
pagesForPostprocess: [],
|
|
15
15
|
selectedPages: [],
|
|
16
16
|
updatedDocument: [],
|
|
17
17
|
showEditConfirmationModal: false,
|
|
18
|
-
|
|
18
|
+
submitEditChanges: false,
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const getters = {
|
|
22
22
|
isPageSelected: (state) => (id) => {
|
|
23
23
|
return state.selectedPages.find((page) => page.id === id);
|
|
24
24
|
},
|
|
25
|
+
|
|
26
|
+
documentShouldBePostprocessed: (state, _, rootState) => {
|
|
27
|
+
const foundRotatedPage = state.pagesForPostprocess.find(
|
|
28
|
+
(page) => page.angle !== 0
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
let foundReorderedPage;
|
|
32
|
+
|
|
33
|
+
state.pagesForPostprocess.map((page) => {
|
|
34
|
+
foundReorderedPage = rootState.document.selectedDocument.pages.find(
|
|
35
|
+
(p) => p.id === page.id && p.number !== page.number
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
state.updatedDocument.length > 1 || foundRotatedPage || foundReorderedPage
|
|
41
|
+
);
|
|
42
|
+
},
|
|
25
43
|
};
|
|
26
44
|
|
|
27
45
|
const actions = {
|
|
@@ -31,11 +49,11 @@ const actions = {
|
|
|
31
49
|
|
|
32
50
|
disableEditMode: ({ commit }) => {
|
|
33
51
|
commit("SET_EDIT_MODE", false);
|
|
34
|
-
commit("
|
|
52
|
+
commit("SET_RENAME_AND_CATEGORIZE", false);
|
|
35
53
|
},
|
|
36
54
|
|
|
37
|
-
|
|
38
|
-
commit("
|
|
55
|
+
setRenameAndCategorize: ({ commit }, value) => {
|
|
56
|
+
commit("SET_RENAME_AND_CATEGORIZE", value);
|
|
39
57
|
},
|
|
40
58
|
|
|
41
59
|
setPagesForPostprocess: ({ commit }, pages) => {
|
|
@@ -46,8 +64,8 @@ const actions = {
|
|
|
46
64
|
commit("SET_UPDATED_DOCUMENT", updatedDocument);
|
|
47
65
|
},
|
|
48
66
|
|
|
49
|
-
|
|
50
|
-
commit("
|
|
67
|
+
setSubmitEditChanges: ({ commit }, value) => {
|
|
68
|
+
commit("SET_SUBMIT_EDIT_CHANGES", value);
|
|
51
69
|
},
|
|
52
70
|
|
|
53
71
|
selectPage: ({ state, commit }, page) => {
|
|
@@ -187,8 +205,6 @@ const actions = {
|
|
|
187
205
|
root: true,
|
|
188
206
|
});
|
|
189
207
|
|
|
190
|
-
commit("SET_DOCUMENT_BEING_SPLIT", true);
|
|
191
|
-
|
|
192
208
|
const oldId = rootState.document.documentId;
|
|
193
209
|
|
|
194
210
|
return new Promise((resolve, reject) => {
|
|
@@ -201,7 +217,7 @@ const actions = {
|
|
|
201
217
|
const newId = response.data[0].id;
|
|
202
218
|
dispatch("document/setSplittingSuggestions", null, { root: true });
|
|
203
219
|
|
|
204
|
-
commit("
|
|
220
|
+
commit("SET_SUBMIT_EDIT_CHANGES", false);
|
|
205
221
|
|
|
206
222
|
if (newId !== oldId) {
|
|
207
223
|
if (getURLQueryParam("document") || getURLPath("docs")) {
|
|
@@ -239,8 +255,8 @@ const mutations = {
|
|
|
239
255
|
state.editMode = option;
|
|
240
256
|
},
|
|
241
257
|
|
|
242
|
-
|
|
243
|
-
state.
|
|
258
|
+
SET_RENAME_AND_CATEGORIZE: (state, value) => {
|
|
259
|
+
state.renameAndCategorize = value;
|
|
244
260
|
},
|
|
245
261
|
|
|
246
262
|
SET_PAGES_FOR_POSTPROCESS: (state, pages) => {
|
|
@@ -259,8 +275,8 @@ const mutations = {
|
|
|
259
275
|
SET_SHOW_EDIT_CONFIRMATION_MODAL: (state, value) => {
|
|
260
276
|
state.showEditConfirmationModal = value;
|
|
261
277
|
},
|
|
262
|
-
|
|
263
|
-
state.
|
|
278
|
+
SET_SUBMIT_EDIT_CHANGES: (state, value) => {
|
|
279
|
+
state.submitEditChanges = value;
|
|
264
280
|
},
|
|
265
281
|
};
|
|
266
282
|
|