Skip to content

Commit 1d928b5

Browse files
authored
Merge pull request #41 from WildCodeSchool/development
Development
2 parents 3b27bd8 + 50d5850 commit 1d928b5

File tree

49 files changed

+732
-135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+732
-135
lines changed

src/app/app.routes.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { CalendarComponent } from './feature/calendars/components/calendar/calen
1818
import { CrudUserComponent } from './feature/user/page/crud-user/crud-user.component';
1919
import { AboutUsComponent } from './feature/home/components/about-us/about-us.component';
2020
import { ContactComponent } from './feature/contact/contact.component';
21+
import { CguPageComponent } from './feature/legal/cgu-page/cgu-page.component';
2122

2223
export const routes: Routes = [
2324
{
@@ -54,6 +55,11 @@ export const routes: Routes = [
5455
},
5556
{ path: 'auth', component: UserConnectionComponent },
5657

58+
{
59+
path: 'conditions-generales',
60+
component: CguPageComponent,
61+
},
62+
5763
{
5864
path: 'providers',
5965
component: ProviderHomeComponent,

src/app/core/components/footer/footer.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
<h5 class="fw-bold mb-3">HandyApp</h5>
1818
<ul class="list-unstyled">
1919
<li><a href="#" class="text-white text-decoration-none d-block mb-2">A propos</a></li>
20-
<li><a href="#" class="text-white text-decoration-none d-block mb-2">Nouvelles</a></li>
20+
<li>
21+
<a href="https://handicap.gouv.fr/les-articles-de-presse-et-les-actualites" class="text-white text-decoration-none d-block mb-2"
22+
>Nouvelles</a
23+
>
24+
</li>
2125
<li><a href="#" class="text-white text-decoration-none d-block mb-2">Relations</a></li>
2226
<li><a href="#" class="text-white text-decoration-none d-block mb-2">Rejoignez-nous</a></li>
2327
</ul>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.logo {
2+
max-height: 50px;
3+
}

src/app/core/components/header/header.component.html

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1-
<header class="bg-dark text-white py-3">
2-
<div class="container d-flex flex-column flex-md-row align-items-center justify-content-center justify-content-md-between">
3-
<div class="col-12 col-md-3 mb-4 mb-md-0">
4-
<img src="assets/logo.png" alt="Logo Alfred" class="img-fluid" />
5-
</div>
6-
<span class="header-logo mx-auto mx-md-0 text-center">Handy App</span>
7-
<nav class="d-none d-md-flex gap-4">
1+
<header class="bg-dark text-white py-3 position-relative">
2+
<div class="position-absolute start-0 top-50 translate-middle-y ms-3">
3+
<a [routerLink]="''">
4+
<img src="assets/logo.png" alt="Logo Alfred" class="img-fluid logo" />
5+
</a>
6+
</div>
7+
8+
<div class="container px-0 d-flex flex-column flex-md-row align-items-center ustify-content-center position-relative">
9+
<nav class="d-none d-md-flex gap-4 mx-auto">
810
<a [routerLink]="''" class="nav-link">Accueil</a>
911
<a [routerLink]="'/products'" class="nav-link">Services</a>
1012
<a [routerLink]="'/providers-list'" class="nav-link">Prestataires</a>
1113
<a [routerLink]="'/contacts'" class="nav-link">Contact</a>
1214
</nav>
13-
@if (isLoggedIn) {
14-
<button type="button" class="btn btn-danger d-none d-md-block" (click)="onLogout()">Déconnexion</button>
15-
} @else {
16-
<button type="button" class="header-button btn btn-success d-none d-md-block" (click)="navigateToSignUpPage()">Se connecter/ s'inscrire</button>
17-
}
15+
<div class="d-flex align-items-center gap-2">
16+
@if (isLoggedIn) {
17+
<button type="button" class="btn btn-danger d-none d-md-block me-3" (click)="onLogout()">Déconnexion</button>
18+
} @else {
19+
<div class="d-flex align-items-center gap-2 d-none d-md-flex">
20+
<button type="button" class="header-button btn btn-success d-none d-md-block" (click)="navigateToSignUpPage()">Se connecter</button>
21+
<a [routerLink]="'/signup'" class="text-white text-decoration-underline d-none d-md-block"> S'inscrire </a>
22+
</div>
23+
}
24+
</div>
1825

1926
@if (isLoggedIn) {
2027
@if (isProvider$ | async) {
@@ -37,7 +44,8 @@
3744
@if (isLoggedIn) {
3845
<button type="button" class="btn btn-danger mt-3" (click)="onLogout()">Déconnexion</button>
3946
} @else {
40-
<button type="button" class="btn btn-success mt-3" (click)="navigateToSignUpPage()">Se connecter / S'inscrire</button>
47+
<button type="button" class="btn btn-success mt-3" (click)="navigateToSignUpPage()">Se connecter</button>
48+
<a [routerLink]="'/signup'" class="text-white text-decoration-underline"> S'inscrire </a>
4149
}
4250
</nav>
4351
</div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.logo {
2+
max-height: 50px;
3+
}

src/app/core/interceptors/http-error.interceptor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ import { HttpInterceptorFn } from '@angular/common/http';
22
import { inject } from '@angular/core';
33
import { Router } from '@angular/router';
44
import { catchError, throwError } from 'rxjs';
5+
import { AuthService } from '../services/auth.service';
56

67
export const httpErrorInterceptor: HttpInterceptorFn = (req, next) => {
78
const router = inject(Router);
9+
const authService = inject(AuthService);
810

911
return next(req).pipe(
1012
catchError(err => {
1113
if (err.status === 401 || err.status === 403) {
14+
authService.logout();
15+
alert('Votre session a expiré, veuillez vous reconnecter.');
1216
router.navigate(['/login']);
1317
}
1418

src/app/core/services/auth.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,4 @@ export class AuthService {
116116
getCurrentUserId(): number | null {
117117
return this._userPayload ? this._userPayload.id : null;
118118
}
119-
120119
}

src/app/core/validators/validators.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ export function securePasswordValidator(minLength: number = 12): ValidatorFn {
2323
return passwordValid ? null : { securePassword: true };
2424
};
2525
}
26+
export function termsAcceptedValidator(): ValidatorFn {
27+
return (control: AbstractControl): ValidationErrors | null => {
28+
return control.value === true ? null : { termsNotAccepted: true };
29+
};
30+
}

src/app/feature/admin/page/admin-home/admin-home.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<p>admin-home works!</p>
21
<div class="container py-5">
32
<h2 class="text-center mb-4">Bienvenue sur le tableau de bord Admin 👑</h2>
43
<p>Créér / Modifier / Supprimer et gouverner</p>

src/app/feature/cart/components/create-cart/create-cart.component.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@
2626

2727
@let selectedSlot = selectedSlots[item.userId + '_' + item.provisionId];
2828
@if (selectedSlot) {
29-
<button type="button" (click)="confirmAvailability(item.userId, item.provisionId)" class="btn-confirm">Confirmer le créneau ✅</button>
29+
<button
30+
type="button"
31+
(click)="confirmAvailability(item.userId, item.provisionId)"
32+
class="btn-confirm"
33+
[disabled]="confirmedSlots[item.userId + '_' + item.provisionId]">
34+
Confirmer le créneau ✅
35+
</button>
3036
}
3137
}
3238

@@ -56,6 +62,11 @@ <h4>Total à régler : {{ getTotalCoefficient() }}</h4>
5662
@if (toastMessage) {
5763
<div class="toast" [ngClass]="toastType">{{ toastMessage }}</div>
5864
}
65+
@if (successMessageUpdate) {
66+
<div class="alert alert-success mt-2" role="alert">
67+
{{ successMessageUpdate }}
68+
</div>
69+
}
5970
@if (cart.length === 0) {
6071
<p>Aucun élément dans le panier</p>
6172
}

0 commit comments

Comments
 (0)