diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/import-dashboard-file-dialog.component.ts b/ui-ngx/src/app/modules/home/pages/dashboard/import-dashboard-file-dialog.component.ts index 1b76ca539f..ecad7891dd 100644 --- a/ui-ngx/src/app/modules/home/pages/dashboard/import-dashboard-file-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/pages/dashboard/import-dashboard-file-dialog.component.ts @@ -11,6 +11,7 @@ import { DashboardInfo } from '@app/shared/models/dashboard.models'; import { ActionNotificationShow } from '@core/notification/notification.actions'; import { DialogComponent } from '@shared/components/dialog.component'; import { Router } from '@angular/router'; +import { HttpErrorResponse, HttpStatusCode } from '@angular/common/http'; export interface DashboardInfoDialogData { dashboard: DashboardInfo; @@ -54,15 +55,22 @@ export class ImportDashboardFileDialogComponent extends DialogComponent { - this.dialogRef.close(true); - }) + this.dashboardService.saveDashboard(dashboard).subscribe({ + next: () => this.dialogRef.close(true), + error: (err: HttpErrorResponse) => { + if (err.status === HttpStatusCode.Conflict) { + this.dialogRef.close(true); + } + } + }); } loadDataFromJsonContent(content: string): any {