diff --git a/src/app/admin-component/add-restau/add-restau.component.ts b/src/app/admin-component/add-restau/add-restau.component.ts index a28523e..3bb1d9a 100644 --- a/src/app/admin-component/add-restau/add-restau.component.ts +++ b/src/app/admin-component/add-restau/add-restau.component.ts @@ -114,7 +114,6 @@ export class AddRestauComponent implements OnInit { restaurant.adresse !== '') { this.apiBackService.addRestaurant(restaurant).subscribe( resp => - this.router.navigate(['restaurants']) ); } else { diff --git a/src/app/admin-component/update-del-restau/update-del-restau.component.ts b/src/app/admin-component/update-del-restau/update-del-restau.component.ts index 721618f..c59fe5b 100644 --- a/src/app/admin-component/update-del-restau/update-del-restau.component.ts +++ b/src/app/admin-component/update-del-restau/update-del-restau.component.ts @@ -15,9 +15,7 @@ export class UpdateDelRestauComponent implements OnInit { this.restauList = []; } - ngOnInit(): void { - - } + ngOnInit(): void {} saveRestauList(event : any){ @@ -28,10 +26,7 @@ export class UpdateDelRestauComponent implements OnInit { deleteRestau(idRestau : number | undefined){ this.apiBackService.deleteRestau(idRestau).subscribe( resp =>{ - - this.restauList = this.restauList.filter(restaus => restaus.id != idRestau) - }); } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index fe37095..332450b 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -7,16 +7,20 @@ import { RestoPageComponent } from './pages/resto-page/resto-page.component'; import { PageNotFoundComponent } from './pages/page-not-found/page-not-found.component'; import { FiltersPageComponent } from './pages/filters-page/filters-page.component'; import { SigninComponent } from './pages/signin/signin.component'; +import { SignupComponent } from './pages/signup/signup.component'; import { AdminPageComponent } from './pages/admin-page/admin-page.component'; 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 }, { path: 'categories', component: ListCategoriesComponent }, { path: 'favoris', component: FavorisUserComponent }, { path: 'filtres', component: FiltersPageComponent }, + { path: 'profil', component: PageAccountComponent }, { path: 'Deconnexion', redirectTo: 'home'}, {path: 'restaurants', canActivate: [AuthGuard], /*data : {ROLE : "ROLE_ADMIN"},*/ component: RestoPageComponent}, {path: 'page-not-found',component: PageNotFoundComponent}, diff --git a/src/app/app.component.ts b/src/app/app.component.ts index be5ed0d..18917ec 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,6 +1,7 @@ import { Component } from '@angular/core'; import { NavigationEnd, Router } from '@angular/router'; import { ApiBackService } from './services/api-back.service'; +import { AuthGuard } from './services/auth.guard'; @Component({ selector: 'app-root', @@ -11,7 +12,7 @@ export class AppComponent { title = 'simpleat'; dontShow: boolean = false; - constructor(public router:Router, private apiBackService : ApiBackService){ + constructor(public router:Router, private apiBackService : ApiBackService, private authgard : AuthGuard){ this.router.events.subscribe(e=>{ //console.log(e); if(e instanceof NavigationEnd){ @@ -26,6 +27,7 @@ export class AppComponent { } - ngOnInit(): void { } + ngOnInit(): void {} + } + -} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6d701ea..de864a8 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -24,6 +24,8 @@ import { UpdateDelRestauComponent } from './admin-component/update-del-restau/up import { HeaderLogoComponent } from './header/components/header-logo/header-logo.component'; import { AuthInterceptor } from './services/auth.interceptor'; import { FavorisUserComponent } from './pages/favoris-user/favoris-user.component'; +import { SignupComponent } from './pages/signup/signup.component'; +import { PageAccountComponent } from './pages/page-account/page-account.component'; @NgModule({ declarations: [ @@ -46,7 +48,9 @@ import { FavorisUserComponent } from './pages/favoris-user/favoris-user.componen AddRestauComponent, UpdateDelRestauComponent, HeaderLogoComponent, - FavorisUserComponent + FavorisUserComponent, + SignupComponent, + PageAccountComponent ], imports: [ BrowserModule, diff --git a/src/app/header/components/header-logo/header-logo.component.html b/src/app/header/components/header-logo/header-logo.component.html index 8cc88e8..af4e171 100644 --- a/src/app/header/components/header-logo/header-logo.component.html +++ b/src/app/header/components/header-logo/header-logo.component.html @@ -10,4 +10,5 @@

LE BON PLAN POUR MANGER

+ \ No newline at end of file diff --git a/src/app/header/components/header-logo/header-logo.component.scss b/src/app/header/components/header-logo/header-logo.component.scss index 1202554..7d00233 100644 --- a/src/app/header/components/header-logo/header-logo.component.scss +++ b/src/app/header/components/header-logo/header-logo.component.scss @@ -10,6 +10,7 @@ } + .trait{ width: 100%; @@ -26,4 +27,12 @@ p{ left: 68px; padding : 0 10px 0 10px; color: grey; +} + +@media only screen and (max-width:753px) { + +.trait{ + display: none; +} + } \ No newline at end of file diff --git a/src/app/header/components/nav-bar/nav-bar.component.html b/src/app/header/components/nav-bar/nav-bar.component.html index 698a52b..6a99db4 100644 --- a/src/app/header/components/nav-bar/nav-bar.component.html +++ b/src/app/header/components/nav-bar/nav-bar.component.html @@ -9,13 +9,14 @@ aria-label="Toggle navigation"> - \ No newline at end of file + + diff --git a/src/app/pages/admin-page/admin-page.component.scss b/src/app/pages/admin-page/admin-page.component.scss index 8e1cebc..e69de29 100644 --- a/src/app/pages/admin-page/admin-page.component.scss +++ b/src/app/pages/admin-page/admin-page.component.scss @@ -1,3 +0,0 @@ -.search-bar{ - width : 30%; -} \ No newline at end of file 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/home-page/home-page.component.html b/src/app/pages/home-page/home-page.component.html index aadcb86..f569c29 100644 --- a/src/app/pages/home-page/home-page.component.html +++ b/src/app/pages/home-page/home-page.component.html @@ -1 +1,50 @@ -

Hello {{userName}} !

+
+

Hello {{userName}} !

+ +
+ Bienvenue sur Simpl'eat, l'application indispensable pour un Simplonien comme toi ! +
+ +
+ +
+ Photo d'un magnifique repas miam ! + +

Cette application à été conçue dans le but de te permettre de visualiser les différents restaurants aux alentours de l’école SIMPLON située à MONTREUIL. + Tu pourras choisir choisir selon tes préférences un restaurant en particulier qui convient selon ton envie du jour. + Une boulangerie, un kebab, une pizzeria ou simplement un magnifique sandwich triangle dans ton cente commercial préféré ! + C'est pas magnifique ça ?

+
+
+
+
+
+

L'idée de cette application vient du fait qu'en tant que provincial, d'arriver dans une nouvelle ville, d'être presque perdu dans un environnement + qui nous ait inconnu, de ne pas savoir si il y a le meilleur kebab du coin dans les environs ? + Toutes ces pensées nous envahissent et nous ont amener à concevoir ceci pour vous !

+ Photo d'un magnifique repas miam ! +
+ +
+ +
+ Photo d'un magnifique repas miam ! + +
    +

    Sur cette application, plusieurs fonctionnalités s'offre à toi :

    +
  • Acceder aux différents restaurants répertoriés sur l'application !
  • +
  • Choisir la catégorie de restaurants qui donne le plus envie !
  • +
  • Sélectionner et préserver en favoris les restaurants dont tu veux garder l'adresse !
  • +
+
+ +
+ A toi de jouer ! +
+
+ + + + + + diff --git a/src/app/pages/home-page/home-page.component.scss b/src/app/pages/home-page/home-page.component.scss index bbc89ce..73491e8 100644 --- a/src/app/pages/home-page/home-page.component.scss +++ b/src/app/pages/home-page/home-page.component.scss @@ -1,7 +1,165 @@ -#demotext { - color: #FFFFFF; - background: #912C22; - text-shadow: 0 0 10px #FFFFFF; - color: #FFFFFF; - background: #912C22; - } \ No newline at end of file +.body{ + width: 100%; + padding: 8vh 20vh; +} + +h1{ + font-size: 4vh; + padding-top: 3vh; +} + +.preface{ + text-align: center; + padding-bottom: 3vh; +} + +.premier_bloc{ + display: flex; + align-items: center; + +} + +.deuxieme_bloc{ + display: flex; + align-items: center; + +} + +.troisieme_bloc{ + display: flex; + align-items: center; +} + +img{ + + + margin: 5vh 0 0 0; + border-radius: 10px; + width: 100%; + max-width: 500px; + height: auto; + + +} + +.uno{ + padding-top: 6vh; + padding-left: 6vh; + text-align: justify; +} + +.dos{ + padding-top: 6vh; + padding-right: 6vh; + text-align: justify; +} + +.tres{ + padding-top: 6vh; + font-size: 3.5vh; +} + + + +.separation{ + display: flex; + justify-content: flex-start; + border-bottom: 2px solid #CE0000; + max-width: 83%; + padding : 20px; +} + +.ligne-rouge{ + display: flex; + justify-content: flex-end; + +} + +.separation2{ + + border-bottom: 2px solid #CE0000; + max-width: 83%; + width: 100%; + padding : 20px; + +} + +@media only screen and (max-width:1131px) { + + .body{ + display: flex; + justify-content: center; + margin: -1vh auto; + padding: 3vh; + flex-wrap: wrap; + } + + img{ + width: 100%; + max-width: 500px; + height: auto; + padding-bottom: 5vh; + border-radius: 10px; + display: flex; + justify-content: center; + } + + .premier_bloc{ + flex-wrap: wrap; + } + + .deuxieme_bloc{ + flex-wrap: wrap; + flex-direction: column-reverse; + } + + .troisieme_bloc{ + flex-wrap: wrap; + } + + .uno{ + padding-top: 0; + padding-left: 0; + padding-bottom: 2.5vh; + text-align: justify; + + } + + .dos{ + padding-top: 0; + padding-right: 0; + padding-bottom: 2.5vh; + text-align: justify; + } + + .tres{ + padding-top: 0; + font-size: 3.5vh; + } + + .separation{ + display: flex; + justify-content: center; + border-bottom: 1px solid #CE0000; + width: 100%; + padding: 0; + + } + + .ligne-rouge{ + display: flex; + justify-content: center; + width: 100%; + } + + .separation2{ + padding: 0; + border-bottom: 1px solid #CE0000; + max-width: 83%; + } + + + + + +} \ No newline at end of file diff --git a/src/app/pages/home-page/home-page.component.ts b/src/app/pages/home-page/home-page.component.ts index 3cbf7bd..f7fd30b 100644 --- a/src/app/pages/home-page/home-page.component.ts +++ b/src/app/pages/home-page/home-page.component.ts @@ -11,19 +11,13 @@ export class HomePageComponent implements OnInit { public userName : any; - constructor(private apiBackService : ApiBackService, private tokenService : TokenService) { - - } + constructor(private apiBackService : ApiBackService, private tokenService : TokenService) {} ngOnInit(): void { this.apiBackService.getPersonneById(this.tokenService.getCurrentUserId()).subscribe( user =>{ - this.userName = user.prenom; - - - }) } diff --git a/src/app/pages/models/roleList.ts b/src/app/pages/models/roleList.ts new file mode 100644 index 0000000..4103504 --- /dev/null +++ b/src/app/pages/models/roleList.ts @@ -0,0 +1,5 @@ +export enum RoleList { + ROLE_ADMIN = 'ROLE_ADMIN', + ROLE_CREATOR = 'ROLE_CREATOR', + ROLE_READER = 'ROLE_READER' +} \ No newline at end of file diff --git a/src/app/pages/models/user.ts b/src/app/pages/models/user.ts index 340925f..2eba1ca 100644 --- a/src/app/pages/models/user.ts +++ b/src/app/pages/models/user.ts @@ -5,4 +5,5 @@ export interface User { email: string; password?: string; preference ?: object; + roleList ?: string[]; } diff --git a/src/app/pages/page-account/page-account.component.html b/src/app/pages/page-account/page-account.component.html new file mode 100644 index 0000000..0e13e4c --- /dev/null +++ b/src/app/pages/page-account/page-account.component.html @@ -0,0 +1,20 @@ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/src/app/pages/page-account/page-account.component.scss b/src/app/pages/page-account/page-account.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/page-account/page-account.component.spec.ts b/src/app/pages/page-account/page-account.component.spec.ts new file mode 100644 index 0000000..8bbe80f --- /dev/null +++ b/src/app/pages/page-account/page-account.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PageAccountComponent } from './page-account.component'; + +describe('PageAccountComponent', () => { + let component: PageAccountComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PageAccountComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PageAccountComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/page-account/page-account.component.ts b/src/app/pages/page-account/page-account.component.ts new file mode 100644 index 0000000..e129fde --- /dev/null +++ b/src/app/pages/page-account/page-account.component.ts @@ -0,0 +1,38 @@ +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({ + selector: 'app-page-account', + templateUrl: './page-account.component.html', + styleUrls: ['./page-account.component.scss'] +}) +export class PageAccountComponent implements OnInit { + + public userInfo: FormGroup; + + constructor(private fb: FormBuilder, private authService: AuthService) { + this.userInfo = this.initForm(); + + this.authService.getConnectedUserInfo()?.subscribe( + (user: User) => { + this.userInfo = this.initForm(user); + } + ) + + } + + ngOnInit(): void { + } + + private initForm(user?: User): FormGroup { + return this.fb.group({ + firstName: [user ? user.prenom : ''], + lastName: [user ? user.nom : ''], + email: [user ? user.email : ''], + RoleList: [user ? user.roleList : ''] + }) + } +} diff --git a/src/app/pages/signin/signin.component.html b/src/app/pages/signin/signin.component.html index 0a30940..4513aa9 100644 --- a/src/app/pages/signin/signin.component.html +++ b/src/app/pages/signin/signin.component.html @@ -1,7 +1,6 @@