From c8c40e74adcd4d7b0dec88a33a7475c8e0b6856c Mon Sep 17 00:00:00 2001 From: OlliL Date: Tue, 31 Dec 2024 00:24:22 +0100 Subject: [PATCH] include ETFs in Trends View --- src/model/report/Trends.ts | 1 + src/model/report/TrendsParameter.ts | 1 + src/service/ReportService.ts | 3 ++ src/views/etf/ListEtfs.vue | 7 --- src/views/reports/ShowTrends.vue | 81 ++++++++++++++++++++++++++--- 5 files changed, 80 insertions(+), 13 deletions(-) diff --git a/src/model/report/Trends.ts b/src/model/report/Trends.ts index 471f194..29b4595 100644 --- a/src/model/report/Trends.ts +++ b/src/model/report/Trends.ts @@ -3,4 +3,5 @@ import type { TrendsMonthAmount } from "./TrendsMonthAmount"; export type Trends = { trendsSettled?: Array; trendsCalculated?: Array; + trendsEtfs?: Array; }; diff --git a/src/model/report/TrendsParameter.ts b/src/model/report/TrendsParameter.ts index 2a7a934..1ef3620 100644 --- a/src/model/report/TrendsParameter.ts +++ b/src/model/report/TrendsParameter.ts @@ -2,4 +2,5 @@ export type TrendsParameter = { startDate: Date; endDate: Date; selectedCapitalsourceIds?: Array; + selectedEtfIds?: Array; }; diff --git a/src/service/ReportService.ts b/src/service/ReportService.ts index 59cfc41..0ff3cf6 100644 --- a/src/service/ReportService.ts +++ b/src/service/ReportService.ts @@ -106,6 +106,7 @@ class ReportService extends AbstractService { endDate: new Date(showTrendsFormResponse.maxDate), selectedCapitalsourceIds: showTrendsFormResponse.settingTrendCapitalsourceIds, + selectedEtfIds: showTrendsFormResponse.settingTrendEtfIds, }; return trendsTransporter; @@ -117,6 +118,7 @@ class ReportService extends AbstractService { request.startDate = getISOStringDate(trendsParameter.startDate); request.endDate = getISOStringDate(trendsParameter.endDate); request.capitalSourceIds = trendsParameter.selectedCapitalsourceIds; + request.etfIds = trendsParameter.selectedEtfIds; const response = await this.api.showTrendsGraph(request); @@ -125,6 +127,7 @@ class ReportService extends AbstractService { const result: Trends = { trendsCalculated: showTrendsGraphResponse.trendsCalculatedTransports, trendsSettled: showTrendsGraphResponse.trendsSettledTransports, + trendsEtfs: showTrendsGraphResponse.trendsEtfTransports, }; return result; diff --git a/src/views/etf/ListEtfs.vue b/src/views/etf/ListEtfs.vue index 4f39453..f1605f3 100644 --- a/src/views/etf/ListEtfs.vue +++ b/src/views/etf/ListEtfs.vue @@ -122,13 +122,6 @@ const reloadView = () => { CrudEtfService.fetchAllEtf() .then((_etfs) => { - _etfs.sort((a, b) => { - if (!a.name && !b.name) return 0; - else if (!a.name) return -1; - else if (!b.name) return 1; - - return a.name.toUpperCase().localeCompare(b.name.toUpperCase()); - }); allEtfs.value = _etfs; searchContent(); }) diff --git a/src/views/reports/ShowTrends.vue b/src/views/reports/ShowTrends.vue index a20f1c6..65a5fec 100644 --- a/src/views/reports/ShowTrends.vue +++ b/src/views/reports/ShowTrends.vue @@ -68,6 +68,30 @@ +
+
+ + +
+
+