From abaf135808c4fc97b939d3419c6766844d0e2330 Mon Sep 17 00:00:00 2001 From: Chris L Date: Thu, 25 Mar 2021 15:03:34 +0100 Subject: [PATCH 1/8] Center the loading spinner. --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 3bb05d027..37f4696cb 100644 --- a/public/index.html +++ b/public/index.html @@ -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); From a4bbc635884ef0c105c2481ba0d6942d65958606 Mon Sep 17 00:00:00 2001 From: Chris L Date: Thu, 25 Mar 2021 22:41:33 +0100 Subject: [PATCH 2/8] Added tests for sources. --- src/sources/Source.js | 4 +-- src/sources/__tests__/Source.test.js | 44 ++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 src/sources/__tests__/Source.test.js diff --git a/src/sources/Source.js b/src/sources/Source.js index 7c8a3a6b7..dd852f365 100644 --- a/src/sources/Source.js +++ b/src/sources/Source.js @@ -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; diff --git a/src/sources/__tests__/Source.test.js b/src/sources/__tests__/Source.test.js new file mode 100644 index 000000000..e14c45692 --- /dev/null +++ b/src/sources/__tests__/Source.test.js @@ -0,0 +1,44 @@ +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({}); + + navigator.onLine = false; + 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); +}); From 9a6b0411a675039836f4691b99c610d7d683c796 Mon Sep 17 00:00:00 2001 From: Chris L Date: Thu, 25 Mar 2021 23:08:12 +0100 Subject: [PATCH 3/8] Removed breaking change --- src/sources/__tests__/Source.test.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/sources/__tests__/Source.test.js b/src/sources/__tests__/Source.test.js index e14c45692..115fb3063 100644 --- a/src/sources/__tests__/Source.test.js +++ b/src/sources/__tests__/Source.test.js @@ -17,10 +17,6 @@ test('Source without parameters', () => { test('blheliSource get versions', async() => { let versions = await blheliSource.getVersions(); expect(versions).not.toBe({}); - - navigator.onLine = false; - versions = await blheliSource.getVersions(); - expect(versions).not.toBe({}); }); test('blheliSource get escs', async() => { From 4fea6994f972cb25cfebfc7a356d01d4c6210b28 Mon Sep 17 00:00:00 2001 From: Chris L Date: Fri, 26 Mar 2021 22:36:00 +0100 Subject: [PATCH 4/8] Added link to chinese mirror. Resolves #61 --- src/Components/Home/index.jsx | 8 ++++++++ src/translations/en/common.json | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Components/Home/index.jsx b/src/Components/Home/index.jsx index db7362ea9..caacc736a 100644 --- a/src/Components/Home/index.jsx +++ b/src/Components/Home/index.jsx @@ -137,6 +137,14 @@ function Home() { +
+

+ {t('homeChinaHeader')} +

+ +
+
+

{t('homeContributionHeader')} diff --git a/src/translations/en/common.json b/src/translations/en/common.json index 48984773f..15914ccf8 100644 --- a/src/translations/en/common.json +++ b/src/translations/en/common.json @@ -87,5 +87,7 @@ "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 mirror directly in China." } From a6c3edf8fe5d17e4330f6685d6b902406b717ae4 Mon Sep 17 00:00:00 2001 From: Chris L Date: Sat, 27 Mar 2021 01:50:08 +0100 Subject: [PATCH 5/8] Added attribution text to Blheli COnfigurator. Resolves #63 --- src/Components/Home/index.jsx | 18 ++++++++++++++---- src/translations/en/common.json | 5 ++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/Components/Home/index.jsx b/src/Components/Home/index.jsx index caacc736a..bb62ef237 100644 --- a/src/Components/Home/index.jsx +++ b/src/Components/Home/index.jsx @@ -13,11 +13,21 @@ function Home() { return(
-

- {t('homeDisclaimerHeader')} -

+
+

+ {t('homeDisclaimerHeader')} +

+ +
+
+ +
+

+ {t('homeAttributionHeader')} +

-
+
+
); diff --git a/src/translations/en/common.json b/src/translations/en/common.json index 15914ccf8..46bcc40c4 100644 --- a/src/translations/en/common.json +++ b/src/translations/en/common.json @@ -89,5 +89,8 @@ "homeDiscordHeader": "Join us on Discord!", "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
mirror directly in China." + "homeChinaText": "Tell your friends behind the great firewall of China, that they can reach us via a local mirror directly in China.", + "melodyEditor": "Melody Editor", + "homeAttributionHeader": "Attribution", + "homeAttributionText": "This project was heavily inspired by the Blheli Configurator. 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." } From 1db2b87ba4fae801fce8cfceb88eb6858f5810ea Mon Sep 17 00:00:00 2001 From: Chris L Date: Sat, 27 Mar 2021 12:22:06 +0100 Subject: [PATCH 6/8] Linked the OG Blheli Configurator from the README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6eabf4398..7d16a5097 100644 --- a/README.md +++ b/README.md @@ -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. From c7b81569c3fba9e29222ca56879d990a4706e5a2 Mon Sep 17 00:00:00 2001 From: Chris L Date: Mon, 29 Mar 2021 00:45:36 +0200 Subject: [PATCH 7/8] Properly display ESCs even if their settings can not be read, so that one can re-flash them. Resolves #70 --- src/Components/Flash/Escs/Esc/index.jsx | 15 +++++++++++---- src/changelog.json | 8 ++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/Components/Flash/Escs/Esc/index.jsx b/src/Components/Flash/Escs/Esc/index.jsx index 7a04cfc11..0d4f8f3d1 100644 --- a/src/Components/Flash/Escs/Esc/index.jsx +++ b/src/Components/Flash/Escs/Esc/index.jsx @@ -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 = ''; diff --git a/src/changelog.json b/src/changelog.json index cdc893dc1..8c35537a8 100644 --- a/src/changelog.json +++ b/src/changelog.json @@ -1,4 +1,12 @@ [ + { + "title": "Unreleased", + "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": [ From c7a8e6c96a4058fd85d3c0495d12af409da095c1 Mon Sep 17 00:00:00 2001 From: Chris L Date: Mon, 29 Mar 2021 00:46:22 +0200 Subject: [PATCH 8/8] Bumped version numbers --- package.json | 2 +- src/changelog.json | 2 +- src/settings.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ffdbfffd1..a05b4a581 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/changelog.json b/src/changelog.json index 8c35537a8..5029b951f 100644 --- a/src/changelog.json +++ b/src/changelog.json @@ -1,6 +1,6 @@ [ { - "title": "Unreleased", + "title": "0.9.1", "items": [ "Add attribution to original project", "Properly display ESCs, even if their settings can not be read", diff --git a/src/settings.json b/src/settings.json index 714e5c8d1..24bda154a 100644 --- a/src/settings.json +++ b/src/settings.json @@ -1,4 +1,4 @@ { - "version": "0.9.0", + "version": "0.9.1", "corsProxy": "https://bubblesort.me/?" }