[DURACOM-309] fix pipeline, remove cookie settings link from footer if popup is disabled

This commit is contained in:
Andrea Barbasso
2025-05-15 10:54:18 +02:00
parent 887bf0d266
commit 9be8a87a57
8 changed files with 14 additions and 13 deletions

View File

@@ -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"

View File

@@ -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();
});
});

View File

@@ -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();
}

View File

@@ -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,

View File

@@ -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/)

View File

@@ -14,7 +14,4 @@ export const environment: Partial<BuildConfig> = {
enableSearchComponent: false,
enableBrowseComponent: false,
},
info: {
enableCookieConsentPopup: true,
},
};

View File

@@ -324,7 +324,6 @@ export const environment: BuildConfig = {
enableEndUserAgreement: true,
enablePrivacyStatement: true,
enableCOARNotifySupport: true,
enableCookieConsentPopup: true,
},
markdown: {
enabled: false,

View File

@@ -19,9 +19,6 @@ export const environment: Partial<BuildConfig> = {
enableSearchComponent: false,
enableBrowseComponent: false,
},
info: {
enableCookieConsentPopup: true,
},
};
/*