Skip to content

feat(gateway): sub-phase 5b-iii — intake policy configuration + session cookie#572

Merged
FredericoAndrade merged 3 commits intomainfrom
feature/cc/gateway-5b-iii
Mar 26, 2026
Merged

feat(gateway): sub-phase 5b-iii — intake policy configuration + session cookie#572
FredericoAndrade merged 3 commits intomainfrom
feature/cc/gateway-5b-iii

Conversation

@FredericoAndrade
Copy link
Copy Markdown
Contributor

@FredericoAndrade FredericoAndrade commented Mar 22, 2026

Summary

  • Session cookiegateway_gated changed from 30-day to session-scoped; gate fires on every new browser session
  • Named intake field setsgateway_intake_fields filter now keyed by set name (e.g. 'standard') instead of post type slug; JS payload renamed intakeStepsintakeSets
  • IntakeResolver — new class implementing 3-tier resolution (per-record postmeta → per-CPT wp_option → global wp_option) for both the field set name and the always flag
  • SettingsRepository — 4 new intake accessors + option key constants for global and per-CPT intake settings
  • Admin UI — Settings page gains an "Intake forms" section (global set dropdown, global always select, per-CPT rows); resource metabox gains "Intake form" and "Show on repeat downloads" selects
  • Download_Shortcode + meta--videos-single.php — all gateway download links now emit data-intake-set and data-intake-always attributes
  • JSopenModal and doSilentPassthrough accept intake params; passthrough with intakeAlways=true shows the intake step instead of proceeding directly to download

Test plan

  • composer test — 187 tests, 270 assertions, all green
  • composer lint — clean
  • Session cookie: download a gated file → gate appears → submit → download. Close browser entirely → reopen → click same link → gate appears again (not skipped)
  • Passthrough within session: download a second file without closing the browser → gate skipped silently
  • Intake set: register a named set via gateway_intake_fields filter, assign it to a CPT in Settings → Download Gateway → intake step appears after gate submit for that CPT
  • Per-record override: set _gateway_intake_set = 'none' on one post in a CPT that has a default set → intake skipped for that post only
  • Always flag: set "Show on repeat downloads = Yes" for a CPT → first download shows gate + intake; second download in same session (passthrough) still shows intake step
  • data-intake-set and data-intake-always attributes visible in rendered HTML for shortcode links and video template links
  • Settings page: "Intake forms" section renders correctly; saving persists values; per-CPT rows show inherit/set/always dropdowns

🤖 Generated with Claude Code

FredericoAndrade and others added 2 commits March 22, 2026 16:01
- Session cookie: gateway_gated changed from 30-day to session-scoped
  (setCookie days=0 on both gate submit and passthrough paths)
- Named intake field sets: gateway_intake_fields filter now keyed by
  set name (not post type); JS payload renamed intakeSteps → intakeSets
- IntakeResolver: 3-tier resolution (per-record postmeta → per-CPT
  wp_option → global wp_option) for both 'set' and 'always' flags
- SettingsRepository: 4 new intake accessors + option key constants
- Download_Shortcode: emits data-intake-set + data-intake-always attrs
- Resource_Metabox: adds Intake form dropdown + repeat-download select
- Settings_Page: Intake forms section with global + per-CPT controls;
  data retention moved to its own section
- meta--videos-single.php: intake attrs on video, Wikimedia, caption links
- JS: openModal/doSilentPassthrough accept intakeSet + intakeAlways;
  passthrough with intakeAlways=true shows intake step instead of
  proceeding directly to download
- Tests: IntakeResolverTest (11 cases); total 187 tests, 270 assertions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…documents

Registers three named intake field sets via the gateway_intake_fields
filter, each defined as a standalone file under includes/intake/:
- videos: use_case (select) + community (radio)
- captions: use_case (select) + community (radio)
- documents: use_case (select, includes grant_writing) + organization (text, optional) + community (radio)

Adds 'intake' to the theme's auto-loaded include directories.
Sets must be wired to CPTs via Gateway > Settings > Intake forms after deploy.

Also adds video state UI planning entry to plan.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@FredericoAndrade FredericoAndrade force-pushed the feature/cc/gateway-5b-iii branch from 44cf130 to 9774e05 Compare March 23, 2026 00:50
…ntainer class

Adds gateway-container + gate/intake modifier classes to both step
containers. Shared styles (labels, text/email/select/textarea inputs,
focus states, fieldset/legend, error messages, action buttons) now live
under .gateway-container. Gate-specific consent label layout sits under
.gateway-container.gate. Intake field types (select, fieldset, legend,
radio options) inherit all shared styles automatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@FredericoAndrade FredericoAndrade merged commit ceeb585 into main Mar 26, 2026
6 checks passed
@FredericoAndrade FredericoAndrade deleted the feature/cc/gateway-5b-iii branch March 26, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant