diff --git a/Backend/data/shareSymbols.txt b/Backend/data/shareSymbols.txt index 6753ef8d..279cf524 100644 --- a/Backend/data/shareSymbols.txt +++ b/Backend/data/shareSymbols.txt @@ -1 +1,7 @@ -IBM \ No newline at end of file +IBM +A +JPM-P-M +AMZN +AADI +K +FB \ No newline at end of file diff --git a/Frontend/src/components/common/SearchResultsTable.jsx b/Frontend/src/components/common/SearchResultsTable.jsx index e54c6f99..5282323d 100644 --- a/Frontend/src/components/common/SearchResultsTable.jsx +++ b/Frontend/src/components/common/SearchResultsTable.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import {Link} from 'react-router-dom'; +import {Link, useNavigate} from 'react-router-dom'; import {Avatar, Button, Grid, List, ListItem, ListItemButton, Typography, Tooltip} from '@mui/material'; import DoneIcon from '@mui/icons-material/Done'; import BookmarkBorderIcon from '@mui/icons-material/BookmarkBorder'; @@ -32,6 +32,11 @@ const SearchResultsTable = props => { return isAssetInWatchList; } + let navigate = useNavigate(); + const routeChange = path => { + navigate(path); + } + /** * Renders each item if the search results table * @param element @@ -88,17 +93,23 @@ const SearchResultsTable = props => { 0 ? 'flex-xl-row flex-grow-1 col-1 pe-4' : 'col-9 col-sm-10'}`}> - 0 && 'col-xl-8'}`} - fontSize={{ - lg: 16, - md: 15, - xs: 14 - }} + - {element.name ? element.name : element.symbol} - + 0 && 'col-xl-8'}`} + fontSize={{ + lg: 16, + md: 15, + xs: 14 + }} + > + {element.name ? element.name : element.symbol} + + 0 && 'ms-xl-3 text-xl-center'} col-lg-4`} @@ -112,7 +123,39 @@ const SearchResultsTable = props => { {element.assetType} - + {!props.watchListsArray && + + {routeChange(`../activities/addActivity/${element.assetType}/${element.symbol}/${element.name}`)}} + > + + + + + + + + } {props.watchListsArray && props.watchListsArray.length > 0 && { { - }} + onClick={() => {routeChange(`../activities/addActivity/${element.assetType}/${element.symbol}/${element.name}`)}} > { 0 ? 'col-12 col-sm-10 col-lg-9 col-xl-11' : 'col-12 col-sm-11 col-md-10 col-lg-11 col-xl-9'}`}> {props.searchResult.map((element, index) => { - return props.watchListsArray && props.watchListsArray.length > 0 ? - renderSearchResultList(element, index) - : ( - - {renderSearchResultList(element, index)} - - ) + return renderSearchResultList(element, index) })} ); diff --git a/Frontend/src/components/screens/Dashboard/PortfolioOverview.jsx b/Frontend/src/components/screens/Dashboard/PortfolioOverview.jsx index 167a81bf..1be6538e 100644 --- a/Frontend/src/components/screens/Dashboard/PortfolioOverview.jsx +++ b/Frontend/src/components/screens/Dashboard/PortfolioOverview.jsx @@ -5,7 +5,8 @@ import { Select, MenuItem, FormControl, - Typography + Typography, + IconButton } from '@mui/material'; import AddIcon from '@mui/icons-material/Add'; import SettingsIcon from '@mui/icons-material/Settings'; @@ -57,7 +58,13 @@ const PortfolioOverview = props => { - + {}} + > + + @@ -74,11 +81,11 @@ const PortfolioOverview = props => { Realised Gains - {portfolio['realisedGains']} + {new Intl.NumberFormat('de-DE', {style: 'currency', currency: 'EUR',}).format(portfolio['realisedGains'])} Dividends - 0,00€ + {new Intl.NumberFormat('de-DE', {style: 'currency', currency: 'EUR',}).format(portfolio['dividends'])} diff --git a/Frontend/src/routes/index.jsx b/Frontend/src/routes/index.jsx index c4d3c535..321e1d84 100644 --- a/Frontend/src/routes/index.jsx +++ b/Frontend/src/routes/index.jsx @@ -33,7 +33,7 @@ const emptyPortfolioData = { 'gains': 0, 'realisedGains': 0, 'totalGains': 0, - 'dividens': 0, + 'dividends': 0, 'performanceWithRealisedGains': 0, 'performanceWithoutRealisedGains': 0, 'shares': [], @@ -380,7 +380,7 @@ const AppRoutes = () => { tempPortfolioData[activePortfolio]['gains'] = dailyDataForValueDevelopment[latestDateWithData]['gains']; tempPortfolioData[activePortfolio]['realisedGains'] = dailyDataForValueDevelopment[latestDateWithData]['realisedGains']; tempPortfolioData[activePortfolio]['totalGains'] = dailyDataForValueDevelopment[latestDateWithData]['totalGains']; - tempPortfolioData[activePortfolio]['dividens'] = dailyDataForValueDevelopment[latestDateWithData]['dividens']; + tempPortfolioData[activePortfolio]['dividends'] = dailyDataForValueDevelopment[latestDateWithData]['dividends']; tempPortfolioData[activePortfolio]['fees'] = dailyDataForValueDevelopment[latestDateWithData]['fees']; tempPortfolioData[activePortfolio]['taxes'] = dailyDataForValueDevelopment[latestDateWithData]['taxes']; tempPortfolioData[activePortfolio]['performanceWithRealisedGains'] = dailyDataForPerformanceGraph[latestDateWithData]['performanceWithRealisedGains']; @@ -400,7 +400,7 @@ const AppRoutes = () => { if (assetDailyDataForValueDevelopment[dateKey] === undefined) return; //return equals continue in a forEach loop const portfolioDateData = dailyDataForValueDevelopment[dateKey] ? dailyDataForValueDevelopment[dateKey] : - {value: 0, invested: 0, gains: 0, realisedGains: 0, totalGains: 0, dividens: 0, taxes: 0, fees: 0}; + {value: 0, invested: 0, gains: 0, realisedGains: 0, totalGains: 0, dividends: 0, taxes: 0, fees: 0}; let assetDateData = assetDailyDataForValueDevelopment[dateKey]; dailyDataForValueDevelopment[dateKey] = {}; Object.keys(assetDateData).forEach(attribute => {