Fixed: Column settings for series table

pull/1148/head
ta264 4 years ago
parent 6adadc0ade
commit 848b183ab8

@ -4,9 +4,9 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { createSelector } from 'reselect'; import { createSelector } from 'reselect';
import { setBooksTableOption, toggleBooksMonitored } from 'Store/Actions/bookActions'; import { toggleBooksMonitored } from 'Store/Actions/bookActions';
import { executeCommand } from 'Store/Actions/commandActions'; import { executeCommand } from 'Store/Actions/commandActions';
import { setSeriesSort } from 'Store/Actions/seriesActions'; import { setSeriesSort, setSeriesTableOption } from 'Store/Actions/seriesActions';
import createAuthorSelector from 'Store/Selectors/createAuthorSelector'; import createAuthorSelector from 'Store/Selectors/createAuthorSelector';
import createCommandsSelector from 'Store/Selectors/createCommandsSelector'; import createCommandsSelector from 'Store/Selectors/createCommandsSelector';
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector'; import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
@ -70,7 +70,7 @@ function createMapStateToProps() {
const mapDispatchToProps = { const mapDispatchToProps = {
toggleBooksMonitored, toggleBooksMonitored,
setBooksTableOption, setSeriesTableOption,
dispatchSetSeriesSort: setSeriesSort, dispatchSetSeriesSort: setSeriesSort,
executeCommand executeCommand
}; };
@ -81,7 +81,7 @@ class AuthorDetailsSeasonConnector extends Component {
// Listeners // Listeners
onTableOptionChange = (payload) => { onTableOptionChange = (payload) => {
this.props.setBooksTableOption(payload); this.props.setSeriesTableOption(payload);
} }
onSortPress = (sortKey) => { onSortPress = (sortKey) => {
@ -113,7 +113,7 @@ class AuthorDetailsSeasonConnector extends Component {
AuthorDetailsSeasonConnector.propTypes = { AuthorDetailsSeasonConnector.propTypes = {
authorId: PropTypes.number.isRequired, authorId: PropTypes.number.isRequired,
toggleBooksMonitored: PropTypes.func.isRequired, toggleBooksMonitored: PropTypes.func.isRequired,
setBooksTableOption: PropTypes.func.isRequired, setSeriesTableOption: PropTypes.func.isRequired,
dispatchSetSeriesSort: PropTypes.func.isRequired, dispatchSetSeriesSort: PropTypes.func.isRequired,
executeCommand: PropTypes.func.isRequired executeCommand: PropTypes.func.isRequired
}; };

@ -5,6 +5,7 @@ import createFetchHandler from './Creators/createFetchHandler';
import createHandleActions from './Creators/createHandleActions'; import createHandleActions from './Creators/createHandleActions';
import createSetClientSideCollectionSortReducer from './Creators/Reducers/createSetClientSideCollectionSortReducer'; import createSetClientSideCollectionSortReducer from './Creators/Reducers/createSetClientSideCollectionSortReducer';
import createSetSettingValueReducer from './Creators/Reducers/createSetSettingValueReducer'; import createSetSettingValueReducer from './Creators/Reducers/createSetSettingValueReducer';
import createSetTableOptionReducer from './Creators/Reducers/createSetTableOptionReducer';
// //
// Variables // Variables
@ -80,6 +81,7 @@ export const defaultState = {
export const FETCH_SERIES = 'series/fetchSeries'; export const FETCH_SERIES = 'series/fetchSeries';
export const SET_SERIES_SORT = 'books/setSeriesSort'; export const SET_SERIES_SORT = 'books/setSeriesSort';
export const SET_SERIES_TABLE_OPTION = 'books/setSeriesTableOption';
export const CLEAR_SERIES = 'series/clearSeries'; export const CLEAR_SERIES = 'series/clearSeries';
export const SET_SERIES_VALUE = 'books/setBookValue'; export const SET_SERIES_VALUE = 'books/setBookValue';
@ -88,6 +90,7 @@ export const SET_SERIES_VALUE = 'books/setBookValue';
export const fetchSeries = createThunk(FETCH_SERIES); export const fetchSeries = createThunk(FETCH_SERIES);
export const setSeriesSort = createAction(SET_SERIES_SORT); export const setSeriesSort = createAction(SET_SERIES_SORT);
export const setSeriesTableOption = createAction(SET_SERIES_TABLE_OPTION);
export const clearSeries = createAction(CLEAR_SERIES); export const clearSeries = createAction(CLEAR_SERIES);
// //
@ -104,6 +107,8 @@ export const reducers = createHandleActions({
[SET_SERIES_SORT]: createSetClientSideCollectionSortReducer(section), [SET_SERIES_SORT]: createSetClientSideCollectionSortReducer(section),
[SET_SERIES_TABLE_OPTION]: createSetTableOptionReducer(section),
[SET_SERIES_VALUE]: createSetSettingValueReducer(section), [SET_SERIES_VALUE]: createSetSettingValueReducer(section),
[CLEAR_SERIES]: (state) => { [CLEAR_SERIES]: (state) => {

Loading…
Cancel
Save