diff --git a/src/common/WiFiSettings/WiFiForm.js b/src/common/WiFiSettings/WiFiForm.js index 7539045..35f52d7 100644 --- a/src/common/WiFiSettings/WiFiForm.js +++ b/src/common/WiFiSettings/WiFiForm.js @@ -8,7 +8,6 @@ import React from "react"; import PropTypes from "prop-types"; import { Switch } from "../../bootstrap/Switch"; -import { CheckBox } from "../../bootstrap/CheckBox"; import { PasswordInput } from "../../bootstrap/PasswordInput"; import { RadioSet } from "../../bootstrap/RadioSet"; import { Select } from "../../bootstrap/Select"; @@ -65,6 +64,7 @@ DeviceForm.propTypes = { guest_wifi: PropTypes.object.isRequired, encryption: PropTypes.string.isRequired, available_bands: PropTypes.array.isRequired, + ieee80211w_disabled: PropTypes.bool.isRequired, }), formErrors: PropTypes.object.isRequired, setFormValue: PropTypes.func.isRequired, @@ -102,7 +102,7 @@ function DeviceForm({ switchHeading {...props} /> - {formData.enabled ? ( + {formData.enabled && ( <> - + {(formData.encryption === "WPA3" || + formData.encryption === "WPA2/3") && ( + ({ + devices: { + [deviceIndex]: { + ieee80211w_disabled: { $set: value }, + }, + }, + }))} + {...props} + /> + )} + {hasGuestNetwork && ( )} - ) : null} - {divider ?
: null} + )} + {divider &&
} ); } diff --git a/src/common/WiFiSettings/WiFiSettings.js b/src/common/WiFiSettings/WiFiSettings.js index d97ba7a..217e242 100644 --- a/src/common/WiFiSettings/WiFiSettings.js +++ b/src/common/WiFiSettings/WiFiSettings.js @@ -59,6 +59,10 @@ function prepDataToSubmit(formData) { if (!device.guest_wifi.enabled) formData.devices[idx].guest_wifi = { enabled: false }; + + if (device.encryption === "WPA2") { + delete formData.devices[idx].ieee80211w_disabled; + } }); return formData; } diff --git a/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap b/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap index 3b2fdf0..d66d559 100644 --- a/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap +++ b/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap @@ -337,7 +337,7 @@ exports[` Snapshot guest network. 1`] = ` - First value + Second value -@@ -500,10 +500,92 @@ +@@ -524,10 +524,92 @@ > Enables Wi-Fi for guests, which is separated from LAN network. Devices connected to this network are allowed to access the internet, but aren't allowed to access other devices and the configuration interface of the router. Parameters of the guest network can be set in the Guest network tab. @@ -347,7 +347,7 @@ exports[` Snapshot guest network. 1`] = ` + class=\\"form-group\\" + > + @@ -356,7 +356,7 @@ exports[` Snapshot guest network. 1`] = ` + > + @@ -386,7 +386,7 @@ exports[` Snapshot guest network. 1`] = ` + class=\\"form-group\\" + > + @@ -396,7 +396,7 @@ exports[` Snapshot guest network. 1`] = ` + Snapshot guest network. 1`] = ` class=\\"form-group switch\\" >
@@ -449,7 +449,7 @@ exports[` Snapshot one module enabled. 1`] = ` - First value + Second value -@@ -22,10 +22,488 @@ +@@ -22,10 +22,512 @@ Wi-Fi 1 @@ -537,7 +537,7 @@ exports[` Snapshot one module enabled. 1`] = ` + class=\\"form-group\\" + > +
+ Snapshot one module enabled. 1`] = ` + for=\\"6\\" + > + Hide SSID -+ -+ If set, network is not visible when scanning for available networks. -+ + ++ ++ If set, network is not visible when scanning for available networks. ++ +
+
+
Snapshot one module enabled. 1`] = ` + class=\\"custom-control-label\\" + for=\\"11\\" + > ++ Disable Management Frame Protection ++ ++ ++ In case you have trouble connecting to WiFi Access Point, try disabling Management Frame Protection. ++ ++
++ ++
++
++ ++ +