Compare commits

..

41 Commits

Author SHA1 Message Date
089381125f TopTags 2026-05-07 15:24:17 +05:30
1a5261ab25 removed dataKey 2026-05-07 15:23:58 +05:30
55b604f700 all periods 2026-05-07 15:23:50 +05:30
04b72d5843 correct comparison 2026-05-07 15:12:27 +05:30
b97e350b1b fixed height of bar 2026-05-07 15:09:04 +05:30
df5cf9fbb6 reading reportData instead of customized data. self massaging data for needed format 2026-05-07 15:04:28 +05:30
4b046c15a5 passing reportData instead of data 2026-05-07 15:04:02 +05:30
02eb55995e passing needed periods and group_by 2026-05-07 15:03:37 +05:30
4e56d86cdb passing clean periods and group_by params instead of periods[] and group_by[] params 2026-05-07 15:02:52 +05:30
15f76eb5f0 new report structure 2026-05-06 14:11:03 +05:30
7470da6d2d all period types 2026-05-05 13:26:35 +05:30
34594215f9 using new state management 2026-05-05 12:58:59 +05:30
0a92126b92 toggleComparison 2026-05-05 12:58:45 +05:30
30cf227050 state controlled by Dashboard.models.ts 2026-05-05 12:26:02 +05:30
a0e62b1bc4 fixes 2026-05-05 11:42:33 +05:30
ea3b451266 removed latest items for now 2026-05-05 11:42:27 +05:30
4b4875c3f5 removed latest items for now 2026-05-05 11:39:38 +05:30
25bd882b75 dashboard using report feature 2026-05-05 11:39:23 +05:30
f684083496 report models and prepareReport function 2026-05-05 11:39:07 +05:30
0e0928af95 report models and prepareReport function 2026-05-02 14:25:55 +05:30
7b0b3fb615 period selection 2026-05-01 17:40:54 +05:30
38f7416942 refactor period (rolling/calender) to periodType 2026-05-01 17:17:17 +05:30
e82cad4f21 refactor period (rolling/calender) to periodType 2026-05-01 17:15:16 +05:30
1daa90d091 refactor period (rolling/calender) to periodType 2026-05-01 17:13:13 +05:30
2d0b0bc470 fixes for correct comparison period 2026-05-01 17:07:35 +05:30
5f85abdf86 use full for fast loading than weekly for payee report 2026-05-01 16:59:56 +05:30
cc7e6509d2 theme changes 2026-04-25 13:47:42 +05:30
8a3ebdb1be better name 2026-04-25 13:22:49 +05:30
a36d9119bb configurable Dashboard.tsx 2026-04-25 13:21:34 +05:30
67d4c85146 fixes 2026-04-25 12:49:58 +05:30
89ad8e376e Progress Cards for Top Payees 2026-04-25 12:41:05 +05:30
71afc157ff proper use of react-openapi for resource api calls 2026-04-25 12:13:28 +05:30
5acbb7ccdd hiding report resource 2026-04-24 14:55:38 +05:30
3fd20f11ab hidden resource 2026-04-24 14:55:29 +05:30
922d05ae37 dashboard feature to use dashboard data 2026-04-24 14:41:19 +05:30
1fe44abfde removed client data massaging with backend report using feature/report 2026-04-24 14:27:20 +05:30
49bdb85088 refactored ProgressCard to component 2026-04-24 14:04:24 +05:30
b1509fd5ab refactored LatestItems to component 2026-04-24 14:01:49 +05:30
175ca64d1f refactored HistoryChart to component 2026-04-24 13:58:12 +05:30
c9e609fee6 header fixes 2026-04-11 11:23:06 +05:30
82264a5c34 color pallete 2026-04-07 13:47:55 +05:30
4 changed files with 13 additions and 29 deletions

View File

@@ -58,28 +58,19 @@ export default function HistoryChartView(props: ViewProps) {
const theme = useTheme();
const isDark = theme.palette.mode === "dark";
const total = currentData.length;
const maxStartIndex = Math.max(total - visibleCount, 0);
const clampedStartIndex = Math.min(startIndex, maxStartIndex);
const handleTabChange = (_: React.MouseEvent<HTMLElement>, newTab: string | null) => {
if (newTab !== null) setActiveTab(newTab);
};
const canGoLeft = clampedStartIndex > 0;
const canGoRight = clampedStartIndex < maxStartIndex;
const canGoLeft = startIndex > 0;
const canGoRight = startIndex + visibleCount < currentData.length;
const handlePrev = () => {
if (!canGoLeft) return;
setStartIndex((prev) => Math.max(prev - visibleCount, 0));
if (canGoLeft) setStartIndex((prev) => prev - visibleCount);
};
const handleNext = () => {
if (!canGoRight) return;
setStartIndex((prev) => {
const next = prev + visibleCount;
return Math.min(next, maxStartIndex);
});
if (canGoRight) setStartIndex((prev) => prev + visibleCount);
};
return (

View File

@@ -76,24 +76,14 @@ export default function TopTags({
arr.sort((a, b) => b.amount - a.amount);
const top = arr.slice(0, 4);
const top = arr.slice(0, 5);
const total = top.reduce((sum, t) => sum + t.amount, 0);
return { items: top, total };
}, [reportData, mode, selectedPeriodId]);
return (
<Box
sx={{
display: "grid",
gridTemplateColumns: {
xs: "1fr",
sm: "repeat(2, 1fr)",
md: "repeat(4, 1fr)"
},
gap: 2
}}
>
<Box sx={{ display: "grid", gap: 2 }}>
{items.map((item) => (
<ProgressCard
key={item.tag}
@@ -101,7 +91,6 @@ export default function TopTags({
progressAmount={item.amount}
totalAmount={total}
compact={compact}
colorTheme={mode === "expense" ? "error" : "success"}
/>
))}
</Box>

View File

@@ -22,6 +22,7 @@ export const configuration: DashboardConfig = {
id: "top-payees",
title: 'Top Payees',
component: TopTags,
isList: true,
settings: {
compact: true,
},

View File

@@ -83,7 +83,10 @@ function buildLabel(
return `${dayFmt.format(start)} - ${dayFmt.format(end)}`;
case "monthly":
return `${monthFmt.format(start)} ${yearFmt.format(start)}`;
if (sameMonth(start, end)) {
return `${monthFmt.format(start)} ${yearFmt.format(start)}`;
}
return `${monthDayFmt.format(start)} - ${monthDayFmt.format(end)}`;
case "yearly":
return yearFmt.format(start);
@@ -107,8 +110,8 @@ function decoratePeriods(
): (ReportPeriod & { id: string; label: string })[] {
return periods.map((p) => ({
...p,
id: buildPeriodId(type, new Date(p.start + "Z"), new Date(p.end + "Z")),
label: buildLabel(type, new Date(p.start + "Z"), new Date(p.end + "Z")),
id: buildPeriodId(type, new Date(p.start), new Date(p.end)),
label: buildLabel(type, new Date(p.start), new Date(p.end)),
}));
}