#38: Enhance new repertory release available notification

This commit is contained in:
2020-02-21 15:35:16 -06:00
parent a70359d36b
commit 39409495c4
5 changed files with 57 additions and 11 deletions

View File

@@ -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)'}}/>}