@konfuzio/document-validation-ui 0.1.43-dev.3 → 0.1.44-dev.0

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.43-dev.3",
3
+ "version": "0.1.44-dev.0",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -355,45 +355,43 @@ const getters = {
355
355
  const labelAnnotations = [];
356
356
  let addLabel = false;
357
357
  const labelHasSearch = labelHasSearchText(label);
358
- if (
358
+ if (!label.annotations || label.annotations.length === 0) {
359
+ if (state.annotationFilters.showEmpty) {
360
+ addLabel = true;
361
+ }
362
+ } else if (
359
363
  !state.annotationFilters.showEmpty ||
360
364
  !state.annotationFilters.showFeedbackNeeded ||
361
365
  !state.annotationFilters.showAccepted
362
366
  ) {
363
- if (!label.annotations || label.annotations.length === 0) {
364
- if (state.annotationFilters.showEmpty) {
365
- addLabel = true;
366
- }
367
- } else {
368
- label.annotations.forEach((annotation) => {
369
- if (
370
- state.annotationFilters.showFeedbackNeeded &&
371
- annotation.revised === false &&
372
- !annotation.created_by
373
- ) {
374
- const added = addAnnotation(
375
- labelAnnotations,
376
- annotation,
377
- labelHasSearch
378
- );
379
- if (added) {
380
- addLabel = true;
381
- }
382
- } else if (
383
- state.annotationFilters.showAccepted &&
384
- (annotation.revised === true || annotation.created_by)
385
- ) {
386
- const added = addAnnotation(
387
- labelAnnotations,
388
- annotation,
389
- labelHasSearch
390
- );
391
- if (added) {
392
- addLabel = true;
393
- }
367
+ label.annotations.forEach((annotation) => {
368
+ if (
369
+ state.annotationFilters.showFeedbackNeeded &&
370
+ annotation.revised === false &&
371
+ !annotation.created_by
372
+ ) {
373
+ const added = addAnnotation(
374
+ labelAnnotations,
375
+ annotation,
376
+ labelHasSearch
377
+ );
378
+ if (added) {
379
+ addLabel = true;
394
380
  }
395
- });
396
- }
381
+ } else if (
382
+ state.annotationFilters.showAccepted &&
383
+ (annotation.revised === true || annotation.created_by)
384
+ ) {
385
+ const added = addAnnotation(
386
+ labelAnnotations,
387
+ annotation,
388
+ labelHasSearch
389
+ );
390
+ if (added) {
391
+ addLabel = true;
392
+ }
393
+ }
394
+ });
397
395
  } else {
398
396
  // add annotations to the document array
399
397
  label.annotations.forEach((annotation) => {
@@ -1283,7 +1281,7 @@ const actions = {
1283
1281
  fetchMissingAnnotations: ({ commit, state, getters }) => {
1284
1282
  return new Promise((resolve, reject) => {
1285
1283
  return HTTP.get(
1286
- `/missing-annotations/?document=${state.documentId}&limit=100`
1284
+ `/missing-annotations/?document=${state.documentId}`
1287
1285
  )
1288
1286
  .then((response) => {
1289
1287
  commit("SET_MISSING_ANNOTATIONS", response.data.results);
@@ -21,9 +21,9 @@ const getters = {
21
21
  // check if label set has multiple and if not, if there's already an annotation set created
22
22
  if (!labelSet.has_multiple_annotation_sets) {
23
23
  const existingAnnotationSet = annotationSets.find((annSet) => {
24
- return annSet.id === labelSet.id;
24
+ return annSet.label_set.id === labelSet.id;
25
25
  });
26
- return existingAnnotationSet;
26
+ return !existingAnnotationSet;
27
27
  } else {
28
28
  return true;
29
29
  }