fix(console): enable phonenumber edit (#725)

* fix: edit phonenumber

* rm consolelog

* remove ? operator

* remove unnecessary check
This commit is contained in:
Max Peintner 2020-09-11 13:26:47 +02:00 committed by GitHub
parent 87c0010d54
commit 4931000dc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 9 deletions

View File

@ -73,7 +73,8 @@
<ng-template #emailEdit>
<mat-form-field class="name">
<mat-label>{{ 'USER.EMAIL' | translate }}</mat-label>
<input *ngIf="user.human && user.human.email" matInput [(ngModel)]="user.human.email" />
<input *ngIf="user.human && user.human.email !== undefined && user.human.email !== null"
matInput [(ngModel)]="user.human.email" />
</mat-form-field>
<button (click)="emailEditState = false" mat-icon-button>
<mat-icon class="icon">close</mat-icon>
@ -114,7 +115,8 @@
<ng-template #phoneEdit>
<mat-form-field class="name">
<mat-label>{{ 'USER.PHONE' | translate }}</mat-label>
<input *ngIf="user.human && user.human.phone" matInput [(ngModel)]="user.human.phone" />
<input *ngIf="user.human && user.human.phone !== undefined && user.human.phone !== null"
matInput [(ngModel)]="user.human.phone" />
</mat-form-field>
<button (click)="phoneEditState = false" mat-icon-button>
<mat-icon class="icon">close</mat-icon>

View File

@ -101,7 +101,9 @@
<ng-template #emailEdit>
<mat-form-field class="name">
<mat-label>{{ 'USER.EMAIL' | translate }}</mat-label>
<input matInput *ngIf="user.human && user.human.email" [(ngModel)]="user.human.email" />
<input matInput
*ngIf="user.human && user.human.email !== undefined && user.human.email !== null"
[(ngModel)]="user.human.email" />
</mat-form-field>
<button (click)="emailEditState = false" mat-icon-button>
<mat-icon class="icon">close</mat-icon>
@ -143,20 +145,22 @@
<ng-template #phoneEdit>
<mat-form-field class="name">
<mat-label>{{ 'USER.PHONE' | translate }}</mat-label>
<input *ngIf="user.human && user.human.phone" matInput
[disabled]="(canWrite$ | async) == false" [(ngModel)]="user.human.phone" />
<input *ngIf="user.human && user.human.phone !== undefined && user.human.phone !== null"
matInput [disabled]="(canWrite$ | async) == false" [(ngModel)]="user.human.phone" />
</mat-form-field>
<button (click)="phoneEditState = false" mat-icon-button
[disabled]="(canWrite$ | async) == false">
<button matTooltip="{{ 'ACTIONS.CLOSE' | translate }}" (click)="phoneEditState = false"
mat-icon-button [disabled]="(canWrite$ | async) == false">
<mat-icon class="icon">close</mat-icon>
</button>
<button *ngIf="user.human?.phone" color="warn" (click)="deletePhone()"
[disabled]="(canWrite$ | async) == false" mat-icon-button>
[disabled]="(canWrite$ | async) == false" mat-icon-button
matTooltip="{{ 'ACTIONS.CLEAR' | translate }}">
<i class="las la-trash"></i>
</button>
<button *ngIf="user.human" [disabled]="!user.human.phone || (canWrite$ | async) == false"
type="button" color="primary" (click)="savePhone()" mat-raised-button>
type="button" color="primary" (click)="savePhone()"
matTooltip="{{ 'ACTIONS.SAVE' | translate }}" mat-raised-button>
{{ 'ACTIONS.SAVE' | translate }}</button>
</ng-template>
</div>

View File

@ -45,6 +45,7 @@
"CONTINUE": "Weiter",
"BACK": "Zurück",
"CLOSE": "Schliessen",
"CLEAR": "Zurücksetzen",
"CANCEL":"Abbrechen",
"INFO": "Info",
"OK": "Ok",

View File

@ -45,6 +45,7 @@
"CONTINUE": "Continue",
"BACK": "Back",
"CLOSE": "Close",
"CLEAR": "Clear",
"CANCEL":"Cancel",
"INFO": "Info",
"OK": "OK",