File tree 2 files changed +7
-15
lines changed
2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change 1
- import { IFilterListenerParams , IFilterStorage , ISerializeOpts } from './i-filter-storage.js' ;
1
+ import { IFilterListenerParams , IFilterStorage } from './i-filter-storage.js' ;
2
2
import { IFilter } from './filters/i-filter.js' ;
3
3
import { filterFactory } from './filters/filter-factory.js' ;
4
4
import { ISerializedFilters } from './i-serialized-filters.js' ;
@@ -100,7 +100,7 @@ export class FilterStorage implements IFilterStorage {
100
100
this . setFiltersAndNotify ( storageKey , filters ) ;
101
101
}
102
102
103
- public serialize ( { includeStorageKey } : ISerializeOpts = { } ) : ISerializedFilters [ ] {
103
+ public serialize ( ) : ISerializedFilters [ ] {
104
104
// Include items that have active filters
105
105
// In case of Composite charts, include only the parent chart
106
106
return Array . from ( this . _listenerChains . values ( ) )
@@ -111,15 +111,11 @@ export class FilterStorage implements IFilterStorage {
111
111
if ( listener ) {
112
112
const filters = this . _filters . get ( listener . storageKey ) ;
113
113
if ( filters && filters . length > 0 ) {
114
- const entry = this . _serializeFilters (
115
- listener . dimId ,
116
- listener . dimLabel ,
117
- filters
114
+ return this . _serializeFilters (
115
+ listener . dimId ,
116
+ listener . dimLabel ,
117
+ filters
118
118
) ;
119
- if ( includeStorageKey ) {
120
- entry . storageKey = listener . storageKey ;
121
- }
122
- return entry ;
123
119
}
124
120
}
125
121
return undefined ;
Original file line number Diff line number Diff line change @@ -9,17 +9,13 @@ export interface IFilterListenerParams {
9
9
applyFilters : ( filters ) => void ;
10
10
}
11
11
12
- export interface ISerializeOpts {
13
- includeStorageKey ?: boolean ;
14
- }
15
-
16
12
export interface IFilterStorage {
17
13
setFiltersFor ( storageKey : any , filters ) ;
18
14
getFiltersFor ( storageKey : any ) ;
19
15
registerFilterListener ( opts : IFilterListenerParams ) : any ;
20
16
deRegisterFilterListener ( storageKey : any , listner : any ) : void ;
21
17
notifyListeners ( storageKey : any , filters ) : void ;
22
18
deRegisterAll ( ) : void ;
23
- serialize ( opts ?: ISerializeOpts ) : ISerializedFilters [ ] ;
19
+ serialize ( ) : ISerializedFilters [ ] ;
24
20
restore ( state : object ) : void ;
25
21
}
You can’t perform that action at this time.
0 commit comments