OLMIS-933: Fix issues with template dependencies
Ok, so I've done a bit of changing. In short, there were problems with
how we did our validations, hence I removed some and changed others. The
problem was that we used the dependency field in requisition-column
for more things that it should be used for (in v2 some validation are
not generic and only apply to select fields). I am currently using it
to mark fields as dependent in each others calculations. I believe however,
that these definitions should probably be moved to the back end in the end.
These are my changes:
* I changed that a field cannot depend on a different calculated field.
This is required, especially since we use the dependency array to
trigger recalculations on the product grid. The current solution
might seem a bit complex, since it is a recursion, it is however
a solution that should work with anything we come up with regarding the
template.
* I removed the validation that a user input field must be displayed. This
was not the case in v2 except for two fields: stockOnHand and
totalConsumedQuantity. This validation is currently missing.
* I removed the validation that all dependent fields must be visisble
for a field to be visisble. This was only the case requestedQuantity
and requestedQuantityExplanation in v2. This validation is missing.
* I defined the dependencies for totalConsumedQuantity. Up to this point,
since the field had no dependencies, it wouldn't auto refresh in the
product grid at all.Fixed template validation