@konfuzio/document-validation-ui 0.1.5 → 0.1.6-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 (53) 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/MagicWandIcon.vue +16 -0
  7. package/src/assets/images/NotFoundIcon.vue +16 -0
  8. package/src/assets/images/SplitZigZag.vue +47 -14
  9. package/src/assets/images/StarIcon.vue +16 -0
  10. package/src/assets/scss/document_annotations.scss +9 -59
  11. package/src/assets/scss/document_category.scss +0 -1
  12. package/src/assets/scss/document_dashboard.scss +6 -0
  13. package/src/assets/scss/document_edit.scss +90 -46
  14. package/src/assets/scss/main.scss +689 -7
  15. package/src/assets/scss/splitting_confirmation_modal.scss +41 -0
  16. package/src/assets/scss/variables.scss +0 -657
  17. package/src/components/App.vue +3 -2
  18. package/src/components/DocumentAnnotations/AnnotationActionButtons.vue +153 -0
  19. package/src/components/DocumentAnnotations/AnnotationDetails.vue +21 -4
  20. package/src/components/DocumentAnnotations/AnnotationRow.vue +97 -34
  21. package/src/components/DocumentAnnotations/AnnotationSetActionButtons.vue +86 -0
  22. package/src/components/DocumentAnnotations/CategorizeModal.vue +24 -2
  23. package/src/components/DocumentAnnotations/DocumentAnnotations.vue +77 -81
  24. package/src/components/DocumentAnnotations/EmptyAnnotation.vue +16 -3
  25. package/src/components/DocumentAnnotations/ExtractingData.vue +3 -3
  26. package/src/components/DocumentAnnotations/index.js +0 -1
  27. package/src/components/DocumentCategory.vue +13 -5
  28. package/src/components/DocumentDashboard.vue +17 -6
  29. package/src/components/DocumentEdit/DocumentEdit.vue +208 -68
  30. package/src/components/DocumentEdit/EditConfirmationModal.vue +54 -0
  31. package/src/components/DocumentEdit/EditPages.vue +29 -18
  32. package/src/components/DocumentEdit/EditSidebar.vue +92 -45
  33. package/src/components/DocumentEdit/SidebarButtons.vue +53 -0
  34. package/src/components/DocumentEdit/SplitInfoBar.vue +19 -0
  35. package/src/components/DocumentEdit/SplitOverview.vue +4 -5
  36. package/src/components/{DocumentError.vue → DocumentModals/DocumentErrorModal.vue} +3 -4
  37. package/src/components/{NotOptimizedViewportModal.vue → DocumentModals/NotOptimizedViewportModal.vue} +2 -2
  38. package/src/components/DocumentModals/SplittingSuggestionsModal.vue +120 -0
  39. package/src/components/DocumentPage/ActionBar.vue +3 -3
  40. package/src/components/DocumentPage/ScrollingDocument.vue +38 -4
  41. package/src/components/DocumentPage/ScrollingPage.vue +4 -5
  42. package/src/components/DocumentThumbnails/DocumentThumbnails.vue +14 -11
  43. package/src/components/DocumentTopBar/DocumentTopBarButtons.vue +35 -30
  44. package/src/components/DocumentTopBar/KeyboardActionsDescription.vue +3 -1
  45. package/src/locales/de.json +19 -6
  46. package/src/locales/en.json +20 -6
  47. package/src/locales/es.json +19 -6
  48. package/src/store/display.js +7 -0
  49. package/src/store/document.js +81 -17
  50. package/src/store/edit.js +67 -48
  51. package/src/store/project.js +14 -14
  52. package/src/components/DocumentAnnotations/ActionButtons.vue +0 -257
  53. package/src/components/DocumentAnnotations/RejectedLabels.vue +0 -96
package/src/store/edit.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import myImports from "../api";
2
+ import { getURLQueryParam, navigateToNewDocumentURL } from "../utils/utils";
2
3
 
3
4
  const HTTP = myImports.HTTP;
4
5
 
@@ -6,9 +7,10 @@ const state = {
6
7
  editMode: false,
7
8
  splitOverview: false,
8
9
  isMultipleSelection: false,
9
- documentPagesListForEditMode: [], // TODO: change name
10
+ pagesForPostprocess: [],
10
11
  selectedPages: [],
11
12
  updatedDocument: [],
13
+ showEditConfirmationModal: false,
12
14
  };
13
15
 
