You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is it?: Add a status field to the heroes collection in Directus (Published / Draft / Archived) and update heroApi to only fetch Published heroes by default (Draft/Archived should not be publicly visible).
Why improve it?: We currently have empty or unfinished hero pages in production because heroes are being created as placeholders (slug/name only) while descriptions, images and other required fields are still missing. Status gating prevents unfinished content from appearing on the live site.
🌟 Benefits of the Enhancement
User Experience: No more blank or incomplete hero pages in production. Users only see fully prepared (Published) heroes.
Project Impact: Establishes a clear and structured content workflow: create heroes as Draft, complete all required fields, then publish when ready. Reduces confusion and ensures no unfinished sections are exposed on the public site.
🛠️ Proposed Implementation
Technical Details:
Directus
Add heroes.status as a Select/Dropdown field (example in the news data model, attached screenshot)
Options: Published, Draft, Archived
Default: Draft
Use a “Status” UI similar to the provided screenshot for clarity
Frontend (heroApi)
Include status in FIELDS (for consistency and debugging)
Add a filter to all public hero queries so they return only status == "Published" by default:
filter[status][_eq]=Published
Ensure this applies to:
getHeroBySlug
getAllHeroes
getHeroGroups
fetchHeroBySlug
fetchAllHeroes
Implementation Plan:
Directus schema
Create status field on heroes
Set default to Draft
Configure allowed values: Published / Draft / Archived
API query updates
Update buildParams() to always append filter[status][_eq]=Published
Add status to FIELDS
Validation
Verify existing placeholder heroes remain hidden until marked Published
Confirm getHeroGroups grouping works correctly with filtered results
Ensure getHeroBySlug returns undefined for Draft/Archived heroes (so the UI can render 404/NotFound appropriately)
📎 Additional Information
Mockups/Examples: Directus Status dropdown UI should match the attached screenshot: default Draft, editors switch to Published only when content is complete.
Notes:
This enhancement enforces a clean separation between work-in-progress content and publicly visible content.
✨ Enhancement Description
statusfield to theheroescollection in Directus (Published / Draft / Archived) and updateheroApito only fetch Published heroes by default (Draft/Archived should not be publicly visible).🌟 Benefits of the Enhancement
🛠️ Proposed Implementation
Technical Details:
heroes.statusas a Select/Dropdown field (example in the news data model, attached screenshot)Published,Draft,ArchivedDraftstatusinFIELDS(for consistency and debugging)status == "Published"by default:filter[status][_eq]=PublishedgetHeroBySluggetAllHeroesgetHeroGroupsfetchHeroBySlugfetchAllHeroesImplementation Plan:
statusfield onheroesDraftbuildParams()to always appendfilter[status][_eq]=PublishedstatustoFIELDSgetHeroGroupsgrouping works correctly with filtered resultsgetHeroBySlugreturnsundefinedfor Draft/Archived heroes (so the UI can render 404/NotFound appropriately)📎 Additional Information
Draft, editors switch toPublishedonly when content is complete.