Skip to content

Subscription button has no functionality while logged out #21727

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JMTeixeira7
Copy link

@JMTeixeira7 JMTeixeira7 commented Apr 5, 2025

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

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

Description

From a logged-out user's perspective, the "Subscribe" button in the comments section of an article page appeared to have no functionality. It was visible but not interactive.

This fix enables logged-out users to interact with the button, triggering the showLoginModal prompt, just like another buttons do, comment, reactions etc...

To implement this behavior, I removed the "ArticleSignedIn" file, since its main purpose was to encapsulate the Subscribe button logic. Since this button should be intercative to logged-out users too and the current "CommentSubscription" code already handles the case where the user is logged out, this ArticleSignedIn's code has been moved into the "ArticlePage" file.

If there's a strong preference to keep "ArticleSignedIn" and "ArticlePage" separate, I'm happy to refactor my code.

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

Open the application as a signed-out user and select any article. Scroll down to the comments section where the Subscribe button is visible.

Attempt to subscribe to the article — you’ll notice that the button has no apparent functionality from the user's perspective.

Since subscribing is a feature available only to logged-in users, this button should trigger the showLoginModal pop-up, similar to other buttons behaviour.

Tested on browsers:
-Chrome
-Opera
-Edge

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

…d out

From a logged-out user's perspective, the "Subscribe" button
in the comment section of an article page has no functionality.
Although it is visible, it is not clickable.

Expected behavior: Trigger the showLoginModal pop-up, just
like other login-only buttons do.
Refs forem#21608
@JMTeixeira7 JMTeixeira7 requested a review from a team as a code owner April 5, 2025 16:29
Copy link
Contributor

github-actions bot commented Apr 5, 2025

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!

Copy link
Contributor

github-actions bot commented Apr 5, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@JMTeixeira7
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@JMTeixeira7
Copy link
Author

Hey @benhalpern , just checking in on this PR. Let me know if there's anything I should change. Thanks!

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.

Comment "Subscribe" does not trigger join modal
1 participant