participateapp / web-client

Participate! is an app for democratic decision making
MIT License
6 stars 1 forks source link

Supporting a proposal #17

Closed oliverbarnes closed 7 years ago

oliverbarnes commented 8 years ago
As a participant
I want to support proposals by other participants

When viewing a proposal not his own, a participant sees a "Support this" button. When clicking on it, the button should change in some way to signify it's "on" somehow. Or maybe the proposal itself could have a visual cue that it's supported?

oliverbarnes commented 8 years ago

There should also be a support count, updated when support is added

oliverbarnes commented 7 years ago

API endpoint done, payloads look like this:

Request

{
  "data": {
    "type": "support",
    "relationships": {
      "proposal": {
        "data": {
          "id": "1",
          "type": "proposal"
        }
      }
    }
  }
}

Response

{
  "data": {
    "id": "1",
    "type": "support",
    "attributes": {},
    "relationships": {
      "proposal": {
        "data": {
          "type": "proposal",
          "id": "1"
        }
      }
    }
  },
  "included": [
    {
      "type": "proposal",
      "id": "1",
      "attributes": {
        "support-count": 1
      }
    }
  ]
}
tnum commented 7 years ago

The mockups have a toggle switch as it is clear to see if the switch is 'on'. I also suggested 'tick' icons in the proposal listing view to indicate which proposals are being supported - although it may make the listings view too "cluttered"

oliverbarnes commented 7 years ago

Something bothers me about the switch widget, I don't think it works... It reminds me of settings, of stuff that you need to be very careful before switching on. While It needs to be very inviting and easy to click.

Once clicked, both the button and the proposal itself should change satisfyingly - you've embraced the proposal, afterall. Maybe a border could show up around the proposal?

I think the green tick on supported proposals works, and green makes sense as the color for the 'supported' state.

Once we get to counter-proposals, there could be an equivalent fat button for 'counter-proposal', as an alternative to the 'support' button. And with delegations, the delegation button would be a mid-way alternative, somehow.

oliverbarnes commented 7 years ago
ThomasWeiser commented 7 years ago

Current state 7aa68e25e4b48a7ee53b61140d506aebaafd532f is the result of a pairing session with @oliverbarnes.

We agreed that the backend should indicate whether a proposal is supported by the current user. This supported-by-me flag should be an attribute of every proposal resource in a response. See https://github.com/oliverbarnes/participate-api/issues/27

(Edit: Didn't see you already mentioned "supported by me" above.)

oliverbarnes commented 7 years ago

authored-by-me and supported-by-me attributes added on https://github.com/oliverbarnes/participate-api/pull/30 and https://github.com/oliverbarnes/participate-api/pull/32

ThomasWeiser commented 7 years ago

Please review the PR.

Done:

API usage depends on oliverbarnes/participate-api#33

Will implement removing support (#24) afterwards as a separate PR.

oliverbarnes commented 7 years ago

Looks good. I didn't have time to test it yet, I'm assuming it was thoroughly tested before asking for the review? ;)

ThomasWeiser commented 7 years ago

Yes, I've tested it. Nonetheless, should soon start with automatic testing #49.