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 icon for OSMF membership to user page #1914

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@datendelphin

datendelphin commented Jun 24, 2018

Add an icon for OSMF membership, similar to user roles.
Creates a new table for memberships, and adds an optional setting
on the user settings page to select if the user wants the
membership to be displayed on to user page or not.

michael spreng
add icon for OSMF membership to user page
Add an icon for OSMF membership, similar to user roles.
Creates a new table for memberships, and adds an optional setting
on the user settings page to select if the user wants the
membership to be displayed on to user page or not.
@tomhughes

This comment has been minimized.

Member

tomhughes commented Jun 24, 2018

Why create a new table? I thought the plan was to use a role?

Is there a workable plan for keeping this in sync yet?

@datendelphin

This comment has been minimized.

datendelphin commented Jun 24, 2018

The query to extract the osm user names from civicrm looks something like this:

https://join.osmfoundation.org/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Membership&action=get&api_key=userkey&key=sitekey&json={"sequential":1,"return":"join_date,contact_id.custom_1","membership_type_id":{"IN":["Normal Member","Associate Member"]},"status_id":{"IN":["Current","Grace"]},"options":{"limit":10000}}

but with the correct keys of course. It outputs json. I can provide a script to update the osm usernames with this query if desired. Updating daily should probably be enough.

@datendelphin

This comment has been minimized.

datendelphin commented Jun 24, 2018

Adding a new table for the membership looked a bit cleaner to me, but if desired I can put it in the existing role table. It does not perfectly match as the role table also has a granter and a date when it was granted.

@@ -0,0 +1,67 @@
require "test_helper"

This comment has been minimized.

@GaspardPO

GaspardPO Jul 1, 2018

Will it be possible to split the method in different tests?

This comment has been minimized.

@datendelphin

datendelphin Jul 4, 2018

I could split it in to 3 functions or files easily:

  • check that badge is not shown on user page by default
  • enable "show" of the OSMF membership, test that checkbox is shown; check that badge is shown on user page
  • make sure that non member does not get the checkbox and post (submit setting "show osmf membership") has no effect: check that badge is not shown on user page

Is that what you have in mind? Functions or Files?

This comment has been minimized.

@GaspardPO

GaspardPO Jul 4, 2018

different functions so if the first assert fails, we still test the others ones.
So we know if a regression affects all features, or just one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment