mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
[ADF - 950] - disabling date button on readonly form (#2032)
This commit is contained in:
parent
98598f03b2
commit
9b5e90c400
@ -18,6 +18,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mdl-cell mdl-cell--1-col">
|
<div class="mdl-cell mdl-cell--1-col">
|
||||||
<button
|
<button
|
||||||
|
[attr.id]="field.id+'-button'"
|
||||||
|
[disabled]="field.readOnly"
|
||||||
class="mdl-button mdl-js-button mdl-button--icon"
|
class="mdl-button mdl-js-button mdl-button--icon"
|
||||||
(click)="datePicker.toggle()">
|
(click)="datePicker.toggle()">
|
||||||
<i class="material-icons">date_range</i>
|
<i class="material-icons">date_range</i>
|
||||||
|
@ -274,5 +274,19 @@ describe('DateWidget', () => {
|
|||||||
});
|
});
|
||||||
widget.checkVisibility(widget.field);
|
widget.checkVisibility(widget.field);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('should disable date button when is readonly', async(() => {
|
||||||
|
widget.field.readOnly = false;
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
let dateButton = <HTMLButtonElement> element.querySelector('#date-field-id-button');
|
||||||
|
expect(dateButton.disabled).toBeFalsy();
|
||||||
|
|
||||||
|
widget.field.readOnly = true;
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
dateButton = <HTMLButtonElement> element.querySelector('#date-field-id-button');
|
||||||
|
expect(dateButton.disabled).toBeTruthy();
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user