changed placeholder and attributes reload

This commit is contained in:
Edi Cziszter 2021-12-18 21:44:56 +02:00
parent c588c85918
commit b477905fa1
2 changed files with 13 additions and 12 deletions

View File

@ -16,15 +16,19 @@
class="iqser-input-group"
>
<label>{{ attr.label }}</label>
<input
<ng-container
*ngIf="isSpecificType(attr, dossierAttributeConfigTypes.NUMBER) || isSpecificType(attr, dossierAttributeConfigTypes.TEXT)"
[formControlName]="attr.id"
[name]="attr.id"
[type]="isSpecificType(attr, dossierAttributeConfigTypes.NUMBER) ? 'number' : 'text'"
/>
>
<input
[formControlName]="attr.id"
[name]="attr.id"
[type]="isSpecificType(attr, dossierAttributeConfigTypes.NUMBER) ? 'number' : 'text'"
/>
</ng-container>
<ng-container *ngIf="isSpecificType(attr, dossierAttributeConfigTypes.DATE)">
<input [formControlName]="attr.id" [matDatepicker]="picker" placeholder="dd/mm/yy" />
<input [formControlName]="attr.id" [matDatepicker]="picker" placeholder="YYYY-MM-DD" />
<mat-datepicker-toggle [for]="picker" matSuffix>
<mat-icon matDatepickerToggleIcon svgIcon="red:calendar"></mat-icon>
</mat-datepicker-toggle>

View File

@ -68,12 +68,9 @@ export class UserPreferenceService extends GenericService<UserAttributes> {
window.location.reload();
}
reload(): Promise<void> {
return this.getAll<UserAttributes>()
.toPromise()
.then(attributes => {
this._userAttributes = attributes ?? {};
});
async reload(): Promise<void> {
const attributes = await this.getAll<UserAttributes>().toPromise();
this._userAttributes = attributes ?? {};
}
@Validate()