diff --git a/frontend/src/Search/Table/SearchIndexRow.js b/frontend/src/Search/Table/SearchIndexRow.js index a54876c8f..2645c02eb 100644 --- a/frontend/src/Search/Table/SearchIndexRow.js +++ b/frontend/src/Search/Table/SearchIndexRow.js @@ -71,6 +71,19 @@ class SearchIndexRow extends Component { }); }; + onSavePress = () => { + const { + downloadUrl, + fileName, + onSavePress + } = this.props; + + onSavePress({ + downloadUrl, + fileName + }); + }; + // // Render @@ -85,7 +98,6 @@ class SearchIndexRow extends Component { publishDate, title, infoUrl, - downloadUrl, indexer, size, files, @@ -300,7 +312,7 @@ class SearchIndexRow extends Component { className={styles.downloadLink} name={icons.SAVE} title={translate('Save')} - to={downloadUrl} + onPress={this.onSavePress} /> ); @@ -323,6 +335,7 @@ SearchIndexRow.propTypes = { ageMinutes: PropTypes.number.isRequired, publishDate: PropTypes.string.isRequired, title: PropTypes.string.isRequired, + fileName: PropTypes.string.isRequired, infoUrl: PropTypes.string.isRequired, downloadUrl: PropTypes.string.isRequired, indexerId: PropTypes.number.isRequired, @@ -335,6 +348,7 @@ SearchIndexRow.propTypes = { indexerFlags: PropTypes.arrayOf(PropTypes.string).isRequired, columns: PropTypes.arrayOf(PropTypes.object).isRequired, onGrabPress: PropTypes.func.isRequired, + onSavePress: PropTypes.func.isRequired, isGrabbing: PropTypes.bool.isRequired, isGrabbed: PropTypes.bool.isRequired, grabError: PropTypes.string, diff --git a/frontend/src/Search/Table/SearchIndexTable.js b/frontend/src/Search/Table/SearchIndexTable.js index 7f1f44118..844628062 100644 --- a/frontend/src/Search/Table/SearchIndexTable.js +++ b/frontend/src/Search/Table/SearchIndexTable.js @@ -51,7 +51,8 @@ class SearchIndexTable extends Component { timeFormat, selectedState, onSelectedChange, - onGrabPress + onGrabPress, + onSavePress } = this.props; const release = items[rowIndex]; @@ -71,6 +72,7 @@ class SearchIndexTable extends Component { longDateFormat={longDateFormat} timeFormat={timeFormat} onGrabPress={onGrabPress} + onSavePress={onSavePress} /> ); @@ -134,6 +136,7 @@ SearchIndexTable.propTypes = { timeFormat: PropTypes.string.isRequired, onSortPress: PropTypes.func.isRequired, onGrabPress: PropTypes.func.isRequired, + onSavePress: PropTypes.func.isRequired, allSelected: PropTypes.bool.isRequired, allUnselected: PropTypes.bool.isRequired, selectedState: PropTypes.object.isRequired, diff --git a/frontend/src/Search/Table/SearchIndexTableConnector.js b/frontend/src/Search/Table/SearchIndexTableConnector.js index e73b9ab9a..13ab84c7d 100644 --- a/frontend/src/Search/Table/SearchIndexTableConnector.js +++ b/frontend/src/Search/Table/SearchIndexTableConnector.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { grabRelease, setReleasesSort } from 'Store/Actions/releaseActions'; +import { grabRelease, saveRelease, setReleasesSort } from 'Store/Actions/releaseActions'; import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector'; import SearchIndexTable from './SearchIndexTable'; @@ -25,6 +25,9 @@ function createMapDispatchToProps(dispatch, props) { }, onGrabPress(payload) { dispatch(grabRelease(payload)); + }, + onSavePress(payload) { + dispatch(saveRelease(payload)); } }; } diff --git a/frontend/src/Settings/Notifications/Notifications/Notification.js b/frontend/src/Settings/Notifications/Notifications/Notification.js index e4a2847d9..1331a7c8b 100644 --- a/frontend/src/Settings/Notifications/Notifications/Notification.js +++ b/frontend/src/Settings/Notifications/Notifications/Notification.js @@ -56,17 +56,9 @@ class Notification extends Component { id, name, onGrab, - onDownload, - onUpgrade, - onRename, - onDelete, onHealthIssue, onApplicationUpdate, supportsOnGrab, - supportsOnDownload, - supportsOnUpgrade, - supportsOnRename, - supportsOnDelete, supportsOnHealthIssue, supportsOnApplicationUpdate } = this.props; @@ -88,34 +80,6 @@ class Notification extends Component { } - { - supportsOnDelete && onDelete && - - } - - { - supportsOnDownload && onDownload && - - } - - { - supportsOnUpgrade && onDownload && onUpgrade && - - } - - { - supportsOnRename && onRename && - - } - { supportsOnHealthIssue && onHealthIssue &&