Skip to content

grundiss/payload-workflow

 
 

Repository files navigation

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 } }) ], });

Stylizing the cards

import { payloadWorkflow } from 'payload-workflow'; import type { BoardCardDefaultContentProps } from 'payload-workflow'; import { Link } from "react-router-dom"; const config = buildConfig({ collections: [ ... ], plugins: [ payloadWorkflow({ 'my-collection-slug': { statuses: [ ... ], cardContentComponent: ({admin, data, link}: BoardCardDefaultContentProps) => ( <Link to={link}>{ data.title }</Link> ) } }) ], });

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!
  • 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)
  • 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 (?)

About

A workflow plugin for Payload CMS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 89.3%
  • SCSS 9.1%
  • Dockerfile 1.6%