14
16
  const actions = {
@@ -25,8 +27,8 @@ const actions = {
25
27
  commit("SET_SPLIT_OVERVIEW", overview);
26
28
  },
27
29
 
28
- setDocumentPagesListForEditMode: ({ commit }, pages) => {
29
- commit("SET_DOCUMENT_PAGES_FOR_EDIT_MODE", pages);
30
+ setPagesForPostprocess: ({ commit }, pages) => {
31
+ commit("SET_PAGES_FOR_POSTPROCESS", pages);
30
32
  },
31
33
 
32
34
  setUpdatedDocument: ({ commit }, updatedDocument) => {
@@ -57,42 +59,41 @@ const actions = {
57
59
  },
58
60
 
59
61
  rotatePage: ({ state, commit }, { page, direction }) => {
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
- };
62
+ if (state.pagesForPostprocess.find((p) => p.id === page[0].id)) {
63
+ const pagesForPostprocess = state.pagesForPostprocess.map((p) => {
64
+ let rotatedAngle;
65
+ if (direction === "left") {
66
+ rotatedAngle = p.angle - 90;
67
+ if (p.id === page[0].id) {
68
+ if (rotatedAngle === -270) {
69
+ rotatedAngle = 90;
74
70
  }
75
- return p;
71
+ return {
72
+ ...p,
73
+ angle: rotatedAngle,
74
+ };
76
75
  }
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
- };
76
+ return p;
77
+ }
78
+ if (direction === "right") {
79
+ rotatedAngle = p.angle + 90;
80
+ if (p.id === page[0].id) {
81
+ if (rotatedAngle === 270) {
82
+ rotatedAngle = -90;
87
83
  }
88
- return p;
84
+ return {
85
+ ...p,
86
+ angle: rotatedAngle,
87
+ };
89
88
  }
90
- });
89
+ return p;
90
+ }
91
+ });
91
92
 
92
- commit("SET_DOCUMENT_PAGES_FOR_EDIT_MODE", documentPagesListForEditMode);
93
+ commit("SET_PAGES_FOR_POSTPROCESS", pagesForPostprocess);
93
94
  } else {
94
95
  if (direction === "left") {
95
- state.documentPagesListForEditMode.push({
96
+ state.pagesForPostprocess.push({
96
97
  id: page.id,
97
98
  number: page.number,
98
99
  angle: -90,
@@ -102,7 +103,7 @@ const actions = {
102
103
  }
103
104
 
104
105
  if (direction === "right") {
105
- state.documentPagesListForEditMode.push({
106
+ state.pagesForPostprocess.push({
106
107
  id: page.id,
107
108
  number: page.number,
108
109
  angle: 90,
@@ -115,7 +116,7 @@ const actions = {
115
116
 
116
117
  updateRotationToTheLeft: ({ state, commit }) => {
117
118
  // updated the angles that will be sent to the backend
118
- const array = state.documentPagesListForEditMode.map((p) => {
119
+ const array = state.pagesForPostprocess.map((p) => {
119
120
  let rotatedAngle = p.angle - 90;
120
121
  if (rotatedAngle === -270) {
121
122
  rotatedAngle = 90;
@@ -126,12 +127,12 @@ const actions = {
126
127
  };
127
128
  });
128
129
 
129
- commit("SET_DOCUMENT_PAGES_FOR_EDIT_MODE", array);
130
+ commit("SET_PAGES_FOR_POSTPROCESS", array);
130
131
  },
131
132
 
132
133
  updateRotationToTheRight: ({ state, commit }) => {
133
134
  // updated the angles that will be sent to the backend
134
- const array = state.documentPagesListForEditMode.map((p) => {
135
+ const array = state.pagesForPostprocess.map((p) => {
135
136
  let rotatedAngle = p.angle + 90;
136
137
  if (rotatedAngle === 270) {
137
138
  rotatedAngle = -90;
@@ -142,13 +143,16 @@ const actions = {
142
143
  };
143
144
  });
144
145
 
145
- commit("SET_DOCUMENT_PAGES_FOR_EDIT_MODE", array);
146
+ commit("SET_PAGES_FOR_POSTPROCESS", array);
146
147
  },
147
148
 
148
149
  editDocument: ({ rootState, dispatch }, editedDocument) => {
149
150
  dispatch("document/startRecalculatingAnnotations", null, {
150
151
  root: true,
151
152
  });
153
+
154
+ const oldId = rootState.document.documentId;
155
+
152
156
  return new Promise((resolve, reject) => {
153
157
  HTTP.post(
154
158
  `/documents/${rootState.document.documentId}/postprocess/`,
@@ -156,15 +160,23 @@ const actions = {
156
160
  )
157
161
  .then(async (response) => {
158
162
  if (response && response.status === 200) {
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
- });
163
+ const newId = response.data[0].id;
164
+ dispatch("document/setSplittingSuggestions", null, { root: true });
165
+
166
+ if (newId !== oldId) {
167
+ if (getURLQueryParam("document")) {
168
+ navigateToNewDocumentURL(oldId, newId);
169
+ } else {
170
+ await dispatch("document/setDocId", newId, {
171
+ root: true,
172
+ });
173
+
174
+ dispatch("document/pollDocumentEndpoint", null, {
175
+ root: true,
176
+ });
177
+ }
178
+ }
179
+
168
180
  resolve(null);
169
181
  } else {
170
182
  resolve(response);
@@ -176,6 +188,10 @@ const actions = {
176
188
  });
177
189
  });
178
190
  },
191
+
192
+ setShowEditConfirmationModal: ({ commit }, value) => {
193
+ commit("SET_SHOW_EDIT_CONFIRMATION_MODAL", value);
194
+ },
179
195
  };
180
196
 
181
197
  const mutations = {
@@ -187,8 +203,8 @@ const mutations = {
187
203
  state.splitOverview = overview;
188
204
  },
189
205
 
190
- SET_DOCUMENT_PAGES_FOR_EDIT_MODE: (state, pages) => {
191
- state.documentPagesListForEditMode = pages;
206
+ SET_PAGES_FOR_POSTPROCESS: (state, pages) => {
207
+ state.pagesForPostprocess = pages;
192
208
  },
193
209
 
194
210
  SET_UPDATED_DOCUMENT: (state, updatedDocument) => {
@@ -200,6 +216,9 @@ const mutations = {
200
216
  ADD_SELECTED_PAGE: (state, selectedPage) => {
201
217
  state.selectedPages.push(selectedPage);
202
218
  },
219
+ SET_SHOW_EDIT_CONFIRMATION_MODAL: (state, value) => {
220
+ state.showEditConfirmationModal = value;
221
+ },
203
222
  };
204
223
 
205
224
  export default {
@@ -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
- state => (labelsSet, annotationSets) => {
14
+ (state) => (labelsSet, annotationSets) => {
15
15
  let returnLabels = [];
16
16
  if (labelsSet) {
17
- returnLabels = labelsSet.filter(labelSet => {
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(annSet => {
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(response => {
41
+ .then((response) => {
42
42
  return resolve(response.data);
43
43
  })
44
- .catch(error => {
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(response => {
55
+ .then((response) => {
56
56
  return resolve(response.data.results);
57
57
  })
58
- .catch(error => {
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(response => {
67
+ .then((response) => {
68
68
  commit("SET_CURRENT_USER", response.data.username);
69
69
  })
70
- .catch(error => {
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,257 +0,0 @@
1
- <template>
2
- <div class="action-buttons">
3
- <!-- loading -->
4
- <div v-if="isLoading && !finishReviewBtn">
5
- <b-notification :closable="false" class="loading-background">
6
- <b-loading :active="isLoading" :is-full-page="loadingOnFullPage">
7
- <b-icon icon="spinner" class="fa-spin loading-icon-size spinner" />
8
- </b-loading>
9
- </b-notification>
10
- </div>
11
-
12
- <!-- save button -->
13
- <b-button
14
- v-if="saveBtn && !isLoading && !publicView"
15
- :class="[
16
- 'annotation-save-btn text-btn',
17
- actionBar && 'action-bar-save-btn',
18
- actionBar ? 'tertiary-button' : 'primary-button',
19
- ]"
20
- type="is-primary"
21
- @click.stop="save"
22
- >
23
- {{ $t("save") }}
24
- </b-button>
25
-
26
- <!-- cancel button -->
27
- <b-button
28
- v-if="cancelBtn && !isLoading"
29
- class="is-small annotation-cancel-btn"
30
- icon-left="xmark"
31
- @click.stop="cancel"
32
- />
33
-
34
- <!-- decline button -->
35
- <div
36
- v-if="declineBtn && !isLoading && !saveBtn && !cancelBtn && !publicView"
37
- class="reject-decline-button-container"
38
- >
39
- <b-button
40
- type="is-ghost"
41
- class="reject-decline-btn decline-btn"
42
- @click.stop="decline"
43
- >
44
- {{ $t("decline") }}
45
- </b-button>
46
- </div>
47
-
48
- <!-- accept button -->
49
- <b-button
50
- v-if="acceptBtn && !isLoading && !saveBtn && !cancelBtn && !publicView"
51
- class="annotation-accept-btn primary-button"
52
- type="is-primary"
53
- @click.stop="accept"
54
- >
55
- {{ $t("accept") }}
56
- </b-button>
57
-
58
- <!-- reject button -->
59
- <div
60
- v-if="showReject && !isLoading && !cancelBtn && !saveBtn && !publicView"
61
- class="reject-decline-button-container"
62
- >
63
- <b-button
64
- type="is-ghost"
65
- class="reject-decline-btn reject-btn"
66
- @click.stop="reject"
67
- >
68
- {{ $t("reject_label") }}
69
- </b-button>
70
- </div>
71
-
72
- <!-- reject all labels -->
73
- <div
74
- v-if="
75
- !publicView && rejectAllEmptyBtn && !isLoading && !cancelBtn && !saveBtn
76
- "
77
- class="reject-decline-button-container reject-all"
78
- @mouseenter="mouseenterAnnotationSet('reject')"
79
- @mouseleave="mouseleaveAnnotationSet"
80
- >
81
- <b-button
82
- type="is-ghost"
83
- class="reject-decline-btn reject-btn reject-all-btn"
84
- :disabled="emptyLabelsLength(annotationSet) === 0"
85
- @click.stop="rejectAllEmpty"
86
- >
87
- {{ $t("reject_all_empty") }} ({{ emptyLabelsLength(annotationSet) }})
88
- </b-button>
89
- </div>
90
-
91
- <!-- accept all pending annotations -->
92
- <div
93
- v-if="!publicView && acceptAllBtn && !isLoading"
94
- class="accept-all"
95
- @mouseenter="mouseenterAnnotationSet('accept')"
96
- @mouseleave="mouseleaveAnnotationSet"
97
- >
98
- <b-button
99
- type="is-primary"
100
- class="accept-all-btn"
101
- :disabled="annotationsWithPendingReviewLength(annotationSet) === 0"
102
- @click.stop="acceptGroup"
103
- >
104
- {{ $t("accept_group") }} ({{
105
- annotationsWithPendingReviewLength(annotationSet)
106
- }})
107
- </b-button>
108
- </div>
109
-
110
- <!-- finish review button -->
111
- <b-tooltip
112
- :active="finishDisabled"
113
- position="is-bottom"
114
- multilined
115
- class="right-aligned finish-review"
116
- >
117
- <b-button
118
- v-if="finishReviewBtn && !publicView"
119
- :class="['finish-review-btn', 'text-btn', 'primary-button']"
120
- type="is-primary"
121
- :disabled="finishDisabled"
122
- @click.stop="finishReview"
123
- >
124
- <span v-if="!isLoading">
125
- {{ $t("finish_review") }}
126
- </span>
127
-
128
- <div v-else>
129
- <b-notification :closable="false" :class="['loading-background']">
130
- <b-loading :active="isLoading" :is-full-page="loadingOnFullPage">
131
- <b-icon
132
- icon="spinner"
133
- class="fa-spin loading-icon-size spinner"
134
- />
135
- </b-loading>
136
- </b-notification>
137
- </div>
138
- </b-button>
139
-
140
- <template #content> {{ $t("disabled_finish_review") }} </template>
141
- </b-tooltip>
142
- </div>
143
- </template>
144
- <script>
145
- /* Component for showing actions for each annotation row */
146
- import { mapState, mapGetters } from "vuex";
147
- export default {
148
- name: "ActionButtons",
149
- props: {
150
- saveBtn: {
151
- type: Boolean,
152
- },
153
- cancelBtn: {
154
- type: Boolean,
155
- },
156
- showReject: {
157
- type: Boolean,
158
- },
159
- isLoading: {
160
- type: Boolean,
161
- },
162
- acceptBtn: {
163
- type: Boolean,
164
- },
165
- // TODO: finishReviewBtn should not be here (see comment above for purpose of this component)
166
- finishReviewBtn: {
167
- type: Boolean,
168
- },
169
- // TODO: finishDisabled should not be here
170
- finishDisabled: {
171
- type: Boolean,
172
- },
173
- // TODO: handleReject should not be here
174
- handleReject: {
175
- type: Function,
176
- default: null,
177
- },
178
- // TODO: rejectAllEmptyBtn should not be here
179
- rejectAllEmptyBtn: {
180
- type: Boolean,
181
- },
182
- // TODO: annotationSet should not be needed on a UI only component
183
- annotationSet: {
184
- type: Object,
185
- default: null,
186
- },
187
- // TODO: acceptAllBtn should not be here
188
- acceptAllBtn: {
189
- type: Boolean,
190
- },
191
- declineBtn: {
192
- type: Boolean,
193
- },
194
- actionBar: {
195
- type: Boolean,
196
- required: false,
197
- },
198
- },
199
- data() {
200
- return {
201
- loadingOnFullPage: false,
202
- };
203
- },
204
- computed: {
205
- ...mapState("document", ["publicView", "missingAnnotations"]),
206
- ...mapGetters("document", [
207
- "emptyLabelsLength",
208
- "annotationsWithPendingReviewLength",
209
- ]),
210
- },
211
- methods: {
212
- save() {
213
- this.$emit("save");
214
- },
215
- cancel() {
216
- this.$emit("cancel");
217
- },
218
- accept() {
219
- this.$emit("accept");
220
- },
221
- reject() {
222
- this.$emit("reject");
223
- },
224
- mouseenterAnnotationSet(type) {
225
- if (type == "reject") {
226
- this.$emit("hover-annotation-set-to-reject");
227
- }
228
-
229
- if (type == "accept") {
230
- this.$emit("hover-annotation-set-to-accept");
231
- }
232
- },
233
- mouseleaveAnnotationSet() {
234
- this.$emit("leave-annotation-set-to-accept");
235
- this.$emit("leave-annotation-set-to-reject");
236
- },
237
- rejectAllEmpty() {
238
- this.$emit("reject-all-empty");
239
- },
240
- finishReview() {
241
- this.$emit("finish-review");
242
- },
243
- acceptGroup() {
244
- this.$emit("accept-group");
245
- },
246
- decline() {
247
- this.$emit("decline");
248
- },
249
- },
250
- };
251
- </script>
252
-
253
- <style
254
- scoped
255
- lang="scss"
256
- src="../../assets/scss/document_annotations.scss"
257
- ></style>
@@ -1,96 +0,0 @@
1
- <template>
2
- <div class="rejected-label-container">
3
- <p class="title">
4
- {{ `${$t("rejected")} (${missingAnnotations.length})` }}
5
- </p>
6
- <section class="rejected-tag-container">
7
- <b-taglist
8
- v-for="missingAnnotation in missingAnnotations"
9
- :key="missingAnnotation.id"
10
- >
11
- <b-tag
12
- attached
13
- closable
14
- aria-close-label="Close tag"
15
- :class="[
16
- isLoading && closedTag === missingAnnotation.id && 'loading-active',
17
- ]"
18
- @close="removeRejectedLabel(missingAnnotation.id)"
19
- >
20
- <span
21
- :class="[
22
- 'label-name',
23
- isLoading && closedTag === missingAnnotation.id && 'loading',
24
- ]"
25
- >
26
- {{ getLabelName(missingAnnotation.label) }}
27
- </span>
28
- </b-tag>
29
- <div class="tag-loading-container">
30
- <ActionButtons
31
- :is-loading="isLoading && closedTag === missingAnnotation.id"
32
- />
33
- </div>
34
- </b-taglist>
35
- </section>
36
- </div>
37
- </template>
38
-
39
- <script>
40
- import { mapState } from "vuex";
41
- import ActionButtons from "./ActionButtons.vue";
42
-
43
- export default {
44
- name: "RejectedLabels",
45
- components: { ActionButtons },
46
- props: {
47
- missingAnnotations: {
48
- default: null,
49
- type: Array,
50
- },
51
- },
52
-
53
- data() {
54
- return {
55
- isLoading: false,
56
- closedTag: null,
57
- };
58
- },
59
- computed: {
60
- ...mapState("document", ["labels"]),
61
- },
62
- methods: {
63
- removeRejectedLabel(id) {
64
- this.isLoading = true;
65
- this.closedTag = id;
66
-
67
- this.$store
68
- .dispatch("document/deleteMissingAnnotation", id)
69
- .catch((error) => {
70
- this.$store.dispatch("document/createErrorMessage", {
71
- error,
72
- serverErrorMessage: this.$t("server_error"),
73
- defaultErrorMessage: this.$t("edit_error"),
74
- });
75
- })
76
- .finally(() => {
77
- this.isLoading = false;
78
- this.closedTag = null;
79
- });
80
- },
81
- getLabelName(label) {
82
- if (!this.labels) return;
83
- const found = this.labels.find((l) => l.id === label);
84
- if (found) {
85
- return found.name;
86
- }
87
- },
88
- },
89
- };
90
- </script>
91
-
92
- <style
93
- scoped
94
- lang="scss"
95
- src="../../assets/scss/document_annotations.scss"
96
- ></style>