cloud-ide-element 1.0.110 β 1.0.112
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.
|
@@ -3569,33 +3569,10 @@ class CideEleFileInputComponent {
|
|
|
3569
3569
|
console.log('π§ [FileInput] setDisabledState called with:', isDisabled, '(controlled by parent component)');
|
|
3570
3570
|
}
|
|
3571
3571
|
onFileSelected(event) {
|
|
3572
|
-
console.log('π [FileInput] onFileSelected called');
|
|
3573
3572
|
const input = event.target;
|
|
3574
3573
|
const selectedFiles = input.files;
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
console.log('π [FileInput] Files selected:', this.fileNames());
|
|
3578
|
-
this.generatePreviews();
|
|
3579
|
-
// Reset upload status when new file is selected
|
|
3580
|
-
this.uploadStatus.set('idle');
|
|
3581
|
-
console.log('π [FileInput] Upload status reset to:', this.uploadStatus());
|
|
3582
|
-
this.onChange(selectedFiles);
|
|
3583
|
-
this.fileChange.emit(selectedFiles);
|
|
3584
|
-
this.onTouched();
|
|
3585
|
-
// Note: Floating uploader is now triggered via service in upload methods
|
|
3586
|
-
// Auto upload if enabled
|
|
3587
|
-
if (this.autoUploadSignal() && selectedFiles && selectedFiles.length > 0) {
|
|
3588
|
-
if (this.multipleSignal()) {
|
|
3589
|
-
console.log('π [FileInput] Auto upload enabled for multiple files mode:', selectedFiles.length, 'files');
|
|
3590
|
-
this.uploadMultipleFiles(Array.from(selectedFiles));
|
|
3591
|
-
}
|
|
3592
|
-
else {
|
|
3593
|
-
console.log('π [FileInput] Auto upload enabled for single file mode:', selectedFiles[0].name);
|
|
3594
|
-
this.uploadFile(selectedFiles[0]);
|
|
3595
|
-
}
|
|
3596
|
-
}
|
|
3597
|
-
else {
|
|
3598
|
-
console.log('βΈοΈ [FileInput] Auto upload disabled or no files');
|
|
3574
|
+
if (selectedFiles) {
|
|
3575
|
+
this.handleFileSelection(selectedFiles);
|
|
3599
3576
|
}
|
|
3600
3577
|
}
|
|
3601
3578
|
clearFiles() {
|
|
@@ -3609,7 +3586,7 @@ class CideEleFileInputComponent {
|
|
|
3609
3586
|
this.fileChange.emit(null);
|
|
3610
3587
|
}
|
|
3611
3588
|
uploadFile(file) {
|
|
3612
|
-
console.log('
|
|
3589
|
+
console.log('π¨ [FileInput] uploadFile called for:', file.name, '- SINGLE UPLOAD INITIATED');
|
|
3613
3590
|
// Angular 20: Use PendingTasks for better loading state management
|
|
3614
3591
|
// const uploadTask = this.pendingTasks.add(); // TODO: Fix PendingTasks API usage
|
|
3615
3592
|
// console.log('β³ [FileInput] Pending task added for upload tracking');
|
|
@@ -3734,8 +3711,7 @@ class CideEleFileInputComponent {
|
|
|
3734
3711
|
* FLOW: 1) Generate group ID first, 2) Upload all files with same group ID, 3) Emit group ID on completion
|
|
3735
3712
|
*/
|
|
3736
3713
|
uploadMultipleFiles(files) {
|
|
3737
|
-
console.log('
|
|
3738
|
-
console.log('π [FileInput] STEP 1: Generate group ID before starting any file uploads');
|
|
3714
|
+
console.log('π¨ [FileInput] uploadMultipleFiles called for:', files.length, 'files - MULTIPLE UPLOAD INITIATED');
|
|
3739
3715
|
// Set multiple upload mode flag
|
|
3740
3716
|
this.isMultipleUploadMode.set(true);
|
|
3741
3717
|
// Set upload status to 'start' before starting upload
|
|
@@ -3749,21 +3725,28 @@ class CideEleFileInputComponent {
|
|
|
3749
3725
|
const notificationId = this.notificationService.showProgress('π Preparing multiple file upload...', 0, { duration: 0 });
|
|
3750
3726
|
this.uploadNotificationId.set(notificationId);
|
|
3751
3727
|
// STEP 1: Generate or get group ID BEFORE starting any file uploads
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3728
|
+
// Check if component already has a group ID or if one is provided in uploadData
|
|
3729
|
+
const existingComponentGroupId = this.groupId();
|
|
3730
|
+
const existingUploadDataGroupId = this.uploadDataSignal().groupId;
|
|
3731
|
+
if (existingComponentGroupId) {
|
|
3732
|
+
// Component already has its own group ID - use it
|
|
3733
|
+
console.log('π [FileInput] Using existing component group ID:', existingComponentGroupId);
|
|
3734
|
+
this.startMulti(files, existingComponentGroupId);
|
|
3735
|
+
}
|
|
3736
|
+
else if (existingUploadDataGroupId) {
|
|
3737
|
+
// Use group ID from uploadData and set it as component's group ID
|
|
3738
|
+
console.log('π [FileInput] Using group ID from uploadData:', existingUploadDataGroupId);
|
|
3739
|
+
this.groupId.set(existingUploadDataGroupId);
|
|
3740
|
+
this.startMulti(files, existingUploadDataGroupId);
|
|
3758
3741
|
}
|
|
3759
3742
|
else {
|
|
3760
|
-
|
|
3761
|
-
|
|
3743
|
+
// Generate new group ID just before upload
|
|
3744
|
+
console.log('π [FileInput] Generating new group ID just before upload...');
|
|
3762
3745
|
this.fileManagerService.generateObjectId().subscribe({
|
|
3763
3746
|
next: (response) => {
|
|
3764
3747
|
const newGroupId = response.data?.objectId;
|
|
3765
|
-
console.log('π [FileInput]
|
|
3766
|
-
|
|
3748
|
+
console.log('π [FileInput] Generated new group ID just before upload:', newGroupId);
|
|
3749
|
+
// Set the group ID to this component so it can track its own files
|
|
3767
3750
|
this.groupId.set(newGroupId);
|
|
3768
3751
|
this.startMulti(files, newGroupId);
|
|
3769
3752
|
},
|
|
@@ -4080,32 +4063,40 @@ class CideEleFileInputComponent {
|
|
|
4080
4063
|
/**
|
|
4081
4064
|
* Get total upload count from file manager service for this component's group ID
|
|
4082
4065
|
* Uses optimized service method for better performance
|
|
4066
|
+
* Only counts files for this component's specific group ID
|
|
4083
4067
|
*/
|
|
4084
4068
|
getUploadCount() {
|
|
4085
4069
|
const groupId = this.groupId();
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4070
|
+
const componentId = this.id();
|
|
4071
|
+
if (!groupId) {
|
|
4072
|
+
// No group ID yet - component hasn't uploaded anything, so count is 0
|
|
4073
|
+
return 0;
|
|
4074
|
+
}
|
|
4075
|
+
const count = this.fileManagerService.getFileCountForGroup(groupId);
|
|
4076
|
+
return count;
|
|
4089
4077
|
}
|
|
4090
4078
|
/**
|
|
4091
4079
|
* Check if there are active uploads for this component's group ID
|
|
4092
4080
|
* Uses optimized service method for better performance
|
|
4081
|
+
* Only checks files for this component's specific group ID
|
|
4093
4082
|
*/
|
|
4094
4083
|
hasActiveUploads() {
|
|
4095
4084
|
const groupId = this.groupId();
|
|
4096
4085
|
if (!groupId) {
|
|
4097
|
-
|
|
4086
|
+
// No group ID yet - component hasn't uploaded anything, so no active uploads
|
|
4087
|
+
return false;
|
|
4098
4088
|
}
|
|
4099
4089
|
return this.fileManagerService.hasActiveUploadsForGroup(groupId);
|
|
4100
4090
|
}
|
|
4101
4091
|
/**
|
|
4102
4092
|
* Get count of active (non-completed) uploads for this component's group ID
|
|
4093
|
+
* Only counts files for this component's specific group ID
|
|
4103
4094
|
*/
|
|
4104
4095
|
getActiveUploadCount() {
|
|
4105
4096
|
const groupId = this.groupId();
|
|
4106
4097
|
if (!groupId) {
|
|
4107
|
-
|
|
4108
|
-
|
|
4098
|
+
// No group ID yet - component hasn't uploaded anything, so no active uploads
|
|
4099
|
+
return 0;
|
|
4109
4100
|
}
|
|
4110
4101
|
return this.fileManagerService.getAllFilesForGroup(groupId)
|
|
4111
4102
|
.filter(file => file.stage !== 'complete').length;
|
|
@@ -4234,30 +4225,27 @@ class CideEleFileInputComponent {
|
|
|
4234
4225
|
});
|
|
4235
4226
|
}
|
|
4236
4227
|
handleFileSelection(files) {
|
|
4228
|
+
console.log('π₯ [FileInput] handleFileSelection called with:', files.length, 'files');
|
|
4237
4229
|
this.files.set(files);
|
|
4238
4230
|
this.fileNames.set(Array.from(files).map(f => f.name));
|
|
4239
|
-
console.log('π [FileInput] Files selected via drag & drop:', this.fileNames());
|
|
4240
4231
|
this.generatePreviews();
|
|
4241
4232
|
// Reset upload status when new file is selected
|
|
4242
4233
|
this.uploadStatus.set('idle');
|
|
4243
|
-
console.log('π [FileInput] Upload status reset to:', this.uploadStatus());
|
|
4244
4234
|
this.onChange(files);
|
|
4245
4235
|
this.fileChange.emit(files);
|
|
4246
4236
|
this.onTouched();
|
|
4247
|
-
// Note: Floating uploader is now triggered via service in upload methods
|
|
4248
4237
|
// Auto upload if enabled
|
|
4249
4238
|
if (this.autoUploadSignal() && files.length > 0) {
|
|
4239
|
+
console.log('π₯ [FileInput] Auto upload is enabled, proceeding with upload...');
|
|
4250
4240
|
if (this.multipleSignal()) {
|
|
4251
|
-
console.log('π [FileInput] Auto upload enabled for multiple files mode (drag & drop):', files.length, 'files');
|
|
4252
4241
|
this.uploadMultipleFiles(Array.from(files));
|
|
4253
4242
|
}
|
|
4254
4243
|
else {
|
|
4255
|
-
console.log('π [FileInput] Auto upload enabled for single file mode (drag & drop):', files[0].name);
|
|
4256
4244
|
this.uploadFile(files[0]);
|
|
4257
4245
|
}
|
|
4258
4246
|
}
|
|
4259
4247
|
else {
|
|
4260
|
-
console.log('
|
|
4248
|
+
console.log('π₯ [FileInput] Auto upload disabled or no files');
|
|
4261
4249
|
}
|
|
4262
4250
|
}
|
|
4263
4251
|
isRequired() {
|