From c4d838856b1b91811c8124d6c5ad5e7f03d9b54e Mon Sep 17 00:00:00 2001 From: Romain Verger Date: Mon, 7 Mar 2022 16:11:13 +0100 Subject: [PATCH] modif page account --- src/app/app-routing.module.ts | 2 +- .../filters-page/filters-page.component.html | 8 +++--- .../filters-page/filters-page.component.scss | 27 +++++++++++++++---- .../page-account/page-account.component.html | 6 ++++- .../page-account/page-account.component.ts | 4 ++- src/app/services/auth.service.ts | 11 +------- 6 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 2571469..a01b041 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -13,7 +13,7 @@ import { AuthGuard } from './services/auth.guard'; import { PageAccountComponent } from './pages/page-account/page-account.component'; const routes: Routes = [ - { path: '', redirectTo: 'signin', pathMatch: 'full' }, + { path: '', redirectTo: 'home', pathMatch: 'full' }, {path: 'signin', component: SigninComponent}, {path: 'signup', component: SignupComponent}, { path: 'home', component: HomePageComponent }, diff --git a/src/app/pages/filters-page/filters-page.component.html b/src/app/pages/filters-page/filters-page.component.html index 00fb9ba..b07ef48 100644 --- a/src/app/pages/filters-page/filters-page.component.html +++ b/src/app/pages/filters-page/filters-page.component.html @@ -8,7 +8,7 @@

- @@ -36,7 +36,7 @@

- @@ -64,7 +64,7 @@

- @@ -91,7 +91,7 @@

- diff --git a/src/app/pages/filters-page/filters-page.component.scss b/src/app/pages/filters-page/filters-page.component.scss index 75a8bba..acb529b 100644 --- a/src/app/pages/filters-page/filters-page.component.scss +++ b/src/app/pages/filters-page/filters-page.component.scss @@ -8,21 +8,18 @@ .titre{ - display: flex; justify-content: flex-start; margin: 2.5em 0 0.5em 8.2em; color: #CE0000; - } .accordion{ padding-top: 100px; -max-width: 30%; +max-width: 40%; margin : 0 auto; margin-bottom: 100px; - } .accordion-body{ @@ -56,8 +53,28 @@ filter: drop-shadow(0 0 0.2rem grey); } span{ - font-weight: 500 ; } +.accordion-button.collapsed { + background: #CE0000; +} + +.accordion-button.collapsed::after { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e"); +} + +@media only screen and (max-width:768px) { + +span{ + font-size: 2vh; +} + +p{ + font-size: 2vh; +} + +} + + diff --git a/src/app/pages/page-account/page-account.component.html b/src/app/pages/page-account/page-account.component.html index 52fc6ea..0e13e4c 100644 --- a/src/app/pages/page-account/page-account.component.html +++ b/src/app/pages/page-account/page-account.component.html @@ -8,9 +8,13 @@

-
+
+
+ + +
\ No newline at end of file diff --git a/src/app/pages/page-account/page-account.component.ts b/src/app/pages/page-account/page-account.component.ts index 41068c2..e129fde 100644 --- a/src/app/pages/page-account/page-account.component.ts +++ b/src/app/pages/page-account/page-account.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; import { AuthService } from 'src/app/services/auth.service'; +import { RoleList } from '../models/roleList'; import { User } from '../models/user'; @Component({ @@ -30,7 +31,8 @@ export class PageAccountComponent implements OnInit { return this.fb.group({ firstName: [user ? user.prenom : ''], lastName: [user ? user.nom : ''], - email: [user ? user.email : ''] + email: [user ? user.email : ''], + RoleList: [user ? user.roleList : ''] }) } } diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 9cf8b88..d77b3ec 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -22,9 +22,7 @@ export class AuthService { } signup(newUser: User): Observable { - - console.log("Mon nouvel utilisateur : ", newUser); - return this.http.post(`${this.apiUrl}/signup`, newUser); + return this.http.post(`${this.apiUrl}/signup`, newUser); } @@ -34,10 +32,6 @@ export class AuthService { password: password }; - console.log("Mon body : ", body); - - - return this.http.post(`${this.apiUrl}/signin`, body).pipe( map((x: any) => { console.log(x); @@ -56,9 +50,6 @@ export class AuthService { const decodedToken = jwt_decode(token); const userId = decodedToken.userId; return this.http.get(`${this.apiUrl}/user/${userId}`); - } else { - this.router.navigate(['signin']); } } - }