mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[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:
parent
f152a24dc2
commit
0800c406cd
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
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';
|
import { HeaderDataService } from '../header-data/header-data.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -123,7 +123,7 @@ export class AppLayoutComponent implements OnInit {
|
|||||||
|
|
||||||
setState(state) {
|
setState(state) {
|
||||||
if (this.config.get('sideNav.preserveState')) {
|
if (this.config.get('sideNav.preserveState')) {
|
||||||
this.userPreferences.set('expandedSidenav', state);
|
this.userPreferences.set(UserPreferenceValues.ExpandedSideNavStatus, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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.
|
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
|
```ts
|
||||||
userPreferences.disableCSRF = true;
|
userPreferences.disableCSRF = true;
|
||||||
|
@ -25,7 +25,8 @@ import { distinctUntilChanged, map } from 'rxjs/operators';
|
|||||||
export enum UserPreferenceValues {
|
export enum UserPreferenceValues {
|
||||||
PaginationSize = 'paginationSize',
|
PaginationSize = 'paginationSize',
|
||||||
Locale = 'locale',
|
Locale = 'locale',
|
||||||
SupportedPageSizes = 'supportedPageSizes'
|
SupportedPageSizes = 'supportedPageSizes',
|
||||||
|
ExpandedSideNavStatus = 'expandedSidenav'
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@ -36,7 +37,8 @@ export class UserPreferencesService {
|
|||||||
defaults = {
|
defaults = {
|
||||||
paginationSize: 25,
|
paginationSize: 25,
|
||||||
supportedPageSizes: [5, 10, 15, 20],
|
supportedPageSizes: [5, 10, 15, 20],
|
||||||
locale: 'en'
|
locale: 'en',
|
||||||
|
expandedSidenav: true
|
||||||
};
|
};
|
||||||
|
|
||||||
private userPreferenceStatus: any = this.defaults;
|
private userPreferenceStatus: any = this.defaults;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user