remove unused imports

This commit is contained in:
Peter Maquiran
2022-10-12 17:01:09 +01:00
parent de16765d97
commit 959bb53b82
59 changed files with 116 additions and 277 deletions
+2 -14
View File
@@ -28,9 +28,7 @@ export class AuthService {
userData$ = new BehaviorSubject<any>('');
userId$ = new BehaviorSubject<any>('');
headers: HttpHeaders;
public ValidatedUser: UserSession;
public wsValidatedUserChat:any;
public ValidatedUserChat:any = {}
public isWsAuthenticated: boolean = false;
opts:any;
@@ -54,17 +52,11 @@ export class AuthService {
this.headers = new HttpHeaders();
if (SessionStore.exist) {
this.ValidatedUser = SessionStore.user
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ) {
this.loginToChatWs()
}
}
if(SessionStore?.user?.ChatData) {
this.ValidatedUserChat = SessionStore.user.ChatData
}
}
@@ -110,7 +102,6 @@ export class AuthService {
session.BasicAuthKey = user.BasicAuthKey
SessionStore.reset(session)
this.ValidatedUser = SessionStore.user;
this.storageService.store(AuthConnstants.USER, response);
@@ -120,11 +111,9 @@ export class AuthService {
this.initialsService.getInitials(session.FullName);
}
async loginChat(responseChat = this.ValidatedUserChat) {
async loginChat(responseChat?) {
if(SessionStore?.user?.ChatData) {
this.ValidatedUserChat = SessionStore.user.ChatData
}
}
async autoLoginChat(expirationDate:number) {
@@ -234,7 +223,6 @@ export class AuthService {
logout() {
this.ValidatedUser = null;
localStorage.removeItem('userChat');
SessionStore.setInativity(false)
+2 -1
View File
@@ -5,6 +5,7 @@ import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { LoginUserRespose } from '../models/user.model';
import { SessionStore } from '../store/session.service';
@Injectable({
providedIn: 'root'
@@ -16,7 +17,7 @@ export class ContactsService {
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
this.loggeduser = user.ValidatedUser;
this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}
+3 -2
View File
@@ -11,6 +11,7 @@ import { OfflineManagerService } from 'src/app/services/offline-manager.service'
import { catchError } from "rxjs/operators";
import { Storage } from '@ionic/storage';
import { BackgroundService } from 'src/app/services/background.service';
import { SessionStore } from '../store/session.service';
@Injectable({
@@ -71,7 +72,7 @@ export class EventsService {
private storage: Storage,
private backgroundservice: BackgroundService) {
this.loggeduser = this.user.ValidatedUser;
this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders();
this.headersMdOficial = new HttpHeaders();
@@ -93,7 +94,7 @@ export class EventsService {
this.setHeader()
this.changeProfileService.registerCallback(() => {
this.loggeduser = this.user.ValidatedUser;
this.loggeduser = SessionStore.user;
this.setHeader()
})
+5 -7
View File
@@ -1,11 +1,9 @@
import { Component, OnInit, LOCALE_ID, EventEmitter, Output, Renderer2, ElementRef } from '@angular/core';
import { Component, OnInit, EventEmitter, Output } from '@angular/core';
import { Event } from '../../models/event.model';
import { EventsService } from 'src/app/services/events.service';
import { NavigationExtras, Router } from '@angular/router';
import { ActivatedRoute, NavigationEnd } from '@angular/router';
import { AuthService } from 'src/app/services/auth.service';
import { StorageService } from 'src/app/services/storage.service';
import { ModalController, Platform } from '@ionic/angular';
import { EventDetailPage } from './event-detail/event-detail.page';
import { ProcessesService } from '../../services/processes.service';
@@ -15,6 +13,7 @@ import { ToDayEventStorage } from 'src/app/store/to-day-event-storage.service';
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-events',
@@ -75,9 +74,7 @@ export class EventsPage implements OnInit {
constructor(
private eventService: EventsService,
private router: Router,
private storageService:StorageService,
public activatedRoute: ActivatedRoute,
private authService: AuthService,
private processes:ProcessesService,
/* private gabineteService: GabineteDigitalPage, */
private modalController:ModalController,
@@ -87,7 +84,7 @@ export class EventsPage implements OnInit {
this.existingScreenOrientation = this.screenOrientation.type;
this.loggeduser = authService.ValidatedUser;
this.loggeduser = SessionStore.user;
this.prEventList = null;
@@ -309,7 +306,8 @@ export class EventsPage implements OnInit {
logout()
{
this.authService.ValidatedUser.BasicAuthKey = "";
SessionStore.user.BasicAuthKey = ""
this.router.navigate(['/home/login']);
}
+2 -1
View File
@@ -6,6 +6,7 @@ import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { LoginUserRespose } from '../models/user.model';
import { OrganicEntity } from 'src/app/models/organic-entity.model';
import { SessionStore } from '../store/session.service';
@Injectable({
providedIn: 'root'
@@ -17,7 +18,7 @@ export class OrganicEntityService {
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
this.loggeduser = user.ValidatedUser;
this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}
+2 -1
View File
@@ -8,6 +8,7 @@ import { catchError } from 'rxjs/operators'
import { Publication } from '../models/publication';
import { getUrl } from 'ionicons/dist/types/components/icon/utils';
import { ActivatedRoute, Router } from '@angular/router';
import { SessionStore } from '../store/session.service';
@Injectable({
providedIn: 'root'
@@ -23,7 +24,7 @@ export class PublicationsService {
constructor(private http: HttpClient, user: AuthService,
private activatedRoute: ActivatedRoute,
private router: Router) {
this.loggeduser = user.ValidatedUser;
this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
+2 -1
View File
@@ -7,6 +7,7 @@ import { AuthService } from '../services/auth.service';
import { LoginUserRespose } from '../models/user.model';
import { EventSearch } from "src/app/models/event-search";
import { TopSearch } from 'src/app/models/top-search';
import { SessionStore } from '../store/session.service';
@Injectable({
providedIn: 'root'
@@ -21,7 +22,7 @@ export class SearchService {
// setup
constructor(private http: HttpClient, user: AuthService) {
this.loggeduser = user.ValidatedUser;
this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}