header.component.ts 910 Bytes
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1
import { Component, OnInit } from '@angular/core';
Lukas Burgey's avatar
Lukas Burgey committed
2

3
import { Observable } from 'rxjs';
Lukas Burgey's avatar
Lukas Burgey committed
4

Lukas Burgey's avatar
Lukas Burgey committed
5
import { UserService } from '../user.service';
Lukas Burgey's avatar
Lukas Burgey committed
6
import { DialogService } from '../dialogues/dialog.service';
Lukas Burgey's avatar
Lukas Burgey committed
7
import { ProfileDialogService } from '../dialogues/profile-dialog.service';
Lukas Burgey's avatar
Lukas Burgey committed
8
import { IdP } from '../types/types.module';
Lukas Burgey's avatar
Lukas Burgey committed
9

Lukas Burgey's avatar
Lukas Burgey committed
10
@Component({
Lukas Burgey's avatar
Lukas Burgey committed
11
  selector: '[feudal-header]',
Lukas Burgey's avatar
Lukas Burgey committed
12
13
14
15
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit {
Lukas Burgey's avatar
Lukas Burgey committed
16

Lukas Burgey's avatar
Lukas Burgey committed
17
  selected: IdP;
Lukas Burgey's avatar
Lukas Burgey committed
18

Lukas Burgey's avatar
Lukas Burgey committed
19
  constructor(
Lukas Burgey's avatar
Lukas Burgey committed
20
    public dialog: DialogService,
Lukas Burgey's avatar
Lukas Burgey committed
21
    public profileDialog: ProfileDialogService,
22
    public userService: UserService,
Lukas Burgey's avatar
Lukas Burgey committed
23
24
  ) {
  }
Lukas Burgey's avatar
Lukas Burgey committed
25
26

  ngOnInit() {
Lukas Burgey's avatar
Lukas Burgey committed
27
28
29
30
31
32
33
34
35
    this.userService.connectIdPInfo().subscribe(
      info => {
        this.selected = info.selectedIdP;
      }
    );
  }

  idpCompare(a: IdP, b: IdP): boolean {
    return a != undefined &&  b != undefined && a.id == b.id;
Lukas Burgey's avatar
Lukas Burgey committed
36
37
  }
}