CHANGE_
This commit is contained in:
parent
70d9731525
commit
9d89a8ee4b
Binary file not shown.
@ -30,17 +30,17 @@
|
|||||||
<input formControlName="password" nbInput id="password" type="text" [status]="userForm.get('password').invalid && userForm.get('password').touched? 'danger' : 'basic'">
|
<input formControlName="password" nbInput id="password" type="text" [status]="userForm.get('password').invalid && userForm.get('password').touched? 'danger' : 'basic'">
|
||||||
|
|
||||||
<ng-container nbInputErrorMessage>
|
<ng-container nbInputErrorMessage>
|
||||||
|
<div style="color:#7c0e0e" *ngIf="userForm.get('password')?.invalid && (userForm.get('password')?.dirty || userForm.get('password')?.touched) && userForm.get('password')?.errors?.required">
|
||||||
<div style="color:#7c0e0e;font-size:small" *ngIf="!userForm.get('password')?.errors?.required && (userForm.get('password')?.errors?.pattern)">
|
Password is required
|
||||||
Password length must be greater than or equal to 8
|
</div>
|
||||||
|
<div style="color:#7c0e0e;font-size:12px;word-wrap: break-word;" *ngIf="!userForm.get('password')?.errors?.required && (userForm.get('password')?.errors?.pattern)">
|
||||||
|
Password length must be greater than or equal to 8 and password must contain one or more uppercase , lowercase , numeric and special characters
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div style="color:#7c0e0e" *ngIf="!userForm.get('password')?.errors?.required">
|
<!-- <div style="color:#7c0e0e" *ngIf="!userForm.get('password')?.errors?.required">
|
||||||
Password length must be greater than or equal to 8 and password must contain one or more uppercase , lowercase , numeric and special characters
|
Password length must be greater than or equal to 8 and password must contain one or more uppercase , lowercase , numeric and special characters
|
||||||
</div> -->
|
</div> -->
|
||||||
<div style="color:#7c0e0e" *ngIf="userForm.get('password')?.invalid && (userForm.get('password')?.dirty || userForm.get('password')?.touched) && userForm.get('password')?.errors?.required">
|
|
||||||
Password is required
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
</nb-form-field>
|
</nb-form-field>
|
||||||
|
|||||||
@ -16,4 +16,17 @@
|
|||||||
.show-grid{
|
.show-grid{
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
.error-message-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-message {
|
||||||
|
color: #7c0e0e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-message.small {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
@ -12,6 +12,7 @@ export class CustomerFormComponent implements OnInit {
|
|||||||
data:any =[];
|
data:any =[];
|
||||||
userForm: FormGroup | any; formData:any =[]
|
userForm: FormGroup | any; formData:any =[]
|
||||||
heading:any =[];
|
heading:any =[];
|
||||||
|
action: any;
|
||||||
constructor(private dialogRef: NbDialogRef<CustomerFormComponent> ,public _api:PageapiService,private dialogService: NbDialogService) {
|
constructor(private dialogRef: NbDialogRef<CustomerFormComponent> ,public _api:PageapiService,private dialogService: NbDialogService) {
|
||||||
|
|
||||||
|
|
||||||
@ -20,6 +21,8 @@ export class CustomerFormComponent implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
console.log('dialogRef', this.dialogRef.componentRef.instance);
|
console.log('dialogRef', this.dialogRef.componentRef.instance);
|
||||||
let details:any = this.dialogRef.componentRef.instance
|
let details:any = this.dialogRef.componentRef.instance
|
||||||
|
console.log('details',details)
|
||||||
|
this.action = details.action
|
||||||
|
|
||||||
this.heading = details.title
|
this.heading = details.title
|
||||||
|
|
||||||
@ -64,6 +67,21 @@ export class CustomerFormComponent implements OnInit {
|
|||||||
this.userForm.controls['password'].updateValueAndValidity();
|
this.userForm.controls['password'].updateValueAndValidity();
|
||||||
}
|
}
|
||||||
this.userForm.patchValue(this.data)
|
this.userForm.patchValue(this.data)
|
||||||
|
|
||||||
|
// Add value change listener for password field
|
||||||
|
this.userForm.get('password').valueChanges.subscribe(value => {
|
||||||
|
const passwordControl = this.userForm.get('password');
|
||||||
|
if (value) {
|
||||||
|
passwordControl.setValidators([
|
||||||
|
Validators.required,
|
||||||
|
Validators.pattern('^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*_=+-]).{8,16}$')
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
passwordControl.clearValidators();
|
||||||
|
}
|
||||||
|
passwordControl.updateValueAndValidity({ onlySelf: true, emitEvent: false });
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel(){
|
cancel(){
|
||||||
@ -108,7 +126,10 @@ export class CustomerFormComponent implements OnInit {
|
|||||||
|
|
||||||
this.formData.append('userName',tmp.userName)
|
this.formData.append('userName',tmp.userName)
|
||||||
this.formData.append('email', tmp.email);
|
this.formData.append('email', tmp.email);
|
||||||
if((tmp.password != "")){
|
// if((tmp.password != "")){
|
||||||
|
// this.formData.append('password', tmp.password);
|
||||||
|
// }
|
||||||
|
if (tmp.password) {
|
||||||
this.formData.append('password', tmp.password);
|
this.formData.append('password', tmp.password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
apiEndpoint:'https://api.vnms.in/api/',
|
apiEndpoint:'https://api.vnms.in/api/',
|
||||||
|
// apiEndpoint:'https://dev.venbait.in/vnms/api/',
|
||||||
// apiEndpoint:'http://localhost:8081/api/',
|
// apiEndpoint:'http://localhost:8081/api/',
|
||||||
mailUrl:'',
|
mailUrl:'',
|
||||||
production: false,
|
production: false,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user