@acorex/modules 20.7.11 → 20.7.12

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.
@@ -5581,49 +5581,13 @@ class AXMDocumentManagerService {
5581
5581
  const ext = item.name.split('.').pop()?.toLowerCase();
5582
5582
  return ext && AXMDocumentManagerService.GALLERY_EXTENSIONS.includes(ext);
5583
5583
  });
5584
- // Fetch documents with null fileId.source.value
5585
- const documentsWithNullFileId = filteredDocuments.filter((doc) => !doc.fileId.source.value);
5586
- // Fetch missing documents and replace them in the array
5587
- if (documentsWithNullFileId.length > 0) {
5588
- const fetchedDocuments = await Promise.all(documentsWithNullFileId.map((doc) => this.documentService.getOne(doc.id)));
5589
- // Replace documents in filteredDocuments with fetched ones
5590
- fetchedDocuments.forEach((fetchedDoc) => {
5591
- const index = filteredDocuments.findIndex((doc) => doc.id === fetchedDoc.id);
5592
- if (index !== -1) {
5593
- filteredDocuments[index] = fetchedDoc;
5594
- }
5595
- });
5596
- }
5597
- // Collect all fileIds that need to be fetched
5598
- const fileIds = filteredDocuments.filter((doc) => doc.fileId.source.value).map((doc) => doc.fileId.source.value);
5599
- // Fetch all file info at once (need URL for media viewer)
5600
- const fileInfosMap = new Map();
5601
- if (fileIds.length > 0) {
5602
- const infos = await Promise.all(fileIds.map((id) => this.fileService.getInfo(id)));
5603
- infos.forEach((info) => {
5604
- if (info?.fileId) {
5605
- fileInfosMap.set(info.fileId, info);
5606
- }
5607
- });
5608
- }
5609
5584
  // Convert documents to AXPFileListItem[] format for the gallery widget
5610
- const fileListItems = await Promise.all(filteredDocuments.map(async (doc) => {
5611
- let url = '';
5612
- if (doc.fileId?.source?.kind === 'fileId') {
5613
- const fileId = doc.fileId.source.value;
5614
- const fileInfo = fileInfosMap.get(fileId);
5615
- url = fileInfo?.url ?? '';
5616
- }
5617
- return {
5618
- id: doc.id ?? '',
5619
- name: doc.name,
5620
- size: doc.size,
5621
- status: 'attached',
5622
- source: {
5623
- kind: 'url',
5624
- value: url,
5625
- },
5626
- };
5585
+ const fileListItems = filteredDocuments.map((doc) => ({
5586
+ id: doc.id ?? '',
5587
+ name: doc.name,
5588
+ size: doc.size,
5589
+ status: 'attached',
5590
+ source: doc.fileId?.source,
5627
5591
  }));
5628
5592
  // Calculate start index
5629
5593
  const startIndex = isVirtualFolder