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

Fix wrong validation of projectid #571

Closed
wants to merge 1 commit into from
Closed

Fix wrong validation of projectid #571

wants to merge 1 commit into from

Conversation

nick2432
Copy link
Contributor

@nick2432 nick2432 commented Oct 1, 2023

What does this PR do?

update the helper text

Test Plan

I update the CustomId component when name is project, it will use a new InputProjectId rather than InputId.

I updated the unit tests, and I verified that they all passed successfully.

before
before

after
after

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

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

Great PR! 🤯 We left some comments during the review, please check them out.

src/lib/elements/forms/inputProjectId.svelte Show resolved Hide resolved

let element: HTMLInputElement;
let icon = 'info';
const pattern = String.raw`^[a-z0-9][a-z0-9-]{1,35}$`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Something seems wrong with this pattern when it actually gets built. in the browser console logs i see:

Pattern attribute value ^[a-z0-9][a-z0-9-]{1,35}$ is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /^[a-z0-9][a-z0-9-]{1,35}$/v: Invalid character class

And it doesn't look like the client-side validation works because the network request is sent despite the invalid id:

image

@nick2432 nick2432 closed this by deleting the head repository Oct 16, 2023
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.

2 participants