@konfuzio/document-validation-ui 0.1.50-dev.0 → 0.1.50-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
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
<div class="bottom-part">
|
|
21
21
|
{{
|
|
22
|
-
`${
|
|
22
|
+
`${categoryName(
|
|
23
23
|
selectedDocument.category
|
|
24
|
-
)}`
|
|
24
|
+
)} ${numberOfDocumentInSet(selectedDocument)}`
|
|
25
25
|
}}
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
>
|
|
42
42
|
<span>
|
|
43
43
|
{{
|
|
44
|
-
`${
|
|
44
|
+
`${categoryName(doc.category)} ${numberOfDocumentInSet(doc)}`
|
|
45
45
|
}}</span
|
|
46
46
|
>
|
|
47
47
|
</b-dropdown-item>
|
package/src/store/document.js
CHANGED
|
@@ -523,18 +523,35 @@ const getters = {
|
|
|
523
523
|
/**
|
|
524
524
|
* Checks the number of current document in the document set
|
|
525
525
|
*/
|
|
526
|
-
numberOfDocumentInSet: (state) => (
|
|
527
|
-
|
|
528
|
-
let
|
|
526
|
+
numberOfDocumentInSet: (state) => (document) => {
|
|
527
|
+
let found = false;
|
|
528
|
+
let value = 0;
|
|
529
|
+
let index = 0;
|
|
529
530
|
if (state.documentSet && state.documentSet.documents) {
|
|
530
|
-
state.documentSet.documents.
|
|
531
|
-
if (
|
|
532
|
-
|
|
533
|
-
|
|
531
|
+
state.documentSet.documents.map((documentSetTemp) => {
|
|
532
|
+
if (
|
|
533
|
+
documentSetTemp.id !== document.id &&
|
|
534
|
+
documentSetTemp.category === document.category
|
|
535
|
+
) {
|
|
536
|
+
found = true;
|
|
537
|
+
index++;
|
|
538
|
+
} else if (documentSetTemp.id === document.id) {
|
|
539
|
+
value = index;
|
|
534
540
|
}
|
|
535
541
|
});
|
|
542
|
+
return found ? `${value + 1}` : "";
|
|
536
543
|
}
|
|
537
|
-
return
|
|
544
|
+
return "";
|
|
545
|
+
// let index = -1;
|
|
546
|
+
// if (state.documentSet && state.documentSet.documents) {
|
|
547
|
+
// state.documentSet.documents.forEach((docTemp, indexTemp) => {
|
|
548
|
+
// if (docTemp.id == documentId) {
|
|
549
|
+
// index = indexTemp;
|
|
550
|
+
// return;
|
|
551
|
+
// }
|
|
552
|
+
// });
|
|
553
|
+
// }
|
|
554
|
+
// return index === -1 ? "" : `${index + 1}`;
|
|
538
555
|
},
|
|
539
556
|
|
|
540
557
|
/**
|