perbaikan profil, update password dan master
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
class="form-control"
|
||||
formControlName="firstName"
|
||||
maxlength="20"
|
||||
placeholder="John Vander"
|
||||
[ngClass]="{'is-invalid': profilInfo.get('firstName').invalid && profilInfo.get('firstName').touched}"
|
||||
/>
|
||||
<div *ngIf="profilInfo.get('firstName').invalid && profilInfo.get('firstName').touched" class="text-danger">
|
||||
@@ -31,7 +30,6 @@
|
||||
class="form-control"
|
||||
formControlName="lastName"
|
||||
maxlength="20"
|
||||
placeholder="John Vander"
|
||||
[ngClass]="{'is-invalid': profilInfo.get('lastName').invalid && profilInfo.get('lastName').touched}"
|
||||
/>
|
||||
<div *ngIf="profilInfo.get('firstName').invalid && profilInfo.get('firstName').touched" class="text-danger">
|
||||
@@ -45,7 +43,6 @@
|
||||
id="email"
|
||||
class="form-control"
|
||||
formControlName="email"
|
||||
placeholder="email@email.com"
|
||||
maxlength="50"
|
||||
[ngClass]="{'is-invalid': profilInfo.get('email').invalid && profilInfo.get('email').touched}"
|
||||
/>
|
||||
@@ -61,7 +58,6 @@
|
||||
class="form-control"
|
||||
formControlName="phone"
|
||||
maxlength="13"
|
||||
placeholder="08**************"
|
||||
pattern="^[0-9]*$"
|
||||
[ngClass]="{'is-invalid': profilInfo.get('phone').invalid && profilInfo.get('phone').touched}"
|
||||
/>
|
||||
|
||||
@@ -52,7 +52,7 @@ export class ProfilInformationComponent {
|
||||
lastName: ["", Validators.required],
|
||||
email: ["", [Validators.required, Validators.pattern(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/)]],
|
||||
phone: ["", [Validators.required, Validators.pattern(/^[0-9]{10,15}$/)]],
|
||||
image: [null],
|
||||
image: [null, Validators.required],
|
||||
});
|
||||
this.dataProfil(this.storedData.sub);
|
||||
this.profilInfo.valueChanges.subscribe(() => {
|
||||
|
||||
@@ -49,7 +49,9 @@
|
||||
</button>
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
<label for="newPass" style="color: #ffffff">New Password</label>
|
||||
<label for="newPass" style="color: #ffffff"
|
||||
>New Password</label
|
||||
>
|
||||
<div class="input-group">
|
||||
<input
|
||||
[type]="showNewPass ? 'text' : 'password'"
|
||||
@@ -67,29 +69,38 @@
|
||||
type="button"
|
||||
class="btn btn-link"
|
||||
(click)="toggleNewPassVisibility()"
|
||||
style="color: #c3f164 !important;"
|
||||
style="color: #c3f164 !important"
|
||||
>
|
||||
<i [class]="showNewPass ? 'fa fa-eye-slash' : 'fa fa-eye'"></i>
|
||||
<i
|
||||
[class]="
|
||||
showNewPass ? 'fa fa-eye-slash' : 'fa fa-eye'
|
||||
"
|
||||
></i>
|
||||
</button>
|
||||
</div>
|
||||
<small
|
||||
class="form-text text-muted danger"
|
||||
*ngIf="submitted && f.newPass.errors"
|
||||
class="invalid-feedback"
|
||||
>
|
||||
<div *ngIf="f.newPass.errors.required">
|
||||
New Password is required
|
||||
</div>
|
||||
<div *ngIf="f.newPass.errors.minlength">
|
||||
New Password must be at least 8 characters long
|
||||
</div>
|
||||
<div *ngIf="f.newPass.errors.pattern">
|
||||
New Password must contain at least one uppercase
|
||||
letter, one lowercase letter, and one number
|
||||
</div>
|
||||
</small>
|
||||
</div>
|
||||
<small
|
||||
class="form-text text-muted danger"
|
||||
*ngIf="submitted && f.newPass.errors"
|
||||
class="invalid-feedback"
|
||||
>
|
||||
<div *ngIf="f.newPass.errors.required">New Password is required</div>
|
||||
<div *ngIf="f.newPass.errors.minlength">
|
||||
New Password must be at least 8 characters long
|
||||
</div>
|
||||
<div *ngIf="f.newPass.errors.pattern">
|
||||
New Password must contain at least one uppercase letter, one lowercase letter, and one number
|
||||
</div>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="confirmPass" style="color: #ffffff">Confirm Password</label>
|
||||
<label for="confirmPass" style="color: #ffffff"
|
||||
>Confirm Password</label
|
||||
>
|
||||
<div class="input-group">
|
||||
<input
|
||||
[type]="showConfirmPass ? 'text' : 'password'"
|
||||
@@ -107,22 +118,30 @@
|
||||
type="button"
|
||||
class="btn btn-link"
|
||||
(click)="toggleConfirmPassVisibility()"
|
||||
style="color: #c3f164 !important;"
|
||||
style="color: #c3f164 !important"
|
||||
>
|
||||
<i [class]="showConfirmPass ? 'fa fa-eye-slash' : 'fa fa-eye'"></i>
|
||||
<i
|
||||
[class]="
|
||||
showConfirmPass
|
||||
? 'fa fa-eye-slash'
|
||||
: 'fa fa-eye'
|
||||
"
|
||||
></i>
|
||||
</button>
|
||||
</div>
|
||||
<small
|
||||
class="form-text text-muted danger"
|
||||
*ngIf="submitted && f.confirmPass.errors"
|
||||
class="invalid-feedback"
|
||||
>
|
||||
<div *ngIf="f.confirmPass.errors.required">
|
||||
Confirm Password is required
|
||||
</div>
|
||||
<div *ngIf="f.confirmPass.errors.matchPassword">
|
||||
Confirm Password must match the New Password
|
||||
</div>
|
||||
</small>
|
||||
</div>
|
||||
<small
|
||||
class="form-text text-muted danger"
|
||||
*ngIf="submitted && f.confirmPass.errors"
|
||||
class="invalid-feedback"
|
||||
>
|
||||
<div *ngIf="f.confirmPass.errors.required">Confirm Password is required</div>
|
||||
<div *ngIf="f.confirmPass.errors.matchPassword">
|
||||
Confirm Password must match the New Password
|
||||
</div>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -93,8 +93,6 @@ export class UpdatePasswordComponent {
|
||||
if (this.profilInfo.invalid) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle form submission
|
||||
}
|
||||
|
||||
cancel() {
|
||||
@@ -114,6 +112,7 @@ export class UpdatePasswordComponent {
|
||||
}
|
||||
|
||||
saveEdit() {
|
||||
this.submitted = true;
|
||||
if (this.profilInfo.valid) {
|
||||
const dataPassword = {
|
||||
userid: this.profilInfo.value.userid,
|
||||
@@ -135,6 +134,8 @@ export class UpdatePasswordComponent {
|
||||
});
|
||||
}
|
||||
);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user