ciyidogan commited on
Commit
e797ab3
·
verified ·
1 Parent(s): d53cc17

Update flare-ui/src/app/components/apis/apis.component.ts

Browse files
flare-ui/src/app/components/apis/apis.component.ts CHANGED
@@ -619,15 +619,6 @@ export class ApisComponent implements OnInit, OnDestroy {
619
  if (imported > 0) {
620
  this.loadAPIs();
621
  }
622
-
623
- // Always show dialog for import results
624
- try {
625
- await this.showImportResultsDialog(imported, failed, errors, 'API');
626
- } catch (dialogError) {
627
- console.error('Failed to show import dialog:', dialogError);
628
- // Fallback to snackbar
629
- this.showImportResultsSnackbar(imported, failed, errors);
630
- }
631
 
632
  // Build detailed message
633
  let message = '';
@@ -645,19 +636,15 @@ export class ApisComponent implements OnInit, OnDestroy {
645
  });
646
  }
647
 
648
- // Use dialog for detailed errors
649
- if (failed > 0 && errors.length > 3) {
650
- // For many errors, show in a dialog instead of snackbar
651
- this.showImportErrorsDialog(imported, failed, errors);
652
- } else {
653
- // For few errors, show in snackbar
654
- this.snackBar.open(message, 'Close', {
655
- duration: failed > 0 ? 10000 : 5000,
656
- panelClass: failed > 0 ? 'error-snackbar' : 'success-snackbar',
657
- verticalPosition: 'top',
658
- horizontalPosition: 'right'
659
- });
660
- }
661
  } catch (error) {
662
  this.loading = false;
663
  this.snackBar.open('Failed to read file', 'Close', {
@@ -670,7 +657,7 @@ export class ApisComponent implements OnInit, OnDestroy {
670
  input.click();
671
  }
672
 
673
- private async showImportErrorsDialog(imported: number, failed: number, errors: string[]) {
674
  try {
675
  const { default: ImportResultsDialogComponent } = await import('../../dialogs/import-results-dialog/import-results-dialog.component');
676
 
 
619
  if (imported > 0) {
620
  this.loadAPIs();
621
  }
 
 
 
 
 
 
 
 
 
622
 
623
  // Build detailed message
624
  let message = '';
 
636
  });
637
  }
638
 
639
+ // Always show dialog for import results
640
+ try {
641
+ await this.showImportResultsDialog(imported, failed, errors, 'API');
642
+ } catch (dialogError) {
643
+ console.error('Failed to show import dialog:', dialogError);
644
+ // Fallback to snackbar
645
+ this.showImportResultsSnackbar(imported, failed, errors);
646
+ }
647
+
 
 
 
 
648
  } catch (error) {
649
  this.loading = false;
650
  this.snackBar.open('Failed to read file', 'Close', {
 
657
  input.click();
658
  }
659
 
660
+ private async showImportResultsDialog(imported: number, failed: number, errors: string[]) {
661
  try {
662
  const { default: ImportResultsDialogComponent } = await import('../../dialogs/import-results-dialog/import-results-dialog.component');
663