ros-infrastructure / rosindex

The source code for generating index.ros.org
https://index.ros.org
GNU General Public License v3.0
12 stars 23 forks source link

404 Page handling w/ issue form (#362) #365

Closed gabrielhsdev closed 3 months ago

gabrielhsdev commented 3 months ago

This pull request introduces the updateGitHref() function. It is responsible for dynamically updating a GitHub issue link with relevant information.

Referrer URL Handling: It's worth noting that accessing document.referrer might result in an empty value if the user navigated directly to the page or if the browser's privacy settings restrict referrer information. The function handles such scenarios, providing a default value to prevent errors.

Issue: #362 from @tfoote

gabrielhsdev commented 3 months ago

Hi @tfoote I'm about to start implementing the requested changes. From what I gathered, I need to:

Does this align with your expectations?

Moreover, it's worth noting that the placeholder text doesn't auto-populate the form. Instead, it functions as a visual cue, presenting text within the input field until users input their own text, which then supersedes the placeholder. Essentially, it serves as a subtle prompt rather than pre-filling the form.

Please refer to the image below: the 'Submit New Issue' button remains unavailable until both required fields are properly filled.

image

tfoote commented 3 months ago

Thanks for the testing on your instance and finding out that the validation works better than I had expected. I'll give it a try with slightly tweaked verbiage.

gabrielhsdev commented 3 months ago

Thanks @tfoote

Based on my experimentation, it appears that the required fields function solely on public repositories. The following quote provides further insight: Prevents form submission until element is completed. Only for public repositories.

Should I add the checkboxes ?

Thanks

tfoote commented 3 months ago

With the placeholders not filling the validation it's not necessary.

Trying it out https://github.com/ros-infrastructure/rosindex/issues/new?labels=bug&template=form404.yml&referrer=testreferrerURL&404page=test404pageurl&title=test_title

I found one bug that there's a typo in the referrer key which is missing an r https://github.com/ros-infrastructure/rosindex/pull/365/files#diff-128cc35baaf40bac8ae4d2932ca6e009311e8279f03f258e9cc83966f1d5b32eR64

gabrielhsdev commented 3 months ago

Thank you @tfoote. I'll check out other issues to see if I can offer any assistance. If I can be of help somehow, you could send me an email at or maybe just tag me on an issue. Email: henriquegabrielhs21@gmail.com

Thanks!