MCPcopy Index your code
hub / github.com/DennisSnijder/payload-workflow

github.com/DennisSnijder/payload-workflow @0.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.4.0 ↗ · + Follow
23 symbols 68 edges 17 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Payload workflow plugin

Note This plugin is currently under active development and still in an early stage. Check the roadmap below in this readme for more details / upcoming features.

Shows an image illustrating the payload-workflow plugin

Installation

The most recent version of payload-workflow currently only supports Payload 2.0 and up. For older payload versions, please use payload-workflow@0.2.0

$ yarn add payload-workflow

Basic usage

import { payloadWorkflow } from 'payload-workflow';

const config = buildConfig({
  collections: [ ... ],
  plugins: [
    payloadWorkflow({
      'my-collection-slug': {
        statuses: [
          {value: 'draft', label: 'Draft'},
          {value: 'in-progress', label: 'In Progress'},
          {value: 'ready-for-review', label: 'Ready for review'},
          {value: 'published', label: 'Published'},
        ],
        defaultStatus: 'draft',
        hideNoStatusColumn: false
      }
    })
  ],
});

Differences with the draft/publish system of Payload.

The workflow plugin introduces a new field called workflowStatus. This field does not interact with the draft/publish system of Payload.

You can "integrate" the workflow status with the draft/publish system of Payload yourself by using Payloads hooks.

For example: Automatically publish the document when the workflowStatus has been changed to published.

Roadmap

Upcoming Features / Ideas. Have a suggestion for the plugin? Feel free to open an issue or contribute!

  • [X] Payload 2.0 support
  • [ ] Customize card properties (currently displays title and createdAt)
  • [ ] Edit relationships directly from the card (e.g., assigning users to a document)
  • [X] Toggleable column for posts without a workflow status (Currently, documents lacking workflowStatus aren't visible on the board)
  • [ ] Lazy loading of column contents when scrolling (Currently, board only shows defaultLimit amount of cards)
  • [ ] Permissions for changing statuses
  • [ ] Allowed transitions between statuses
  • [ ] Integration with the draft/publish system of Payload (?)

Extension points exported contracts — how you extend this code

PluginCollectionConfig (Interface)
(no doc)
src/index.ts
InnerListProps (Interface)
(no doc)
src/components/BoardCardList/BoardCardList.tsx
BoardCardListProps (Interface)
(no doc)
src/components/BoardCardList/BoardCardList.tsx
BoardCardProps (Interface)
(no doc)
src/components/BoardCard/BoardCard.tsx
WorkflowViewHeaderProps (Interface)
(no doc)
src/components/WorkflowViewHeader/WorkflowViewHeader.tsx
BoardColumProps (Interface)
(no doc)
src/components/BoardColumn/BoardColumn.tsx

Core symbols most depended-on inside this repo

updateDocument
called by 7
src/components/Board/Board.tsx
sortAndFilterDocumentsForStatus
called by 2
src/utils/documents.util.ts
start
called by 1
dev/src/server.ts
seed
called by 1
dev/src/seed/index.ts
extendCollectionConfig
called by 1
src/index.ts
payloadWorkflow
called by 1
src/index.ts
WorkflowView
called by 1
src/components/WorkflowView/WorkflowView.tsx
onDragEnd
called by 1
src/components/Board/Board.tsx

Shape

Function 16
Interface 7

Languages

TypeScript100%

Modules by API surface

src/components/BoardCardList/BoardCardList.tsx4 symbols
src/components/Board/Board.tsx4 symbols
src/index.ts3 symbols
src/utils/documents.util.ts2 symbols
src/components/WorkflowViewHeader/WorkflowViewHeader.tsx2 symbols
src/components/WorkflowView/WorkflowView.tsx2 symbols
src/components/BoardColumn/BoardColumn.tsx2 symbols
src/hooks/generateOrderRank.ts1 symbols
src/components/BoardCard/BoardCard.tsx1 symbols
dev/src/server.ts1 symbols
dev/src/seed/index.ts1 symbols

Datastores touched

(mongodb)Database · 1 repos

For agents

$ claude mcp add payload-workflow \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact