@konfuzio/document-validation-ui 0.2.8-dev.0 → 0.2.8-dev.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.2.8-dev.0",
3
+ "version": "0.2.8-dev.1",
4
4
  "repository": "https://github.com/konfuzio-ai/document-validation-ui",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -44,6 +44,7 @@
44
44
  "devDependencies": {
45
45
  "@4tw/cypress-drag-drop": "^2.3.0",
46
46
  "@babel/preset-env": "^7.26.9",
47
+ "@vue/cli-plugin-eslint": "^5.0.9",
47
48
  "@vue/cli-service": "^5.0.9",
48
49
  "@vue/compiler-sfc": "^3.1.0",
49
50
  "@vue/test-utils": "^2.4.6",
@@ -60,6 +61,7 @@
60
61
  },
61
62
  "overrides": {
62
63
  "postcss": "8.4.31",
63
- "webpack-dev-server": "5.2.1"
64
+ "webpack-dev-server": "5.2.1",
65
+ "node-forge": "1.3.2"
64
66
  }
65
67
  }
package/src/api.js CHANGED
@@ -119,7 +119,6 @@ const makeGetPaginatedRequest = (request, hasParams = false) => {
119
119
  } catch (error) {
120
120
  reject(error);
121
121
  toFinishLoop = true;
122
- console.log(error);
123
122
  }
124
123
  } while (!toFinishLoop);
125
124
  resolve(returnResponse);
@@ -127,8 +127,8 @@ export default {
127
127
  this.$refs.contentEditable.focus();
128
128
  }
129
129
  })
130
- .catch((error) => {
131
- console.log(error);
130
+ .catch(() => {
131
+ // Error is silently ignored
132
132
  });
133
133
  // check if this is part of a group of spans to show the whole bounding box as a placeholder
134
134
  if (this.annotation.selection_bbox && this.annotation.span.length > 1) {
@@ -50,62 +50,73 @@
50
50
  }"
51
51
  />
52
52
  <template v-if="pageInVisibleRange && !editMode">
53
- <template v-if="searchResults.length > 0">
54
- <v-rect
55
- v-for="(bbox, index) in searchResults"
56
- :key="'sr' + index"
57
- :config="{
58
- ...selectionTextRect(bbox, bbox === currentSearchResultForPage),
59
- }"
60
- ></v-rect>
61
- </template>
62
- <v-group
63
- v-if="
64
- !categorizeModalIsActive || !publicView || !isDocumentReviewed
65
- "
66
- ref="entities"
67
- >
53
+ <!-- Main Group -->
54
+ <v-group>
55
+ <!-- Search Results -->
56
+ <template v-if="searchResults.length > 0">
57
+ <v-rect
58
+ v-for="(bbox, index) in searchResults"
59
+ :key="'sr' + index"
60
+ :config="{
61
+ ...selectionTextRect(
62
+ bbox,
63
+ bbox === currentSearchResultForPage
64
+ ),
65
+ }"
66
+ />
67
+ </template>
68
+
69
+ <!-- Grouped Ann Sets Box -->
68
70
  <v-rect
69
- v-for="(entity, index) in scaledEntities(page.entities, page)"
71
+ v-for="(annotationSet, index) in pageAnnotationSets"
70
72
  :key="index"
71
- :config="entityRect(entity)"
72
- @click="handleClickedEntity(entity)"
73
- @mouseenter="onElementEnter"
74
- @mouseleave="onElementLeave"
73
+ :config="groupAnnotationRect(annotationSet, index)"
74
+ @click="handleClickedAnnotationSet(annotationSet)"
75
+ @mouseenter="onAnnotationSetEnter(annotationSet)"
76
+ @mouseleave="onAnnotationSetLeave"
75
77
  />
76
- </v-group>
77
- <template v-for="(annotationSet, index) in pageAnnotationSets">
78
- <v-group>
79
- <v-rect
80
- :config="groupAnnotationRect(annotationSet, index)"
81
- @click="handleClickedAnnotationSet(annotationSet)"
82
- @mouseenter="onAnnotationSetEnter(annotationSet)"
83
- @mouseleave="onAnnotationSetLeave"
84
- />
85
- </v-group>
86
- </template>
87
- <template v-for="annotation in pageAnnotations">
78
+
79
+ <!-- Entities -->
88
80
  <template
89
- v-for="(bbox, index) in annotation.span.filter(
90
- (bbox) => bbox.page_index + 1 == page.number
91
- )"
81
+ v-if="
82
+ !categorizeModalIsActive || !publicView || !isDocumentReviewed
83
+ "
92
84
  >
