Skip to content
Snippets Groups Projects
Commit 0a151f26 authored by Tobias Stummer's avatar Tobias Stummer
Browse files

Merge branch 'develop' into 'master'

Merge develop into master - delete email from user

See merge request eclipse/openk-usermodules/org.eclipse.openk-usermodules.statementPublicAffairs.frontend!27
parents a647b7ee d4e5ab83
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,16 @@
[type]="'email'"
appFormControlStatus
class="openk-input openk-info email--input"/>
<button (click)="deleteEmail((appSelectedUser?.id))"
class="openk-button openk-danger department-buttons" style="margin-right: 0.7em;"
[disabled]="!formGroup.controls['email'].value"
>
<mat-icon>delete</mat-icon>
{{"shared.actions.delete" | translate}}
</button>
<ng-container *ngIf="appSelectedUser | appIsUserOfficialInCharge">
<span class="email--identifier">{{"settings.users.initials" | translate}}</span>
<input [formControlName]="'initials'"
......
......@@ -20,7 +20,7 @@
.email {
align-items: center;
display: grid;
grid-template-columns: max-content auto;
grid-template-columns: max-content auto max-content;
grid-column-gap: 0.25em;
flex: 1;
......
......@@ -153,6 +153,7 @@ describe("UsersSettingsEditComponent", () => {
expect(component.appError.emit).toHaveBeenCalledWith(EErrorCode.DEPARTMENT_MULTIPLE_USE);
component.patchValueForDepartment(1, {name: "anotherName", group: "anotherGroupName"});
component.patchValue({...{}, email: "abc", phone: "phone", fax: "fax", initials: "initials"});
component.submit(1);
expect(component.appError.emit).toHaveBeenCalledWith(EErrorCode.BAD_USER_DATA);
});
......
......@@ -51,7 +51,7 @@ export class UsersSettingsEditComponent implements OnChanges {
public constructor() {
this.formGroup = createFormGroup<IUserSettingsEditFormValue>({
email: new FormControl("", [Validators.email, Validators.required]),
email: new FormControl("", [Validators.email]),
phone: new FormControl("", []),
fax: new FormControl("", []),
initials: new FormControl("", []),
......@@ -164,4 +164,11 @@ export class UsersSettingsEditComponent implements OnChanges {
}
return null;
}
public deleteEmail(id: number) {
this.formGroup.patchValue({
email: ""
});
this.submit(id);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment