mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-1070] fix issue with user preferences and page reload (#2075)
* user preferences profile storage support * update unit test
This commit is contained in:
committed by
Eugenio Romano
parent
689eb42f72
commit
b52888144e
@@ -61,6 +61,7 @@ describe('UserPreferencesService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should format property key for default prefix', () => {
|
it('should format property key for default prefix', () => {
|
||||||
|
preferences.setStoragePrefix(null);
|
||||||
expect(preferences.getPropertyKey('propertyA')).toBe('GUEST__propertyA');
|
expect(preferences.getPropertyKey('propertyA')).toBe('GUEST__propertyA');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -26,14 +26,12 @@ export class UserPreferencesService {
|
|||||||
paginationSize: 25
|
paginationSize: 25
|
||||||
};
|
};
|
||||||
|
|
||||||
private _storagePrefix: string = 'GUEST';
|
|
||||||
|
|
||||||
getStoragePrefix(): string {
|
getStoragePrefix(): string {
|
||||||
return this._storagePrefix;
|
return this.storage.getItem('USER_PROFILE') || 'GUEST';
|
||||||
}
|
}
|
||||||
|
|
||||||
setStoragePrefix(value: string) {
|
setStoragePrefix(value: string) {
|
||||||
this._storagePrefix = value || 'GUEST';
|
this.storage.setItem('USER_PROFILE', value || 'GUEST');
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
Reference in New Issue
Block a user