diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6f992a7337d57f46b9f2d345f280099e96471490..89ece5601bdafe96a93b52dfe8fcf06770268dcc 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -48,6 +48,7 @@ import { AdminGuard } from './guards/admin.guard'; UserVerificationComponent, ResetEmailComponent, ResetPasswordComponent, + FormComponent, ], imports: [BrowserModule, HttpClientModule, AppRoutingModule, SharedModule, MapModule, ProfileModule, AdminModule], providers: [ diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index 3c34647cc7778bd7950c5dc19d9f346c976d93d5..1d5973c3cab0ab59404f9d185711d9f644b369fa 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -244,7 +244,19 @@ ></app-create-account-form> </div> <div class="form" fxLayout="column"> - <app-menu-phone (closeEvent)="closeMenu($event)"></app-menu-phone> + <div *ngIf="showModalExit" class="modalExitContainer"> + <div class="modal"> + <div class="contentModal" fxLayout="column" fxLayoutAlign="space-around center"> + <h3>ATTENTION</h3> + <p>Il vous faudra de nouveau remplir le formulaire si vous quittez</p> + <div class="footerModal" fxLayout="row" fxLayoutAlign="space-around center"> + <button class="btn leave" (click)="leaveForm(showModalExit)" >Quitter</button> + <button class="btn" (click)="leaveForm(null)">Annuler</button> + </div> + </div> + </div> + </div> + <app-menu-phone *ngIf="showMenu" (closeEvent)="closeMenu($event)"></app-menu-phone> <div class="header"> <div class="container-icoMenu"> <div class="block-iconMenu" (click)="toggleMenu()"> diff --git a/src/app/form/form.component.scss b/src/app/form/form.component.scss index cf9235f321dc5df61a7245773b1f410cc5fc65c5..cce0fa17eb69dea77c08c7357dbeb3bffeb4eb0c 100644 --- a/src/app/form/form.component.scss +++ b/src/app/form/form.component.scss @@ -2,6 +2,8 @@ @import '../../assets/scss/breakpoint'; @import '../../assets/scss/color'; @import '../../assets/scss/typography'; +@import '../../assets/scss/shapes'; +@import '../../assets/scss/z-index'; $progressBar-height: 50px; @@ -11,7 +13,7 @@ $progressBar-height: 50px; width: 100vw; height: calc(100vh - #{$header-height} - #{$footer-height}); top: #{$header-height}; - z-index: 9999; + z-index: $structure-details-z-index; overflow: auto; @media #{$tablet} { height: calc(100vh); @@ -436,3 +438,49 @@ img { width: 100%; margin-right: 12px; } + +.modalExitContainer { + width: 100%; + height: 100%; + z-index: $modal-confirmation-z-index; + position: absolute; + content: ''; + top: 0; + background: rgba(0, 0, 0, 0.65); + .modal { + .contentModal { + width: 100%; + background: rgba(255, 255, 255, 1); + padding: 35px 20px 18px 20px; + h3 { + @include cn-bold-18; + color: $orange-warning; + } + p { + @include cn-bold-16; + color: $grey-1; + text-align: center; + } + .footerModal { + width: 100%; + margin-top: 14px; + @include cn-bold-16; + .btn { + width: 149px; + &.leave { + background: none; + color: $grey-1; + text-decoration: underline; + } + } + } + } + width: 350px; + margin: auto; + border-radius: 6px; + @include background-hash; + border: 1px solid $grey-4; + margin-top: 50vh; + transform: translateY(-50%); + } +} diff --git a/src/app/form/form.component.ts b/src/app/form/form.component.ts index 53f6c250dc082c64d282825def95fd1219b8436a..f96d848120878363eba77a37c5ef2498845701bb 100644 --- a/src/app/form/form.component.ts +++ b/src/app/form/form.component.ts @@ -18,6 +18,7 @@ import { Address } from '../models/address.model'; import { Week } from '../models/week.model'; import { Module } from '../structure-list/models/module.model'; import { Equipment } from '../structure-list/enum/equipment.enum'; +import { Router } from '@angular/router'; @Component({ selector: 'app-structureForm', @@ -59,7 +60,7 @@ export class FormComponent implements OnInit { public userAcceptSavedDate = false; public showMenu = false; - + public showModalExit: string = null; //collapse var public showWebsite: boolean; public showSocialNetwork: boolean; @@ -69,7 +70,8 @@ export class FormComponent implements OnInit { constructor( private structureService: StructureService, private searchService: SearchService, - private profileService: ProfileService + private profileService: ProfileService, + private router: Router ) {} ngOnInit(): void { @@ -534,7 +536,20 @@ export class FormComponent implements OnInit { this.showMenu = !this.showMenu; console.log(this.showMenu); } - public closeMenu(e): void { - console.log(e); + + public leaveForm(route: string): void { + if (route) { + this.router.navigateByUrl(route); + } else { + this.showModalExit = null; + } + } + + public closeMenu(route: string): void { + if (route) { + this.showModalExit = route; + } else { + this.showMenu = false; + } } } diff --git a/src/app/header/header.component.ts b/src/app/header/header.component.ts index 22e7fc8425684cae0f8520911dcf973dd8b12af8..e04f35036b60a1141bdae129ea6381f3667a5ab4 100644 --- a/src/app/header/header.component.ts +++ b/src/app/header/header.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; import { ProfileService } from '../profile/services/profile.service'; import { AuthService } from '../services/auth.service'; @@ -12,13 +13,14 @@ export class HeaderComponent implements OnInit { public isPopUpOpen = false; public displaySignUp = true; - constructor(private authService: AuthService, private profileService: ProfileService) {} + constructor(private authService: AuthService, private profileService: ProfileService, private router: Router) {} ngOnInit(): void {} public openMenu(): void { this.showMenu = true; } - public closeMenu(): void { + public closeMenu(route: string): void { + this.router.navigateByUrl(route); this.showMenu = false; } diff --git a/src/app/menu-phone/menu-phone.component.html b/src/app/menu-phone/menu-phone.component.html index 3551f848ef9539f082f94ec03de1efd0f8ff54d3..72aaf670c796de64c07280f6d32e8d772b115de1 100644 --- a/src/app/menu-phone/menu-phone.component.html +++ b/src/app/menu-phone/menu-phone.component.html @@ -1,16 +1,16 @@ <div class="containerMenu" fxLayout="row"> - <div class="outside" (click)="closeMenu()"></div> + <div class="outside" (click)="closeMenu(null)"></div> <div class="contentMenu" fxLayout="column" fxLayoutAlign="space-between"> <div> <div class="titleFilter" fxLayout="row" fxLayoutAlign="space-between"> <span>Menu</span> - <div (click)="closeMenu()" class="ico-close-details"></div> + <div (click)="closeMenu(null)" class="ico-close-details"></div> </div> <div fxLayout="column" class="right-header" fxLayoutGap="3vw"> - <a routerLink="/home" [routerLinkActive]="'active'" (click)="closeMenu()" i18n>Les acteurs</a> + <a (click)="closeMenu('home')" i18n>Les acteurs</a> <!-- <a routerLink="/resources" [routerLinkActive]="'active'" i18n>Ressources</a> <a routerLink="/projects" [routerLinkActive]="'active'" i18n>Projets</a> --> - <a routerLink="/about" [routerLinkActive]="'active'" (click)="closeMenu()" i18n>Qui sommes-nous ?</a> + <a (click)="closeMenu('about')" i18n>Qui sommes-nous ?</a> <a *ngIf="isAdmin" routerLink="/admin" [routerLinkActive]="'active'">Administration</a> <!--<a routerLink="/login" [routerLinkActive]="'active'" i18n><span class="clickable ico-mglass purple"></span></a> diff --git a/src/app/menu-phone/menu-phone.component.ts b/src/app/menu-phone/menu-phone.component.ts index a0276b4c6984e8cce0b25884e72bf4fbdcc281f3..ecb50fa07fb3c472376e0370f4ce3aab193fa57f 100644 --- a/src/app/menu-phone/menu-phone.component.ts +++ b/src/app/menu-phone/menu-phone.component.ts @@ -10,11 +10,11 @@ import { AuthService } from '../services/auth.service'; export class MenuPhoneComponent implements OnInit { constructor(private authService: AuthService, private profileService: ProfileService) {} - @Output() closeEvent = new EventEmitter(); + @Output() closeEvent = new EventEmitter<string>(); ngOnInit(): void {} - closeMenu(): void { - this.closeEvent.emit(); + closeMenu(route: string): void { + this.closeEvent.emit(route); } public get isLoggedIn(): boolean { diff --git a/src/app/profile/profile.module.ts b/src/app/profile/profile.module.ts index 1f86c78ac628b6b082a4fcc81f6eead59e0b8e92..a9427003f2507d4092e966617363aa223996b4f5 100644 --- a/src/app/profile/profile.module.ts +++ b/src/app/profile/profile.module.ts @@ -3,11 +3,10 @@ import { ProfileComponent } from './profile.component'; import { SharedModule } from '../shared/shared.module'; import { CommonModule } from '@angular/common'; import { BrowserModule } from '@angular/platform-browser'; -import { FormComponent } from '../form/form.component'; @NgModule({ imports: [CommonModule, BrowserModule, SharedModule], - declarations: [ProfileComponent, FormComponent], - exports: [ProfileComponent, FormComponent], + declarations: [ProfileComponent], + exports: [ProfileComponent], }) export class ProfileModule {} diff --git a/src/assets/scss/_typography.scss b/src/assets/scss/_typography.scss index 5efdf238c7e84312d140a43d9042cefef29bdd22..8d7f4162c860d3b70d8f2350b53553b2f756c061 100644 --- a/src/assets/scss/_typography.scss +++ b/src/assets/scss/_typography.scss @@ -9,7 +9,7 @@ $font-size-medium: 1.375em; // 22px $font-size-xmedium: 1.5em; // 24px $font-size-large: 1.75em; // 28px $font-size-xlarge: 2em; // 32px -$font-size-medium-mobile: 1em; +$font-size-medium-mobile: 1.1em; html, body, diff --git a/src/assets/scss/_z-index.scss b/src/assets/scss/_z-index.scss index 1f6dbcd22289984b44529458df1b94e40d7cfb2d..d9bdd90208bbc2cf0665aeeaf540ea230c4cabae 100644 --- a/src/assets/scss/_z-index.scss +++ b/src/assets/scss/_z-index.scss @@ -3,3 +3,4 @@ $modal-add-structure-z-index: 1002; $modal-filter-structure-z-index: 1002; $modal-menu-phone-z-index: 1002; $btn-phone-switch-map-list-z-index: 1001; +$modal-confirmation-z-index: 1003;