Skip to content

Commit

Permalink
Merge branch 'release/0.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
stylesuxx committed Mar 28, 2021
2 parents 2228da7 + c7a8e6c commit 89e8684
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A progressive web-app to flash your BLHELI_S capable ESC's directly from the web

> The latest state of the master branch can be [viewed in the browser](https://esc-configurator.com)
This is basically a complete re-write of the original BLHELI_S configurator. Some bits and pieces have been re-used - mainly the ones concerning the actual flashing part.
This project is basically a re-write and clean up of the original [Blheli configurator](https://github.com/blheli-configurator/blheli-configurator). Some bits and pieces have been re-used - mainly the ones concerning the actual flashing part.

I did this since I was interested in having this as an web app, but also because the original BLHELI_S configurator code was too much for me to re-factor and I thought I might be able to re-write it in the same amount of time.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esc-configurator",
"version": "0.9.0",
"version": "0.9.1",
"private": true,
"dependencies": {
"@palmabit/react-cookie-law": "^0.6.2",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#root:empty:after {
margin: 60px auto;
font-size: 10px;
position: relative;
position: absolute;
text-indent: -9999em;
border-top: 1.1em solid rgba(255, 255, 255, 0.2);
border-right: 1.1em solid rgba(255, 255, 255, 0.2);
Expand Down
15 changes: 11 additions & 4 deletions src/Components/Flash/Escs/Esc/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,23 @@ function Esc({
const settings = esc.individualSettings;
const currentSettings = settings;
const settingsDescriptions = esc.individualSettingsDescriptions;
const revision = settings ? `${settings.MAIN_REVISION}.${settings.SUB_REVISION}` : 'UNSUPPORTED';

let revision = 'Unsupported/Unrecognized';
if(settings.MAIN_REVISION !== undefined && settings.SUB_REVISION !== undefined) {
revision = `${settings.MAIN_REVISION}.${settings.SUB_REVISION}`;
}

let make = '';
if (esc.make) {
make = `${esc.make}, `;
}

let name = settings ? (settings.NAME).trim() : '';
if (name.length > 0) {
name = `, ${name}`;
let name = '';
if(settings.NAME) {
name = settings ? (settings.NAME).trim() : '';
if (name.length > 0) {
name = `, ${name}`;
}
}

let bootloader = '';
Expand Down
26 changes: 22 additions & 4 deletions src/Components/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,21 @@ function Home() {
return(
<div className="column third_left text1">
<div className="wrap">
<h2>
{t('homeDisclaimerHeader')}
</h2>
<div className="summary-section">
<h2>
{t('homeDisclaimerHeader')}
</h2>

<div dangerouslySetInnerHTML={{ __html: t('homeDisclamierText') }} />
</div>

<div className="summary-section">
<h2>
{t('homeAttributionHeader')}
</h2>

<div dangerouslySetInnerHTML={{ __html: t('homeDisclamierText') }} />
<div dangerouslySetInnerHTML={{ __html: t('homeAttributionText') }} />
</div>
</div>
</div>
);
Expand Down Expand Up @@ -137,6 +147,14 @@ function Home() {
</a>
</div>

<div className="summary-section">
<h2>
{t('homeChinaHeader')}
</h2>

<div dangerouslySetInnerHTML={{ __html: t('homeChinaText') }} />
</div>

<div className="summary-section">
<h2>
{t('homeContributionHeader')}
Expand Down
8 changes: 8 additions & 0 deletions src/changelog.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"title": "0.9.1",
"items": [
"Add attribution to original project",
"Properly display ESCs, even if their settings can not be read",
"Link to chinese mirror"
]
},
{
"title": "0.9.0",
"items": [
Expand Down
2 changes: 1 addition & 1 deletion src/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.9.0",
"version": "0.9.1",
"corsProxy": "https://bubblesort.me/?"
}
4 changes: 2 additions & 2 deletions src/sources/Source.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {

class Source {
constructor(name, platform, versions, escs, eeprom, localVersions, localEscs, pwm) {
if(!name || !versions || !escs || !localVersions || !localEscs || !pwm) {
throw new Error("Parameters required: name, platform, versions, escs, eeprom, localVersions, localEscs");
if(!name || platform === undefined || !versions || !escs || !eeprom || !localVersions || !localEscs || !pwm) {
throw new Error("Parameters required: name, platform, versions, escs, eeprom, localVersions, localEscs, pwm");
}

this.name = name;
Expand Down
40 changes: 40 additions & 0 deletions src/sources/__tests__/Source.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {
Source
} from '../Source';

import {
blheliSource,
} from '../index';

test('Source without parameters', () => {
try {
const source = new Source();
} catch(e) {
expect(e).not.toBeNull();
}
});

test('blheliSource get versions', async() => {
let versions = await blheliSource.getVersions();
expect(versions).not.toBe({});
});

test('blheliSource get escs', async() => {
const escs = await blheliSource.getEscs();
expect(escs).not.toBe({});
});

test('blheliSource get platform', async() => {
const platform = await blheliSource.getPlatform();
expect(platform).toBe(0);
});

test('blheliSource get platform', async() => {
const name = await blheliSource.getName();
expect(name).toBe('Blheli');
});

test('blheliSource get platform', async() => {
const pwm = await blheliSource.getPwm();
expect(pwm.length).toBe(0);
});
7 changes: 6 additions & 1 deletion src/translations/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,10 @@
"masterSpeed": "Master Speed",
"motorNr": "Motor {{index}}",
"homeDiscordHeader": "Join us on Discord!",
"homeDiscordText": "If you have any questions or need a quick helping hand, join us on our Discord server:"
"homeDiscordText": "If you have any questions or need a quick helping hand, join us on our Discord server:",
"homeChinaHeader": "For our Chinese Visiotors",
"homeChinaText": "Tell your friends behind the great firewall of China, that they can reach us via a local <a href=\"https://esc-configurator.pitronic.top/\">mirror directly in China<a>.",
"melodyEditor": "Melody Editor",
"homeAttributionHeader": "Attribution",
"homeAttributionText": "This project was heavily inspired by the <a target=\"_blank\" href=\"https://github.com/blheli-configurator/blheli-configurator\">Blheli Configurator</a>. Most of the UI has been re-written from scratch but a lot of the low level stuff related to flashing and firmware handling have been re-used - so a big shout out to everyone involved in the original Blheli Configurator."
}

0 comments on commit 89e8684

Please sign in to comment.