Skip to content

feat(cms): add Homepage CTA section global configuration - #38

Open
leonyllukejayme wants to merge 1 commit into
mainfrom
feat/25-homepage-cta-section
Open

feat(cms): add Homepage CTA section global configuration#38
leonyllukejayme wants to merge 1 commit into
mainfrom
feat/25-homepage-cta-section

Conversation

@leonyllukejayme

@leonyllukejayme leonyllukejayme commented Jul 28, 2026

Copy link
Copy Markdown

📝 Overview

Add a Homepage CTA section global configuration

🚀 Type of Change

  • 🐛 Bug Fix: Fixed something that was broken.
  • New Feature: Added new functionality or pages.
  • 🗄️ CMS / Database: Updated collections, fields, or config in Payload CMS.
  • 🧹 Chore / Clean up: Text updates, typos, or code cleanup.

🧱 CMS & Database Changes

Skip this section if no CMS or database changes were made.

  • Migration Created: Ran payload migrate:create and saved the file.
  • Local Verification: Verified changes in the local admin panel.

📊 Data Structure

Describe the new fields/tables or drag-and-drop a screenshot here:


🧪 Testing & Validation

  • Test Case Approval: Verified that test cases were commented on the assigned GitHub issue and approved by the Project Lead before development started.
  • Unit Tests: Added or updated unit test scripts covering the new logic.
  • Admin Panel: Verified behavior in the CMS Admin UI.
  • API Check: Tested REST/GraphQL endpoints for correct data.

📸 Visual Evidence (Mandatory)

Important

Visual proof is required to demonstrate that the approved test cases from the issue were successfully met.
Please provide screenshots, screen recordings (GIFs/Videos), or sample API outputs proving that the feature satisfies all approved test cases and do not introduce regressions.


Tests
image

API Endpoint (published)
image

Icons
image

(draft)
image

📋 Final Checklist

  • Sync: Rebased from main and resolved conflicts.
  • Pre-commit: Installed and ran pre-commit hooks successfully.
  • Security: Verified no secrets or local credentials are included.
  • Build: Project builds without errors.
  • Visuals: Attached mandatory visual evidence proving all test cases passed.
  • Migrations: Migration script included (if applicable).

🧠 Extra Notes / Questions

Add any additional context or questions for the reviewers here.

@leonyllukejayme leonyllukejayme linked an issue Jul 28, 2026 that may be closed by this pull request
5 tasks
@leonyllukejayme leonyllukejayme self-assigned this Jul 28, 2026
@leonyllukejayme
leonyllukejayme marked this pull request as ready for review July 29, 2026 00:38
@leonyllukejayme
leonyllukejayme requested a review from a team July 29, 2026 00:38
@leonyllukejayme
leonyllukejayme marked this pull request as draft July 29, 2026 00:40
@leonyllukejayme
leonyllukejayme marked this pull request as ready for review July 29, 2026 01:05
import { CollectionSlug, getCollectionGroupLabel } from '@/constants/collections'

export const CTASection: GlobalConfig = {
slug: 'cta-section',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's use a constant from src/constants/globals.ts for the slug instead of a hardcoded string.

Also, let's update the literal slug value to 'durianpy-website-cta-section' to avoid any potential naming collisions. To keep the UI clean, we should explicitly set the label to GLOBAL_LABELS[GLOBALS.DURIANPY_WEBSITE_CTA_SECTION] (or "CTA Section") so the longer slug doesn't show up in the admin panel.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Once the #37 PR is merged (which introduces the src/constants/globals.ts file), let's make sure to add this new global there. It should look something like this:

export const GLOBALS = {
  // ... existing globals
  DURIANPY_WEBSITE_CTA_SECTION: 'durianpy-website-cta-section',
} as const

// ...
export const GLOBAL_LABELS: Record<GlobalSlug, string> = {
  // ... existing labels
  [GLOBALS.DURIANPY_WEBSITE_CTA_SECTION]: 'CTA Section',
}

We can wait for that PR to be finished before making this specific edit to avoid merge conflicts. Once ready, we can import them to set slug: GLOBALS.DURIANPY_WEBSITE_CTA_SECTION and label: GLOBAL_LABELS[GLOBALS.DURIANPY_WEBSITE_CTA_SECTION].

group: getCollectionGroupLabel('durianpy-website'),
},

access: {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's refactor the access control to use the same higher-order function pattern we use in other collections, rather than casting the string to CollectionSlug.

It should look something like this:

const checkCTASectionAccess = (accessType?: AccessType) => (access: AccessArgs) =>
  checkCollectionAccess(access, GLOBALS.DURIANPY_WEBSITE_CTA_SECTION, accessType)

// ... inside the config:
  access: {
    read: anyone,
    update: checkCTASectionAccess('update'),
  },

@ASPactores ASPactores left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@leonyllukejayme Kindly check comments. You may coordinate with @jpornillos for the globals.ts edits.

cc: @seangaaab

import { CollectionSlug, getCollectionGroupLabel } from '@/constants/collections'

export const CTASection: GlobalConfig = {
slug: 'cta-section',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Once the #37 PR is merged (which introduces the src/constants/globals.ts file), let's make sure to add this new global there. It should look something like this:

export const GLOBALS = {
  // ... existing globals
  DURIANPY_WEBSITE_CTA_SECTION: 'durianpy-website-cta-section',
} as const

// ...
export const GLOBAL_LABELS: Record<GlobalSlug, string> = {
  // ... existing labels
  [GLOBALS.DURIANPY_WEBSITE_CTA_SECTION]: 'CTA Section',
}

We can wait for that PR to be finished before making this specific edit to avoid merge conflicts. Once ready, we can import them to set slug: GLOBALS.DURIANPY_WEBSITE_CTA_SECTION and label: GLOBAL_LABELS[GLOBALS.DURIANPY_WEBSITE_CTA_SECTION].

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.

[CMS-MIGRATE]: Homepage CTA Section

2 participants