93
- <v-group>
85
+ <v-rect
86
+ v-for="(entity, index) in scaledEntities(page.entities, page)"
87
+ :key="index"
88
+ :config="entityRect(entity)"
89
+ @click="handleClickedEntity(entity)"
90
+ @mouseenter="onElementEnter"
91
+ @mouseleave="onElementLeave"
92
+ />
93
+ </template>
94
+
95
+ <!-- Annotations -->
96
+ <template v-for="(annotation, annIndex) in pageAnnotations">
97
+ <template v-if="!isAnnotationInEditMode(annotation.id)">
94
98
  <v-rect
95
- v-if="!isAnnotationInEditMode(annotation.id)"
99
+ v-for="(bbox, index) in annotation.span.filter(
100
+ (bbox) => bbox.page_index + 1 == page.number
101
+ )"
102
+ :key="index"
96
103
  :config="annotationRect(bbox, annotation.id)"
97
104
  @click="handleFocusedAnnotation(annotation)"
98
105
  @mouseenter="onElementEnter(annotation, bbox)"
99
106
  @mouseleave="onElementLeave"
100
107
  />
101
- </v-group>
102
- </template>
103
- <template
104
- v-if="annotation.metadata && annotation.metadata.checkbox"
105
- >
106
- <v-group>
108
+ </template>
109
+
110
+ <!-- Annotations Checkboxes-->
111
+ <template
112
+ v-if="
113
+ annotation.metadata &&
114
+ annotation.metadata.checkbox &&
115
+ !isAnnotationInEditMode(annotation.id)
116
+ "
117
+ >
107
118
  <v-rect
108
- v-if="!isAnnotationInEditMode(annotation.id)"
119
+ :key="annIndex"
109
120
  :config="
110
121
  annotationRect(
111
122
  annotation.metadata.checkbox.bbox,
@@ -121,24 +132,25 @@
121
132
  "
122
133
  @mouseleave="onElementLeave"
123
134
  />
124
- </v-group>
135
+ </template>
125
136
  </template>
126
- </template>
137
+ </v-group>
127
138
  </template>
128
139
  </v-layer>
129
140
  <v-layer>
130
- <template
141
+ <span-selection
131
142
  v-for="(span, index) in spanSelectionsForPage(page)"
143
+ :id="index"
132
144
  :key="index"
133
- >
134
- <span-selection :id="index" :span="span" :page="page" />
135
- </template>
136
- <template
145
+ :span="span"
146
+ :page="page"
147
+ />
148
+ <placeholder-selection
137
149
  v-for="(span, index) in placeholderSelectionForPage(page)"
138
150
  :key="`${index}_placeholder`"
139
- >
140
- <placeholder-selection :span="span" :page="page" />
141
- </template>
151
+ :span="span"
152
+ :page="page"
153
+ />
142
154
  <template v-if="page.number === selectionPage">
143
155
  <box-selection :page="page" />
144
156
  </template>
@@ -551,7 +563,7 @@ export default {
551
563
  .then((myBlob) => {
552
564
  convertBlob(myBlob);
553
565
  })
554
- .catch((error) => {});
566
+ .catch(() => {});
555
567
  } else {
556
568
  convertBlob(this.imageBlob);
557
569
  }
@@ -260,7 +260,6 @@ export default {
260
260
  serverErrorMessage: this.$t("server_error"),
261
261
  defaultErrorMessage: this.$t("error_downloading_file"),
262
262
  });
263
- console.log(error);
264
263
  });
265
264
  },
266
265
  cancelAnnotationEditMode() {
@@ -158,8 +158,8 @@ const actions = {
158
158
  commit("SET_CATEGORIES", results);
159
159
  }
160
160
  })
161
- .catch((error) => {
162
- console.log(error, "Could not fetch categories from the backend");
161
+ .catch(() => {
162
+ // Error is silently ignored
163
163
  });
164
164
  },
165
165
  };
@@ -287,7 +287,7 @@ const actions = {
287
287
  break;
288
288
  }
289
289
  default:
290
- console.log("No fit defined");
290
+ // No fit defined
291
291
  break;
292
292
  }
293
293
  },
@@ -1263,7 +1263,6 @@ const actions = {
1263
1263
  }
1264
1264
  })
