From 008d8ab6e2b2c191c22d2428a17b1b0670acc39d Mon Sep 17 00:00:00 2001 From: Isoumyajit Date: Fri, 10 Jul 2026 21:19:57 +0530 Subject: [PATCH] AAE-48227 replacing custom labels with mat-labels --- .../components/form-renderer.component.html | 2 +- .../widgets/amount/amount.widget.html | 4 ++-- .../widgets/amount/amount.widget.spec.ts | 4 ++-- .../widgets/date-time/date-time.widget.html | 2 +- .../components/widgets/date/date.widget.html | 8 ++------ .../widgets/decimal/decimal.component.html | 2 +- .../multiline-text/multiline-text.widget.html | 2 +- .../multiline-text/multiline-text.widget.scss | 2 +- .../widgets/number/number.widget.html | 2 +- .../components/widgets/text/text.widget.html | 2 +- .../form/components/form-cloud.component.html | 1 + .../form/components/form-cloud.component.scss | 3 ++- .../widgets/date/date-cloud.widget.html | 2 +- .../display-external-property.widget.html | 2 +- .../display-external-property.widget.scss | 2 +- .../dropdown/dropdown-cloud.widget.html | 2 +- .../start-form/start-form.component.spec.ts | 14 +++++++------- .../form/widgets/dropdown/dropdown.widget.html | 12 ++++++++---- .../widgets/dropdown/dropdown.widget.spec.ts | 5 ++--- .../editors/amount/amount.editor.html | 2 +- .../editors/date/date.editor.html | 2 +- .../editors/datetime/datetime.editor.html | 2 +- .../editors/dropdown/dropdown.editor.html | 5 +++-- .../editors/text/text.editor.html | 2 +- .../functional-group.widget.html | 18 +++++++++--------- .../functional-group.widget.spec.ts | 9 +++------ .../lib/form/widgets/people/people.widget.html | 4 ++-- .../form/widgets/people/people.widget.spec.ts | 7 +++---- .../widgets/typeahead/typeahead.widget.html | 2 +- .../start-task/start-task.component.scss | 4 ++-- 30 files changed, 64 insertions(+), 66 deletions(-) diff --git a/lib/core/src/lib/form/components/form-renderer.component.html b/lib/core/src/lib/form/components/form-renderer.component.html index d025b0e7e1..cafbc41427 100644 --- a/lib/core/src/lib/form/components/form-renderer.component.html +++ b/lib/core/src/lib/form/components/form-renderer.component.html @@ -1,4 +1,4 @@ -
@if (formDefinition.hasTabs()) { @if (hasTabs()) { diff --git a/lib/core/src/lib/form/components/widgets/amount/amount.widget.html b/lib/core/src/lib/form/components/widgets/amount/amount.widget.html index 76104bba6d..8ff875f63d 100644 --- a/lib/core/src/lib/form/components/widgets/amount/amount.widget.html +++ b/lib/core/src/lib/form/components/widgets/amount/amount.widget.html @@ -15,7 +15,7 @@ subscriptSizing="dynamic" [floatLabel]="placeholder ? 'always' : null" > - @if ( (field.name || field?.required) && !field.leftLabels) { {{field.name | translate }} } + @if ( (field.name || field?.required) && !field.leftLabels) { {{field.name | translate }} } @if(!enableDisplayBasedOnLocale) { {{ currency }}  } @@ -34,7 +34,7 @@ [errorStateMatcher]="errorStateMatcher" (focus)="amountWidgetOnFocus()" (blur)="amountWidgetOnBlur()" - /> + /> @if (field.validationSummary?.message || (isInvalidFieldRequired() && isTouched())) { error_outline diff --git a/lib/core/src/lib/form/components/widgets/amount/amount.widget.spec.ts b/lib/core/src/lib/form/components/widgets/amount/amount.widget.spec.ts index ac4ab4a1d4..aa6ba3deab 100644 --- a/lib/core/src/lib/form/components/widgets/amount/amount.widget.spec.ts +++ b/lib/core/src/lib/form/components/widgets/amount/amount.widget.spec.ts @@ -325,7 +325,7 @@ describe('AmountWidgetComponent - rendering', () => { expect(inputField).toBeTruthy(); expect(await field.getPrefixText()).toBe('$'); - const widgetLabel = testingUtils.getByCSS('.adf-label').nativeElement; + const widgetLabel = testingUtils.getByDataAutomationId('adf-amount-widget-label').nativeElement; expect(widgetLabel.textContent.trim()).toBe('Test Amount'); expect(widget.field.isValid).toBe(false); @@ -362,7 +362,7 @@ describe('AmountWidgetComponent - rendering', () => { fixture.detectChanges(); await fixture.whenStable(); - const widgetLabel = testingUtils.getByCSS('.adf-label').nativeElement; + const widgetLabel = testingUtils.getByDataAutomationId('adf-amount-widget-label').nativeElement; expect(widgetLabel.textContent.trim()).toBe('Test Amount'); const field = await testingUtils.formField.get(); diff --git a/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.html b/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.html index 1457221133..2639fdabd6 100644 --- a/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.html +++ b/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.html @@ -14,7 +14,7 @@ [class.adf-left-label-input-datepicker]="field.leftLabels" [floatLabel]="field.placeholder ? 'always' : null"> @if( (field.name || field?.required) && !field.leftLabels) { - + {{ field.name | translate }} ({{ field.dateDisplayFormat }}) } diff --git a/lib/core/src/lib/form/components/widgets/date/date.widget.html b/lib/core/src/lib/form/components/widgets/date/date.widget.html index 8633b8db24..02a0c8fe02 100644 --- a/lib/core/src/lib/form/components/widgets/date/date.widget.html +++ b/lib/core/src/lib/form/components/widgets/date/date.widget.html @@ -2,9 +2,7 @@ [class.adf-invalid]="dateInputControl.invalid && dateInputControl.touched" [class.adf-readonly]="field.readOnly"> - + {{ field.name | translate }} ({{ field.dateDisplayFormat }}) - + @if (dateInputControl.invalid && dateInputControl.touched) { error_outline diff --git a/lib/core/src/lib/form/components/widgets/decimal/decimal.component.html b/lib/core/src/lib/form/components/widgets/decimal/decimal.component.html index c531e78288..3d5b17f7f2 100644 --- a/lib/core/src/lib/form/components/widgets/decimal/decimal.component.html +++ b/lib/core/src/lib/form/components/widgets/decimal/decimal.component.html @@ -10,7 +10,7 @@
- @if ( (field.name || field?.required) && !field.leftLabels) { {{ field.name | translate }} } + @if ( (field.name || field?.required) && !field.leftLabels) { {{ field.name | translate }} } @if(field.name || field.required) { - {{ field.name | translate }} + {{ field.name | translate }} }