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 title block #7648

Open
wants to merge 4 commits into
base: epic/campaigns
Choose a base branch
from

Conversation

pauloiankoski
Copy link
Contributor

@pauloiankoski pauloiankoski commented Dec 12, 2024

Resolves GIVE-1959

Description

This pull request lays the foundation for future Campaign-related blocks by introducing key structural elements. The updates in this PR include:

  • Dynamic Webpack Entry: Automatically discovers all block directories and compiles them using their directory names.
  • Dynamic Block Registration: Registers blocks dynamically based on their block.json files.
  • Campaign Page REST API: Adds campaignId as a field to the REST API response for the Campaign Page CPT.
  • Custom Hooks and Shared Components: Introduces reusable hooks and components to simplify campaign selection or retrieval from context within campaign blocks.
  • Initial Campaign Title Block: Adds a basic Campaign Title block to serve as a reference and model for upcoming blocks.

These changes establish a scalable and flexible structure for Campaign blocks, enabling more streamlined development of future features.

Visuals

CleanShot 2024-12-12 at 11 30 34

Testing Instructions

  1. Test on a Campaign Page:
  • Open a Campaign Page.
  • Add the Campaign Title block.
  • Verify that the block renders automatically, displaying the corresponding campaign title.
  1. Test on Other Pages:
  • Open any other page type (not a Campaign Page).
  • Add the Campaign Title block.
  • Ensure that a campaign selector is displayed.
  • Select a campaign from the selector.
  • Verify that the block updates and renders the title of the selected campaign.

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

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