仓库指标
- 星标
- (0 个星标)
- PR 合并指标
- (PR 指标待抓取)
描述
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