-
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-453][CCAP-439][CCAP-537] Update content on providerresponse/provider-number screen, update provider id validation logic, remove broken link #869
Changes from all commits
9568b63
fcaaa39
9bafd92
84cbe0d
3ca9368
d5b7ca5
4387084
a120a54
6747314
75dca6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
package org.ilgcc.app.data; | ||
|
||
import java.math.BigInteger; | ||
import java.time.LocalDate; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface ProviderRepository extends JpaRepository<Provider, BigInteger> { | ||
|
||
@Query(value = "SELECT CASE WHEN COUNT(*) > 0 THEN TRUE ELSE FALSE END FROM providers " | ||
+ "WHERE status IN :statuses AND provider_id = :providerId " | ||
+ "AND date_of_last_approval >= :threeYearsAgo", nativeQuery = true) | ||
boolean existsByStatusInAndProviderIdAndDateOfLastApprovalAfter(@Param("statuses") List<String> statuses, | ||
@Param("providerId") BigInteger providerId, @Param("threeYearsAgo") LocalDate threeYearsAgo); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,10 +34,20 @@ public Map<String, List<String>> runValidation(FormSubmission formSubmission, Su | |
Map<String, List<String>> errorMessages = new HashMap<>(); | ||
String inputValue = (String) formSubmission.getFormData().get(PROVIDER_NUMBER); | ||
|
||
if (validateProviderId && !providerRepositoryService.isProviderIdValid(inputValue)) { | ||
if (validateProviderId) { | ||
Locale locale = LocaleContextHolder.getLocale(); | ||
errorMessages.put(PROVIDER_NUMBER, | ||
List.of(messageSource.getMessage("provider-response-ccap-registration.error.invalid-number", null, locale))); | ||
|
||
if (inputValue == null || inputValue.isBlank()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I love the most specific error messages here. I think it makes it much clearer what the actual issue is. |
||
errorMessages.put(PROVIDER_NUMBER, | ||
List.of(messageSource.getMessage("errors.provide-provider-number", null, locale))); | ||
} else if (inputValue.length() < 8 || inputValue.length() > 15) { | ||
errorMessages.put(PROVIDER_NUMBER, | ||
List.of(messageSource.getMessage("errors.provide-provider-number-length", null, locale))); | ||
} else if (!providerRepositoryService.isProviderIdValid(inputValue)) { | ||
errorMessages.put(PROVIDER_NUMBER, | ||
List.of(messageSource.getMessage("provider-response-provider-number.error.invalid-number", null, | ||
locale))); | ||
} | ||
} | ||
|
||
return errorMessages; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -522,22 +522,18 @@ flow: | |
nextScreens: | ||
- name: paid-by-ccap | ||
condition: EnableProviderRegistration | ||
- name: ccap-registration | ||
- name: provider-number | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @spokenbird - heads up that this PR is actually renaming the ccap-registration screen to provider-number so it will actually always appear at the beginning of the flow. This means that you probably no longer need to add the GenerateDummyClientSubmissionForDev to the paid by CCAP screen |
||
paid-by-ccap: | ||
condition: EnableProviderRegistration | ||
nextScreens: | ||
- name: provider-number | ||
condition: IsPaidByCCAP | ||
- name: registration-start | ||
provider-number: | ||
condition: EnableProviderRegistration | ||
nextScreens: | ||
- name: confirmation-code | ||
registration-start: | ||
condition: EnableProviderRegistration | ||
nextScreens: | ||
- name: registration-getting-started | ||
ccap-registration: | ||
provider-number: | ||
crossFieldValidationAction: ValidateProviderNumber | ||
beforeSaveAction: SaveApplicationId | ||
onPostAction: GenerateDummyClientSubmissionForDev | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ | |
<th:block | ||
th:replace="~{fragments/inputs/submitButton :: submitButton(text=${buttonLabel != null ? buttonLabel : 'Submit'})}"/> | ||
<div> | ||
<a th:if="hasSkipLocation" | ||
<a th:if="${hasSkipLocation}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was apparently always broken, fwiw. |
||
th:id="${'skip-to-'+skipLocation}" | ||
th:text="${hasSkipTextValue ? skipText : 'Skip'}" | ||
th:href="|/flow/${flow}/${skipLocation}|"></a> | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,37 @@ | ||
<!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:replace="~{fragments/inputs/screenWithOneInputAndSkip :: | ||
screenWithOneInputAndSkip( | ||
title=#{'provider-response-provider-number.title'}, | ||
iconFragment=~{fragments/gcc-icons :: registeredProvider}, | ||
header=#{provider-response-provider-number.header}, | ||
required='true', | ||
subtext=#{provider-response-provider-number.subtext}, | ||
buttonLabel=#{general.button.continue}, | ||
formAction=${formAction}, | ||
inputContent=~{::inputContent})}"> | ||
|
||
<th:block th:ref="inputContent"> | ||
<div class="spacing-below-60 move-40-up"> | ||
<th:block th:replace="~{'fragments/honeycrisp/reveal' :: reveal( | ||
controlId='r1', | ||
linkLabel=~{::revealLabel1}, | ||
content=~{::revealContent1}, | ||
forceShowContent='true')}"> | ||
<th:block th:ref="revealLabel1"> | ||
<th:span th:text="#{provider-response-provider-number.accordion.title}"></th:span> | ||
</th:block> | ||
<th:block th:ref="revealContent1"> | ||
<p th:text="#{provider-response-provider-number.accordion.intro}"></p> | ||
<ul class="list--bulleted"> | ||
<li th:utext="#{provider-response-provider-number.accordion.document1}"></li> | ||
<li th:utext="#{provider-response-provider-number.accordion.document2}"></li> | ||
<li th:utext="#{provider-response-provider-number.accordion.document3}"></li> | ||
<li th:utext="#{provider-response-provider-number.accordion.document4}"></li> | ||
</ul> | ||
</th:block> | ||
</th:block> | ||
</th:block> | ||
</main> | ||
</div> | ||
</section> | ||
</div> | ||
<th:block th:replace="~{fragments/footer :: footer}"/> | ||
</body> | ||
</html> | ||
</div> | ||
<th:block | ||
th:replace="~{fragments/inputs/overrides/number :: number(inputName='providerResponseProviderNumber', ariaLabel='header', required='true')}"/> | ||
</th:block> | ||
</th:block> |
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.
I tunneled into staging and tested this query using psql. the test worked :)