Skip to content

Commit

Permalink
remove if DEBUG check for sltp functionality, use abacus feature fl…
Browse files Browse the repository at this point in the history
…ag for reduce only (#163)

* remove if DEBUG checks that block new sltp UI

* reduce only feature flag driven by env.json
  • Loading branch information
mike-dydx committed Aug 21, 2024
1 parent 12e5188 commit 9b01101
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public enum dydxBoolFeatureFlag: String, CaseIterable {
case push_notification
case force_mainnet
case enable_trading_rewards
case enable_reduce_only
case enable_app_rating
case enable_isolated_margins

Expand Down
20 changes: 0 additions & 20 deletions dydx/dydxPresenters/dydxPresenters/_Features/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,6 @@
]
}
},
{
"title":{
"text":"Enable Reduce-only"
},
"field":{
"field":"enable_reduce_only",
"optional":true,
"type" : "text",
"options" : [
{
"text": "yes",
"value" : "1"
},
{
"text": "no",
"value" : "0"
}
]
}
},
{
"title":{
"text":"Push Notification"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ class dydxMarketPositionViewPresenter: HostedViewPresenter<dydxMarketPositionVie

viewModel?.funding = SignedAmountViewModel(amount: position.netFunding?.doubleValue, displayType: .dollar, coloringOption: .allText)

// hide for now until feature work complete and E2E testing
#if DEBUG
// TODO: comment this in when available
if AbacusStateManager.shared.environment?.featureFlags.isSlTpEnabled == true {
let routeToTakeProfitStopLossAction = {[weak self] in
if let marketId = self?.position?.id {
Expand Down Expand Up @@ -150,6 +147,5 @@ class dydxMarketPositionViewPresenter: HostedViewPresenter<dydxMarketPositionVie

viewModel?.takeProfitStopLossAction = routeToTakeProfitStopLossAction
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,7 @@ private class dydxTakeProfitStopLossViewPresenter: HostedViewPresenter<dydxTakeP
viewModel.takeProfitStopLossInputAreaViewModel?.takeProfitPriceInputViewModel = .init(title: DataLocalizer.shared?.localize(path: "APP.TRIGGERS_MODAL.TP_PRICE", params: nil))
viewModel.takeProfitStopLossInputAreaViewModel?.stopLossPriceInputViewModel = .init(title: DataLocalizer.shared?.localize(path: "APP.TRIGGERS_MODAL.SL_PRICE", params: nil))

#if DEBUG
viewModel.shouldDisplayCustomLimitPriceViewModel = AbacusStateManager.shared.environment?.featureFlags.isSlTpLimitOrdersEnabled == true
#endif

viewModel.customAmountViewModel = dydxCustomAmountViewModel()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ internal class dydxTradeInputEditViewPresenter: HostedViewPresenter<dydxTradeInp
visible.append(executionViewModel)
}

if dydxBoolFeatureFlag.enable_reduce_only.isEnabled {
if AbacusStateManager.shared.environment?.featureFlags.reduceOnlySupported == true {
if tradeInput.options?.needsReduceOnly == true {
let vm = reduceOnlyViewModel()
vm.isEnabled = tradeInput.options?.needsReduceOnly == true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,9 @@ public class dydxTakeProfitStopLossViewModel: PlatformViewModel {
self.takeProfitStopLossInputAreaViewModel?.createView(parentStyle: parentStyle, styleKey: styleKey)
self.separator
self.customAmountViewModel?.createView(parentStyle: parentStyle, styleKey: styleKey)
#if DEBUG
if self.shouldDisplayCustomLimitPriceViewModel {
self.customLimitPriceViewModel?.createView(parentStyle: parentStyle, styleKey: styleKey)
}
#endif
}
}
.keyboardObserving()
Expand Down

0 comments on commit 9b01101

Please sign in to comment.