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

Add link in button for CPE firmware update #30727

Merged
merged 1 commit into from Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/i18n/common/en_us.json
Expand Up @@ -1475,7 +1475,9 @@
"unpublish": "Unpublish",
"unpublishPending": "Unpublishing...",
"updateFirmware": "Update Firmware",
"updateFirmwareExplanation": "This board is not using the most up-to-date version of the firmware. For best results, please update the firmware by clicking on the button below.",
"updateFirmwareExplanation": "This board is not using the most up-to-date version of the firmware. ",
"updateFirmwareExplanationClassic": "For best results, please update the firmware by clicking on the button below.",
"updateFirmwareExplanationExpress": "For best results, please update the firmware by clicking on the button below and following the instructions on the Adafruit website.",
"usernameLabel": "Username: ",
"usingHints": "Using hints",
"usingTooManyBlocks": "Using too many blocks",
Expand Down
31 changes: 23 additions & 8 deletions apps/src/lib/kits/maker/ui/SetupChecklist.jsx
Expand Up @@ -19,6 +19,7 @@ import {BOARD_TYPE} from '../CircuitPlaygroundBoard';
import experiments from '@cdo/apps/util/experiments';
import _ from 'lodash';
import yaml from 'js-yaml';
import Button from '@cdo/apps/templates/Button';

const STATUS_SUPPORTED_BROWSER = 'statusSupportedBrowser';
const STATUS_APP_INSTALLED = 'statusAppInstalled';
Expand Down Expand Up @@ -345,18 +346,32 @@ export default class SetupChecklist extends Component {
.{this.contactSupport()}
</ValidationStep>
{experiments.isEnabled('flash-classic') &&
this.state.boardTypeDetected === BOARD_TYPE.CLASSIC && (
this.state.boardTypeDetected !== BOARD_TYPE.OTHER && (
<ValidationStep
stepStatus={this.state[STATUS_BOARD_FIRMWARE]}
stepName={i18n.validationStepBoardFirmware()}
>
<div>{i18n.updateFirmwareExplanation()}</div>
<button
type="button"
onClick={() => this.updateBoardFirmware()}
>
{i18n.updateFirmware()}
</button>
<div>
<p>{i18n.updateFirmwareExplanation()}</p>
<p>
{this.state.boardTypeDetected === BOARD_TYPE.CLASSIC
? i18n.updateFirmwareExplanationClassic()
: i18n.updateFirmwareExplanationExpress()}
</p>
<Button
text={i18n.updateFirmware()}
onClick={
this.state.boardTypeDetected === BOARD_TYPE.CLASSIC
? () => this.updateBoardFirmware()
: null
}
href={
this.state.boardTypeDetected === BOARD_TYPE.CLASSIC
? null
: 'https://learn.adafruit.com/adafruit-circuit-playground-express/code-org-csd'
}
/>
</div>
</ValidationStep>
)}
</div>
Expand Down