#34: Allow cancelling/closing dependency installation if version count > 1
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
* \#33: Add 'Microsoft Visual C++ Redistributable' as dependency installation on Windows
|
||||
* \#32: Don't display network error message when check for UI updates fails
|
||||
* \#30: Add uninstall feature with reboot to handle WinFSP upgrades/downgrades
|
||||
* \#34: Allow cancelling/closing dependency installation if version count > 1
|
||||
|
||||
## 1.0.6
|
||||
* Additional Linux distribution support:
|
||||
|
||||
16
src/App.js
16
src/App.js
@@ -2,7 +2,6 @@ import React from 'react';
|
||||
import './App.css';
|
||||
import Box from './components/UI/Box/Box';
|
||||
import Configuration from './containers/Configuration/Configuration';
|
||||
import {checkVersionInstalled} from './redux/actions/install_actions';
|
||||
import {connect} from 'react-redux';
|
||||
import DependencyList from './components/DependencyList/DependencyList';
|
||||
import DownloadProgress from './components/DownloadProgress/DownloadProgress';
|
||||
@@ -45,7 +44,6 @@ class App extends IPCContainer {
|
||||
(prevProps.ReleaseVersion !== this.props.ReleaseVersion) ||
|
||||
(prevProps.VersionLookup !== this.props.VersionLookup)) {
|
||||
this.props.saveState();
|
||||
this.props.checkVersionInstalled();
|
||||
} else if (Object.keys(this.props.ProviderState).filter(k=> {
|
||||
return this.props.ProviderState[k] !== prevProps.ProviderState[k];
|
||||
}).length > 0) {
|
||||
@@ -78,8 +76,11 @@ class App extends IPCContainer {
|
||||
(selectedVersion !== 'unavailable') &&
|
||||
(selectedVersion !== this.props.InstalledVersion);
|
||||
|
||||
const missingDependencies = (this.props.MissingDependencies.length > 0);
|
||||
const allowMount = this.props.InstalledVersion !== 'none' &&
|
||||
const missingDependencies = (this.props.MissingDependencies.length > 0) &&
|
||||
this.props.AllowMount;
|
||||
|
||||
const allowMount = this.props.AllowMount &&
|
||||
this.props.InstalledVersion !== 'none' &&
|
||||
!missingDependencies &&
|
||||
!this.props.InstallActive;
|
||||
|
||||
@@ -108,7 +109,9 @@ class App extends IPCContainer {
|
||||
const showDependencies = !showUpgrade &&
|
||||
missingDependencies &&
|
||||
!this.props.DownloadActive &&
|
||||
!this.props.RebootRequired;
|
||||
!this.props.RebootRequired &&
|
||||
!this.props.DismissDependencies &&
|
||||
this.props.AllowMount;
|
||||
|
||||
const rebootDisplay = this.createModalConditionally(this.props.RebootRequired, <Reboot />);
|
||||
const configDisplay = this.createModalConditionally(showConfig, <Configuration version={selectedVersion} />);
|
||||
@@ -184,8 +187,10 @@ class App extends IPCContainer {
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
AllowDownload: state.download.AllowDownload,
|
||||
AllowMount: state.common.AllowMount,
|
||||
AppPlatform: state.common.AppPlatform,
|
||||
AppReady: state.common.AppReady,
|
||||
DismissDependencies: state.install.DismissDependencies,
|
||||
DisplayConfiguration: state.mounts.DisplayConfiguration,
|
||||
DisplayError: state.error.DisplayError,
|
||||
DownloadActive: state.download.DownloadActive,
|
||||
@@ -207,7 +212,6 @@ const mapStateToProps = state => {
|
||||
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
checkVersionInstalled: () => dispatch(checkVersionInstalled()),
|
||||
loadReleases: ()=> dispatch(loadReleases()),
|
||||
notifyError: (msg, critical, callback) => dispatch(notifyError(msg, critical, callback)),
|
||||
saveState: () => dispatch(saveState()),
|
||||
|
||||
@@ -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>
|
||||
));
|
||||
|
||||
@@ -5,6 +5,7 @@ import {getIPCRenderer} from '../../utils';
|
||||
const ipcRenderer = getIPCRenderer();
|
||||
|
||||
export const notifyRebootRequired = createAction('common/notifyRebootRequired');
|
||||
export const setAllowMount = createAction('common/setAllowMount');
|
||||
|
||||
export const rebootSystem = () => {
|
||||
return dispatch => {
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
setReleaseUpgradeAvailable
|
||||
} from './release_version_actions';
|
||||
import {
|
||||
setAllowMount,
|
||||
setApplicationReady,
|
||||
setRebootRequired,
|
||||
showWindow,
|
||||
@@ -43,6 +44,7 @@ export const checkInstalled = (dependencies, version) => {
|
||||
dispatch(setReleaseUpgradeAvailable(upgradeAvailable));
|
||||
dispatch(setMissingDependencies(result.Dependencies));
|
||||
dispatch(setAllowDownload(true));
|
||||
dispatch(setAllowMount(true));
|
||||
if (result.Dependencies && (result.Dependencies.length > 0)) {
|
||||
dispatch(showWindow());
|
||||
}
|
||||
@@ -189,6 +191,7 @@ export const installUpgrade = (source, sha256, signature, skipVerification) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const setDismissDependencies = createAction('install/setDismissDependencies');
|
||||
export const setInstallActive = createAction('install/setInstallActive');
|
||||
export const setInstallComplete = createAction('install/setInstallComplete');
|
||||
export const setMissingDependencies = createAction('install/setMissingDependencies');
|
||||
|
||||
@@ -4,9 +4,14 @@ import {createAction} from 'redux-starter-kit';
|
||||
import {notifyError} from './error_actions';
|
||||
import {
|
||||
saveState,
|
||||
setAllowMount,
|
||||
setApplicationReady,
|
||||
showWindow
|
||||
} from './common_actions';
|
||||
import {
|
||||
checkVersionInstalled,
|
||||
setDismissDependencies
|
||||
} from './install_actions';
|
||||
import {unmountAll} from './mount_actions';
|
||||
|
||||
export const CLEAR_UI_UPGRADE = 'relver/clearUIUpgrade';
|
||||
@@ -60,16 +65,20 @@ export const loadReleases = () => {
|
||||
|
||||
dispatch(setReleaseData(locationsLookup, versionLookup));
|
||||
|
||||
const dispatchActions = () => {
|
||||
const dispatchActions = (processAllowDismiss = true) => {
|
||||
dispatch(setReleaseUpgradeAvailable((version !== latestVersion)));
|
||||
dispatch(setApplicationReady(true));
|
||||
dispatch(detectUIUpgrade());
|
||||
if (processAllowDismiss) {
|
||||
dispatch(setAllowDismissDependencies(versionLookup[Constants.RELEASE_TYPES[release]].length > 1));
|
||||
}
|
||||
dispatch(checkVersionInstalled());
|
||||
};
|
||||
|
||||
if ((version !== state.Version) || (release !== state.Release)) {
|
||||
dispatch(unmountAll(() => {
|
||||
dispatch(setActiveRelease(release, version));
|
||||
dispatchActions();
|
||||
dispatchActions(false);
|
||||
dispatch(showWindow());
|
||||
dispatch(saveState());
|
||||
}));
|
||||
@@ -112,17 +121,33 @@ export const loadReleases = () => {
|
||||
};
|
||||
};
|
||||
|
||||
export const SET_ACTIVE_RELEASE = 'relver/setActiveRelease';
|
||||
export const setActiveRelease = (release, version) => {
|
||||
export const NOTIFY_ACTIVE_RELEASE = 'relver/notifyActiveRelease';
|
||||
export const notifyActiveRelease = (release, version) => {
|
||||
return {
|
||||
type: SET_ACTIVE_RELEASE,
|
||||
type: NOTIFY_ACTIVE_RELEASE,
|
||||
payload: {
|
||||
release,
|
||||
version
|
||||
release: release,
|
||||
version: version
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const setActiveRelease = (release, version) => {
|
||||
return (dispatch, getState) => {
|
||||
dispatch(setAllowMount(false));
|
||||
const relVer = getState().relver;
|
||||
const common = getState().common;
|
||||
const versions = relVer.VersionLookup[Constants.RELEASE_TYPES[release]];
|
||||
dispatch(setAllowDismissDependencies(versions.length > 1));
|
||||
dispatch(setDismissDependencies(false));
|
||||
dispatch(notifyActiveRelease(release, version));
|
||||
if (common.AppReady) {
|
||||
dispatch(checkVersionInstalled());
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const setAllowDismissDependencies = createAction('relver/setAllowDismissDependencies');
|
||||
export const setDismissUIUpgrade = createAction('relver/setDismissUIUpgrade');
|
||||
export const setInstalledVersion = createAction('relver/setInstalledVersion');
|
||||
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
import {createReducer} from 'redux-starter-kit';
|
||||
import {
|
||||
notifyRebootRequired,
|
||||
setAllowMount,
|
||||
setApplicationReady,
|
||||
} from '../actions/common_actions';
|
||||
|
||||
export const createCommonReducer = (platform, appPlatform, version) => {
|
||||
return createReducer({
|
||||
AllowMount: false,
|
||||
AppPlatform: appPlatform,
|
||||
AppReady: false,
|
||||
Platform: platform,
|
||||
RebootRequired: false,
|
||||
Version: version,
|
||||
}, {
|
||||
[setAllowMount]: (state, action) => {
|
||||
return {
|
||||
...state,
|
||||
AllowMount: action.payload,
|
||||
}
|
||||
},
|
||||
[setApplicationReady]: (state, action) => {
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -1,16 +1,24 @@
|
||||
import {createReducer} from 'redux-starter-kit';
|
||||
import {
|
||||
setDismissDependencies,
|
||||
setInstallActive,
|
||||
setInstallComplete,
|
||||
setMissingDependencies
|
||||
} from '../actions/install_actions';
|
||||
|
||||
export const installReducer = createReducer({
|
||||
DismissDependencies: false,
|
||||
InstallActive: false,
|
||||
InstallResult: null,
|
||||
InstallType: null,
|
||||
MissingDependencies: [],
|
||||
}, {
|
||||
[setDismissDependencies]: (state, action) => {
|
||||
return {
|
||||
...state,
|
||||
DismissDependencies: action.payload,
|
||||
}
|
||||
},
|
||||
[setInstallActive]: (state, action) => {
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -14,6 +14,7 @@ const versionLookup = Constants.RELEASE_TYPES.map(k=> {
|
||||
});
|
||||
|
||||
export const releaseVersionReducer = createReducer({
|
||||
AllowDismissDependencies: false,
|
||||
InstalledVersion: 'none',
|
||||
LocationsLookup: {},
|
||||
Release: 0,
|
||||
@@ -35,13 +36,19 @@ export const releaseVersionReducer = createReducer({
|
||||
UpgradeVersion: null,
|
||||
};
|
||||
},
|
||||
[Actions.SET_ACTIVE_RELEASE]: (state, action) => {
|
||||
[Actions.NOTIFY_ACTIVE_RELEASE]: (state, action) => {
|
||||
return {
|
||||
...state,
|
||||
Release: action.payload.release,
|
||||
Version: action.payload.version
|
||||
};
|
||||
},
|
||||
[Actions.setAllowDismissDependencies]: (state, action) => {
|
||||
return {
|
||||
...state,
|
||||
AllowDismissDependencies: action.payload,
|
||||
};
|
||||
},
|
||||
[Actions.setDismissUIUpgrade]: (state, action) => {
|
||||
return {
|
||||
...state,
|
||||
|
||||
Reference in New Issue
Block a user