PursuanceProject / pursuance

Pursuance: end-to-end encrypted task management optimized for large numbers of volunteers. We are building a vast and formidable ecosystem of opposition to institutionalized injustice.
https://pursuanceproject.org/
Other
133 stars 15 forks source link

Add pursuance membership #213

Closed elimisteve closed 6 years ago

elimisteve commented 6 years ago

Users should be able to optionally join or leave a pursuance.

Add this button next to each pursuance listed at /pursuance/all.

Add an "Explore Pursuance Universe" button on the dashboard somewhere that links to /pursuance/all.

Later we can make pursuances invite-only, but that's not part of this first version of this feature.

elimisteve commented 6 years ago

The memberships table already exists, it's just not being populated and used

elimisteve commented 6 years ago

Specifics

  1. Next to each pursuance listed at /pursuance/all, put a blue Join button to the right.

  2. Once a user clicks Join, the button should turn purple and say Leave.

  3. Clicking Join should trigger a POST request to /memberships with a payload that looks like {"user_username": "barrett", "pursuance_id": 5} (table definition here: https://github.com/PursuanceProject/pursuance/blob/develop/db/sql/table04_memberships.sql)

  4. Clicking Leave should trigger a DELETE to /memberships?user_username=eq.${user.username}&pursuance_id=eq.${pursuanceId}

  5. If user.username in Redux is empty, don't show the Join/Leave buttons at all.

elimisteve commented 6 years ago

Once this is in place we can filter AssignerInput suggestions based on which users are actually a member of each pursuance, rather than pretending that every user is part of every pursuance! (/cc @Moe-Shoman)

elimisteve commented 6 years ago

@Moe-Shoman Redux key: ${pursuance_id}_${username}