FOUR-16161: Add support for raw query conditions to advanced filters#6876
Merged
nolanpro merged 5 commits intonext2-recommendationsfrom Jun 18, 2024
Merged
FOUR-16161: Add support for raw query conditions to advanced filters#6876nolanpro merged 5 commits intonext2-recommendationsfrom
nolanpro merged 5 commits intonext2-recommendationsfrom
Conversation
Contributor
Author
|
Other todo: resolve failing unit tests |
…upport for "between" operator, since it is not needed yet. Simplified new code
…ker/processmaker into improvement/FOUR-16161
|
nolanpro
approved these changes
May 29, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

97.9% Coverage on New Code
0.0% Duplication on New Code
Issue
Advanced Filters need to be able to support
raw()filtering query conditions to allow for more granular filtering, e.g.raw(NOW() + 1 INTERVAL DAY)which can be used to query tasks which will expire in the next 24 hours (but is not limited to just that, of course).Reproduction Steps
/taskspageraw(), for example:raw(1 + 10). This is the one I used since SQL can do basic arithmetic and is useful to test against the integer value of the "Case Number" column.Testing in Tinker
You can also test more granularly by opening tinker (
php artisan tinker) and creating a newProcessMaker\Filters\Filterinstance.Here is some example code you can use, but you can do much more than this if you'd like:
Solution
ProcessMaker\Traits\InteractsWithRawFiltertrait to contain the logic/query updatesProcessMaker\Filters\Filterto check for and appropriately implement anyraw()filter values foundHow to Test
All of the reproduction steps (for the UI and for tinker) would be best.
CICD
ci:next
Related Tickets & Packages
Code Review Checklist