|
1 | | -import { Component, Optional } from '@angular/core'; |
| 1 | +import { Component, Optional, Inject, OnInit } from '@angular/core'; |
2 | 2 | import { hasValue } from '../shared/empty.util'; |
3 | 3 | import { KlaroService } from '../shared/cookies/klaro.service'; |
4 | 4 | import { environment } from '../../environments/environment'; |
5 | 5 | import { Observable } from 'rxjs'; |
6 | 6 | import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service'; |
7 | 7 | import { FeatureID } from '../core/data/feature-authorization/feature-id'; |
| 8 | +import { AppConfig, APP_CONFIG } from '../../config/app-config.interface'; |
8 | 9 |
|
9 | 10 | @Component({ |
10 | 11 | selector: 'ds-footer', |
11 | 12 | styleUrls: ['footer.component.scss'], |
12 | 13 | templateUrl: 'footer.component.html' |
13 | 14 | }) |
14 | | -export class FooterComponent { |
| 15 | +export class FooterComponent implements OnInit { |
15 | 16 | dateObj: number = Date.now(); |
16 | 17 |
|
17 | 18 | /** |
18 | 19 | * A boolean representing if to show or not the top footer container |
19 | 20 | */ |
20 | 21 | showTopFooter = false; |
| 22 | + showCookieSettings = false; |
21 | 23 | showPrivacyPolicy = environment.info.enablePrivacyStatement; |
22 | 24 | showEndUserAgreement = environment.info.enableEndUserAgreement; |
23 | 25 | showSendFeedback$: Observable<boolean>; |
24 | 26 |
|
25 | 27 | constructor( |
26 | 28 | @Optional() private cookies: KlaroService, |
27 | 29 | private authorizationService: AuthorizationDataService, |
| 30 | + @Inject(APP_CONFIG) protected appConfig: AppConfig, |
28 | 31 | ) { |
29 | 32 | this.showSendFeedback$ = this.authorizationService.isAuthorized(FeatureID.CanSendFeedback); |
30 | 33 | } |
31 | 34 |
|
32 | | - showCookieSettings() { |
| 35 | + ngOnInit() { |
| 36 | + this.showCookieSettings = this.appConfig.info.enableCookieConsentPopup; |
| 37 | + } |
| 38 | + |
| 39 | + openCookieSettings() { |
33 | 40 | if (hasValue(this.cookies)) { |
34 | 41 | this.cookies.showSettings(); |
35 | 42 | } |
|
0 commit comments