Skip to content
Snippets Groups Projects
Commit b5cd6467 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #14235 TIME 1 fix build prod

parent d6c73b79
No related branches found
No related tags found
No related merge requests found
...@@ -16,23 +16,23 @@ import { SortPipe } from '../plugins/sorting.pipe'; ...@@ -16,23 +16,23 @@ import { SortPipe } from '../plugins/sorting.pipe';
NgStringPipesModule NgStringPipesModule
], ],
declarations: [ declarations: [
TimeAgoPipe,
TimeLimitPipe,
FilterListPipe, FilterListPipe,
FullDatePipe, FullDatePipe,
SafeHtmlPipe, SafeHtmlPipe,
SecureUrlPipe, SecureUrlPipe,
SortPipe SortPipe,
TimeAgoPipe,
TimeLimitPipe,
], ],
exports: [ exports: [
NgStringPipesModule, NgStringPipesModule,
TimeAgoPipe,
TimeLimitPipe,
FilterListPipe, FilterListPipe,
FullDatePipe, FullDatePipe,
SafeHtmlPipe, SafeHtmlPipe,
SecureUrlPipe, SecureUrlPipe,
SortPipe, SortPipe,
TimeAgoPipe,
TimeLimitPipe,
], ],
entryComponents: [ entryComponents: [
], ],
......
import { Component, ViewChild, OnInit } from '@angular/core'; import { Component, ViewChild, OnInit, HostListener, AfterViewInit } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
import { MatIconRegistry } from '@angular/material/icon'; import { MatIconRegistry } from '@angular/material/icon';
import { MAT_TOOLTIP_DEFAULT_OPTIONS, MatTooltipDefaultOptions } from '@angular/material/tooltip'; import { MAT_TOOLTIP_DEFAULT_OPTIONS, MatTooltipDefaultOptions } from '@angular/material/tooltip';
...@@ -26,10 +26,14 @@ export const myCustomTooltipDefaults: MatTooltipDefaultOptions = { ...@@ -26,10 +26,14 @@ export const myCustomTooltipDefaults: MatTooltipDefaultOptions = {
{ provide: MAT_TOOLTIP_DEFAULT_OPTIONS, useValue: myCustomTooltipDefaults } { provide: MAT_TOOLTIP_DEFAULT_OPTIONS, useValue: myCustomTooltipDefaults }
], ],
}) })
export class AppComponent implements OnInit { export class AppComponent implements OnInit, AfterViewInit {
debugMode: boolean = false; debugMode: boolean = false;
@ViewChild('snavLeft', { static: true }) snavLeft: MatSidenav; @ViewChild('snavLeft', { static: true }) snavLeft: MatSidenav;
@HostListener('window:resize', ['$event'])
onResize() {
this.appService.setScreenWidth(window.innerWidth);
}
constructor( constructor(
public http: HttpClient, public http: HttpClient,
public langService: LangService, public langService: LangService,
...@@ -54,4 +58,8 @@ export class AppComponent implements OnInit { ...@@ -54,4 +58,8 @@ export class AppComponent implements OnInit {
this.headerService.hideSideBar = true; this.headerService.hideSideBar = true;
this.headerService.sideNavLeft = this.snavLeft; this.headerService.sideNavLeft = this.snavLeft;
} }
ngAfterViewInit(): void {
this.appService.setScreenWidth(window.innerWidth);
}
} }
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<div class="col-md-6"> <div class="col-md-6">
<div>{{lang.chooseLogo}} : </div> <div>{{lang.chooseLogo}} : </div>
<div> <div>
<mat-card style="width: 350px;background-size: 100%;cursor: pointer;" [matRipple]="!stepFormGroup.controls['uploadedLogo'].disabled"> <mat-card style="width: 350px;background-size: 100%;cursor: pointer;" matRipple>
<img [src]="logoURL()" (click)="clickLogoButton(uploadLogo)" style="width: 100%;" /> <img [src]="logoURL()" (click)="clickLogoButton(uploadLogo)" style="width: 100%;" />
<input type="file" name="files[]" #uploadLogo (change)="uploadTrigger($event, 'logo')" <input type="file" name="files[]" #uploadLogo (change)="uploadTrigger($event, 'logo')"
accept="image/svg+xml" style="display: none;"> accept="image/svg+xml" style="display: none;">
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<div color="primary" [title]="element.creationDate | fullDate" <div color="primary" [title]="element.creationDate | fullDate"
style="flex:1;justify-content: flex-end;display: flex;font-size: 80%;"> style="flex:1;justify-content: flex-end;display: flex;font-size: 80%;">
{{element.creationDate}} {{element.creationDate | timeAgo : 'full'}} {{element.creationDate}} {{element.creationDate | date : "dd/MM/y HH:mm"}}
</div> </div>
</div> </div>
</mat-list-option> </mat-list-option>
......
...@@ -185,6 +185,7 @@ export class AppGuard implements CanActivate { ...@@ -185,6 +185,7 @@ export class AppGuard implements CanActivate {
if (err.error.errors === 'User must change his password') { if (err.error.errors === 'User must change his password') {
return this.router.navigate(['/password-modification']); return this.router.navigate(['/password-modification']);
} else { } else {
this.authService.logout();
return of(false); return of(false);
} }
}) })
......
...@@ -5,27 +5,19 @@ import { Injectable } from '@angular/core'; ...@@ -5,27 +5,19 @@ import { Injectable } from '@angular/core';
}) })
export class AppService { export class AppService {
private _mobileQueryListener: () => void; screenWidth: number = 0;
mobileQuery: MediaQueryList;
currentUser: any; constructor() { }
constructor() {
/*this.mobileQuery = media.matchMedia('(max-width: 768px)');
this._mobileQueryListener = () => changeDetectorRef.detectChanges();
this.mobileQuery.addListener(this._mobileQueryListener);*/
}
getViewMode() { getViewMode() {
return false;
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
return true; return true;
} else { } else {
return this.mobileQuery.matches; return this.screenWidth <= 768;
} }
} }
/*ngOnDestroy(): void { setScreenWidth(width: number) {
this.mobileQuery.removeListener(this._mobileQueryListener); this.screenWidth = width;
}*/ }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment