diff --git a/apps/web/app/(app)/actions.ts b/apps/web/app/(app)/actions.ts index c1c484f5..9e8ac290 100644 --- a/apps/web/app/(app)/actions.ts +++ b/apps/web/app/(app)/actions.ts @@ -52,6 +52,8 @@ import { setTaskBudget, type Budget, setProjectSecret, + setNeedDone, + removeNeed, deleteProjectSecret, reencryptAll, markSecretRotated, @@ -646,6 +648,23 @@ export async function saveProjectSecretAction(f: FormData) { }); } +// PEP-112: «чтобы заработало по-настоящему» on the «Ваш продукт» card. +export async function setNeedDoneAction(f: FormData) { + const user = asWebActor(await requireUser()); + await attempt(f, async () => { + const project = await projectForUser(db, user.id, Number(str(f, "projectId"))); + await setNeedDone(db, project.id, str(f, "id"), str(f, "done") !== "0"); + }); +} + +export async function removeNeedAction(f: FormData) { + const user = asWebActor(await requireUser()); + await attempt(f, async () => { + const project = await projectForUser(db, user.id, Number(str(f, "projectId"))); + await removeNeed(db, project.id, str(f, "id")); + }); +} + export async function deleteProjectSecretAction(f: FormData) { const user = asWebActor(await requireUser()); await attempt(f, async () => { diff --git a/apps/web/app/(app)/p/[key]/page.tsx b/apps/web/app/(app)/p/[key]/page.tsx index 938ab43a..abc9eea5 100644 --- a/apps/web/app/(app)/p/[key]/page.tsx +++ b/apps/web/app/(app)/p/[key]/page.tsx @@ -4,7 +4,7 @@ import { notFound } from "next/navigation"; import { ExternalLink, Plus, Rocket, SquareTerminal } from "lucide-react"; import { columnOf, currentReleases, describeRepo, isPlatform, listReleases, bugsinkWebhookBase, openPulls, platformReleaseCandidate, platformReleaseOffers, ownPendingLogins, readAgentsMd, repoOverview, type Release, sharedRequest } from "@peppa/runner"; import { poolSubscriptions, userProjectIds, projectProduct, discussionUnread, ensureProjectChat, listHosts, DEFAULT_RUNNER_SETTINGS, DEFAULT_AGENT_SETTINGS, getProjectAgentSettings, getSystemAgentSettings, getProjectRunnerSettings, getSystemRunnerSettings, blockedLabel, blockersMap, epicProgress, progressLabel, taskProgress, getProjectBudget, listJournal, listProjectSecrets, projectMetrics, type ActorChannel, type ActorKind, getAutonomy, getIncidentSettings, getReviewSettings, isSuperadmin, listEpics, listErrorSources, listIncidents, listMembers, listPools, listSpecs, taskAgentNames, getIntakeSettings, intakePendingTasks, projectAgentWarning, memoryStats, readMemory, projectPool, sharedPool, ownPool, poolOverview, repoAudience, repoVisibilityLabel } from "@peppa/core"; -import { PRODUCT_PROJECT_TABS } from "@peppa/core"; +import { productNeeds, lastProductReview } from "@peppa/core"; import { LiveRefresh } from "@/components/LiveRefresh"; import { PanelSection } from "@/components/ActivityAside"; import { Board, type Card } from "@/components/Board"; @@ -156,6 +156,7 @@ export default async function ProjectPage({ params, searchParams }: { params: Pr const specs = tab === "specs" ? listSpecs(p) : []; const agentsMd = tab === "agents" ? await readAgentsMd(db, p) : null; const product = await projectProduct(db, p.id); + const [productNeedList, productReview] = await Promise.all([productNeeds(db, p.id), lastProductReview(db, p.id)]); // The chat belongs to the project's people; a superadmin looking at someone else's project has none. const canChat = (await userProjectIds(db, user.id)).includes(p.id); const sharedReq = await sharedRequest(db, p.id); @@ -487,7 +488,7 @@ export default async function ProjectPage({ params, searchParams }: { params: Pr

)} - {tab === "board" && } + {tab === "board" && }