Fix remaining dropdown's

This commit is contained in:
2019-10-23 15:52:38 -05:00
parent 16622ba3e8
commit a8d9639ad7
2 changed files with 14 additions and 9 deletions

View File

@@ -41,13 +41,14 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
};
const handleReleaseChanged = e => {
const release = parseInt(e.target.value, 10);
const release = Constants.RELEASE_TYPES.indexOf(e.target.value);
const releaseVersion = props.VersionLookup[Constants.RELEASE_TYPES[release]].length - 1;
props.setActiveRelease(release, releaseVersion);
};
const handleVersionChanged = e => {
props.setActiveRelease(props.Release, parseInt(e.target.value, 10));
const releaseVersion = props.VersionLookup[Constants.RELEASE_TYPES[props.Release]].indexOf(e.target.value);
props.setActiveRelease(props.Release, releaseVersion);
};
const text = props.InstalledVersion + ' [' + props.AppPlatform + ']';
@@ -119,7 +120,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
items={Constants.RELEASE_TYPES}
row={5}
rowSpan={7}
selected={props.Release}/>
selected={Constants.RELEASE_TYPES[props.Release]}/>
<Text col={dimensions => dimensions.columns / 3}
colSpan={remain=>remain / 2}
rowSpan={4}
@@ -138,7 +139,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
items={props.VersionLookup[Constants.RELEASE_TYPES[props.Release]]}
row={5}
rowSpan={7}
selected={props.ReleaseVersion}/>
selected={props.VersionLookup[Constants.RELEASE_TYPES[props.Release]][props.ReleaseVersion]}/>
{optionsDisplay}
</Grid>
);

View File

@@ -48,6 +48,13 @@ class SelectAppPlatform extends IPCContainer {
this.grabLatestRelease(Constants.LINUX_SELECTABLE_PLATFORMS[this.state.Selected])
};
handleChanged = e => {
this.setState({
...this.state,
Selected: Constants.LINUX_SELECTABLE_PLATFORMS.indexOf(e.target.value),
});
};
render() {
return (
<Box dxDark dxStyle={{padding: 'var(--default_spacing)'}}>
@@ -56,13 +63,10 @@ class SelectAppPlatform extends IPCContainer {
<p>Repertory was unable to detect your Linux distribution. Please select one of the following and click <b>Test</b> to continue:</p>
</div>
<div className={'SAPActions'}>
<DropDown changed={e => this.setState({
...this.state,
Selected: e.target.value
})}
<DropDown changed={this.handleChanged}
disabled={this.props.InstallTestActive}
items={Constants.LINUX_SELECTABLE_PLATFORMS}
selected={this.state.Selected}/>
selected={Constants.LINUX_SELECTABLE_PLATFORMS[this.state.Selected]}/>
<Button clicked={this.handleTestClicked}
disabled={this.props.InstallTestActive}>Test</Button>
</div>