From d1e677bc4fb7c8be52f09f889471982c200265ca Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Wed, 20 Nov 2024 11:42:57 -0800 Subject: [PATCH 1/2] ILGCC-CCAP-319 Add autocomplete capabilities to relevent input fields (#621) * ILGCC-CCAP-319 Add autocomplete capabilities to relevent input fields * Fix failing tests * Further additions to README --- README.md | 27 +++++++++++++++++++ .../templates/fragments/inputs/address.html | 10 +++++++ .../templates/fragments/inputs/date.html | 24 ++++++++++------- .../templates/fragments/inputs/number.html | 2 ++ .../templates/fragments/inputs/phone.html | 2 ++ .../templates/fragments/inputs/select.html | 2 ++ .../templates/fragments/inputs/text.html | 2 ++ .../templates/fragments/inputs/textArea.html | 2 ++ .../library/file/UploadJourneyTests.java | 2 +- 9 files changed, 63 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2ddf940c..97aed7a3 100644 --- a/README.md +++ b/README.md @@ -1171,6 +1171,10 @@ names, addresses, and emails, etc. Text inputs have an optional placeholder parameter which can be used to display a placeholder within the rendered input field. +Additionally, text inputs have an optional autoComplete parameter which can be used to pass auto +complete tokens. [For more information, see the MDN article on autocomplete.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) + + Example of using a text input: ```html @@ -1196,6 +1200,9 @@ if no value is passed and maxlength will default to 500 if no value is passed. A convenience live template for text area inputs is provided through `cfa:inputTextArea`. +Additionally, text area inputs have an optional autoComplete parameter which can be used to pass auto +complete tokens. [For more information, see the MDN article on autocomplete.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) + #### Number Number inputs are used to gather numbers from users. The number input makes use @@ -1225,6 +1232,9 @@ the end of the number input, like so: In this `postfix` example, the string passed in was "hrs". The string will not get submitted with the input data and is only shown in the user interface. +Additionally, number inputs have an optional autoComplete parameter which can be used to pass auto +complete tokens. [For more information, see the MDN article on autocomplete.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) + A live template for numbers is provided through `cfa:inputNumber`. #### Social Security Number @@ -1250,6 +1260,9 @@ state code to state name, like so: The value saved from this input is the selected state's code. Example `MA`. +Additionally, state inputs have an optional autoComplete parameter which can be used to pass auto +complete tokens. [For more information, see the MDN article on autocomplete.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) + #### Submit Button Submit button will submit form data to the server and will move you along to the next screen, @@ -1298,6 +1311,9 @@ values will be stored in the database. Phone inputs also have an optional `place A convenience live template for phone inputs is provided through `cfa:inputPhone`. +Additionally, phone inputs have an optional autoComplete parameter which can be used to pass auto +complete tokens. [For more information, see the MDN article on autocomplete.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) + #### YesOrNo Yes or no inputs are used to gather a `yes` or `no` answer from a user. They are visually displayed @@ -1522,6 +1538,11 @@ They are visually displayed as three separate inputs for Month, Day and Year in A convenience live template for dates is provided through `cfa:inputDate`. +Additionally, date inputs have a optional autoComplete parameters for each input, Month, Day and year. +These are `autoCompleteMonth`, `autoCompleteDay` and `autoCompleteYear` which can be used to pass auto +complete tokens. [For more information, see the MDN article on autocomplete.](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) + + #### Address For convenience, we have provided a `cfa:address` live template to quickly create an address @@ -1575,6 +1596,12 @@ The address fragment has these optional parameters the `address.state` key in the message source file. - `zipCodeLabel` - text used for label as this field; if not passed in this will default to the `address.zip` key in the message source file. +- `autoCompleteStreetAddress1` - auto complete token for street address 1 +- `autoCompleteStreetAddress2` - auto complete token for street address 2 +- `autoCompleteCity` - auto complete token for city +- `autoCompleteState` - auto complete token for state +- `autoCompleteZipCode` - auto complete token for zip code + #### Reveal diff --git a/src/main/resources/templates/fragments/inputs/address.html b/src/main/resources/templates/fragments/inputs/address.html index e6da6d0e..811a932b 100644 --- a/src/main/resources/templates/fragments/inputs/address.html +++ b/src/main/resources/templates/fragments/inputs/address.html @@ -17,29 +17,39 @@ cityInputName=${inputName + T(formflow.library.inputs.AddressParts).CITY.toString()}, stateInputName=${inputName + T(formflow.library.inputs.AddressParts).STATE.toString()}, zipCodeInputName=${inputName + T(formflow.library.inputs.AddressParts).ZIPCODE.toString()}, + hasAutoCompleteStreetAddress1=${!#strings.isEmpty(autoCompleteStreetAddress1)}, + hasAutoCompleteStreetAddress2=${!#strings.isEmpty(autoCompleteStreetAddress2)}, + hasAutoCompleteCity=${!#strings.isEmpty(autoCompleteCity)}, + hasAutoCompleteState=${!#strings.isEmpty(autoCompleteState)}, + hasAutoCompleteZipCode=${!#strings.isEmpty(autoCompleteZipCode)}, validateAddressInputName=${T(formflow.library.inputs.FieldNameMarkers).UNVALIDATED_FIELD_MARKER_VALIDATE_ADDRESS + inputName}" > diff --git a/src/main/resources/templates/fragments/inputs/date.html b/src/main/resources/templates/fragments/inputs/date.html index b70a9b0a..bfbc5f91 100644 --- a/src/main/resources/templates/fragments/inputs/date.html +++ b/src/main/resources/templates/fragments/inputs/date.html @@ -8,6 +8,9 @@ (requiredInputsForFlow != null && requiredInputsForFlow.getOrDefault(inputName + 'Day', false)) || (requiredInputsForFlow != null && requiredInputsForFlow.getOrDefault(inputName + 'Year', false)) || (required != null && required)}, + hasAutoCompleteMonth=${!#strings.isEmpty(autoCompleteMonth)}, + hasAutoCompleteDay=${!#strings.isEmpty(autoCompleteDay)}, + hasAutoCompleteYear=${!#strings.isEmpty(autoCompleteYear)}, hasErrorMonth=${errorMessages != null && !#arrays.isEmpty(errorMessages.get(inputName + 'Month'))}, hasErrorDay=${errorMessages != null && !#arrays.isEmpty(errorMessages.get(inputName + 'Day'))}, hasErrorYear=${errorMessages != null && !#arrays.isEmpty(errorMessages.get(inputName + 'Year'))}, @@ -47,9 +50,10 @@ th:name="${inputName}+'Month'" th:placeholder="#{general.month-format}" th:attr=" - aria-describedby=${inputName + '-month-label'}, - aria-labelledby=${hasAriaLabel ? ariaLabel : ''}, - aria-invalid=${hasErrorMonth}" + autocomplete=${hasAutoCompleteMonth ? autoCompleteMonth : null}, + aria-describedby=${inputName + '-month-label'}, + aria-labelledby=${hasAriaLabel ? ariaLabel : ''}, + aria-invalid=${hasErrorMonth}" th:value="${fieldData.getOrDefault(inputName + 'Month', '')}"/> / / diff --git a/src/main/resources/templates/fragments/inputs/number.html b/src/main/resources/templates/fragments/inputs/number.html index b42fb3a5..0a9e0e4c 100644 --- a/src/main/resources/templates/fragments/inputs/number.html +++ b/src/main/resources/templates/fragments/inputs/number.html @@ -6,6 +6,7 @@ hasPattern=${!#strings.isEmpty(pattern)}, hasLabel=${!#strings.isEmpty(label)}, hasAriaLabel=${!#strings.isEmpty(ariaLabel)}, + hasAutoComplete=${!#strings.isEmpty(autoComplete)}, requiredInputsForFlow=${requiredInputs.get(flow)}, isRequiredInput=${(requiredInputsForFlow != null && requiredInputsForFlow.getOrDefault(inputName, false)) || (required != null && required)}, hasError=${ @@ -32,6 +33,7 @@ th:name="${inputName}" th:placeholder="${placeholder}" th:attr=" + autocomplete=${hasAutoComplete ? autoComplete : null}, title=${hasTitle ? title : #messages.msg('general.inputs.number')}, pattern=${hasPattern ? pattern : '^\d*(\.\d{0,2})?$'}, aria-describedby=${hasHelpText ? inputName + '-help-text' : ''}, diff --git a/src/main/resources/templates/fragments/inputs/phone.html b/src/main/resources/templates/fragments/inputs/phone.html index 37d56ad4..7db4d006 100644 --- a/src/main/resources/templates/fragments/inputs/phone.html +++ b/src/main/resources/templates/fragments/inputs/phone.html @@ -4,6 +4,7 @@ hasHelpText=${!#strings.isEmpty(helpText)}, hasLabel=${!#strings.isEmpty(label)}, hasAriaLabel=${!#strings.isEmpty(ariaLabel)}, + hasAutoComplete=${!#strings.isEmpty(autoComplete)}, requiredInputsForFlow=${requiredInputs.get(flow)}, isRequiredInput=${(requiredInputsForFlow != null && requiredInputsForFlow.getOrDefault(inputName, false)) || (required != null && required)}, hasError=${ @@ -28,6 +29,7 @@ th:name="${inputName}" th:placeholder="${placeholder}" th:attr=" + autocomplete=${hasAutoComplete ? autoComplete : null}, aria-describedby=${hasHelpText ? inputName + '-help-text' : ''}, aria-labelledby=${hasAriaLabel ? ariaLabel : ''}, aria-invalid=${hasError}" diff --git a/src/main/resources/templates/fragments/inputs/select.html b/src/main/resources/templates/fragments/inputs/select.html index 43a63951..1056a131 100644 --- a/src/main/resources/templates/fragments/inputs/select.html +++ b/src/main/resources/templates/fragments/inputs/select.html @@ -4,6 +4,7 @@ hasHelpText=${!#strings.isEmpty(helpText)}, hasLabel=${!#strings.isEmpty(label)}, hasAriaLabel=${!#strings.isEmpty(ariaLabel)}, + hasAutoComplete=${!#strings.isEmpty(autoComplete)}, requiredInputsForFlow=${requiredInputs.get(flow)}, isRequiredInput=${(requiredInputsForFlow != null && requiredInputsForFlow.getOrDefault(inputName, false)) || (required != null && required)}, hasError=${ @@ -31,6 +32,7 @@ th:id="${inputName}" th:name="${inputName}" th:attr=" + autocomplete=${hasAutoComplete ? autoComplete : null}, aria-describedby=${hasHelpText ? inputName + '-help-text' : ''}, aria-labelledby=${hasAriaLabel ? ariaLabel : ''}, aria-invalid=${hasError}"> diff --git a/src/main/resources/templates/fragments/inputs/text.html b/src/main/resources/templates/fragments/inputs/text.html index 9b6435de..4580f3eb 100644 --- a/src/main/resources/templates/fragments/inputs/text.html +++ b/src/main/resources/templates/fragments/inputs/text.html @@ -4,6 +4,7 @@ hasHelpText=${!#strings.isEmpty(helpText)}, hasLabel=${!#strings.isEmpty(label)}, hasAriaLabel=${!#strings.isEmpty(ariaLabel)}, + hasAutoComplete=${!#strings.isEmpty(autoComplete)}, requiredInputsForFlow=${requiredInputs.get(flow)}, isRequiredInput=${(requiredInputsForFlow != null && requiredInputsForFlow.getOrDefault(inputName, false)) || (required != null && required)}, hasError=${ @@ -28,6 +29,7 @@ th:name="${inputName}" th:placeholder="${placeholder}" th:attr=" + autocomplete=${hasAutoComplete ? autoComplete : null}, aria-describedby=${hasHelpText ? inputName + '-help-text' : ''}, aria-labelledby=${hasAriaLabel ? ariaLabel : ''}, aria-invalid=${hasError}" diff --git a/src/main/resources/templates/fragments/inputs/textArea.html b/src/main/resources/templates/fragments/inputs/textArea.html index 263fdbef..b904aabc 100644 --- a/src/main/resources/templates/fragments/inputs/textArea.html +++ b/src/main/resources/templates/fragments/inputs/textArea.html @@ -4,6 +4,7 @@ hasHelpText=${!#strings.isEmpty(helpText)}, hasLabel=${!#strings.isEmpty(label)}, hasAriaLabel=${!#strings.isEmpty(ariaLabel)}, + hasAutoComplete=${!#strings.isEmpty(autoComplete)}, rows=${!#strings.isEmpty(rows)} ? ${rows} : '6', maxLength=${!#strings.isEmpty(maxLength)} ? ${maxLength} : '500', requiredInputsForFlow=${requiredInputs.get(flow)}, @@ -29,6 +30,7 @@ type="textarea" class="textarea spacing-below-0" th:attr=" + autocomplete=${hasAutoComplete ? autoComplete : null}, aria-describedby=${hasHelpText ? inputName + '-help-text' : ''}, aria-labelledby=${hasAriaLabel ? ariaLabel : ''}, rows=${rows}, diff --git a/src/test/java/formflow/library/file/UploadJourneyTests.java b/src/test/java/formflow/library/file/UploadJourneyTests.java index 8fd71cfa..0b5b352b 100644 --- a/src/test/java/formflow/library/file/UploadJourneyTests.java +++ b/src/test/java/formflow/library/file/UploadJourneyTests.java @@ -60,7 +60,7 @@ void documentUploadFlow() { //Race condition caused by uploadPasswordProtectedPdf waits until upload file has file details added instead //of waiting until file upload is complete. try { - Thread.sleep(500); + Thread.sleep(2000); } catch (InterruptedException e) { throw new RuntimeException(e); } From 4a69354cd85735126054f52b5db4d99a2fcbb524 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:47:15 -0800 Subject: [PATCH 2/2] Bump org.springframework.integration:spring-integration-ws (#622) Bumps [org.springframework.integration:spring-integration-ws](https://github.com/spring-projects/spring-integration) from 6.3.5 to 6.4.0. - [Release notes](https://github.com/spring-projects/spring-integration/releases) - [Commits](https://github.com/spring-projects/spring-integration/compare/v6.3.5...v6.4.0) --- updated-dependencies: - dependency-name: org.springframework.integration:spring-integration-ws dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alex Gonzalez --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 69f9b17d..e4047d1c 100644 --- a/build.gradle +++ b/build.gradle @@ -67,7 +67,7 @@ dependencies { // This dependency is used internally, and not exposed to consumers on their own compile classpath. api 'org.springframework.boot:spring-boot-starter-thymeleaf' - implementation 'org.springframework.integration:spring-integration-ws:6.3.5' + implementation 'org.springframework.integration:spring-integration-ws:6.4.0' implementation 'com.google.guava:guava:33.3.1-jre' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-validation'