cloud-ide-element 1.0.71 β†’ 1.0.72

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.
@@ -3342,12 +3342,12 @@ class CideEleFileInputComponent {
3342
3342
  this.onTouched();
3343
3343
  // Auto upload if enabled
3344
3344
  if (this.autoUploadSignal() && selectedFiles && selectedFiles.length > 0) {
3345
- if (this.multipleSignal() && selectedFiles.length > 1) {
3346
- console.log('πŸš€ [FileInput] Auto upload enabled for multiple files:', selectedFiles.length);
3345
+ if (this.multipleSignal()) {
3346
+ console.log('πŸš€ [FileInput] Auto upload enabled for multiple files mode:', selectedFiles.length, 'files');
3347
3347
  this.uploadMultipleFiles(Array.from(selectedFiles));
3348
3348
  }
3349
3349
  else {
3350
- console.log('πŸš€ [FileInput] Auto upload enabled, starting upload for:', selectedFiles[0].name);
3350
+ console.log('πŸš€ [FileInput] Auto upload enabled for single file mode:', selectedFiles[0].name);
3351
3351
  this.uploadFile(selectedFiles[0]);
3352
3352
  }
3353
3353
  }
@@ -3488,10 +3488,11 @@ class CideEleFileInputComponent {
3488
3488
  }
3489
3489
  /**
3490
3490
  * Upload multiple files with group ID support
3491
- * Generates a group ID if not provided and uploads all files with the same group ID
3491
+ * FLOW: 1) Generate group ID first, 2) Upload all files with same group ID, 3) Emit group ID on completion
3492
3492
  */
3493
3493
  uploadMultipleFiles(files) {
3494
3494
  console.log('πŸ“€ [FileInput] uploadMultipleFiles called for:', files.length, 'files');
3495
+ console.log('πŸ”„ [FileInput] STEP 1: Generate group ID before starting any file uploads');
3495
3496
  // Set multiple upload mode flag
3496
3497
  this.isMultipleUploadMode.set(true);
3497
3498
  // Set upload status to 'start' before starting upload
@@ -3504,20 +3505,22 @@ class CideEleFileInputComponent {
3504
3505
  // Show initial progress notification
3505
3506
  const notificationId = this.notificationService.showProgress('πŸ”„ Preparing multiple file upload...', 0, { duration: 0 });
3506
3507
  this.uploadNotificationId.set(notificationId);
3507
- // Check if we already have a group ID from uploadData
3508
+ // STEP 1: Generate or get group ID BEFORE starting any file uploads
3508
3509
  const existingGroupId = this.uploadDataSignal().groupId;
3509
3510
  if (existingGroupId) {
3510
- console.log('πŸ†” [FileInput] Using existing group ID:', existingGroupId);
3511
+ console.log('πŸ†” [FileInput] STEP 1 COMPLETE: Using existing group ID:', existingGroupId);
3512
+ console.log('πŸ”„ [FileInput] STEP 2: Starting file uploads with group ID:', existingGroupId);
3511
3513
  this.groupId.set(existingGroupId);
3512
3514
  this.startMulti(files, existingGroupId);
3513
3515
  }
3514
3516
  else {
3515
- console.log('πŸ†” [FileInput] No group ID provided, generating new one...');
3516
- // Generate group ID first
3517
+ console.log('πŸ†” [FileInput] No existing group ID, generating new one...');
3518
+ // Generate group ID BEFORE starting any file uploads
3517
3519
  this.fileManagerService.generateObjectId().subscribe({
3518
3520
  next: (response) => {
3519
3521
  const newGroupId = response.objectId;
3520
- console.log('πŸ†” [FileInput] Generated new group ID:', newGroupId);
3522
+ console.log('πŸ†” [FileInput] STEP 1 COMPLETE: Generated new group ID:', newGroupId);
3523
+ console.log('πŸ”„ [FileInput] STEP 2: Starting file uploads with group ID:', newGroupId);
3521
3524
  this.groupId.set(newGroupId);
3522
3525
  this.startMulti(files, newGroupId);
3523
3526
  },
@@ -3538,18 +3541,21 @@ class CideEleFileInputComponent {
3538
3541
  }
3539
3542
  /**
3540
3543
  * Start uploading multiple files with the provided group ID
3544
+ * All files will be uploaded with the SAME group ID that was generated before this method
3541
3545
  */
3542
3546
  startMulti(files, groupId) {
3543
- console.log('πŸš€ [FileInput] Starting upload for', files.length, 'files with group ID:', groupId);
3547
+ console.log('πŸš€ [FileInput] STEP 2: Starting upload for', files.length, 'files with group ID:', groupId);
3548
+ console.log('πŸ“‹ [FileInput] All files will use the same group ID:', groupId);
3544
3549
  let completedUploads = 0;
3545
3550
  let failedUploads = 0;
3546
3551
  const totalFiles = files.length;
3547
- // Update upload data with group ID
3552
+ // IMPORTANT: All files use the SAME group ID that was generated before starting uploads
3548
3553
  const uploadDataWithGroupId = {
3549
3554
  ...this.uploadDataSignal(),
3550
3555
  groupId: groupId
3551
3556
  };
3552
3557
  files.forEach((file, index) => {
3558
+ console.log(`πŸ“€ [FileInput] Uploading file ${index + 1}/${totalFiles}: "${file.name}" with group ID: ${groupId}`);
3553
3559
  this.fileManagerService.uploadFile(file, uploadDataWithGroupId, (progress) => {
3554
3560
  // Calculate overall progress
3555
3561
  const fileProgress = progress / totalFiles;
@@ -3600,10 +3606,11 @@ class CideEleFileInputComponent {
3600
3606
  // All files uploaded successfully
3601
3607
  this.uploadStatus.set('success');
3602
3608
  this.notificationService.success(`βœ… All ${total} files uploaded successfully!`, { duration: 0 });
3603
- // For multiple file upload, return the group ID as the form value
3609
+ // STEP 3: For multiple file upload, emit the group ID (not individual file IDs)
3604
3610
  this.onChange(groupId);
3605
3611
  this.uploadSuccess.emit(groupId);
3606
- console.log('πŸ“ [FileInput] Form control value set to group ID:', groupId);
3612
+ console.log('πŸ“ [FileInput] STEP 3 COMPLETE: Form control value set to group ID:', groupId);
3613
+ console.log('βœ… [FileInput] Multiple upload SUCCESS - Group ID emitted:', groupId);
3607
3614
  }
3608
3615
  else if (completed > 0) {
3609
3616
  // Some files uploaded successfully
@@ -3838,8 +3845,14 @@ class CideEleFileInputComponent {
3838
3845
  this.onTouched();
3839
3846
  // Auto upload if enabled
3840
3847
  if (this.autoUploadSignal() && files.length > 0) {
3841
- console.log('πŸš€ [FileInput] Auto upload enabled, starting upload for:', files[0].name);
3842
- this.uploadFile(files[0]);
3848
+ if (this.multipleSignal()) {
3849
+ console.log('πŸš€ [FileInput] Auto upload enabled for multiple files mode (drag & drop):', files.length, 'files');
3850
+ this.uploadMultipleFiles(Array.from(files));
3851
+ }
3852
+ else {
3853
+ console.log('πŸš€ [FileInput] Auto upload enabled for single file mode (drag & drop):', files[0].name);
3854
+ this.uploadFile(files[0]);
3855
+ }
3843
3856
  }
3844
3857
  else {
3845
3858
  console.log('⏸️ [FileInput] Auto upload disabled or no files');