@konfuzio/document-validation-ui 0.1.5-automatic-document-splitting-2 → 0.1.5-pre-release-1

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.
Files changed (38) hide show
  1. package/dist/css/app.css +1 -1
  2. package/dist/index.html +1 -1
  3. package/dist/js/app.js +1 -1
  4. package/dist/js/app.js.map +1 -1
  5. package/package.json +1 -1
  6. package/src/assets/images/ServerImage.vue +2 -2
  7. package/src/assets/images/SplitZigZag.vue +14 -47
  8. package/src/assets/scss/document_category.scss +1 -0
  9. package/src/assets/scss/document_dashboard.scss +0 -6
  10. package/src/assets/scss/document_edit.scss +46 -131
  11. package/src/assets/scss/document_top_bar.scss +1 -1
  12. package/src/assets/scss/variables.scss +3 -63
  13. package/src/components/DocumentAnnotations/AnnotationContent.vue +1 -1
  14. package/src/components/DocumentAnnotations/CategorizeModal.vue +2 -22
  15. package/src/components/DocumentAnnotations/DocumentAnnotations.vue +3 -11
  16. package/src/components/DocumentCategory.vue +5 -13
  17. package/src/components/DocumentDashboard.vue +6 -17
  18. package/src/components/DocumentEdit/DocumentEdit.vue +69 -207
  19. package/src/components/DocumentEdit/EditPages.vue +18 -29
  20. package/src/components/DocumentEdit/EditSidebar.vue +45 -95
  21. package/src/components/DocumentEdit/SplitOverview.vue +5 -4
  22. package/src/components/{DocumentModals/DocumentErrorModal.vue → DocumentError.vue} +4 -3
  23. package/src/components/DocumentPage/ScrollingDocument.vue +2 -2
  24. package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +20 -6
  25. package/src/components/{DocumentModals/NotOptimizedViewportModal.vue → NotOptimizedViewportModal.vue} +2 -2
  26. package/src/locales/de.json +2 -15
  27. package/src/locales/en.json +1 -15
  28. package/src/locales/es.json +1 -14
  29. package/src/store/document.js +19 -49
  30. package/src/store/edit.js +48 -66
  31. package/src/store/project.js +14 -14
  32. package/src/assets/images/MagicWandIcon.vue +0 -16
  33. package/src/assets/images/StarIcon.vue +0 -16
  34. package/src/assets/scss/splitting_confirmation_modal.scss +0 -41
  35. package/src/components/DocumentEdit/EditConfirmationModal.vue +0 -54
  36. package/src/components/DocumentEdit/SidebarButtons.vue +0 -53
  37. package/src/components/DocumentEdit/SplitInfoBar.vue +0 -19
  38. package/src/components/DocumentModals/SplittingSuggestionsModal.vue +0 -121
@@ -1,105 +1,75 @@
1
1
  <template>
2
2
  <div class="edit-sidebar">
3
- <div class="buttons-container">
4
- <div class="rotate-selected edit-buttons">
5
- <SidebarButtons
6
- :show-rotate-button="true"
7
- :button-disabled="buttonDisabled"
8
- :button-text="$t('rotate_selected')"
9
- :icon="'arrow-rotate-left'"
10
- @rotate="rotateLeft"
11
- />
12
-
13
- <SidebarButtons
14
- :show-rotate-button="true"
15
- :button-disabled="buttonDisabled"
16
- :button-text="$t('rotate_selected')"
17
- :icon="'arrow-rotate-right'"
18
- @rotate="rotateRight"
19
- />
3
+ <div class="sidebar-header">
4
+ <h3 class="sidebar-title">
5
+ {{ $t("edit_document") }}
6
+ </h3>
7
+ <p class="description">
8
+ {{ $t("edit_early_access") }}
9
+ </p>
10
+ <p class="description">
11
+ {{ $t("select_pages") }}
12
+ </p>
13
+ </div>
20
14
 
