@konfuzio/document-validation-ui 0.1.10-dev.15 → 0.1.10-dev.16
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 +2 -0
- package/src/assets/scss/document_name.scss +0 -2
- package/src/assets/scss/document_top_bar.scss +6 -0
- package/src/assets/scss/theme.scss +1 -1
- package/src/components/App.vue +2 -5
- package/src/components/DocumentAnnotations/AnnotationContent.vue +0 -1
- package/src/components/DocumentEdit/DocumentEdit.vue +12 -4
- package/src/components/DocumentEdit/EditPageThumbnail.vue +1 -3
- package/src/components/DocumentEdit/EditSidebar.vue +6 -1
- package/src/components/DocumentPage/DocumentToolbar.vue +1 -0
- package/src/components/DocumentTopBar/DocumentName.vue +3 -1
- package/src/components/DocumentTopBar/DocumentTopBar.vue +6 -1
- package/src/store/document.js +2 -2
- package/src/store/edit.js +23 -11
- package/src/store/project.js +2 -2
- package/src/utils/utils.js +2 -2
package/package.json
CHANGED
package/src/components/App.vue
CHANGED
|
@@ -66,6 +66,7 @@ export default {
|
|
|
66
66
|
required: false,
|
|
67
67
|
default: "",
|
|
68
68
|
},
|
|
69
|
+
// eslint-disable-next-line vue/require-default-prop
|
|
69
70
|
locale: {
|
|
70
71
|
type: String,
|
|
71
72
|
required: false,
|
|
@@ -110,11 +111,7 @@ export default {
|
|
|
110
111
|
}
|
|
111
112
|
},
|
|
112
113
|
isPublicView() {
|
|
113
|
-
if (
|
|
114
|
-
process.env.VUE_APP_GUEST_USER_TOKEN ||
|
|
115
|
-
this.user_token ||
|
|
116
|
-
(this.full_mode && this.full_mode === "true")
|
|
117
|
-
) {
|
|
114
|
+
if (this.userToken || (this.full_mode && this.full_mode === "true")) {
|
|
118
115
|
return false;
|
|
119
116
|
} else {
|
|
120
117
|
return true;
|
|
@@ -85,8 +85,9 @@ export default {
|
|
|
85
85
|
"selectedPages",
|
|
86
86
|
"submitEditChanges",
|
|
87
87
|
]),
|
|
88
|
-
...mapState("project", ["projectId", "documentsListPath"]),
|
|
88
|
+
...mapState("project", ["projectId", "documentsListPath", "currentUser"]),
|
|
89
89
|
...mapGetters("edit", ["documentShouldBePostprocessed"]),
|
|
90
|
+
...mapGetters("document", ["waitingForSplittingConfirmation"]),
|
|
90
91
|
},
|
|
91
92
|
watch: {
|
|
92
93
|
renameAndCategorize(newValue) {
|
|
@@ -375,7 +376,10 @@ export default {
|
|
|
375
376
|
// Send update request to the backend
|
|
376
377
|
saveEditChanges() {
|
|
377
378
|
// Verify if there was splitting, rotating and/or reordering
|
|
378
|
-
if (
|
|
379
|
+
if (
|
|
380
|
+
this.documentShouldBePostprocessed ||
|
|
381
|
+
this.waitingForSplittingConfirmation(this.selectedDocument)
|
|
382
|
+
) {
|
|
379
383
|
this.$store
|
|
380
384
|
.dispatch("edit/editDocument", this.updatedDocument)
|
|
381
385
|
.catch((error) => {
|
|
@@ -386,9 +390,13 @@ export default {
|
|
|
386
390
|
});
|
|
387
391
|
});
|
|
388
392
|
|
|
389
|
-
navigateToDocumentsList(
|
|
393
|
+
navigateToDocumentsList(
|
|
394
|
+
this.documentsListPath,
|
|
395
|
+
this.projectId,
|
|
396
|
+
this.currentUser.id
|
|
397
|
+
);
|
|
390
398
|
} else {
|
|
391
|
-
// Check if only the category changes:
|
|
399
|
+
// Check if only the category and/or name changes:
|
|
392
400
|
const newCategory = this.updatedDocument[0].category;
|
|
393
401
|
const newName = this.updatedDocument[0].name;
|
|
394
402
|
let category = {};
|
|
@@ -11,9 +11,7 @@
|
|
|
11
11
|
isVisible && 'visible',
|
|
12
12
|
checkboxValue && 'selected',
|
|
13
13
|
]"
|
|
14
|
-
:style="{
|
|
15
|
-
transform: `rotate(${rotation}deg)`,
|
|
16
|
-
}"
|
|
14
|
+
:style="`rotate:${rotation}deg`"
|
|
17
15
|
@click="selectPage()"
|
|
18
16
|
>
|
|
19
17
|
<ServerImage :image-url="`${page.thumbnail_url}?${page.updated_at}`">
|
|
@@ -96,7 +96,7 @@ export default {
|
|
|
96
96
|
};
|
|
97
97
|
},
|
|
98
98
|
computed: {
|
|
99
|
-
...mapState("edit", ["selectedPages"]),
|
|
99
|
+
...mapState("edit", ["selectedPages", "updatedDocument"]),
|
|
100
100
|
...mapState("document", ["splittingSuggestions", "selectedDocument"]),
|
|
101
101
|
...mapGetters("document", ["documentHasProposedSplit"]),
|
|
102
102
|
},
|
|
@@ -117,6 +117,11 @@ export default {
|
|
|
117
117
|
this.switchStatus = false;
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
|
+
updatedDocument(newValue) {
|
|
121
|
+
if (newValue && newValue.length === 1) {
|
|
122
|
+
this.switchStatus = false;
|
|
123
|
+
}
|
|
124
|
+
},
|
|
120
125
|
},
|
|
121
126
|
mounted() {
|
|
122
127
|
this.$nextTick(() => {
|
package/src/store/document.js
CHANGED
|
@@ -774,7 +774,7 @@ const actions = {
|
|
|
774
774
|
"category/createAvailableDocumentsList",
|
|
775
775
|
{
|
|
776
776
|
categoryId,
|
|
777
|
-
user: rootState.project.currentUser,
|
|
777
|
+
user: rootState.project.currentUser.username,
|
|
778
778
|
poll: pollDocumentList,
|
|
779
779
|
},
|
|
780
780
|
{
|
|
@@ -1093,7 +1093,7 @@ const actions = {
|
|
|
1093
1093
|
|
|
1094
1094
|
contactSupport: ({ rootState }, error) => {
|
|
1095
1095
|
const url = "https://konfuzio.com/support/";
|
|
1096
|
-
const params = `project=${rootState.project.projectId}&email=${rootState.project.currentUser}&issue=${error}`;
|
|
1096
|
+
const params = `project=${rootState.project.projectId}&email=${rootState.project.currentUser.username}&issue=${error}`;
|
|
1097
1097
|
const fullUrl = `${url}?${params}`;
|
|
1098
1098
|
|
|
1099
1099
|
window.open(fullUrl, "_blank");
|
package/src/store/edit.js
CHANGED
|
@@ -28,12 +28,19 @@ const getters = {
|
|
|
28
28
|
(page) => page.angle !== 0
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
-
let foundReorderedPage;
|
|
32
|
-
|
|
33
|
-
state.pagesForPostprocess.map((page) => {
|
|
34
|
-
|
|
35
|
-
(
|
|
36
|
-
|
|
31
|
+
let foundReorderedPage = false;
|
|
32
|
+
|
|
33
|
+
state.pagesForPostprocess.map((page, index) => {
|
|
34
|
+
if (
|
|
35
|
+
(page.id === rootState.document.selectedDocument.pages[index].id &&
|
|
36
|
+
page.number !==
|
|
37
|
+
rootState.document.selectedDocument.pages[index].number) ||
|
|
38
|
+
(page.id !== rootState.document.selectedDocument.pages[index].id &&
|
|
39
|
+
page.number ===
|
|
40
|
+
rootState.document.selectedDocument.pages[index].number)
|
|
41
|
+
) {
|
|
42
|
+
foundReorderedPage = true;
|
|
43
|
+
}
|
|
37
44
|
});
|
|
38
45
|
|
|
39
46
|
return (
|
|
@@ -219,7 +226,7 @@ const actions = {
|
|
|
219
226
|
|
|
220
227
|
commit("SET_SUBMIT_EDIT_CHANGES", false);
|
|
221
228
|
|
|
222
|
-
if (newId
|
|
229
|
+
if (newId != oldId) {
|
|
223
230
|
if (getURLQueryParam("document") || getURLPath("docs")) {
|
|
224
231
|
navigateToNewDocumentURL(oldId, newId);
|
|
225
232
|
} else {
|
|
@@ -231,12 +238,17 @@ const actions = {
|
|
|
231
238
|
root: true,
|
|
232
239
|
});
|
|
233
240
|
}
|
|
241
|
+
} else {
|
|
242
|
+
dispatch("document/setSelectedDocument", response.data[0], {
|
|
243
|
+
root: true,
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
dispatch("document/pollDocumentEndpoint", null, {
|
|
247
|
+
root: true,
|
|
248
|
+
});
|
|
234
249
|
}
|
|
235
|
-
|
|
236
|
-
resolve(null);
|
|
237
|
-
} else {
|
|
238
|
-
resolve(response);
|
|
239
250
|
}
|
|
251
|
+
resolve(response);
|
|
240
252
|
})
|
|
241
253
|
.catch((error) => {
|
|
242
254
|
reject(error.response);
|
package/src/store/project.js
CHANGED
|
@@ -67,7 +67,7 @@ const actions = {
|
|
|
67
67
|
fetchCurrentUser: ({ commit }) => {
|
|
68
68
|
return HTTP.get(`/auth/me/`)
|
|
69
69
|
.then((response) => {
|
|
70
|
-
commit("SET_CURRENT_USER", response.data
|
|
70
|
+
commit("SET_CURRENT_USER", response.data);
|
|
71
71
|
})
|
|
72
72
|
.catch((error) => {
|
|
73
73
|
console.log(error);
|
|
@@ -88,7 +88,7 @@ const actions = {
|
|
|
88
88
|
|
|
89
89
|
fetchDocumentList: ({ commit, state }, parameters) => {
|
|
90
90
|
return HTTP.get(
|
|
91
|
-
`documents/?project=${state.projectId}&assignee=${state.currentUser}&limit=100&${parameters}`
|
|
91
|
+
`documents/?project=${state.projectId}&assignee=${state.currentUser.username}&limit=100&${parameters}`
|
|
92
92
|
)
|
|
93
93
|
.then((response) => {
|
|
94
94
|
if (response.data.results) {
|
package/src/utils/utils.js
CHANGED
|
@@ -30,10 +30,10 @@ export function navigateToNewDocumentURL(oldId, newId) {
|
|
|
30
30
|
window.location.replace(newUrl);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export function navigateToDocumentsList(path, projectId) {
|
|
33
|
+
export function navigateToDocumentsList(path, projectId, userId) {
|
|
34
34
|
if (!path) return;
|
|
35
35
|
|
|
36
|
-
const parameters = `?project=${projectId}&is_reviewed__exact=0`;
|
|
36
|
+
const parameters = `?project=${projectId}&is_reviewed__exact=0&assignee__id__exact=${userId}`;
|
|
37
37
|
|
|
38
38
|
const newPath = `${path}/${parameters}`;
|
|
39
39
|
|