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
12 ~ Unless required by applicable law or agreed to in writing,
13 ~ software distributed under the License is distributed on an
14 ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 ~ KIND, either express or implied. See the License for the
16 ~ specific language governing permissions and limitations
20 <form class="mt-3 mb-3" [formGroup]="userForm" (ngSubmit)="onSubmit()">
21 <div class="form-group col-md-8">
22 <label for="user_id">{{'users.attributes.user_id' |translate}}</label>
23 <input type="text" class="form-control" formControlName="user_id" id="user_id"
24 [ngClass]="valid('user_id')"
25 placeholder="{{'users.input.user_id'|translate}}">
26 <small>{{'users.input.small.user_id'|translate:{'minSize':this.minUserIdSize} }}</small>
27 <div *ngIf="userForm.get('user_id').invalid" class="invalid-feedback">
28 <div *ngIf="userForm.get('user_id').errors.required">
29 {{'form.error.required'|translate}}
31 <div *ngIf="userForm.get('user_id').errors.containsWhitespace">
32 {{'form.error.containsWhitespace'|translate}}
34 <div *ngIf="userForm.get('user_id').errors.userexists">
35 {{'form.error.userexists'|translate}}
40 <div class="form-group col-md-8">
41 <label for="full_name">{{'users.attributes.full_name' |translate}}</label>
42 <input type="text" class="form-control" formControlName="full_name" id="full_name"
43 [ngClass]="valid('full_name')"
44 placeholder="{{'users.input.full_name'|translate}}">
45 <small>{{'users.input.small.full_name'|translate}}</small>
47 <div class="form-group col-md-8">
48 <label for="email">{{'users.attributes.email' |translate}}</label>
49 <input type="text" class="form-control" formControlName="email" id="email"
50 [ngClass]="valid('email')"
51 placeholder="{{'users.input.email'|translate}}">
53 <div class="form-group col-md-8">
54 <label for="password">{{'users.attributes.password' |translate}}</label>
55 <input type="password" class="form-control" formControlName="password" id="password"
56 [ngClass]="valid('password')"
57 placeholder="{{'users.input.password'|translate}}">
59 <div class="form-group col-md-8">
60 <label for="confirm_password">{{'users.attributes.confirm_password' |translate}}</label>
61 <input type="password" class="form-control" formControlName="confirm_password" id="confirm_password"
62 [ngClass]="valid('confirm_password')"
63 placeholder="{{'users.input.confirm_password'|translate}}">
65 <div class="form-group col-md-8">
66 <div class="form-check">
67 <input class="form-check-input" type="checkbox" formControlName="locked" id="locked">
68 <label class="form-check-label" for="locked">
69 {{'users.attributes.locked'|translate}}
72 <div class="form-check">
73 <input class="form-check-input" type="checkbox" formControlName="password_change_required"
74 id="password_change_required" checked>
75 <label class="form-check-label" for="password_change_required">
76 {{'users.attributes.password_change_required'|translate}}
79 <div class="form-check">
80 <input class="form-check-input" type="checkbox" formControlName="validated"
81 id="validated" checked>
82 <label class="form-check-label" for="validated">
83 {{'users.attributes.validated'|translate}}
87 <div class="form-group col-md-8">
88 <button class="btn btn-primary" type="submit"
89 [attr.disabled]="userForm.valid?null:true">{{'users.add.submit'|translate}}</button>
91 <div *ngIf="success" class="alert alert-success" role="alert">
92 User <a [routerLink]="['user','users','edit',result?.user_id]">{{result?.userid}}</a> was added to the list.
94 <div *ngIf="error" class="alert alert-danger" role="alert" >
95 <h4 class="alert-heading">{{'users.add.errortitle'|translate}}</h4>
96 <ng-container *ngFor="let message of errorResult?.error_messages; first as isFirst" >
98 <p>{{message.message}}</p>