ZettaKonsult/zetta-workspace

Dynamically generated error messages

Ouverte

#74 ouverte le 11 janv. 2018

 (4 commentaires) (0 réaction) (0 personne assignée)JavaScript (0 fork)auto 404
enhancementhelp wanted

Métriques du dépôt

Stars
 (0 étoile)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Plans right now contain a error field for what error message to print.

However given the information a plan rule contains this should be possible to generate on the fly. This of course puts some trust into the our users will give groups or labels good names that make sense. But the other way around we trust that they write good error messages for their own rules, so think the first approach is slightly better

{ "id": "3", "name": "trfRule", "group": "obligatory", "attribute": "id", "key": "18", "func": "only", "value": "1", "error": "TRF must be part of the subscription" },

given a rule like this a error message could be generated like There can ${func} be ${value} of ${key===id ? fetchPlanName(key) : ${attribute} group

since some of the rules are named stuff like "lessThan" and there needs to be some nifty transforms for these

A good place to implement these would be FrontEnd/src/membership/PlanTemplate.js

Guide contributeur