Skip to content

Conversation

@scottstewart-sl
Copy link

@scottstewart-sl scottstewart-sl commented Oct 30, 2025

JIRA link (if applicable)

https://tools.hmcts.net/jira/browse/CCD-6925

Change description

Currently when a text field in ExUI has a max size and the provided content exceeds it, the full field content is included in the validation error message. Sometimes that field content can be very long which makes the error message hard to read.

Ideally the content wouldn't be included at all in the validation error message, but as a light touch improvement for now I propose truncating the text value in the error message if it is longer than a certain size.

I am also suggesting to add the character count for the field value in the error message so that the user has an idea of how far over the limit they were. I have also modified the error message for the minimum length validation for consistency.

Currently the field value is truncated to 50 characters, but this could easily be changed if required.

Maximum length validation:

Before:
max-before

After:
max-after

Minimum length validation:

Before:
min-before
After:
min-after

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

…_length_validation_messages

# Conflicts:
#	src/test/java/uk/gov/hmcts/ccd/domain/types/BaseLocationValidatorTest.java
#	src/test/java/uk/gov/hmcts/ccd/domain/types/RegionValidatorTest.java
#	src/test/java/uk/gov/hmcts/ccd/domain/types/TextValidatorTest.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant