Skip to content

Commit

Permalink
Display checklist for new ESC firmware, link to release notes #412
Browse files Browse the repository at this point in the history
  • Loading branch information
stylesuxx committed Sep 14, 2023
1 parent 05eea5a commit 753f1b2
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 22 deletions.
41 changes: 41 additions & 0 deletions src/Components/FirmwareSelector/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function FirmwareSelector({
version: null,
url: null,
pwm: null,
releaseUrl: null,
});

const [layoutSelectionDisabled, setLayoutSelectionDisabled] = useState(false);
Expand Down Expand Up @@ -133,6 +134,7 @@ function FirmwareSelector({
key: version.key,
value: version.url,
name: version.name,
releaseUrl: version.releaseUrl ? version.releaseUrl : null,
}));

const firmwareOptions = validFirmware.map((key) => ({
Expand Down Expand Up @@ -205,6 +207,8 @@ function FirmwareSelector({
const selected = e.target.options.selectedIndex;
const selectedOption = e.target.options[selected];

const releaseUrl = options.versions[selected - 1].releaseUrl;

const firmwareName = selection.firmware;
const firmwareVersion = options.versions[selected - 1].key;

Expand All @@ -223,6 +227,7 @@ function FirmwareSelector({
setSelection({
...selection,
url: e.target.value,
releaseUrl,
version: selectedOption && options.versions[selected - 1].key,
});
}, [options, selection]);
Expand Down Expand Up @@ -375,6 +380,42 @@ function FirmwareSelector({
/>}
</>}

<div className="alert">
<p>
<strong>
{t('selectionAttention')}
</strong>
</p>

<p>
{t('selectionHint')}
</p>

<p>
<ul>
<li>
{t('selectionLi1')}
</li>

<li>
{t('selectionLi2')}
</li>

<li>
{t('selectionLi3')}
</li>
</ul>
</p>

{selection.releaseUrl &&
<a
href={selection.releaseUrl}
target="_blank"
>
{t('selectionLinkText')}
</a>}
</div>

<div className="default-btn">
<button
className={disableFlashButton ? "disabled" : ""}
Expand Down
3 changes: 1 addition & 2 deletions src/Components/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ function HomeColumnCenter() {
}, [dispatch]);

return(
<div className="column third_center text2">
<div className="column third_center text2 tab">
<div className="wrap">

<div className="alert">
<strong>
Attention Bluejay users!
Expand Down
11 changes: 0 additions & 11 deletions src/Components/Home/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,4 @@
list-style: disc;
}
}

.alert {
color: #721c24;
background-color: #f8d7da;
border-color: #f5c6cb;
position: relative;
padding: 0.75rem 1.25rem;
margin-bottom: 1rem;
border: 1px solid transparent;
border-radius: 0.25rem;
}
}
44 changes: 37 additions & 7 deletions src/Components/MainContent/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

.note {
background-color: #fff3cd;
border: 1px solid #ffeeba;
border-color: #ffeeba;
color: #856404;
margin-top: 5px;
margin-bottom: 25px;
border-radius: 3px;
font-size: 11px;
font-family: 'open_sansregular', Arial, sans-serif;
padding: 5px 7px;

position: relative;
padding: 0.75rem 1.25rem;
margin-bottom: 10px;
border: 1px solid transparent;
border-radius: 0.25rem;

@media screen and (width <= 768px) {
margin-bottom: 18px;
Expand Down Expand Up @@ -104,6 +104,36 @@
}
}

.alert {
color: #721c24;
background-color: #f8d7da;
border-color: #f5c6cb;
position: relative;
padding: 0.75rem 1.25rem;
margin-bottom: 10px;
border: 1px solid transparent;
border-radius: 0.25rem;

p {
margin-bottom: 10px;
font-weight: normal;

ul {
font-weight: normal;
li {
list-style-type: disc;
margin-left: 20px;
}
}
}

span,
a {
color: #721c24;
font-size: inherit;
}
}

.checkbox,
.number,
.number-text,
Expand Down
2 changes: 1 addition & 1 deletion src/sources/Bluejay/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class BluejaySource extends GithubSource {
}

async getVersions() {
return this.getRemoteVersionsList(GITHUB_REPO, blacklist, 5);
return this.getRemoteVersionsList(GITHUB_REPO, blacklist, 8);
}

isValidName(name) {
Expand Down
1 change: 1 addition & 0 deletions src/sources/GithubSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class GithubSource extends Source {
name: release.name || release.tag_name.replace(/^v/, ''),
key: release.tag_name,
url: `https://github.com/${repo}/releases/download/${release.tag_name}/`,
releaseUrl: `https://github.com/${repo}/releases/tag/${release.tag_name}/`,
prerelease: release.prerelease,
published_at: release.published_at,
}));
Expand Down
8 changes: 7 additions & 1 deletion src/translations/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,11 @@
"mistaggedDetected": "Detected",
"update": "Update available! To update the app, refresh or restart it.",
"resettingDevice": "Resetting device...",
"disabled": "Disabled"
"disabled": "Disabled",
"selectionAttention": "Attention!",
"selectionHint": "When flashing new (or different) ESC firmware it is best practice to adhere to the following checklist:",
"selectionLi1": "Read the relese notes to understand what changed and what you might need to adjust",
"selectionLi2": "Make sure your motors spin up reliably on arm and in the correct direction",
"selectionLi3": "Check motor temperatures after a short test flight and adjust tune if they are too hot",
"selectionLinkText": "Show release notes on Github"
}

0 comments on commit 753f1b2

Please sign in to comment.