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 Unable to Preview a Reply for a Comment Before Publishing it #20394

Conversation

joaoGabriel55
Copy link
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

I can't preview a comment that I wrote before publishing it. There is nothing happen when I click the button.

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

  1. Go to a post.
  2. Go to a comment and click reply.
  3. Write a reply.
  4. Click "preview" button.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Semantic HTML implemented?
  • Keyboard operability supported?
  • Checked with axe DevTools and addressed Critical and Serious issues?
  • Color contrast tested?

For more info, check out the
Forem Accessibility Docs.

Added/updated tests?

We encourage you to keep the code coverage percentage at 80% and above.

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

[optional] Are there any post deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

alt_text

@joaoGabriel55 joaoGabriel55 requested a review from a team as a code owner November 24, 2023 18:11
@joaoGabriel55 joaoGabriel55 requested review from lightalloy and maestromac and removed request for a team November 24, 2023 18:11
Copy link
Contributor

Thank you for opening this PR! We appreciate you!

For all pull requests coming from third-party forks we will need to
review the PR before we can process it through our CI pipelines.

A Forem Team member will review this contribution and get back to
you as soon as possible!

@joaoGabriel55
Copy link
Contributor Author

I do not know if this was the better approach because we lost a (simple) test

Copy link
Contributor

github-actions bot commented Nov 24, 2023

Uffizzi Ephemeral Environment Deploying

☁️ https://app.uffizzi.com/github.com/forem/forem/pull/20394

⚙️ Updating now by workflow run 9031305757.

What is Uffizzi? Learn more!

Copy link
Contributor

@maestromac maestromac left a comment

Choose a reason for hiding this comment

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

Thanks for this PR. I think what you got here is too drastic of a change. The problem is that when we migrated legacy JS (JS within assets) off to bundler JS (app/java scripts), we lost the implied global function assignment. What I'm suggesting as a solution instead is to add

  window.handleCommentPreview = handleCommentPreview;

onto line 67 of app/assets/javascripts/initializers/initializeCommentsPage.js.erb
That will resolve this issue with mininal change. what do you think?

@ccoVeille
Copy link

Thanks for this PR. I think what you got here is too drastic of a change. The problem is that when we migrated legacy JS (JS within assets) off to bundler JS (app/java scripts), we lost the implied global function assignment. What I'm suggesting as a solution instead is to add

  window.handleCommentPreview = handleCommentPreview;

onto line 67 of app/assets/javascripts/initializers/initializeCommentsPage.js.erb
That will resolve this issue with mininal change. what do you think?

I would say you @maestromac should open a PR with the simple change you request, mention this PR and see how things evolve. Asking someone who wrote things 6 months ago to change everything to only keep 1 line of code that is not his one sounds like strange to me.

Because then, if it doesn't work, reviewer may come after him to request changes, while it would be consequence of following your guidance.

My 2 cents, @joaoGabriel55 could do whatever he wants of course

@ccoVeille
Copy link

And yes, I would love this painful bug to be fixed!

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.

Unable to Preview a Reply for a Comment Before Publishing it
3 participants