mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 05:53:03 +00:00
adapt klaro code to be compatible with v0.7
This commit is contained in:

committed by
Giuseppe Digilio

parent
574caeb528
commit
54d0569bab
@@ -78,7 +78,7 @@ export class BrowserKlaroService extends KlaroService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add all message keys for apps and purposes
|
* Add all message keys for services and purposes
|
||||||
*/
|
*/
|
||||||
this.addAppMessages();
|
this.addAppMessages();
|
||||||
|
|
||||||
@@ -88,8 +88,7 @@ export class BrowserKlaroService extends KlaroService {
|
|||||||
* Show the configuration if the configuration has not been confirmed
|
* Show the configuration if the configuration has not been confirmed
|
||||||
*/
|
*/
|
||||||
this.translateConfiguration();
|
this.translateConfiguration();
|
||||||
Klaro.renderKlaro(this.klaroConfig, false);
|
Klaro.setup(this.klaroConfig);
|
||||||
Klaro.initialize();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -161,10 +160,10 @@ export class BrowserKlaroService extends KlaroService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add message keys for all apps and purposes
|
* Add message keys for all services and purposes
|
||||||
*/
|
*/
|
||||||
addAppMessages() {
|
addAppMessages() {
|
||||||
this.klaroConfig.apps.forEach((app) => {
|
this.klaroConfig.services.forEach((app) => {
|
||||||
this.klaroConfig.translations.en[app.name] = { title: this.getTitleTranslation(app.name), description: this.getDescriptionTranslation(app.name) };
|
this.klaroConfig.translations.en[app.name] = { title: this.getTitleTranslation(app.name), description: this.getDescriptionTranslation(app.name) };
|
||||||
app.purposes.forEach((purpose) => {
|
app.purposes.forEach((purpose) => {
|
||||||
this.klaroConfig.translations.en.purposes[purpose] = this.getPurposeTranslation(purpose);
|
this.klaroConfig.translations.en.purposes[purpose] = this.getPurposeTranslation(purpose);
|
||||||
|
@@ -30,8 +30,8 @@ export const klaroConfiguration: any = {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Setting 'acceptAll' to 'true' will show an "accept all" button in the notice and
|
Setting 'acceptAll' to 'true' will show an "accept all" button in the notice and
|
||||||
modal, which will enable all third-party apps if the user clicks on it. If set
|
modal, which will enable all third-party services if the user clicks on it. If set
|
||||||
to 'false', there will be an "accept" button that will only enable the apps that
|
to 'false', there will be an "accept" button that will only enable the services that
|
||||||
are enabled in the consent modal.
|
are enabled in the consent modal.
|
||||||
*/
|
*/
|
||||||
acceptAll: true,
|
acceptAll: true,
|
||||||
@@ -84,7 +84,7 @@ export const klaroConfiguration: any = {
|
|||||||
purposes: {}
|
purposes: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
apps: [
|
services: [
|
||||||
{
|
{
|
||||||
name: 'authentication',
|
name: 'authentication',
|
||||||
purposes: ['functional'],
|
purposes: ['functional'],
|
||||||
@@ -120,7 +120,7 @@ export const klaroConfiguration: any = {
|
|||||||
// /*
|
// /*
|
||||||
// you an either only provide a cookie name or regular expression (regex) or a list
|
// you an either only provide a cookie name or regular expression (regex) or a list
|
||||||
// consisting of a name or regex, a path and a cookie domain. Providing a path and
|
// consisting of a name or regex, a path and a cookie domain. Providing a path and
|
||||||
// domain is necessary if you have apps that set cookies for a path that is not
|
// domain is necessary if you have services that set cookies for a path that is not
|
||||||
// "/", or a domain that is not the current domain. If you do not set these values
|
// "/", or a domain that is not the current domain. If you do not set these values
|
||||||
// properly, the cookie can't be deleted by Klaro, as there is no way to access the
|
// properly, the cookie can't be deleted by Klaro, as there is no way to access the
|
||||||
// path or domain of a cookie in JS. Notice that it is not possible to delete
|
// path or domain of a cookie in JS. Notice that it is not possible to delete
|
||||||
|
Reference in New Issue
Block a user