mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 14:03:06 +00:00
debounce for update requests
This commit is contained in:
@@ -18,10 +18,13 @@ $footer-logo-height: 55px;
|
|||||||
height: $footer-logo-height;
|
height: $footer-logo-height;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul li {
|
ul {
|
||||||
padding-top: $spacer * 0.5;
|
padding-top: $spacer * 0.5;
|
||||||
|
|
||||||
|
li {
|
||||||
|
display: inline-flex;
|
||||||
a {
|
a {
|
||||||
|
padding: 0 $spacer/2;
|
||||||
color: inherit
|
color: inherit
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,9 +32,9 @@ $footer-logo-height: 55px;
|
|||||||
&:after {
|
&:after {
|
||||||
content: '';
|
content: '';
|
||||||
border-right: 1px map-get($theme-colors, secondary) solid;
|
border-right: 1px map-get($theme-colors, secondary) solid;
|
||||||
margin: 0 $spacer/2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,18 +7,13 @@ import { environment } from '../../../environments/environment';
|
|||||||
import { switchMap, take } from 'rxjs/operators';
|
import { switchMap, take } from 'rxjs/operators';
|
||||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||||
import { KlaroService } from './klaro.service';
|
import { KlaroService } from './klaro.service';
|
||||||
import { hasValue, isEmpty, isNotEmpty } from '../empty.util';
|
import { hasValue, isNotEmpty } from '../empty.util';
|
||||||
import { CookieService } from '../../core/services/cookie.service';
|
import { CookieService } from '../../core/services/cookie.service';
|
||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||||
import { cloneDeep } from 'lodash';
|
import { cloneDeep, debounce } from 'lodash';
|
||||||
import { ANONYMOUS_STORAGE_NAME_KLARO, klaroConfiguration } from './klaro-configuration';
|
import { ANONYMOUS_STORAGE_NAME_KLARO, klaroConfiguration } from './klaro-configuration';
|
||||||
import { Operation } from 'fast-json-patch';
|
import { Operation } from 'fast-json-patch';
|
||||||
|
|
||||||
/**
|
|
||||||
* Cookie for has_agreed_end_user
|
|
||||||
*/
|
|
||||||
export const HAS_AGREED_END_USER = 'dsHasAgreedEndUser';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metadata field to store a user's cookie consent preferences in
|
* Metadata field to store a user's cookie consent preferences in
|
||||||
*/
|
*/
|
||||||
@@ -39,6 +34,10 @@ const cookieDescriptionMessagePrefix = 'cookies.consent.app.description.';
|
|||||||
*/
|
*/
|
||||||
const cookiePurposeMessagePrefix = 'cookies.consent.purpose.';
|
const cookiePurposeMessagePrefix = 'cookies.consent.purpose.';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update request debounce in ms
|
||||||
|
*/
|
||||||
|
const updateDebounce = 300;
|
||||||
/**
|
/**
|
||||||
* Browser implementation for the KlaroService, representing a service for handling Klaro consent preferences and UI
|
* Browser implementation for the KlaroService, representing a service for handling Klaro consent preferences and UI
|
||||||
*/
|
*/
|
||||||
@@ -100,7 +99,7 @@ export class BrowserKlaroService extends KlaroService {
|
|||||||
* @param user The authenticated user
|
* @param user The authenticated user
|
||||||
*/
|
*/
|
||||||
private initializeUser(user: EPerson) {
|
private initializeUser(user: EPerson) {
|
||||||
this.klaroConfig.callback = (consent, app) => this.updateSettingsForUsers(user);
|
this.klaroConfig.callback = debounce((consent, app) => this.updateSettingsForUsers(user), updateDebounce);
|
||||||
this.klaroConfig.storageName = this.getStorageName(user.uuid);
|
this.klaroConfig.storageName = this.getStorageName(user.uuid);
|
||||||
|
|
||||||
const anonCookie = this.cookieService.get(ANONYMOUS_STORAGE_NAME_KLARO);
|
const anonCookie = this.cookieService.get(ANONYMOUS_STORAGE_NAME_KLARO);
|
||||||
|
@@ -1,7 +1,11 @@
|
|||||||
import { TOKENITEM } from '../../core/auth/models/auth-token-info.model';
|
import { TOKENITEM } from '../../core/auth/models/auth-token-info.model';
|
||||||
import { IMPERSONATING_COOKIE, REDIRECT_COOKIE } from '../../core/auth/auth.service';
|
import { IMPERSONATING_COOKIE, REDIRECT_COOKIE } from '../../core/auth/auth.service';
|
||||||
import { LANG_COOKIE } from '../../core/locale/locale.service';
|
import { LANG_COOKIE } from '../../core/locale/locale.service';
|
||||||
import { HAS_AGREED_END_USER } from './browser-klaro.service';
|
|
||||||
|
/**
|
||||||
|
* Cookie for has_agreed_end_user
|
||||||
|
*/
|
||||||
|
export const HAS_AGREED_END_USER = 'dsHasAgreedEndUser';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Storage name used to store klaro cookie
|
* Storage name used to store klaro cookie
|
||||||
|
Reference in New Issue
Block a user