Parse dynamic variables in preset and field validation uses
Description
Fixes both dynamic variables eg. $NOW in presets and field validation on create and update requests.
Tests also added.
Fixes #14759, fixes #13198
Type of Change
- [x] Bugfix
- [ ] Improvement
Requirements Checklist
- [x] New / updated tests are included
- [x] All tests are passing locally
- [x] Performed a self-review of the submitted code
@qborisb This touches the same validation logic as we were discussing the other day. I don't think this change affects that update in any way, but good to have on your radar regardless 🙂
@rijkvanzanten Was there anything left to discuss on this? We could merge this and start on a new PR to support $CURRENT_ITEM or?
I think the changes are good to go. @licitdev Could you check if this path is covered in the blackbox and if not advise on how to add proper tests there?
@rijkvanzanten Just ran the black box tests and they all passed. But also couldn't find that it was testing any of the services test. So seems like it is independent of the tests defined in api/tests.
@rijkvanzanten The blackbox tests currently do not cover the dynamic variables and functions in filtering tests. I'm adding additional permissions testing capabilities which will then allow for the testing of the presets and validations to be included.
@u12206050 The test you've added runs under the Unit Tests.
@licitdev so this PR can be merged now and all tests will be included later right?
Closing in favour of https://github.com/directus/directus/pull/14887. 👍
To bad the $CURRENT_ITEM is taking so long, should have just merged this smaller fix I guess