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

Add portfolio filter in Trades view #4005

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ public class Messages extends NLS
public static String MenuChartYZoomOut;
public static String MenuChangeUrl;
public static String MenuChooseClientFilter;
public static String MenuChooseClientFilterWithoutReferenceAccount;
public static String MenuConfigureChart;
public static String MenuConfigureCurrentDashboard;
public static String MenuConfigureDashboards;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,8 @@ MenuChartYZoomOut = Zoom out

MenuChooseClientFilter = Filter data by portfolio and reference account

MenuChooseClientFilterWithoutReferenceAccount = Filter data by portfolio

MenuConfigureChart = Configure chart

MenuConfigureCurrentDashboard = Configure dashboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,8 @@ MenuChartYZoomOut = Odd\u00E1lit

MenuChooseClientFilter = Filtrov\u00E1n\u00ED dat podle portfolia a referen\u010Dn\u00EDho \u00FA\u010Dtu

MenuChooseClientFilterWithoutReferenceAccount = Filtrov\u00E1n\u00ED dat podle portfolia

MenuConfigureChart = Nastaven\u00ED grafu

MenuConfigureCurrentDashboard = Nastaven\u00ED dashboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,8 @@ MenuChartYZoomOut = Zoom ud

MenuChooseClientFilter = Filtrer data efter portef\u00F8lje og referencekonto

MenuChooseClientFilterWithoutReferenceAccount = Filtrer data efter portef\u00F8lje

MenuConfigureChart = Konfigurer diagram

MenuConfigureCurrentDashboard = Konfigurer brugergr\u00E6nseflade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,8 @@ MenuChartYZoomOut = Y-Achse verkleinern

MenuChooseClientFilter = Daten nach Depot und Referenzkonto filtern

MenuChooseClientFilterWithoutReferenceAccount = Daten nach Depot filtern

MenuConfigureChart = Diagramm konfigurieren

MenuConfigureCurrentDashboard = Dashboard konfigurieren
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,8 @@ MenuChartYZoomOut = Alejar

MenuChooseClientFilter = Filtrar por cartera y cuenta

MenuChooseClientFilterWithoutReferenceAccount = Filtrar por cartera

MenuConfigureChart = Configurar gr\u00E1fico

MenuConfigureCurrentDashboard = Configurar Dashboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1782,6 +1782,8 @@ MenuChartYZoomOut = Zoom arri\u00E8re

MenuChooseClientFilter = Filtrer les donn\u00E9es par portefeuille et compte de r\u00E9f\u00E9rence

MenuChooseClientFilterWithoutReferenceAccount = Filtrer les donn\u00E9es par portefeuille

MenuConfigureChart = Configurer le graphique

MenuConfigureCurrentDashboard = Configurer le tableau de bord
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,8 @@ MenuChartYZoomOut = Riduci

MenuChooseClientFilter = Filtra i dati per portafoglio e conto di riferimento

MenuChooseClientFilterWithoutReferenceAccount = Filtra i dati per portafoglio

MenuConfigureChart = Configura grafico

MenuConfigureCurrentDashboard = Configura dashboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,8 @@ MenuChartYZoomOut = Uitzoomen

MenuChooseClientFilter = Gegevens filteren op portefeuilles en tegenrekeningen

MenuChooseClientFilterWithoutReferenceAccount = Gegevens filteren op portefeuilles

MenuConfigureChart = Grafiek configureren

MenuConfigureCurrentDashboard = Dashboard configureren
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,8 @@ MenuChartYZoomOut = Oddal

MenuChooseClientFilter = Filtruj dane wed\u0142ug portfela i konta odniesienia

MenuChooseClientFilterWithoutReferenceAccount = Filtruj dane wed\u0142ug portfela

MenuConfigureChart = Skonfiguruj wykres

MenuConfigureCurrentDashboard = Skonfiguruj panel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,8 @@ MenuChartYZoomOut = Diminuir zoom

MenuChooseClientFilter = Filtre dados por portf\u00F3lio e conta de refer\u00EAncia

MenuChooseClientFilterWithoutReferenceAccount = Filtre dados por portf\u00F3lio

MenuConfigureChart = Configurar gr\u00E1fico

MenuConfigureCurrentDashboard = Configurar painel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,8 @@ MenuChartYZoomOut = Diminuir zoom

MenuChooseClientFilter = Filtre dados por portf\u00F3lio e conta de refer\u00EAncia

MenuChooseClientFilterWithoutReferenceAccount = Filtre dados por portf\u00F3lio

MenuConfigureChart = Configurar gr\u00E1fico

MenuConfigureCurrentDashboard = Configurar painel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,8 @@ MenuChartYZoomOut = \u0423\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C

