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

Add support for Polls Widget on ZT. #1551

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions zulipterminal/ui_tools/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,11 @@ def main_view(self) -> List[Any]:
else "No poll question provided. Please add one via the web app."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: For this line and one further below, we might consider using a fixed string common to both cases, and adding a TODO comment which relates to the lack of this feature so far (in ZT).

)

if not self.poll_question:
# If no poll question is provided, set a message to display
# in Poll Results popup.
self.poll_question = "No poll question provided."
Comment on lines +774 to +777
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can do this last commit as part of an earlier commit when you first write this code, ie. setting a variable. This same text is used directly above, so that will avoid duplication. When you do the adding of the self. prefix, the variable will already be available.


if self.poll_options:
max_votes_len = max(
len(str(len(option["votes"])))
Expand Down
Loading