#38: Enhance new repertory release available notification
This commit is contained in:
@@ -7,16 +7,22 @@ import {
|
||||
notifyError,
|
||||
notifyInfo
|
||||
} from '../../../redux/actions/error_actions';
|
||||
import {installReleaseByVersion} from '../../../redux/actions/install_actions';
|
||||
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
installReleaseByVersion: (release, version) => dispatch(installReleaseByVersion(release, version)),
|
||||
notifyError: msg => dispatch(notifyError(msg)),
|
||||
notifyInfo: (title, msg) => dispatch(notifyInfo(title, msg)),
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(({release, lastItem, notifyError, notifyInfo}) => {
|
||||
export default connect(null, mapDispatchToProps)(({dismiss, release, lastItem, notifyError, notifyInfo, installReleaseByVersion}) => {
|
||||
const title = '[' + Constants.RELEASE_TYPES[release.Release] + '] ' + release.Display;
|
||||
const installReleaseVersion = () => {
|
||||
dismiss();
|
||||
installReleaseByVersion(release.Release, release.Version);
|
||||
};
|
||||
const displayChanges = async () => {
|
||||
try {
|
||||
const lines = await getChangesForRepertoryVersion(release.VersionString);
|
||||
@@ -40,7 +46,7 @@ export default connect(null, mapDispatchToProps)(({release, lastItem, notifyErro
|
||||
<div style={{width: 'var(--default_spacing)'}}/>
|
||||
</td>
|
||||
<td width="50%">
|
||||
<Button buttonStyles={{width: '100%'}}>Install</Button>
|
||||
<Button buttonStyles={{width: '100%'}} clicked={installReleaseVersion}>Install</Button>
|
||||
</td>
|
||||
</tr>
|
||||
{lastItem ? null : <tr style={{height: 'var(--default_spacing)'}}/>}
|
||||
|
||||
@@ -20,7 +20,8 @@ const mapDispatchToProps = dispatch => {
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(props => {
|
||||
const newReleases = props.NewReleasesAvailable.map((i, idx) => {
|
||||
return <NewRelease key={'new_release_' + i.Release + '_' + i.Version}
|
||||
return <NewRelease dismiss={props.dismissNewReleasesAvailable}
|
||||
key={'new_release_' + i.Release + '_' + i.Version}
|
||||
lastItem={idx === (props.NewReleasesAvailable.length - 1)}
|
||||
release={i} />;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user