#34: Allow cancelling/closing dependency installation if version count > 1
This commit is contained in:
@@ -6,16 +6,19 @@ import Dependency from './Dependency/Dependency';
|
||||
import Box from '../UI/Box/Box';
|
||||
import {downloadItem} from '../../redux/actions/download_actions';
|
||||
import {extractFileNameFromURL} from '../../utils';
|
||||
import {setDismissDependencies} from '../../redux/actions/install_actions';
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
AllowDismissDependencies: state.relver.AllowDismissDependencies,
|
||||
MissingDependencies: state.install.MissingDependencies,
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
downloadItem: (name, type, url, isWinFSP) => dispatch(downloadItem(name, type, url, isWinFSP))
|
||||
downloadItem: (name, type, url, isWinFSP) => dispatch(downloadItem(name, type, url, isWinFSP)),
|
||||
setDismissDependencies: dismiss => dispatch(setDismissDependencies(dismiss)),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -28,8 +31,19 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
|
||||
);
|
||||
});
|
||||
|
||||
let dismissDisplay;
|
||||
if (props.AllowDismissDependencies) {
|
||||
dismissDisplay = (
|
||||
<div style={{float: 'right', margin: 0, paddingRight: '4px', boxSizing: 'border-box', display: 'block'}}>
|
||||
<b style={{cursor: 'pointer'}}
|
||||
onClick={()=>props.setDismissDependencies(true)}>X
|
||||
</b>
|
||||
</div>);
|
||||
}
|
||||
|
||||
return (
|
||||
<Box dxStyle={{width: '300px', height: 'auto', padding: '5px'}}>
|
||||
{dismissDisplay}
|
||||
<div style={{width: '100%', height: 'auto', paddingBottom: '5px', boxSizing: 'border-box'}}>
|
||||
<h1 style={{width: '100%', textAlign: 'center', color: 'var(--text_color_error)'}}>Missing Dependencies</h1>
|
||||
</div>
|
||||
|
||||
@@ -7,12 +7,13 @@ import Grid from '../UI/Grid/Grid';
|
||||
import Text from '../UI/Text/Text';
|
||||
import Button from '../UI/Button/Button';
|
||||
import UpgradeIcon from '../UpgradeIcon/UpgradeIcon';
|
||||
import {setActiveRelease} from "../../redux/actions/release_version_actions";
|
||||
import {setActiveRelease} from '../../redux/actions/release_version_actions';
|
||||
import {downloadItem} from '../../redux/actions/download_actions';
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
AppPlatform: state.common.AppPlatform,
|
||||
DismissDependencies: state.install.DismissDependencies,
|
||||
DownloadActive: state.download.DownloadActive,
|
||||
InstallActive: state.install.InstallActive,
|
||||
InstallType: state.install.InstallType,
|
||||
@@ -74,7 +75,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
|
||||
text={text}
|
||||
textAlign={'left'}/>
|
||||
));
|
||||
} else if (props.downloadDisabled) {
|
||||
} else if (props.downloadDisabled || props.DismissDependencies) {
|
||||
optionsDisplay.push((
|
||||
<Text col={dimensions => (dimensions.columns / 3) * 2}
|
||||
colSpan={'remain'}
|
||||
@@ -100,7 +101,6 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
|
||||
col={dimensions => (dimensions.columns / 3) * 2}
|
||||
colSpan={20}
|
||||
key={key++}
|
||||
disabled={props.downloadDisabled}
|
||||
row={5}
|
||||
rowSpan={7}>Install</Button>
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user