Skip to content

Commit

Permalink
✔ Fix Some 💩
Browse files Browse the repository at this point in the history
  • Loading branch information
bifeldy committed May 18, 2023
1 parent 01c086a commit 037c813
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/app/_pages/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="h3 mb-3 font-weight-normal">Hai, Jumpa Lagi! >_<"</h1>
<div class="col-md-8">
<input type="text" id="userNameOrEmail" class="text-bifeldy form-control {{
!fg.get('userNameOrEmail').valid && fg.get('userNameOrEmail').touched ? 'is-invalid' : ''
}}" placeholder="Username / E-Mail" required autofocus formControlName="userNameOrEmail" autocomplete="email, username" />
}}" placeholder="Username / E-Mail" required formControlName="userNameOrEmail" autocomplete="email, username" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg.get('userNameOrEmail').hasError('required')">
Username / Email Tidak Boleh Kosong! <br />
Expand Down
2 changes: 1 addition & 1 deletion src/app/_pages/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class LoginComponent implements OnInit, OnDestroy {
}

ngOnInit(): void {
this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || this.gs.previousUrl || '/home';
this.returnUrl = this.route.snapshot.queryParamMap.get('returnUrl') || this.gs.previousUrl || '/';
if (this.gs.isBrowser) {
this.subsUser = this.as.currentUser.subscribe({
next: user => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/_pages/not-found/not-found.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class NotFoundComponent implements OnInit, OnDestroy {

ngOnInit(): void {
if (this.gs.isBrowser) {
this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/home';
this.returnUrl = this.route.snapshot.queryParamMap.get('returnUrl') || '/';
if (this.returnUrl) {
this.timedOut = setTimeout(() => {
this.router.navigateByUrl(this.returnUrl);
Expand Down
6 changes: 3 additions & 3 deletions src/app/_pages/register/register.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1 class="h3 mb-3 font-weight-normal">Hai, Selamat Datang! >_<"</h1>
<div class="col-md-8">
<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 autofocus formControlName="username" autocomplete="username" />
}}" placeholder="Username Minimal 8 Huruf" required formControlName="username" autocomplete="username" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg.get('username').hasError('required')">
Username Tidak Boleh Kosong <br />
Expand All @@ -39,7 +39,7 @@ <h1 class="h3 mb-3 font-weight-normal">Hai, Selamat Datang! >_<"</h1>
<div class="col-md-8">
<input type="text" id="name" class="text-bifeldy form-control {{
!fg.get('name').valid && fg.get('name').touched ? 'is-invalid' : ''
}}" placeholder="Nama Lengkap" required autofocus formControlName="name" autocomplete="name" />
}}" placeholder="Nama Lengkap" required formControlName="name" autocomplete="name" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg.get('name').hasError('required')">
Nama Tidak Boleh Kosong <br />
Expand All @@ -55,7 +55,7 @@ <h1 class="h3 mb-3 font-weight-normal">Hai, Selamat Datang! >_<"</h1>
<div class="col-md-8">
<input type="email" id="email" class="text-bifeldy form-control {{
!fg.get('email').valid && fg.get('email').touched ? 'is-invalid' : ''
}}" placeholder="Alamat E-Mail" required autofocus formControlName="email" autocomplete="email" />
}}" placeholder="Alamat E-Mail" required formControlName="email" autocomplete="email" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg.get('email').hasError('required')">
Email Tidak Boleh Kosong <br />
Expand Down
2 changes: 1 addition & 1 deletion src/app/_pages/register/register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class RegisterComponent implements OnInit, OnDestroy {
}

