GithubHelp home page GithubHelp logo

michellechsy / strapi-plugin-validate-relations Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 455 KB

Strapi plugin to help validate if relations are all published when publishing an entry or updating an published entry

JavaScript 100.00%

strapi-plugin-validate-relations's Introduction

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

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

strapi-plugin-validate-relations's People

Contributors

mix-zhang avatar michellechsy avatar

Stargazers

Phùng Văn Hoà avatar FluxCapacitor avatar Joe Speck avatar wkd avatar

Watchers

 avatar

strapi-plugin-validate-relations's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.