-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mahdiyeh/ Refactor: Reports monorepo package #5620
Mahdiyeh/ Refactor: Reports monorepo package #5620
Conversation
…_monorepo_package2
@@ -95,7 +97,11 @@ const Routes = ({ | |||
}, []); | |||
|
|||
React.useEffect(() => { | |||
return () => onUnmountPortfolio(); | |||
if (is_reports_url) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since reports is not part of trader any more , when navigating from one of the reports routes to the trader, the trader component reloads and onUnmountPortfolio
is going to be called. Adding this condition prevents this behavour.
bdc145e
…_monorepo_package2
@@ -44,6 +44,11 @@ const ContractUpdateForm = props => { | |||
validation_errors, | |||
} = contract; | |||
|
|||
const [contract_profit_or_loss, setContractProfitOrLoss] = React.useState({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changing input has lag because it's getting the value of inputs from contract. Adding local state for updating the view which is sync with contracts value improve this lag and fixes the performance issue.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
* add initial config of reports monorepo * add config to core * fix event-source-polyfil version * resolve build errors * move validator to utils * fix trader files * delete reports, change imports * fix root_store error * fix chunkName * fix direcory path * fix jest errors * fix directory * make separate emptyPrtfolioMessage in trader * fix aliases * add translation * fix code smell * reload tests * fix empty-portfolio-message conflicts * remove unnecessary css files and functions * remove deriv-charts package and unnecessary related files * fix import from trader in reports * remove duplicated files * change BinaryLink to NavLink * rerun tests * fix circular dependency * fix EHOIST_PKG_VERSION error * fix test * remove position-drawer-card from trader * remove duplicated scss * remove bottom-widget * fix reports loader * add contract, portfolio and chartbarrier stores to the core * use core portfolio and contract store in trader and reports * move markers component, helpers and constants to the core * remove all duplicated files from trader and reports * remove contract store from core exports * update reports packages version * remove commented imports * add getContactValidationRules to contact core * move duration test to shared * fix active_symbols store * fix moduleLoader in routes.config error * fix stores constructor * move contract-type file to trader * move validation-rules to trading * remove serverTime from shared * remove .js from imports * remove all commented lines * fix error when the trade_store in localStorage in not existd yet * clean the code * fix is_multiplier error issue using it from portfolio store * add props type to open-positions and position-drawer * change portfolio file name * add action for updating contract_type observable in portfolio store * update with latest master * remove comments * add shared to translation scripts/add deriv/reports to the build * remove redundant comment in contract-replay.jsx * remove connectionWithContractUpdate from reports * fix openPositions default tab issue * fix to not remove closed contracts when navigating from reporst to trader * prevent unmounting the portfolio component when redirecting to reports packge * fix performance issue on profit_loss input * fix circular dependancy Co-authored-by: Carol Sachdeva <58209918+carol-binary@users.noreply.github.com>
Changes:
Please include a summary of the change and which issue is fixed below:
When you need to add unit test
When you need to add integration test
Test coverage checklist (for reviewer)
Type of change