import {ChangeDetectionStrategy, Component} from "@angular/core";
import {Router} from "@angular/router";
import {UserService, Session} from "@webbpm/base-package";
import {Observable} from "rxjs";

@Component({
  moduleId: module.id,
  selector: "app-header",
  templateUrl: "../../../../../src/resources/template/app/component/app_header.html",
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppHeaderComponent {

  public currentSession: Observable<Session>;

  constructor(protected userService: UserService,
              protected router: Router) {
    this.currentSession = this.userService.getCurrentSession();
  }

  public openTaskList(): void {
    this.router.navigateByUrl("/process/tasks");
  }
}
