PEP-86: the Home page shows only the user's own projects
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
54182d0637
commit
aecd9363ad
@ -1,7 +1,7 @@
|
||||
import Link from "next/link";
|
||||
import type { ProgressOverview as Overview, ProjectProgress } from "@peppa/core";
|
||||
import { AgentBadge } from "@/components/AgentBadge";
|
||||
import { Disclosure, Empty, Key } from "@/components/common";
|
||||
import { Empty, Key } from "@/components/common";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const PARTS = [
|
||||
@ -85,9 +85,9 @@ function ProjectRow({ p }: { p: ProjectProgress }) {
|
||||
);
|
||||
}
|
||||
|
||||
/** PEP-77: progress of all stories and projects on the Home page. */
|
||||
/** PEP-77: progress of the user's own projects on the Home page (other people's projects — on «Проекты», for a superadmin). */
|
||||
export function ProgressOverview({ data }: { data: Overview }) {
|
||||
if (!data.mine.length && !data.others.length) return <Empty>Проектов пока нет — прогресс появится с первой стори.</Empty>;
|
||||
if (!data.mine.length) return <Empty>Проектов пока нет — прогресс появится с первой стори.</Empty>;
|
||||
const t = data.totals;
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
@ -108,15 +108,6 @@ export function ProgressOverview({ data }: { data: Overview }) {
|
||||
<ProjectRow key={p.key} p={p} />
|
||||
))}
|
||||
</ul>
|
||||
{data.others.length > 0 && (
|
||||
<Disclosure summary={`Проекты других — ${data.others.length}`}>
|
||||
<ul className="m-0 mt-2 flex list-none flex-col gap-2 p-0">
|
||||
{data.others.map((p) => (
|
||||
<ProjectRow key={p.key} p={p} />
|
||||
))}
|
||||
</ul>
|
||||
</Disclosure>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user