Skip to content

Commit

Permalink
AAE-21392 Fix dropdown form widget style (#9605)
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogoABastos authored and VitoAlbano committed May 7, 2024
1 parent 77141cd commit 262ff67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<div class="adf-dropdown-widget {{field.className}}"
[class.adf-invalid]="(!field.isValid && isTouched()) || isRestApiFailed" [class.adf-readonly]="field.readOnly" [class.adf-left-label-input-container]="field.leftLabels">
<div class="adf-dropdown-widget-top-labels">
<label class="adf-label" [attr.for]="field.id" [class.adf-left-label]="field.leftLabels">{{field.name | translate }}<span class="adf-asterisk"
*ngIf="isRequired()">*</span>
</label>
</div>
<div>
<mat-form-field>
<mat-label *ngIf="getDefaultOption(list$ | async) as defaultOption">
{{ defaultOption.name }}
</mat-label>
<label class="adf-label" [attr.for]="field.id" [class.adf-left-label]="field.leftLabels">{{field.name | translate }}<span class="adf-asterisk"
*ngIf="isRequired()">*</span>
</label>
<mat-select class="adf-select"
[id]="field.id"
[(ngModel)]="field.value"
Expand All @@ -22,6 +17,7 @@
(blur)="markAsTouched()"
matTooltipPosition="above"
matTooltipShowDelay="1000"
[placeholder]="getDefaultOption(list$ | async)?.name"
[multiple]="field.hasMultipleValues">
<adf-select-filter-input *ngIf="showInputFilter" (change)="filter$.next($event)"></adf-select-filter-input>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import { TaskVariableCloud } from '../../../models/task-variable-cloud.model';
import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatSelectHarness } from '@angular/material/select/testing';
import { MatFormFieldHarness } from '@angular/material/form-field/testing';
import { MatTooltipHarness } from '@angular/material/tooltip/testing';

describe('DropdownCloudWidgetComponent', () => {
Expand Down Expand Up @@ -239,12 +238,8 @@ describe('DropdownCloudWidgetComponent', () => {
await dropdown.open();
await dropdown.clickOptions({ selector: '[id="empty"]' });

const formField = await loader.getHarness(MatFormFieldHarness);
const dropdownLabel = await formField.getLabel();

expect(dropdownLabel).toEqual('This is a mock none option');
expect(await dropdown.getValueText()).toEqual('This is a mock none option');
expect(widget.fieldValue).toEqual(undefined);
expect(await dropdown.getValueText()).toEqual('');
});
});

Expand Down

0 comments on commit 262ff67

Please sign in to comment.