mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
[DURACOM-160] Hide "Send feedback" link when CanSendFeedback is false
This commit is contained in:
@@ -75,7 +75,7 @@
|
|||||||
<a class="text-white"
|
<a class="text-white"
|
||||||
routerLink="info/end-user-agreement">{{ 'footer.link.end-user-agreement' | translate}}</a>
|
routerLink="info/end-user-agreement">{{ 'footer.link.end-user-agreement' | translate}}</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li *ngIf="showSendFeedback$ | async">
|
||||||
<a class="text-white"
|
<a class="text-white"
|
||||||
routerLink="info/feedback">{{ 'footer.link.feedback' | translate}}</a>
|
routerLink="info/feedback">{{ 'footer.link.feedback' | translate}}</a>
|
||||||
</li>
|
</li>
|
||||||
|
@@ -15,6 +15,8 @@ import { FooterComponent } from './footer.component';
|
|||||||
|
|
||||||
import { TranslateLoaderMock } from '../shared/mocks/translate-loader.mock';
|
import { TranslateLoaderMock } from '../shared/mocks/translate-loader.mock';
|
||||||
import { storeModuleConfig } from '../app.reducer';
|
import { storeModuleConfig } from '../app.reducer';
|
||||||
|
import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service';
|
||||||
|
import { AuthorizationDataServiceStub } from '../shared/testing/authorization-service.stub';
|
||||||
|
|
||||||
let comp: FooterComponent;
|
let comp: FooterComponent;
|
||||||
let fixture: ComponentFixture<FooterComponent>;
|
let fixture: ComponentFixture<FooterComponent>;
|
||||||
@@ -34,7 +36,8 @@ describe('Footer component', () => {
|
|||||||
})],
|
})],
|
||||||
declarations: [FooterComponent], // declare the test component
|
declarations: [FooterComponent], // declare the test component
|
||||||
providers: [
|
providers: [
|
||||||
FooterComponent
|
FooterComponent,
|
||||||
|
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||||
],
|
],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||||
});
|
});
|
||||||
|
@@ -2,6 +2,9 @@ import { Component, Optional } from '@angular/core';
|
|||||||
import { hasValue } from '../shared/empty.util';
|
import { hasValue } from '../shared/empty.util';
|
||||||
import { KlaroService } from '../shared/cookies/klaro.service';
|
import { KlaroService } from '../shared/cookies/klaro.service';
|
||||||
import { environment } from '../../environments/environment';
|
import { environment } from '../../environments/environment';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service';
|
||||||
|
import { FeatureID } from '../core/data/feature-authorization/feature-id';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-footer',
|
selector: 'ds-footer',
|
||||||
@@ -17,8 +20,13 @@ export class FooterComponent {
|
|||||||
showTopFooter = false;
|
showTopFooter = false;
|
||||||
showPrivacyPolicy = environment.info.enablePrivacyStatement;
|
showPrivacyPolicy = environment.info.enablePrivacyStatement;
|
||||||
showEndUserAgreement = environment.info.enableEndUserAgreement;
|
showEndUserAgreement = environment.info.enableEndUserAgreement;
|
||||||
|
showSendFeedback$: Observable<boolean>;
|
||||||
|
|
||||||
constructor(@Optional() private cookies: KlaroService) {
|
constructor(
|
||||||
|
@Optional() private cookies: KlaroService,
|
||||||
|
private authorizationService: AuthorizationDataService,
|
||||||
|
) {
|
||||||
|
this.showSendFeedback$ = this.authorizationService.isAuthorized(FeatureID.CanSendFeedback);
|
||||||
}
|
}
|
||||||
|
|
||||||
showCookieSettings() {
|
showCookieSettings() {
|
||||||
|
Reference in New Issue
Block a user