@konfuzio/document-validation-ui 0.1.8-scoped-styles-6 → 0.1.8
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/css/chunk-vendors.css +5 -0
- 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 +0 -10
- package/src/assets/scss/categorize_modal.scss +1 -1
- package/src/assets/scss/choose_label_set_modal.scss +1 -1
- package/src/assets/scss/document_category.scss +11 -6
- package/src/assets/scss/document_edit.scss +1 -1
- package/src/assets/scss/{theme.scss → main.scss} +28 -30
- package/src/assets/scss/variables.scss +11 -1
- package/src/components/App.vue +2 -55
- package/src/components/DocumentAnnotations/AnnotationActionButtons.vue +9 -12
- package/src/components/DocumentAnnotations/AnnotationContent.vue +5 -5
- package/src/components/DocumentAnnotations/AnnotationRow.vue +2 -2
- package/src/components/DocumentAnnotations/AnnotationSetActionButtons.vue +7 -4
- package/src/components/DocumentAnnotations/CategorizeModal.vue +5 -3
- package/src/components/DocumentAnnotations/DocumentAnnotations.vue +4 -4
- package/src/components/DocumentAnnotations/EmptyAnnotation.vue +5 -5
- package/src/components/DocumentAnnotations/MultiAnnotationTableOverlay.vue +42 -10
- package/src/components/DocumentCategory.vue +5 -1
- package/src/components/DocumentEdit/DocumentEdit.vue +4 -10
- package/src/components/DocumentModals/SplittingSuggestionsModal.vue +15 -3
- package/src/components/DocumentPage/DocumentPage.vue +6 -6
- package/src/components/DocumentPage/DocumentToolbar.vue +16 -14
- package/src/components/DocumentPage/MultiAnnSelection.vue +4 -2
- package/src/components/DocumentTopBar/DocumentName.vue +3 -3
- package/src/components/DocumentTopBar/DocumentTopBar.vue +8 -8
- package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +10 -25
- package/src/components/DocumentTopBar/KeyboardActionsDescription.vue +4 -7
- package/src/main.js +1 -0
- package/src/store/document.js +8 -26
package/src/store/document.js
CHANGED
|
@@ -25,12 +25,10 @@ const state = {
|
|
|
25
25
|
annotationsMarkedAsMissing: null,
|
|
26
26
|
errorMessageWidth: null,
|
|
27
27
|
hoveredAnnotationSet: null,
|
|
28
|
-
finishedReview: false,
|
|
29
28
|
newAcceptedAnnotations: null,
|
|
30
29
|
selectedEntities: null,
|
|
31
30
|
serverError: false,
|
|
32
31
|
splittingSuggestions: null,
|
|
33
|
-
documentIsReviewed: false,
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
const getters = {
|
|
@@ -406,13 +404,15 @@ const getters = {
|
|
|
406
404
|
},
|
|
407
405
|
|
|
408
406
|
// Check if document is ready to be finished
|
|
409
|
-
|
|
407
|
+
isDocumentReadyToFinishReview: (state) => {
|
|
410
408
|
// check if all annotations have been revised
|
|
411
409
|
let notRevised;
|
|
412
410
|
|
|
413
411
|
const emptyAnnotations = [];
|
|
414
412
|
|
|
415
|
-
if (state.
|
|
413
|
+
if (state.labels.length === 0) return false;
|
|
414
|
+
|
|
415
|
+
if (state.annotationSets && state.annotationSets.length > 0) {
|
|
416
416
|
state.annotationSets.forEach((annSet) => {
|
|
417
417
|
annSet.labels.map((label) => {
|
|
418
418
|
// return only labels with empty annotations
|
|
@@ -443,10 +443,13 @@ const getters = {
|
|
|
443
443
|
) {
|
|
444
444
|
return true;
|
|
445
445
|
}
|
|
446
|
-
|
|
447
446
|
return false;
|
|
448
447
|
},
|
|
449
448
|
|
|
449
|
+
isDocumentReviewed: (state) => {
|
|
450
|
+
return state.selectedDocument.is_reviewed;
|
|
451
|
+
},
|
|
452
|
+
|
|
450
453
|
/**
|
|
451
454
|
* Get number of annotations pending review per annotation set
|
|
452
455
|
*/
|
|
@@ -703,9 +706,6 @@ const actions = {
|
|
|
703
706
|
setSplittingSuggestions: ({ commit }, value) => {
|
|
704
707
|
commit("SET_SPLITTING_SUGGESTIONS", value);
|
|
705
708
|
},
|
|
706
|
-
setDocumentIsReviewed: ({ commit }, value) => {
|
|
707
|
-
commit("SET_DOCUMENT_IS_REVIEWED", value);
|
|
708
|
-
},
|
|
709
709
|
|
|
710
710
|
/**
|
|
711
711
|
* Actions that use HTTP requests always return the axios promise,
|
|
@@ -742,8 +742,6 @@ const actions = {
|
|
|
742
742
|
commit("SET_ANNOTATIONS", annotations);
|
|
743
743
|
commit("SET_LABELS", labels);
|
|
744
744
|
commit("SET_SELECTED_DOCUMENT", response.data);
|
|
745
|
-
commit("SET_DOCUMENT_IS_REVIEWED", response.data.is_reviewed);
|
|
746
|
-
commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
|
|
747
745
|
|
|
748
746
|
if (rootState.project.projectId) {
|
|
749
747
|
projectId = rootState.project.projectId;
|
|
@@ -840,7 +838,6 @@ const actions = {
|
|
|
840
838
|
.then(async (response) => {
|
|
841
839
|
if (response.status === 201) {
|
|
842
840
|
await dispatch("fetchMissingAnnotations");
|
|
843
|
-
commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
|
|
844
841
|
|
|
845
842
|
if (!getters.annotationSetExists(response.data.annotation_set)) {
|
|
846
843
|
const documentData = await dispatch("fetchDocumentData");
|
|
@@ -876,7 +873,6 @@ const actions = {
|
|
|
876
873
|
.then(async (response) => {
|
|
877
874
|
if (response.status === 200) {
|
|
878
875
|
commit("UPDATE_ANNOTATION", response.data);
|
|
879
|
-
commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
|
|
880
876
|
commit("SET_NEW_ACCEPTED_ANNOTATIONS", null);
|
|
881
877
|
|
|
882
878
|
resolve(true);
|
|
@@ -895,7 +891,6 @@ const actions = {
|
|
|
895
891
|
.then(async (response) => {
|
|
896
892
|
if (response.status === 204) {
|
|
897
893
|
commit("DELETE_ANNOTATION", annotationId);
|
|
898
|
-
commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
|
|
899
894
|
|
|
900
895
|
resolve(true);
|
|
901
896
|
}
|
|
@@ -918,7 +913,6 @@ const actions = {
|
|
|
918
913
|
commit("UPDATE_FILE_NAME", response.data.data_file_name);
|
|
919
914
|
} else {
|
|
920
915
|
commit("SET_SELECTED_DOCUMENT", response.data);
|
|
921
|
-
commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
|
|
922
916
|
|
|
923
917
|
dispatch("pollDocumentEndpoint");
|
|
924
918
|
}
|
|
@@ -955,7 +949,6 @@ const actions = {
|
|
|
955
949
|
)
|
|
956
950
|
.then((response) => {
|
|
957
951
|
commit("SET_MISSING_ANNOTATIONS", response.data.results);
|
|
958
|
-
commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
|
|
959
952
|
resolve(true);
|
|
960
953
|
})
|
|
961
954
|
.catch((error) => {
|
|
@@ -972,7 +965,6 @@ const actions = {
|
|
|
972
965
|
if (response.status === 201) {
|
|
973
966
|
commit("SET_ANNOTATIONS_MARKED_AS_MISSING", null);
|
|
974
967
|
commit("ADD_MISSING_ANNOTATIONS", response.data);
|
|
975
|
-
commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
|
|
976
968
|
}
|
|
977
969
|
|
|
978
970
|
resolve(response);
|
|
@@ -990,7 +982,6 @@ const actions = {
|
|
|
990
982
|
.then((response) => {
|
|
991
983
|
if (response.status === 204) {
|
|
992
984
|
commit("DELETE_MISSING_ANNOTATION", id);
|
|
993
|
-
commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
|
|
994
985
|
resolve(true);
|
|
995
986
|
}
|
|
996
987
|
})
|
|
@@ -1226,9 +1217,6 @@ const mutations = {
|
|
|
1226
1217
|
SET_EDIT_ANNOTATION: (state, editAnnotation) => {
|
|
1227
1218
|
state.editAnnotation = editAnnotation;
|
|
1228
1219
|
},
|
|
1229
|
-
SET_FINISHED_REVIEW: (state, finishedReview) => {
|
|
1230
|
-
state.finishedReview = finishedReview;
|
|
1231
|
-
},
|
|
1232
1220
|
RESET_EDIT_ANNOTATION: (state) => {
|
|
1233
1221
|
state.editAnnotation = null;
|
|
1234
1222
|
},
|
|
@@ -1256,9 +1244,6 @@ const mutations = {
|
|
|
1256
1244
|
}
|
|
1257
1245
|
},
|
|
1258
1246
|
SET_SELECTED_DOCUMENT: (state, document) => {
|
|
1259
|
-
if (document.is_reviewed === true) {
|
|
1260
|
-
state.documentIsReviewed = true;
|
|
1261
|
-
}
|
|
1262
1247
|
state.selectedDocument = document;
|
|
1263
1248
|
|
|
1264
1249
|
// this is to handle cache when a document is edited or changed
|
|
@@ -1327,9 +1312,6 @@ const mutations = {
|
|
|
1327
1312
|
SET_SPLITTING_SUGGESTIONS: (state, array) => {
|
|
1328
1313
|
state.splittingSuggestions = array;
|
|
1329
1314
|
},
|
|
1330
|
-
SET_DOCUMENT_IS_REVIEWED: (state, value) => {
|
|
1331
|
-
state.documentIsReviewed = value;
|
|
1332
|
-
},
|
|
1333
1315
|
};
|
|
1334
1316
|
|
|
1335
1317
|
export default {
|