зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1497944 - Hide wifi section in ConnectPage behind pref;r=daisuke
Depends on D9222 . Differential Revision: https://phabricator.services.mozilla.com/D9223 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
cf9f2f85ba
Коммит
84ef7175f1
|
@ -33,6 +33,7 @@ class App extends PureComponent {
|
|||
networkRuntimes: PropTypes.arrayOf(Types.runtime).isRequired,
|
||||
selectedPage: PropTypes.string,
|
||||
usbRuntimes: PropTypes.arrayOf(Types.runtime).isRequired,
|
||||
wifiEnabled: PropTypes.bool.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -43,6 +44,7 @@ class App extends PureComponent {
|
|||
networkEnabled,
|
||||
networkLocations,
|
||||
selectedPage,
|
||||
wifiEnabled,
|
||||
} = this.props;
|
||||
|
||||
if (!selectedPage) {
|
||||
|
@ -57,6 +59,7 @@ class App extends PureComponent {
|
|||
dispatch,
|
||||
networkEnabled,
|
||||
networkLocations,
|
||||
wifiEnabled,
|
||||
});
|
||||
default:
|
||||
// All pages except for the CONNECT page are RUNTIME pages.
|
||||
|
@ -105,6 +108,7 @@ const mapStateToProps = state => {
|
|||
networkRuntimes: state.runtimes.networkRuntimes,
|
||||
selectedPage: state.ui.selectedPage,
|
||||
usbRuntimes: state.runtimes.usbRuntimes,
|
||||
wifiEnabled: state.ui.wifiEnabled,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -39,11 +39,16 @@ class ConnectPage extends PureComponent {
|
|||
getString: PropTypes.func.isRequired,
|
||||
networkEnabled: PropTypes.bool.isRequired,
|
||||
networkLocations: PropTypes.arrayOf(PropTypes.string).isRequired,
|
||||
wifiEnabled: PropTypes.bool.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
renderWifi() {
|
||||
const { getString } = this.props;
|
||||
const { getString, wifiEnabled } = this.props;
|
||||
if (!wifiEnabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Localized(
|
||||
{
|
||||
id: "about-debugging-connect-wifi",
|
||||
|
|
|
@ -65,6 +65,8 @@ const PAGES = {
|
|||
const PREFERENCES = {
|
||||
// Temporary preference without any default value until network locations are enabled.
|
||||
NETWORK_ENABLED: "devtools.aboutdebugging.network",
|
||||
// Temporary preference without any default value until wifi is enabled.
|
||||
WIFI_ENABLED: "devtools.aboutdebugging.wifi",
|
||||
};
|
||||
|
||||
const RUNTIME_PREFERENCE = {
|
||||
|
|
|
@ -42,7 +42,8 @@ function getUiState() {
|
|||
const collapsibilities = getDebugTargetCollapsibilities();
|
||||
const locations = getNetworkLocations();
|
||||
const networkEnabled = Services.prefs.getBoolPref(PREFERENCES.NETWORK_ENABLED, false);
|
||||
return new UiState(locations, collapsibilities, networkEnabled);
|
||||
const wifiEnabled = Services.prefs.getBoolPref(PREFERENCES.WIFI_ENABLED, false);
|
||||
return new UiState(locations, collapsibilities, networkEnabled, wifiEnabled);
|
||||
}
|
||||
|
||||
exports.configureStore = configureStore;
|
||||
|
|
|
@ -12,13 +12,14 @@ const {
|
|||
} = require("../constants");
|
||||
|
||||
function UiState(locations = [], debugTargetCollapsibilities = {},
|
||||
networkEnabled = false) {
|
||||
networkEnabled = false, wifiEnabled = false) {
|
||||
return {
|
||||
adbAddonStatus: null,
|
||||
debugTargetCollapsibilities,
|
||||
networkEnabled,
|
||||
networkLocations: locations,
|
||||
selectedPage: null,
|
||||
wifiEnabled,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче