Unassigned filter based on detecting the string null#2147
Open
Unassigned filter based on detecting the string null#2147
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the “Assigned To = Unassigned” filter returning no results by treating the literal string "null" (as received from the client/filter serialization) the same as an actual null filter value when building the dynamic submission list SQL.
Changes:
- Update
assignee.emailfilter SQL generation to interpret"null"as an “unassigned” sentinel and generateIS NULLpredicates accordingly.
Comments suppressed due to low confidence (1)
src/main/java/org/tdl/vireo/model/repo/impl/SubmissionRepoImpl.java:807
- This change introduces support for the literal string "null" as the Unassigned filter value, but there is no regression test covering it. Please add a backend test (integration or repo-level) that creates assigned + unassigned submissions and asserts the "assignee.email" filter with filterValue "null" returns only the unassigned submissions.
for (String filterString : submissionListColumn.getFilters()) {
sqlBuilder = new StringBuilder();
if (filterString == null) {
sqlBuilder.append("a.email IS NULL");
} else if (filterString.equalsIgnoreCase("null")) {
sqlBuilder.append("a.email IS NULL");
} else if (submissionListColumn.getExactMatch()) {
sqlBuilder.append("a.email = '").append(filterString).append("'");
} else {
sqlBuilder.append("LOWER(a.email) LIKE '%").append(escapeString(filterString)).append("%'");
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
799
to
+802
| if (filterString == null) { | ||
| sqlBuilder.append("a.email IS NULL"); | ||
| } else if (filterString.equalsIgnoreCase("null")) { | ||
| sqlBuilder.append("a.email IS NULL"); |
Comment on lines
803
to
805
| } else if (submissionListColumn.getExactMatch()) { | ||
| sqlBuilder.append("a.email = '").append(filterString).append("'"); | ||
| } else { |
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.
Fixes #2119