strapi-plugin-validate-relations

1.0.2 • Public • Published

Strapi plugin Validate Relations for Publication

This plugin allows the validation of publication to check whether the relations are PUBLISHED.

Installation

npm install strapi-plugin-validate-relations

yarn add strapi-plugin-validate-relations

Good to know

The populate depth is calculated by strapi built-in capability (i.e. WYSIWYG). Deeper nested relations will not be validated if it's not explored by the populate.

e.g. the relation chain is: Homepage -> Menu -> Link, when editing Homepage, it will not validate if the Link connected to a Menu is DRAFT since the populate of Homepage will not include it, however, if the selected Menu is DRAFT, error will be returned.

Currently the plugin will throw the validation error immediately when a DRAFT relation is found.

Configuration

Example configuration

config/plugins.js

module.exports = ({ env }) => ({
  'strapi-plugin-validate-relations': {
    enabled: true
  },
});

Sample Validation Results

  1. Publishing without required relation validation failure
  2. Publishing with a DRAFT relation draft relation
  3. Publishing with a published relation successfully successfully published

Readme

Keywords

Package Sidebar

Install

npm i strapi-plugin-validate-relations

Weekly Downloads

8

Version

1.0.2

License

MIT

Unpacked Size

202 kB

Total Files

14

Last publish

Collaborators

  • michelle_chsy