1265
1265
  .catch((error) => {
1266
- console.log(error, "Could not fetch document details from the backend");
1267
1266
  dispatch("display/setPageError", error.response.data.detail, {
1268
1267
  root: true,
1269
1268
  });
@@ -1293,8 +1292,8 @@ const actions = {
1293
1292
  .then((response) => {
1294
1293
  commit("ADD_PAGE", response.data);
1295
1294
  })
1296
- .catch((error) => {
1297
- console.log(error);
1295
+ .catch(() => {
1296
+ // Error is silently ignored
1298
1297
  });
1299
1298
  },
1300
1299
 
@@ -1311,8 +1310,8 @@ const actions = {
1311
1310
  .then((response) => {
1312
1311
  commit("SET_DOC_SET", response.data);
1313
1312
  })
1314
- .catch((error) => {
1315
- console.log(error);
1313
+ .catch(() => {
1314
+ // Error is silently ignored
1316
1315
  });
1317
1316
  },
1318
1317
 
@@ -1366,7 +1365,6 @@ const actions = {
1366
1365
  })
1367
1366
  .catch((error) => {
1368
1367
  reject(error.response);
1369
- console.log(error);
1370
1368
  });
1371
1369
  });
1372
1370
  },
@@ -1392,7 +1390,6 @@ const actions = {
1392
1390
  })
1393
1391
  .catch((error) => {
1394
1392
  reject(error.response);
1395
- console.log(error);
1396
1393
  });
1397
1394
  });
1398
1395
  },
@@ -1432,7 +1429,6 @@ const actions = {
1432
1429
  })
1433
1430
  .catch((error) => {
1434
1431
  reject(error.response);
1435
- console.log(error);
1436
1432
  });
1437
1433
  });
1438
1434
  },
@@ -1490,7 +1486,6 @@ const actions = {
1490
1486
  })
1491
1487
  .catch((error) => {
1492
1488
  reject(error.response);
1493
- console.log(error);
1494
1489
  });
1495
1490
  });
1496
1491
  },
@@ -1508,7 +1503,6 @@ const actions = {
1508
1503
  })
1509
1504
  .catch((error) => {
1510
1505
  reject(error.response);
1511
- console.log(error);
1512
1506
  });
1513
1507
  });
1514
1508
  },
@@ -1524,7 +1518,6 @@ const actions = {
1524
1518
  })
1525
1519
  .catch((error) => {
1526
1520
  reject(error.response);
1527
- console.log(error);
1528
1521
  });
1529
1522
  });
1530
1523
  },
@@ -1575,7 +1568,6 @@ const actions = {
1575
1568
  })
1576
1569
  .catch((error) => {
1577
1570
  reject(error.response);
1578
- console.log(error);
1579
1571
  });
1580
1572
  });
1581
1573
  },
package/src/store/edit.js CHANGED
@@ -260,7 +260,6 @@ const actions = {
260
260
  })
261
261
  .catch((error) => {
262
262
  reject(error.response);
263
- console.log(error);
264
263
  });
265
264
  });
266
265
  },
@@ -22,7 +22,6 @@ const actions = {
22
22
  })
23
23
  .catch((error) => {
24
24
  reject(error);
25
- console.log(error);
26
25
  });
27
26
  });
28
27
  },
@@ -34,8 +33,8 @@ const actions = {
34
33
  .then((results) => {
35
34
  commit("SET_LABEL_SETS", results);
36
35
  })
37
- .catch((error) => {
38
- console.log(error);
36
+ .catch(() => {
37
+ // Error is silently ignored
39
38
  });
40
39
  },
41
40
 
@@ -44,8 +43,8 @@ const actions = {
44
43
  .then((response) => {
45
44
  commit("SET_CURRENT_USER", response.data);
46
45
  })
47
- .catch((error) => {
48
- console.log(error);
46
+ .catch(() => {
47
+ // Error is silently ignored
49
48
  });
50
49
  },
51
50
 
@@ -71,9 +70,8 @@ const actions = {
71
70
  .then((results) => {
72
71
  resolve(results);
73
72
  })
74
- .catch((error) => {
73
+ .catch(() => {
75
74
  reject();
76
- console.log(error, "Could not fetch document list from the backend");
77
75
  });
78
76
  });
79
77
  },
@@ -87,9 +85,8 @@ const actions = {
87
85
  .then((results) => {
88
86
  resolve(results);
89
87
  })
90
- .catch((error) => {
88
+ .catch(() => {
91
89
  reject();
92
- console.log(error, "Could not fetch document list from the backend");
93
90
  });
94
91
  });
95
92
  },