From 5a7b32e3cdca31439c76e45872b041d826b65ada Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Wed, 21 Aug 2019 14:53:07 +0200 Subject: [PATCH] Readd filter store keys Adds custom storage keys to the filter list again prevents a problem that appears on minified code --- .../src/app/core/ui-services/base-filter-list.service.ts | 7 ++----- .../app/site/agenda/services/agenda-filter-list.service.ts | 5 +++++ .../site/assignments/services/assignment-filter.service.ts | 5 +++++ .../site/motions/services/amendment-filter-list.service.ts | 7 ++++++- .../site/motions/services/motion-filter-list.service.ts | 5 +++++ .../app/site/users/services/user-filter-list.service.ts | 5 +++++ 6 files changed, 28 insertions(+), 6 deletions(-) diff --git a/client/src/app/core/ui-services/base-filter-list.service.ts b/client/src/app/core/ui-services/base-filter-list.service.ts index 0d54dda38..15f435c67 100644 --- a/client/src/app/core/ui-services/base-filter-list.service.ts +++ b/client/src/app/core/ui-services/base-filter-list.service.ts @@ -149,7 +149,7 @@ export abstract class BaseFilterListService { /** * The key to access stored valued */ - private storageKey: string; + protected abstract readonly storageKey: string; /** * Constructor. @@ -157,10 +157,7 @@ export abstract class BaseFilterListService { * @param name the name of the filter service * @param store storage service, to read saved filter variables */ - public constructor(private store: StorageService, private OSStatus: OpenSlidesStatusService) { - this.storageKey = this.constructor.name; - console.log('storage-key: ', this.storageKey); - } + public constructor(private store: StorageService, private OSStatus: OpenSlidesStatusService) {} /** * Initializes the filterService. diff --git a/client/src/app/site/agenda/services/agenda-filter-list.service.ts b/client/src/app/site/agenda/services/agenda-filter-list.service.ts index f41d86075..5bedbe268 100644 --- a/client/src/app/site/agenda/services/agenda-filter-list.service.ts +++ b/client/src/app/site/agenda/services/agenda-filter-list.service.ts @@ -15,6 +15,11 @@ import { ViewItem } from '../models/view-item'; providedIn: 'root' }) export class AgendaFilterListService extends BaseFilterListService { + /** + * set the storage key name + */ + protected storageKey = 'AgendaList'; + /** * Constructor. Also creates the dynamic filter options * diff --git a/client/src/app/site/assignments/services/assignment-filter.service.ts b/client/src/app/site/assignments/services/assignment-filter.service.ts index f3dc5c7c9..704b2eeec 100644 --- a/client/src/app/site/assignments/services/assignment-filter.service.ts +++ b/client/src/app/site/assignments/services/assignment-filter.service.ts @@ -12,6 +12,11 @@ import { AssignmentPhases, ViewAssignment } from '../models/view-assignment'; providedIn: 'root' }) export class AssignmentFilterListService extends BaseFilterListService { + /** + * set the storage key name + */ + protected storageKey = 'AssignmentList'; + /** * Constructor. Activates the phase options subscription * diff --git a/client/src/app/site/motions/services/amendment-filter-list.service.ts b/client/src/app/site/motions/services/amendment-filter-list.service.ts index df6ff6932..281c2143c 100644 --- a/client/src/app/site/motions/services/amendment-filter-list.service.ts +++ b/client/src/app/site/motions/services/amendment-filter-list.service.ts @@ -24,10 +24,15 @@ import { ViewMotion } from '../models/view-motion'; }) export class AmendmentFilterListService extends MotionFilterListService { /** - * Private acessor for an amendment id + * Private accessor for an amendment id */ private _parentMotionId: number; + /** + * set the storage key nae + */ + protected storageKey = 'AmendmentList'; + /** * publicly get an amendment id */ diff --git a/client/src/app/site/motions/services/motion-filter-list.service.ts b/client/src/app/site/motions/services/motion-filter-list.service.ts index 254883fbf..75df1afe9 100644 --- a/client/src/app/site/motions/services/motion-filter-list.service.ts +++ b/client/src/app/site/motions/services/motion-filter-list.service.ts @@ -34,6 +34,11 @@ interface WorkflowFilterDesc { providedIn: 'root' }) export class MotionFilterListService extends BaseFilterListService { + /** + * set the storage key name + */ + protected storageKey = 'MotionList'; + /** * Listen to the configuration for change in defined/used workflows */ diff --git a/client/src/app/site/users/services/user-filter-list.service.ts b/client/src/app/site/users/services/user-filter-list.service.ts index 0309c31af..706f54e93 100644 --- a/client/src/app/site/users/services/user-filter-list.service.ts +++ b/client/src/app/site/users/services/user-filter-list.service.ts @@ -15,6 +15,11 @@ import { ViewUser } from '../models/view-user'; providedIn: 'root' }) export class UserFilterListService extends BaseFilterListService { + /** + * set the storage key name + */ + protected storageKey = 'UserList'; + private userGroupFilterOptions: OsFilter = { property: 'groups_id', label: 'Groups',