revert 2
This commit is contained in:
@@ -16,6 +16,7 @@ export class AppComponent {
|
||||
private readonly _swUpdate: SwUpdate,
|
||||
private _notifications: NotificationsService
|
||||
) {
|
||||
console.log('AppComponent');
|
||||
this.subscribeUpdates();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import moment, { Moment } from 'moment';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { User } from '../models/user.model';
|
||||
import { BehaviorSubject, from, Observable } from 'rxjs';
|
||||
import jwt_decode from "jwt-decode";
|
||||
import {jwtDecode} from "jwt-decode";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -27,6 +27,9 @@ export class AuthService {
|
||||
this.askForAuthData();
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
console.log('Check if loaded', window.onGoogleLibraryLoad);
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
window.onGoogleLibraryLoad = () => {
|
||||
this.isGoogleLibLoaded.next(true);
|
||||
};
|
||||
@@ -47,8 +50,8 @@ export class AuthService {
|
||||
});
|
||||
}
|
||||
retrieveUserFromCredentials(credentials: string) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const responsePayload: any = jwt_decode(credentials);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const responsePayload: any = jwtDecode(credentials);
|
||||
this.user = new User({
|
||||
userName: `${responsePayload.given_name} ${responsePayload.family_name}`,
|
||||
email: responsePayload.email,
|
||||
@@ -78,6 +81,7 @@ export class AuthService {
|
||||
return from(this.getAPIToken());
|
||||
}
|
||||
isAuthenticated(): boolean {
|
||||
console.log('IsAuthenticated');
|
||||
return !!this.apiToken &&
|
||||
!!this.webCredentials &&
|
||||
!!this.user &&
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
HttpRequest,
|
||||
HttpHandler,
|
||||
HttpEvent,
|
||||
HttpInterceptor
|
||||
} from '@angular/common/http';
|
||||
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
|
||||
import { AuthService } from '../auth/auth.service';
|
||||
import { EMPTY, Observable } from 'rxjs';
|
||||
import moment from 'moment';
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
HttpRequest,
|
||||
HttpHandler,
|
||||
HttpEvent,
|
||||
HttpInterceptor
|
||||
} from '@angular/common/http';
|
||||
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
|
||||
import { finalize, Observable } from 'rxjs';
|
||||
import { DataService } from '../services/data.service';
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { Moment } from 'moment';
|
||||
|
||||
import { Deserializable } from './deserializable.model';
|
||||
import { Serializable } from './serializable.model';
|
||||
import * as moment from 'moment';
|
||||
|
||||
import { User } from './user.model';
|
||||
import moment, {Moment} from "moment";
|
||||
|
||||
export class Base implements Deserializable, Serializable {
|
||||
id?: string;
|
||||
@@ -17,7 +16,7 @@ export class Base implements Deserializable, Serializable {
|
||||
constructor(data: Partial<Base> = {}) {
|
||||
Object.assign(this, data);
|
||||
}
|
||||
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
deserialize(input: any): this {
|
||||
if (input.createdAt) { input.createdAt = moment(input.createdAt).utc(true); }
|
||||
@@ -27,9 +26,9 @@ export class Base implements Deserializable, Serializable {
|
||||
Object.assign(this, input);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
serialize() : any {
|
||||
return Object.assign({}, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,9 @@ export class LoginViewComponent implements OnInit {
|
||||
loading = false;
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log('Init loginViewComponent');
|
||||
this.auth$.isGoogleLibLoaded.subscribe((isLoaded) => {
|
||||
console.log('GoogleLibLoaded', isLoaded);
|
||||
if (isLoaded) {
|
||||
this.initGoogleLogin();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Component, NgZone, ViewChild } from '@angular/core';
|
||||
import { MatSidenav, MatSidenavModule } from '@angular/material/sidenav';
|
||||
import { NavigationStart, Router, RouterLink, RouterOutlet } from '@angular/router';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import * as moment from 'moment';
|
||||
import packageInfo from 'package.json';
|
||||
import { delay } from 'rxjs';
|
||||
import { environment } from 'src/environments/environment';
|
||||
@@ -16,13 +15,14 @@ import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { NgIf, DatePipe } from '@angular/common';
|
||||
import { MainMenuComponent } from 'src/app/components/main-menu/main-menu.component';
|
||||
import moment from "moment";
|
||||
|
||||
@Component({
|
||||
selector: 'diunabi-main-view',
|
||||
templateUrl: './main-view.component.html',
|
||||
styleUrls: ['./main-view.component.scss'],
|
||||
standalone: true,
|
||||
imports: [NgIf, MatIconModule, MatToolbarModule, MatButtonModule, MatSidenavModule,
|
||||
imports: [NgIf, MatIconModule, MatToolbarModule, MatButtonModule, MatSidenavModule,
|
||||
MatListModule, RouterLink, MatDividerModule, RouterOutlet, DatePipe, MatMenuModule, MainMenuComponent]
|
||||
})
|
||||
export class MainViewComponent {
|
||||
@@ -49,7 +49,7 @@ export class MainViewComponent {
|
||||
|
||||
//listen to loading subject
|
||||
data$.showLoader.pipe(delay(0)).subscribe(loading => {
|
||||
this.ngZone$.run(() => {
|
||||
this.ngZone$.run(() => {
|
||||
this.loading = loading;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
@include mat.core();
|
||||
|
||||
$my-app-primary: mat.define-palette(mat.$orange-palette);
|
||||
$my-app-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
|
||||
$my-app-warn: mat.define-palette(mat.$red-palette);
|
||||
$my-app-primary: mat.m2-define-palette(mat.$m2-orange-palette);
|
||||
$my-app-accent: mat.m2-define-palette(mat.$m2-pink-palette, A200, A100, A400);
|
||||
$my-app-warn: mat.m2-define-palette(mat.$m2-red-palette);
|
||||
|
||||
$my-app-theme: mat.define-light-theme((color: (primary: $my-app-primary,
|
||||
$my-app-theme: mat.m2-define-light-theme((color: (primary: $my-app-primary,
|
||||
accent: $my-app-accent,
|
||||
warn: $my-app-warn,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user