|
|
|
@ -3,13 +3,13 @@ import { Component, OnInit, ViewChild } from '@angular/core'; |
|
|
|
|
import { Subscription } from 'rxjs'; |
|
|
|
|
|
|
|
|
|
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 { 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; |
|
|
|
|
|
|
|
|
|
constructor(private service: CollaborateursService, private collaborateurConnecte: CollaborateurConnecte) {} |
|
|
|
|
constructor(private service: CollaborateursService) {} |
|
|
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
|
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 |
|
|
|
|
*/ |
|
|
|
|
setBUsId() { |
|
|
|
|
if(this.collaborateurConnecte.collaborateur == undefined) { |
|
|
|
|
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined){ |
|
|
|
|
setTimeout( () => this.setBUsId(), 1000); |
|
|
|
|
} |
|
|
|
|
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) { |
|
|
|
|
this.busIds.push(bu.id); |
|
|
|
|
} |
|
|
|
|