Skip to content

Commit

Permalink
(fix) Recurring: fails on relaunch (#677)
Browse files Browse the repository at this point in the history
* Restore Recurring order on FE

* HistoryButton: moved to separated component

* Backtest: add history/new test toggler

* PanelButton: align text and icon

* fetch strategy backtests

* BT history: recieve data from data-server

* BT history: layout list

* BT history: restructure components and folders

* BT history: launch to details tab

* BT history: details layout"

* fix prop validation

* BT history: fix styles

* BT history: results

* Revert "Merge pull request #394 from dmytroshch/fix/backtest-clear"

This reverts commit 755f7dd, reversing
changes made to 7e41af4.

* fixed: new test button

* BT: add bt to history after execution

* BT: log error messages during execution

* BT: update initial messages

* BT: fix button style

* BT: reset tab state when strategy has changed

* BT: change fetching history logic

* removed duplicated action

* rename method

* BT: remove history on strategy delete

* BT history: move some component state properties to redux store

* AOs history: fix issue with relaunch Recurring AO

* resolve conflits
  • Loading branch information
dmytroshch authored Sep 6, 2023
1 parent db469ca commit af8f7c3
Show file tree
Hide file tree
Showing 53 changed files with 1,321 additions and 557 deletions.
18 changes: 13 additions & 5 deletions public/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,6 @@
"updateCreds": "Update credentials"
},
"strategyEditor": {
"clearBacktestResultsModalTitle": "Confirmation Required",
"clearBacktestResultsModalText": "If you choose to continue, the current backtest results will be cleared. Do you wish to proceed?",
"unsavedChanges": "Unsaved changes",
"unsavedChangesModalTitle": "Do you need to save changes in the strategy before closing?",
"cancelThisProcess": "Cancel this process",
Expand Down Expand Up @@ -783,7 +781,9 @@
"openStartegyModalNoSelectedError": "No strategy selected",
"backtestingCreateMessage": "Create a strategy to begin backtesting",
"backtestingLoadingMessage": "Loading candles and executing strategy...",
"backtestingStartingMessage": "Press start to begin backtesting",
"backtestingStartingMessage": "Click \"Start\" to begin backtesting",
"backtestingHistoryListMessage": "Select a completed backtest and view its details",
"backtestingHistoryDetailsMessage": "Click \"More info\" to view backtest performance metrics, trades and chart table",
"exportCSV": "Export as CSV",
"exportStrategy": "Export strategy to JSON",
"historical": "Historical",
Expand Down Expand Up @@ -873,7 +873,14 @@
"lastQuarter": "Last quarter",
"lastYear": "Last year",
"lastXyears": "Last {{amount}} years",
"elapsedTime": "Elapsed time"
"elapsedTime": "Elapsed time",
"noHistoryBacktests": "No backtests in history",
"executedAt": "Executed at",
"period": "Period",
"tradingPair": "Trading Pair",
"source": "Source",
"candlesSource": "Candles ({{timeframe}}),\n\n Seed count = {{candleSeed}}",
"backtestHistoryResults": "Backtest results for"
},
"ui": {
"ok": "Okay",
Expand Down Expand Up @@ -915,7 +922,8 @@
"saveAndLaunch": "Save & Launch",
"launchNoSave": "Launch without saving",
"updateAndRestart": "Update and Restart",
"saveAndContinue": "Save and Continue"
"saveAndContinue": "Save and Continue",
"starred": "Starred"
},
"crashHandler": {
"text1": "An error occurred that caused the Bitfinex Honey UI to halt. Please, restart the application to proceed working with it",
Expand Down
21 changes: 3 additions & 18 deletions src/components/AlgoOrdersHistoryButton/AlgoOrdersHistoryButton.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
import React, { useRef, useEffect } from 'react'
import _toUpper from 'lodash/toUpper'
import { useDispatch, useSelector } from 'react-redux'

import { useTranslation } from 'react-i18next'
import { Spinner } from '@ufx-ui/core'
import PanelButton from '../../ui/Panel/Panel.Button'
import { getShowAOsHistory } from '../../redux/selectors/ao'
import { getIsAOsHistoryLoaded } from '../../redux/selectors/ws'
import AOActions from '../../redux/actions/ao'
import useToggle from '../../hooks/useToggle'
import HistoryIcon from '../../ui/Icons/HistoryIcon'

import './style.css'
import HistoryButton from '../../ui/HistoryButton'

const AlgoOrdersHistoryButton = () => {
const [isHistoryLoading, , setIsLoading, setStopLoading] = useToggle(false)
const timeoutId = useRef(null)

const { t } = useTranslation()

const isHistoryActive = useSelector(getShowAOsHistory)
const isHistoryLoaded = useSelector(getIsAOsHistoryLoaded)

Expand Down Expand Up @@ -62,17 +54,10 @@ const AlgoOrdersHistoryButton = () => {
}, [])

return (
<PanelButton
<HistoryButton
onClick={onButtonClickHandler}
text={_toUpper(t('tradingStatePanel.history'))}
isActive={isHistoryActive}
icon={
isHistoryLoading ? (
<Spinner className='hfui-history-button__spinner' />
) : (
<HistoryIcon className='hfui-history-button__icon' width='25px' height='25px' />
)
}
isLoading={isHistoryLoading}
/>
)
}
Expand Down
Loading

0 comments on commit af8f7c3

Please sign in to comment.