This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
page-ribbon.component.ts 843 B
Newer Older
Lukas Kaltenbrunner's avatar
Lukas Kaltenbrunner committed
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
Michael Breu's avatar
Michael Breu committed
import { TranslateService } from '@ngx-translate/core';
Michael Breu's avatar
Michael Breu committed

Lukas Kaltenbrunner's avatar
Lukas Kaltenbrunner committed
import { ProfileService } from './profile.service';

@Component({
  selector: 'jhi-page-ribbon',
  template: `
    <div class="ribbon" *ngIf="ribbonEnv$ | async as ribbonEnv">
      <a href="" jhiTranslate="global.ribbon.{{ ribbonEnv }}">{{ ribbonEnv }}</a>
    </div>
  `,
Michael Breu's avatar
Michael Breu committed
  styleUrls: ['./page-ribbon.component.scss'],
Lukas Kaltenbrunner's avatar
Lukas Kaltenbrunner committed
})
export class PageRibbonComponent implements OnInit {
  ribbonEnv$?: Observable<string | undefined>;

Michael Breu's avatar
Michael Breu committed
  constructor(private profileService: ProfileService, private translateService: TranslateService) {}
Lukas Kaltenbrunner's avatar
Lukas Kaltenbrunner committed

  ngOnInit(): void {
    this.ribbonEnv$ = this.profileService.getProfileInfo().pipe(map(profileInfo => profileInfo.ribbonEnv));
  }
}