cloud-ide-element 1.0.102 → 1.0.104
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.
|
@@ -4,7 +4,7 @@ import * as i0 from '@angular/core';
|
|
|
4
4
|
import { Pipe, Injectable, inject, EventEmitter, ViewContainerRef, forwardRef, ViewChild, Output, Input, Component, HostListener, ContentChildren, signal, DestroyRef, computed, effect, afterRenderEffect, afterNextRender, ElementRef, Directive, viewChild } from '@angular/core';
|
|
5
5
|
import * as i2 from '@angular/forms';
|
|
6
6
|
import { FormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
7
|
-
import { BehaviorSubject, Subject, debounceTime, takeUntil, distinctUntilChanged, Observable, retry, catchError, finalize, throwError, map } from 'rxjs';
|
|
7
|
+
import { BehaviorSubject, Subject, debounceTime, takeUntil, distinctUntilChanged, Observable, retry, catchError, finalize, throwError, map, of } from 'rxjs';
|
|
8
8
|
import * as i2$1 from '@angular/router';
|
|
9
9
|
import * as i1$1 from '@angular/common/http';
|
|
10
10
|
import { HttpClient, HttpEventType, HttpRequest } from '@angular/common/http';
|
|
@@ -2940,18 +2940,30 @@ class CideEleFileManagerService {
|
|
|
2940
2940
|
fetchAndStoreFilesByGroupId(groupId) {
|
|
2941
2941
|
console.log('📡 [FileManagerService] Fetching and storing files for group:', groupId);
|
|
2942
2942
|
return this.getFilesByGroupId(groupId).pipe(map(response => {
|
|
2943
|
+
console.log('📡 [FileManagerService] API Response for group', groupId, ':', response);
|
|
2943
2944
|
if (response.success && response.data && response.data.files) {
|
|
2944
2945
|
// Store files in service state
|
|
2945
2946
|
const currentFetchedFiles = new Map(this._fetchedFiles());
|
|
2946
2947
|
currentFetchedFiles.set(groupId, response.data.files);
|
|
2947
2948
|
this._fetchedFiles.set(currentFetchedFiles);
|
|
2948
2949
|
console.log('📁 [FileManagerService] Stored', response.data.files.length, 'files for group:', groupId);
|
|
2950
|
+
console.log('📁 [FileManagerService] Files stored:', response.data.files.map(f => ({ id: f._id, name: f.cyfm_name })));
|
|
2951
|
+
// Debug: Check if files are actually stored
|
|
2952
|
+
const storedFiles = this.getFetchedFilesByGroupId(groupId);
|
|
2953
|
+
console.log('📁 [FileManagerService] Verification - files now in storage:', storedFiles.length);
|
|
2949
2954
|
return response.data.files;
|
|
2950
2955
|
}
|
|
2956
|
+
else {
|
|
2957
|
+
console.log('📡 [FileManagerService] No files in response or response not successful:', {
|
|
2958
|
+
success: response.success,
|
|
2959
|
+
hasData: !!response.data,
|
|
2960
|
+
hasFiles: !!(response.data && response.data.files)
|
|
2961
|
+
});
|
|
2962
|
+
}
|
|
2951
2963
|
return [];
|
|
2952
2964
|
}), catchError(error => {
|
|
2953
2965
|
console.error('❌ [FileManagerService] Failed to fetch files for group:', groupId, error);
|
|
2954
|
-
return [];
|
|
2966
|
+
return of([]);
|
|
2955
2967
|
}));
|
|
2956
2968
|
}
|
|
2957
2969
|
/**
|
|
@@ -3001,12 +3013,12 @@ class CideEleFileManagerService {
|
|
|
3001
3013
|
// Add fetched files for this group (only if not already in active uploads)
|
|
3002
3014
|
const fetchedFiles = this.getFetchedFilesByGroupId(groupId);
|
|
3003
3015
|
fetchedFiles.forEach(file => {
|
|
3004
|
-
const fetchedFileId = file.
|
|
3016
|
+
const fetchedFileId = file._id;
|
|
3005
3017
|
if (!fileIds.has(fetchedFileId)) {
|
|
3006
3018
|
fileIds.add(fetchedFileId);
|
|
3007
3019
|
files.push({
|
|
3008
3020
|
fileId: fetchedFileId,
|
|
3009
|
-
fileName: file.cyfm_name || file
|
|
3021
|
+
fileName: file.cyfm_name || 'Unknown file',
|
|
3010
3022
|
stage: 'complete' // Fetched files are already completed
|
|
3011
3023
|
});
|
|
3012
3024
|
}
|
|
@@ -3333,10 +3345,16 @@ class CideEleFloatingFileUploaderComponent {
|
|
|
3333
3345
|
return [];
|
|
3334
3346
|
}
|
|
3335
3347
|
const files = this.fileManagerService.getAllFilesForGroup(groupId);
|
|
3336
|
-
|
|
3348
|
+
const fetchedFiles = this.fileManagerService.getFetchedFilesByGroupId(groupId);
|
|
3349
|
+
const activeUploads = Array.from(this.fileManagerService.activeUploads().entries()).filter(([_, upload]) => upload.groupId === groupId);
|
|
3350
|
+
console.log('🔍 [FloatingFileUploader] allFilesForGroup computed - DETAILED:', {
|
|
3337
3351
|
groupId,
|
|
3338
3352
|
filesCount: files.length,
|
|
3339
|
-
|
|
3353
|
+
fetchedFilesCount: fetchedFiles.length,
|
|
3354
|
+
activeUploadsCount: activeUploads.length,
|
|
3355
|
+
files: files.map(f => ({ id: f.fileId, name: f.fileName, stage: f.stage })),
|
|
3356
|
+
fetchedFiles: fetchedFiles.map(f => ({ id: f._id, name: f.cyfm_name })),
|
|
3357
|
+
activeUploads: activeUploads.map(([id, upload]) => ({ id, stage: upload.stage, groupId: upload.groupId }))
|
|
3340
3358
|
});
|
|
3341
3359
|
return files;
|
|
3342
3360
|
}, ...(ngDevMode ? [{ debugName: "allFilesForGroup" }] : []));
|