modif page account
This commit is contained in:
parent
c80b74eb7f
commit
c4d838856b
@ -13,7 +13,7 @@ import { AuthGuard } from './services/auth.guard';
|
|||||||
import { PageAccountComponent } from './pages/page-account/page-account.component';
|
import { PageAccountComponent } from './pages/page-account/page-account.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: '', redirectTo: 'signin', pathMatch: 'full' },
|
{ path: '', redirectTo: 'home', pathMatch: 'full' },
|
||||||
{path: 'signin', component: SigninComponent},
|
{path: 'signin', component: SigninComponent},
|
||||||
{path: 'signup', component: SignupComponent},
|
{path: 'signup', component: SignupComponent},
|
||||||
{ path: 'home', component: HomePageComponent },
|
{ path: 'home', component: HomePageComponent },
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header" id="panelsStayOpen-headingOne">
|
<h2 class="accordion-header" id="panelsStayOpen-headingOne">
|
||||||
<button class="accordion-button" type="button" data-bs-toggle="collapse"
|
<button class="btn shadow accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||||
data-bs-target="#panelsStayOpen-collapseOne">
|
data-bs-target="#panelsStayOpen-collapseOne">
|
||||||
<p style="font-family:'Roboto';font-size: 20px;">Distance</p>
|
<p style="font-family:'Roboto';font-size: 20px;">Distance</p>
|
||||||
</button>
|
</button>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header" id="panelsStayOpen-headingTwo">
|
<h2 class="accordion-header" id="panelsStayOpen-headingTwo">
|
||||||
<button class="accordion-button" type="button" data-bs-toggle="collapse"
|
<button class="btn shadow accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||||
data-bs-target="#panelsStayOpen-collapseTwo">
|
data-bs-target="#panelsStayOpen-collapseTwo">
|
||||||
<p style="font-family:'Roboto'; font-size: 20px;">Prix</p>
|
<p style="font-family:'Roboto'; font-size: 20px;">Prix</p>
|
||||||
</button>
|
</button>
|
||||||
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header" id="panelsStayOpen-headingThree">
|
<h2 class="accordion-header" id="panelsStayOpen-headingThree">
|
||||||
<button class="accordion-button" type="button" data-bs-toggle="collapse"
|
<button class="btn shadow accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||||
data-bs-target="#panelsStayOpen-collapseThree">
|
data-bs-target="#panelsStayOpen-collapseThree">
|
||||||
<p style="font-family:'Roboto'; font-size: 20px;">Sur Place / A Emporter</p>
|
<p style="font-family:'Roboto'; font-size: 20px;">Sur Place / A Emporter</p>
|
||||||
</button>
|
</button>
|
||||||
@ -91,7 +91,7 @@
|
|||||||
|
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header" id="panelsStayOpen-headingFour">
|
<h2 class="accordion-header" id="panelsStayOpen-headingFour">
|
||||||
<button class="accordion-button" type="button" data-bs-toggle="collapse"
|
<button class="btn shadow accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||||
data-bs-target="#panelsStayOpen-collapseFour">
|
data-bs-target="#panelsStayOpen-collapseFour">
|
||||||
<p style="font-family:'Roboto'; font-size: 20px;">Accès PMR</p>
|
<p style="font-family:'Roboto'; font-size: 20px;">Accès PMR</p>
|
||||||
</button>
|
</button>
|
||||||
|
@ -8,21 +8,18 @@
|
|||||||
|
|
||||||
|
|
||||||
.titre{
|
.titre{
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
margin: 2.5em 0 0.5em 8.2em;
|
margin: 2.5em 0 0.5em 8.2em;
|
||||||
color: #CE0000;
|
color: #CE0000;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.accordion{
|
.accordion{
|
||||||
padding-top: 100px;
|
padding-top: 100px;
|
||||||
max-width: 30%;
|
max-width: 40%;
|
||||||
margin : 0 auto;
|
margin : 0 auto;
|
||||||
margin-bottom: 100px;
|
margin-bottom: 100px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.accordion-body{
|
.accordion-body{
|
||||||
@ -56,8 +53,28 @@ filter: drop-shadow(0 0 0.2rem grey);
|
|||||||
}
|
}
|
||||||
|
|
||||||
span{
|
span{
|
||||||
|
|
||||||
font-weight: 500 ;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,9 +8,13 @@
|
|||||||
<label for="inputLastName" class="form-label">Nom</label>
|
<label for="inputLastName" class="form-label">Nom</label>
|
||||||
<input type="text" class="form-control" id="inputLastName" formControlName="lastName" readonly="readonly">
|
<input type="text" class="form-control" id="inputLastName" formControlName="lastName" readonly="readonly">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12">
|
<div class="col-md-6">
|
||||||
<label for="inputEmail" class="form-label">Email</label>
|
<label for="inputEmail" class="form-label">Email</label>
|
||||||
<input type="email" class="form-control" id="inputEmail" formControlName="email" readonly="readonly">
|
<input type="email" class="form-control" id="inputEmail" formControlName="email" readonly="readonly">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<label for="inputEmail" class="form-label">Role</label>
|
||||||
|
<input type="RoleList" class="form-control" id="inputRoleList" formControlName="RoleList" readonly="readonly">
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
@ -1,6 +1,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
|
import { RoleList } from '../models/roleList';
|
||||||
import { User } from '../models/user';
|
import { User } from '../models/user';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -30,7 +31,8 @@ export class PageAccountComponent implements OnInit {
|
|||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
firstName: [user ? user.prenom : ''],
|
firstName: [user ? user.prenom : ''],
|
||||||
lastName: [user ? user.nom : ''],
|
lastName: [user ? user.nom : ''],
|
||||||
email: [user ? user.email : '']
|
email: [user ? user.email : ''],
|
||||||
|
RoleList: [user ? user.roleList : '']
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,6 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
signup(newUser: User): Observable<any> {
|
signup(newUser: User): Observable<any> {
|
||||||
|
|
||||||
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
|
password: password
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("Mon body : ", body);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return this.http.post(`${this.apiUrl}/signin`, body).pipe(
|
return this.http.post(`${this.apiUrl}/signin`, body).pipe(
|
||||||
map((x: any) => {
|
map((x: any) => {
|
||||||
console.log(x);
|
console.log(x);
|
||||||
@ -56,9 +50,6 @@ export class AuthService {
|
|||||||
const decodedToken = jwt_decode<any>(token);
|
const decodedToken = jwt_decode<any>(token);
|
||||||
const userId = decodedToken.userId;
|
const userId = decodedToken.userId;
|
||||||
return this.http.get<User>(`${this.apiUrl}/user/${userId}`);
|
return this.http.get<User>(`${this.apiUrl}/user/${userId}`);
|
||||||
} else {
|
|
||||||
this.router.navigate(['signin']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user