From 677435ceda6d479c9a959412e5b9b56cb4926957 Mon Sep 17 00:00:00 2001 From: max-1-max <201788345+max-1-max@users.noreply.github.com> Date: Fri, 27 Nov 2026 07:12:19 +0000 Subject: [PATCH 1/2] Add illustrated empty states to the Audience pages Overview, Contacts, Segments, Campaigns and Signup forms now show an illustration from the blank slate set when there is nothing to list. Search misses, filtered lists and the other campaign tabs keep their icon and text. The Signup forms empty state also gets a New form button. --- frontend/public/blank-slate/audience-campaigns.svg | 5 +++++ frontend/public/blank-slate/audience-contacts.svg | 5 +++++ frontend/public/blank-slate/audience-overview.svg | 5 +++++ frontend/public/blank-slate/audience-segments.svg | 5 +++++ frontend/public/blank-slate/audience-signup-forms.svg | 5 +++++ frontend/src/ee/crm/components/Audience.module.scss | 10 ++++++++++ .../crm/components/routes/AudienceCampaigns/index.tsx | 4 +++- .../crm/components/routes/AudienceContacts/index.tsx | 4 +++- .../ee/crm/components/routes/AudienceForms/index.tsx | 4 ++++ .../crm/components/routes/AudienceOverview/index.tsx | 3 +-- .../crm/components/routes/AudienceSegments/index.tsx | 4 ++-- 11 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 frontend/public/blank-slate/audience-campaigns.svg create mode 100644 frontend/public/blank-slate/audience-contacts.svg create mode 100644 frontend/public/blank-slate/audience-overview.svg create mode 100644 frontend/public/blank-slate/audience-segments.svg create mode 100644 frontend/public/blank-slate/audience-signup-forms.svg diff --git a/frontend/public/blank-slate/audience-campaigns.svg b/frontend/public/blank-slate/audience-campaigns.svg new file mode 100644 index 0000000000..bcac6e82cc --- /dev/null +++ b/frontend/public/blank-slate/audience-campaigns.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/public/blank-slate/audience-contacts.svg b/frontend/public/blank-slate/audience-contacts.svg new file mode 100644 index 0000000000..f10bc80485 --- /dev/null +++ b/frontend/public/blank-slate/audience-contacts.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/public/blank-slate/audience-overview.svg b/frontend/public/blank-slate/audience-overview.svg new file mode 100644 index 0000000000..28d206c7eb --- /dev/null +++ b/frontend/public/blank-slate/audience-overview.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/public/blank-slate/audience-segments.svg b/frontend/public/blank-slate/audience-segments.svg new file mode 100644 index 0000000000..744ad1bb05 --- /dev/null +++ b/frontend/public/blank-slate/audience-segments.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/public/blank-slate/audience-signup-forms.svg b/frontend/public/blank-slate/audience-signup-forms.svg new file mode 100644 index 0000000000..51d16b00a7 --- /dev/null +++ b/frontend/public/blank-slate/audience-signup-forms.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/src/ee/crm/components/Audience.module.scss b/frontend/src/ee/crm/components/Audience.module.scss index 029136074b..677615065d 100644 --- a/frontend/src/ee/crm/components/Audience.module.scss +++ b/frontend/src/ee/crm/components/Audience.module.scss @@ -154,6 +154,16 @@ $surface: var(--mantine-color-gray-0); } } +.emptyImage { + width: 200px; + height: 200px; + + &[data-compact] { + width: 140px; + height: 140px; + } +} + .firstRun { padding: 6px 18px 16px; diff --git a/frontend/src/ee/crm/components/routes/AudienceCampaigns/index.tsx b/frontend/src/ee/crm/components/routes/AudienceCampaigns/index.tsx index 3e126e12e9..65b8449ed4 100644 --- a/frontend/src/ee/crm/components/routes/AudienceCampaigns/index.tsx +++ b/frontend/src/ee/crm/components/routes/AudienceCampaigns/index.tsx @@ -301,7 +301,9 @@ const AudienceCampaigns = () => { {campaignsQuery.data && campaigns.length === 0 && (
- + {debouncedQuery || filter !== 'all' + ? + : }

{debouncedQuery ? t`No campaigns match your search.` : emptyCopy[filter]}

diff --git a/frontend/src/ee/crm/components/routes/AudienceContacts/index.tsx b/frontend/src/ee/crm/components/routes/AudienceContacts/index.tsx index bb4b87f554..c7a45d3d68 100644 --- a/frontend/src/ee/crm/components/routes/AudienceContacts/index.tsx +++ b/frontend/src/ee/crm/components/routes/AudienceContacts/index.tsx @@ -315,7 +315,9 @@ const AudienceContacts = () => { {meta?.total === 0 && (
- {isSuppressed ? : } + {isSuppressed && } + {!isSuppressed && isFiltered && } + {!isSuppressed && !isFiltered && }

{emptyMessage()}

{isFiltered && ( From 2422ab6c55767aaf560b3af1f9972fd05222a3fe Mon Sep 17 00:00:00 2001 From: max-1-max <201788345+max-1-max@users.noreply.github.com> Date: Fri, 27 Nov 2026 07:23:23 +0000 Subject: [PATCH 2/2] Let organizers change resale settings on the resale page The resale page gets a settings bar with the on/off switch and the cutoff, saved straight away, in place of the link to checkout settings. Turning resale on or off asks first: turning it on shows the full explanation, including the chargeback sentence, and turning it off says what happens to listed tickets. The switch still needs the refund permission, and members who cannot edit see no controls. --- .../rules/features/ticket-transfer-resale.md | 2 +- e2e/pages/resale.page.ts | 17 + e2e/tests/management/resale-settings.spec.ts | 25 ++ .../routes/event/Resale/Resale.module.scss | 70 +++- .../routes/event/Resale/ResaleSettings.tsx | 97 +++++ .../components/routes/event/Resale/index.tsx | 23 +- .../HomepageAndCheckoutSettings/index.tsx | 27 +- frontend/src/locales/cs.js | 2 +- frontend/src/locales/cs.po | 334 ++++++++++-------- frontend/src/locales/de.js | 2 +- frontend/src/locales/de.po | 334 ++++++++++-------- frontend/src/locales/el.js | 2 +- frontend/src/locales/el.po | 334 ++++++++++-------- frontend/src/locales/en.js | 2 +- frontend/src/locales/en.po | 334 ++++++++++-------- frontend/src/locales/es.js | 2 +- frontend/src/locales/es.po | 334 ++++++++++-------- frontend/src/locales/fi.js | 2 +- frontend/src/locales/fi.po | 334 ++++++++++-------- frontend/src/locales/fr.js | 2 +- frontend/src/locales/fr.po | 334 ++++++++++-------- frontend/src/locales/hu.js | 2 +- frontend/src/locales/hu.po | 334 ++++++++++-------- frontend/src/locales/it.js | 2 +- frontend/src/locales/it.po | 334 ++++++++++-------- frontend/src/locales/ja.js | 2 +- frontend/src/locales/ja.po | 334 ++++++++++-------- frontend/src/locales/ko.js | 2 +- frontend/src/locales/ko.po | 334 ++++++++++-------- frontend/src/locales/nl.js | 2 +- frontend/src/locales/nl.po | 334 ++++++++++-------- frontend/src/locales/pl.js | 2 +- frontend/src/locales/pl.po | 334 ++++++++++-------- frontend/src/locales/pt-br.js | 2 +- frontend/src/locales/pt-br.po | 334 ++++++++++-------- frontend/src/locales/pt.js | 2 +- frontend/src/locales/pt.po | 334 ++++++++++-------- frontend/src/locales/ru.js | 2 +- frontend/src/locales/ru.po | 334 ++++++++++-------- frontend/src/locales/se.js | 2 +- frontend/src/locales/se.po | 334 ++++++++++-------- frontend/src/locales/sk.js | 2 +- frontend/src/locales/sk.po | 334 ++++++++++-------- frontend/src/locales/tr.js | 2 +- frontend/src/locales/tr.po | 334 ++++++++++-------- frontend/src/locales/vi.js | 2 +- frontend/src/locales/vi.po | 334 ++++++++++-------- frontend/src/locales/zh-cn.js | 2 +- frontend/src/locales/zh-cn.po | 334 ++++++++++-------- frontend/src/locales/zh-hk.js | 2 +- frontend/src/locales/zh-hk.po | 334 ++++++++++-------- frontend/src/utilites/cutoffOptions.ts | 22 ++ frontend/src/utilites/ticketResaleCopy.ts | 7 + 53 files changed, 4297 insertions(+), 3385 deletions(-) create mode 100644 frontend/src/components/routes/event/Resale/ResaleSettings.tsx create mode 100644 frontend/src/utilites/cutoffOptions.ts create mode 100644 frontend/src/utilites/ticketResaleCopy.ts diff --git a/.claude/rules/features/ticket-transfer-resale.md b/.claude/rules/features/ticket-transfer-resale.md index a02c529854..18d742391a 100644 --- a/.claude/rules/features/ticket-transfer-resale.md +++ b/.claude/rules/features/ticket-transfer-resale.md @@ -58,7 +58,7 @@ paths: - Buyer resale lives on the order page only: `useTicketResaleActions(orderLink, timezone)` verifies first, then opens `SellTicketModal` with the estimate. A listed ticket shows `TicketResaleListed` and none of the ticket link, print, transfer or edit actions. The ticket page never offers sell or withdraw, because the link may belong to a guest. - `AttendeeTicket` replaces the QR code when `resale.status` is `LISTED` or `SOLD`, which covers the ticket page and both print views. Never render the QR code for a listed ticket anywhere else. - E2E: `e2e/utils/resale.ts` (`markOrderPaidThroughStripe`) turns an offline-paid order into one paid through Stripe, which is all a listing needs; no real Stripe. -- Organizer oversight is `/manage/event/:id/resale` (`routes/event/Resale`); the failed-refund email links to that exact path. The status filter is server-side (`filter_fields[status]`); "Needs attention" is a client-side filter over the Sold page because the API cannot filter it. The Refund column shows only when the payload carries the money fields, "Close listing" needs `EDIT` and "Retry refund" needs `ISSUE_REFUNDS` as well. The organizer attendee payload's `resale` is `{status, sold_order_id, sold_order_public_id}`: a resold attendee shows "Resold" with the replacement order and no Activate action. +- Organizer oversight is `/manage/event/:id/resale` (`routes/event/Resale`); the failed-refund email links to that exact path. Its settings bar (`ResaleSettings`) saves `allow_ticket_resale` and `ticket_resale_cutoff_minutes` straight away through the same partial update as checkout settings: the switch always asks first (turning on shows `ticketResaleDescription()`, which carries the chargeback sentence), needs `ISSUE_REFUNDS`, and members without `EDIT` see no controls. The status filter is server-side (`filter_fields[status]`); "Needs attention" is a client-side filter over the Sold page because the API cannot filter it. The Refund column shows only when the payload carries the money fields, "Close listing" needs `EDIT` and "Retry refund" needs `ISSUE_REFUNDS` as well. The organizer attendee payload's `resale` is `{status, sold_order_id, sold_order_public_id}`: a resold attendee shows "Resold" with the replacement order and no Activate action. - E2E for organizer pages: `e2e/utils/resale-listings.ts` (`seedResaleListing`) inserts listings in any stored state. A retried refund stays `PENDING` when the replacement order has no platform-fee row, so settle it (`settleResaleRefund`) when the test ends. ## Resale diff --git a/e2e/pages/resale.page.ts b/e2e/pages/resale.page.ts index c6c4833e3e..55b404f2a1 100644 --- a/e2e/pages/resale.page.ts +++ b/e2e/pages/resale.page.ts @@ -32,6 +32,23 @@ export class ResalePage { return this.page.getByTestId('resale-attention-summary'); } + enabledSwitch(): Locator { + return this.page.getByTestId('resale-enabled-switch'); + } + + cutoffSelect(): Locator { + return this.page.getByTestId('resale-cutoff-select'); + } + + async toggleResale(): Promise { + await this.enabledSwitch().click({ force: true }); + } + + async chooseCutoff(label: string): Promise { + await this.cutoffSelect().click(); + await this.page.getByRole('option', { name: label }).click(); + } + async filterBy(status: 'All' | 'Open' | 'Sold' | 'Closed'): Promise { await this.page.getByRole('radiogroup', { name: 'Filter by status' }).getByText(status, { exact: true }).click(); } diff --git a/e2e/tests/management/resale-settings.spec.ts b/e2e/tests/management/resale-settings.spec.ts index 5eb1faf27d..8abdcb47a3 100644 --- a/e2e/tests/management/resale-settings.spec.ts +++ b/e2e/tests/management/resale-settings.spec.ts @@ -1,6 +1,7 @@ import { test, expect } from '../../fixtures'; import { EventSettingsPage } from '../../pages/event-settings.page'; import { ProductEditPage } from '../../pages/product-edit.page'; +import { ResalePage } from '../../pages/resale.page'; import { WebhookPage } from '../../pages/webhook.page'; import { createFreshOrganizer, createLiveEventWithFreeTicket } from '../../api/factory'; @@ -25,6 +26,30 @@ test.describe('organizer controls for ticket resale', () => { expect((await api.getEventSettings(event.eventId)).ticket_resale_cutoff_minutes).toBe(1440); }); + test('an organizer turns resale on, moves the cutoff and turns it off again from the resale page', async ({ authedPage, api, account }) => { + const event = await createLiveEventWithFreeTicket(api, account.organizerId); + + const resale = new ResalePage(authedPage); + await resale.goto(event.eventId); + await expect(resale.enabledSwitch()).not.toBeChecked(); + await expect(resale.cutoffSelect()).toBeDisabled(); + + await resale.toggleResale(); + const turnOn = authedPage.getByRole('dialog', { name: 'Turn on ticket resale?' }); + await expect(turnOn.getByText('that chargeback is at your risk, as with any sale.')).toBeVisible(); + await turnOn.getByRole('button', { name: 'Turn on resale' }).click(); + await expect(resale.enabledSwitch()).toBeChecked(); + await expect.poll(async () => (await api.getEventSettings(event.eventId)).allow_ticket_resale).toBe(true); + + await resale.chooseCutoff('1 day before'); + await expect.poll(async () => (await api.getEventSettings(event.eventId)).ticket_resale_cutoff_minutes).toBe(1440); + + await resale.toggleResale(); + await authedPage.getByRole('dialog', { name: 'Turn off ticket resale?' }).getByRole('button', { name: 'Turn off resale' }).click(); + await expect(resale.enabledSwitch()).not.toBeChecked(); + await expect.poll(async () => (await api.getEventSettings(event.eventId)).allow_ticket_resale).toBe(false); + }); + test('the organizer default decides whether a new event allows resale', async ({ authedPage, api }) => { const organizer = await createFreshOrganizer(api); diff --git a/frontend/src/components/routes/event/Resale/Resale.module.scss b/frontend/src/components/routes/event/Resale/Resale.module.scss index cc071e8998..3c6c610b2a 100644 --- a/frontend/src/components/routes/event/Resale/Resale.module.scss +++ b/frontend/src/components/routes/event/Resale/Resale.module.scss @@ -1,3 +1,5 @@ +@use "../../../../styles/mixins"; + .notice { display: flex; align-items: flex-start; @@ -12,10 +14,72 @@ margin-top: 2px; color: var(--mantine-color-gray-6); } +} + +.settings { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 12px 24px; + margin-bottom: 16px; + padding: 12px 16px; + border: 1px solid var(--mantine-color-gray-3); + border-radius: var(--hi-radius-lg); + background: var(--mantine-color-body); + + :global(.mantine-Switch-root), + :global(.mantine-InputWrapper-root) { + margin-bottom: 0; + } +} + +.settingsToggle { + flex: 1 1 260px; + min-width: 0; +} + +.settingsCutoff { + display: flex; + flex: 0 1 auto; + align-items: center; + gap: 10px; + min-width: 0; +} + +.settingsCutoffLabel { + flex-shrink: 0; + font-size: var(--mantine-font-size-sm); + font-weight: 500; + color: var(--mantine-color-gray-7); +} + +.settingsCutoffSelect { + width: 210px; + min-width: 0; +} + +@include mixins.respond-below(sm) { + .settingsCutoff { + flex: 1 1 100%; + } + + .settingsCutoffSelect { + flex: 1; + width: auto; + } +} + +.settingsHelp { + display: inline-flex; + flex-shrink: 0; + align-items: center; + gap: 6px; + font-size: var(--mantine-font-size-sm); + font-weight: 500; + color: var(--mantine-color-gray-7); - a { - font-weight: 500; - color: var(--mantine-color-primary-7); + &:hover { + color: var(--mantine-color-gray-9); } } diff --git a/frontend/src/components/routes/event/Resale/ResaleSettings.tsx b/frontend/src/components/routes/event/Resale/ResaleSettings.tsx new file mode 100644 index 0000000000..890221456c --- /dev/null +++ b/frontend/src/components/routes/event/Resale/ResaleSettings.tsx @@ -0,0 +1,97 @@ +import {t} from "@lingui/macro"; +import {Popover, Select, Switch, Text, UnstyledButton} from "@mantine/core"; +import {IconInfoCircle} from "@tabler/icons-react"; +import {useAccess} from "../../../../hooks/useAccess.ts"; +import {useUpdateEventSettings} from "../../../../mutations/useUpdateEventSettings.ts"; +import {EventSettings, IdParam} from "../../../../types.ts"; +import {confirmationDialog} from "../../../../utilites/confirmationDialog.tsx"; +import {cutoffOptions} from "../../../../utilites/cutoffOptions.ts"; +import {showError, showSuccess} from "../../../../utilites/notifications.tsx"; +import {resaleToggleRefusedMessage, ticketResaleDescription} from "../../../../utilites/ticketResaleCopy.ts"; +import classes from "./Resale.module.scss"; + +const DEFAULT_CUTOFF_MINUTES = 120; + +interface ResaleSettingsProps { + eventId: IdParam; + eventSettings: EventSettings; +} + +export const ResaleSettings = ({eventId, eventSettings}: ResaleSettingsProps) => { + const canTurnResaleOnOrOff = useAccess().can('ISSUE_REFUNDS'); + const updateMutation = useUpdateEventSettings(); + const isOn = !!eventSettings.allow_ticket_resale; + const cutoffMinutes = eventSettings.ticket_resale_cutoff_minutes ?? DEFAULT_CUTOFF_MINUTES; + + const save = (changes: Partial, savedMessage: string) => { + updateMutation.mutate({eventId, eventSettings: changes}, { + onSuccess: () => showSuccess(savedMessage), + onError: (error: any) => showError(error?.response?.data?.message || t`Something went wrong. Please try again.`), + }); + }; + + const confirmToggle = () => { + if (isOn) { + confirmationDialog( + t`Turn off ticket resale?`, + () => save({allow_ticket_resale: false}, t`Ticket resale is off for this event.`), + { + confirm: t`Turn off resale`, + description: t`Listed tickets come off sale and go back to their buyers to use, unless someone is already paying for one. Tickets that have already been resold are not affected.`, + }, + ); + return; + } + + confirmationDialog( + t`Turn on ticket resale?`, + () => save({allow_ticket_resale: true}, t`Ticket resale is on for this event.`), + { + confirm: t`Turn on resale`, + description: ticketResaleDescription(), + }, + ); + }; + + return ( +
+ + +
+ +