Skip to content

Commit

Permalink
feat(app): Implement clearer robot server upgrade/downgrade informati…
Browse files Browse the repository at this point in the history
…on (#2807)

closes #2401
  • Loading branch information
Kadee80 authored Dec 12, 2018
1 parent f854953 commit d37e3aa
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 218 deletions.
2 changes: 2 additions & 0 deletions app/src/components/ReleaseNotes/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,7 @@

& p {
@apply --font-body-2-dark;

margin-bottom: 1rem;
}
}
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),
}
}

0 comments on commit d37e3aa

Please sign in to comment.