diff --git a/ui-ngx/src/app/modules/home/components/import-export/export-widgets-bundle-dialog.component.ts b/ui-ngx/src/app/modules/home/components/import-export/export-widgets-bundle-dialog.component.ts index 570beaf7e8..6b9d680815 100644 --- a/ui-ngx/src/app/modules/home/components/import-export/export-widgets-bundle-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/import-export/export-widgets-bundle-dialog.component.ts @@ -22,9 +22,11 @@ import { FormControl } from '@angular/forms'; import { Router } from '@angular/router'; import { DialogComponent } from '@app/shared/components/dialog.component'; import { WidgetsBundle } from '@shared/models/widgets-bundle.model'; +import { ActionPreferencesPutUserSettings } from '@core/auth/auth.actions'; export interface ExportWidgetsBundleDialogData { widgetsBundle: WidgetsBundle; + includeBundleWidgetsInExport: boolean; } export interface ExportWidgetsBundleDialogResult { @@ -44,12 +46,18 @@ export class ExportWidgetsBundleDialogComponent extends DialogComponent, protected router: Router, @Inject(MAT_DIALOG_DATA) public data: ExportWidgetsBundleDialogData, public dialogRef: MatDialogRef) { super(store, router, dialogRef); this.widgetsBundle = data.widgetsBundle; + this.includeBundleWidgetsInExport = data.includeBundleWidgetsInExport; + if (this.includeBundleWidgetsInExport) { + this.exportWidgetsFormControl.patchValue(this.includeBundleWidgetsInExport, {emitEvent: false}); + } } ngOnInit(): void { @@ -60,6 +68,9 @@ export class ExportWidgetsBundleDialogComponent extends DialogComponent { + if(settings) { + includeBundleWidgetsInExport = settings; + } + }); + this.widgetService.getWidgetsBundle(widgetsBundleId).subscribe( (widgetsBundle) => { this.dialog.open { diff --git a/ui-ngx/src/app/shared/models/user-settings.models.ts b/ui-ngx/src/app/shared/models/user-settings.models.ts index bd64e0241b..28aedc7c14 100644 --- a/ui-ngx/src/app/shared/models/user-settings.models.ts +++ b/ui-ngx/src/app/shared/models/user-settings.models.ts @@ -18,6 +18,7 @@ export interface UserSettings { openedMenuSections?: string[]; notDisplayConnectivityAfterAddDevice?: boolean; notDisplayInstructionsAfterAddEdge?: boolean; + includeBundleWidgetsInExport?: boolean; } export const initialUserSettings: UserSettings = {