cloud-ide-element 1.0.112 → 1.0.113
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.
|
@@ -4460,19 +4460,29 @@ class CideEleFloatingFileUploaderComponent {
|
|
|
4460
4460
|
this.showWithAnimation();
|
|
4461
4461
|
return;
|
|
4462
4462
|
}
|
|
4463
|
-
//
|
|
4464
|
-
if (shouldShow
|
|
4463
|
+
// Handle manual trigger (show OR switch group ID)
|
|
4464
|
+
if (shouldShow) {
|
|
4465
4465
|
if (triggerGroupId) {
|
|
4466
|
+
// Always switch to the new group ID (even if already visible)
|
|
4467
|
+
console.log('🔄 [FloatingFileUploader] Switching to group ID:', triggerGroupId);
|
|
4466
4468
|
this.currentGroupId.set(triggerGroupId);
|
|
4467
4469
|
// Fetch files for this group
|
|
4468
4470
|
this.fileManagerService.fetchAndStoreFilesByGroupId(triggerGroupId)
|
|
4469
4471
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
4470
4472
|
.subscribe({
|
|
4471
|
-
next: () =>
|
|
4472
|
-
|
|
4473
|
+
next: () => {
|
|
4474
|
+
if (!isCurrentlyVisible) {
|
|
4475
|
+
this.showWithAnimation();
|
|
4476
|
+
}
|
|
4477
|
+
},
|
|
4478
|
+
error: () => {
|
|
4479
|
+
if (!isCurrentlyVisible) {
|
|
4480
|
+
this.showWithAnimation(); // Show anyway
|
|
4481
|
+
}
|
|
4482
|
+
}
|
|
4473
4483
|
});
|
|
4474
4484
|
}
|
|
4475
|
-
else {
|
|
4485
|
+
else if (!isCurrentlyVisible) {
|
|
4476
4486
|
this.showWithAnimation();
|
|
4477
4487
|
}
|
|
4478
4488
|
}
|
|
@@ -4586,8 +4596,8 @@ class CideEleFloatingFileUploaderComponent {
|
|
|
4586
4596
|
*/
|
|
4587
4597
|
handleFiles(files) {
|
|
4588
4598
|
console.log('📁 [FloatingFileUploader] Handling files:', files.length);
|
|
4589
|
-
// Use
|
|
4590
|
-
this.
|
|
4599
|
+
// Use handleFileSelection to avoid duplicate upload paths
|
|
4600
|
+
this.handleFileSelection(files);
|
|
4591
4601
|
}
|
|
4592
4602
|
/**
|
|
4593
4603
|
* Update visibility - simplified for notification only
|
|
@@ -4723,41 +4733,6 @@ class CideEleFloatingFileUploaderComponent {
|
|
|
4723
4733
|
this.currentUserId.set(userId);
|
|
4724
4734
|
this.fileManagerService.setUserId(userId);
|
|
4725
4735
|
}
|
|
4726
|
-
/**
|
|
4727
|
-
* Public method to handle files from external sources
|
|
4728
|
-
* This can be called by other components to trigger the floating uploader
|
|
4729
|
-
*/
|
|
4730
|
-
handleExternalFiles(files, userId, groupId) {
|
|
4731
|
-
console.log('📁 [FloatingFileUploader] External files received:', files.length, 'files');
|
|
4732
|
-
// Set user ID if provided
|
|
4733
|
-
if (userId && userId !== this.currentUserId()) {
|
|
4734
|
-
this.setCurrentUserId(userId);
|
|
4735
|
-
}
|
|
4736
|
-
// Set group ID if provided
|
|
4737
|
-
if (groupId) {
|
|
4738
|
-
this.currentGroupId.set(groupId);
|
|
4739
|
-
}
|
|
4740
|
-
// Upload files using file manager service
|
|
4741
|
-
// The file manager service will handle adding to its queue and the effect will show the floating uploader
|
|
4742
|
-
files.forEach((file, index) => {
|
|
4743
|
-
console.log(`📁 [FloatingFileUploader] Starting upload for file ${index + 1}/${files.length}:`, file.name);
|
|
4744
|
-
this.fileManagerService.uploadFile(file, {
|
|
4745
|
-
userId: this.currentUserId(),
|
|
4746
|
-
groupId: groupId,
|
|
4747
|
-
permissions: ['read', 'write'],
|
|
4748
|
-
tags: []
|
|
4749
|
-
})
|
|
4750
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
4751
|
-
.subscribe({
|
|
4752
|
-
next: (response) => {
|
|
4753
|
-
console.log('✅ [FloatingFileUploader] Upload completed:', response);
|
|
4754
|
-
},
|
|
4755
|
-
error: (error) => {
|
|
4756
|
-
console.error('❌ [FloatingFileUploader] Upload failed:', error);
|
|
4757
|
-
}
|
|
4758
|
-
});
|
|
4759
|
-
});
|
|
4760
|
-
}
|
|
4761
4736
|
/**
|
|
4762
4737
|
* Check if there are any uploads for the current group
|
|
4763
4738
|
*/
|
|
@@ -4803,7 +4778,8 @@ class CideEleFloatingFileUploaderComponent {
|
|
|
4803
4778
|
* Trigger file input click
|
|
4804
4779
|
*/
|
|
4805
4780
|
triggerFileInput() {
|
|
4806
|
-
|
|
4781
|
+
// Use ViewChild or querySelector with specific selector to target only this component's file input
|
|
4782
|
+
const fileInput = document.querySelector('.floating-uploader input[type="file"]');
|
|
4807
4783
|
if (fileInput) {
|
|
4808
4784
|
fileInput.click();
|
|
4809
4785
|
}
|