Commit Graph

9 Commits

Author SHA1 Message Date
Steve Howell
1fdfe11e8b node tests: Add tests for voting_widget.js.
This first commit starts by testing handling of
inbound data.
2018-07-02 13:46:30 -04:00
Rhea Parekh
b22d266667 widgets: Add question for poll widget in the message itself.
Use the command '/poll question?', to start a question.
2018-07-01 19:56:19 -04:00
Rhea Parekh
784e7249a5 widgets: Add question in the poll widget itself.
The user can also edit the question after adding it.

The question in the poll can only be added/edited
by the user who started the poll.

The input bar will be disabled for the other users
if the question is not yet added. If the question is
added, the input bar will not be visible to the other
users.
2018-07-01 19:56:19 -04:00
Rhea Parekh
3d5cecdad5 widgets: Avoid voting while adding a new option in poll widget. 2018-07-01 19:56:19 -04:00
Shubham Dhama
9a45e52f75 widgets: Fix empty message_content of "All messages" widgets.
Fixes: #9827.
2018-06-28 14:04:37 -04:00
Steve Howell
c1cd0b710e poll widget: Handle unknown keys.
This directly prevents a traceback when submessage events
arrive in the wrong order.  This was probably a symptom
of not updating message.submessages for not-yet-widgeted
messages, which was fixed in an earlier commit, but we
want defensive code in case of races or other glitches, and
it's not the end of the world is somebody sees partial
survey results due to some corner case.
2018-05-31 12:11:32 -04:00
Steve Howell
c0a9eb19fd poll widget: Clear input after adding an option. 2018-05-30 18:11:03 -07:00
Steve Howell
f1877d8fdb poll widget: Prevent blank poll options. 2018-05-30 18:11:03 -07:00
Steve Howell
d0e70a9700 Add poll widget. 2018-05-16 15:13:33 -07:00