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> <ng-template #emailEdit>
<mat-form-field class="name"> <mat-form-field class="name">
<mat-label>{{ 'USER.EMAIL' | translate }}</mat-label> <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> </mat-form-field>
<button (click)="emailEditState = false" mat-icon-button> <button (click)="emailEditState = false" mat-icon-button>
<mat-icon class="icon">close</mat-icon> <mat-icon class="icon">close</mat-icon>
@ -114,7 +115,8 @@
<ng-template #phoneEdit> <ng-template #phoneEdit>
<mat-form-field class="name"> <mat-form-field class="name">
<mat-label>{{ 'USER.PHONE' | translate }}</mat-label> <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> </mat-form-field>
<button (click)="phoneEditState = false" mat-icon-button> <button (click)="phoneEditState = false" mat-icon-button>
<mat-icon class="icon">close</mat-icon> <mat-icon class="icon">close</mat-icon>

View File

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

View File

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

View File

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