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 invoice prefix input validation #391

Merged
merged 2 commits into from
Dec 14, 2021
Merged

Conversation

AlexP11223
Copy link
Contributor

@AlexP11223 AlexP11223 commented Dec 6, 2021

Fixes #390

Limited max length to 15 and added pattern attribute with regex to allow only latin letters and -, _.

When contains not allowed characters, the red border appears:

image

There are some issues such as that when saving via the button and the prefix is invalid, the page will scroll to it, but not enough, and it will be hidden under the page header.

image

But during input the red border appears immediately, so it should be good enough for this admin setting.

At first I was thinking to simply delete/replace the not allowed characters during saving on the server side, but it could result in confusion and bad prefixes (not unique across the merchant instances), because the merchant would not notice it after saving + afaik currently there is no good way to show a noticeable error message after saving, and we do not validate anything else like this.

@AlexP11223 AlexP11223 requested a review from Dinamiko December 6, 2021 13:12
@Dinamiko Dinamiko merged commit d3626bf into trunk Dec 14, 2021
@Dinamiko Dinamiko deleted the pcp-446-prefix-input-validation branch December 14, 2021 15:01
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.

empty space in invoice prefix causes smart buttons to not load (446)
2 participants