MenuChooseClientFilter = \u0424\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u044F \u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E \u043F\u043E\u0440\u0442\u0444\u043E\u043B\u0438\u043E \u0438 \u044D\u0442\u0430\u043B\u043E\u043D\u043D\u043E\u043C\u0443 \u0441\u0447\u0435\u0442\u0443

MenuChooseClientFilterWithoutReferenceAccount = \u0424\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u044F \u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E \u043F\u043E\u0440\u0442\u0444\u043E\u043B\u0438\u043E

MenuConfigureChart = \u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430 \u0433\u0440\u0430\u0444\u0438\u043A\u0430

MenuConfigureCurrentDashboard = \u041D\u0430\u0441\u0442\u0440\u043E\u0438\u0442\u044C \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u0443\u044E \u043F\u0430\u043D\u0435\u043B\u044C
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,8 @@ MenuChartYZoomOut = Oddiali\u0165

MenuChooseClientFilter = Filtrovanie \u00FAdajov pod\u013Ea portf\u00F3lia a referen\u010Dn\u00E9ho \u00FA\u010Dtu

MenuChooseClientFilterWithoutReferenceAccount = Filtrovanie \u00FAdajov pod\u013Ea portf\u00F3lia

MenuConfigureChart = Nastavenie grafu

MenuConfigureCurrentDashboard = Nastavenie pr\u00EDstrojovej dosky
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,8 @@ MenuChartYZoomOut = \u7F29\u5C0F

MenuChooseClientFilter = \u4EE5\u6295\u8D44\u7EC4\u5408\u4E0E\u5173\u8054\u8D26\u6237\u8FC7\u6EE4\u6570\u636E

MenuChooseClientFilterWithoutReferenceAccount = \u6309\u6295\u8D44\u7EC4\u5408\u7B5B\u9009\u6570\u636E

MenuConfigureChart = \u914D\u7F6E\u56FE\u8868

MenuConfigureCurrentDashboard = \u914D\u7F6E\u62A5\u8868
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,8 @@ MenuChartYZoomOut = \u7E2E\u5C0F

MenuChooseClientFilter = \u6309\u6295\u8CC7\u7D44\u5408\u548C\u53C3\u8003\u5E33\u6236\u5C07\u6578\u64DA\u904E\u6FFE

MenuChooseClientFilterWithoutReferenceAccount = \u6309\u6295\u8CC7\u7D44\u5408\u904E\u6FFE\u6578\u64DA

MenuConfigureChart = \u8A2D\u5B9A\u5716\u8868

MenuConfigureCurrentDashboard = \u8A2D\u5B9A\u5831\u8868
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,52 @@ public ClientFilterMenu(Client client, IPreferenceStore preferences)
loadCustomItems();
}

public ClientFilterMenu(Client client, IPreferenceStore preferences, boolean withReferenceAccount)
{
this.client = client;
this.preferences = preferences;
this.filterConfig = client.getSettings()
.getConfigurationSet(WellKnownConfigurationSets.CLIENT_FILTER_DEFINITIONS);

selectedItem = new Item("", Messages.PerformanceChartLabelEntirePortfolio, "", //$NON-NLS-1$ //$NON-NLS-2$
ClientFilter.NO_FILTER);
defaultItems.add(selectedItem);
if (withReferenceAccount)
{
client.getActivePortfolios().forEach(portfolio -> {
defaultItems.add(new Item(portfolio.getUUID(), portfolio.getName(), portfolio.getUUID(),
new PortfolioClientFilter(portfolio)));
defaultItems.add(new Item(portfolio.getUUID() + "," + portfolio.getReferenceAccount().getUUID(), //$NON-NLS-1$
portfolio.getName() + " + " + portfolio.getReferenceAccount().getName(), //$NON-NLS-1$
portfolio.getUUID() + "," + portfolio.getReferenceAccount().getUUID(), //$NON-NLS-1$
new PortfolioClientFilter(portfolio, portfolio.getReferenceAccount())));
});
}
else // do not fetch ReferenceAccount
{
client.getActivePortfolios().forEach(portfolio -> {
defaultItems.add(new Item(portfolio.getUUID(), portfolio.getName(), portfolio.getUUID(),
new PortfolioClientFilter(portfolio)));
});

}

loadCustomItems();

}

public ClientFilterMenu(Client client, IPreferenceStore preferences, Consumer<ClientFilter> listener)
{
this(client, preferences);
this.listeners.add(listener);
}

public ClientFilterMenu(Client client, IPreferenceStore preferences, Consumer<ClientFilter> listener,
boolean withReferenceAccount)
{
this(client, preferences, withReferenceAccount);
this.listeners.add(listener);
}
private void loadCustomItems()
{
filterConfig.getConfigurations().forEach(conf -> {
Expand Down
Loading