@hmcts/ccd-case-ui-toolkit 7.0.26 → 7.0.29-move-file-path-fix

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.
@@ -20959,7 +20959,8 @@ class CaseFileViewFolderSelectorComponent {
20959
20959
  return [];
20960
20960
  }
20961
20961
  containsDocument(cat, document) {
20962
- if (cat.documents.findIndex((doc) => doc.document_binary_url === document.document_binary_url) > -1) {
20962
+ if (cat.documents.findIndex((doc) => (doc.document_binary_url === document.document_binary_url)
20963
+ && (doc.attribute_path === document.attribute_path)) > -1) {
20963
20964
  return [cat.category_id];
20964
20965
  }
20965
20966
  for (const c of cat.sub_categories) {
@@ -21457,10 +21458,11 @@ class CaseFileViewFolderComponent {
21457
21458
  newDocumentTreeNode.name = node.category_name;
21458
21459
  newDocumentTreeNode.type = DocumentTreeNodeType.FOLDER;
21459
21460
  newDocumentTreeNode.children = [...this.generateTreeData(node.sub_categories), ...this.getDocuments(node.documents)];
21461
+ newDocumentTreeNode.category_order = node.category_order;
21460
21462
  return [
21461
21463
  ...tree,
21462
21464
  newDocumentTreeNode,
21463
- ];
21465
+ ].sort((a, b) => a.category_order - b.category_order);
21464
21466
  }, []);
21465
21467
  }
21466
21468
  getDocuments(documents) {