-
Notifications
You must be signed in to change notification settings - Fork 0
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
CCAP-466 #960
Open
enyia21
wants to merge
4
commits into
main
Choose a base branch
from
CCAP-466-Create-providerresponse-registration-home-provider-dob-screen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+145
−38
Open
CCAP-466 #960
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
35 changes: 35 additions & 0 deletions
35
src/main/java/org/ilgcc/app/submission/actions/CreateProviderIdentityCheckDOB.java
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.ilgcc.app.submission.actions; | ||
|
||
import formflow.library.config.submission.Action; | ||
import formflow.library.data.FormSubmission; | ||
import formflow.library.data.Submission; | ||
import java.util.Map; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.ilgcc.app.utils.DateUtilities; | ||
import org.joda.time.format.DateTimeFormat; | ||
import org.joda.time.format.DateTimeFormatter; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Slf4j | ||
@Component | ||
public class CreateProviderIdentityCheckDOB implements Action { | ||
|
||
@Override | ||
public void run(FormSubmission formSubmission, Submission submission) { | ||
log.info(String.format("Running %s", this.getClass().getName())); | ||
String prefix = "providerIdentityCheckDateOfBirth"; | ||
Map<String, Object> inputData = formSubmission.getFormData(); | ||
DateTimeFormatter dtf = DateTimeFormat.forPattern("MM/dd/yyyy"); | ||
String parentDateString = String.format("%s/%s/%s", | ||
inputData.get(prefix + "Month"), | ||
inputData.get(prefix + "Day"), | ||
inputData.get(prefix + "Year")); | ||
|
||
if (DateUtilities.isDateInvalid(parentDateString)) { | ||
return; | ||
} | ||
|
||
String formattedDate = dtf.print(dtf.parseDateTime(parentDateString)); | ||
formSubmission.formData.put(prefix + "Date", formattedDate); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/org/ilgcc/app/submission/actions/ValidateHomeProviderDateOfBirth.java
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.ilgcc.app.submission.actions; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.context.MessageSource; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Slf4j | ||
@Component | ||
public class ValidateHomeProviderDateOfBirth extends ValidateBirthdate { | ||
|
||
public ValidateHomeProviderDateOfBirth(MessageSource messageSource) { | ||
super(messageSource, "providerIdentityCheckDateOfBirth", "providerIdentityCheckDateOfBirthDate"); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/org/ilgcc/app/submission/conditions/ProviderDOBRequired.java
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.ilgcc.app.submission.conditions; | ||
|
||
import formflow.library.config.submission.Condition; | ||
import formflow.library.data.Submission; | ||
import java.util.List; | ||
import org.ilgcc.app.utils.enums.ProviderType; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class ProviderDOBRequired implements Condition { | ||
|
||
final static List providerTypesRequired = List.of( | ||
ProviderType.LICENSE_EXEMPT_RELATIVE_IN_PROVIDER_HOME.name(), | ||
ProviderType.LICENSE_EXEMPT_NONRELATIVE_IN_PROVIDER_HOME.name(), | ||
ProviderType.LICENSE_EXEMPT_RELATIVE_IN_CHILDS_HOME.name(), | ||
ProviderType.LICENSE_EXEMPT_NONRELATIVE_IN_CHILDS_HOME.name() | ||
); | ||
|
||
@Value("${il-gcc.allow-provider-registration-flow}") | ||
private boolean enableProviderRegistration; | ||
|
||
@Override | ||
public Boolean run(Submission submission) { | ||
return enableProviderRegistration && displayScreen(submission); | ||
} | ||
|
||
private Boolean displayScreen(Submission submission) { | ||
String providerType = (String) submission.getInputData().getOrDefault("providerType", ""); | ||
return providerTypesRequired.contains(providerType); | ||
} | ||
} |
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
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
46 changes: 18 additions & 28 deletions
46
src/main/resources/templates/providerresponse/registration-home-provider-dob.html
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,28 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html th:lang="${#locale.language}" xmlns:th="http://www.thymeleaf.org"> | ||
<head th:replace="~{fragments/head :: head(title='TEMPLATE')}"></head> | ||
<body> | ||
<div class="page-wrapper"> | ||
<div th:replace="~{fragments/toolbar :: toolbar}"></div> | ||
<section class="slab"> | ||
<div class="grid"> | ||
<div th:replace="~{fragments/goBack :: goBackLink}"></div> | ||
<main id="content" role="main" class="form-card spacing-above-35"> | ||
<th:block th:replace="~{fragments/cardHeader :: cardHeader(header=#{placeholder}, subtext=#{placeholder})}"/> | ||
<th:block th:replace="~{fragments/form :: form(action=${formAction}, content=~{::formContent})}"> | ||
<th:block th:ref="formContent"> | ||
<div class="form-card__content"> | ||
<!-- Put inputs here --> | ||
</div> | ||
<div class="form-card__footer"> | ||
<th:block th:replace="~{fragments/inputs/submitButton :: submitButton(text=#{general.inputs.continue})}"/> | ||
</div> | ||
</th:block> | ||
</th:block> | ||
</main> | ||
</div> | ||
</section> | ||
</div> | ||
<th:block th:replace="~{fragments/footer :: footer}"/> | ||
</body> | ||
</html> | ||
<th:block | ||
th:replace="~{fragments/screens/screenWithOneInput :: | ||
screenWithOneInput( | ||
title=#{registration-home-provider-dob.title}, | ||
header=#{registration-home-provider-dob.header}, | ||
subtext=#{registration-home-provider-dob.helper}, | ||
buttonLabel=#{general.button.continue}, | ||
required='true', | ||
formAction=${formAction}, | ||
iconFragment=~{fragments/gcc-icons :: calendar}, | ||
inputContent=~{::inputContent})}"> | ||
<th:block th:ref="inputContent"> | ||
<th:block th:replace="~{fragments/inputs/date :: | ||
date(inputName='providerIdentityCheckDateOfBirth', | ||
ariaLabel='header', | ||
groupName='providerIdentityCheckDateOfBirthDate')}"/> | ||
</th:block> | ||
</th:block> |
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
Oops, something went wrong.
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.
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.
This is great! It should skip in the other flows (Licensed home, Licensed group home, Licensed day care, licensed exempt day care)