Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/past-event-submit-report.md
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 14 additions & 0 deletions tests/regression/browser/specs/owner-event-visibility.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}),
};
}

Expand Down Expand Up @@ -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();
Expand Down
19 changes: 18 additions & 1 deletion ui/src/components/discovery/activity-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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,
Expand Down Expand Up @@ -173,6 +176,20 @@ export function ActivityEditor({
{translate("common.edit")}
</Button>
)}
{eventVisibility(a, visibilityContext) === "ended" && (
<Button
size="sm"
variant="outline"
data-testid={`activity-editor.submit-report-${a.id}`}
nativeButton={false}
render={(props) => (
<a {...props} href={postEventReportUrl} target="_blank" rel="noopener noreferrer" />
)}
>
{translate("events.submitReport")}
<ArrowUpRightIcon />
</Button>
)}
{canOnboard && a.kind === "event" && a.status !== "cancelled" && (
<DropdownMenu>
<DropdownMenuTrigger
Expand Down
1 change: 1 addition & 0 deletions ui/src/i18n/messages/discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ export const discoveryMessages = createMessageCatalogs(["en", "es", "fr", "zh"],
"Lancer un point d'inscription",
"开始站点",
],
"events.submitReport": ["Submit report", "Enviar informe", "Envoyer le rapport", "提交报告"],
"events.summary": ["Summary", "Resumen", "Résumé", "摘要"],
"events.syncFailed": [
"Sync failed",
Expand Down
Loading