mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +00:00
AAE-21392 Fix dropdown form widget style (#9605)
This commit is contained in:
@@ -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">
|
||||
<div>
|
||||
<mat-form-field>
|
||||
<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>
|
||||
<mat-select class="adf-select"
|
||||
[id]="field.id"
|
||||
[(ngModel)]="field.value"
|
||||
@@ -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>
|
||||
|
||||
|
@@ -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', () => {
|
||||
@@ -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('');
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user