Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(app): Implement clearer robot server upgrade/downgrade information #2807

Merged
merged 2 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 0 additions & 163 deletions app/src/components/RobotSettings/RobotUpdateModal.js

This file was deleted.

12 changes: 0 additions & 12 deletions app/src/components/RobotSettings/UpdateAppMessage.js

This file was deleted.

1 change: 0 additions & 1 deletion app/src/components/RobotSettings/UpdateRobot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ function UpdateRobot (props: Props) {
return <RestartRobotModal robot={robot} />
}
if (updateRequest.inProgress) {
// TODO (ka 2018-11-27): Clarify update message with UX
return <SpinnerModal message="Robot is updating" alertOverlay />
} else {
return <UpdateRobotModal robot={robot} appUpdate={appUpdate} />
Expand Down
13 changes: 0 additions & 13 deletions app/src/components/RobotSettings/UpdateRobotMessage.js

This file was deleted.

3 changes: 1 addition & 2 deletions app/src/components/RobotSettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import ControlsCard from './ControlsCard'
import ConnectionCard from './ConnectionCard'
import AdvancedSettingsCard from './AdvancedSettingsCard'
import ConnectAlertModal from './ConnectAlertModal'
import RobotUpdateModal from './RobotUpdateModal'

import type {ViewableRobot} from '../../discovery'

Expand Down Expand Up @@ -44,4 +43,4 @@ export default function RobotSettings (props: Props) {
)
}

export {ConnectAlertModal, RobotUpdateModal}
export {ConnectAlertModal}
5 changes: 0 additions & 5 deletions app/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ export type Config = {
discovery: {
candidates: string | Array<string>,
},

// internal development flags
devInternal?: {
newUpdateModal?: boolean,
},
}

type UpdateConfigAction = {|
Expand Down
17 changes: 2 additions & 15 deletions app/src/pages/Robots/RobotSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// connect and configure robots page
import * as React from 'react'
import {connect} from 'react-redux'
import {getIn} from '@thi.ng/paths'
import {withRouter, Route, Switch, Redirect, type Match} from 'react-router'

import {getConfig} from '../../config'
import {selectors as robotSelectors, actions as robotActions} from '../../robot'
import {CONNECTABLE, REACHABLE} from '../../discovery'
import {
Expand All @@ -19,10 +17,7 @@ import {
import {SpinnerModalPage} from '@opentrons/components'
import {ErrorModal} from '../../components/modals'
import Page from '../../components/Page'
import RobotSettings, {
ConnectAlertModal,
RobotUpdateModal,
} from '../../components/RobotSettings'
import RobotSettings, {ConnectAlertModal} from '../../components/RobotSettings'
import UpdateRobot from '../../components/RobotSettings/UpdateRobot'
import CalibrateDeck from '../../components/CalibrateDeck'
import ConnectBanner from '../../components/RobotSettings/ConnectBanner'
Expand All @@ -44,7 +39,6 @@ type SP = {|
showConnectAlert: boolean,
homeInProgress: ?boolean,
homeError: ?Error,
__featureEnabled: boolean,
|}

type DP = {|dispatch: Dispatch|}
Expand All @@ -56,8 +50,6 @@ type Props = {
closeConnectAlert: () => mixed,
}

const __FEATURE_FLAG = 'devInternal.newUpdateModal'

export default withRouter(
connect(
makeMapStateToProps,
Expand Down Expand Up @@ -110,11 +102,7 @@ function RobotSettingsPage (props: Props) {
<Route
path={`${path}/${UPDATE_FRAGMENT}`}
render={() => {
if (props.__featureEnabled) {
return <UpdateRobot robot={robot} appUpdate={appUpdate} />
} else {
return <RobotUpdateModal robot={robot} />
}
return <UpdateRobot robot={robot} appUpdate={appUpdate} />
}}
/>

Expand Down Expand Up @@ -199,7 +187,6 @@ function makeMapStateToProps (): (state: State, ownProps: OP) => SP {
homeInProgress: homeRequest && homeRequest.inProgress,
homeError: homeRequest && homeRequest.error,
showConnectAlert: !connectRequest.inProgress && !!connectRequest.error,
__featureEnabled: !!getIn(getConfig(state), __FEATURE_FLAG),
}
}
}
Expand Down
8 changes: 1 addition & 7 deletions app/src/pages/Robots/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import * as React from 'react'
import {connect} from 'react-redux'
import {withRouter, Route, Switch, Redirect, type Match} from 'react-router'
import find from 'lodash/find'
import {getIn} from '@thi.ng/paths'

import {getConfig} from '../../config'
import createLogger from '../../logger'

import {
Expand All @@ -31,7 +29,6 @@ type SP = {
robot: ?ViewableRobot,
connectedName: ?string,
appUpdate: ShellUpdateState,
__featureEnabled: boolean,
}

type OP = {match: Match}
Expand All @@ -40,8 +37,6 @@ type Props = SP & OP

const log = createLogger(__filename)

const __FEATURE_FLAG = 'devInternal.newUpdateModal'

export default withRouter(
connect(
mapStateToProps,
Expand All @@ -61,7 +56,7 @@ function Robots (props: Props) {
},
} = props

if (appUpdate.available && !appUpdate.seen && props.__featureEnabled) {
if (appUpdate.available && !appUpdate.seen) {
log.warn('App update available on load, redirecting to app update.')
return <Redirect to={'menu/app/update'} />
}
Expand Down Expand Up @@ -117,6 +112,5 @@ function mapStateToProps (state: State, ownProps: OP): SP {
robot,
connectedName,
appUpdate: getShellUpdateState(state),
__featureEnabled: !!getIn(getConfig(state), __FEATURE_FLAG),
}
}