@konfuzio/document-validation-ui 0.1.5-automatic-document-splitting-3 → 0.1.5-styles-refactor
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/.DS_Store +0 -0
- package/src/api.js +31 -21
- package/src/assets/images/ServerImage.vue +5 -4
- package/src/assets/images/SplitZigZag.vue +14 -47
- package/src/assets/scss/document_category.scss +1 -0
- package/src/assets/scss/document_dashboard.scss +0 -6
- package/src/assets/scss/document_edit.scss +46 -131
- package/src/assets/scss/main.scss +666 -7
- package/src/assets/scss/variables.scss +0 -719
- package/src/components/App.vue +3 -2
- package/src/components/DocumentAnnotations/CategorizeModal.vue +2 -22
- package/src/components/DocumentAnnotations/DocumentAnnotations.vue +3 -11
- package/src/components/DocumentCategory.vue +5 -13
- package/src/components/DocumentDashboard.vue +6 -17
- package/src/components/DocumentEdit/DocumentEdit.vue +78 -220
- package/src/components/DocumentEdit/EditPages.vue +18 -29
- package/src/components/DocumentEdit/EditSidebar.vue +45 -95
- package/src/components/DocumentEdit/SplitOverview.vue +5 -4
- package/src/components/{DocumentModals/DocumentErrorModal.vue → DocumentError.vue} +4 -3
- package/src/components/DocumentPage/DocumentPage.vue +9 -7
- package/src/components/DocumentPage/ScrollingDocument.vue +34 -4
- package/src/components/DocumentPage/ScrollingPage.vue +4 -5
- package/src/components/DocumentThumbnails/DocumentThumbnails.vue +14 -11
- package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +20 -6
- package/src/components/{DocumentModals/NotOptimizedViewportModal.vue → NotOptimizedViewportModal.vue} +2 -2
- package/src/locales/de.json +2 -15
- package/src/locales/en.json +1 -15
- package/src/locales/es.json +1 -14
- package/src/store/display.js +7 -0
- package/src/store/document.js +16 -41
- package/src/store/edit.js +50 -68
- package/src/store/project.js +14 -14
- package/src/assets/images/MagicWandIcon.vue +0 -16
- package/src/assets/images/StarIcon.vue +0 -16
- package/src/assets/scss/splitting_confirmation_modal.scss +0 -41
- package/src/components/DocumentEdit/EditConfirmationModal.vue +0 -54
- package/src/components/DocumentEdit/SidebarButtons.vue +0 -53
- package/src/components/DocumentEdit/SplitInfoBar.vue +0 -19
- package/src/components/DocumentModals/SplittingSuggestionsModal.vue +0 -121
package/src/locales/es.json
CHANGED
|
@@ -112,18 +112,5 @@
|
|
|
112
112
|
"disabled_finish_review": "Solo es posible finalizar la revisión del documento si todas las anotaciones han sido revisadas, ya sea aceptadas o rechazadas.",
|
|
113
113
|
"no_multi_ann_labelset_model": "En este documento no hay grupos de etiquetas múltiples disponibles. Para más información, haz clic en <a href='https://help.konfuzio.com/tutorials/advanced-document-extraction/index.html#multiple-annotation-sets' target='_blank'>este enlace</a>.",
|
|
114
114
|
"single_category_in_project": "Este proyecto solo tiene una categoría. Para poder modificarla, es necesario agregar esta nueva categoría al proyecto. Para más información, visita <a href='https://help.konfuzio.com/modules/categories/index.html#add-a-category' target='_blank'>este enlace</a>.",
|
|
115
|
-
"approved_annotations": "No es posible cambiar la categoría, ya que existen anotaciones aceptadas o creadas manualmente en este documento."
|
|
116
|
-
"split_modal_title": "Dividir el documento",
|
|
117
|
-
"split_modal_body": "Hemos escaneado tu documento y hemos encontrado <strong>{number_of_split_documents}</strong> documentos diferentes. <strong>Te recomendamos</strong> dividir el documento en esta etapa, ya que de lo contrario se perderá el progreso logrado debido a una nueva extracción de los datos del documento.",
|
|
118
|
-
"do_it_later": "Lo haré luego",
|
|
119
|
-
"review_now": "Revisar ahora",
|
|
120
|
-
"recommended": "Recomendado",
|
|
121
|
-
"smart_split": "División Inteligente",
|
|
122
|
-
"smart_split_suggestions": "Nuestras sugerencias de División Inteligente están marcadas en color verde",
|
|
123
|
-
"no_splitting_suggestions": "Este documento no tiene sugerencias de división",
|
|
124
|
-
"confirm_splitting": "¿Seguro que quieres confirmar los cambios?",
|
|
125
|
-
"splitting_warning": "Ten en cuenta que se perderán las anotaciones que hayas confirmado en el documento.",
|
|
126
|
-
"no": "No",
|
|
127
|
-
"yes": "Sí",
|
|
128
|
-
"split_modal_no_suggestions": "Do you need to split the document? <strong>We strongly recommend</strong> splitting it at this stage, otherwise all the progress you’ve made will be lost in the future."
|
|
115
|
+
"approved_annotations": "No es posible cambiar la categoría, ya que existen anotaciones aceptadas o creadas manualmente en este documento."
|
|
129
116
|
}
|
package/src/store/display.js
CHANGED
|
@@ -29,6 +29,7 @@ const state = {
|
|
|
29
29
|
interactionBlocked: false,
|
|
30
30
|
documentActionBar: null, // document action bar properties
|
|
31
31
|
categorizeModalIsActive: false,
|
|
32
|
+
pageChangedFromThumbnail: false,
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const getters = {
|
|
@@ -209,6 +210,9 @@ const actions = {
|
|
|
209
210
|
setCategorizeModalIsActive: ({ commit }, value) => {
|
|
210
211
|
commit("SET_CATEGORIZE_MODAL_IS_ACTIVE", value);
|
|
211
212
|
},
|
|
213
|
+
setPageChangedFromThumbnail: ({ commit }, value) => {
|
|
214
|
+
commit("SET_PAGE_CHANGED_FROM_THUMBNAIL", value);
|
|
215
|
+
},
|
|
212
216
|
};
|
|
213
217
|
|
|
214
218
|
const mutations = {
|
|
@@ -235,6 +239,9 @@ const mutations = {
|
|
|
235
239
|
SET_CATEGORIZE_MODAL_IS_ACTIVE: (state, value) => {
|
|
236
240
|
state.categorizeModalIsActive = value;
|
|
237
241
|
},
|
|
242
|
+
SET_PAGE_CHANGED_FROM_THUMBNAIL: (state, value) => {
|
|
243
|
+
state.pageChangedFromThumbnail = value;
|
|
244
|
+
},
|
|
238
245
|
};
|
|
239
246
|
|
|
240
247
|
export default {
|
package/src/store/document.js
CHANGED
|
@@ -28,7 +28,6 @@ const state = {
|
|
|
28
28
|
newAcceptedAnnotations: null,
|
|
29
29
|
selectedEntities: null,
|
|
30
30
|
serverError: false,
|
|
31
|
-
splittingSuggestions: false,
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
const getters = {
|
|
@@ -420,20 +419,6 @@ const getters = {
|
|
|
420
419
|
}
|
|
421
420
|
},
|
|
422
421
|
|
|
423
|
-
/**
|
|
424
|
-
* If automatic splitting is enabled for the project
|
|
425
|
-
*/
|
|
426
|
-
waitingForSplittingConfirmation: () => (document) => {
|
|
427
|
-
return document && document.status_data === 41;
|
|
428
|
-
},
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* Show the Smart Split switch or not
|
|
432
|
-
*/
|
|
433
|
-
documentHasProposedSplit: () => (document) => {
|
|
434
|
-
return document.proposed_split && document.proposed_split.length > 0;
|
|
435
|
-
},
|
|
436
|
-
|
|
437
422
|
/**
|
|
438
423
|
* Joins all strings in a multi-entity Annotation array
|
|
439
424
|
* to look like a single string
|
|
@@ -604,9 +589,6 @@ const actions = {
|
|
|
604
589
|
setSelectedEntities: ({ commit }, entities) => {
|
|
605
590
|
commit("SET_SELECTED_ENTITIES", entities);
|
|
606
591
|
},
|
|
607
|
-
setSplittingSuggestions: ({ commit }, value) => {
|
|
608
|
-
commit("SET_SPLITTING_SUGGESTIONS", value);
|
|
609
|
-
},
|
|
610
592
|
|
|
611
593
|
/**
|
|
612
594
|
* Actions that use HTTP requests always return the axios promise,
|
|
@@ -653,10 +635,6 @@ const actions = {
|
|
|
653
635
|
});
|
|
654
636
|
}
|
|
655
637
|
|
|
656
|
-
if (getters.documentHasProposedSplit(response.data)) {
|
|
657
|
-
commit("SET_SPLITTING_SUGGESTIONS", response.data.proposed_split);
|
|
658
|
-
}
|
|
659
|
-
|
|
660
638
|
categoryId = response.data.category;
|
|
661
639
|
// TODO: add this validation to a method
|
|
662
640
|
isRecalculatingAnnotations = response.data.labeling_available !== 1;
|
|
@@ -738,7 +716,7 @@ const actions = {
|
|
|
738
716
|
HTTP.post(`/annotations/`, annotation)
|
|
739
717
|
.then(async (response) => {
|
|
740
718
|
if (response.status === 201) {
|
|
741
|
-
|
|
719
|
+
dispatch("fetchMissingAnnotations");
|
|
742
720
|
commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
|
|
743
721
|
|
|
744
722
|
if (!getters.annotationSetExists(response.data.annotation_set)) {
|
|
@@ -834,11 +812,13 @@ const actions = {
|
|
|
834
812
|
|
|
835
813
|
fetchMissingAnnotations: ({ commit, state, getters }) => {
|
|
836
814
|
return new Promise((resolve, reject) => {
|
|
837
|
-
HTTP.get(
|
|
815
|
+
return HTTP.get(
|
|
816
|
+
`/missing-annotations/?document=${state.documentId}&limit=100`
|
|
817
|
+
)
|
|
838
818
|
.then((response) => {
|
|
839
819
|
commit("SET_MISSING_ANNOTATIONS", response.data.results);
|
|
840
820
|
commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
|
|
841
|
-
resolve(
|
|
821
|
+
resolve(true);
|
|
842
822
|
})
|
|
843
823
|
.catch((error) => {
|
|
844
824
|
reject(error.response);
|
|
@@ -849,11 +829,11 @@ const actions = {
|
|
|
849
829
|
|
|
850
830
|
addMissingAnnotations: ({ commit, dispatch }, missingAnnotations) => {
|
|
851
831
|
return new Promise((resolve, reject) => {
|
|
852
|
-
HTTP.post(`/missing-annotations/`, missingAnnotations)
|
|
853
|
-
.then(
|
|
832
|
+
return HTTP.post(`/missing-annotations/`, missingAnnotations)
|
|
833
|
+
.then((response) => {
|
|
854
834
|
if (response.status === 201) {
|
|
855
835
|
commit("SET_REJECTED_MISSING_ANNOTATIONS", null);
|
|
856
|
-
|
|
836
|
+
dispatch("fetchMissingAnnotations");
|
|
857
837
|
}
|
|
858
838
|
|
|
859
839
|
resolve(response);
|
|
@@ -866,16 +846,16 @@ const actions = {
|
|
|
866
846
|
},
|
|
867
847
|
|
|
868
848
|
deleteMissingAnnotation: ({ commit, getters, dispatch }, id) => {
|
|
869
|
-
return new Promise((resolve) => {
|
|
870
|
-
HTTP.delete(`/missing-annotations/${id}/`)
|
|
871
|
-
.then(
|
|
849
|
+
return new Promise((resolve, reject) => {
|
|
850
|
+
return HTTP.delete(`/missing-annotations/${id}/`)
|
|
851
|
+
.then((response) => {
|
|
872
852
|
if (response.status === 204) {
|
|
873
|
-
|
|
853
|
+
dispatch("fetchMissingAnnotations");
|
|
874
854
|
resolve(true);
|
|
875
855
|
}
|
|
876
856
|
})
|
|
877
857
|
.catch((error) => {
|
|
878
|
-
|
|
858
|
+
reject(error.response);
|
|
879
859
|
console.log(error);
|
|
880
860
|
});
|
|
881
861
|
});
|
|
@@ -911,11 +891,8 @@ const actions = {
|
|
|
911
891
|
`documents/${state.documentId}/?fields=status_data,labeling_available`
|
|
912
892
|
)
|
|
913
893
|
.then((response) => {
|
|
914
|
-
if (
|
|
915
|
-
|
|
916
|
-
getters.waitingForSplittingConfirmation(response.data)
|
|
917
|
-
) {
|
|
918
|
-
// ready or has splitting suggestions
|
|
894
|
+
if (getters.isDocumentReadyToBeReviewed(response.data)) {
|
|
895
|
+
// ready
|
|
919
896
|
return resolve(true);
|
|
920
897
|
} else if (getters.documentHadErrorDuringExtraction(response.data)) {
|
|
921
898
|
// error
|
|
@@ -926,6 +903,7 @@ const actions = {
|
|
|
926
903
|
}
|
|
927
904
|
})
|
|
928
905
|
.catch((error) => {
|
|
906
|
+
reject(error.response);
|
|
929
907
|
console.log(error);
|
|
930
908
|
});
|
|
931
909
|
});
|
|
@@ -1186,9 +1164,6 @@ const mutations = {
|
|
|
1186
1164
|
UPDATE_FILE_NAME: (state, value) => {
|
|
1187
1165
|
state.selectedDocument.data_file_name = value;
|
|
1188
1166
|
},
|
|
1189
|
-
SET_SPLITTING_SUGGESTIONS: (state, array) => {
|
|
1190
|
-
state.splittingSuggestions = array;
|
|
1191
|
-
},
|
|
1192
1167
|
};
|
|
1193
1168
|
|
|
1194
1169
|
export default {
|
package/src/store/edit.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import myImports from "../api";
|
|
2
|
-
import { getURLQueryParam, navigateToNewDocumentURL } from "../utils/utils";
|
|
3
2
|
|
|
4
3
|
const HTTP = myImports.HTTP;
|
|
5
4
|
|
|
@@ -7,10 +6,9 @@ const state = {
|
|
|
7
6
|
editMode: false,
|
|
8
7
|
splitOverview: false,
|
|
9
8
|
isMultipleSelection: false,
|
|
10
|
-
|
|
9
|
+
documentPagesListForEditMode: [], // TODO: change name
|
|
11
10
|
selectedPages: [],
|
|
12
11
|
updatedDocument: [],
|
|
13
|
-
showEditConfirmationModal: false,
|
|
14
12
|
};
|
|
15
13
|
|
|
16
14
|
const actions = {
|
|
@@ -27,8 +25,8 @@ const actions = {
|
|
|
27
25
|
commit("SET_SPLIT_OVERVIEW", overview);
|
|
28
26
|
},
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
commit("
|
|
28
|
+
setDocumentPagesListForEditMode: ({ commit }, pages) => {
|
|
29
|
+
commit("SET_DOCUMENT_PAGES_FOR_EDIT_MODE", pages);
|
|
32
30
|
},
|
|
33
31
|
|
|
34
32
|
setUpdatedDocument: ({ commit }, updatedDocument) => {
|
|
@@ -59,41 +57,42 @@ const actions = {
|
|
|
59
57
|
},
|
|
60
58
|
|
|
61
59
|
rotatePage: ({ state, commit }, { page, direction }) => {
|
|
62
|
-
if (state.
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (
|
|
69
|
-
rotatedAngle
|
|
60
|
+
if (state.documentPagesListForEditMode.find((p) => p.id === page[0].id)) {
|
|
61
|
+
const documentPagesListForEditMode =
|
|
62
|
+
state.documentPagesListForEditMode.map((p) => {
|
|
63
|
+
let rotatedAngle;
|
|
64
|
+
if (direction === "left") {
|
|
65
|
+
rotatedAngle = p.angle - 90;
|
|
66
|
+
if (p.id === page[0].id) {
|
|
67
|
+
if (rotatedAngle === -270) {
|
|
68
|
+
rotatedAngle = 90;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
...p,
|
|
72
|
+
angle: rotatedAngle,
|
|
73
|
+
};
|
|
70
74
|
}
|
|
71
|
-
return
|
|
72
|
-
...p,
|
|
73
|
-
angle: rotatedAngle,
|
|
74
|
-
};
|
|
75
|
+
return p;
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
if (direction === "right") {
|
|
78
|
+
rotatedAngle = p.angle + 90;
|
|
79
|
+
if (p.id === page[0].id) {
|
|
80
|
+
if (rotatedAngle === 270) {
|
|
81
|
+
rotatedAngle = -90;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
...p,
|
|
85
|
+
angle: rotatedAngle,
|
|
86
|
+
};
|
|
83
87
|
}
|
|
84
|
-
return
|
|
85
|
-
...p,
|
|
86
|
-
angle: rotatedAngle,
|
|
87
|
-
};
|
|
88
|
+
return p;
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
});
|
|
90
|
+
});
|
|
92
91
|
|
|
93
|
-
commit("
|
|
92
|
+
commit("SET_DOCUMENT_PAGES_FOR_EDIT_MODE", documentPagesListForEditMode);
|
|
94
93
|
} else {
|
|
95
94
|
if (direction === "left") {
|
|
96
|
-
state.
|
|
95
|
+
state.documentPagesListForEditMode.push({
|
|
97
96
|
id: page.id,
|
|
98
97
|
number: page.number,
|
|
99
98
|
angle: -90,
|
|
@@ -103,7 +102,7 @@ const actions = {
|
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
if (direction === "right") {
|
|
106
|
-
state.
|
|
105
|
+
state.documentPagesListForEditMode.push({
|
|
107
106
|
id: page.id,
|
|
108
107
|
number: page.number,
|
|
109
108
|
angle: 90,
|
|
@@ -116,7 +115,7 @@ const actions = {
|
|
|
116
115
|
|
|
117
116
|
updateRotationToTheLeft: ({ state, commit }) => {
|
|
118
117
|
// updated the angles that will be sent to the backend
|
|
119
|
-
const array = state.
|
|
118
|
+
const array = state.documentPagesListForEditMode.map((p) => {
|
|
120
119
|
let rotatedAngle = p.angle - 90;
|
|
121
120
|
if (rotatedAngle === -270) {
|
|
122
121
|
rotatedAngle = 90;
|
|
@@ -127,12 +126,12 @@ const actions = {
|
|
|
127
126
|
};
|
|
128
127
|
});
|
|
129
128
|
|
|
130
|
-
commit("
|
|
129
|
+
commit("SET_DOCUMENT_PAGES_FOR_EDIT_MODE", array);
|
|
131
130
|
},
|
|
132
131
|
|
|
133
132
|
updateRotationToTheRight: ({ state, commit }) => {
|
|
134
133
|
// updated the angles that will be sent to the backend
|
|
135
|
-
const array = state.
|
|
134
|
+
const array = state.documentPagesListForEditMode.map((p) => {
|
|
136
135
|
let rotatedAngle = p.angle + 90;
|
|
137
136
|
if (rotatedAngle === 270) {
|
|
138
137
|
rotatedAngle = -90;
|
|
@@ -143,54 +142,40 @@ const actions = {
|
|
|
143
142
|
};
|
|
144
143
|
});
|
|
145
144
|
|
|
146
|
-
commit("
|
|
145
|
+
commit("SET_DOCUMENT_PAGES_FOR_EDIT_MODE", array);
|
|
147
146
|
},
|
|
148
147
|
|
|
149
148
|
editDocument: ({ rootState, dispatch }, editedDocument) => {
|
|
150
149
|
dispatch("document/startRecalculatingAnnotations", null, {
|
|
151
150
|
root: true,
|
|
152
151
|
});
|
|
153
|
-
|
|
154
|
-
const oldId = rootState.document.documentId;
|
|
155
|
-
|
|
156
|
-
return new Promise((resolve) => {
|
|
152
|
+
return new Promise((resolve, reject) => {
|
|
157
153
|
HTTP.post(
|
|
158
154
|
`/documents/${rootState.document.documentId}/postprocess/`,
|
|
159
155
|
editedDocument
|
|
160
156
|
)
|
|
161
157
|
.then(async (response) => {
|
|
162
158
|
if (response && response.status === 200) {
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
dispatch("document/pollDocumentEndpoint", null, {
|
|
174
|
-
root: true,
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
159
|
+
const newDocument = response.data[0];
|
|
160
|
+
const newId = newDocument.id;
|
|
161
|
+
|
|
162
|
+
await dispatch("document/setDocId", newId, {
|
|
163
|
+
root: true,
|
|
164
|
+
});
|
|
165
|
+
dispatch("document/pollDocumentEndpoint", null, {
|
|
166
|
+
root: true,
|
|
167
|
+
});
|
|
179
168
|
resolve(null);
|
|
180
169
|
} else {
|
|
181
170
|
resolve(response);
|
|
182
171
|
}
|
|
183
172
|
})
|
|
184
173
|
.catch((error) => {
|
|
185
|
-
|
|
174
|
+
reject(error.response);
|
|
186
175
|
console.log(error);
|
|
187
176
|
});
|
|
188
177
|
});
|
|
189
178
|
},
|
|
190
|
-
|
|
191
|
-
setShowEditConfirmationModal: ({ commit }, value) => {
|
|
192
|
-
commit("SET_SHOW_EDIT_CONFIRMATION_MODAL", value);
|
|
193
|
-
},
|
|
194
179
|
};
|
|
195
180
|
|
|
196
181
|
const mutations = {
|
|
@@ -202,8 +187,8 @@ const mutations = {
|
|
|
202
187
|
state.splitOverview = overview;
|
|
203
188
|
},
|
|
204
189
|
|
|
205
|
-
|
|
206
|
-
state.
|
|
190
|
+
SET_DOCUMENT_PAGES_FOR_EDIT_MODE: (state, pages) => {
|
|
191
|
+
state.documentPagesListForEditMode = pages;
|
|
207
192
|
},
|
|
208
193
|
|
|
209
194
|
SET_UPDATED_DOCUMENT: (state, updatedDocument) => {
|
|
@@ -215,9 +200,6 @@ const mutations = {
|
|
|
215
200
|
ADD_SELECTED_PAGE: (state, selectedPage) => {
|
|
216
201
|
state.selectedPages.push(selectedPage);
|
|
217
202
|
},
|
|
218
|
-
SET_SHOW_EDIT_CONFIRMATION_MODAL: (state, value) => {
|
|
219
|
-
state.showEditConfirmationModal = value;
|
|
220
|
-
},
|
|
221
203
|
};
|
|
222
204
|
|
|
223
205
|
export default {
|
package/src/store/project.js
CHANGED
|
@@ -3,7 +3,7 @@ const HTTP = myImports.HTTP;
|
|
|
3
3
|
|
|
4
4
|
const state = {
|
|
5
5
|
projectId: null,
|
|
6
|
-
currentUser: null
|
|
6
|
+
currentUser: null
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
const getters = {
|
|
@@ -11,13 +11,13 @@ const getters = {
|
|
|
11
11
|
* Gets label sets for an annotation set creation
|
|
12
12
|
*/
|
|
13
13
|
labelSetsFilteredForAnnotationSetCreation:
|
|
14
|
-
|
|
14
|
+
state => (labelsSet, annotationSets) => {
|
|
15
15
|
let returnLabels = [];
|
|
16
16
|
if (labelsSet) {
|
|
17
|
-
returnLabels = labelsSet.filter(
|
|
17
|
+
returnLabels = labelsSet.filter(labelSet => {
|
|
18
18
|
// check if label set has multiple and if not, if there's already an annotation set created
|
|
19
19
|
if (!labelSet.has_multiple_annotation_sets) {
|
|
20
|
-
const existingAnnotationSet = annotationSets.find(
|
|
20
|
+
const existingAnnotationSet = annotationSets.find(annSet => {
|
|
21
21
|
return annSet.id === labelSet.id;
|
|
22
22
|
});
|
|
23
23
|
return existingAnnotationSet;
|
|
@@ -27,7 +27,7 @@ const getters = {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
return returnLabels;
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const actions = {
|
|
@@ -38,10 +38,10 @@ const actions = {
|
|
|
38
38
|
fetchLabelSetDetails: ({ commit, state }, labelSetId) => {
|
|
39
39
|
return new Promise((resolve, reject) => {
|
|
40
40
|
HTTP.get(`label-sets/${labelSetId}/`)
|
|
41
|
-
.then(
|
|
41
|
+
.then(response => {
|
|
42
42
|
return resolve(response.data);
|
|
43
43
|
})
|
|
44
|
-
.catch(
|
|
44
|
+
.catch(error => {
|
|
45
45
|
reject(error);
|
|
46
46
|
console.log(error);
|
|
47
47
|
});
|
|
@@ -52,10 +52,10 @@ const actions = {
|
|
|
52
52
|
fetchLabelSets: ({ state }) => {
|
|
53
53
|
return new Promise((resolve, reject) => {
|
|
54
54
|
HTTP.get(`label-sets/?project=${state.projectId}`)
|
|
55
|
-
.then(
|
|
55
|
+
.then(response => {
|
|
56
56
|
return resolve(response.data.results);
|
|
57
57
|
})
|
|
58
|
-
.catch(
|
|
58
|
+
.catch(error => {
|
|
59
59
|
reject(error);
|
|
60
60
|
console.log(error);
|
|
61
61
|
});
|
|
@@ -64,17 +64,17 @@ const actions = {
|
|
|
64
64
|
|
|
65
65
|
fetchCurrentUser: ({ commit }) => {
|
|
66
66
|
return HTTP.get(`/auth/me/`)
|
|
67
|
-
.then(
|
|
67
|
+
.then(response => {
|
|
68
68
|
commit("SET_CURRENT_USER", response.data.username);
|
|
69
69
|
})
|
|
70
|
-
.catch(
|
|
70
|
+
.catch(error => {
|
|
71
71
|
console.log(error);
|
|
72
72
|
});
|
|
73
73
|
},
|
|
74
74
|
|
|
75
75
|
setCurrentUser: ({ commit }, currentUser) => {
|
|
76
76
|
commit("SET_CURRENT_USER", currentUser);
|
|
77
|
-
}
|
|
77
|
+
}
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
const mutations = {
|
|
@@ -83,7 +83,7 @@ const mutations = {
|
|
|
83
83
|
},
|
|
84
84
|
SET_CURRENT_USER: (state, currentUser) => {
|
|
85
85
|
state.currentUser = currentUser;
|
|
86
|
-
}
|
|
86
|
+
}
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
export default {
|
|
@@ -91,5 +91,5 @@ export default {
|
|
|
91
91
|
state,
|
|
92
92
|
actions,
|
|
93
93
|
mutations,
|
|
94
|
-
getters
|
|
94
|
+
getters
|
|
95
95
|
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg
|
|
3
|
-
width="19"
|
|
4
|
-
height="19"
|
|
5
|
-
viewBox="0 0 19 19"
|
|
6
|
-
fill="none"
|
|
7
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
-
>
|
|
9
|
-
<path
|
|
10
|
-
fill-rule="evenodd"
|
|
11
|
-
clip-rule="evenodd"
|
|
12
|
-
d="M11.5098 0.833984C11.97 0.833984 12.3431 1.20708 12.3431 1.66732V2.91732C12.3431 3.37755 11.97 3.75065 11.5098 3.75065C11.0496 3.75065 10.6765 3.37755 10.6765 2.91732V1.66732C10.6765 1.20708 11.0496 0.833984 11.5098 0.833984ZM6.70333 2.74473C7.02877 2.41929 7.55641 2.41929 7.88184 2.74473L8.76573 3.62861C9.09116 3.95405 9.09116 4.48169 8.76573 4.80712C8.44029 5.13256 7.91265 5.13256 7.58721 4.80712L6.70333 3.92324C6.37789 3.5978 6.37789 3.07017 6.70333 2.74473ZM16.2657 2.74473C16.5912 3.07017 16.5912 3.5978 16.2657 3.92324L15.3818 4.80712C15.0564 5.13256 14.5288 5.13256 14.2033 4.80712C13.8779 4.48169 13.8779 3.95405 14.2033 3.62861L15.0872 2.74473C15.4127 2.41929 15.9403 2.41929 16.2657 2.74473ZM9.73615 5.84407C10.0709 5.7353 10.4315 5.7353 10.7662 5.84407C11.0076 5.92251 11.1925 6.05549 11.3383 6.17918C11.4709 6.29182 11.6158 6.43668 11.7645 6.58543L12.4164 7.23737C12.5651 7.38607 12.71 7.53089 12.8226 7.66358C12.9463 7.80928 13.0793 7.99419 13.1578 8.23562C13.2665 8.57036 13.2665 8.93094 13.1578 9.26568C13.0793 9.50711 12.9463 9.69202 12.8226 9.83772C12.71 9.9704 12.5652 10.1152 12.4164 10.2639L10.4244 12.256C10.4242 12.2562 10.424 12.2564 10.4238 12.2566C10.4236 12.2568 10.4234 12.257 10.4232 12.2572L4.68113 17.9992C4.53242 18.148 4.3876 18.2928 4.25492 18.4055C4.10921 18.5291 3.9243 18.6621 3.68287 18.7406C3.34813 18.8493 2.98755 18.8493 2.65281 18.7406C2.41138 18.6621 2.22648 18.5291 2.08077 18.4055C1.94809 18.2928 1.80327 18.148 1.65456 17.9992L1.63578 17.9804L1.0214 17.366L1.0026 17.3473C0.853863 17.1986 0.709012 17.0537 0.596376 16.9211C0.472682 16.7754 0.339706 16.5904 0.26126 16.349C0.152497 16.0143 0.152497 15.6537 0.26126 15.319C0.339706 15.0775 0.472681 14.8926 0.596375 14.7469C0.709013 14.6142 0.853865 14.4694 1.0026 14.3207L6.74496 8.57836L8.73791 6.5854C8.88661 6.43667 9.03142 6.29182 9.1641 6.17918C9.30981 6.05549 9.49472 5.92251 9.73615 5.84407ZM7.33451 10.3458L2.19991 15.4804C2.02518 15.6552 1.93003 15.7512 1.86694 15.8255C1.86443 15.8285 1.86207 15.8313 1.85985 15.834C1.86207 15.8366 1.86443 15.8395 1.86694 15.8424C1.93003 15.9167 2.02518 16.0128 2.19991 16.1875L2.81429 16.8019C2.98902 16.9767 3.08509 17.0718 3.1594 17.1349C3.16236 17.1374 3.16518 17.1398 3.16785 17.142C3.17052 17.1398 3.17333 17.1374 3.17629 17.1349C3.2506 17.0718 3.34667 16.9766 3.5214 16.8019L8.656 11.6673L7.33451 10.3458ZM9.83451 10.4888L8.51302 9.16732L9.89762 7.78272C10.0724 7.60799 10.1684 7.51284 10.2427 7.44975C10.2457 7.44724 10.2485 7.44487 10.2512 7.44265C10.2538 7.44487 10.2567 7.44724 10.2596 7.44975C10.3339 7.51284 10.43 7.60799 10.6047 7.78272L11.2191 8.3971C11.3938 8.57183 11.489 8.66789 11.5521 8.74221C11.5546 8.74516 11.557 8.74798 11.5592 8.75065C11.557 8.75332 11.5546 8.75614 11.5521 8.75909C11.489 8.83341 11.3938 8.92947 11.2191 9.1042L9.83451 10.4888ZM15.2598 7.50065C15.2598 7.04041 15.6329 6.66732 16.0931 6.66732H17.3431C17.8034 6.66732 18.1765 7.04041 18.1765 7.50065C18.1765 7.96089 17.8034 8.33398 17.3431 8.33398H16.0931C15.6329 8.33398 15.2598 7.96089 15.2598 7.50065ZM14.2033 10.2447C14.5288 9.91929 15.0564 9.91929 15.3818 10.2447L16.2657 11.1286C16.5912 11.454 16.5912 11.9817 16.2657 12.3071C15.9403 12.6326 15.4127 12.6326 15.0872 12.3071L14.2033 11.4232C13.8779 11.0978 13.8779 10.5702 14.2033 10.2447Z"
|
|
13
|
-
fill="#41AF85"
|
|
14
|
-
/>
|
|
15
|
-
</svg>
|
|
16
|
-
</template>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg
|
|
3
|
-
width="16"
|
|
4
|
-
height="16"
|
|
5
|
-
viewBox="0 0 16 16"
|
|
6
|
-
fill="none"
|
|
7
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
-
>
|
|
9
|
-
<path
|
|
10
|
-
fill-rule="evenodd"
|
|
11
|
-
clip-rule="evenodd"
|
|
12
|
-
d="M2.99935 0.667969C3.36754 0.667969 3.66602 0.966446 3.66602 1.33464V2.33464H4.66602C5.03421 2.33464 5.33268 2.63311 5.33268 3.0013C5.33268 3.36949 5.03421 3.66797 4.66602 3.66797H3.66602V4.66797C3.66602 5.03616 3.36754 5.33464 2.99935 5.33464C2.63116 5.33464 2.33268 5.03616 2.33268 4.66797V3.66797H1.33268C0.964492 3.66797 0.666016 3.36949 0.666016 3.0013C0.666016 2.63311 0.964492 2.33464 1.33268 2.33464H2.33268V1.33464C2.33268 0.966446 2.63116 0.667969 2.99935 0.667969ZM8.66601 1.33464C8.94186 1.33464 9.18922 1.50452 9.28824 1.76198L10.4444 4.76789C10.6446 5.28859 10.7076 5.43863 10.7936 5.5597C10.88 5.68117 10.9861 5.7873 11.1076 5.87367C11.2287 5.95975 11.3787 6.02268 11.8994 6.22295L14.9053 7.37907C15.1628 7.47809 15.3327 7.72545 15.3327 8.0013C15.3327 8.27715 15.1628 8.52451 14.9053 8.62353L11.8994 9.77965C11.3787 9.97992 11.2287 10.0429 11.1076 10.1289C10.9861 10.2153 10.88 10.3214 10.7936 10.4429C10.7076 10.564 10.6446 10.714 10.4444 11.2347L9.28825 14.2406C9.18922 14.4981 8.94186 14.668 8.66602 14.668C8.39017 14.668 8.14281 14.4981 8.04379 14.2406L6.88767 11.2347C6.6874 10.714 6.62447 10.564 6.53838 10.4429C6.45201 10.3214 6.34588 10.2153 6.22441 10.1289C6.10335 10.0429 5.9533 9.97992 5.4326 9.77965L2.4267 8.62353C2.16923 8.52451 1.99935 8.27715 1.99935 8.0013C1.99935 7.72545 2.16923 7.47809 2.4267 7.37907L5.4326 6.22295C5.9533 6.02268 6.10335 5.95975 6.22441 5.87367C6.34588 5.7873 6.45201 5.68117 6.53838 5.5597C6.62447 5.43863 6.6874 5.28859 6.88767 4.76789L8.04378 1.76198C8.14281 1.50452 8.39017 1.33464 8.66601 1.33464ZM2.99935 10.668C3.36754 10.668 3.66602 10.9664 3.66602 11.3346V12.3346H4.66602C5.03421 12.3346 5.33268 12.6331 5.33268 13.0013C5.33268 13.3695 5.03421 13.668 4.66602 13.668H3.66602V14.668C3.66602 15.0362 3.36754 15.3346 2.99935 15.3346C2.63116 15.3346 2.33268 15.0362 2.33268 14.668V13.668H1.33268C0.964492 13.668 0.666016 13.3695 0.666016 13.0013C0.666016 12.6331 0.964492 12.3346 1.33268 12.3346H2.33268V11.3346C2.33268 10.9664 2.63116 10.668 2.99935 10.668Z"
|
|
13
|
-
fill="#41AF85"
|
|
14
|
-
/>
|
|
15
|
-
</svg>
|
|
16
|
-
</template>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
@import "./imports.scss";
|
|
2
|
-
|
|
3
|
-
.splitting-confirmation-modal {
|
|
4
|
-
.header {
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
gap: 8px;
|
|
8
|
-
padding-bottom: 15px;
|
|
9
|
-
font-weight: 500;
|
|
10
|
-
font-size: 18px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.content {
|
|
14
|
-
text-align: left;
|
|
15
|
-
font-weight: 400;
|
|
16
|
-
font-size: 14px;
|
|
17
|
-
color: $text-color;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.modal-card-foot {
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
gap: 10px;
|
|
24
|
-
|
|
25
|
-
.recommended {
|
|
26
|
-
font-weight: 600;
|
|
27
|
-
font-size: 11px;
|
|
28
|
-
background-color: rgba(255, 255, 255, 0.2);
|
|
29
|
-
padding: 2px 5px;
|
|
30
|
-
border-radius: 36px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.button {
|
|
34
|
-
width: 100%;
|
|
35
|
-
|
|
36
|
-
&.is-primary {
|
|
37
|
-
font-weight: 500;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section class="edit-confirmation-modal">
|
|
3
|
-
<b-modal v-model="isModalActive" :can-cancel="[]" class="edit-modal">
|
|
4
|
-
<section class="modal-card-body">
|
|
5
|
-
<div class="header">
|
|
6
|
-
<p class="modal-title">{{ $t("confirm_splitting") }}</p>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="content">{{ $t("splitting_warning") }}</div>
|
|
9
|
-
</section>
|
|
10
|
-
<footer class="modal-card-foot">
|
|
11
|
-
<b-button @click="closeModal">
|
|
12
|
-
{{ $t("no") }}
|
|
13
|
-
</b-button>
|
|
14
|
-
<b-button type="is-primary" @click="confirmChanges">
|
|
15
|
-
{{ $t("yes") }}
|
|
16
|
-
</b-button>
|
|
17
|
-
</footer>
|
|
18
|
-
</b-modal>
|
|
19
|
-
</section>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script>
|
|
23
|
-
import { mapState } from "vuex";
|
|
24
|
-
/**
|
|
25
|
-
* This component shows a modal to confirm the edit changes in the document
|
|
26
|
-
*/
|
|
27
|
-
export default {
|
|
28
|
-
name: "EditConfirmationModal",
|
|
29
|
-
data() {
|
|
30
|
-
return {
|
|
31
|
-
isModalActive: false,
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
computed: {
|
|
35
|
-
...mapState("edit", ["showEditConfirmationModal"]),
|
|
36
|
-
},
|
|
37
|
-
watch: {
|
|
38
|
-
showEditConfirmationModal(newValue) {
|
|
39
|
-
this.isModalActive = newValue;
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
methods: {
|
|
43
|
-
closeModal() {
|
|
44
|
-
this.isModalActive = false;
|
|
45
|
-
this.$store.dispatch("edit/setShowEditConfirmationModal", false);
|
|
46
|
-
},
|
|
47
|
-
confirmChanges() {
|
|
48
|
-
this.$emit("save-changes");
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<style scoped lang="scss" src="../../assets/scss/document_edit.scss"></style>
|