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

Add user friendly validation messages #1442

Closed
wants to merge 1 commit into from

Conversation

lukasdo
Copy link

@lukasdo lukasdo commented Feb 5, 2024

As described in #1351 the validation messages are not very user-friendly. Additionally the validation of the telephone number (which is a String value) with @Digits is faulty because leading zeros are ignored when converting from String to BigDecimal in the DigitsValidator. This faulty behaviour was also visible in the tests where an 11 digit number was parsed as the telephone number.

	@Test
	void testProcessCreationFormSuccess() throws Exception {
		mockMvc
			.perform(post("/owners/new").param("firstName", "Joe")
				.param("lastName", "Bloggs")
				.param("address", "123 Caramel Street")
				.param("city", "London")
				.param("telephone", "01316761638"))
			.andExpect(status().is3xxRedirection());
	}

These caused the failing tests in #1361.

Copy link
Contributor

@zyberzebra zyberzebra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Catch with the digits! I woud remove the messages you added, because they dont provide any benefit and just add maintenance

@@ -28,11 +28,11 @@
public class Person extends BaseEntity {

@Column(name = "first_name")
@NotBlank
@NotBlank(message = "First Name cannot be blank")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THe message is redundant and should be removed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message was requested in #1361

@dsyer
Copy link
Member

dsyer commented May 16, 2024

If someone can resolve the conflict I'm happy to merge.

@dsyer
Copy link
Member

dsyer commented May 16, 2024

I think this is obsolete with #1483

@dsyer dsyer closed this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants