msupply-foundation / conforma-web-app

Conforma application manager (IRIMS) front-end
GNU Affero General Public License v3.0
5 stars 0 forks source link

Use the evaluateExpression on each question #18

Closed nmadruga closed 4 years ago

nmadruga commented 4 years ago

using evaluationExpression on UI example: Select list of companies based on toggle for Applicant category: Manufacturer/Supplier

andreievg commented 4 years ago

@CarlosNZ

I thought about this a bit. And I think we would need to re-run evaluator on isVisible and isRequired on ALL questions (not just the current page), this would be required for progress bar and for summary view.

Thus I think we should try to minimise the number of times evaluator should run, suggestions:

Basic Identify an evaluation express as

Advanced For dynamics ->

Also something to keep in mind, if element becomes not visible, we should change it's value to null. (not sure how to best do it, probably from within the wrapper ?)

CarlosNZ commented 4 years ago

Also something to keep in mind, if element becomes not visible, we should change it's value to null. (not sure how to best do it, probably from within the wrapper ?)

Do we really, though? I was thinking about this, and I don't really see a downside to just leaving it as is. The isVisible field will dictate that it should be ignored in all subsequent processing, and in the occasional case that the applicant switches a conditional answer back to what it used to be, it'd be nice for the previous response to pop back into the form as it was.(i.e. less work for more features!)