From 3307e89d97839e90d9426e380b07379be6a560f9 Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Wed, 8 Nov 2023 11:14:43 +0200 Subject: [PATCH] UI: Save status include bundle --- .../export-widgets-bundle-dialog.component.ts | 11 +++++++++++ .../import-export/import-export.service.ts | 17 ++++++++++++++--- .../app/shared/models/user-settings.models.ts | 1 + 3 files changed, 26 insertions(+), 3 deletions(-) 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 = {