Skip to content

Commit 4eb2297

Browse files
[DURACOM-160] Hide "Send feedback" link when CanSendFeedback is false
1 parent 471051d commit 4eb2297

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/app/footer/footer.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ <h5 class="text-uppercase">Footer Content</h5>
7575
<a class="text-white"
7676
routerLink="info/end-user-agreement">{{ 'footer.link.end-user-agreement' | translate}}</a>
7777
</li>
78-
<li>
78+
<li *ngIf="showSendFeedback$ | async">
7979
<a class="text-white"
8080
routerLink="info/feedback">{{ 'footer.link.feedback' | translate}}</a>
8181
</li>

src/app/footer/footer.component.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { FooterComponent } from './footer.component';
1515

1616
import { TranslateLoaderMock } from '../shared/mocks/translate-loader.mock';
1717
import { storeModuleConfig } from '../app.reducer';
18+
import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service';
19+
import { AuthorizationDataServiceStub } from '../shared/testing/authorization-service.stub';
1820

1921
let comp: FooterComponent;
2022
let fixture: ComponentFixture<FooterComponent>;
@@ -34,7 +36,8 @@ describe('Footer component', () => {
3436
})],
3537
declarations: [FooterComponent], // declare the test component
3638
providers: [
37-
FooterComponent
39+
FooterComponent,
40+
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
3841
],
3942
schemas: [CUSTOM_ELEMENTS_SCHEMA]
4043
});

src/app/footer/footer.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { Component, Optional } from '@angular/core';
22
import { hasValue } from '../shared/empty.util';
33
import { KlaroService } from '../shared/cookies/klaro.service';
44
import { environment } from '../../environments/environment';
5+
import { Observable } from 'rxjs';
6+
import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service';
7+
import { FeatureID } from '../core/data/feature-authorization/feature-id';
58

69
@Component({
710
selector: 'ds-footer',
@@ -17,8 +20,13 @@ export class FooterComponent {
1720
showTopFooter = false;
1821
showPrivacyPolicy = environment.info.enablePrivacyStatement;
1922
showEndUserAgreement = environment.info.enableEndUserAgreement;
23+
showSendFeedback$: Observable<boolean>;
2024

21-
constructor(@Optional() private cookies: KlaroService) {
25+
constructor(
26+
@Optional() private cookies: KlaroService,
27+
private authorizationService: AuthorizationDataService,
28+
) {
29+
this.showSendFeedback$ = this.authorizationService.isAuthorized(FeatureID.CanSendFeedback);
2230
}
2331

2432
showCookieSettings() {

0 commit comments

Comments
 (0)