mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
[DURACOM-309] fix pipeline, remove cookie settings link from footer if popup is disabled
This commit is contained in:
@@ -59,11 +59,13 @@
|
||||
href="https://www.lyrasis.org/" role="link" tabindex="0">{{ 'footer.link.lyrasis' | translate}}</a>
|
||||
</p>
|
||||
<ul class="footer-info list-unstyled d-flex justify-content-center mb-0">
|
||||
@if (showCookieSettings) {
|
||||
<li>
|
||||
<button class="btn btn-link text-white" type="button" (click)="showCookieSettings()" role="button" tabindex="0">
|
||||
<button class="btn btn-link text-white" type="button" (click)="openCookieSettings()" role="button" tabindex="0">
|
||||
{{ 'footer.link.cookies' | translate}}
|
||||
</button>
|
||||
</li>
|
||||
}
|
||||
@if (showPrivacyPolicy) {
|
||||
<li>
|
||||
<a class="btn text-white"
|
||||
|
@@ -63,21 +63,21 @@ describe('Footer component', () => {
|
||||
expect(comp.showEndUserAgreement).toBe(environment.info.enableEndUserAgreement);
|
||||
});
|
||||
|
||||
describe('showCookieSettings', () => {
|
||||
describe('openCookieSettings', () => {
|
||||
it('should call cookies.showSettings() if cookies is defined', () => {
|
||||
const cookies = jasmine.createSpyObj('cookies', ['showSettings']);
|
||||
comp.cookies = cookies;
|
||||
comp.showCookieSettings();
|
||||
comp.openCookieSettings();
|
||||
expect(cookies.showSettings).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should not call cookies.showSettings() if cookies is undefined', () => {
|
||||
comp.cookies = undefined;
|
||||
expect(() => comp.showCookieSettings()).not.toThrow();
|
||||
expect(() => comp.openCookieSettings()).not.toThrow();
|
||||
});
|
||||
|
||||
it('should return false', () => {
|
||||
expect(comp.showCookieSettings()).toBeFalse();
|
||||
expect(comp.openCookieSettings()).toBeFalse();
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -39,6 +39,7 @@ export class FooterComponent implements OnInit {
|
||||
* A boolean representing if to show or not the top footer container
|
||||
*/
|
||||
showTopFooter = false;
|
||||
showCookieSettings = false;
|
||||
showPrivacyPolicy: boolean;
|
||||
showEndUserAgreement: boolean;
|
||||
showSendFeedback$: Observable<boolean>;
|
||||
@@ -53,13 +54,14 @@ export class FooterComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.showCookieSettings = this.appConfig.info.enableCookieConsentPopup;
|
||||
this.showPrivacyPolicy = this.appConfig.info.enablePrivacyStatement;
|
||||
this.showEndUserAgreement = this.appConfig.info.enableEndUserAgreement;
|
||||
this.coarLdnEnabled$ = this.appConfig.info.enableCOARNotifySupport ? this.notifyInfoService.isCoarConfigEnabled() : observableOf(false);
|
||||
this.showSendFeedback$ = this.authorizationService.isAuthorized(FeatureID.CanSendFeedback);
|
||||
}
|
||||
|
||||
showCookieSettings() {
|
||||
openCookieSettings() {
|
||||
if (hasValue(this.cookies)) {
|
||||
this.cookies.showSettings();
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { TestScheduler } from 'rxjs/testing';
|
||||
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
import { RestResponse } from '../../core/cache/response.models';
|
||||
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||
@@ -78,6 +79,8 @@ describe('BrowserOrejimeService', () => {
|
||||
},
|
||||
});
|
||||
|
||||
environment.info.enableCookieConsentPopup = true;
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
BrowserOrejimeService,
|
||||
|
@@ -483,6 +483,7 @@ export class DefaultAppConfig implements AppConfig {
|
||||
enableEndUserAgreement: true,
|
||||
enablePrivacyStatement: true,
|
||||
enableCOARNotifySupport: true,
|
||||
enableCookieConsentPopup: true,
|
||||
};
|
||||
|
||||
// Whether to enable Markdown (https://commonmark.org/) and MathJax (https://www.mathjax.org/)
|
||||
|
@@ -14,7 +14,4 @@ export const environment: Partial<BuildConfig> = {
|
||||
enableSearchComponent: false,
|
||||
enableBrowseComponent: false,
|
||||
},
|
||||
info: {
|
||||
enableCookieConsentPopup: true,
|
||||
},
|
||||
};
|
||||
|
@@ -324,7 +324,6 @@ export const environment: BuildConfig = {
|
||||
enableEndUserAgreement: true,
|
||||
enablePrivacyStatement: true,
|
||||
enableCOARNotifySupport: true,
|
||||
enableCookieConsentPopup: true,
|
||||
},
|
||||
markdown: {
|
||||
enabled: false,
|
||||
|
@@ -19,9 +19,6 @@ export const environment: Partial<BuildConfig> = {
|
||||
enableSearchComponent: false,
|
||||
enableBrowseComponent: false,
|
||||
},
|
||||
info: {
|
||||
enableCookieConsentPopup: true,
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user