ngOnInit(): void {
this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/home';
this.returnUrl = this.route.snapshot.queryParamMap.get('returnUrl') || '/';
if (this.gs.isBrowser) {
this.subsUser = this.as.currentUser.subscribe({
next: user => {
Expand Down
8 changes: 4 additions & 4 deletions src/app/_pages/reset-password/reset-password.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1 class="h3 mb-3 font-weight-normal">Hikz, Akun Kamu Kenapa (?)</h1>
<div class="col-md-8">
<input type="text" id="userNameOrEmail" class="text-bifeldy form-control {{
!fg1.get('userNameOrEmail').valid && fg1.get('userNameOrEmail').touched ? 'is-invalid' : ''
}}" placeholder="Username / E-Mail" required autofocus formControlName="userNameOrEmail" autocomplete="email, username" />
}}" placeholder="Username / E-Mail" required formControlName="userNameOrEmail" autocomplete="email, username" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg1.get('userNameOrEmail').hasError('required')">
Username / Email Tidak Boleh Kosong! <br />
Expand Down Expand Up @@ -48,7 +48,7 @@ <h1 class="h3 mb-3 font-weight-normal">Hikz, Akun Kamu Kenapa (?)</h1>
<div class="col-md-8">
<textarea rows="3" type="text" id="token" class="text-bifeldy form-control {{
!fg2.get('token').valid && fg2.get('token').touched ? 'is-invalid' : ''
}}" placeholder="Token" required autofocus formControlName="token" autocomplete="token">
}}" placeholder="Token" required formControlName="token" autocomplete="token">
</textarea>
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg2.get('token').hasError('required')">
Expand All @@ -63,9 +63,9 @@ <h1 class="h3 mb-3 font-weight-normal">Hikz, Akun Kamu Kenapa (?)</h1>
<div class="form-group row py-2">
<label for="password" class="col-md-4 col-form-label text-md-end">Password Baru</label>
<div class="col-md-8">
<input type="text" id="password" class="text-bifeldy form-control {{
<input type="password" id="password" class="text-bifeldy form-control {{
!fg2.get('password').valid && fg2.get('password').touched ? 'is-invalid' : ''
}}" placeholder="Kata Sandi" required autofocus formControlName="password" autocomplete="password" />
}}" placeholder="Password Minimal 8 Huruf" required formControlName="password" autocomplete="password" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg2.get('password').hasError('required')">
Password Tidak Boleh Kosong <br />
Expand Down
5 changes: 3 additions & 2 deletions src/app/_pages/reset-password/reset-password.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
subsUser = null;

constructor(
private activatedRoute: ActivatedRoute,
private breakpointObserver: BreakpointObserver,
private fb: FormBuilder,
private router: Router,
Expand Down Expand Up @@ -68,7 +69,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
}

