mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-48227 keep adf-label class on mat-labels to preserve downstream styling
The mat-label refactor dropped the .adf-label class from several widget labels. That class is a public styling hook: consuming apps (e.g. hxp studio form editor) target it to set label font, line-height and sizing, so removing it silently changed label metrics and form field spacing downstream. Keep class="adf-label" on the mat-labels alongside the new data-automation-id hooks, and restore the SCSS selectors that had been renamed to work around the missing class. Unit tests already select labels via data-automation-id, so they are unaffected. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
subscriptSizing="dynamic"
|
||||
[floatLabel]="placeholder ? 'always' : null"
|
||||
>
|
||||
@if ( (field.name || field?.required) && !field.leftLabels) { <mat-label data-automation-id="adf-amount-widget-label">{{field.name | translate }}</mat-label> }
|
||||
@if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class="adf-label" data-automation-id="adf-amount-widget-label">{{field.name | translate }}</mat-label> }
|
||||
@if(!enableDisplayBasedOnLocale) {
|
||||
<span matTextPrefix class="adf-amount-widget__prefix-spacing">{{ currency }} </span>
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
[class.adf-invalid]="dateInputControl.invalid && dateInputControl.touched"
|
||||
[class.adf-readonly]="field.readOnly">
|
||||
<mat-form-field class="adf-date-widget adf-form-field-input" subscriptSizing="dynamic" [floatLabel]="field.placeholder ? 'always' : null">
|
||||
<mat-label data-automation-id="adf-date-widget-label">
|
||||
<mat-label class="adf-label" data-automation-id="adf-date-widget-label">
|
||||
{{ field.name | translate }} ({{ field.dateDisplayFormat }})
|
||||
</mat-label>
|
||||
<input matInput
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
[floatLabel]="field.placeholder ? 'always' : null"
|
||||
>
|
||||
@if(field.name || field.required) {
|
||||
<mat-label class="adf-multiline-text-widget-label" data-automation-id="adf-multiline-text-widget-label"> {{ field.name | translate }} </mat-label>
|
||||
<mat-label class="adf-label adf-multiline-text-widget-label" data-automation-id="adf-multiline-text-widget-label"> {{ field.name | translate }} </mat-label>
|
||||
}
|
||||
<textarea
|
||||
matInput
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
subscriptSizing="dynamic"
|
||||
[floatLabel]="placeholder ? 'always' : null"
|
||||
>
|
||||
@if ( (field.name || this.field?.required) && !field.leftLabels) { <mat-label data-automation-id="adf-text-widget-label">
|
||||
@if ( (field.name || this.field?.required) && !field.leftLabels) { <mat-label class="adf-label" data-automation-id="adf-text-widget-label">
|
||||
{{ field.name | translate }}
|
||||
</mat-label>
|
||||
}
|
||||
|
||||
@@ -135,8 +135,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.adf-label,
|
||||
.adf-display-external-property-widget-label {
|
||||
.adf-label {
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
<div>
|
||||
<mat-form-field class="adf-form-field-input" subscriptSizing="dynamic" [floatLabel]="field.placeholder ? 'always' : null">
|
||||
@if( (field.name || field?.required) && !field.leftLabels) {
|
||||
<mat-label class="adf-display-external-property-widget-label" data-automation-id="adf-display-external-property-widget-label"> {{ field.name | translate }} </mat-label>
|
||||
<mat-label class="adf-label adf-display-external-property-widget-label" data-automation-id="adf-display-external-property-widget-label"> {{ field.name | translate }} </mat-label>
|
||||
}
|
||||
<input
|
||||
matInput
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
[class.adf-readonly]="field.readOnly"
|
||||
>
|
||||
<mat-form-field class="adf-form-field-input" subscriptSizing="dynamic">
|
||||
<mat-label data-automation-id="adf-dropdown-widget-label">{{ field.name | translate }}</mat-label>
|
||||
<mat-label class="adf-label" data-automation-id="adf-dropdown-widget-label">{{ field.name | translate }}</mat-label>
|
||||
<mat-select
|
||||
class="adf-select"
|
||||
data-automation-id="adf-dropdown-widget-select"
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
id="functional-group-div"
|
||||
>
|
||||
<mat-form-field class="adf-group-widget-field">
|
||||
<mat-label data-automation-id="adf-group-widget-label">{{ field.name | translate }}</mat-label>
|
||||
<mat-label class="adf-label" data-automation-id="adf-group-widget-label">{{ field.name | translate }}</mat-label>
|
||||
<mat-chip-grid #chipGrid [required]="isRequired()">
|
||||
<mat-chip-row
|
||||
*ngFor="let group of selectedGroups"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
id="people-widget-content">
|
||||
<mat-form-field
|
||||
class="adf-people-widget-field">
|
||||
<mat-label class="adf-people-widget-label" data-automation-id="adf-people-widget-label">{{ field.name | translate }}</mat-label>
|
||||
<mat-label class="adf-label adf-people-widget-label" data-automation-id="adf-people-widget-label">{{ field.name | translate }}</mat-label>
|
||||
<mat-chip-grid #chipGrid [attr.aria-label]="'ADF_PROCESS_LIST.START_PROCESS.FORM.LABEL.SELECTED_PEOPLE' | translate"
|
||||
[required]="isRequired()" [ngModel]="selectedUsers" [errorStateMatcher]="errorStateMatcher">
|
||||
<mat-chip-row
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
[class.adf-readonly]="field.readOnly"
|
||||
id="typehead-div">
|
||||
<mat-form-field class="adf-form-field-input" subscriptSizing="dynamic">
|
||||
<mat-label>{{ field.name | translate }}</mat-label>
|
||||
<mat-label class="adf-label">{{ field.name | translate }}</mat-label>
|
||||
<input matInput class="adf-input"
|
||||
type="text"
|
||||
[id]="field.id"
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ adf-start-task {
|
||||
border-color: var(--mat-sys-error);
|
||||
}
|
||||
|
||||
.adf-people-widget-label {
|
||||
.adf-label {
|
||||
color: var(--mat-sys-error);
|
||||
|
||||
&::after {
|
||||
|
||||
Reference in New Issue
Block a user