fix: Hide fleet selection from settings

- introduce `ENABLE_FLEET_SELECTION` desktop config entry to control the
Fleet selection UI availability
- UI can be enabled with envvar `STATUS_RUNTIME_ENABLE_FLEET_SELECTION=1`

Fixes #13848
This commit is contained in:
Lukáš Tinkl 2024-03-06 10:14:48 +01:00 committed by Lukáš Tinkl
parent a9b5d8fcf7
commit 29c61d8135
5 changed files with 11 additions and 0 deletions

View File

@ -41,6 +41,7 @@ let
WAKU_V2_PORT* = desktopConfig.defaultWakuV2Port
STATUS_PORT* = desktopConfig.statusPort
LOG_LEVEL* = desktopConfig.logLevel
FLEET_SELECTION_ENABLED* = desktopConfig.enableFleetSelection
# build variables
POKT_TOKEN_RESOLVED* = desktopConfig.poktToken

View File

@ -212,6 +212,11 @@ type StatusDesktopConfig = object
longdesc: "Can be one of: \"ERROR\", \"WARN\", \"INFO\", \"DEBUG\", \"TRACE\". \"INFO\" in production build, otherwise \"DEBUG\""
name: "LOG_LEVEL"
abbr: "log-level" .}: string
enableFleetSelection* {.
defaultValue: false
desc: "Determines if the fleet selection UI is enabled"
name: "ENABLE_FLEET_SELECTION"
abbr: "enable-fleet-selection" .}: bool
# On macOS the first time when a user gets the "App downloaded from the

View File

@ -163,6 +163,7 @@ proc mainProc() =
singletonInstance.engine.setRootContextProperty("uiScaleFilePath", newQVariant(uiScaleFilePath))
singletonInstance.engine.setRootContextProperty("singleInstance", newQVariant(singleInstance))
singletonInstance.engine.setRootContextProperty("isExperimental", isExperimentalQVariant)
singletonInstance.engine.setRootContextProperty("fleetSelectionEnabled", newQVariant(FLEET_SELECTION_ENABLED))
singletonInstance.engine.setRootContextProperty("signals", signalsManagerQVariant)
singletonInstance.engine.setRootContextProperty("production", isProductionQVariant)

View File

@ -318,6 +318,7 @@ StatusSectionLayout {
messagingStore: root.store.messagingStore
advancedStore: root.store.advancedStore
walletStore: root.store.walletStore
isFleetSelectionEnabled: fleetSelectionEnabled
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.advanced)
contentWidth: d.contentWidth
}

View File

@ -36,6 +36,8 @@ SettingsContentBase {
property AdvancedStore advancedStore
property WalletStore walletStore
property bool isFleetSelectionEnabled
Item {
id: advancedContainer
width: root.contentWidth
@ -59,6 +61,7 @@ SettingsContentBase {
text: qsTr("Fleet")
currentValue: root.advancedStore.fleet
onClicked: fleetModal.open()
visible: root.isFleetSelectionEnabled
}
StatusSettingsLineButton {