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