[ADF-4328] added expandedSideNav as new user preference value (#4545)

* [ADF-4328] added expandedSideNav as new user preference value

* [ADF-4328] update demo shell with the new User preference value

* [ADF-4328] added documentation update
This commit is contained in:
Vito 2019-04-03 17:56:37 +01:00 committed by Eugenio Romano
parent f152a24dc2
commit 0800c406cd
3 changed files with 7 additions and 5 deletions

View File

@ -16,7 +16,7 @@
*/
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
import { UserPreferencesService, AppConfigService, AlfrescoApiService } from '@alfresco/adf-core';
import { UserPreferencesService, AppConfigService, AlfrescoApiService, UserPreferenceValues } from '@alfresco/adf-core';
import { HeaderDataService } from '../header-data/header-data.service';
@Component({
@ -123,7 +123,7 @@ export class AppLayoutComponent implements OnInit {
setState(state) {
if (this.config.get('sideNav.preserveState')) {
this.userPreferences.set('expandedSidenav', state);
this.userPreferences.set(UserPreferenceValues.ExpandedSideNavStatus, state);
}
}
}

View File

@ -108,7 +108,7 @@ whole set of user properties. This is useful when a component needs to react to
```
You can also use the `select` method to get notification when a particular property is changed.
A set of basic properties is added into the enumeration [`UserPreferenceValues`](../../../lib/core/services/user-preferences.service.ts) which gives you the key value to access the standard user preference service properties : **PaginationSize**, **DisableCSRF**, **Locale** and **SupportedPageSizes**.
A set of basic properties is added into the enumeration [`UserPreferenceValues`](../../../lib/core/services/user-preferences.service.ts) which gives you the key value to access the standard user preference service properties : **PaginationSize**, **DisableCSRF**, **Locale**, **SupportedPageSizes** and **ExpandedSideNavStatus**.
```ts
userPreferences.disableCSRF = true;

View File

@ -25,7 +25,8 @@ import { distinctUntilChanged, map } from 'rxjs/operators';
export enum UserPreferenceValues {
PaginationSize = 'paginationSize',
Locale = 'locale',
SupportedPageSizes = 'supportedPageSizes'
SupportedPageSizes = 'supportedPageSizes',
ExpandedSideNavStatus = 'expandedSidenav'
}
@Injectable({
@ -36,7 +37,8 @@ export class UserPreferencesService {
defaults = {
paginationSize: 25,
supportedPageSizes: [5, 10, 15, 20],
locale: 'en'
locale: 'en',
expandedSidenav: true
};
private userPreferenceStatus: any = this.defaults;