Skip to content

fix: Feedback Form Submits Empty String#1705

Closed
chauhan-varun wants to merge 1 commit intojson-schema-org:mainfrom
chauhan-varun:fix/form-submit
Closed

fix: Feedback Form Submits Empty String#1705
chauhan-varun wants to merge 1 commit intojson-schema-org:mainfrom
chauhan-varun:fix/form-submit

Conversation

@chauhan-varun
Copy link
Copy Markdown
Contributor

@chauhan-varun chauhan-varun commented Jun 14, 2025

What kind of change does this PR introduce?

Bug Fix: Fixed a bug that allowed blank feedback submissions by enforcing comment field validation

Issue Number:

Screenshot from 2025-06-14 22-18-18

Summary
The changes I made to fix the bug include:

  • Added validation in both form submission handlers (createFeedbackHandler and createGitHubIssueHandler) to check if the feedback comment is empty or only contains whitespace
  • Changed the label from "Optional" to "Required" to clearly indicate that feedback is required
  • Added the required attribute to the textarea to enable HTML5 form validation
  • Added red text color to error messages for better visibility
  • Added code to clear previous error messages when a new submission is attempted
    These changes will prevent users from submitting empty feedback and will display an appropriate error message when they try to do so. The validation occurs both client-side (via the HTML5 required attribute) and server-side (via the JavaScript validation), providing a robust solution to the bug.

Does this PR introduce a breaking change?
N/A

If relevant, did you update the documentation?
N/A

Checklist

Please ensure the following tasks are completed before submitting this pull request.

@chauhan-varun chauhan-varun requested a review from a team as a code owner June 14, 2025 17:05
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 14, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview 9939a60

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 14, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.

Project coverage is 99.12%. Comparing base (b68db4b) to head (9939a60).
Report is 53 commits behind head on main.

Files with missing lines Patch % Lines
components/DocsHelp.tsx 66.66% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main    #1705      +/-   ##
===========================================
- Coverage   100.00%   99.12%   -0.88%     
===========================================
  Files           10       18       +8     
  Lines          396      458      +62     
  Branches       106      118      +12     
===========================================
+ Hits           396      454      +58     
- Misses           0        4       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Utkarsh-123github
Copy link
Copy Markdown
Member

Hi @chauhan-varun
It's great to see your enthusiasm and willingness to contribute actively to the JSON Schema project, we truly appreciate it.
However, I kindly suggest that you follow the contribution guidelines closely and get yourself assigned to an issue before opening a PR. This helps us coordinate efforts better and avoid duplicated work. It’s something that’s come up a couple of times now, so I wanted to gently remind you.

Open source is not just about contributing code, it's also about collaboration, communication, and a bit of patience. I’m sure with time, you’ll make some meaningful contributions here. Looking forward to working together!

@chauhan-varun
Copy link
Copy Markdown
Contributor Author

Hi @Utkarsh-123github

Thank you so much for your kind message and guidance — I truly appreciate it.

I completely understand the importance of following contribution guidelines and the need to coordinate properly within the team. The reason I went ahead with the PR was simply because the issue seemed very small and quick to resolve — it took me barely five minutes, and I thought it would be helpful to just get it done rather than wait to be assigned.

That said, I totally respect the process and will make sure to get assigned to an issue first before submitting any future PRs. I'm really looking forward to learning and contributing more meaningfully to the project.

Thanks again for the encouragement!

@benjagm
Copy link
Copy Markdown
Collaborator

benjagm commented Jun 28, 2025

@idanidan29 Can you please review this PR?

@benjagm benjagm moved this from Unclear to In Review Team in PR - Triage Group Jun 28, 2025
Copy link
Copy Markdown
Collaborator

@idanidan29 idanidan29 left a comment

Choose a reason for hiding this comment

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

@chauhan-varun Thanks for the effort your PR looks good! Just a quick note: in the current state of the website, the DocHelp component has already been adapted to ShadCN. Could you please rebase your branch and adjust the code accordingly to avoid conflicts?

@Utkarsh-123github Utkarsh-123github moved this from In Review Team to Changes requested in PR - Triage Group Jun 28, 2025
@chauhan-varun
Copy link
Copy Markdown
Contributor Author

@idanidan29 okay i'll adjust the changes

@github-project-automation github-project-automation bot moved this from Changes requested to Done in PR - Triage Group Jun 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛Bug: Feedback Form Submits Empty String

4 participants