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

[CCAP-478, CCAP-479] Split info screen to info and address screens #835

Merged
merged 6 commits into from
Nov 23, 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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void sendDocumentTransferServiceRequest(String presignedUrl, Submission s
throw new RuntimeException(errorMessage, e);
}

try (BufferedReader br = new BufferedReader(
try (BufferedReader br = new BufferedReader (
new InputStreamReader(httpUrlConnection.getInputStream(), StandardCharsets.UTF_8))) {
StringBuilder response = new StringBuilder();
String responseLine = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class GenerateDummyClientSubmissionForDev implements Action {

@Autowired
Environment env;

public GenerateDummyClientSubmissionForDev(SubmissionRepositoryService submissionRepositoryService,
SubmissionRepository submissionRepository, HttpSession httpSession) {
this.submissionRepositoryService = submissionRepositoryService;
Expand All @@ -44,7 +44,7 @@ public void run(FormSubmission formSubmission, Submission submission) {
Optional<Submission> existingDummyClientSubmision = submissionRepositoryService.findByShortCode("DEV-123ABC");
existingDummyClientSubmision.ifPresent(submissionRepository::delete);

Map<String, Object> inputData = createFamilySubmission();
Map<String, Object> inputData = createFamilySubmission(submission);

Submission dummyClientSubmission = new Submission();
dummyClientSubmission.setSubmittedAt(OffsetDateTime.now().minusDays(1));
Expand All @@ -58,7 +58,7 @@ public void run(FormSubmission formSubmission, Submission submission) {
}
}

private @NotNull Map<String, Object> createFamilySubmission() {
private @NotNull Map<String, Object> createFamilySubmission(Submission providerSubmission) {
Map<String, Object> inputData = new HashMap<>();
inputData.put("familyIntendedProviderName", "Dev Provider");
inputData.put("parentFirstName", "Devy");
Expand All @@ -72,6 +72,7 @@ public void run(FormSubmission formSubmission, Submission submission) {
inputData.put("parentHomeState", "CA - California");
inputData.put("parentHomeZipCode", "94103");
inputData.put("parentHasPartner", "false");
inputData.put("providerResponseSubmissionId", providerSubmission.getId().toString());

List<Map<String, Object>> children = new ArrayList<>();
Map<String, Object> child1 = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public UploadProviderSubmissionToS3(PdfService pdfService, CloudFileRepository c
public void run(Submission providerSubmission) {
if (waitForProviderResponseFlag) {
var clientId = ProviderSubmissionUtilities.getClientId(providerSubmission);
if(clientId !=null && clientId.isPresent()){
if (clientId !=null && clientId.isPresent()) {
Optional<Submission> familySubmissionOptional = submissionRepositoryService.findById(clientId.get());
if(familySubmissionOptional.isPresent()){
if (familySubmissionOptional.isPresent()) {
log.info("Provider submitted response for client ID {}, enqueuing transfer of documents.", clientId.get());
Submission familySubmission = familySubmissionOptional.get();
familySubmission.getInputData().put("providerResponseSubmissionId", providerSubmission.getId().toString());
Expand All @@ -67,10 +67,10 @@ public void run(Submission providerSubmission) {
familySubmission, FileNameUtility.getFileNameForPdf(familySubmission, "Provider-Responded"));
enqueueDocumentTransfer.enqueueUploadedDocumentBySubmission(userFileRepositoryService,
uploadedDocumentTransmissionJob, s3PresignService, familySubmission);
}else{
} else {
log.error(String.format("We can not find a match for your family submission: %s", clientId.get()));
}
}else{
} else {
log.error(String.format("Family Submission Id is Blank for the provider submission: %s.", providerSubmission.getId().toString()));
}

Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/flows-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,7 @@ flow:
info:
nextScreens:
- name: service-address
condition: EnableProviderRegistration
- name: confirm-address
service-address:
condition: EnableProviderRegistration
nextScreens:
- name: confirm-address
confirm-address:
Expand All @@ -594,7 +591,6 @@ flow:
nextScreens:
- name: submit-complete-final
submit-complete-final:
beforeDisplayAction: RemoveDummySubmissionForDev
nextScreens:
- name: registration-getting-started
condition: EnableProviderRegistration
Expand Down
10 changes: 7 additions & 3 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1196,17 +1196,21 @@ provider-response-submit-complete.notice-no=We will notify the CCR&R of your res
provider-response-submit-complete.button-no=Return to home

#info
provider-response-info.title=Provider Info
provider-response-info.header=Your provider information
provider-response-info.title=Tell us about yourself
provider-response-info.header=Tell us about yourself
provider-response-info.business-name=Business name
provider-response-info.business-name-help=If you have one, enter the business name you are registered under.
provider-response-info.first-name=First name
provider-response-info.first-name-help=Enter your first name.
provider-response-info.last-name=Last name
provider-response-info.last-name-help=Enter your last name.

#provider-address
provider-response-provider-service-address.title=Child care location
provider-response-provider-service-address.header=Where are you providing the child care?
provider-response-info.street-address=Street address
provider-response-info.street-address-help=Provide the location where care is taking place. If you are a relative or friend providing care, use your home address.
provider-response-info.street-address-2=Street address line 2
provider-response-info.street-address-2=Apartment #
provider-response-info.street-address-2-help=This is optional.
provider-response-info.city=City
provider-response-info.state=State
Expand Down
14 changes: 4 additions & 10 deletions src/main/resources/templates/providerresponse/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
th:replace="~{fragments/form :: form(action=${formAction}, content=~{::info})}">
<th:block th:ref="info">
<div class="form-card__content">
<th:block th:replace="~{fragments/inputs/text ::
text(inputName='providerResponseBusinessName',
label=#{provider-response-info.business-name},
helpText=#{provider-response-info.business-name-help})}"/>
<th:block th:replace="~{fragments/inputs/text ::
text(inputName='providerResponseFirstName',
label=#{provider-response-info.first-name},
Expand All @@ -27,12 +23,10 @@
text(inputName='providerResponseLastName',
label=#{provider-response-info.last-name},
helpText=#{provider-response-info.last-name-help})}"/>
<th:block th:replace="~{fragments/inputs/overrides/address ::
address(
validate=true,
requireAddressFields=true,
inputName='providerResponseService'
)}"/>
<th:block th:replace="~{fragments/inputs/text ::
text(inputName='providerResponseBusinessName',
label=#{provider-response-info.business-name},
helpText=#{provider-response-info.business-name-help})}"/>
</div>
<div class="form-card__footer">
<th:block th:replace="~{fragments/inputs/submitButton :: submitButton(
Expand Down
53 changes: 32 additions & 21 deletions src/main/resources/templates/providerresponse/service-address.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
<!DOCTYPE html>
<html th:lang="${#locale.language}" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/head :: head(title='TEMPLATE')}"></head>
<head th:replace="~{fragments/head :: head(title=#{provider-response-provider-service-address.title})}"></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: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/gcc-icons :: caring}"></th:block>
<th:block
th:replace="~{fragments/cardHeader :: cardHeader(header=#{provider-response-provider-service-address.header})}"/>
<th:block
th:replace="~{fragments/form :: form(action=${formAction}, content=~{::info})}">
<th:block th:ref="info">
<div class="form-card__content">
<th:block th:replace="~{fragments/inputs/overrides/address ::
address(
validate=true,
streetAddress2Label=#{general.street-address-2},
streetAddress2HelpText=#{provider-response-info.street-address-2-help},
requireAddressFields=true,
inputName='providerResponseService'
)}"/>
</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>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ void ProviderresponseJourneyTest_validLink() {
testPage.enter("providerResponseBusinessName", "Business Name");
testPage.enter("providerResponseFirstName", "First Name");
testPage.enter("providerResponseLastName", "Last Name");
testPage.clickButton("Continue");

// service-address
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("provider-response-provider-service-address.title"));
testPage.enter("providerResponseServiceStreetAddress1", "123 Main St");
testPage.enter("providerResponseServiceCity", "City");
testPage.selectFromDropdown("providerResponseServiceState", "IL - Illinois");
Expand Down Expand Up @@ -189,6 +193,10 @@ void ProviderresponseJourneyTest_noLink() {
testPage.enter("providerResponseBusinessName", "Business Name");
testPage.enter("providerResponseFirstName", "First Name");
testPage.enter("providerResponseLastName", "Last Name");
testPage.clickButton("Continue");

// service-address
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("provider-response-provider-service-address.title"));
testPage.enter("providerResponseServiceStreetAddress1", "123 Main St");
testPage.enter("providerResponseServiceCity", "City");
testPage.selectFromDropdown("providerResponseServiceState", "IL - Illinois");
Expand Down