Subscription button has no functionality while logged out #21727
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
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:
Critical
andSerious
issues?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.
have not been included
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?