2 ~ Licensed to the Apache Software Foundation (ASF) under one
3 ~ or more contributor license agreements. See the NOTICE file
4 ~ distributed with this work for additional information
5 ~ regarding copyright ownership. The ASF licenses this file
6 ~ to you under the Apache License, Version 2.0 (the
7 ~ "License"); you may not use this file except in compliance
8 ~ with the License. You may obtain a copy of the License at
10 ~ http://www.apache.org/licenses/LICENSE-2.0
11 ~ Unless required by applicable law or agreed to in writing,
12 ~ software distributed under the License is distributed on an
13 ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 ~ KIND, either express or implied. See the License for the
15 ~ specific language governing permissions and limitations
19 <form class="mt-3 mb-3" [formGroup]="userForm" (ngSubmit)="onSubmit()">
20 <div class="form-group row col-md-8" *ngIf="!editUser.permanent">
21 <div class="col-md-1">{{'form.edit' |translate}} <span class="fas fa-edit"></span></div>
22 <div class="col-md-6">
23 <input class="form-check-input" type="checkbox" [value]="editMode" [checked]="editMode"
24 (change)="editMode=!editMode"
28 <div class="form-group row col-md-8">
29 <label class="col-md-2 col-form-label" for="user_id">{{'users.attributes.user_id' |translate}}</label>
30 <div class="col-md-6">
31 <input type="text" formControlName="user_id" id="user_id"
32 [ngClass]="valid('user_id')"
33 [attr.readonly]="true">
36 <div class="form-group row col-md-8">
37 <label class="col-md-2 col-form-label" for="full_name">{{'users.attributes.full_name' |translate}}</label>
38 <div class="col-md-6">
39 <input type="text" formControlName="full_name" id="full_name"
40 [ngClass]="valid('full_name')" [attr.readonly]="editMode?null:true">
41 <small *ngIf="editMode">{{'users.input.small.full_name'|translate}}</small>
44 <div class="form-group row col-md-8">
45 <label class="col-md-2 col-form-label" for="email">{{'users.attributes.email' |translate}}</label>
46 <div class="col-md-6">
47 <input type="text" formControlName="email" id="email"
48 [ngClass]="valid('email')" value="{{editUser.email}}" [attr.readonly]="editMode?null:true">
51 <div class="form-group row col-md-8" *ngIf="editMode">
52 <label class="col-md-2 col-form-label" for="password">{{'users.attributes.password' |translate}}</label>
53 <div class="col-md-6">
54 <input type="password" class="form-control" formControlName="password" id="password"
55 [ngClass]="valid('password')"
56 placeholder="{{'users.input.password'|translate}}">
57 <small>{{'users.edit.small.password'|translate}}</small>
60 <div class="form-group row col-md-8" *ngIf="editMode">
61 <label class="col-md-2 col-form-label"
62 for="confirm_password">{{'users.attributes.confirm_password' |translate}}</label>
63 <div class="col-md-6">
64 <input type="password" class="form-control" formControlName="confirm_password" id="confirm_password"
65 [ngClass]="valid('confirm_password')"
66 placeholder="{{'users.input.confirm_password'|translate}}">
69 <div class="form-group row col-md-8">
70 <div class="col-md-2">Flags</div>
71 <div class="col-md-6">
72 <div class="form-check">
73 <input class="form-check-input" type="checkbox" formControlName="locked"
74 id="locked" [attr.disabled]="editMode?null:true">
75 <label class="form-check-label " for="locked">
76 {{'users.attributes.locked'|translate}}
79 <div class="form-check" >
80 <input class="form-check-input" type="checkbox"
81 formControlName="password_change_required"
82 id="password_change_required" [attr.disabled]="editMode?null:true">
83 <label class="form-check-label" for="password_change_required" >
84 {{'users.attributes.password_change_required'|translate}}
87 <div class="form-check">
88 <input class="form-check-input" type="checkbox"
89 formControlName="validated"
90 id="validated" [attr.disabled]="editMode?null:true">
91 <label class="form-check-label" for="validated">
92 {{'users.attributes.validated'|translate}}
97 <div class="form-group row col-md-8">
98 <label class="col-md-2 col-form-label" for="created">{{'users.attributes.created' |translate}}</label>
99 <div class="col-md-6">
100 <input type="text" id="created" class="form-control-plaintext"
101 value="{{editUser.timestamp_account_creation|date:'yyyy-MM-ddTHH:mm:ss'}}" [attr.readonly]="true">
104 <div class="form-group row col-md-8">
105 <label class="col-md-2 col-form-label" for="last_login">{{'users.attributes.last_login' |translate}}</label>
106 <div class="col-md-6">
107 <input type="text" id="last_login" class="form-control-plaintext"
108 value="{{editUser.timestamp_last_login|date:'yyyy-MM-ddTHH:mm:ss'}}" [attr.readonly]="true">
111 <div class="form-group row col-md-8">
112 <label class="col-md-2 col-form-label" for="email">{{'users.attributes.last_password_change' |translate}}</label>
113 <div class="col-md-6">
114 <input type="text" id="last_password_change" class="form-control-plaintext"
115 value="{{editUser.timestamp_last_password_change|date:'yyyy-MM-ddTHH:mm:ss'}}" [attr.readonly]="true">
119 <div class="form-group col-md-8" *ngIf="editMode">
120 <button class="btn btn-primary" type="submit"
121 [disabled]="userForm.invalid || !userForm.dirty">{{'users.edit.submit'|translate}}</button>
123 <div *ngIf="success" class="alert alert-success" role="alert">
124 User has been updated.
126 <div *ngIf="error" class="alert alert-danger" role="alert">
127 <h4 class="alert-heading">Errors</h4>
128 <ng-container *ngFor="let message of errorResult?.error_messages; first as isFirst">
129 <hr *ngIf="!isFirst">
130 <p>{{message.message}}</p>
133 <div *ngIf="editMode && userForm.invalid" class="alert alert-danger" role="alert" >
134 <h4 class="alert-heading">Validation Errors</h4>
135 <ng-container *ngFor="let message of getAllErrors(userForm); first as isFirst" >
136 <hr *ngIf="!isFirst">