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

Implement --votes=0 setting to vote all options even if adding an option #506

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

kaakaa
Copy link
Contributor

@kaakaa kaakaa commented Oct 9, 2023

fixes #496
refs #372

--votes=0 setting allows users to vote all options even after adding an option.

matterpoll-496

Notes: When creating a poll from interactive dialog, 0 cannot be set to Number of Votes due to mattermost's issue. Until resolving it, --votes=0 setting can be used only from /poll command.

@kaakaa kaakaa added Type/Enhancement New feature or request 3. To Review Docs/Done Required documentation has been written Tech/Server Plugin Server labels Oct 9, 2023
@kaakaa kaakaa added this to the v1.7.0 milestone Oct 9, 2023
@kaakaa kaakaa requested a review from hanzei October 9, 2023 06:15
@kaakaa kaakaa self-assigned this Oct 9, 2023
@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.19%. Comparing base (c8d868e) to head (1da265f).
Report is 4 commits behind head on master.

❗ Current head 1da265f differs from pull request most recent head 9c1bc67. Consider uploading reports for the commit 9c1bc67 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #506      +/-   ##
==========================================
- Coverage   93.27%   93.19%   -0.09%     
==========================================
  Files          13       13              
  Lines        1650     1630      -20     
==========================================
- Hits         1539     1519      -20     
  Misses         84       84              
  Partials       27       27              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@hanzei hanzei left a comment

Choose a reason for hiding this comment

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

Should we bump the minimum server version to v9.3.0 so it includes mattermost/mattermost#24916?

server/plugin/command.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
server/plugin/command.go Outdated Show resolved Hide resolved
votedAnswers := poll.GetVotedAnswers(userID)
remains := poll.Settings.MaxVotes - len(votedAnswers)
if poll.Settings.MaxVotes == 0 {
remains = len(poll.AnswerOptions) - len(votedAnswers)
Copy link
Member

Choose a reason for hiding this comment

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

0/5 do we even want to show the number of remaining votes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not required, but I think that giving feedback on how many options users have already voted for (= remaining votes) is better than nothing.

server/poll/poll.go Show resolved Hide resolved
server/poll/transform.go Outdated Show resolved Hide resolved
kaakaa and others added 4 commits December 20, 2023 21:45
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
@kaakaa
Copy link
Contributor Author

kaakaa commented Dec 20, 2023

It seems to me that v9.3 is too new and I concerned that a number of users could be unable to launch Matterpoll v1.7. mattermost/mattermost#24916 occurs only in dialog, not in command, so ESR v8.1 (or v7.8) looks better.

@kaakaa kaakaa requested a review from hanzei April 12, 2024 06:41
@kaakaa kaakaa modified the milestones: v1.7.0, v1.8.0 May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. To Review Docs/Done Required documentation has been written Tech/Server Plugin Server Type/Enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

Possibility to vote for all independent of the number of options
2 participants