diff --git a/app/src/components/ReleaseNotes/styles.css b/app/src/components/ReleaseNotes/styles.css index b6b8f0ba26c..ee7da8ef110 100644 --- a/app/src/components/ReleaseNotes/styles.css +++ b/app/src/components/ReleaseNotes/styles.css @@ -56,5 +56,7 @@ & p { @apply --font-body-2-dark; + + margin-bottom: 1rem; } } diff --git a/app/src/components/RobotSettings/RobotUpdateModal.js b/app/src/components/RobotSettings/RobotUpdateModal.js deleted file mode 100644 index 32d7c6a1c74..00000000000 --- a/app/src/components/RobotSettings/RobotUpdateModal.js +++ /dev/null @@ -1,163 +0,0 @@ -// @flow -import * as React from 'react' -import {connect} from 'react-redux' -import {push} from 'react-router-redux' - -import { - updateRobotServer, - restartRobotServer, - clearUpdateResponse, - makeGetRobotUpdateInfo, - makeGetRobotUpdateRequest, - makeGetRobotRestartRequest, - setIgnoredUpdate, -} from '../../http-api-client' - -import {CURRENT_RELEASE_NOTES, getShellUpdateState} from '../../shell' - -import type {ShellUpdateState} from '../../shell' - -import {Icon} from '@opentrons/components' -import {ScrollableAlertModal} from '../modals' -import UpdateAppMessage from './UpdateAppMessage' -import UpdateRobotMessage from './UpdateRobotMessage' -import ReleaseNotes from '../ReleaseNotes' - -import type {State, Dispatch} from '../../types' -import type {ViewableRobot} from '../../discovery' -import type { - RobotServerUpdate, - RobotServerRestart, - RobotUpdateInfo, -} from '../../http-api-client' - -type OP = {robot: ViewableRobot} - -type SP = {| - appUpdate: ShellUpdateState, - updateInfo: RobotUpdateInfo, - updateRequest: RobotServerUpdate, - restartRequest: RobotServerRestart, -|} - -type DP = {dispatch: Dispatch} - -type Props = { - ...$Exact, - ...SP, - update: () => mixed, - restart: () => mixed, - ignoreUpdate: () => mixed, -} - -const API_RELEASE_NOTES = CURRENT_RELEASE_NOTES.replace( - /([\S\s]*?)/, - '' -) - -const DOWNGRADE_MSG = - 'Your app is at an older version than your robot. You may want to downgrade your robot to ensure compatability.' -const UPGRADE_MSG = - 'Your robot is at an older version than your app. We recommend you upgrade your robot to ensure compatability.' -const ALREADY_UPDATED_MSG = - "It looks like your robot is already up to date, but if you're experiencing issues you can re-apply the latest update." -const RESTART_MSG = - 'Restart your robot to finish the update. It may take several minutes for your robot to restart.' - -// TODO(mc, 2018-03-19): prop or component for text-height icons -const Spinner = () => - -export default connect( - makeMapStateToProps, - null, - mergeProps -)(RobotUpdateModal) - -function RobotUpdateModal (props: Props) { - const { - updateInfo, - ignoreUpdate, - update, - restart, - updateRequest, - restartRequest, - appUpdate: {available}, - } = props - const inProgress = updateRequest.inProgress || restartRequest.inProgress - let closeButtonText = 'not now' - let message - let button - - const heading = updateInfo.type - ? `Version ${updateInfo.version} available` - : 'Robot is up to date' - - let buttonAction - let buttonText - if (!updateRequest.response) { - buttonAction = update - if (updateInfo.type) { - message = updateInfo.type === 'upgrade' ? UPGRADE_MSG : DOWNGRADE_MSG - buttonText = updateInfo.type - } else { - message = ALREADY_UPDATED_MSG - buttonText = 'reinstall' - } - } else { - message = RESTART_MSG - buttonText = 'restart' - buttonAction = restart - } - - button = inProgress - ? {disabled: true, children: } - : {onClick: buttonAction, children: buttonText} - - return ( - - {available && } - - - - ) -} - -function makeMapStateToProps (): (State, OP) => SP { - const getRobotUpdateInfo = makeGetRobotUpdateInfo() - const getRobotUpdateRequest = makeGetRobotUpdateRequest() - const getRobotRestartRequest = makeGetRobotRestartRequest() - - return (state, ownProps) => ({ - appUpdate: getShellUpdateState(state), - updateInfo: getRobotUpdateInfo(state, ownProps.robot), - updateRequest: getRobotUpdateRequest(state, ownProps.robot), - restartRequest: getRobotRestartRequest(state, ownProps.robot), - }) -} - -function mergeProps (stateProps: SP, dispatchProps: DP, ownProps: OP): Props { - const {robot} = ownProps - const {updateInfo} = stateProps - const {dispatch} = dispatchProps - - const close = () => dispatch(push(`/robots/${robot.name}`)) - let ignoreUpdate = updateInfo.type - ? () => dispatch(setIgnoredUpdate(robot, updateInfo.version)).then(close) - : close - - return { - ...stateProps, - ...ownProps, - ignoreUpdate, - update: () => dispatch(updateRobotServer(robot)), - restart: () => { - dispatch(restartRobotServer(robot)) - .then(() => dispatch(clearUpdateResponse(robot))) - .then(close) - }, - } -} diff --git a/app/src/components/RobotSettings/UpdateAppMessage.js b/app/src/components/RobotSettings/UpdateAppMessage.js deleted file mode 100644 index f0fa3d114fa..00000000000 --- a/app/src/components/RobotSettings/UpdateAppMessage.js +++ /dev/null @@ -1,12 +0,0 @@ -// @flow -import * as React from 'react' -import {Link} from 'react-router-dom' -import styles from './styles.css' - -export default function UpdateAppMessage () { - return ( -

