-
Notifications
You must be signed in to change notification settings - Fork 45
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
17835 Show business lookup error for invalid name change entity types #713
Conversation
@@ -59,7 +59,7 @@ export default class BusinessFetch extends Vue { | |||
private validate (): boolean { | |||
if (!this.searchField) { | |||
this.errorMessages = ['Required field'] | |||
} else if (!/^(A|BC|C|CP|FM|LLC|LP|S|XCP|XL|XP|XS)( |)\d{7}$/i.test(this.searchField)) { | |||
} else if (!/^(A|BC|C|CP|FM|LLC|LP|PA|PAR|S|XCP|XL|XP|XS)( |)\d{7}$/i.test(this.searchField)) { |
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 am just going to resolve 17952 at the same time as this ticket. This change, plus Vysakh's ticket were all that was needed.
Side note: Would it be valuable to come up with a generic solution here? For example: changing this regex to just check the generic format of having a 1-3 letter code followed by 7 digits, rather than checking the codes explicitly? Otherwise we will have to remember to update this specific section of code whenever a legal type code is added or changed.
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.
That's a really good idea.
It would also be good to display a useful error message if the format is invalid.
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.
Good call, I'll run the idea past UX
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.
Updated the regex, just waiting to hear back from UX on the wording of the error message.
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.
This all looks good to me.
When you hear back, if everything is OK, merge away.
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.
LGTM 👍
/gcbrun |
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.
Lots of little "tactical" changes... Looks great!
Temporary Url for review: https://namerequest-dev--pr-713-c5l2iich.web.app |
Issue #: /bcgov/entity#17835
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namerequest license (Apache 2.0).