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 { DashboardShell } from "@/components/templates/DashboardShell";
|
||||||
import { SignedOutPanel } from "@/components/auth/SignedOutPanel";
|
import { SignedOutPanel } from "@/components/auth/SignedOutPanel";
|
||||||
import { ForgejoIssueMetricCards } from "@/components/git/ForgejoIssueMetricCards";
|
import { ForgejoIssueMetricCards } from "@/components/git/ForgejoIssueMetricCards";
|
||||||
|
import { ForgejoHeatmap } from "@/components/git/ForgejoHeatmap";
|
||||||
import {
|
import {
|
||||||
DashboardMetricCard,
|
DashboardMetricCard,
|
||||||
DashboardInfoBlock,
|
DashboardInfoBlock,
|
||||||
|
|
@ -969,12 +970,28 @@ export default function DashboardPage() {
|
||||||
repositories={forgejoRepositories}
|
repositories={forgejoRepositories}
|
||||||
isLoading={forgejoIssueMetricsLoading}
|
isLoading={forgejoIssueMetricsLoading}
|
||||||
error={forgejoIssueMetricsError}
|
error={forgejoIssueMetricsError}
|
||||||
heatmapDays={forgejoHeatmapQuery.data?.days ?? []}
|
|
||||||
heatmapMaxCount={forgejoHeatmapQuery.data?.max_count ?? 0}
|
|
||||||
heatmapLoading={forgejoHeatmapQuery.isLoading}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</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">
|
<div className="mt-4 grid grid-cols-1 gap-4 xl:grid-cols-3">
|
||||||
<DashboardInfoBlock title="Workload" rows={workloadRows} />
|
<DashboardInfoBlock title="Workload" rows={workloadRows} />
|
||||||
<DashboardInfoBlock
|
<DashboardInfoBlock
|
||||||
|
|
|
||||||
|
|
@ -11,19 +11,15 @@ import {
|
||||||
RefreshCw,
|
RefreshCw,
|
||||||
} from "lucide-react";
|
} 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 { formatRelativeTimestamp } from "@/lib/formatters";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { ForgejoHeatmap } from "@/components/git/ForgejoHeatmap";
|
|
||||||
|
|
||||||
type ForgejoIssueMetricCardsProps = {
|
type ForgejoIssueMetricCardsProps = {
|
||||||
metrics: ForgejoIssueMetrics | null;
|
metrics: ForgejoIssueMetrics | null;
|
||||||
repositories: ForgejoRepository[];
|
repositories: ForgejoRepository[];
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
error?: string | null;
|
error?: string | null;
|
||||||
heatmapDays?: ForgejoHeatmapDay[];
|
|
||||||
heatmapMaxCount?: number;
|
|
||||||
heatmapLoading?: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type MetricTone = "accent" | "success" | "warning" | "danger" | "muted";
|
type MetricTone = "accent" | "success" | "warning" | "danger" | "muted";
|
||||||
|
|
@ -197,9 +193,6 @@ export function ForgejoIssueMetricCards({
|
||||||
repositories,
|
repositories,
|
||||||
isLoading = false,
|
isLoading = false,
|
||||||
error,
|
error,
|
||||||
heatmapDays = [],
|
|
||||||
heatmapMaxCount = 0,
|
|
||||||
heatmapLoading = false,
|
|
||||||
}: ForgejoIssueMetricCardsProps) {
|
}: ForgejoIssueMetricCardsProps) {
|
||||||
const openIssues = metrics?.open_issues ?? 0;
|
const openIssues = metrics?.open_issues ?? 0;
|
||||||
const recentlyClosed = metrics?.closed_last_7_days ?? 0;
|
const recentlyClosed = metrics?.closed_last_7_days ?? 0;
|
||||||
|
|
@ -290,16 +283,6 @@ export function ForgejoIssueMetricCards({
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : 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>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue