Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add campaign pages #7510

Merged
merged 14 commits into from
Sep 3, 2024
Merged

Conversation

kjohnson
Copy link
Member

@kjohnson kjohnson commented Aug 22, 2024

Resolves GIVE-1150

Description

This PR introduces the Campaign Page, which can be customized via the Block Editor.

From the campaign list table (coming soon), the campaign page can be accessed via /wp-admin/?action=edit_campaign_page&campaign_id={id}.

The Campaign Page model is created "on demand" when attempting to customize the page content (see the testing instructions). Ideally, this provides us flexibility to update the "default" state of the page when not customized (as blocks can be complicated to update if created ahead of time).

Note: This does not include front-end routing of the Campaign for publicly rendering the page content.

Affects

The Campaign/Page relationship has been moved to the CampaignPage class, which now stores the related campaignId as a property (as opposed to the Campaign having a pageId property). This prevents broken references to a CampaignPage when the underlying post is deleted or trashed.

Visuals

image

Testing Instructions

With a Campaign created (manually or via the database), go to /wp-admin/?action=edit_campaign_page&campaign_id={id} to be redirected to the related campaign page in the Block Editor.

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@kjohnson kjohnson changed the base branch from develop to epic/campaigns August 22, 2024 21:20
@kjohnson kjohnson marked this pull request as ready for review August 30, 2024 16:43
Copy link
Member

@alaca alaca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

src/Campaigns/ServiceProvider.php Outdated Show resolved Hide resolved
Copy link
Contributor

@glaubersilva glaubersilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kjohnson Great work! Just left a couple of comments related to small string tweaks.

src/Campaigns/Actions/RegisterCampaignPagePostType.php Outdated Show resolved Hide resolved
src/Campaigns/Repositories/CampaignPageRepository.php Outdated Show resolved Hide resolved
@kjohnson kjohnson merged commit f12b328 into epic/campaigns Sep 3, 2024
20 checks passed
@kjohnson kjohnson deleted the feature/campaign-pages-1150 branch September 3, 2024 15:54
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.

3 participants