diff --git a/.changeset/past-event-submit-report.md b/.changeset/past-event-submit-report.md new file mode 100644 index 00000000..b5602294 --- /dev/null +++ b/.changeset/past-event-submit-report.md @@ -0,0 +1,5 @@ +--- +"ui": patch +--- + +Past events a community shows on its calendar get a **Submit report** button on the Events tab that opens the post-event report form in a new tab. Hidden or removed imports, drafts and cancelled events don't get it. diff --git a/tests/regression/browser/specs/owner-event-visibility.spec.ts b/tests/regression/browser/specs/owner-event-visibility.spec.ts index 1b90f152..e896c0a6 100644 --- a/tests/regression/browser/specs/owner-event-visibility.spec.ts +++ b/tests/regression/browser/specs/owner-event-visibility.spec.ts @@ -69,6 +69,13 @@ async function seedEventStates(nodeId: string) { status: "published", ...eventWindow(-3), }), + endedImport: await seedDiscoveryActivity({ + nodeId, + title: "Ended import", + status: "draft", + luma: { available: true, hidden: true }, + ...eventWindow(-2), + }), }; } @@ -156,6 +163,13 @@ test.describe("owner event visibility", () => { await expect(badge(events.ended.id)).toHaveAttribute("data-state", "ended", { timeout: 15000, }); + const report = page.getByTestId(`activity-editor.submit-report-${events.ended.id}`); + await expect(report).toHaveAttribute("href", /^https:\/\/docs\.google\.com\/forms\//); + await expect(report).toHaveAttribute("target", "_blank"); + await expect(badge(events.endedImport.id)).toHaveAttribute("data-state", "hiddenImport"); + await expect( + page.getByTestId(`activity-editor.submit-report-${events.endedImport.id}`), + ).toHaveCount(0); await page.getByTestId("activity-editor.tab-upcoming").click(); await badge(events.live.id).click(); diff --git a/ui/src/components/discovery/activity-editor.tsx b/ui/src/components/discovery/activity-editor.tsx index 57e5842f..3b8fa307 100644 --- a/ui/src/components/discovery/activity-editor.tsx +++ b/ui/src/components/discovery/activity-editor.tsx @@ -45,7 +45,7 @@ import { useClientValue } from "@/hooks"; import type { AppTranslator } from "@/i18n/catalogs"; import { useAppLocale, useAppTranslation } from "@/i18n/runtime"; import { buildEventTimeline } from "@/lib/event-timeline"; -import { isWaitingImport } from "@/lib/event-visibility"; +import { eventVisibility, isWaitingImport } from "@/lib/event-visibility"; import { type Activity, activitiesQueryOptions } from "./activity-form"; import { DiscoveryLoadError } from "./discovery-load-error"; import { useOpenEventStation } from "./event-onboarding"; @@ -54,6 +54,9 @@ import { EventVisibilityBadge, ImportsWaiting, useVisibilityContext } from "./ev import { LumaImport } from "./luma-import"; import { ReportContent } from "./report-content"; +const postEventReportUrl = + "https://docs.google.com/forms/d/e/1FAIpQLSdGTdQ9znOJbObaeef7NHAzXc04OygTLIOu6Qv1dKRx8Fwxxw/viewform"; + export function ActivityEditor({ nodeId, reviewImports = false, @@ -173,6 +176,20 @@ export function ActivityEditor({ {translate("common.edit")} )} + {eventVisibility(a, visibilityContext) === "ended" && ( + + )} {canOnboard && a.kind === "event" && a.status !== "cancelled" && (