Skip to content
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

Remove year, month, and day from predicate view dropdown #7418

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions server/app/services/applicant/ApplicantService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1886,11 +1886,11 @@ public CompletionStage<ImmutableMap<String, String>> cleanDateQuestions(
monthValue == null ? "" : Strings.padStart(monthValue, 2, '0'),
dayValue == null ? "" : Strings.padStart(dayValue, 2, '0'));
newFormData.put(dateQuestion.getDatePath().toString(), dateString);
// Remove the 3 individual paths, so they won't be stored.
newFormData.remove(dateQuestion.getYearPath().toString());
newFormData.remove(dateQuestion.getMonthPath().toString());
newFormData.remove(dateQuestion.getDayPath().toString());
}
// Remove the 3 individual paths, so they won't be stored.
newFormData.remove(dateQuestion.getYearPath().toString());
newFormData.remove(dateQuestion.getMonthPath().toString());
newFormData.remove(dateQuestion.getDayPath().toString());
}

return CompletableFuture.completedFuture(ImmutableMap.copyOf(newFormData));
Expand Down
5 changes: 3 additions & 2 deletions server/app/services/applicant/question/Scalar.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public enum Scalar {
PHONE_NUMBER("phone_number", ScalarType.PHONE_NUMBER),
COUNTRY_CODE("country_code", ScalarType.STRING),

// Scalars for Date Question using memorable date (3 different inputs)
// Scalars for Date Question using memorable date (3 different inputs). They are not used
// for storage or predicates, so they are not included in getScalars.
DAY("day", ScalarType.LONG),
MONTH("month", ScalarType.LONG),
YEAR("year", ScalarType.LONG),
Expand Down Expand Up @@ -110,7 +111,7 @@ public static ImmutableSet<Scalar> getScalars(QuestionType questionType)
case CURRENCY:
return ImmutableSet.of(CURRENCY_CENTS);
case DATE:
return ImmutableSet.of(DATE, YEAR, MONTH, DAY);
return ImmutableSet.of(DATE);
case EMAIL:
return ImmutableSet.of(EMAIL);
case FILEUPLOAD:
Expand Down