|
|
|
@ -17,7 +17,7 @@ |
|
|
|
import { Inject, Injectable } from '@angular/core'; |
|
|
|
import { DashboardService } from '@core/http/dashboard.service'; |
|
|
|
import { TranslateService } from '@ngx-translate/core'; |
|
|
|
import { Store } from '@ngrx/store'; |
|
|
|
import { select, Store } from '@ngrx/store'; |
|
|
|
import { AppState } from '@core/core.state'; |
|
|
|
import { ActionNotificationShow } from '@core/notification/notification.actions'; |
|
|
|
import { Dashboard, DashboardLayoutId } from '@shared/models/dashboard.models'; |
|
|
|
@ -35,7 +35,7 @@ import { |
|
|
|
import { MatDialog } from '@angular/material/dialog'; |
|
|
|
import { ImportDialogComponent, ImportDialogData } from '@home/components/import-export/import-dialog.component'; |
|
|
|
import { forkJoin, Observable, of, Subject } from 'rxjs'; |
|
|
|
import { catchError, map, mergeMap, switchMap, tap } from 'rxjs/operators'; |
|
|
|
import { catchError, map, mergeMap, switchMap, take, tap } from 'rxjs/operators'; |
|
|
|
import { DashboardUtilsService } from '@core/services/dashboard-utils.service'; |
|
|
|
import { EntityService } from '@core/http/entity.service'; |
|
|
|
import { Widget, WidgetSize, WidgetType, WidgetTypeDetails } from '@shared/models/widget.models'; |
|
|
|
@ -79,6 +79,7 @@ import { |
|
|
|
ExportWidgetsBundleDialogData, |
|
|
|
ExportWidgetsBundleDialogResult |
|
|
|
} from '@home/components/import-export/export-widgets-bundle-dialog.component'; |
|
|
|
import { selectUserSettingsProperty } from '@core/auth/auth.selectors'; |
|
|
|
|
|
|
|
// @dynamic
|
|
|
|
@Injectable() |
|
|
|
@ -314,6 +315,15 @@ export class ImportExportService { |
|
|
|
} |
|
|
|
|
|
|
|
public exportWidgetsBundle(widgetsBundleId: string) { |
|
|
|
let includeBundleWidgetsInExport = false; |
|
|
|
this.store.pipe(select(selectUserSettingsProperty( 'includeBundleWidgetsInExport'))).pipe( |
|
|
|
take(1) |
|
|
|
).subscribe((settings: boolean) => { |
|
|
|
if(settings) { |
|
|
|
includeBundleWidgetsInExport = settings; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
this.widgetService.getWidgetsBundle(widgetsBundleId).subscribe( |
|
|
|
(widgetsBundle) => { |
|
|
|
this.dialog.open<ExportWidgetsBundleDialogComponent, ExportWidgetsBundleDialogData, |
|
|
|
@ -321,7 +331,8 @@ export class ImportExportService { |
|
|
|
disableClose: true, |
|
|
|
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], |
|
|
|
data: { |
|
|
|
widgetsBundle |
|
|
|
widgetsBundle, |
|
|
|
includeBundleWidgetsInExport |
|
|
|
} |
|
|
|
}).afterClosed().subscribe( |
|
|
|
(result) => { |
|
|
|
|