#34: Allow cancelling/closing dependency installation if version count > 1

This commit is contained in:
2019-08-14 15:13:01 -05:00
parent 76f2227855
commit 3788b9b7ec
10 changed files with 89 additions and 18 deletions

View File

@@ -5,6 +5,7 @@
* \#33: Add 'Microsoft Visual C++ Redistributable' as dependency installation on Windows * \#33: Add 'Microsoft Visual C++ Redistributable' as dependency installation on Windows
* \#32: Don't display network error message when check for UI updates fails * \#32: Don't display network error message when check for UI updates fails
* \#30: Add uninstall feature with reboot to handle WinFSP upgrades/downgrades * \#30: Add uninstall feature with reboot to handle WinFSP upgrades/downgrades
* \#34: Allow cancelling/closing dependency installation if version count > 1
## 1.0.6 ## 1.0.6
* Additional Linux distribution support: * Additional Linux distribution support:

View File

@@ -2,7 +2,6 @@ import React from 'react';
import './App.css'; import './App.css';
import Box from './components/UI/Box/Box'; import Box from './components/UI/Box/Box';
import Configuration from './containers/Configuration/Configuration'; import Configuration from './containers/Configuration/Configuration';
import {checkVersionInstalled} from './redux/actions/install_actions';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import DependencyList from './components/DependencyList/DependencyList'; import DependencyList from './components/DependencyList/DependencyList';
import DownloadProgress from './components/DownloadProgress/DownloadProgress'; import DownloadProgress from './components/DownloadProgress/DownloadProgress';
@@ -45,7 +44,6 @@ class App extends IPCContainer {
(prevProps.ReleaseVersion !== this.props.ReleaseVersion) || (prevProps.ReleaseVersion !== this.props.ReleaseVersion) ||
(prevProps.VersionLookup !== this.props.VersionLookup)) { (prevProps.VersionLookup !== this.props.VersionLookup)) {
this.props.saveState(); this.props.saveState();
this.props.checkVersionInstalled();
} else if (Object.keys(this.props.ProviderState).filter(k=> { } else if (Object.keys(this.props.ProviderState).filter(k=> {
return this.props.ProviderState[k] !== prevProps.ProviderState[k]; return this.props.ProviderState[k] !== prevProps.ProviderState[k];
}).length > 0) { }).length > 0) {
@@ -78,8 +76,11 @@ class App extends IPCContainer {
(selectedVersion !== 'unavailable') && (selectedVersion !== 'unavailable') &&
(selectedVersion !== this.props.InstalledVersion); (selectedVersion !== this.props.InstalledVersion);
const missingDependencies = (this.props.MissingDependencies.length > 0); const missingDependencies = (this.props.MissingDependencies.length > 0) &&
const allowMount = this.props.InstalledVersion !== 'none' && this.props.AllowMount;
const allowMount = this.props.AllowMount &&
this.props.InstalledVersion !== 'none' &&
!missingDependencies && !missingDependencies &&
!this.props.InstallActive; !this.props.InstallActive;
@@ -108,7 +109,9 @@ class App extends IPCContainer {
const showDependencies = !showUpgrade && const showDependencies = !showUpgrade &&
missingDependencies && missingDependencies &&
!this.props.DownloadActive && !this.props.DownloadActive &&
!this.props.RebootRequired; !this.props.RebootRequired &&
!this.props.DismissDependencies &&
this.props.AllowMount;
const rebootDisplay = this.createModalConditionally(this.props.RebootRequired, <Reboot />); const rebootDisplay = this.createModalConditionally(this.props.RebootRequired, <Reboot />);
const configDisplay = this.createModalConditionally(showConfig, <Configuration version={selectedVersion} />); const configDisplay = this.createModalConditionally(showConfig, <Configuration version={selectedVersion} />);
@@ -184,8 +187,10 @@ class App extends IPCContainer {
const mapStateToProps = state => { const mapStateToProps = state => {
return { return {
AllowDownload: state.download.AllowDownload, AllowDownload: state.download.AllowDownload,
AllowMount: state.common.AllowMount,
AppPlatform: state.common.AppPlatform, AppPlatform: state.common.AppPlatform,
AppReady: state.common.AppReady, AppReady: state.common.AppReady,
DismissDependencies: state.install.DismissDependencies,
DisplayConfiguration: state.mounts.DisplayConfiguration, DisplayConfiguration: state.mounts.DisplayConfiguration,
DisplayError: state.error.DisplayError, DisplayError: state.error.DisplayError,
DownloadActive: state.download.DownloadActive, DownloadActive: state.download.DownloadActive,
@@ -207,7 +212,6 @@ const mapStateToProps = state => {
const mapDispatchToProps = dispatch => { const mapDispatchToProps = dispatch => {
return { return {
checkVersionInstalled: () => dispatch(checkVersionInstalled()),
loadReleases: ()=> dispatch(loadReleases()), loadReleases: ()=> dispatch(loadReleases()),
notifyError: (msg, critical, callback) => dispatch(notifyError(msg, critical, callback)), notifyError: (msg, critical, callback) => dispatch(notifyError(msg, critical, callback)),
saveState: () => dispatch(saveState()), saveState: () => dispatch(saveState()),

View File

@@ -6,16 +6,19 @@ import Dependency from './Dependency/Dependency';
import Box from '../UI/Box/Box'; import Box from '../UI/Box/Box';
import {downloadItem} from '../../redux/actions/download_actions'; import {downloadItem} from '../../redux/actions/download_actions';
import {extractFileNameFromURL} from '../../utils'; import {extractFileNameFromURL} from '../../utils';
import {setDismissDependencies} from '../../redux/actions/install_actions';
const mapStateToProps = state => { const mapStateToProps = state => {
return { return {
AllowDismissDependencies: state.relver.AllowDismissDependencies,
MissingDependencies: state.install.MissingDependencies, MissingDependencies: state.install.MissingDependencies,
}; };
}; };
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { 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 ( return (
<Box dxStyle={{width: '300px', height: 'auto', padding: '5px'}}> <Box dxStyle={{width: '300px', height: 'auto', padding: '5px'}}>
{dismissDisplay}
<div style={{width: '100%', height: 'auto', paddingBottom: '5px', boxSizing: 'border-box'}}> <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> <h1 style={{width: '100%', textAlign: 'center', color: 'var(--text_color_error)'}}>Missing Dependencies</h1>
</div> </div>

View File

@@ -7,12 +7,13 @@ import Grid from '../UI/Grid/Grid';
import Text from '../UI/Text/Text'; import Text from '../UI/Text/Text';
import Button from '../UI/Button/Button'; import Button from '../UI/Button/Button';
import UpgradeIcon from '../UpgradeIcon/UpgradeIcon'; 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'; import {downloadItem} from '../../redux/actions/download_actions';
const mapStateToProps = state => { const mapStateToProps = state => {
return { return {
AppPlatform: state.common.AppPlatform, AppPlatform: state.common.AppPlatform,
DismissDependencies: state.install.DismissDependencies,
DownloadActive: state.download.DownloadActive, DownloadActive: state.download.DownloadActive,
InstallActive: state.install.InstallActive, InstallActive: state.install.InstallActive,
InstallType: state.install.InstallType, InstallType: state.install.InstallType,
@@ -74,7 +75,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
text={text} text={text}
textAlign={'left'}/> textAlign={'left'}/>
)); ));
} else if (props.downloadDisabled) { } else if (props.downloadDisabled || props.DismissDependencies) {
optionsDisplay.push(( optionsDisplay.push((
<Text col={dimensions => (dimensions.columns / 3) * 2} <Text col={dimensions => (dimensions.columns / 3) * 2}
colSpan={'remain'} colSpan={'remain'}
@@ -100,7 +101,6 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
col={dimensions => (dimensions.columns / 3) * 2} col={dimensions => (dimensions.columns / 3) * 2}
colSpan={20} colSpan={20}
key={key++} key={key++}
disabled={props.downloadDisabled}
row={5} row={5}
rowSpan={7}>Install</Button> rowSpan={7}>Install</Button>
)); ));

View File

@@ -5,6 +5,7 @@ import {getIPCRenderer} from '../../utils';
const ipcRenderer = getIPCRenderer(); const ipcRenderer = getIPCRenderer();
export const notifyRebootRequired = createAction('common/notifyRebootRequired'); export const notifyRebootRequired = createAction('common/notifyRebootRequired');
export const setAllowMount = createAction('common/setAllowMount');
export const rebootSystem = () => { export const rebootSystem = () => {
return dispatch => { return dispatch => {

View File

@@ -12,6 +12,7 @@ import {
setReleaseUpgradeAvailable setReleaseUpgradeAvailable
} from './release_version_actions'; } from './release_version_actions';
import { import {
setAllowMount,
setApplicationReady, setApplicationReady,
setRebootRequired, setRebootRequired,
showWindow, showWindow,
@@ -43,6 +44,7 @@ export const checkInstalled = (dependencies, version) => {
dispatch(setReleaseUpgradeAvailable(upgradeAvailable)); dispatch(setReleaseUpgradeAvailable(upgradeAvailable));
dispatch(setMissingDependencies(result.Dependencies)); dispatch(setMissingDependencies(result.Dependencies));
dispatch(setAllowDownload(true)); dispatch(setAllowDownload(true));
dispatch(setAllowMount(true));
if (result.Dependencies && (result.Dependencies.length > 0)) { if (result.Dependencies && (result.Dependencies.length > 0)) {
dispatch(showWindow()); 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 setInstallActive = createAction('install/setInstallActive');
export const setInstallComplete = createAction('install/setInstallComplete'); export const setInstallComplete = createAction('install/setInstallComplete');
export const setMissingDependencies = createAction('install/setMissingDependencies'); export const setMissingDependencies = createAction('install/setMissingDependencies');

View File

@@ -4,9 +4,14 @@ import {createAction} from 'redux-starter-kit';
import {notifyError} from './error_actions'; import {notifyError} from './error_actions';
import { import {
saveState, saveState,
setAllowMount,
setApplicationReady, setApplicationReady,
showWindow showWindow
} from './common_actions'; } from './common_actions';
import {
checkVersionInstalled,
setDismissDependencies
} from './install_actions';
import {unmountAll} from './mount_actions'; import {unmountAll} from './mount_actions';
export const CLEAR_UI_UPGRADE = 'relver/clearUIUpgrade'; export const CLEAR_UI_UPGRADE = 'relver/clearUIUpgrade';
@@ -60,16 +65,20 @@ export const loadReleases = () => {
dispatch(setReleaseData(locationsLookup, versionLookup)); dispatch(setReleaseData(locationsLookup, versionLookup));
const dispatchActions = () => { const dispatchActions = (processAllowDismiss = true) => {
dispatch(setReleaseUpgradeAvailable((version !== latestVersion))); dispatch(setReleaseUpgradeAvailable((version !== latestVersion)));
dispatch(setApplicationReady(true)); dispatch(setApplicationReady(true));
dispatch(detectUIUpgrade()); dispatch(detectUIUpgrade());
if (processAllowDismiss) {
dispatch(setAllowDismissDependencies(versionLookup[Constants.RELEASE_TYPES[release]].length > 1));
}
dispatch(checkVersionInstalled());
}; };
if ((version !== state.Version) || (release !== state.Release)) { if ((version !== state.Version) || (release !== state.Release)) {
dispatch(unmountAll(() => { dispatch(unmountAll(() => {
dispatch(setActiveRelease(release, version)); dispatch(setActiveRelease(release, version));
dispatchActions(); dispatchActions(false);
dispatch(showWindow()); dispatch(showWindow());
dispatch(saveState()); dispatch(saveState());
})); }));
@@ -112,17 +121,33 @@ export const loadReleases = () => {
}; };
}; };
export const SET_ACTIVE_RELEASE = 'relver/setActiveRelease'; export const NOTIFY_ACTIVE_RELEASE = 'relver/notifyActiveRelease';
export const setActiveRelease = (release, version) => { export const notifyActiveRelease = (release, version) => {
return { return {
type: SET_ACTIVE_RELEASE, type: NOTIFY_ACTIVE_RELEASE,
payload: { payload: {
release, release: release,
version 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 setDismissUIUpgrade = createAction('relver/setDismissUIUpgrade');
export const setInstalledVersion = createAction('relver/setInstalledVersion'); export const setInstalledVersion = createAction('relver/setInstalledVersion');

View File

@@ -1,17 +1,25 @@
import {createReducer} from 'redux-starter-kit'; import {createReducer} from 'redux-starter-kit';
import { import {
notifyRebootRequired, notifyRebootRequired,
setAllowMount,
setApplicationReady, setApplicationReady,
} from '../actions/common_actions'; } from '../actions/common_actions';
export const createCommonReducer = (platform, appPlatform, version) => { export const createCommonReducer = (platform, appPlatform, version) => {
return createReducer({ return createReducer({
AllowMount: false,
AppPlatform: appPlatform, AppPlatform: appPlatform,
AppReady: false, AppReady: false,
Platform: platform, Platform: platform,
RebootRequired: false, RebootRequired: false,
Version: version, Version: version,
}, { }, {
[setAllowMount]: (state, action) => {
return {
...state,
AllowMount: action.payload,
}
},
[setApplicationReady]: (state, action) => { [setApplicationReady]: (state, action) => {
return { return {
...state, ...state,

View File

@@ -1,16 +1,24 @@
import {createReducer} from 'redux-starter-kit'; import {createReducer} from 'redux-starter-kit';
import { import {
setDismissDependencies,
setInstallActive, setInstallActive,
setInstallComplete, setInstallComplete,
setMissingDependencies setMissingDependencies
} from '../actions/install_actions'; } from '../actions/install_actions';
export const installReducer = createReducer({ export const installReducer = createReducer({
DismissDependencies: false,
InstallActive: false, InstallActive: false,
InstallResult: null, InstallResult: null,
InstallType: null, InstallType: null,
MissingDependencies: [], MissingDependencies: [],
}, { }, {
[setDismissDependencies]: (state, action) => {
return {
...state,
DismissDependencies: action.payload,
}
},
[setInstallActive]: (state, action) => { [setInstallActive]: (state, action) => {
return { return {
...state, ...state,

View File

@@ -14,6 +14,7 @@ const versionLookup = Constants.RELEASE_TYPES.map(k=> {
}); });
export const releaseVersionReducer = createReducer({ export const releaseVersionReducer = createReducer({
AllowDismissDependencies: false,
InstalledVersion: 'none', InstalledVersion: 'none',
LocationsLookup: {}, LocationsLookup: {},
Release: 0, Release: 0,
@@ -35,13 +36,19 @@ export const releaseVersionReducer = createReducer({
UpgradeVersion: null, UpgradeVersion: null,
}; };
}, },
[Actions.SET_ACTIVE_RELEASE]: (state, action) => { [Actions.NOTIFY_ACTIVE_RELEASE]: (state, action) => {
return { return {
...state, ...state,
Release: action.payload.release, Release: action.payload.release,
Version: action.payload.version Version: action.payload.version
}; };
}, },
[Actions.setAllowDismissDependencies]: (state, action) => {
return {
...state,
AllowDismissDependencies: action.payload,
};
},
[Actions.setDismissUIUpgrade]: (state, action) => { [Actions.setDismissUIUpgrade]: (state, action) => {
return { return {
...state, ...state,