fairvotereform / RankIt

https://rankit.vote
1 stars 2 forks source link

Saving polls while still working on them #87

Closed ggordn3r closed 4 years ago

ggordn3r commented 5 years ago

While we intended creating polls to be done in one session, users want the ability to save and come back to their work (see #34). They also want to know that their poll is "hidden" from view.

To prevent anyone from acting on polls that are not "Published", we will need to disable some features as specified below.

On the poll creation page, have two buttons: "Save" and "Save & Publish".

If I click "Save"

If I click "Save & Publish"

While is_published = false

There should be no option to unpublish a poll. Once is_published is set to true the user cannot set it to false again. This is to prevent a user from editing the choices and options of a poll after it has already received votes.

ggordn3r commented 4 years ago

VCMA also requested this: Important for VCMA/Partnerships --- Admin - Save it and edit it before it’s published. The ability to keep a saved draft that would be really helpful on there end, so we can do it in advance.

I propose reworking the "create poll" button and "open/close poll" toggle slightly to be more in line with "save" --> "publish" --> "close poll", which seems to be the expected UX.

proggeramlug commented 4 years ago

Alright, this has been implemented in its first form. Check it out. You might experience it that in some places the checks whether or not polls are already published are not properly in place yet, but this is what testing is for. :)

proggeramlug commented 4 years ago

We now have a "Publish Poll" and "Unpublish Poll" button when you look at your own polls

ggordn3r commented 4 years ago

Looking to @iambateman for the UX design here

iambateman commented 4 years ago

@ggordn3r thoughts on this?

Concept

Question

Preview Screenshot 2020-04-27 21 36 47

proggeramlug commented 4 years ago

@iambateman We have a new attribute is_published which differentiates from is_open as that a published poll does not need to be open. The "Publish Poll" button makes is_published = true.

iambateman commented 4 years ago

@proggeramlug that makes sense! But does anything change when it gets published?

proggeramlug commented 4 years ago

What do you mean @iambateman?

ggordn3r commented 4 years ago

Based on the confusion above, it seems like we may be biting off more than we can chew to ship this in the first release. @proggeramlug if you agree, can you roll back or comment out these changes?

Otherwise, you'll need to call @iambateman asap to sort this out.

proggeramlug commented 4 years ago

@ggordn3r I don't see much confusion other than terms here. I'm not even sure what to comment out really :D

@iambateman can you specify what currently, with the "as is" state needs to change in your opinion?

ggordn3r commented 4 years ago

@proggeramlug I think Stephen is asking whether the "is_published" state actually does anything. For example, If I save my poll without publishing it, I can still do all the things I would do anyway--vote in it, share it, view results, etc.

proggeramlug commented 4 years ago

@ggordn3r Okay got it, as of now this is the case. You can only vote for your own unpublished polls and see your own results if it is unpublished.

Everyone else sees a "Poll not found" (we can change that if we want to).

ggordn3r commented 4 years ago

@proggeramlug Ah, ok. "Poll not found" is good. I'll test that later.

I'm also thinking that is_published should be irreversible (for reasons I describe above), which changes the way we handle this slightly.

I've added a lot of detail to the issue itself based on Stephen's comment and my own thoughts on how this should work. Basically, we need to hide or disable the features that should be impossible while the poll is not published, and allow the user to make changes to the options on an unpublished poll.

Let me know if you need anything else on this. I think it's fully defined now.

proggeramlug commented 4 years ago

This is now updated and ready to be tested again.

ggordn3r commented 4 years ago

I clicked "Save" from the poll creation menu and it produced a poll where is_open = true and is_published = false. This is incorrect. If the user clicks "Save", the poll should be created with is_open and is_published both set to false.

Also, when I attempt to switch the toggle to "Closed", the text still reads "Open, Accepting Votes" as in this screenshot: Screenshot (281)

proggeramlug commented 4 years ago

Restart your browser and test again, this is technically fixed and I think was already then. But since 6h ago I submitted like 10 new deployments ;D

But it should be as expected now.

ggordn3r commented 4 years ago

This worked as expected when I tried again; however, I came across a new issue: when I clicked "Publish poll" and "OK" in the verification, nothing happened on screen. I did this 3 times, but the "Publish poll" button did not disappear.

When I refreshed the page, the poll was published but is_open was false, which is incorrect. Publishing the poll should also set is_open to true.

proggeramlug commented 4 years ago

Corrected!

ggordn3r commented 4 years ago

@proggeramlug noticed a missed spec when we implemented this feature during Priority 2.0. While is_published is false, the user should see another button at the bottom, [Edit poll] between [Publish poll] and [Delete poll].

Clicking on the [Edit poll] button should allow a user to change any of the options previously selected in .../polls/create and re-save the poll.

A key user story here is that super users want to be able to add their custom branding, then see a preview of what it will look like. Right now, their only option is to save the poll and click "View Results (only you can see). But if they want to change the logo or colors, they have to delete the poll and start all over. If editing the poll proves difficult to implement, an alternative way to satisfy this story would be a preview feature on .../polls/create that showed the user what to expect.

proggeramlug commented 4 years ago

Implemented!

ggordn3r commented 4 years ago

Two quick fixes, see screenshot:

1) The menu is incorrect at the bottom. The new "cancel" button is good, but besides that I expected the same choices: "Save Poll" and "Save and Publish Poll". The "Delete" button should be removed.

2) I saved a poll, then clicked "Edit Poll" and added another choice, then clicked "Save Poll" at the bottom. Expected behavior is to return to the poll management page, but instead there was no visible change on the page. When I clicked "Cancel" and "Edit Poll" again, the change was preserved, so it is saving correctly. Just an issue with the link.

Screenshot (357)

proggeramlug commented 4 years ago

Fixed both but I left the delete button. Logically it is not easy to destinguish here but also it makes no sense. Why would I not be able to delete a draft poll? :)

ggordn3r commented 4 years ago

Fair enough. In that case, can you make it match the style of the "Delete Poll" button on the /polls page? I would add the class to this comment but I can't get the elements to load in dev tools right now.

proggeramlug commented 4 years ago

Should be the case now, I think stephen might have done it because I don't recall me doing it

ggordn3r commented 4 years ago

Hmm... maybe I didn't explain this correctly. Trying again:

The Delete button on the poll creation page: Screenshot (380)

Should look identical to the one on the poll management page: Screenshot (379)

proggeramlug commented 4 years ago

Okay, now! :)

ggordn3r commented 4 years ago

Looks great!