@konfuzio/document-validation-ui 0.1.8-pre-release-2 → 0.1.8-pre-release-3

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 (31) 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/.DS_Store +0 -0
  7. package/src/assets/scss/categorize_modal.scss +1 -1
  8. package/src/assets/scss/choose_label_set_modal.scss +1 -1
  9. package/src/assets/scss/document_category.scss +11 -6
  10. package/src/assets/scss/document_edit.scss +1 -1
  11. package/src/assets/scss/main.scss +19 -5
  12. package/src/assets/scss/variables.scss +1 -0
  13. package/src/components/DocumentAnnotations/AnnotationActionButtons.vue +9 -12
  14. package/src/components/DocumentAnnotations/AnnotationContent.vue +5 -5
  15. package/src/components/DocumentAnnotations/AnnotationRow.vue +2 -2
  16. package/src/components/DocumentAnnotations/AnnotationSetActionButtons.vue +7 -4
  17. package/src/components/DocumentAnnotations/CategorizeModal.vue +5 -3
  18. package/src/components/DocumentAnnotations/DocumentAnnotations.vue +4 -4
  19. package/src/components/DocumentAnnotations/EmptyAnnotation.vue +5 -5
  20. package/src/components/DocumentAnnotations/MultiAnnotationTableOverlay.vue +42 -10
  21. package/src/components/DocumentCategory.vue +5 -1
  22. package/src/components/DocumentEdit/DocumentEdit.vue +4 -10
  23. package/src/components/DocumentModals/SplittingSuggestionsModal.vue +15 -3
  24. package/src/components/DocumentPage/DocumentPage.vue +6 -6
  25. package/src/components/DocumentPage/DocumentToolbar.vue +16 -14
  26. package/src/components/DocumentPage/MultiAnnSelection.vue +4 -2
  27. package/src/components/DocumentTopBar/DocumentName.vue +3 -3
  28. package/src/components/DocumentTopBar/DocumentTopBar.vue +8 -8
  29. package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +10 -25
  30. package/src/components/DocumentTopBar/KeyboardActionsDescription.vue +4 -7
  31. package/src/store/document.js +6 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.8-pre-release-2",
3
+ "version": "0.1.8-pre-release-3",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
package/src/.DS_Store ADDED
Binary file
@@ -18,7 +18,7 @@
18
18
 
