@konfuzio/document-validation-ui 0.1.26-dev.1 → 0.1.26-dev.2

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.26-dev.1",
3
+ "version": "0.1.26-dev.2",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -304,6 +304,7 @@ const getters = {
304
304
  let annotations = [];
305
305
  let labels = [];
306
306
  let processedAnnotationSets = [];
307
+ let processedLabels = [];
307
308
  annotationSets.forEach((annotationSet) => {
308
309
  labels = [];
309
310
  annotationSet.labels.forEach((label) => {
@@ -333,15 +334,22 @@ const getters = {
333
334
  }
334
335
  if (addLabel) {
335
336
  labels.push({ ...label, annotations: labelAnnotations });
337
+ let addProcessedLabel = true;
338
+ processedLabels.forEach((processedLabel) => {
339
+ if (processedLabel.id === label.id) {
340
+ addProcessedLabel = false;
341
+ return;
342
+ }
343
+ });
344
+ processedLabels.push(label);
336
345
  }
337
346
  annotations.push(...labelAnnotations);
338
347
  });
339
348
  processedAnnotationSets.push({ ...annotationSet, labels });
340
349
  });
341
-
342
350
  return {
343
351
  annotationSets: processedAnnotationSets,
344
- labels,
352
+ labels: processedLabels,
345
353
  annotations,
346
354
  };
347
355
  },