Merge branch 'develop' into feature/AAE-36582-forms-misalignment

This commit is contained in:
Tomasz Nastaly
2025-07-24 23:04:53 +02:00
committed by GitHub
6 changed files with 38 additions and 3 deletions
@@ -1,9 +1,29 @@
@use '../../../../../src/lib/styles/flex' as flex;
.adf-grid-list { .adf-grid-list {
&-section { &-section {
&-single-column { &-single-column {
display: flex; display: flex;
flex-wrap: inherit; flex-wrap: inherit;
flex-direction: column;
gap: 1%; gap: 1%;
@include flex.layout-bp(lt-md) {
flex: 1 1 100% !important;
}
.adf-section-widget {
@include flex.layout-bp(lt-md) {
width: 100% !important;
}
}
> div {
@include flex.layout-bp(lt-md) {
width: 100% !important;
}
}
} }
&-column-view-item { &-column-view-item {
@@ -998,6 +998,21 @@ describe('DropdownCloudWidgetComponent', () => {
expect(widget.dropdownControl.value).toEqual({ id: 'testValue', name: '' }); expect(widget.dropdownControl.value).toEqual({ id: 'testValue', name: '' });
}); });
it('should set dropdownControl value when form field value gets changed', () => {
widget.field = {
value: { id: 'Id_1', name: 'Label 1' },
options: [],
isVisible: true,
markAsValid: () => {}
} as FormFieldModel;
spyOn(widget.dropdownControl, 'setValue').and.callThrough();
widget.updateReactiveFormControl();
expect(widget.dropdownControl.setValue).toHaveBeenCalledWith({ id: 'Id_1', name: 'Label 1' }, { emitEvent: false });
expect(widget.dropdownControl.value).toEqual({ id: 'Id_1', name: 'Label 1' });
});
it('should set dropdownControl value without emitting events if is an object', () => { it('should set dropdownControl value without emitting events if is an object', () => {
widget.field = { widget.field = {
value: { id: 'testValueObj', name: 'testValueObjName' }, value: { id: 'testValueObj', name: 'testValueObjName' },
@@ -137,6 +137,7 @@ export class DropdownCloudWidgetComponent extends WidgetComponent implements OnI
} }
updateReactiveFormControl(): void { updateReactiveFormControl(): void {
this.setFormControlValue();
this.updateFormControlState(); this.updateFormControlState();
this.handleErrors(); this.handleErrors();
} }
@@ -1,7 +1,6 @@
<form> <form>
<mat-form-field <mat-form-field
[subscriptSizing]="formFieldSubscriptSizing" [subscriptSizing]="formFieldSubscriptSizing"
[floatLabel]="'auto'"
class="adf-people-cloud adf-form-field-input" class="adf-people-cloud adf-form-field-input"
[class.adf-invalid]="hasError() && isDirty()" [class.adf-invalid]="hasError() && isDirty()"
> >
@@ -8,7 +8,7 @@
<label class="adf-label" [attr.for]="field.id" <label class="adf-label" [attr.for]="field.id"
>{{field.name | translate }}<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span></label >{{field.name | translate }}<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span></label
> >
<mat-form-field [floatLabel]="field.placeholder ? 'always': null" class="adf-group-widget-field"> <mat-form-field class="adf-group-widget-field">
<mat-chip-grid #chipGrid> <mat-chip-grid #chipGrid>
<mat-chip-row <mat-chip-row
*ngFor="let group of selectedGroups" *ngFor="let group of selectedGroups"
@@ -3,7 +3,7 @@
[class.adf-readonly]="field.readOnly" [class.adf-readonly]="field.readOnly"
id="people-widget-content"> id="people-widget-content">
<label class="adf-label" [attr.for]="field.id">{{field.name | translate }}<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span></label> <label class="adf-label" [attr.for]="field.id">{{field.name | translate }}<span class="adf-asterisk" [style.visibility]="isRequired() ? 'visible' : 'hidden'">*</span></label>
<mat-form-field [floatLabel]="field.placeholder ? 'always': null" <mat-form-field
class="adf-people-widget-field"> class="adf-people-widget-field">
<mat-chip-grid #chipGrid [attr.aria-label]="'ADF_PROCESS_LIST.START_PROCESS.FORM.LABEL.SELECTED_PEOPLE' | translate"> <mat-chip-grid #chipGrid [attr.aria-label]="'ADF_PROCESS_LIST.START_PROCESS.FORM.LABEL.SELECTED_PEOPLE' | translate">
<mat-chip-row <mat-chip-row