Skip to content

Helpers to set up a document validation workflow in a Vulcan.js application

License

Notifications You must be signed in to change notification settings

lbke/vulcan-validation-workflows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vulcan Validation Workflows

Validate only the best

This package helps to manage document validation workflows in Vulcan.js applications. Its goal is to help developers to setup validation process, for example if you need documents to be validated by an admin before they are shown to the public.

/!\ This is an experimental package, API will certainly evolve in the months to come.

Current workflows

Validation

Create a _valid field editable only by administrators, and provide related checkAccess method and views for filtered display.

Limitation

Limit the number of documents an user can create.

Installation

Clone this repo:

git clone https://github.com/lbke/vulcan-validation-workflows

You can clone it directly in your app packages folder. You can also clone it in an isolated vulcan-packages folder outside of your app, and then set the METEOR_PACKAGE_DIRS environment variable to "/some-dir/vulcan-packages". This way, you can put all your reusable package in this vulcan-packages folder without polluting your own app.

Then use the package in your app:

import { theFunctionYouNeed } from "vulcan:validation-workflows";

This package won't be published on Atmosphere or npm until it is a bit more mature.

Contributing

This package will evolve and improve depending on the use cases we encounter. Best way to contribute is to use it in your own app, and propose ideas, suggestions and PR based on your experience.

We seek for maximum reusability, so each method should be as configurable as possible, and split into independant functions whenever possible.

Possible improvements:

  • Add a filter at the database level on the _valid field for users that are not in the moderator group. This way the totalCount computation would be correct.
  • Add a _refused state to the current workflow (right now user can't know if its document has been refused)
  • Add more complex workflows (validation by a specific assigned user, multiple validations, remember who validated what, etc.)
  • Handle drafts (would need to deactivate mandatory data validation, e.g if the title is needed but the document is only a draft, do not trigger errors if the title is not set yet)

Built with love by LBKE

About

Helpers to set up a document validation workflow in a Vulcan.js application

Resources

License

Stars

Watchers

Forks

Packages

No packages published