@konfuzio/document-validation-ui 0.1.13-dev.4 → 0.1.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.13-dev.4",
3
+ "version": "0.1.13",
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
@@ -99,245 +99,261 @@
99
99
  line-height: 20px;
100
100
  }
101
101
  }
102
- }
103
-
104
- .labels {
105
- .label {
106
- .label-group {
107
- display: flex;
108
- flex-direction: row;
109
- justify-content: space-between;
110
- align-items: center;
111
- border-bottom: 1px solid $grey-lightest;
112
- min-height: 44px;
113
- cursor: pointer;
114
102
 
115
- .label-group-left {
103
+ .labels {
104
+ .label {
105
+ .label-group {
116
106
  display: flex;
117
107
  flex-direction: row;
118
- padding-left: 28px;
119
- color: $text-lighter;
108
+ justify-content: space-between;
120
109
  align-items: center;
110
+ border-bottom: 1px solid $grey-lightest;
111
+ min-height: 44px;
112
+ cursor: pointer;
121
113
 
122
- .label-name {
123
- padding-left: 20px;
124
- }
125
- }
126
-
127
- .label-group-right {
128
- display: flex;
129
- flex-direction: row;
130
- font-weight: 400;
131
- font-size: 14px;
132
- line-height: 20px;
133
- padding-right: 16px;
134
- cursor: default;
135
-
136
- .label-annotations-pending {
137
- padding: 0px 8px;
138
- border-radius: 20px;
139
- background: $grey-lighter-low-opacity;
114
+ .label-group-left {
115
+ display: flex;
116
+ flex-direction: row;
117
+ padding-left: 28px;
140
118
  color: $text-lighter;
141
- margin-right: 4px;
142
- }
119
+ align-items: center;
143
120
 
144
- .label-annotations-accepted {
145
- padding: 0px 8px;
146
- border-radius: 20px;
147
- background: $green-low-opacity;
148
- color: $green;
121
+ .label-name {
122
+ padding-left: 20px;
123
+ }
149
124
  }
150
- }
151
- }
152
125
 
153
- .label-group-annotation-list {
154
- background-color: $grey-hover;
126
+ .label-group-right {
127
+ display: flex;
128
+ flex-direction: row;
129
+ font-weight: 400;
130
+ font-size: 14px;
131
+ line-height: 20px;
132
+ padding-right: 16px;
133
+ cursor: default;
134
+
135
+ .label-annotations-pending {
136
+ padding: 0px 8px;
137
+ border-radius: 20px;
138
+ background: $grey-lighter-low-opacity;
139
+ color: $text-lighter;
140
+ margin-right: 4px;
141
+ }
155
142
 
156
- .annotation-row {
157
- padding-left: 16px;
143
+ .label-annotations-accepted {
144
+ padding: 0px 8px;
145
+ border-radius: 20px;
146
+ background: $green-low-opacity;
147
+ color: $green;
148
+ }
149
+ }
158
150
  }
159
- }
160
-
161
- .label-name {
162
- color: $text-lighter;
163
- word-break: break-word;
164
- font-size: 14px;
165
- line-height: 20px;
166
- font-weight: 400;
167
- }
168
151
 
169
- .annotation-row {
170
- width: 100%;
171
- border-bottom: 1px solid $grey-lightest;
172
- transition: background-color 0.2s ease-out;
173
- display: flex;
174
- align-items: center;
175
- padding-right: 5px;
176
-
177
- .annotation-row-left {
178
- flex: 1;
179
- padding-left: 8px;
180
- display: flex;
181
- align-items: center;
152
+ .label-group-annotation-list {
153
+ background-color: $grey-hover;
182
154
 
183
- .annotation-icon {
184
- height: 40px;
185
- padding: 0 15px;
155
+ .annotation-row {
156
+ padding-left: 16px;
186
157
  }
158
+ }
187
159
 
188
- .label-name {
189
- padding: 10px 0;
190
- padding-right: 4px;
191
- }
160
+ .label-name {
161
+ color: $text-lighter;
162
+ word-break: break-word;
163
+ font-size: 14px;
164
+ line-height: 20px;
165
+ font-weight: 400;
192
166
  }
193
167
 
194
- .annotation-row-right {
195
- width: 60%;
168
+ .annotation-row {
169
+ width: 100%;
170
+ border-bottom: 1px solid $grey-lightest;
171
+ transition: background-color 0.2s ease-out;
196
172
  display: flex;
197
173
  align-items: center;
174
+ padding-right: 5px;
198
175
 
199
- .notification {
200
- background-color: transparent;
201
- }
202
-
203
- .annotation-content {
204
- width: 100%;
205
- font-size: 14px;
206
- line-height: 20px;
207
- font-weight: 400;
208
-
209
- .annotation,
210
- .empty-annotation {
211
- min-height: 36px;
212
- display: flex;
213
- align-items: center;
214
- }
215
-
216
- .loading-container {
217
- height: 20px;
218
- display: flex;
219
- align-items: center;
176
+ .annotation-row-left {
177
+ flex: 1;
178
+ padding-left: 8px;
179
+ display: flex;
180
+ align-items: center;
220
181
 
221
- .loading-icon-size {
222
- width: 13px;
223
- height: 13px;
224
- }
182
+ .annotation-icon {
183
+ height: 40px;
184
+ padding: 0 15px;
225
185
  }
226
186
 
227
- .spinner {
228
- color: $grey;
187
+ .label-name {
188
+ padding: 10px 0;
189
+ padding-right: 4px;
229
190
  }
230
191
  }
231
192
 
232
- .buttons-container {
193
+ .annotation-row-right {
194
+ width: 60%;
233
195
  display: flex;
234
- gap: 8px;
235
- }
196
+ align-items: center;
236
197
 
237
- .annotation-value {
238
- display: inline-block;
239
- color: $text;
240
- padding: 0 8px;
241
- border: none;
242
- background-color: transparent;
243
- inline-size: 100%;
244
- overflow-wrap: break-word;
245
- word-break: break-all;
246
-
247
- &:focus {
248
- outline: none;
198
+ .notification {
199
+ background-color: transparent;
249
200
  }
250
201
 
251
- &.label-empty {
252
- font-weight: 500;
202
+ .annotation-content {
203
+ width: 100%;
253
204
  font-size: 14px;
254
- color: $primary;
205
+ line-height: 20px;
206
+ font-weight: 400;
207
+
208
+ .annotation,
209
+ .empty-annotation {
210
+ min-height: 36px;
211
+ display: flex;
212
+ align-items: center;
213
+ }
214
+
215
+ .loading-container {
216
+ height: 20px;
217
+ display: flex;
218
+ align-items: center;
219
+
220
+ .loading-icon-size {
221
+ width: 13px;
222
+ height: 13px;
223
+ }
224
+ }
255
225
 
256
- &.clicked-ann {
257
- font-weight: 400;
258
- color: $text-lighter;
226
+ .spinner {
227
+ color: $grey;
259
228
  }
260
229
  }
261
- }
262
- }
263
230
 
264
- .empty-annotation {
265
- display: flex;
266
- width: 100%;
267
- justify-content: space-between;
268
- }
231
+ .buttons-container {
232
+ display: flex;
233
+ gap: 8px;
234
+ }
269
235
 
270
- &:hover,
271
- &.selected {
272
- background-color: $grey-lightest;
273
- }
236
+ .annotation-value {
237
+ display: inline-block;
238
+ color: $text;
239
+ padding: 0 8px;
240
+ border: none;
241
+ background-color: transparent;
242
+ inline-size: 100%;
243
+ overflow-wrap: break-word;
244
+ word-break: break-all;
245
+
246
+ &:focus {
247
+ outline: none;
248
+ }
274
249
 
275
- &.hovered-empty-labels {
276
- background-color: $grey-lightest;
277
- border-bottom-color: $grey-detail;
278
- }
250
+ &.label-empty {
251
+ font-weight: 500;
252
+ font-size: 14px;
253
+ color: $primary;
279
254
 
280
- &.hovered-pending-annotations {
281
- position: relative;
282
- border-bottom-color: $primary;
255
+ &.clicked-ann {
256
+ font-weight: 400;
257
+ color: $text-lighter;
258
+ }
259
+ }
260
+ }
261
+ }
283
262
 
284
- &:before {
285
- display: block;
286
- content: "";
263
+ .empty-annotation {
264
+ display: flex;
287
265
  width: 100%;
288
- height: 100%;
289
- background: $primary;
290
- opacity: 0.1;
291
- position: absolute;
292
- top: 0;
293
- left: 0;
266
+ justify-content: space-between;
294
267
  }
295
- }
296
268
 
297
- &.editing {
298
- background-color: $background;
299
- border-bottom: 1px solid $primary;
300
- }
269
+ &:hover,
270
+ &.selected {
271
+ background-color: $grey-lightest;
272
+ }
301
273
 
302
- .not-found-text {
303
- color: $grey;
304
- opacity: 0.3;
305
- }
274
+ &.hovered-empty-labels {
275
+ background-color: $grey-lightest;
276
+ border-bottom-color: $grey-detail;
277
+ }
306
278
 
307
- .saving-changes {
308
- color: $grey;
309
- }
279
+ &.hovered-pending-annotations {
280
+ position: relative;
281
+ border-bottom-color: $primary;
282
+
283
+ &:before {
284
+ display: block;
285
+ content: "";
286
+ width: 100%;
287
+ height: 100%;
288
+ background: $primary;
289
+ opacity: 0.1;
290
+ position: absolute;
291
+ top: 0;
292
+ left: 0;
293
+ }
294
+ }
310
295
 
311
- .error-editing {
312
- color: $red;
313
- animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
314
- transform: translate3d(0, 0, 0);
315
- }
296
+ &.editing {
297
+ background-color: $background;
298
+ border-bottom: 1px solid $primary;
299
+ }
316
300
 
317
- @keyframes shake {
318
- 10%,
319
- 90% {
320
- transform: translate3d(-1px, 0, 0);
301
+ .not-found-text {
302
+ color: $grey;
303
+ opacity: 0.3;
321
304
  }
322
305
 
323
- 20%,
324
- 80% {
325
- transform: translate3d(2px, 0, 0);
306
+ .saving-changes {
307
+ color: $grey;
326
308
  }
327
309
 
328
- 30%,
329
- 50%,
330
- 70% {
331
- transform: translate3d(-4px, 0, 0);
310
+ .error-editing {
311
+ color: $red;
312
+ animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
313
+ transform: translate3d(0, 0, 0);
332
314
  }
333
315
 
334
- 40%,
335
- 60% {
336
- transform: translate3d(4px, 0, 0);
316
+ @keyframes shake {
317
+ 10%,
318
+ 90% {
319
+ transform: translate3d(-1px, 0, 0);
320
+ }
321
+
322
+ 20%,
323
+ 80% {
324
+ transform: translate3d(2px, 0, 0);
325
+ }
326
+
327
+ 30%,
328
+ 50%,
329
+ 70% {
330
+ transform: translate3d(-4px, 0, 0);
331
+ }
332
+
333
+ 40%,
334
+ 60% {
335
+ transform: translate3d(4px, 0, 0);
336
+ }
337
337
  }
338
338
  }
339
339
  }
340
340
  }
341
+
342
+ .no-labels {
343
+ display: flex;
344
+ gap: 5px;
345
+ padding-left: 28px;
346
+ color: $text-lighter;
347
+ font-size: 14px;
348
+ line-height: 20px;
349
+ min-height: 44px;
350
+
351
+ a {
352
+ color: $white;
353
+ text-decoration: underline;
354
+ font-weight: 500;
355
+ }
356
+ }
341
357
  }
342
358
  }
343
359
 
@@ -508,6 +508,7 @@
508
508
  .b-tooltip {
509
509
  height: 100%;
510
510
  align-items: center;
511
+
511
512
  .tooltip-content {
512
513
  background-color: $text-color !important;
513
514
 
@@ -785,4 +786,16 @@
785
786
  }
786
787
  }
787
788
  }
789
+
790
+ .no-labels {
791
+ a {
792
+ color: (var(--primary-color));
793
+ text-decoration: underline;
794
+ font-weight: 500;
795
+
796
+ &:hover {
797
+ filter: brightness(0.8) contrast(160%) grayscale(0.4);
798
+ }
799
+ }
800
+ }
788
801
  }
@@ -84,7 +84,7 @@
84
84
  >{{ Math.floor(confidence(annotation) * 100) / 100 }}</span
85
85
  >
86
86
  </div>
87
- <div v-if="!publicView" class="revision">
87
+ <div class="revision" v-if="!publicView">
88
88
  <div class="detail-icons">
89
89
  <div v-if="created(annotation) || edited(annotation)">
90
90
  <div
@@ -54,7 +54,10 @@
54
54
  )}`
55
55
  }}
56
56
  </div>
57
- <div class="labelset-action-buttons">
57
+ <div
58
+ class="labelset-action-buttons"
59
+ v-if="annotationSet.labels.length !== 0"
60
+ >
58
61
  <AnnotationSetActionButtons
59
62
  :number-of-empty-labels-in-annotation-set="
60
63
  emptyLabelsLength(annotationSet)
@@ -82,19 +85,33 @@
82
85
  </div>
83
86
  </div>
84
87
 
85
- <div v-for="label in annotationSet.labels" :key="label.id">
86
- <div
87
- v-if="!(label.annotations.length === 0 && publicView)"
88
- class="labels"
89
- >
90
- <DocumentLabel
91
- :label="label"
92
- :annotation-set="annotationSet"
93
- :index-group="indexGroup"
94
- @handle-missing-annotation="markAnnotationsAsMissing"
95
- />
88
+ <div v-if="annotationSet.labels.length > 0">
89
+ <div v-for="label in annotationSet.labels" :key="label.id">
90
+ <div
91
+ v-if="!(label.annotations.length === 0 && publicView)"
92
+ class="labels"
93
+ >
94
+ <DocumentLabel
95
+ :label="label"
96
+ :annotation-set="annotationSet"
97
+ :index-group="indexGroup"
98
+ @handle-missing-annotation="markAnnotationsAsMissing"
99
+ />
100
+ </div>
96
101
  </div>
97
102
  </div>
103
+
104
+ <div v-if="annotationSet.labels.length === 0" class="no-labels">
105
+ <span> {{ $t("no_labels_in_set") }}</span>
106
+ <span v-if="!publicView" v-html="$t('link_to_add_labels')"></span>
107
+ </div>
108
+
109
+ <div
110
+ v-else-if="!annotationSetHasAnnotations(annotationSet) && publicView"
111
+ class="no-labels"
112
+ >
113
+ <span> {{ $t("no_annotations_in_annotation_set") }}</span>
114
+ </div>
98
115
  </div>
99
116
  </div>
100
117
  </div>
@@ -175,6 +192,14 @@ export default {
175
192
  window.removeEventListener("keydown", this.keyDownHandler);
176
193
  },
177
194
  methods: {
195
+ annotationSetHasAnnotations(annotationSet) {
196
+ const found = annotationSet.labels.find(
197
+ (label) => label.annotations.length > 0
198
+ );
199
+
200
+ return found;
201
+ },
202
+
178
203
  focusOnNextAnnotation() {
179
204
  const annotations = this.createArray("keyboard-nav");
180
205
 
@@ -15,14 +15,14 @@
15
15
  </div>
16
16
  </div>
17
17
  <div class="label-group-right">
18
- <div v-if="!publicView" class="label-annotations-pending">
18
+ <div class="label-annotations-pending" v-if="!publicView">
19
19
  {{
20
20
  `${
21
21
  label.annotations.length - acceptedAnnotationsGroupCounter
22
22
  } ${$t("annotations_pending")}`
23
23
  }}
24
24
  </div>
25
- <div v-if="!publicView" class="label-annotations-accepted">
25
+ <div class="label-annotations-accepted" v-if="!publicView">
26
26
  {{
27
27
  `${acceptedAnnotationsGroupCounter} ${$t("annotations_accepted")}`
28
28
  }}
@@ -9,21 +9,33 @@
9
9
  </div>
10
10
  <div class="data-extraction-text">
11
11
  <p class="title">
12
- {{ $t("data_being_extracted") }}
12
+ <span v-if="redirectingUser"> {{ $t("wait_title") }}</span>
13
+ <span v-else>
14
+ {{ $t("data_being_extracted") }}
15
+ </span>
13
16
  </p>
14
17
  <div class="description">
15
- <p>{{ $t("analysing_document") }}</p>
16
- <p>{{ $t("few_minutes") }}</p>
18
+ <span v-if="redirectingUser">
19
+ <p>{{ $t("redirecting_to_documents_list") }}</p>
20
+ </span>
21
+ <span v-else>
22
+ <p>{{ $t("analysing_document") }}</p>
23
+ <p>{{ $t("few_minutes") }}</p>
24
+ </span>
17
25
  </div>
18
26
  </div>
19
27
  </div>
20
28
  </template>
21
29
  <script>
30
+ import { mapState } from "vuex";
22
31
  import AnnotationActionButtons from "./AnnotationActionButtons";
23
32
 
24
33
  export default {
25
34
  name: "ExtractingData",
26
35
  components: { AnnotationActionButtons },
36
+ computed: {
37
+ ...mapState("edit", ["redirectingUser"]),
38
+ },
27
39
  };
28
40
  </script>
29
41
  <style scoped lang="scss" src="../../assets/scss/extracting_data.scss"></style>
@@ -390,11 +390,15 @@ export default {
390
390
  });
391
391
  });
392
392
 
393
- navigateToDocumentsList(
393
+ const redirection = navigateToDocumentsList(
394
394
  this.documentsListPath,
395
395
  this.projectId,
396
396
  this.currentUser.id
397
397
  );
398
+
399
+ if (redirection) {
400
+ this.$store.dispatch("edit/setRedirectingUser", true);
401
+ }
398
402
  } else {
399
403
  // Check if only the category and/or name changes:
400
404
  const newCategory = this.updatedDocument[0].category;
@@ -3,7 +3,7 @@
3
3
  <b-modal
4
4
  v-model="isModalActive"
5
5
  :width="400"
6
- can-cancel="['x']"
6
+ :can-cancel="['x']"
7
7
  :on-cancel="closeModal"
8
8
  >
9
9
  <section class="modal-card-body">
@@ -135,5 +135,10 @@
135
135
  "delete_table": "Tabelle löschen",
136
136
  "error_downloading_file": "Die Datei konnte nicht heruntergeladen werden.",
137
137
  "original_file": "Originaldatei",
138
- "pdf_file": "PDF Datei"
138
+ "pdf_file": "PDF Datei",
139
+ "no_labels_in_set": "Dieser Annotationssatz hat keine Beschriftungen.",
140
+ "link_to_add_labels": "Sehen Sie <a href='https://help.konfuzio.com/modules/labels/index.html#add-a-label' target='_blank'>hier</a>, wie Sie sie hinzufügen.",
141
+ "no_annotations_in_annotation_set": "Dieser Annotationssatz enthält keine extrahierten Annotationen für die jeweiligen Beschriftungen.",
142
+ "wait_title": "Bitte warten...",
143
+ "redirecting_to_documents_list": "Wir führen Sie zur Dokumentenliste, sodass Sie Ihre Dokumente weiter überprüfen können, während wir die vorgenommenen Änderungen verarbeiten."
139
144
  }
@@ -135,5 +135,10 @@
135
135
  "delete_table": "Delete table",
136
136
  "error_downloading_file": "The file could not be downloaded.",
137
137
  "original_file": "Original file",
138
- "pdf_file": "PDF file"
138
+ "pdf_file": "PDF file",
139
+ "no_labels_in_set": "This annotation set has no labels.",
140
+ "link_to_add_labels": "See how to add them <a href='https://help.konfuzio.com/modules/labels/index.html#add-a-label' target='_blank'>here</a>.",
141
+ "no_annotations_in_annotation_set": "This annotation set has no annotations extracted for its respective labels.",
142
+ "wait_title": "Please wait...",
143
+ "redirecting_to_documents_list": "We are taking you to the documents list, so you can continue reviewing your documents while we process the changes made."
139
144
  }