19
19
  .categorize-dropdown {
20
20
  width: 100%;
21
- border: 1px solid #d0d5dd;
21
+ border: 1px solid $grey-outline;
22
22
  height: 40px;
23
23
  cursor: pointer;
24
24
  box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
@@ -18,7 +18,7 @@
18
18
 
19
19
  .label-set-dropdown {
20
20
  width: 100%;
21
- border: 1px solid #d0d5dd;
21
+ border: 1px solid $grey-outline;
22
22
  height: 40px;
23
23
  cursor: pointer;
24
24
  box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
@@ -4,25 +4,30 @@
4
4
  cursor: pointer;
5
5
 
6
6
  &.split-mode {
7
- border: 1px solid $grey-detail;
7
+ border: 1px solid $grey-outline;
8
8
  border-radius: 4px;
9
9
  background-color: $white;
10
+
11
+ &:hover {
12
+ border-color: $grey-outline-dark;
13
+ background-color: transparent;
14
+ }
10
15
  }
11
16
 
12
17
  &.disabled {
13
18
  cursor: not-allowed;
14
19
  }
15
20
 
21
+ &:not(.split-mode) {
22
+ .category-drop-down {
23
+ border-right: $component-border;
24
+ }
25
+ }
16
26
  .category-drop-down {
17
27
  display: flex;
18
28
  height: 100%;
19
29
  align-items: center;
20
30
  padding: 0 8px 0 14px;
21
- border-right: $component-border;
22
-
23
- &:hover {
24
- background-color: $background;
25
- }
26
31
 
27
32
  .caret-section {
28
33
  padding-top: 5px;
@@ -74,7 +74,7 @@
74
74
 
75
75
  &.active-split {
76
76
  .lines {
77
- margin-left: 3px;
77
+ margin-left: 15px;
78
78
  margin-right: 3px;
79
79
  padding-right: 12px;
80
80
  }
@@ -245,14 +245,19 @@ body {
245
245
 
246
246
  .dropdown-menu {
247
247
  padding-top: 0px;
248
+ min-width: 40px;
248
249
  }
249
250
 
250
- a.dropdown-item.is-active {
251
- background-color: $primary;
252
- }
251
+ a.dropdown-item {
252
+ padding-right: 16px;
253
253
 
254
- a.dropdown-item.is-disabled {
255
- color: $grey-blue !important;
254
+ &.is-active {
255
+ background-color: $primary;
256
+ }
257
+
258
+ &.is-disabled {
259
+ color: $grey-blue !important;
260
+ }
256
261
  }
257
262
 
258
263
  &.dropdown-menu-animation {
@@ -296,6 +301,8 @@ body {
296
301
  }
297
302
 
298
303
  &.modal-400 {
304
+ position: absolute !important;
305
+
299
306
  .modal-content {
300
307
  max-width: 400px !important;
301
308
 
@@ -528,6 +535,12 @@ body {
528
535
  }
529
536
  }
530
537
 
538
+ &.full-height-tooltip {
539
+ .tooltip-trigger {
540
+ height: 100%;
541
+ }
542
+ }
543
+
531
544
  &.width-184 {
532
545
  .tooltip-content {
533
546
  width: 184px !important;
@@ -619,6 +632,7 @@ body {
619
632
  &.split-mode {
620
633
  .dropdown-trigger {
621
634
  font-size: 14px;
635
+ height: 38px;
622
636
  }
623
637
  }
624
638
 
@@ -19,6 +19,7 @@ $grey-low-opacity: rgba(133, 140, 154, 0.4);
19
19
  $grey-lighter-low-opacity: rgba(223, 224, 228, 0.5);
20
20
  $grey-lightest: #f0f0f0;
21
21
  $grey-outline: #d0d5dd;
22
+ $grey-outline-dark: #b5b5b5;
22
23
  $grey-detail: #e1e1e1;
23
24
  $subtle-grey: #f2f4f7;
24
25
  $subtlest-grey: #e3e4e5;
@@ -11,7 +11,7 @@
11
11
 
12
12
  <!-- save button -->
13
13
  <b-button
14
- v-if="saveBtn && !isLoading && !publicView && !documentIsReviewed"
14
+ v-if="saveBtn && !isLoading && !publicView && !isDocumentReviewed"
15
15
  :class="[
16
16
  'annotation-save-btn text-btn',
17
17
  actionBar && 'action-bar-save-btn',
@@ -25,7 +25,7 @@
25
25
 
26
26
  <!-- cancel button -->
27
27
  <b-button
28
- v-if="cancelBtn && !isLoading && !documentIsReviewed"
28
+ v-if="cancelBtn && !isLoading && !isDocumentReviewed"
29
29
  class="is-small annotation-cancel-btn"
30
30
  icon-left="xmark"
31
31
  @click.stop="cancel"
@@ -39,7 +39,7 @@
39
39
  !saveBtn &&
40
40
  !cancelBtn &&
41
41
  !publicView &&
42
- !documentIsReviewed
42
+ !isDocumentReviewed
43
43
  "
44
44
  class="missing-decline-button-container"
45
45
  >
@@ -60,7 +60,7 @@
60
60
  !saveBtn &&
61
61
  !cancelBtn &&
62
62
  !publicView &&
63
- !documentIsReviewed
63
+ !isDocumentReviewed
64
64
  "
65
65
  class="annotation-accept-btn primary-button"
66
66
  type="is-primary"
@@ -77,7 +77,7 @@
77
77
  !cancelBtn &&
78
78
  !saveBtn &&
79
79
  !publicView &&
80
- !documentIsReviewed
80
+ !isDocumentReviewed
81
81
  "
82
82
  class="missing-decline-button-container"
83
83
  >
@@ -92,7 +92,7 @@
92
92
 
93
93
  <!-- Restore not found annotations -->
94
94
  <b-button
95
- v-if="restoreBtn && !isLoading && !publicView && !documentIsReviewed"
95
+ v-if="restoreBtn && !isLoading && !publicView && !isDocumentReviewed"
96
96
  class="restore-btn"
97
97
  type="is-primary"
98
98
  @click.stop="restore"
@@ -103,7 +103,7 @@
103
103
  </template>
104
104
  <script>
105
105
  /* Component for showing actions for each annotation row */
106
- import { mapState } from "vuex";
106
+ import { mapGetters, mapState } from "vuex";
107
107
  export default {
108
108
  name: "AnnotationActionButtons",
109
109
  props: {
@@ -135,11 +135,8 @@ export default {
135
135
  },
136
136
  },
137
137
  computed: {
138
- ...mapState("document", [
139
- "publicView",
140
- "missingAnnotations",
141
- "documentIsReviewed",
142
- ]),
138
+ ...mapState("document", ["publicView", "missingAnnotations"]),
139
+ ...mapGetters("document", ["isDocumentReviewed"]),
143
140
  },
144
141
  methods: {
145
142
  save() {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div :id="annotation.id" ref="annotation" class="annotation">
3
3
  <span
4
- v-if="!publicView || !documentIsReviewed"
4
+ v-if="!publicView || !isDocumentReviewed"
5
5
  :id="annotation.id"
6
6
  ref="contentEditable"
7
7
  :class="[
@@ -71,6 +71,7 @@ export default {
71
71
  "isAnnotationInEditMode",
72
72
  "pageAtIndex",
73
73
  "getTextFromEntities",
74
+ "isDocumentReviewed",
74
75
  ]),
75
76
  ...mapGetters("display", ["bboxToRect"]),
76
77
  ...mapGetters("selection", ["isValueArray"]),
@@ -82,7 +83,6 @@ export default {
82
83
  "newAcceptedAnnotations",
83
84
  "selectedEntities",
84
85
  "showActionError",
85
- "documentIsReviewed",
86
86
  ]),
87
87
  annotationText() {
88
88
  if (this.isAnnotationBeingEdited) {
@@ -156,7 +156,7 @@ export default {
156
156
  this.$refs.contentEditable.textContent = text;
157
157
  },
158
158
  handleEditAnnotation(event) {
159
- if (this.publicView || this.documentIsReviewed) return;
159
+ if (this.publicView || this.isDocumentReviewed) return;
160
160
 
161
161
  if (event) {
162
162
  event.preventDefault();
@@ -164,7 +164,7 @@ export default {
164
164
 
165
165
  if (
166
166
  !this.publicView &&
167
- !this.documentIsReviewed &&
167
+ !this.isDocumentReviewed &&
168
168
  !this.isAnnotationBeingEdited &&
169
169
  !this.isLoading
170
170
  ) {
@@ -228,7 +228,7 @@ export default {
228
228
  event.preventDefault();
229
229
  },
230
230
  saveAnnotationChanges(event) {
231
- if (this.publicView || this.documentIsReviewed) return;
231
+ if (this.publicView || this.isDocumentReviewed) return;
232
232
 
233
233
  if (event) {
234
234
  event.preventDefault();
@@ -168,12 +168,12 @@ export default {
168
168
  "documentId",
169
169
  "showActionError",
170
170
  "missingAnnotations",
171
- "documentIsReviewed",
172
171
  ]),
173
172
  ...mapState("selection", ["spanSelection", "elementSelected"]),
174
173
  ...mapGetters("document", [
175
174
  "isAnnotationInEditMode",
176
175
  "annotationIsNotFound",
176
+ "isDocumentReviewed",
177
177
  ]),
178
178
  ...mapGetters("selection", ["isValueArray"]),
179
179
  defaultSpan() {
@@ -426,7 +426,7 @@ export default {
426
426
  );
427
427
  },
428
428
  handleSaveChanges(decline) {
429
- if (this.publicView || this.documentIsReviewed) return;
429
+ if (this.publicView || this.isDocumentReviewed) return;
430
430
 
431
431
  if (
432
432
  this.showAcceptButton() ||
@@ -2,7 +2,7 @@
2
2
  <div class="action-buttons">
3
3
  <!-- mark all empty labels as missing -->
4
4
  <div
5
- v-if="!publicView && !documentIsReviewed"
5
+ v-if="!publicView && !isDocumentReviewed"
6
6
  class="missing-decline-button-container all-missing"
7
7
  @mouseenter="mouseenterAnnotationSet('missing')"
8
8
  @mouseleave="mouseleaveAnnotationSet"
@@ -19,7 +19,7 @@
19
19
 
20
20
  <!-- accept all pending annotations -->
21
21
  <div
22
- v-if="!publicView && !documentIsReviewed"
22
+ v-if="!publicView && !isDocumentReviewed"
23
23
  class="accept-all"
24
24
  @mouseenter="mouseenterAnnotationSet('accept')"
25
25
  @mouseleave="mouseleaveAnnotationSet"
@@ -40,20 +40,23 @@
40
40
  <script>
41
41
  /* Component for showing actions for each Annotation Set */
42
42
 
43
- import { mapState } from "vuex";
43
+ import { mapGetters, mapState } from "vuex";
44
44
 
45
45
  export default {
46
46
  name: "AnnotationSetActionButtons",
47
47
  props: {
48
48
  numberOfEmptyLabelsInAnnotationSet: {
49
49
  type: Number,
50
+ default: 0,
50
51
  },
51
52
  numberOfPendingAnnotationsInAnnotationSet: {
52
53
  type: Number,
54
+ default: 0,
53
55
  },
54
56
  },
55
57
  computed: {
56
- ...mapState("document", ["publicView", "documentIsReviewed"]),
58
+ ...mapState("document", ["publicView"]),
59
+ ...mapGetters("document", ["isDocumentReviewed"]),
57
60
  },
58
61
  methods: {
59
62
  mouseenterAnnotationSet(type) {
@@ -110,10 +110,12 @@ export default {
110
110
  "categorizeModalIsActive",
111
111
  "splittingSuggestions",
112
112
  "publicView",
113
- "documentIsReviewed",
114
113
  ]),
115
114
  ...mapGetters("category", ["category", "projectHasSingleCategory"]),
116
- ...mapGetters("document", ["categorizationIsConfirmed"]),
115
+ ...mapGetters("document", [
116
+ "categorizationIsConfirmed",
117
+ "isDocumentReviewed",
118
+ ]),
117
119
 
118
120
  singleCategoryInProject() {
119
121
  // if only 1 category in the project, we don't enable the dropdown
@@ -185,7 +187,7 @@ export default {
185
187
  (!category || (category && !this.splittingSuggestions)) &&
186
188
  !this.categorizationIsConfirmed &&
187
189
  !this.publicView &&
188
- !this.documentIsReviewed;
190
+ !this.isDocumentReviewed;
189
191
  }
190
192
  },
191
193
  canCloseModal() {
@@ -17,7 +17,7 @@
17
17
  <CategorizeModal
18
18
  v-if="
19
19
  !publicView &&
20
- !documentIsReviewed &&
20
+ !isDocumentReviewed &&
21
21
  !waitingForSplittingConfirmation(selectedDocument)
22
22
  "
23
23
  />
@@ -25,7 +25,7 @@
25
25
  </div>
26
26
 
27
27
  <div v-else :class="['annotation-set-list']">
28
- <CategorizeModal v-if="!publicView || !documentIsReviewed" />
28
+ <CategorizeModal v-if="!publicView || !isDocumentReviewed" />
29
29
  <div
30
30
  v-if="Object.entries(annotationSetsInTable()).length > 0"
31
31
  class="annotation-set-group"
@@ -148,7 +148,6 @@ export default {
148
148
  "labels",
149
149
  "selectedDocument",
150
150
  "splittingSuggestions",
151
- "documentIsReviewed",
152
151
  ]),
153
152
  ...mapGetters("category", ["category"]),
154
153
  ...mapGetters("document", [
@@ -158,6 +157,7 @@ export default {
158
157
  "waitingForSplittingConfirmation",
159
158
  "annotationSetsToShowInList",
160
159
  "annotationSetsInTable",
160
+ "isDocumentReviewed",
161
161
  ]),
162
162
  isAnnotationBeingEdited() {
163
163
  return this.editAnnotation && this.editAnnotation.id;
@@ -231,7 +231,7 @@ export default {
231
231
 
232
232
  keyDownHandler(event) {
233
233
  // only allow keyboard navigation if we are not in public view mode
234
- if (this.publicView || this.documentIsReviewed) return;
234
+ if (this.publicView || this.isDocumentReviewed) return;
235
235
 
236
236
  // get out of edit mode and navigation
237
237
  if (event.key === "Escape") {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="empty-annotation">
3
3
  <span
4
- v-if="!publicView && !documentIsReviewed"
4
+ v-if="!publicView && !isDocumentReviewed"
5
5
  :id="emptyAnnotationId()"
6
6
  ref="emptyAnnotation"
7
7
  :class="[
@@ -76,6 +76,7 @@ export default {
76
76
  "isAnnotationInEditMode",
77
77
  "getTextFromEntities",
78
78
  "annotationIsNotFound",
79
+ "isDocumentReviewed",
79
80
  ]),
80
81
  ...mapGetters("selection", ["isValueArray"]),
81
82
  ...mapState("selection", ["spanSelection", "elementSelected"]),
@@ -84,7 +85,6 @@ export default {
84
85
  "publicView",
85
86
  "selectedEntities",
86
87
  "showActionError",
87
- "documentIsReviewed",
88
88
  ]),
89
89
  },
90
90
  watch: {
@@ -159,14 +159,14 @@ export default {
159
159
  handleEditEmptyAnnotation() {
160
160
  if (
161
161
  this.publicView ||
162
- this.documentIsReviewed ||
162
+ this.isDocumentReviewed ||
163
163
  this.annotationIsNotFound(this.annotationSet, this.label)
164
164
  )
165
165
  return;
166
166
 
167
167
  if (
168
168
  !this.publicView &&
169
- !this.documentIsReviewed &&
169
+ !this.isDocumentReviewed &&
170
170
  !this.isLoading &&
171
171
  this.elementSelected !== this.emptyAnnotationId()
172
172
  ) {
@@ -221,7 +221,7 @@ export default {
221
221
  }
222
222
  },
223
223
  saveEmptyAnnotationChanges(event) {
224
- if (this.publicView || this.documentIsReviewed) return;
224
+ if (this.publicView || this.isDocumentReviewed) return;
225
225
 
226
226
  if (event) {
227
227
  event.preventDefault();
@@ -21,7 +21,7 @@
21
21
  @columndragleave="columndragleave"
22
22
  >
23
23
  <b-table-column
24
- v-for="(item, index) in columns"
24
+ v-for="(item, index) in isLoading ? [columns[0]] : columns"
25
25
  :key="index"
26
26
  :field="item.field"
27
27
  :label="item.label.name"
@@ -31,14 +31,17 @@
31
31
  :ref="getDropdownReference(item)"
32
32
  aria-role="list"
33
33
  class="header-dropdown"
34
- position="is-top-left"
34
+ position="is-top-right"
35
35
  :close-on-click="false"
36
36
  @active-change="(e) => onDropdownChange(item, e)"
37
37
  >
38
38
  <template #trigger="{ active }">
39
- <DraggableIcon class="draggable" />
40
- <span :class="active ? 'active' : ''">{{ column.label }} </span>
39
+ <DraggableIcon v-if="!isLoading" class="draggable" />
40
+ <span v-if="!isLoading" :class="active ? 'active' : ''"
41
+ >{{ column.label }}
42
+ </span>
41
43
  <b-icon
44
+ v-if="!isLoading"
42
45
  :icon="active ? 'angle-up' : 'angle-down'"
43
46
  size="is-small"
44
47
  class="arrow"
@@ -63,7 +66,7 @@
63
66
  :key="label.id"
64
67
  aria-role="listitem"
65
68
  :disabled="label.disabled"
66
- ><span @click="changeLabel(item, label)">{{
69
+ ><span @click="!label.disabled && changeLabel(item, label)">{{
67
70
  label.name
68
71
  }}</span></b-dropdown-item
69
72
  >
@@ -73,7 +76,9 @@
73
76
 
74
77
  <template #default="props">
75
78
  <div class="annotations-table">
79
+ <b-skeleton v-if="isLoading" width="98%" height="90%" />
76
80
  <AnnotationRow
81
+ v-if="!isLoading"
77
82
  :annotation="props.row[item.field]"
78
83
  :label="item.label"
79
84
  :annotation-set="item.annotationSet"
@@ -120,6 +125,7 @@ export default {
120
125
  editingLabels: [],
121
126
  openDropdown: null,
122
127
  draggingColumnIndex: null,
128
+ isLoading: false,
123
129
  };
124
130
  },
125
131
  computed: {
@@ -136,6 +142,13 @@ export default {
136
142
  this.handleColumns();
137
143
  this.handleRows();
138
144
  },
145
+ columns(columns) {
146
+ if (!columns || (columns && columns.length === 0)) {
147
+ this.$store.dispatch("selection/disableSelection");
148
+ this.$store.dispatch("document/resetEditAnnotation");
149
+ this.$store.dispatch("display/showAnnSetTable", null);
150
+ }
151
+ },
139
152
  },
140
153
  mounted() {
141
154
  this.handleColumns();
@@ -212,6 +225,8 @@ export default {
212
225
  },
213
226
 
214
227
  async changeLabel(column, label) {
228
+ this.isLoading = true;
229
+ this.closeDropdown(column);
215
230
  for (let i = 0; i < this.rows.length; i++) {
216
231
  const annotationToUpdate = this.rows[i][column.label.id];
217
232
  await this.$store
@@ -227,12 +242,22 @@ export default {
227
242
  });
228
243
  });
229
244
  }
230
- this.closeDropdown(column);
245
+ this.isLoading = false;
231
246
  },
232
247
 
233
248
  async deleteColumn(column) {
249
+ this.isLoading = true;
250
+ this.closeDropdown(column);
251
+
252
+ const annotationsToDelete = [];
234
253
  for (let i = 0; i < this.rows.length; i++) {
235
254
  const annotationToDelete = this.rows[i][column.label.id];
255
+ if (annotationToDelete && annotationToDelete.id) {
256
+ annotationsToDelete.push(annotationToDelete);
257
+ }
258
+ }
259
+
260
+ annotationsToDelete.forEach(async (annotationToDelete) => {
236
261
  await this.$store
237
262
  .dispatch("document/deleteAnnotation", {
238
263
  annotationId: annotationToDelete.id,
@@ -244,8 +269,9 @@ export default {
244
269
  defaultErrorMessage: this.$t("edit_error"),
245
270
  });
246
271
  });
247
- }
248
- this.closeDropdown(column);
272
+ });
273
+
274
+ this.isLoading = false;
249
275
  },
250
276
 
251
277
  onDropdownChange(column, open) {
@@ -253,7 +279,10 @@ export default {
253
279
  this.$store.dispatch("selection/disableSelection");
254
280
  this.$store.dispatch("document/resetEditAnnotation");
255
281
  if (open) {
256
- if (this.openDropdown) {
282
+ if (
283
+ this.openDropdown &&
284
+ this.$refs[this.getDropdownReference(column)].length > 0
285
+ ) {
257
286
  this.$refs[this.openDropdown][0].toggle();
258
287
  }
259
288
  this.openDropdown = this.getDropdownReference(column);
@@ -265,7 +294,10 @@ export default {
265
294
  },
266
295
 
267
296
  closeDropdown(column) {
268
- if (this.openDropdown) {
297
+ if (
298
+ this.openDropdown &&
299
+ this.$refs[this.getDropdownReference(column)].length > 0
300
+ ) {
269
301
  this.$refs[this.getDropdownReference(column)][0].toggle();
270
302
  this.openDropdown = null;
271
303
  }
@@ -4,7 +4,11 @@
4
4
  :active="tooltipIsShown || dropdownIsDisabled"
5
5
  size="is-large"
6
6
  position="is-bottom"
7
- :class="[editMode ? 'right-aligned full-height-tooltip' : 'left-aligned']"
7
+ :class="[
8
+ editMode
9
+ ? 'right-aligned full-height-tooltip'
10
+ : 'left-aligned full-height-tooltip',
11
+ ]"
8
12
  :close-delay="tooltipCloseDelay"
9
13
  >
10
14
  <template #content>
@@ -184,17 +184,11 @@ export default {
184
184
  if (!this.splittingSuggestions) return;
185
185
 
186
186
  this.splittingSuggestions.map((item) => {
187
- const firstPage = this.selectedDocument.pages.find(
188
- (page) => page.id === item.pages[0].id
187
+ const lastPage = this.selectedDocument.pages.find(
188
+ (page) => page.id === item.pages[item.pages.length - 1].id
189
189
  );
190
190
 
191
- if (firstPage.number === 1 && item.pages.length > 1) {
192
- // only add the active splitting line from the 1st page of the second document
193
- // since it's the first splitting point
194
- return;
195
- }
196
-
197
- this.handleSplittingLines(firstPage.number, "AI");
191
+ this.handleSplittingLines(lastPage.number, "AI");
198
192
  });
199
193
  },
200
194
  applySplittingSuggestions(value) {
@@ -342,7 +336,7 @@ export default {
342
336
  );
343
337
 
344
338
  const singleSplittingSuggestion = this.splittingSuggestions.find(
345
- (item) => item.pages[0].id === foundPage.id
339
+ (item) => item.pages[item.pages.length - 1].id === foundPage.id
346
340
  );
347
341
 
348
342
  return this.splittingSuggestions.indexOf(singleSplittingSuggestion);
@@ -52,6 +52,7 @@ export default {
52
52
  },
53
53
  computed: {
54
54
  ...mapState("document", ["splittingSuggestions", "selectedDocument"]),
55
+ ...mapState("edit", ["editMode"]),
55
56
  ...mapGetters("document", ["waitingForSplittingConfirmation"]),
56
57
  },
57
58
  watch: {
@@ -60,6 +61,11 @@ export default {
60
61
  this.isModalActive = true;
61
62
  }
62
63
  },
64
+ editMode(newValue) {
65
+ if (!newValue) {
66
+ this.showModal();
67
+ }
68
+ },
63
69
  isModalActive(newValue) {
64
70
  if (newValue) {
65
71
  this.$nextTick(() => {
@@ -80,9 +86,7 @@ export default {
80
86
  },
81
87
  },
82
88
  mounted() {
83
- if (this.splittingSuggestions) {
84
- this.isModalActive = true;
85
- }
89
+ this.showModal();
86
90
 
87
91
  this.$nextTick(() => {
88
92
  if (this.recommended) {
@@ -91,6 +95,14 @@ export default {
91
95
  });
92
96
  },
93
97
  methods: {
98
+ showModal() {
99
+ if (
100
+ this.splittingSuggestions &&
101
+ this.waitingForSplittingConfirmation(this.selectedDocument)
102
+ ) {
103
+ this.isModalActive = true;
104
+ }
105
+ },
94
106
  closeModal() {
95
107
  const updatedDocument = [
96
108
  {