bug: heatmap
This commit is contained in:
parent
6f789a4284
commit
ac6320f6de
|
|
@ -13,6 +13,7 @@ import { DashboardSidebar } from "@/components/organisms/DashboardSidebar";
|
|||
import { DashboardShell } from "@/components/templates/DashboardShell";
|
||||
import { SignedOutPanel } from "@/components/auth/SignedOutPanel";
|
||||
import { ForgejoIssueMetricCards } from "@/components/git/ForgejoIssueMetricCards";
|
||||
import { ForgejoHeatmap } from "@/components/git/ForgejoHeatmap";
|
||||
import {
|
||||
DashboardMetricCard,
|
||||
DashboardInfoBlock,
|
||||
|
|
@ -969,12 +970,28 @@ export default function DashboardPage() {
|
|||
repositories={forgejoRepositories}
|
||||
isLoading={forgejoIssueMetricsLoading}
|
||||
error={forgejoIssueMetricsError}
|
||||
heatmapDays={forgejoHeatmapQuery.data?.days ?? []}
|
||||
heatmapMaxCount={forgejoHeatmapQuery.data?.max_count ?? 0}
|
||||
heatmapLoading={forgejoHeatmapQuery.isLoading}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-4">
|
||||
<section className="rounded-xl border border-[color:var(--border)] bg-[color:var(--surface)] p-4 shadow-lush md:p-6">
|
||||
<div className="mb-4">
|
||||
<h3 className="text-lg font-semibold text-strong">
|
||||
Git Activity
|
||||
</h3>
|
||||
<p className="mt-1 text-sm text-muted">
|
||||
Issue contributions across all tracked repositories in the
|
||||
last 12 months.
|
||||
</p>
|
||||
</div>
|
||||
<ForgejoHeatmap
|
||||
days={forgejoHeatmapQuery.data?.days ?? []}
|
||||
maxCount={forgejoHeatmapQuery.data?.max_count ?? 0}
|
||||
isLoading={forgejoHeatmapQuery.isLoading}
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 grid grid-cols-1 gap-4 xl:grid-cols-3">
|
||||
<DashboardInfoBlock title="Workload" rows={workloadRows} />
|
||||
<DashboardInfoBlock
|
||||
|
|
|
|||
|
|
@ -11,19 +11,15 @@ import {
|
|||
RefreshCw,
|
||||
} from "lucide-react";
|
||||
|
||||
import type { ForgejoHeatmapDay, ForgejoIssueMetrics, ForgejoRepository } from "@/lib/api-forgejo";
|
||||
import type { ForgejoIssueMetrics, ForgejoRepository } from "@/lib/api-forgejo";
|
||||
import { formatRelativeTimestamp } from "@/lib/formatters";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { ForgejoHeatmap } from "@/components/git/ForgejoHeatmap";
|
||||
|
||||
type ForgejoIssueMetricCardsProps = {
|
||||
metrics: ForgejoIssueMetrics | null;
|
||||
repositories: ForgejoRepository[];
|
||||
isLoading?: boolean;
|
||||
error?: string | null;
|
||||
heatmapDays?: ForgejoHeatmapDay[];
|
||||
heatmapMaxCount?: number;
|
||||
heatmapLoading?: boolean;
|
||||
};
|
||||
|
||||
type MetricTone = "accent" | "success" | "warning" | "danger" | "muted";
|
||||
|
|
@ -197,9 +193,6 @@ export function ForgejoIssueMetricCards({
|
|||
repositories,
|
||||
isLoading = false,
|
||||
error,
|
||||
heatmapDays = [],
|
||||
heatmapMaxCount = 0,
|
||||
heatmapLoading = false,
|
||||
}: ForgejoIssueMetricCardsProps) {
|
||||
const openIssues = metrics?.open_issues ?? 0;
|
||||
const recentlyClosed = metrics?.closed_last_7_days ?? 0;
|
||||
|
|
@ -290,16 +283,6 @@ export function ForgejoIssueMetricCards({
|
|||
</div>
|
||||
) : null}
|
||||
|
||||
<div className="mt-5 border-t border-[color:var(--border)] pt-4">
|
||||
<p className="mb-3 text-xs font-semibold uppercase tracking-[0.14em] text-muted">
|
||||
Issue Activity — Last 12 Months
|
||||
</p>
|
||||
<ForgejoHeatmap
|
||||
days={heatmapDays}
|
||||
maxCount={heatmapMaxCount}
|
||||
isLoading={heatmapLoading}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue