Add portfolio filter in Trades view #4005
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1597 (except the Filter by date range (applied on the Close Date)..)
Issue: https://forum.portfolio-performance.info/t/weitere-filter-bei-trades-unter-dem-reiter-berichte-fur-einzelne-depots/21955
Issue: https://forum.portfolio-performance.info/t/trades-filtern/18171
Issue: https://forum.portfolio-performance.info/t/trades-nach-offen-vs-geschlossen-filtern/11208/5, fifth post
Hello this is a proposition to add to the Trades view a filter by account, in addition to the onlyOpen/onlyClose/onlyProfitable/onlyLoss already existing filtering options.
I have also added in the search box the possibility to search in the Portfolio column (second commit).
Note 1: I am thinking a little change to the
clientFilterMenu
, allowing to give the possibility to only fetch Portfolio account and custom filter account (instead of fetching Portfolio account + (Portfolio +Deposit account) +custom filter account) may be good, .I do not see the value of a (Portfolio + Deposit account) filter here for example, since, if I am not mistaken, it is the same filter as the Portfolio account only. Same for the
SecuritiesPerformanceView
(which is the reference for this commit's code). So the Portfolio +Deposit account takes a lot of place in the menu for nothing in those two views.Edit: updated as per fourth commit. Indeed, if we confirm that Ref accounts have no added value here, it may better to exclude them right from the start of the feature, in order to not have to deal with retrocompatibility for already selected "Portfolio+Ref Account".
Note 2 : I kept the existing logic around "hasPreselectedTrades" , but I have no idea of what this is supposed to do. Are we supposed to get a additional filter action in the menu with it ? See lines 289-293 of the current before commits
TradeDetailsView
. I have never managed to get such menu line appear in the current release of PP.