- A newer version of the robot software is available. To update your robot to the latest version, please update your app software before updating your robot software. -

- ) -} diff --git a/app/src/components/RobotSettings/UpdateRobot/index.js b/app/src/components/RobotSettings/UpdateRobot/index.js index 5feeafef426..76fad13763a 100644 --- a/app/src/components/RobotSettings/UpdateRobot/index.js +++ b/app/src/components/RobotSettings/UpdateRobot/index.js @@ -35,7 +35,6 @@ function UpdateRobot (props: Props) { return } if (updateRequest.inProgress) { - // TODO (ka 2018-11-27): Clarify update message with UX return } else { return diff --git a/app/src/components/RobotSettings/UpdateRobotMessage.js b/app/src/components/RobotSettings/UpdateRobotMessage.js deleted file mode 100644 index bdf32c99286..00000000000 --- a/app/src/components/RobotSettings/UpdateRobotMessage.js +++ /dev/null @@ -1,13 +0,0 @@ -// @flow -import * as React from 'react' -import styles from './styles.css' - -type Props = {message: React.Node} - -export default function UpdateRobotMessage (props: Props) { - return ( -

- {props.message} -

- ) -} diff --git a/app/src/components/RobotSettings/index.js b/app/src/components/RobotSettings/index.js index 7dcc7dd4fa5..104eab07354 100644 --- a/app/src/components/RobotSettings/index.js +++ b/app/src/components/RobotSettings/index.js @@ -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' @@ -44,4 +43,4 @@ export default function RobotSettings (props: Props) { ) } -export {ConnectAlertModal, RobotUpdateModal} +export {ConnectAlertModal} diff --git a/app/src/config/index.js b/app/src/config/index.js index 7dfafa3787a..b062ed77486 100644 --- a/app/src/config/index.js +++ b/app/src/config/index.js @@ -56,11 +56,6 @@ export type Config = { discovery: { candidates: string | Array, }, - - // internal development flags - devInternal?: { - newUpdateModal?: boolean, - }, } type UpdateConfigAction = {| diff --git a/app/src/pages/Robots/RobotSettings.js b/app/src/pages/Robots/RobotSettings.js index ae6c3639438..fa42ccd007f 100644 --- a/app/src/pages/Robots/RobotSettings.js +++ b/app/src/pages/Robots/RobotSettings.js @@ -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 { @@ -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' @@ -44,7 +39,6 @@ type SP = {| showConnectAlert: boolean, homeInProgress: ?boolean, homeError: ?Error, - __featureEnabled: boolean, |} type DP = {|dispatch: Dispatch|} @@ -56,8 +50,6 @@ type Props = { closeConnectAlert: () => mixed, } -const __FEATURE_FLAG = 'devInternal.newUpdateModal' - export default withRouter( connect( makeMapStateToProps, @@ -110,11 +102,7 @@ function RobotSettingsPage (props: Props) { { - if (props.__featureEnabled) { - return - } else { - return - } + return }} /> @@ -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), } } } diff --git a/app/src/pages/Robots/index.js b/app/src/pages/Robots/index.js index 75c4f6a0d41..fec1da2000f 100644 --- a/app/src/pages/Robots/index.js +++ b/app/src/pages/Robots/index.js @@ -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 { @@ -31,7 +29,6 @@ type SP = { robot: ?ViewableRobot, connectedName: ?string, appUpdate: ShellUpdateState, - __featureEnabled: boolean, } type OP = {match: Match} @@ -40,8 +37,6 @@ type Props = SP & OP const log = createLogger(__filename) -const __FEATURE_FLAG = 'devInternal.newUpdateModal' - export default withRouter( connect( mapStateToProps, @@ -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 } @@ -117,6 +112,5 @@ function mapStateToProps (state: State, ownProps: OP): SP { robot, connectedName, appUpdate: getShellUpdateState(state), - __featureEnabled: !!getIn(getConfig(state), __FEATURE_FLAG), } }