Replace GiveBanner/StickyNote with SiteBanner and EmergencyMessaging#1682
Open
TomWoodward wants to merge 2 commits into
Open
Replace GiveBanner/StickyNote with SiteBanner and EmergencyMessaging#1682TomWoodward wants to merge 2 commits into
TomWoodward wants to merge 2 commits into
Conversation
Rebuilds the marketing-banner backend to support multiple concurrent banners (for frontend A/B testing), scheduling, and per-page targeting, and separates the emergency-override path into its own site setting. - Add SiteBanner model + admin/serializer/viewset in donations app - Add EmergencyMessaging BaseSiteSetting in global_settings - Drop GiveBanner (snippets) and StickyNote (global_settings) and all references in serializers, views, urls, signals, and tests - Replace /api/sticky/ with /api/emergency/; SiteBanner is served at /api/donations/sitebanner/ CORE-1761 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Addresses PR review feedback: - post_save signal clears donations/sitebanner CloudFront cache on edit - Tests cover active/inactive, in-window/future/expired, and open-ended banners to lock in the SiteBannerViewSet filtering behavior Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EmergencyMessaging) instead of co-habiting with the banner model.GiveBannerandStickyNotemodels and every reference to them (serializers, views, urls, signals, tests, wagtail admin).API changes
GET /apps/cms/api/donations/sitebanner/— list of active, in-date banners. Backend does not filter by URL/context; the frontend filters client-side so navigation can swap banners without a refetch.GET /apps/cms/api/emergency/— replacesGET /apps/cms/api/sticky/.GET /apps/cms/api/snippets/givebanner/— removed.Wagtail admin
Implementation notes
SiteBannerusesTranslatableMixinand inheritsTranslatableMixin.Metaso the(translation_key, locale)uniqueness constraint is preserved alongside the customverbose_name/ordering.is_active=Trueand date windows (start_date/end_datenullable). Context/URL filtering lives entirely in the frontend.StickyNote→EmergencyMessaging(keyemergency).Test plan
GET /apps/cms/api/donations/sitebanner/is_activeand confirm it disappears from the APIGET /apps/cms/api/emergency/returns expected payload/apps/cms/api/sticky/and/apps/cms/api/snippets/givebanner/404Ticket
CORE-1761
🤖 Generated with Claude Code