15
+ <div class="buttons-container">
16
+ <div class="rotate-selected rotate">
21
17
  <p :class="['pages-selected', buttonDisabled && 'disabled']">
22
18
  {{ selectedPages.length }} {{ $t("selected") }}
23
19
  </p>
20
+ <b-button
21
+ class="rotate-button primary-button"
22
+ :disabled="buttonDisabled"
23
+ @click="rotateLeft"
24
+ >
25
+ <div class="button-content">
26
+ <b-icon icon="arrow-rotate-left" class="is-small" />
27
+ <span class="button-text">{{ $t("rotate_selected") }}</span>
28
+ </div>
29
+ </b-button>
30
+ <b-button
31
+ class="rotate-button primary-button"
32
+ :disabled="buttonDisabled"
33
+ @click="rotateRight"
34
+ >
35
+ <div class="button-content">
36
+ <b-icon icon="arrow-rotate-right" class="is-small" />
37
+ <span class="button-text">{{ $t("rotate_selected") }}</span>
38
+ </div>
39
+ </b-button>
24
40
  </div>
25
41
 
26
- <div class="rotate-all edit-buttons">
27
- <SidebarButtons
28
- :show-rotate-button="true"
29
- :button-disabled="false"
30
- :button-text="$t('rotate_all')"
31
- :icon="'arrow-rotate-left'"
32
- @rotate="rotateAllLeft"
33
- />
34
-
35
- <SidebarButtons
36
- :show-rotate-button="true"
37
- :button-disabled="false"
38
- :button-text="$t('rotate_all')"
39
- :icon="'arrow-rotate-right'"
40
- @rotate="rotateAllRight"
41
- />
42
+ <div class="rotate-all rotate">
43
+ <b-button class="rotate-button primary-button" @click="rotateAllLeft">
44
+ <b-icon icon="arrow-rotate-left" class="is-small" />
45
+ <span class="button-text">{{ $t("rotate_all") }}</span>
46
+ </b-button>
47
+ <b-button class="rotate-button primary-button" @click="rotateAllRight">
48
+ <b-icon icon="arrow-rotate-right" class="is-small" />
49
+ <span class="button-text">{{ $t("rotate_all") }}</span>
50
+ </b-button>
42
51
  </div>
43
52
  </div>
44
- <div class="split smart-split">
45
- <b-tooltip
46
- multilined
47
- :active="!documentHasProposedSplit(selectedDocument)"
48
- position="is-bottom"
49
- class="bottom-aligned"
50
- :label="tooltipInfo"
51
- >
52
- <b-field>
53
- <b-switch
54
- :value="true"
55
- size="is-small"
56
- v-model="switchStatus"
57
- :disabled="!documentHasProposedSplit(selectedDocument)"
58
- >
59
- <span class="switch-text">{{ $t("smart_split") }}</span>
60
- <span
61
- v-if="documentHasProposedSplit(selectedDocument)"
62
- class="new-badge"
63
- >{{ newText }}</span
64
- >
65
- </b-switch>
66
- </b-field>
67
- </b-tooltip>
68
- </div>
69
53
  </div>
70
54
  </template>
71
55
 
72
56
  <script>
73
- import { mapState, mapGetters } from "vuex";
74
- import { nextTick } from "vue";
75
- import SidebarButtons from "./SidebarButtons";
76
-
77
57
  /**
78
58
  * This component renders buttons to rotate single pages or all pages
79
59
  * in edit mode
80
60
  * */
