|
|
@ -3,13 +3,13 @@ import { Component, OnInit, ViewChild } from '@angular/core'; |
|
|
|
import { Subscription } from 'rxjs'; |
|
|
|
import { Subscription } from 'rxjs'; |
|
|
|
|
|
|
|
|
|
|
|
import {MatTableDataSource} from '@angular/material/table'; |
|
|
|
import {MatTableDataSource} from '@angular/material/table'; |
|
|
|
import {MatPaginator} from '@angular/material/paginator'; |
|
|
|
|
|
|
|
import {MatSort} from '@angular/material/sort'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { CollaborateursService } from "@shared/api-swagger/api/api"; |
|
|
|
import { CollaborateursService } from "@shared/api-swagger/api/api"; |
|
|
|
|
|
|
|
|
|
|
|
import { BusinessUnitDTO, CollaborateurDTO } from "@shared/api-swagger/model/models"; |
|
|
|
import { BusinessUnitDTO, CollaborateurDTO } from "@shared/api-swagger/model/models"; |
|
|
|
import { CollaborateurConnecte } from "@shared/globales/collaborateur-connecte" |
|
|
|
|
|
|
|
|
|
|
|
import { cles } from "@shared/utils/cles"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -96,7 +96,7 @@ export class ReferentsComponent implements OnInit { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
chargement = true; |
|
|
|
chargement = true; |
|
|
|
|
|
|
|
|
|
|
|
constructor(private service: CollaborateursService, private collaborateurConnecte: CollaborateurConnecte) {} |
|
|
|
constructor(private service: CollaborateursService) {} |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
ngOnInit() { |
|
|
|
this.setBUsId(); |
|
|
|
this.setBUsId(); |
|
|
@ -162,11 +162,12 @@ export class ReferentsComponent implements OnInit { |
|
|
|
* création de la liste des business unit du collaborateur connecté pour afficher les checkboxes |
|
|
|
* création de la liste des business unit du collaborateur connecté pour afficher les checkboxes |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
setBUsId() { |
|
|
|
setBUsId() { |
|
|
|
if(this.collaborateurConnecte.collaborateur == undefined) { |
|
|
|
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined){ |
|
|
|
setTimeout( () => this.setBUsId(), 1000); |
|
|
|
setTimeout( () => this.setBUsId(), 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
this.bus = this.collaborateurConnecte.collaborateur.businessUnit.agence.bu; |
|
|
|
const connecte = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee)); |
|
|
|
|
|
|
|
this.bus = connecte.businessUnit.agence.bu; |
|
|
|
for(let bu of this.bus) { |
|
|
|
for(let bu of this.bus) { |
|
|
|
this.busIds.push(bu.id); |
|
|
|
this.busIds.push(bu.id); |
|
|
|
} |
|
|
|
} |
|
|
|