From f952e25205e298f67134ad6ea7b818b9aa790b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Mat=C4=9Bjek?= Date: Sat, 12 Feb 2022 22:08:04 +0100 Subject: [PATCH 1/5] Add wifi 802.11ax HE modes --- src/common/WiFiSettings/constants.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/WiFiSettings/constants.js b/src/common/WiFiSettings/constants.js index f132b09..49776c7 100644 --- a/src/common/WiFiSettings/constants.js +++ b/src/common/WiFiSettings/constants.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/) + * Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/) * * This is free software, licensed under the GNU General Public License v3. * See /LICENSE for more information. @@ -13,6 +13,10 @@ export const HTMODES = { VHT40: _("802.11ac - 40 MHz wide channel"), VHT80: _("802.11ac - 80 MHz wide channel"), VHT160: _("802.11ac - 160 MHz wide channel"), + HE20: _("802.11ax - 20 MHz wide channel"), + HE40: _("802.11ax - 40 MHz wide channel"), + HE80: _("802.11ax - 80 MHz wide channel"), + HE160: _("802.11ax - 160 MHz wide channel"), }; export const HWMODES = { "11g": "2.4", From 175a07a865ac6d10683a7a39d0b7ceebfd9244b9 Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Thu, 17 Feb 2022 13:01:40 +0100 Subject: [PATCH 2/5] Remove customOrder prop As some options of Select component should be ordered by values or keys, it was decided to handle sorting not in options, but locally in corresponding lists. --- src/bootstrap/Select.js | 16 +++++----------- src/common/WiFiSettings/WiFiForm.js | 1 - 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/bootstrap/Select.js b/src/bootstrap/Select.js index 5fdbdc1..0292a2a 100644 --- a/src/bootstrap/Select.js +++ b/src/bootstrap/Select.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/) + * Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/) * * This is free software, licensed under the GNU General Public License v3. * See /LICENSE for more information. @@ -18,20 +18,14 @@ Select.propTypes = { value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, /** Help text message. */ helpText: PropTypes.string, - /** Turns on/off alphabetical ordering of the Select options. */ - customOrder: PropTypes.bool, }; -export function Select({ label, choices, helpText, customOrder, ...props }) { +export function Select({ label, choices, helpText, ...props }) { const uid = useUID(); - const keys = Object.keys(choices); - if (!customOrder) { - keys.sort((a, b) => a - b || a.toString().localeCompare(b.toString())); - } - const options = keys.map((key) => ( - )); diff --git a/src/common/WiFiSettings/WiFiForm.js b/src/common/WiFiSettings/WiFiForm.js index 8179f1b..02f50aa 100644 --- a/src/common/WiFiSettings/WiFiForm.js +++ b/src/common/WiFiSettings/WiFiForm.js @@ -209,7 +209,6 @@ function DeviceForm({ [deviceIndex]: { encryption: { $set: value } }, }, }))} - customOrder {...props} /> From 52cdaf5bc5fa8b882579e0f68c7c313f380f0c95 Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Thu, 17 Feb 2022 16:15:03 +0100 Subject: [PATCH 3/5] Update Snapshots --- .../__tests__/__snapshots__/WiFiSettings.test.js.snap | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap b/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap index 24124bb..9210840 100644 --- a/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap +++ b/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap @@ -627,6 +627,11 @@ exports[` Snapshot one module enabled. 1`] = ` + id=\\"8\\" + > + ++ + -+