From ce741cf2deee263628c33cecad84dd669a4d6709 Mon Sep 17 00:00:00 2001 From: dpinkevych Date: Mon, 26 Oct 2026 12:50:26 +0200 Subject: [PATCH] refactor(iot-hub): build the form rows and the unmasked passwords in one ngOnChanges block --- .../install-form-renderer.component.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/install-form-renderer/install-form-renderer.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/install-form-renderer/install-form-renderer.component.ts index db2382e5c0..2f90853272 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/install-form-renderer/install-form-renderer.component.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/install-form-renderer/install-form-renderer.component.ts @@ -54,11 +54,15 @@ export class InstallFormRendererComponent implements OnChanges { readonly FormFieldType = FormFieldType; ngOnChanges(changes: SimpleChanges): void { - // The hint boxes depend on reviewMode too + // The hint boxes and the unmasked passwords depend on reviewMode too if (changes.fields || changes.reviewMode) { this.sections = []; + this.passwordVisible = {}; let previous: FormFieldDefinition | undefined; for (const field of this.fields ?? []) { + if (this.reviewMode && field.type === FormFieldType.PASSWORD) { + this.passwordVisible[field.key] = true; + } if (!previous || field.group !== previous.group) { this.sections.push({ title: field.group, rows: [] }); } @@ -74,16 +78,6 @@ export class InstallFormRendererComponent implements OnChanges { previous = field; } } - if (changes.fields || changes.reviewMode) { - this.passwordVisible = {}; - if (this.reviewMode) { - for (const f of this.fields) { - if (f.type === FormFieldType.PASSWORD) { - this.passwordVisible[f.key] = true; - } - } - } - } } togglePasswordVisible(key: string): void {