From d3f2ed6eb34b990b3f34195502b8226d84b93b0b Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Thu, 26 Sep 2024 12:37:56 +0300 Subject: [PATCH 1/2] UI: Fixed layout settings translate --- ui-ngx/src/assets/locale/locale.constant-en_US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 23a60fec14..bb4fc57e8a 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -1211,7 +1211,7 @@ "layout-type-default": "Default", "layout-type-scada": "SCADA", "layout-type-divider": "Divider", - "layout-settings-type": "Layout settings: {{ type }}", + "layout-settings-type": "Layout settings: {{ type }} breakpoint", "columns-count": "Columns count", "columns-count-required": "Columns count is required.", "min-columns-count-message": "Only 10 minimum column count is allowed.", From 7f10ad33f23df31fac121b24bfec7508af6d8b17 Mon Sep 17 00:00:00 2001 From: mpetrov Date: Thu, 26 Sep 2024 13:09:41 +0300 Subject: [PATCH 2/2] Fixed device credentials on discard/cancel conflict --- .../device/device-credentials-dialog.component.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/pages/device/device-credentials-dialog.component.ts b/ui-ngx/src/app/modules/home/pages/device/device-credentials-dialog.component.ts index 10ea5b286c..7cc5e1bbc0 100644 --- a/ui-ngx/src/app/modules/home/pages/device/device-credentials-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/pages/device/device-credentials-dialog.component.ts @@ -25,7 +25,9 @@ import { DeviceCredentials, DeviceProfileInfo, DeviceTransportType } from '@shar import { DialogComponent } from '@shared/components/dialog.component'; import { Router } from '@angular/router'; import { DeviceProfileService } from '@core/http/device-profile.service'; -import { forkJoin } from 'rxjs'; +import { forkJoin, throwError } from 'rxjs'; +import { catchError } from 'rxjs/operators'; +import { HttpStatusCode } from '@angular/common/http'; export interface DeviceCredentialsDialogData { isReadOnly: boolean; @@ -102,7 +104,16 @@ export class DeviceCredentialsDialogComponent extends this.submitted = true; const deviceCredentialsValue = this.deviceCredentialsFormGroup.value.credential; this.deviceCredentials = {...this.deviceCredentials, ...deviceCredentialsValue}; - this.deviceService.saveDeviceCredentials(this.deviceCredentials).subscribe( + this.deviceService.saveDeviceCredentials(this.deviceCredentials) + .pipe( + catchError((err) => { + if (err.status === HttpStatusCode.Conflict) { + return this.deviceService.getDeviceCredentials(this.deviceCredentials.deviceId.id); + } + return throwError(() => err); + }) + ) + .subscribe( (deviceCredentials) => { this.dialogRef.close(deviceCredentials); }