[ADF-2025] Task List - The pagination should be fetched from the UserPreference (#2733)

[ADF-2025] Task List - The pagination should be fetched from the UserPreference
This commit is contained in:
madhukar23
2017-12-04 23:03:45 +05:30
committed by Eugenio Romano
parent 910b2b344c
commit 4462486df1
5 changed files with 28 additions and 10 deletions

View File

@@ -26,8 +26,9 @@ import { StorageService } from './storage.service';
@Injectable()
export class UserPreferencesService {
private defaults = {
defaults = {
paginationSize: 25,
supportedPageSizes: [5, 10, 15, 20],
locale: 'en'
};
@@ -43,7 +44,8 @@ export class UserPreferencesService {
const currentLocale = this.locale || this.getDefaultLocale();
this.localeSubject = new BehaviorSubject(currentLocale);
this.locale$ = this.localeSubject.asObservable();
this.defaults.paginationSize = appConfig.get('pagination.size', 25);
this.defaults.paginationSize = this.appConfig.get('pagination.size', this.defaults.paginationSize);
this.defaults.supportedPageSizes = this.appConfig.get('pagination.supportedPageSizes', this.defaults.supportedPageSizes);
}
get(property: string, defaultValue?: string): string {
@@ -76,6 +78,10 @@ export class UserPreferencesService {
return `${this.getStoragePrefix()}__${property}`;
}
getDifferentPageSizes(): number[] {
return this.defaults.supportedPageSizes;
}
set authType(value: string) {
this.storage.setItem('AUTH_TYPE', value);
this.apiService.reset();