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

poll: hide back to poll button for unregistered users #1691

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

goapunk
Copy link
Contributor

@goapunk goapunk commented Nov 11, 2024

Tasks

  • PR name contains story or task reference
  • Documentation (docs and inline)
  • Tests (including n+1 and django_assert_num_queries where applicable)
  • Changelog

<div className="poll">
{this.state.hasUserVote ? this.linkChangeVote : this.linkToPoll}
</div>
{this.state.questions.length > 0 && this.state.questions[0].authenticate &&
Copy link
Contributor

@hom3mad3 hom3mad3 Nov 12, 2024

Choose a reason for hiding this comment

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

we could put this.state.questions[0].authenticate into a variable with a meaningful name (i.e. registeredUser, logged in etc)?
also a note for eventual refactoring: {this.state.hasUserVote ? this.linkChangeVote : this.linkToPoll} doesn't immediate show what type of element we are rendering, we should probably have the <button> receive an onclick event which handles things for us.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah all the conditions in here could need a refactor, the chains are terribly long and hard to read. (Some of them could ideally be already done in the backend as well I think), I just made it work with minimal effort for now

Copy link
Contributor

Choose a reason for hiding this comment

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

I will merge this now, refactoring will happen when PM will budget resources for that.

@m4ra m4ra merged commit cb21e2e into main Nov 13, 2024
3 of 5 checks passed
@m4ra m4ra deleted the jd-2024-11-fix-blocked-polls branch November 13, 2024 11:25
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.

3 participants