Fixed: The add button is not disabled#176
Fixed: The add button is not disabled#176PadamSinha2511 wants to merge 3 commits intoEddieHubCommunity:mainfrom
Conversation
Bashamega
left a comment
There was a problem hiding this comment.
Please fix the failing tests
Sure will look into it |
| dockerfile: Dockerfile.dev | ||
| volumes: | ||
| - .:/usr/src/app | ||
| - /usr/src/app/node_modules |
There was a problem hiding this comment.
please do not use main in your fork, because these changes should not be in your 2nd PR
There was a problem hiding this comment.
So i should checkout to some other branch and then push the changes.Right?
There was a problem hiding this comment.
You should always create a new branch from main, but you never push to main, your changes only enter main when your PR is accepted and merged, then you update your main to be in sync with upstream
I have a video demoing and explain on my youtube channel
| const [isGithubUrlValid,setIsGithubUrlValid] = useState(false) | ||
| const [isDisabled,setIsDisabled] = useState(true) | ||
|
|
||
| const githubRegex = /^https:\/\/github\.com\/[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+$/; |
There was a problem hiding this comment.
My concern with this, is we should let github return a 404 if the repo is not found - if we try to do it with a regex we might be stopping people adding repos
There was a problem hiding this comment.
After more thought, I am concerned that this might present other bugs in the future
There was a problem hiding this comment.
My concern with this, is we should let github return a
404if the repo is not found - if we try to do it with a regex we might be stopping people adding repos
I suggested regex so people can't enter non repo links. Like git lab links or spam links, or anything else
There was a problem hiding this comment.
I think the UX is better, but could create a bug without us knowing. At the moment we rely on github returning a 200 or 404 which after some thought I think is better
There was a problem hiding this comment.
okay so I think we could only check for the domain using regex i.e. whatever the URL is being entered has to be a GitHub URL and let's not check further as if the repo does not exist the GitHub itself will return a 404.
Example:
https://google.com/EddieHubCommunity/HealthCheck --> is a invalid URL
https://github.com/EddieHubCommunity/Reop --> returns a 404 from github
https://github.com/EddieHubCommunity/HealthCheck --> a valid URL
There was a problem hiding this comment.
great idea, that is a great idea and comprise 👍
|
|
||
| const githubRegex = /^https:\/\/github\.com\/[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+$/; | ||
|
|
||
| useEffect(()=>{ |
There was a problem hiding this comment.
Please format files to our project standards
Closes #149
Changes proposed
Now the save button is disabled for empty as well as for invalid repo URLs, it only enables If the repo URL is valid.
Screenshots
Screencast.from.2024-08-16.16-50-05.webm