61
+
62
+ import { mapState } from "vuex";
63
+
81
64
  export default {
82
65
  name: "EditSidebar",
83
- components: {
84
- SidebarButtons,
85
- },
86
66
  data() {
87
67
  return {
88
68
  buttonDisabled: true,
89
- tooltipInfo: null,
90
- newText: this.$t("new"),
91
- switchStatus: true,
92
69
  };
93
70
  },
94
- props: {
95
- splitSuggestionsEnabled: {
96
- type: Boolean,
97
- },
98
- },
99
71
  computed: {
100
72
  ...mapState("edit", ["selectedPages"]),
101
- ...mapState("document", ["splittingSuggestions", "selectedDocument"]),
102
- ...mapGetters("document", ["documentHasProposedSplit"]),
103
73
  },
104
74
  watch: {
105
75
  selectedPages(newValue) {
@@ -109,26 +79,6 @@ export default {
109
79
  this.buttonDisabled = true;
110
80
  }
111
81
  },
112
- switchStatus(newValue) {
113
- if (this.splittingSuggestions && this.splittingSuggestions.length > 0)
114
- this.$emit("handle-splitting-suggestions", newValue);
115
- },
116
- splitSuggestionsEnabled(newValue) {
117
- if (!newValue) {
118
- this.switchStatus = false;
119
- }
120
- },
121
- },
122
- mounted() {
123
- this.tooltipInfo = this.$t("no_splitting_suggestions");
124
-
125
- nextTick(() => {
126
- if (this.newText) {
127
- this.newText = this.$t("new").toUpperCase();
128
- }
129
-
130
- this.switchStatus = this.splitSuggestionsEnabled;
131
- });
132
82
  },
133
83
  methods: {
134
84
  rotateLeft() {
@@ -112,7 +112,7 @@ export default {
112
112
  },
113
113
  computed: {
114
114
  ...mapState("document", ["selectedDocument", "pages"]),
115
- ...mapState("edit", ["updatedDocument", "pagesForPostprocess"]),
115
+ ...mapState("edit", ["updatedDocument", "documentPagesListForEditMode"]),
116
116
  },
117
117
  methods: {
118
118
  handleBackButton() {
@@ -162,11 +162,11 @@ export default {
162
162
  return name.split(".").slice(0, -1).join(".");
163
163
  },
164
164
  getImageUrl(page) {
165
- if (!this.pagesForPostprocess || !this.pages || !page) return;
165
+ if (!this.documentPagesListForEditMode || !this.pages || !page) return;
166
166
 
167
167
  // returns the first thumbnail in the pages array
168
168
  // for each new document
169
- const image = this.pagesForPostprocess.find(
169
+ const image = this.documentPagesListForEditMode.find(
170
170
  (p) => p.number === page.pages[0].number
171
171
  );
172
172
 
@@ -174,7 +174,8 @@ export default {
174
174
  },
175
175
  getRotation(pageId) {
176
176
  // rotate page
177
- return this.pagesForPostprocess?.find((p) => p.id === pageId)?.angle;
177
+ return this.documentPagesListForEditMode?.find((p) => p.id === pageId)
178
+ ?.angle;
178
179
  },
179
180
  },
180
181
  };
@@ -29,10 +29,11 @@
29
29
  </template>
30
30
 
31
31
  <script>
32
- import ErrorIcon from "../../assets/images/ErrorIcon";
32
+ import { mapState } from "vuex";
33
+ import ErrorIcon from "../assets/images/ErrorIcon";
33
34
 
34
35
  export default {
35
- name: "DocumentErrorModal",
36
+ name: "DocumentError",
36
37
  components: {
37
38
  ErrorIcon,
38
39
  },
@@ -53,4 +54,4 @@ export default {
53
54
  };
54
55
  </script>
55
56
 
56
- <style scoped lang="scss" src="../../assets/scss/document_error.scss"></style>
57
+ <style scoped lang="scss" src="../assets/scss/document_error.scss"></style>
@@ -11,7 +11,7 @@
11
11
  "
12
12
  >
13
13
  <ScrollingPage
14
- v-for="page in editMode ? pagesForPostprocess : pages"
14
+ v-for="page in editMode ? documentPagesListForEditMode : pages"
15
15
  :key="page.number"
16
16
  :page="page"
17
17
  :client-height="clientHeight"
@@ -58,7 +58,7 @@ export default {
58
58
  "selectedDocument",
59
59
  "loading",
60
60
  ]),
61
- ...mapState("edit", ["editMode", "pagesForPostprocess"]),
61
+ ...mapState("edit", ["editMode", "documentPagesListForEditMode"]),
62
62
  ...mapState("display", ["scale", "documentActionBar"]),
63
63
 
64
64
  pages() {
@@ -38,7 +38,7 @@
38
38
  </template>
39
39
 
40
40
  <script>
41
- import { mapState, mapGetters } from "vuex";
41
+ import { mapState } from "vuex";
42
42
  import ActionButtons from "../DocumentAnnotations/ActionButtons";
43
43
 
44
44
  export default {
@@ -83,6 +83,7 @@ export default {
83
83
  this.finishDisabled = !this.finishedReview;
84
84
  },
85
85
  methods: {
86
+ /** EDIT MODE */
86
87
  closeEditMode() {
87
88
  this.$store.dispatch("edit/disableEditMode");
88
89
  this.$store.dispatch("edit/setSplitOverview", false);
@@ -104,11 +105,24 @@ export default {
104
105
  // Enable the "next" button to go to the overview
105
106
  this.$store.dispatch("edit/setSplitOverview", true);
106
107
  this.$store.dispatch("edit/setSelectedPages", null);
107
- } else {
108
- // If we are in the overview (so more than 1 doc)
109
- // or in the edit mode (only 1 doc)
110
- // Show confirmation modal to user
111
- this.$store.dispatch("edit/setShowEditConfirmationModal", true);
108
+ }
109
+
110
+ // If we are in the overview (so more than 1 doc)
111
+ // or in the edit mode (only 1 doc)
112
+ else if (this.updatedDocument) {
113
+ // Send update request to the backend
114
+ this.$store
115
+ .dispatch("edit/editDocument", this.updatedDocument)
116
+ .catch((error) => {
117
+ this.$store.dispatch("document/createErrorMessage", {
118
+ error,
119
+ serverErrorMessage: this.$t("server_error"),
120
+ defaultErrorMessage: this.$t("edit_error"),
121
+ });
122
+ });
123
+
124
+ // Close edit mode
125
+ this.closeEditMode();
112
126
  }
113
127
  },
114
128
  handleFinishReview() {
@@ -24,7 +24,7 @@
24
24
  </template>
25
25
 
26
26
  <script>
27
- import Illustration from "../../assets/images/NotOptimizedIllustration";
27
+ import Illustration from "../assets/images/NotOptimizedIllustration";
28
28
 
29
29
  export default {
30
30
  name: "NotOptimizedViewportModal",
@@ -47,5 +47,5 @@ export default {
47
47
  <style
48
48
  scoped
49
49
  lang="scss"
50
- src="../../assets/scss/document_viewport_modal.scss"
50
+ src="../assets/scss/document_viewport_modal.scss"
51
51
  ></style>
@@ -110,21 +110,8 @@
110
110
  "new_multi_ann_description": "Wählen Sie ein Datenmodell aus den vorhandenen aus und deaktivieren Sie dann die Labels, die in diesem Dokument nicht vorhanden sind.",
111
111
  "drag_drop_columns_multi_ann": "Drag and Drop, um die Reihenfolge der Labels zu ändern",
112
112
  "error_creating_multi_ann": "Nicht alle Annotationen wurden erfolgreich erstellt.",
113
+ "disabled_finish_review": "Der Abschluss der Dokumentenprüfung ist erst möglich, nachdem alle Annotationen überarbeitet wurden, unabhängig davon, ob sie akzeptiert oder abgelehnt wurden.",
113
114
  "no_multi_ann_labelset_model": "Es gibt keine verfügbaren Label Sets, die mehrfach in diesem Dokument zu finden sind. Weitere Informationen finden Sie unter <a href='https://help.konfuzio.com/tutorials/advanced-document-extraction/index.html#multiple-annotation-sets' target='_blank'>diesem Link</a>.",
114
115
  "single_category_in_project": "Das aktuelle Projekt hat nur eine Kategorie. Um sie ändern zu können, sollte die neue zuerst dem Projekt hinzugefügt werden. Einzelheiten dazu finden Sie unter <a href='https://help.konfuzio.com/modules/categories/index.html#add-a-category' target='_blank'>diesem Link</a>.",
115
- "approved_annotations": "Die Kategorie kann nicht geändert werden, da bereits akzeptierte Annotationen oder manuell erstellte Annotationen zu diesem Dokument vorhanden sind.",
116
- "disabled_finish_review": "Der Abschluss der Dokumentenprüfung ist erst möglich, nachdem alle Annotationen überarbeitet wurden, unabhängig davon, ob sie akzeptiert oder abgelehnt wurden.",
117
- "split_modal_title": "Dokument aufteilen",
118
- "split_modal_body": "Wir haben Ihre Datei gescannt und <strong>{number_of_split_documents}</strong> verschiedene Dokumente gefunde. <strong>Wir empfehlen dringend,</strong> sie zu diesem Zeitpunkt aufzuteilen, da sonst alle Fortschritte, die Sie gemacht haben, aufgrund der erneuten Extraktion der Dokumentdaten verloren gehen.",
119
- "do_it_later": "Ich werde es später machen",
120
- "review_now": "Jetzt reviewen",
121
- "recommended": "Empfohlen",
122
- "smart_split": "Smart Split",
123
- "smart_split_suggestions": "Unsere Smart Split-Vorschläge sind grün hervorgehoben",
124
- "no_splitting_suggestions": "Dieses Dokument enthält keine Split-Vorschläge",
125
- "confirm_splitting": "Sind Sie sicher, dass Sie die Änderungen bestätigen möchten?",
126
- "splitting_warning": "Beachten Sie bitte, dass alle Annotationen, die Sie in diesem Dokument gemacht haben, nicht gespeichert werden, wenn Sie fortfahren.",
127
- "no": "Nein",
128
- "yes": "Ja",
129
- "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."
116
+ "approved_annotations": "Die Kategorie kann nicht geändert werden, da bereits akzeptierte Annotationen oder manuell erstellte Annotationen zu diesem Dokument vorhanden sind."
130
117
  }
@@ -114,19 +114,5 @@
114
114
  "disabled_finish_review": "Finishing the document review is only possible after all annotations have been revised, whether they are accepted or rejected.",
115
115
  "no_multi_ann_labelset_model": "There are no available label sets that can be found multiple times in this document. For more details, you can visit <a href='https://help.konfuzio.com/tutorials/advanced-document-extraction/index.html#multiple-annotation-sets' target='_blank'>this link</a>.",
116
116
  "single_category_in_project": "The current project has only one category. To be able to change it, the new one should be first added to the project. For details on how to do this, visit <a href='https://help.konfuzio.com/modules/categories/index.html#add-a-category' target='_blank'>this link</a>.",
117
- "approved_annotations": "It is not possible to change the current category since the document has approved or manually created annotations.",
118
- "split_modal_title": "Split the document",
119
- "split_modal_body": "We've scanned your file and found <strong>{number_of_split_documents}</strong> different documents. <strong>We strongly recommend</strong> splitting it at this stage, otherwise all the progress you’ve made will be lost due to document data re-extraction.",
120
- "do_it_later": "I'll do it later",
121
- "review_now": "Review now",
122
- "recommended": "Recommended",
123
- "smart_split": "Smart Split",
124
- "smart_split_suggestions": "Our Smart Split suggestions are highlighted in green",
125
- "no_splitting_suggestions": "This document does not have splitting suggestions",
126
- "confirm_splitting": "Are you sure you want to confirm the changes?",
127
- "splitting_warning": "Be aware that any annotations you have made in this document will not be saved if you proceed.",
128
- "no": "No",
129
- "yes": "Yes",
130
- "prepare_document": "Prepare the document",
131
- "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."
117
+ "approved_annotations": "It is not possible to change the current category since the document has approved or manually created annotations."
132
118
  }
@@ -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
  }
@@ -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
- await dispatch("fetchMissingAnnotations");
719
+ dispatch("fetchMissingAnnotations");
742
720
  commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
743
721
 
744
722
  if (!getters.annotationSetExists(response.data.annotation_set)) {
@@ -833,27 +811,25 @@ const actions = {
833
811
  },
834
812
 
835
813
  fetchMissingAnnotations: ({ commit, state, getters }) => {
836
- return new Promise((resolve, reject) => {
837
- HTTP.get(`/missing-annotations/?document=${state.documentId}&limit=100`)
838
- .then((response) => {
839
- commit("SET_MISSING_ANNOTATIONS", response.data.results);
840
- commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
841
- resolve(response);
842
- })
843
- .catch((error) => {
844
- reject(error.response);
845
- console.log(error);
846
- });
847
- });
814
+ return HTTP.get(
815
+ `/missing-annotations/?document=${state.documentId}&limit=100`
816
+ )
817
+ .then((response) => {
818
+ commit("SET_MISSING_ANNOTATIONS", response.data.results);
819
+ commit("SET_FINISHED_REVIEW", getters.isDocumentReviewFinished());
820
+ })
821
+ .catch((error) => {
822
+ console.log(error);
823
+ });
848
824
  },
849
825
 
850
826
  addMissingAnnotations: ({ commit, dispatch }, missingAnnotations) => {
851
827
  return new Promise((resolve, reject) => {
852
- HTTP.post(`/missing-annotations/`, missingAnnotations)
853
- .then(async (response) => {
828
+ return HTTP.post(`/missing-annotations/`, missingAnnotations)
829
+ .then((response) => {
854
830
  if (response.status === 201) {
855
831
  commit("SET_REJECTED_MISSING_ANNOTATIONS", null);
856
- await dispatch("fetchMissingAnnotations");
832
+ dispatch("fetchMissingAnnotations");
857
833
  }
858
834
 
859
835
  resolve(response);
@@ -867,10 +843,10 @@ const actions = {
867
843
 
868
844
  deleteMissingAnnotation: ({ commit, getters, dispatch }, id) => {
869
845
  return new Promise((resolve) => {
870
- HTTP.delete(`/missing-annotations/${id}/`)
871
- .then(async (response) => {
846
+ return HTTP.delete(`/missing-annotations/${id}/`)
847
+ .then((response) => {
872
848
  if (response.status === 204) {
873
- await dispatch("fetchMissingAnnotations");
849
+ dispatch("fetchMissingAnnotations");
874
850
  resolve(true);
875
851
  }
876
852
  })
@@ -911,11 +887,8 @@ const actions = {
911
887
  `documents/${state.documentId}/?fields=status_data,labeling_available`
912
888
  )
913
889
  .then((response) => {
914
- if (
915
- getters.isDocumentReadyToBeReviewed(response.data) ||
916
- getters.waitingForSplittingConfirmation(response.data)
917
- ) {
918
- // ready or has splitting suggestions
890
+ if (getters.isDocumentReadyToBeReviewed(response.data)) {
891
+ // ready
919
892
  return resolve(true);
920
893
  } else if (getters.documentHadErrorDuringExtraction(response.data)) {
921
894
  // error
@@ -1186,9 +1159,6 @@ const mutations = {
1186
1159
  UPDATE_FILE_NAME: (state, value) => {
1187
1160
  state.selectedDocument.data_file_name = value;
1188
1161
  },
1189
- SET_SPLITTING_SUGGESTIONS: (state, array) => {
1190
- state.splittingSuggestions = array;
1191
- },
1192
1162
  };
1193
1163
 
1194
1164
  export default {