@konfuzio/document-validation-ui 0.1.43-dev.2 → 0.1.43
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/dist/css/app.css +1 -1
- package/dist/index.html +1 -1
- package/dist/js/app.js +1 -1
- package/dist/js/app.js.map +1 -1
- package/package.json +1 -1
- package/src/components/DocumentEdit/DocumentEdit.vue +1 -2
- package/src/store/document.js +33 -35
- package/src/store/project.js +2 -2
- package/src/utils/utils.js +2 -2
package/package.json
CHANGED
package/src/store/document.js
CHANGED
|
@@ -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
|
-
|
|
364
|
-
if (
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
annotation
|
|
372
|
-
|
|
373
|
-
)
|
|
374
|
-
|
|
375
|
-
|
|
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}
|
|
1284
|
+
`/missing-annotations/?document=${state.documentId}`
|
|
1287
1285
|
)
|
|
1288
1286
|
.then((response) => {
|
|
1289
1287
|
commit("SET_MISSING_ANNOTATIONS", response.data.results);
|
package/src/store/project.js
CHANGED
|
@@ -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
|
}
|
package/src/utils/utils.js
CHANGED
|
@@ -60,7 +60,7 @@ export function navigateToNewDocumentURL(oldId, newId) {
|
|
|
60
60
|
window.location.replace(newUrl);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export function navigateToDocumentsList(path, projectId
|
|
63
|
+
export function navigateToDocumentsList(path, projectId) {
|
|
64
64
|
if (!path) return;
|
|
65
65
|
|
|
66
66
|
const lastCharOfString = path.charAt(path.length - 1);
|
|
@@ -70,7 +70,7 @@ export function navigateToDocumentsList(path, projectId, userId) {
|
|
|
70
70
|
slash = "";
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
const parameters = `?project=${projectId}
|
|
73
|
+
const parameters = `?project=${projectId}`;
|
|
74
74
|
|
|
75
75
|
const newPath = `${path}${slash}${parameters}`;
|
|
76
76
|
|