Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgerstmayr committed Jan 26, 2025
1 parent 085a8ba commit 290e2af
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test-js-update:
test-py:
uv run pytest

test: test-js test-py
test: test-py test-js

## Utils
run:
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/api/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export interface ConfigResponse {
currencies: Currency[];
};
operatingCurrencies: string[];
/** Fava date range */
dateRange: string;
}

export function useConfig() {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/api/series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface SeriesResponse {
}

export function useSeries(request: SeriesRequest): UseQueryResult<SeriesResponse> {
const params = new URLSearchParams(location.search);
const params = new URLSearchParams(location.search); // keep Fava's filters like ?time=...
params.set("investments", request.investmentFilter.join(","));
params.set("currency", request.targetCurrency);
params.set("series", request.series.join(","));
Expand All @@ -29,7 +29,7 @@ export function useSeries(request: SeriesRequest): UseQueryResult<SeriesResponse

export function useMultiSeries(requests: SeriesRequest[]) {
const urls = requests.map((request) => {
const params = new URLSearchParams(location.search);
const params = new URLSearchParams(location.search); // keep Fava's filters like ?time=...
params.set("investments", request.investmentFilter.join(","));
params.set("currency", request.targetCurrency);
params.set("series", request.series.join(","));
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ interface DashboardProps {
children?: React.ReactNode;
}
export function Dashboard({ children }: DashboardProps) {
// remove 1.5em padding from <article>
return (
<Stack
sx={{
flexDirection: "column",
// remove 1.5em padding from <article>
mx: "-1.5em",
marginBottom: "-1.5em",
padding: "1.5em",
Expand Down
7 changes: 1 addition & 6 deletions frontend/src/components/Header/TargetCurrencySelection.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import { ToggleButton, ToggleButtonGroup } from "@mui/material";
import { SyntheticEvent } from "react";
import { useToolbarContext } from "./ToolbarProvider";

export function TargetCurrencySelection() {
const { targetCurrency, setTargetCurrency, config: toolbarResponse } = useToolbarContext();

const handleChange = (_event: SyntheticEvent, value: string) => {
setTargetCurrency(value);
};

return (
<ToggleButtonGroup value={targetCurrency} exclusive onChange={handleChange}>
<ToggleButtonGroup value={targetCurrency} onChange={(_e, value) => setTargetCurrency(value)} exclusive>
{toolbarResponse.operatingCurrencies.map((currency) => (
<ToggleButton key={currency} value={currency}>
{currency}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/InvestmentsSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useToolbarContext } from "./Header/ToolbarProvider";
export interface InvestmentOption {
type: "Account" | "Group" | "Currency";
id: string;
/** text next to checkbox and search text */
/** text next to checkbox, and search text */
label: string;
chipLabel: string;
}
Expand Down
2 changes: 1 addition & 1 deletion src/fava_portfolio_returns/FavaPortfolioReturns.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/fava_portfolio_returns/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright 2021-2022 Martin Blais <[email protected]> and beangrow contributors
# Copyright 2024 Andreas Gerstmayr <[email protected]>
# Copyright 2025 Andreas Gerstmayr <[email protected]>
#
# The following code is a derivative work of the code from the beangrow project,
# which is licensed GPLv2. This code therefore is also licensed under the terms
Expand Down Expand Up @@ -151,7 +151,6 @@ def api_config(self):
return {
"investments": self.portfolio.investment_groups,
"operatingCurrencies": operating_currencies,
"dateRange": g.filtered.date_range,
}

@extension_endpoint("allocation") # type: ignore
Expand Down

0 comments on commit 290e2af

Please sign in to comment.