Skip to content

Keep code review submit button disabled until there is text - #48069

Merged
sanchitmalhotra126 merged 1 commit into
stagingfrom
sanchit/code-review-empty-text
Sep 13, 2022
Merged

Keep code review submit button disabled until there is text#48069
sanchitmalhotra126 merged 1 commit into
stagingfrom
sanchit/code-review-empty-text

Conversation

@sanchitmalhotra126

Copy link
Copy Markdown
Contributor

We saw an issue where the submit button would sometimes get enabled even if there was no text in the comment box. This was due to the fact that when there's no text, the comment text value may still contain newline characters (either '\n' for only paragraph text or '```\n\n\n```\n' for code block markdown + paragraph). This adds a check which trims newlines to check if the comment contents are actually empty. Trying to save empty comments would result in a 404 anyway but this issue was causing some flakiness in UI tests.

Screen Shot 2022-09-13 at 10 54 07 AM
Screen Shot 2022-09-13 at 10 54 15 AM

Links

JIRA: https://codedotorg.atlassian.net/browse/JAVA-683

Testing story

Tested locally with empty text, newlines, and spaces.

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@sanchitmalhotra126
sanchitmalhotra126 requested a review from a team September 13, 2022 16:05
@sanchitmalhotra126
sanchitmalhotra126 marked this pull request as ready for review September 13, 2022 16:05

@molly-moen molly-moen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice fix!

@sanchitmalhotra126
sanchitmalhotra126 merged commit b5fe584 into staging Sep 13, 2022
@sanchitmalhotra126
sanchitmalhotra126 deleted the sanchit/code-review-empty-text branch September 13, 2022 17:39
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