New: RSS Sync button on Calendar

This commit is contained in:
Mark McDowall 2020-03-18 18:32:43 -07:00 committed by Qstick
parent 22be6820f8
commit 0472b43a9c
2 changed files with 27 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import PageContentBody from 'Components/Page/PageContentBody';
import PageToolbar from 'Components/Page/Toolbar/PageToolbar';
import PageToolbarButton from 'Components/Page/Toolbar/PageToolbarButton';
import PageToolbarSection from 'Components/Page/Toolbar/PageToolbarSection';
import PageToolbarSeparator from 'Components/Page/Toolbar/PageToolbarSeparator';
import { align, icons } from 'Helpers/Props';
import getErrorMessage from 'Utilities/Object/getErrorMessage';
import CalendarConnector from './CalendarConnector';
@ -81,8 +82,10 @@ class CalendarPage extends Component {
artistIsFetching,
artistIsPopulated,
missingAlbumIds,
isRssSyncExecuting,
isSearchingForMissing,
useCurrentPage,
onRssSyncPress,
onFilterSelect
} = this.props;
@ -103,6 +106,15 @@ class CalendarPage extends Component {
onPress={this.onGetCalendarLinkPress}
/>
<PageToolbarSeparator />
<PageToolbarButton
label="RSS Sync"
iconName={icons.RSS}
isSpinning={isRssSyncExecuting}
onPress={onRssSyncPress}
/>
<PageToolbarButton
label="Search for Missing"
iconName={icons.SEARCH}
@ -196,10 +208,12 @@ CalendarPage.propTypes = {
artistIsFetching: PropTypes.bool.isRequired,
artistIsPopulated: PropTypes.bool.isRequired,
missingAlbumIds: PropTypes.arrayOf(PropTypes.number).isRequired,
isRssSyncExecuting: PropTypes.bool.isRequired,
isSearchingForMissing: PropTypes.bool.isRequired,
useCurrentPage: PropTypes.bool.isRequired,
onSearchMissingPress: PropTypes.func.isRequired,
onDaysCountChange: PropTypes.func.isRequired,
onRssSyncPress: PropTypes.func.isRequired,
onFilterSelect: PropTypes.func.isRequired
};

View File

@ -1,9 +1,12 @@
import moment from 'moment';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import * as commandNames from 'Commands/commandNames';
import withCurrentPage from 'Components/withCurrentPage';
import { searchMissing, setCalendarDaysCount, setCalendarFilter } from 'Store/Actions/calendarActions';
import { executeCommand } from 'Store/Actions/commandActions';
import createArtistCountSelector from 'Store/Selectors/createArtistCountSelector';
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
import createCommandsSelector from 'Store/Selectors/createCommandsSelector';
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
import { isCommandExecuting } from 'Utilities/Command';
@ -59,6 +62,7 @@ function createMapStateToProps() {
createArtistCountSelector(),
createUISettingsSelector(),
createMissingAlbumIdsSelector(),
createCommandExecutingSelector(commandNames.RSS_SYNC),
createIsSearchingSelector(),
(
selectedFilterKey,
@ -66,6 +70,7 @@ function createMapStateToProps() {
artistCount,
uiSettings,
missingAlbumIds,
isRssSyncExecuting,
isSearchingForMissing
) => {
return {
@ -77,6 +82,7 @@ function createMapStateToProps() {
artistIsFetching: artistCount.isFetching,
artistIsPopulated: artistCount.isPopulated,
missingAlbumIds,
isRssSyncExecuting,
isSearchingForMissing
};
}
@ -85,9 +91,16 @@ function createMapStateToProps() {
function createMapDispatchToProps(dispatch, props) {
return {
onRssSyncPress() {
dispatch(executeCommand({
name: commandNames.RSS_SYNC
}));
},
onSearchMissingPress(albumIds) {
dispatch(searchMissing({ albumIds }));
},
onDaysCountChange(dayCount) {
dispatch(setCalendarDaysCount({ dayCount }));
},