From 5d0bd5b25a09ca950494da43823afd393a0f6197 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Thu, 4 Feb 2021 17:40:23 +0100 Subject: [PATCH] fix(form): clean code --- src/app/form/form.component.scss | 2 +- src/app/guards/deactivate.guard.ts | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/app/form/form.component.scss b/src/app/form/form.component.scss index 470827eff..0f9ef4733 100644 --- a/src/app/form/form.component.scss +++ b/src/app/form/form.component.scss @@ -17,7 +17,7 @@ h3 { z-index: $structure-details-z-index; @media #{$tablet} { position: fixed; //Hide default header app. - height: calc(100vh); + height: 100vh; top: 0; } } diff --git a/src/app/guards/deactivate.guard.ts b/src/app/guards/deactivate.guard.ts index d8a74fa6c..3f86e0502 100644 --- a/src/app/guards/deactivate.guard.ts +++ b/src/app/guards/deactivate.guard.ts @@ -1,6 +1,6 @@ -import { ActivatedRouteSnapshot, CanDeactivate, RouterStateSnapshot } from '@angular/router'; +import { CanDeactivate } from '@angular/router'; import { Injectable } from '@angular/core'; -import { Observable, Subject } from 'rxjs'; +import { Observable } from 'rxjs'; export interface IDeactivateComponent { canExit: () => Observable<boolean> | Promise<boolean> | boolean; @@ -12,16 +12,10 @@ export interface IDeactivateComponent { @Injectable() export class DeactivateGuard implements CanDeactivate<Object> { component: Object; - route: ActivatedRouteSnapshot; constructor() {} - canDeactivate( - component: IDeactivateComponent, - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot, - nextState: RouterStateSnapshot - ): Observable<boolean> | Promise<boolean> | boolean { + canDeactivate(component: IDeactivateComponent): Observable<boolean> | Promise<boolean> | boolean { return component.canExit(); } } -- GitLab