Skip to content

Commit f377c3d

Browse files
committed
2 parents 57f6e42 + 60239a0 commit f377c3d

16 files changed

+203
-15
lines changed

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@angular/platform-browser-dynamic": "~13.3.8",
2323
"@angular/router": "~13.3.8",
2424
"@fortawesome/fontawesome-free": "^6.1.1",
25+
"@ng-bootstrap/ng-bootstrap": "^12.1.2",
2526
"@ngneat/transloco": "^4.0.0",
2627
"bootstrap": "^5.1.3",
2728
"rxjs": "~7.5.5",

frontend/src/app/anatomy/anatomy.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ <h6 class="my-5">3. {{ "anatomy.signature" | transloco }} (<span class="jwt-sign
9393

9494
<p class="font-grey">{{ "anatomy.signature1" | transloco }}</p>
9595

96-
<p class="font-grey">{{ "anatomy.signature2" | transloco }}</p>
96+
<p class="font-grey">{{ "anatomy.signature2" | transloco }} <span triggers="hover focus" ngbPopover="{{ 'anatomy.signature2Tooltip' | transloco }}" class="c-pointer">(?)</span></p>
9797

9898
<p class="font-grey">{{ "anatomy.signature3" | transloco }}</p>
9999

@@ -102,13 +102,13 @@ <h6 class="my-5">3. {{ "anatomy.signature" | transloco }} (<span class="jwt-sign
102102
<div class="card my-5">
103103
<div class="card-body">
104104
<div class="row">
105-
<div class="col-auto"><i class="fa-solid" [ngClass]="{'fa-caret-right': !showToken, 'fa-caret-down': showToken}" (click)="showToken = !showToken"></i></div>
105+
<div class="col-auto"><i class="fa-solid c-pointer" [ngClass]="{'fa-caret-right': !showToken, 'fa-caret-down': showToken}" (click)="showToken = !showToken"></i></div>
106106
<div class="col">{{ showToken ? token : token.substring(0, 20) + '...' }}</div>
107107
</div>
108108
</div>
109109
</div>
110110

111-
<button type="button" class="btn btn-primary btn-decode my-2">
111+
<button type="button" (click)="nextStep()" class="btn btn-primary btn-decode my-2">
112112
{{ "anatomy.verifyJwt" | transloco }}
113113
<img src="assets/images/icon-arrow-right.svg" class="ms-1" />
114114
</button>

frontend/src/app/anatomy/anatomy.component.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Component, OnInit } from '@angular/core';
2+
import { Router } from '@angular/router';
23

34
import { JwtService } from '../shared/services/jwt.service';
5+
import { StepService } from '../shared/services/step.service';
46

57
@Component({
68
selector: 'app-anatomy',
@@ -22,7 +24,10 @@ export class AnatomyComponent implements OnInit {
2224
jwtSignatureShort: string;
2325
token: string;
2426

25-
constructor(private jwtService: JwtService) {
27+
constructor(private router: Router,
28+
private jwtService: JwtService,
29+
private stepService: StepService) {
30+
this.stepService.setStep(2);
2631
this.showToken = false;
2732
this.jwtHeader = '';
2833
this.jwtHeaderShort = '';
@@ -45,7 +50,6 @@ export class AnatomyComponent implements OnInit {
4550
this.jwtService.get()
4651
.subscribe({
4752
next: (success: any) => {
48-
console.debug('success:', success);
4953
if (success && success.token) {
5054
const tokenSplitted = success.token.split('.');
5155
this.jwtHeader = tokenSplitted[0];
@@ -63,4 +67,9 @@ export class AnatomyComponent implements OnInit {
6367
});
6468
}
6569

70+
public nextStep(): void {
71+
this.stepService.setStep(3);
72+
this.router.navigate(['/verify']);
73+
}
74+
6675
}

frontend/src/app/anatomy/anatomy.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
3+
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
34
import { TranslocoModule } from '@ngneat/transloco';
45

56
// Routes
@@ -15,6 +16,7 @@ import { AnatomyComponent } from './anatomy.component';
1516
],
1617
imports: [
1718
CommonModule,
19+
NgbModule,
1820
TranslocoModule,
1921
// Routes
2022
AnatomyRoutingModule,

frontend/src/app/app-routing.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const routes: Routes = [
1515
path: 'home',
1616
loadChildren: () => import('./home/home.module').then(mod => mod.HomeModule),
1717
},
18+
{
19+
path: 'verify',
20+
loadChildren: () => import('./verify/verify.module').then(mod => mod.VerifyModule),
21+
},
1822
{
1923
path: '**',
2024
redirectTo: 'home',

frontend/src/app/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ <h2 class="my-5">{{ "home.knowledge" | transloco }}</h2>
4747
{{ "home.knowledge5" | transloco }}
4848
</p>
4949

50-
<button type="button" (click)="nextStep()" class="btn btn-primary btn-start mt-5">{{ "home.startInteractive" | transloco }}</button>
50+
<button type="button" (click)="nextStep()" class="btn btn-warning mt-5">{{ "home.startInteractive" | transloco }}</button>

frontend/src/app/home/home.component.scss

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,3 @@
77
.time-mins {
88
color: #a3acb9;
99
}
10-
11-
.btn-start {
12-
font-size: 18px;
13-
font-weight: bold;
14-
color: #1a2035;
15-
padding: 20px;
16-
border: solid 1px #eab500;
17-
background-color: #ffd852;
18-
}

frontend/src/app/shared/services/jwt.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ export class JwtService {
1919
return this.http.get<any>(this.url);
2020
}
2121

22+
public verifyToken(token: string): Observable<any> {
23+
return this.http.get<any>(`${this.url}/verify/${token}`);
24+
}
25+
2226
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
import { VerifyComponent } from './verify.component';
5+
6+
const routes: Routes = [
7+
{
8+
path: '',
9+
component: VerifyComponent,
10+
},
11+
];
12+
13+
@NgModule({
14+
imports: [
15+
RouterModule.forChild(routes),
16+
],
17+
exports: [
18+
RouterModule,
19+
],
20+
})
21+
export class VerifyRoutingModule {
22+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
<h1 class="mb-5">{{ "verify.verifyingToken" | transloco }}</h1>
3+
4+
<hr>
5+
6+
<div class="card card-jwt my-5">
7+
<div class="card-header">
8+
<div class="row">
9+
<div class="col">
10+
<img src="assets/images/icon-check-square.png" class="icon-check-square me-2" />
11+
{{ "verify.verifiedToken" | transloco | uppercase }}
12+
</div>
13+
<div class="col-auto">
14+
</div>
15+
</div>
16+
</div>
17+
<div class="card-body">
18+
<span class="jwt-decoded">{{ jwtDecoded }}</span>
19+
</div>
20+
</div>
21+
22+
<p class="font-grey">{{ "verify.verified1" | transloco }}</p>
23+
24+
<p class="font-grey" innerHTML="{{ 'verify.verified2' | transloco }}"></p>
25+
26+
<p class="font-grey">{{ "verify.verified3" | transloco }}</p>
27+
28+
<div class="row">
29+
<div class="col text-end">
30+
<button type="button" (click)="nextStep()" class="btn btn-outline-light mt-5">{{ "verify.back" | transloco }}</button>
31+
</div>
32+
<div class="col-auto text-end">
33+
<button type="button" (click)="nextStep()" class="btn btn-warning mt-5" innerHTML="{{ 'verify.createMore' | transloco }}"></button>
34+
</div>
35+
</div>

0 commit comments

Comments
 (0)