Skip to content
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

Merged

Conversation

mahdiyeh-deriv
Copy link
Contributor

@mahdiyeh-deriv mahdiyeh-deriv commented Jun 2, 2022

Changes:

Please include a summary of the change and which issue is fixed below:

  • Separate reports as a independent package from Trader
  • Move portfolio-store, contract-store, contract-trade-store, contract-replay-store from trader to core.

When you need to add unit test

  • If this change disrupt current flow
  • If this change is adding new flow

When you need to add integration test

  • If components from external libraries are being used to define the flow, e.g. @deriv/components
  • If it relies on a very specific set of props with no default behavior for the current component.

Test coverage checklist (for reviewer)

  • Ensure utility / function has a test case
  • Ensure all the tests are passing

Type of change

  • Bug fix
  • New feature
  • Update feature
  • Refactor code
  • Translation to code
  • Translation to crowdin
  • Script configuration
  • Improve performance
  • Style only
  • Dependency update
  • Documentation update
  • Release

mahdiyeh-deriv and others added 30 commits March 17, 2022 18:20
@@ -95,7 +97,11 @@ const Routes = ({
}, []);

React.useEffect(() => {
return () => onUnmountPortfolio();
if (is_reports_url) {
Copy link
Contributor Author

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.

matin-deriv
matin-deriv previously approved these changes Jul 1, 2022
@@ -44,6 +44,11 @@ const ContractUpdateForm = props => {
validation_errors,
} = contract;

const [contract_profit_or_loss, setContractProfitOrLoss] = React.useState({
Copy link
Contributor Author

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.

@carolsachdeva carolsachdeva merged commit 4329cac into binary-com:master Jul 7, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jul 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
3.9% 3.9% Duplication

likhith-deriv pushed a commit to likhith-deriv/deriv-app that referenced this pull request Jul 17, 2022
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants