-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Sort & Filter attribute change logs [DHIS2-18475] #19331
Conversation
...n/java/org/hisp/dhis/tracker/export/trackedentity/TrackedEntityChangeLogOperationParams.java
Fixed
Show fixed
Hide fixed
...n/java/org/hisp/dhis/tracker/export/trackedentity/TrackedEntityChangeLogOperationParams.java
Dismissed
Show dismissed
Hide dismissed
…attribute-change-logs
...n/java/org/hisp/dhis/tracker/export/trackedentity/TrackedEntityChangeLogOperationParams.java
Show resolved
Hide resolved
...in/java/org/hisp/dhis/tracker/export/trackedentity/HibernateTrackedEntityChangeLogStore.java
Outdated
Show resolved
Hide resolved
@@ -313,7 +313,7 @@ public static void validateFilter(String filter, Set<Pair<String, Class<?>>> sup | |||
for (Pair<String, Class<?>> filterField : supportedFields) { | |||
if (filterField.getKey().equalsIgnoreCase(split[0]) | |||
&& filterField.getValue() == UID.class | |||
&& !CodeGenerator.isValidUid(filterField.getKey())) { | |||
&& !CodeGenerator.isValidUid(split[2])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What test tests this fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and now RequestParamsValidatorTest.shouldFailWhenChangeLogFilterDoesNotHaveCorrectUidFormat
too
just that before it was validating the key instead of the value
Quality Gate passedIssues Measures |
This PR introduces filtering for attribute change logs. These filters differ slightly from the ones we currently use:
Another key difference is that while our current filters are UID based, these new filters are string based.
Although the only supported operator is
eq
, I’ve retained the filter format [field]:[operator]:[filter] used in other endpoints. This way, if we need to support additional operators in the future, it won’t require a breaking change.