-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Feat: EW - add unpublished entries to collections #7495
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
Feat: EW - add unpublished entries to collections #7495
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
EntryCard
with 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
PropTypes
but 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
,mapStateToProps
logic, and the integration path to ensure the editorial workflow loads and merges entries correctly.
loadUnpublishedEntries: (collections) => loadUnpublishedEntries(collections),
@@ -148,7 +148,7 @@ export function selectUnpublishedEntry(state: EditorialWorkflow, collection: str | |||
export function selectUnpublishedEntriesByStatus(state: EditorialWorkflow, status: string) { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Copilot uses AI. Check for mistakes.
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.