Feat: EW - add unpublished entries to collections#7495
Feat: EW - add unpublished entries to collections#7495demshy merged 18 commits intodecaporg:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR integrates unpublished entries into collection views and adds editorial status badges to each entry.
- Load and select unpublished entries alongside published ones.
- Merge unpublished entries in the listing component (
EntryListing) and pass workflow status to entry cards. - Render a status badge in
EntryCardwith appropriate styling and translations.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/decap-cms-core/src/reducers/editorialWorkflow.ts | Guard selector against missing entities, using optional chaining |
| packages/decap-cms-core/src/components/Collection/Entries/EntryListing.js | Added getAllEntries to merge unpublished entries and new props |
| packages/decap-cms-core/src/components/Collection/Entries/EntryCard.js | Introduced WorkflowBadge, TitleIcons and translation support |
| packages/decap-cms-core/src/components/Collection/Entries/EntriesCollection.js | Fetch unpublished entries, extend mapStateToProps and dispatch |
| packages/decap-cms-core/src/components/Collection/Entries/Entries.js | Propagate new props (getWorkflowStatus, getUnpublishedEntries, filterTerm) |
Comments suppressed due to low confidence (2)
packages/decap-cms-core/src/components/Collection/Entries/EntryListing.js:3
- The component uses
PropTypesbut there’s noimport PropTypes from 'prop-types';. Add this import at the top to prevent undefined reference errors.
import React from 'react';
packages/decap-cms-core/src/components/Collection/Entries/EntriesCollection.js:270
- New unpublished-entry loading logic and state mappings are introduced here—consider adding unit tests for
loadUnpublishedEntries,mapStateToPropslogic, and the integration path to ensure the editorial workflow loads and merges entries correctly.
loadUnpublishedEntries: (collections) => loadUnpublishedEntries(collections),
| if (!state) return null; | ||
| const entities = state.get('entities') as Entities; | ||
| return entities.filter(entry => entry.get('status') === status).valueSeq(); | ||
| return entities?.filter(entry => entry.get('status') === status).valueSeq(); |
There was a problem hiding this comment.
Using optional chaining here can result in returning undefined before calling valueSeq(). Consider explicitly returning an empty sequence (e.g., Immutable.Seq()) when entities is falsy to avoid runtime errors.
|
hey @martinjagodic
does it work out of the box in the next release, or do I need to configure something? Thank you in advance. |
It does, no config needed.
It's showing the editorial status of draft/in review/ready to publish, not GitHub-specific. |
Closes #4675
Adds unpublished entries to collections
Displays a status badge for each entry based on status in the editorial workflow.