From 2b6311032300950c9ff779147bd6be9f5a8dc71c Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 5 Apr 2019 20:17:24 -0700 Subject: [PATCH] Series index selector improvements --- .../Index/Overview/SeriesIndexOverviewsConnector.js | 7 ++----- .../Index/Posters/SeriesIndexPostersConnector.js | 7 ++----- frontend/src/Series/Index/SeriesIndex.js | 4 ++++ .../Series/Index/Table/SeriesIndexTableConnector.js | 10 +++++----- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/frontend/src/Series/Index/Overview/SeriesIndexOverviewsConnector.js b/frontend/src/Series/Index/Overview/SeriesIndexOverviewsConnector.js index cf7025984..b8ce5c74e 100644 --- a/frontend/src/Series/Index/Overview/SeriesIndexOverviewsConnector.js +++ b/frontend/src/Series/Index/Overview/SeriesIndexOverviewsConnector.js @@ -1,6 +1,5 @@ import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector'; import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector'; import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector'; import SeriesIndexOverviews from './SeriesIndexOverviews'; @@ -8,18 +7,16 @@ import SeriesIndexOverviews from './SeriesIndexOverviews'; function createMapStateToProps() { return createSelector( (state) => state.seriesIndex.overviewOptions, - createClientSideCollectionSelector('series', 'seriesIndex'), createUISettingsSelector(), createDimensionsSelector(), - (overviewOptions, series, uiSettings, dimensions) => { + (overviewOptions, uiSettings, dimensions) => { return { overviewOptions, showRelativeDates: uiSettings.showRelativeDates, shortDateFormat: uiSettings.shortDateFormat, longDateFormat: uiSettings.longDateFormat, timeFormat: uiSettings.timeFormat, - isSmallScreen: dimensions.isSmallScreen, - ...series + isSmallScreen: dimensions.isSmallScreen }; } ); diff --git a/frontend/src/Series/Index/Posters/SeriesIndexPostersConnector.js b/frontend/src/Series/Index/Posters/SeriesIndexPostersConnector.js index 0d74d3256..9b9dd03f0 100644 --- a/frontend/src/Series/Index/Posters/SeriesIndexPostersConnector.js +++ b/frontend/src/Series/Index/Posters/SeriesIndexPostersConnector.js @@ -1,6 +1,5 @@ import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector'; import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector'; import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector'; import SeriesIndexPosters from './SeriesIndexPosters'; @@ -8,17 +7,15 @@ import SeriesIndexPosters from './SeriesIndexPosters'; function createMapStateToProps() { return createSelector( (state) => state.seriesIndex.posterOptions, - createClientSideCollectionSelector('series', 'seriesIndex'), createUISettingsSelector(), createDimensionsSelector(), - (posterOptions, series, uiSettings, dimensions) => { + (posterOptions, uiSettings, dimensions) => { return { posterOptions, showRelativeDates: uiSettings.showRelativeDates, shortDateFormat: uiSettings.shortDateFormat, timeFormat: uiSettings.timeFormat, - isSmallScreen: dimensions.isSmallScreen, - ...series + isSmallScreen: dimensions.isSmallScreen }; } ); diff --git a/frontend/src/Series/Index/SeriesIndex.js b/frontend/src/Series/Index/SeriesIndex.js index 105e6cb88..f8d50a37a 100644 --- a/frontend/src/Series/Index/SeriesIndex.js +++ b/frontend/src/Series/Index/SeriesIndex.js @@ -320,6 +320,10 @@ class SeriesIndex extends Component {
state.app.dimensions, - createClientSideCollectionSelector('series', 'seriesIndex'), - (dimensions, series) => { + (state) => state.seriesIndex.tableOptions, + (state) => state.seriesIndex.columns, + (dimensions, tableOptions, columns) => { return { isSmallScreen: dimensions.isSmallScreen, - ...series, - showBanners: series.tableOptions.showBanners + showBanners: tableOptions.showBanners, + columns }; } );