aurelia / aurelia/validation

Drive Validations based on values returned from REST controller.

Open
#521 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
129
Forks
125
PR merge metrics
No merged PRs in 30d

Description

Code Sample:

ValidationRules
.ensure('id').displayName('ID').required().then().

**Current behavior:**

If code is bundled with webpacks, and later on we decided id is not a required field, we need to make code changes by removing .required() on a property and rebundle with webpack and deploy it

**Expected/desired behavior:**

Consider I have a REST CONTROLLER which says if that is required or not. Based on a value of a key I would like to dynamically set id as required or not required.

if the controller returns as below json, I would like id to be required:
id:{
required:true;
}

if the controller returns as below json, I would like id to be not required:
id:{
required:false;
}

I've already implemented a service which does that for me, Can I know how to achieve this on UI with Aurelia-Validation framework.?

Contributor guide

Open the contributing guide

Research direction

Start with the Aurelia-Validation API and the ValidationRules.ensure example shown in the issue, then trace how rules are created and changed after a REST response. The issue names no repository files or tests, so identify the relevant validation entry point and existing dynamic-rule coverage first. Done means a controller-provided required value can control the UI rule without rebundling.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.