Skip to content

Commit

Permalink
✔ Saran Dari User ~
Browse files Browse the repository at this point in the history
  • Loading branch information
bifeldy committed Dec 31, 2023
1 parent 25c8c24 commit d2c5c5d
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/api/middlewares/register.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export class RegisterMiddleware implements NestMiddleware {
}, HttpStatus.BAD_REQUEST);
}
const result: any = {};
if (usrName.length < 8) {
result.username = 'Nama Pengguna Minimal 8 Huruf';
if (usrName.length < 6) {
result.username = 'Nama Pengguna Minimal 6 Huruf';
}
if (!req.body.email.match(/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/)) {
result.email = 'Email Tidak Valid';
Expand Down
8 changes: 4 additions & 4 deletions src/app/_pages/register/register.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1 class="h3 mb-3 font-weight-normal">Hai, Selamat Datang! >_<"</h1>
<div class="input-group">
<input type="text" id="username" class="text-bifeldy form-control {{
!fg.get('username').valid && fg.get('username').touched ? 'is-invalid' : ''
}}" placeholder="Username Minimal 8 Huruf" required formControlName="username" autocomplete="username"
}}" placeholder="Username Minimal 6 Huruf" required formControlName="username" autocomplete="username"
style="border-top-right-radius: 0; border-bottom-right-radius: 0;" />
<div class="input-group-append">
<span class="input-group-text" style="border-top-left-radius: 0; border-bottom-left-radius: 0;">
Expand All @@ -30,7 +30,7 @@ <h1 class="h3 mb-3 font-weight-normal">Hai, Selamat Datang! >_<"</h1>
Username Tidak Boleh Kosong <br />
</strong>
<strong *ngIf="fg.get('username').hasError('minlength')">
Username Minimal 8 Huruf <br />
Username Minimal 6 Huruf <br />
</strong>
<strong *ngIf="fg.get('username').hasError('pattern')">
Username Hanya Boleh Huruf Kecil Dan Angka <br />
Expand Down Expand Up @@ -84,13 +84,13 @@ <h1 class="h3 mb-3 font-weight-normal">Hai, Selamat Datang! >_<"</h1>
<div class="col-md-8">
<input type="password" id="password" class="text-bifeldy form-control {{
!fg.get('password').valid && fg.get('password').touched ? 'is-invalid' : ''
}}" placeholder="Password Minimal 8 Huruf" required formControlName="password" autocomplete="current-password, new-password" />
}}" placeholder="Password Minimal 6 Huruf" required formControlName="password" autocomplete="current-password, new-password" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg.get('password').hasError('required')">
Password Tidak Boleh Kosong <br />
</strong>
<strong *ngIf="fg.get('password').hasError('minlength')">
Password Minimal 8 Huruf <br />
Password Minimal 6 Huruf <br />
</strong>
<strong *ngIf="fg.get('password').hasError('pattern')">
Password Hanya Boleh Huruf Standar Papan Ketik <br />
Expand Down
4 changes: 2 additions & 2 deletions src/app/_pages/register/register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ export class RegisterComponent implements OnInit, OnDestroy {

initForm(): void {
this.fg = this.fb.group({
username: [null, [Validators.required, Validators.minLength(8), Validators.pattern(/^[a-z0-9]+$/)]],
username: [null, [Validators.required, Validators.minLength(6), Validators.pattern(/^[a-z0-9]+$/)]],
name: [null, [Validators.required, Validators.pattern(/^[a-zA-Z. ]+$/)]],
email: [null, [Validators.required, Validators.email, Validators.pattern(CONSTANTS.regexEmail)]],
password: [null, [Validators.required, Validators.minLength(8), Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)]],
password: [null, [Validators.required, Validators.minLength(6), Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)]],
agree_tatib: [null, [Validators.required]],
agree_pp: [null, [Validators.required]],
'g-recaptcha-response': [null, [Validators.required, Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)]]
Expand Down
4 changes: 2 additions & 2 deletions src/app/_pages/reset-password/reset-password.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ <h1 class="h3 mb-3 font-weight-normal">Hikz, Akun Kamu Kenapa (?)</h1>
<div class="col-md-8">
<input type="password" id="password" class="text-bifeldy form-control {{
!fg2.get('password').valid && fg2.get('password').touched ? 'is-invalid' : ''
}}" placeholder="Password Minimal 8 Huruf" required formControlName="password" autocomplete="password" />
}}" placeholder="Password Minimal 6 Huruf" required formControlName="password" autocomplete="password" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg2.get('password').hasError('required')">
Password Tidak Boleh Kosong <br />
</strong>
<strong *ngIf="fg2.get('password').hasError('minlength')">
Password Minimal 8 Huruf <br />
Password Minimal 6 Huruf <br />
</strong>
<strong *ngIf="fg2.get('password').hasError('pattern')">
Password Hanya Boleh Huruf Standar Papan Ketik <br />
Expand Down
2 changes: 1 addition & 1 deletion src/app/_pages/reset-password/reset-password.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class ResetPasswordComponent implements OnInit, AfterViewInit, OnDestroy
});
this.fg2 = this.fb.group({
token: [null, [Validators.required, Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)]],
password: [null, [Validators.required, Validators.minLength(8), Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)]]
password: [null, [Validators.required, Validators.minLength(6), Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)]]
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/_pages/user/user-edit/user-edit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h1 class="m-0 mt-auto">
</button>
<mat-error>
<div *ngIf="fg.get('old_password').hasError('required')">Password Tidak Boleh Kosong</div>
<div *ngIf="fg.get('old_password').hasError('minlength')">Password Minimal 8 Huruf</div>
<div *ngIf="fg.get('old_password').hasError('minlength')">Password Minimal 6 Huruf</div>
<div *ngIf="fg.get('old_password').hasError('pattern')">Password Hanya Boleh Huruf Standar Papan Ketik</div>
</mat-error>
</mat-form-field>
Expand All @@ -98,7 +98,7 @@ <h1 class="m-0 mt-auto">
<mat-icon [fontIcon]="passwordHide ? 'visibility_off' : 'visibility'"></mat-icon>
</button>
<mat-error>
<div *ngIf="fg.get('new_password').hasError('minlength')">Password Minimal 8 Huruf</div>
<div *ngIf="fg.get('new_password').hasError('minlength')">Password Minimal 6 Huruf</div>
<div *ngIf="fg.get('new_password').hasError('pattern')">Password Hanya Boleh Huruf Standar Papan Ketik</div>
</mat-error>
</mat-form-field>
Expand Down
4 changes: 2 additions & 2 deletions src/app/_pages/user/user-edit/user-edit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export class UserEditComponent implements OnInit, OnDestroy {
this.fg = this.fb.group({
nama: [data.kartu_tanda_penduduk_.nama, [Validators.required, Validators.pattern(/^[a-zA-Z. ]+$/)]],
description: [data.profile_.description, Validators.compose([Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)])],
old_password: [null, Validators.compose([Validators.required, Validators.minLength(8), Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)])],
new_password: [null, Validators.compose([Validators.minLength(8), Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)])],
old_password: [null, Validators.compose([Validators.required, Validators.minLength(6), Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)])],
new_password: [null, Validators.compose([Validators.minLength(6), Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)])],
image_photo: [null, Validators.compose([Validators.pattern(CONSTANTS.regexUrl)])],
image_cover: [null, Validators.compose([Validators.pattern(CONSTANTS.regexUrl)])],
private: [data.private, Validators.compose([Validators.required])]
Expand Down
1 change: 1 addition & 0 deletions src/app/_shared/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export class AuthService {
clearInterval(this.intervalLogout);
this.intervalLogout = null;
this.logoutTimerText = '';
window.location.reload();
}
}, 1000);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/_shared/services/service-worker.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class ServiceWorkerService {
this.dialogRef = this.ds.openInfoDialog({
data: {
title: `Pembaharuan ${au ? 'Berhasil' : 'Gagal'}`,
htmlMessage: `Ingin Refresh Halaman (?)`,
htmlMessage: `Ingin Refresh Halaman Sekarang (?)`,
confirmText: 'Ya',
cancelText: 'Tidak'
}
Expand Down

0 comments on commit d2c5c5d

Please sign in to comment.