Skip to content

Commit

Permalink
issue #138 Merge "alwaysOnFilters" with the "defaultSearchParams.alwa…
Browse files Browse the repository at this point in the history
…ysOnFilter"
  • Loading branch information
wajda committed Sep 23, 2021
1 parent 33db697 commit 8b72362
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import SearchParams = SearchQuery.SearchParams;

export type SearchDataSourceConfig<TFilter extends SplineRecord = {}, TSortableFields = string> = {
defaultSearchParams: Partial<SearchParams<TFilter, TSortableFields>>
alwaysOnFilters: TFilter
}

export abstract class SearchDataSource<TDataRecord = unknown,
Expand Down Expand Up @@ -73,10 +72,6 @@ export abstract class SearchDataSource<TDataRecord = unknown,
const defaultSearchParams = {
...DEFAULT_SEARCH_PARAMS,
...config.defaultSearchParams,
alwaysOnFilter: {
...DEFAULT_SEARCH_PARAMS.alwaysOnFilter,
...config.alwaysOnFilters
}
}
this._defaultSearchParams = defaultSearchParams
this._searchParams$ = new BehaviorSubject(defaultSearchParams)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ import { DsOverviewHistoryPage } from './ds-overview-history.page.models'
withLatestFrom(store.dataSourceInfo$),
filter(([isInitialized, dataSourceInfo]) => isInitialized && !!dataSourceInfo),
map(([, dataSourceInfo]) => ({
alwaysOnFilters: {
dataSourceUri: dataSourceInfo.uri
defaultSearchParams: {
alwaysOnFilter: {
dataSourceUri: dataSourceInfo.uri
}
}
})))

Expand Down

0 comments on commit 8b72362

Please sign in to comment.