Skip to content

Commit

Permalink
fix(app): Show the correct release notes for robot update (#2560)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcous authored Oct 25, 2018
1 parent 275a144 commit 7b0279c
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions app/src/components/RobotSettings/RobotUpdateModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
setIgnoredUpdate,
} from '../../http-api-client'

import {getShellUpdateState} from '../../shell'
import {CURRENT_RELEASE_NOTES, getShellUpdateState} from '../../shell'

import type {ShellUpdateState} from '../../shell'

Expand Down Expand Up @@ -50,6 +50,11 @@ type Props = {
ignoreUpdate: () => mixed,
}

const API_RELEASE_NOTES = CURRENT_RELEASE_NOTES.replace(
/<!-- start:@opentrons\/app -->([\S\s]*?)<!-- end:@opentrons\/app -->/,
''
)

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 =
Expand All @@ -76,7 +81,7 @@ function RobotUpdateModal (props: Props) {
restart,
updateRequest,
restartRequest,
appUpdate: {available, info},
appUpdate: {available},
} = props
const inProgress = updateRequest.inProgress || restartRequest.inProgress
let closeButtonText = 'not now'
Expand Down Expand Up @@ -108,9 +113,6 @@ function RobotUpdateModal (props: Props) {
? {disabled: true, children: <Spinner />}
: {onClick: buttonAction, children: buttonText}

let source =
info && info.releaseNotes ? removeAppNotes(info.releaseNotes) : null

return (
<ScrollableAlertModal
heading={heading}
Expand All @@ -119,7 +121,7 @@ function RobotUpdateModal (props: Props) {
>
{available && <UpdateAppMessage />}
<UpdateRobotMessage message={message} />
<ReleaseNotes source={source} />
<ReleaseNotes source={API_RELEASE_NOTES} />
</ScrollableAlertModal>
)
}
Expand Down Expand Up @@ -159,12 +161,3 @@ function mergeProps (stateProps: SP, dispatchProps: DP, ownProps: OP): Props {
},
}
}

// TODO (ka, 2018-10-1):
// Grabbing only the api notes removes changes since and technical change log

const RE_APP_NOTES = /<!-- start:@opentrons\/app -->([\S\s]*?)<!-- end:@opentrons\/app -->/

function removeAppNotes (notes: string) {
return notes.replace(RE_APP_NOTES, '')
}

0 comments on commit 7b0279c

Please sign in to comment.