-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reject invalid order parameter values DHIS2-16935 (#16673)
* fix: reject invalid order parameter values Rename OrderCriteria factory to valueOf so its used by Springs conversion system. The OrderCriteriaParamEditor is not needed. In fact its even causing the issue that "order=createdAt:desc,event:asc" is not split by Spring and passed as is to the PropertyEditor. Whatever mechansim is used to convert Spring suggests throwing an IllegalArgumentException in case conversion failed. We returned null which lead to successful conversions with null elements * chore: reject empty order fields * test: asssert on actual types and their order instead of strings. Add tests for passing comma separated values in one order param. Add test for the mixed case of comma separated values in one order param with a repeated param * test: TE workinglist separates order using ; instead of , * chore: UID does not need a PropertyEditor as it has a contructor from String -> UID its automatically picked up by Spring * chore: cannot order by orgUnit using this implementation we need to update this to the new tracker mechanism. Not sure if these workinglists are also used by old tracker though * test: UID binding * test: fix * test: clean
- Loading branch information
Showing
8 changed files
with
391 additions
and
267 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
150 changes: 79 additions & 71 deletions
150
dhis-2/dhis-test-e2e/src/test/resources/tracker/workinglists/trackedEntityFilters.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,83 @@ | ||
{ | ||
"id": "ctZIHTIIlYS", | ||
"name": "TA Tracker program filter", | ||
"program": { | ||
"id": "f1AyMswryyQ" | ||
"id": "ctZIHTIIlYS", | ||
"name": "TA Tracker program filter", | ||
"program": { | ||
"id": "f1AyMswryyQ" | ||
}, | ||
"sharing": { | ||
"public": "rw------", | ||
"userGroups": { | ||
"OPVIvvXzNTw": { | ||
"access": "rw------", | ||
"id": "OPVIvvXzNTw" | ||
} | ||
} | ||
}, | ||
"entityQueryCriteria": { | ||
"enrollmentStatus": "COMPLETED", | ||
"followUp": true, | ||
"ouMode": "ACCESSIBLE", | ||
"displayColumnOrder": [ | ||
"eventDate", | ||
"dueDate", | ||
"program", | ||
"invalid" | ||
], | ||
"assignedUserMode": "ANY", | ||
"programStage": "a3kGcGDCuk6", | ||
"trackedEntityType": "Q9GufDoplCL", | ||
"lastUpdatedDate": { | ||
"period": "TODAY", | ||
"startBuffer": -5, | ||
"endBuffer": 5, | ||
"type": "RELATIVE" | ||
}, | ||
"sharing": { | ||
"public": "rw------", | ||
"userGroups": { | ||
"OPVIvvXzNTw": { | ||
"access": "rw------", | ||
"id": "OPVIvvXzNTw" | ||
} | ||
} | ||
"enrollmentCreatedDate": { | ||
"period": "TODAY", | ||
"startBuffer": -5, | ||
"endBuffer": 5, | ||
"type": "RELATIVE" | ||
}, | ||
"enrollmentIncidentDate": { | ||
"endDate": "2019-03-20T00:00:00.000", | ||
"type": "ABSOLUTE", | ||
"startDate": "2014-05-01T00:00:00.000" | ||
}, | ||
"entityQueryCriteria": { | ||
"enrollmentStatus": "COMPLETED", | ||
"followUp": true, | ||
"ouMode": "ACCESSIBLE", | ||
"displayColumnOrder": [ "eventDate", "dueDate", "program", "invalid"], | ||
"assignedUserMode": "ANY", | ||
"programStage":"a3kGcGDCuk6", | ||
"trackedEntityType":"Q9GufDoplCL", | ||
"lastUpdatedDate": { | ||
"period": "TODAY", | ||
"startBuffer": -5, | ||
"endBuffer": 5, | ||
"type": "RELATIVE" | ||
}, | ||
"enrollmentCreatedDate": { | ||
"period": "TODAY", | ||
"startBuffer": -5, | ||
"endBuffer": 5, | ||
"type": "RELATIVE" | ||
}, | ||
"enrollmentIncidentDate": { | ||
"endDate": "2019-03-20T00:00:00.000", | ||
"type": "ABSOLUTE", | ||
"startDate": "2014-05-01T00:00:00.000" | ||
}, | ||
"trackedEntityInstances": ["a3kGcGDCuk7", "a3kGcGDCuk8"], | ||
"order": "createdAt:desc;orgUnit:asc", | ||
"attributeValueFilters": [ | ||
{ | ||
"attribute": "dIVt4l5vIOa", | ||
"sw": "a", | ||
"ew": "e" | ||
}, | ||
{ | ||
"attribute": "kZeSYCgaHTk", | ||
"like": "abc" | ||
}, | ||
{ | ||
"attribute": "x5yfLot5VCM", | ||
"dateFilter": { | ||
"startDate": "2014-05-01T00:00:00.000", | ||
"endDate": "2019-03-20T00:00:00.000", | ||
"type": "ABSOLUTE" | ||
} | ||
}, | ||
{ | ||
"attribute": "ypGAwVRNtVY", | ||
"le": "20", | ||
"ge": "10" | ||
}, | ||
{ | ||
"attribute": "aIga5mPOFOJ", | ||
"in": [ | ||
"MALE", | ||
"FEMALE" | ||
] | ||
} | ||
"trackedEntityInstances": [ | ||
"a3kGcGDCuk7", | ||
"a3kGcGDCuk8" | ||
], | ||
"order": "createdAt:desc", | ||
"attributeValueFilters": [ | ||
{ | ||
"attribute": "dIVt4l5vIOa", | ||
"sw": "a", | ||
"ew": "e" | ||
}, | ||
{ | ||
"attribute": "kZeSYCgaHTk", | ||
"like": "abc" | ||
}, | ||
{ | ||
"attribute": "x5yfLot5VCM", | ||
"dateFilter": { | ||
"startDate": "2014-05-01T00:00:00.000", | ||
"endDate": "2019-03-20T00:00:00.000", | ||
"type": "ABSOLUTE" | ||
} | ||
}, | ||
{ | ||
"attribute": "ypGAwVRNtVY", | ||
"le": "20", | ||
"ge": "10" | ||
}, | ||
{ | ||
"attribute": "aIga5mPOFOJ", | ||
"in": [ | ||
"MALE", | ||
"FEMALE" | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
38 changes: 0 additions & 38 deletions
38
dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/common/OrderCriteriaParamEditor.java
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/common/UIDParamEditor.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.