Skip to content

feat(cms): add partners collection - #54

Open
sbcxty wants to merge 2 commits into
mainfrom
feat/19-partners-collection
Open

feat(cms): add partners collection#54
sbcxty wants to merge 2 commits into
mainfrom
feat/19-partners-collection

Conversation

@sbcxty

@sbcxty sbcxty commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

📝 Overview

What does this PR do? Briefly describe the changes and the goal of this PR.
Adds a new Partners collection to Payload CMS for the DurianPy website, per ticket #19. Includes schema (name, logo, websiteUrl), draft/versioning support with scheduled publish, role-based access control via checkCollectionAccess, and URL-format validation on websiteUrl.

🚀 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:
fields:

  • name (text, required)
  • logo (upload, relation to media, required)
  • websiteUrl (text, optional, validated as a proper URL format).
image

🧪 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.

Schema and UI Verification

CMS Dashboard showing Partners under durianpy-website group

partners_dashboard

Schema shows correct input fields

image

Validation and Versioning

When all required fields are complete, the partner publishes successfully.

partners_submit_successful

Attempting to publish with required fields left empty shows a validation error.

partners_error_message

websiteUrl rejects invalid URL formats.

partners_url

Scheduled a partner's publish date for a future time.

partners_schedule publish

GraphQL query before triggering the job queue

graphql_firstpublish

Manually triggered the scheduled job via npx payload jobs:run

job queue

Re-ran the same query after the job ran

graphql_secondpublish

Access Control Verification

Group-level access (durianpy-website) grants full access to all collections under that group. Example: can create/read/update/delete on both Partners and Events collections.

group level access events group level access partners

Collection-specific access (Partners) can only access that collection. Example: can only create/read/update/delete on Partners but can only read Events.

partners only access cannot access events

Non-admin read access. Any authenticated user can read published and draft partners.

non admin read access

REST API Verification

Authenticated users can read draft and published partners.

partners_restapi

Unauthenticated users cannot read draft partners.

published_draft_unathenticated

Unauthenticated users can read published partners.

partners_published_unathneticated

GraphQL Verification

Shows only published partners when querying with where: { _status: { equals: published } } filter.

graphql_firstpublish

Shows published and drafts when the query has draft: true flag.

graphql_drafttrue

Shows only published partners regardless of draft: true flag when user is unauthenticated.

graphql_incognito --- ## 📋 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.
I didn’t strictly follow the read: anyone pattern because I noticed that it also allows unauthenticated users to read drafts. I used a helper function to modify the logic so only authenticated users can read everything. I used the same helper function for both Events and Partners collections. Would it make sense to make it a shared helper function, similar to anyone.ts, so it can be reused?

@sbcxty sbcxty self-assigned this Aug 14, 2026
@sbcxty
sbcxty requested a review from a team August 14, 2026 13:52
@sbcxty sbcxty linked an issue Aug 14, 2026 that may be closed by this pull request
3 tasks
@jlorion

jlorion commented Aug 16, 2026

Copy link
Copy Markdown
Member

Looking into integration I think we also need descriptions for partners

{ECFCAF01-1980-4D38-A780-5E23FC2E2AA2}

},
maxPerDoc: 50,
},
fields: [

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.

Kindly include a new field to store partner description. It should be an optional text.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added the optional description field.

image

@sbcxty
sbcxty requested a review from ASPactores August 16, 2026 14:05
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]: Partners Collection

3 participants