New: RSS Sync button on Calendar

pull/1689/head
Mark McDowall 5 years ago committed by Qstick
parent 22be6820f8
commit 0472b43a9c

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

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

Loading…
Cancel
Save