AAE-43710 Fix form field spacing misalignments (#11763)

This commit is contained in:
Wojciech Duda
2026-03-31 10:32:26 +02:00
committed by GitHub
parent 7b29d56272
commit 28fe6d3a76
8 changed files with 180 additions and 24 deletions
@@ -11,7 +11,7 @@
</label>
</div>
}
<div>
<div class="adf-dropdown-widget-container">
<mat-form-field class="adf-form-field-input">
@if ( (field.name || this.field?.required) && !field.leftLabels) {
<mat-label class="adf-label" [attr.for]="field.id">{{ field.name | translate }}</mat-label>
@@ -17,6 +17,12 @@
width: 100%;
}
&-container {
display: flex;
align-items: flex-start;
flex-direction: column;
}
&-dropdown-required-message {
.adf-error-container {
margin-top: 1px;
@@ -23,6 +23,156 @@ import { TaskCloudServiceMock } from '../../../mock/task-cloud.service.mock';
import { FormCloudServiceMock } from '../../../../form/mocks/form-cloud.service.mock';
import { provideStoryProcessServicesCloud } from '../../../../stories/process-services-cloud-story.providers';
import { taskWithFormDetailsMock } from '../../../task-header/mocks/task-details-cloud.mock';
import { Observable, of } from 'rxjs';
import { FormContent } from '../../../../services/form-fields.interfaces';
const allWidgetTypesForm: FormContent = {
formRepresentation: {
id: 'form-all-widget-types',
name: 'Widget Alignment Test',
description: '',
version: 0,
formDefinition: {
tabs: [],
fields: [
{
type: 'container',
id: 'row-text-dropdown',
name: 'Label',
tab: '',
numberOfColumns: 2,
fields: {
1: [
{
type: 'text',
id: 'textField',
name: 'Text Field',
colspan: 1,
placeholder: null,
value: '',
required: false,
minLength: 0,
maxLength: 0,
regexPattern: null,
visibilityCondition: null,
params: { existingColspan: 1, maxColspan: 2 }
}
],
2: [
{
type: 'dropdown',
id: 'dropdownField',
name: 'Dropdown Field',
colspan: 1,
value: '',
required: false,
optionType: 'manual',
options: [
{ id: 'empty', name: 'Choose one...' },
{ id: 'opt1', name: 'Option 1' },
{ id: 'opt2', name: 'Option 2' }
],
visibilityCondition: null,
params: { existingColspan: 1, maxColspan: 2 }
}
]
}
},
{
type: 'container',
id: 'row-amount-number',
name: 'Label',
tab: '',
numberOfColumns: 2,
fields: {
1: [
{
type: 'amount',
id: 'amountField',
name: 'Amount Field',
colspan: 1,
placeholder: '123',
value: '',
required: false,
minValue: null,
maxValue: null,
visibilityCondition: null,
params: { existingColspan: 1, maxColspan: 2 },
enableFractions: false,
currency: '$'
}
],
2: [
{
type: 'integer',
id: 'numberField',
name: 'Number Field',
colspan: 1,
placeholder: null,
value: null,
required: false,
minValue: null,
maxValue: null,
visibilityCondition: null,
params: { existingColspan: 1, maxColspan: 2 }
}
]
}
},
{
type: 'container',
id: 'row-date-text2',
name: 'Label',
tab: '',
numberOfColumns: 2,
fields: {
1: [
{
type: 'date',
id: 'dateField',
name: 'Date Field',
value: null,
colspan: 1,
placeholder: null,
required: false,
minValue: null,
maxValue: null,
visibilityCondition: null,
params: { existingColspan: 1, maxColspan: 2 },
dateDisplayFormat: 'D-M-YYYY'
}
],
2: [
{
type: 'text',
id: 'textField2',
name: 'Another Text',
colspan: 1,
placeholder: null,
value: '',
required: false,
minLength: 0,
maxLength: 0,
regexPattern: null,
visibilityCondition: null,
params: { existingColspan: 1, maxColspan: 2 }
}
]
}
}
],
outcomes: [],
metadata: {},
variables: []
}
}
};
class AllWidgetTypesFormCloudServiceMock extends FormCloudServiceMock {
override getForm(_appName: string, _formKey: string, _version?: number): Observable<FormContent> {
return of(allWidgetTypesForm);
}
}
const meta: Meta<TaskFormCloudComponent> = {
component: TaskFormCloudComponent,
@@ -218,3 +368,26 @@ export const InvalidOrMissingTaskId: Story = {
taskDetails: { ...taskWithFormDetailsMock }
}
};
export const AllWidgetTypes: Story = {
decorators: [
moduleMetadata({
imports: [TaskFormCloudComponent],
providers: [
{ provide: TaskCloudService, useClass: TaskCloudServiceMock },
{ provide: FormCloudService, useClass: AllWidgetTypesFormCloudServiceMock }
]
}),
applicationConfig({
providers: [...provideStoryProcessServicesCloud()]
})
],
render: (args) => ({
props: args
}),
args: {
appName: 'app',
taskId: 'mock-task-with-form',
taskDetails: { ...taskWithFormDetailsMock }
}
};