Skip to content

Commit

Permalink
Remove recurring AO feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytroshch committed Nov 4, 2024
1 parent a58ad4a commit 9ed0981
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 21 deletions.
8 changes: 2 additions & 6 deletions src/components/OrderForm/OrderForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,10 @@ class OrderForm extends React.Component {
getAlgoOrderParams,
aoParams,
t,
showAdvancedAlgos,
isPaperTrading,
} = this.props
const { currentMarket } = this.state
const algoOrders = getAOs(t, showAdvancedAlgos, false, isPaperTrading)
const algoOrders = getAOs({ t, isEditMode: false, isPaperTrading })
const orders = getAtomicOrders(t)
resetActiveAOParamsID()

Expand Down Expand Up @@ -394,7 +393,6 @@ class OrderForm extends React.Component {
isOrderExecuting,
activeMarket,
t,
showAdvancedAlgos,
isAlgoWorkerStarted,
isPaperTrading,
} = this.props
Expand All @@ -411,7 +409,7 @@ class OrderForm extends React.Component {
isAlgoOrder,
} = this.state

const algoOrders = getAOs(t, showAdvancedAlgos, false, isPaperTrading)
const algoOrders = getAOs({ t, isEditMode: false, isPaperTrading })
const processedAOs = filterAOs(algoOrders, activeMarket)

const apiClientConfigured = apiCredentials?.configured && apiCredentials?.valid
Expand Down Expand Up @@ -590,7 +588,6 @@ OrderForm.propTypes = {
isOrderExecuting: PropTypes.bool,
moveable: PropTypes.bool,
removeable: PropTypes.bool,
showAdvancedAlgos: PropTypes.bool,
t: PropTypes.func.isRequired,
atomicOrdersCount: PropTypes.number.isRequired,
atomicOrdersCountActiveMarket: PropTypes.number.isRequired,
Expand All @@ -609,7 +606,6 @@ OrderForm.defaultProps = {
apiCredentials: {},
onRemove: () => { },
authToken: null,
showAdvancedAlgos: false,
}

export default OrderForm
15 changes: 7 additions & 8 deletions src/components/OrderForm/OrderForm.orders.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,26 @@ import timeFrames from '../../util/time_frames'

import rawOrders from '../../orders'

const getAlgoOrdersForStandalone = (isBeta, isPaperTrading) => {
const getAlgoOrdersForStandalone = (isPaperTrading) => {
const aos = [
AccumulateDistribute,
PingPong,
Iceberg,
TWAP,
Bracket,
]
if (isBeta) {
if (!isPaperTrading) {
aos.unshift(Recurring)
}
aos.unshift(AccumulateDistribute)
if (!isPaperTrading) {
aos.unshift(Recurring)
}

return aos
}

const HOSTED_ALGO_ORDERS = [Iceberg, TWAP]

const getAlgoOrders = (isBeta, isPaperTrading) => (isElectronApp ? getAlgoOrdersForStandalone(isBeta, isPaperTrading) : HOSTED_ALGO_ORDERS)
const getAlgoOrders = (isPaperTrading) => (isElectronApp ? getAlgoOrdersForStandalone(isPaperTrading) : HOSTED_ALGO_ORDERS)

export const getAOs = memoizeOne((t, isBeta, isEditMode, isPaperTrading = false) => _map(getAlgoOrders(isBeta, isPaperTrading), (ao) => ao.meta.getUIDef({
export const getAOs = memoizeOne(({ t, isEditMode, isPaperTrading = false }) => _map(getAlgoOrders(isPaperTrading), (ao) => ao.meta.getUIDef({
timeframes: timeFrames,
i18n: { t, prefix: 'algoOrderForm.' },
isEditMode,
Expand Down
2 changes: 1 addition & 1 deletion src/modals/EditOrderModal/EditOrderModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const EditOrderModal = ({
return
}
const updOrder = { ...order }
const algoOrders = getAOs(t, true, !isRelaunching, false)
const algoOrders = getAOs({ t, isEditMode: !isRelaunching, isPaperTrading: false })
let isAlgoOrder = true
let uiDef = _find(
algoOrders,
Expand Down
6 changes: 0 additions & 6 deletions src/redux/selectors/ui/get_feature_flags.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import _get from 'lodash/get'
import { createSelector } from 'reselect'
import { REDUCER_PATHS } from '../../config'

const path = REDUCER_PATHS.UI

export const getFeatureFlags = (state) => _get(state, `${path}.featureFlags`)

export const getIsRecurringAOVisible = createSelector(
getFeatureFlags,
(flags) => flags?.recurring_AOs,
)

export default getFeatureFlags

0 comments on commit 9ed0981

Please sign in to comment.