ngOnInit(): void {
this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || this.gs.previousUrl || '/home';
this.returnUrl = this.route.snapshot.queryParamMap.get('returnUrl') || '/';
if (this.gs.isBrowser) {
this.initForm();
this.subsUser = this.as.currentUser.subscribe({
Expand All @@ -91,7 +92,7 @@ export class ResetPasswordComponent implements OnInit, OnDestroy {
'g-recaptcha-response': [null, [Validators.required, Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)]]
});
this.fg2 = this.fb.group({
token: [null, [Validators.required, Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)]],
token: [this.activatedRoute.snapshot.queryParamMap.get('token'), [Validators.required, Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)]],
password: [null, [Validators.required, Validators.minLength(8), Validators.pattern(CONSTANTS.regexEnglishKeyboardKeys)]]
});
}
Expand Down
16 changes: 8 additions & 8 deletions src/app/_pages/verify/verify.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1 class="h3 mb-3 font-weight-normal">Yuhu~, Ayo Verifikasi! >_<"</h1>
<div class="col-md-8">
<input type="text" id="nik" class="form-control {{
!fg1.get('nik').valid && fg1.get('nik').touched ? 'is-invalid' : ''
}}" placeholder="Nomor Induk Kependudukan" required autofocus formControlName="nik" autocomplete="nik" />
}}" placeholder="Nomor Induk Kependudukan" required formControlName="nik" autocomplete="nik" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg1.get('nik').hasError('required')">
Nomor NIK Tidak Boleh Kosong! <br />
Expand All @@ -41,7 +41,7 @@ <h1 class="h3 mb-3 font-weight-normal">Yuhu~, Ayo Verifikasi! >_<"</h1>
<div class="col-md-8">
<input type="text" id="nama" class="form-control {{
!fg1.get('nama').valid && fg1.get('nama').touched ? 'is-invalid' : ''
}}" placeholder="Nama Depan" required autofocus formControlName="nama" autocomplete="nama" />
}}" placeholder="Nama Depan" required formControlName="nama" autocomplete="nama" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg1.get('nama').hasError('required')">
Nama Depan Tidak Boleh Kosong! <br />
Expand Down Expand Up @@ -69,7 +69,7 @@ <h1 class="h3 mb-3 font-weight-normal">Yuhu~, Ayo Verifikasi! >_<"</h1>
<div class="col-md-8">
<input type="text" id="nik" class="form-control {{
!fg2.get('nik').valid && fg2.get('nik').touched ? 'is-invalid' : ''
}}" placeholder="Nomor Induk Kependudukan" required autofocus formControlName="nik" autocomplete="nik" />
}}" placeholder="Nomor Induk Kependudukan" required formControlName="nik" autocomplete="nik" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg2.get('nik').hasError('required')">
NIK Tidak Boleh Kosong! <br />
Expand All @@ -85,7 +85,7 @@ <h1 class="h3 mb-3 font-weight-normal">Yuhu~, Ayo Verifikasi! >_<"</h1>
<div class="col-md-8">
<input type="text" id="nama" class="form-control {{
!fg2.get('nama').valid && fg2.get('nama').touched ? 'is-invalid' : ''
}}" placeholder="Nama Depan" required autofocus formControlName="nama" autocomplete="nama" />
}}" placeholder="Nama Depan" required formControlName="nama" autocomplete="nama" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg2.get('nama').hasError('required')">
Nama Depan Tidak Boleh Kosong! <br />
Expand All @@ -101,7 +101,7 @@ <h1 class="h3 mb-3 font-weight-normal">Yuhu~, Ayo Verifikasi! >_<"</h1>
<div class="col-md-8">
<input type="text" id="tempat_lahir" class="form-control {{
!fg2.get('tempat_lahir').valid && fg2.get('tempat_lahir').touched ? 'is-invalid' : ''
}}" placeholder="Tempat Lahir" required autofocus formControlName="tempat_lahir" autocomplete="tempat_lahir" />
}}" placeholder="Tempat Lahir" required formControlName="tempat_lahir" autocomplete="tempat_lahir" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg2.get('tempat_lahir').hasError('required')">
Tempat Lahir Tidak Boleh Kosong! <br />
Expand All @@ -117,7 +117,7 @@ <h1 class="h3 mb-3 font-weight-normal">Yuhu~, Ayo Verifikasi! >_<"</h1>
<div class="col-md-8">
<input type="text" id="jenis_kelamin" class="form-control {{
!fg2.get('jenis_kelamin').valid && fg2.get('jenis_kelamin').touched ? 'is-invalid' : ''
}}" placeholder="Jenis Kelamin" required autofocus formControlName="jenis_kelamin" autocomplete="jenis_kelamin" />
}}" placeholder="Jenis Kelamin" required formControlName="jenis_kelamin" autocomplete="jenis_kelamin" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg2.get('jenis_kelamin').hasError('required')">
Tempat Lahir Tidak Boleh Kosong! <br />
Expand All @@ -133,7 +133,7 @@ <h1 class="h3 mb-3 font-weight-normal">Yuhu~, Ayo Verifikasi! >_<"</h1>
<div class="col-md-8">
<input type="text" id="kelurahan_desa" class="form-control {{
!fg2.get('kelurahan_desa').valid && fg2.get('kelurahan_desa').touched ? 'is-invalid' : ''
}}" placeholder="Kelurahan / Desa" required autofocus formControlName="kelurahan_desa" autocomplete="kelurahan_desa" />
}}" placeholder="Kelurahan / Desa" required formControlName="kelurahan_desa" autocomplete="kelurahan_desa" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg2.get('kelurahan_desa').hasError('required')">
Kelurahan Tidak Boleh Kosong! <br />
Expand All @@ -149,7 +149,7 @@ <h1 class="h3 mb-3 font-weight-normal">Yuhu~, Ayo Verifikasi! >_<"</h1>
<div class="col-md-8">
<input type="text" id="kecamatan / Kota" class="form-control {{
!fg2.get('kecamatan').valid && fg2.get('kecamatan').touched ? 'is-invalid' : ''
}}" placeholder="Kelurahan" required autofocus formControlName="kecamatan" autocomplete="kecamatan" />
}}" placeholder="Kelurahan" required formControlName="kecamatan" autocomplete="kecamatan" />
<span class="invalid-feedback" role="alert">
<strong *ngIf="fg2.get('kecamatan').hasError('required')">
Kecamatan Tidak Boleh Kosong! <br />
Expand Down
2 changes: 1 addition & 1 deletion src/app/_pages/verify/verify.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class VerifyComponent implements OnInit, OnDestroy {
}

ngOnInit(): void {
this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || this.gs.previousUrl || '/home';
this.returnUrl = this.route.snapshot.queryParamMap.get('returnUrl') || '/';
if (this.returnUrl.includes('/login')) {
this.returnUrl = '/';
}
Expand Down

0 comments on commit 037c813

Please sign in to comment.