aclu-people-power / map

ACLU People Power Map
MIT License
3 stars 12 forks source link

Type of event list should dynamically update #88

Closed kpenning closed 7 years ago

kpenning commented 7 years ago

The type of event list should dynamically update as we add/remove categories. There's a new category for Deportation Solidarity Rallies, but it doesn't appear to be reflected in this list. We may need backup from @ejucovy and @jarasi on this one.

stuartsan commented 7 years ago

Do we know if the human-readable names for event categories are stored in ActionKit? For example, the category freedomcities has a display name of Freedom Cities Action, and I'm wondering if the latter is stored in AK anywhere.

Side note to consider: for the most part event categories in AK map to what we are calling "event types" in the web client, but there is an exception for official ACLU events, whose designation does not come from the event categories but is an additional boolean field added at some point in the pipeline (I'm not sure at what point this is added).

kpenning commented 7 years ago

Ethan would know the answer to this!

On Sun, Apr 23, 2017 at 5:10 PM, Stuart Sandine notifications@github.com wrote:

Do we know if the human-readable names for event categories are stored in ActionKit? For example, the category freedomcities has a display name of Freedom Cities Action, and I'm wondering if the latter is stored in AK anywhere.

Side note to consider: for the most part event categories in AK map to what we are calling "event types" in the web client, but there is an exception for official ACLU events, whose designation does not come from the event categories but is an additional boolean field added at some point in the pipeline (I'm not sure at what point this is added).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aclu-people-power/map/issues/88#issuecomment-296488903, or mute the thread https://github.com/notifications/unsubscribe-auth/AEkVKCay-EeB9U5mC5Hus0n2gjLvUmfIks5ry75OgaJpZM4NDMOY .

ejucovy commented 7 years ago

@stuartsan yup -- here's a very silly json endpoint where you can grab the canonical list of event types + their human readable names:

http://d3r5pbxngwkvri.cloudfront.net/event_categories.json

But it is very silly! You'll need to do like JSON.parse(resp[0].value)). I can probably fix this to just give you the relevant json itself instead of escaped-and-wrapped-in-more-json if it bothers you enough.

stuartsan commented 7 years ago

Ah ok, thanks @ejucovy .

I'm wondering how much of a pain it'd be on your end to roll this data into the same JSON blob as the event data. So for example, maybe the file would be called something like actionkit_data.json and it would contain:

{
  events: Array,
  categories: Array/Object (whatever is convenient)
}

My thinking is that if we hit this additional endpoint from the map app, the user will be paying for it in terms of longer initial loading time, but by rolling them together the loading time difference would be negligible.

ejucovy commented 7 years ago

Good point - lemme see what I can do.

On Mon, Apr 24, 2017 at 10:39 AM, Stuart Sandine notifications@github.com wrote:

Ah ok, thanks @ejucovy https://github.com/ejucovy .

I'm wondering how much of a pain it'd be on your end to roll this data into the same JSON blob as the event data. So for example, maybe the file would be called something like actionkit_data.json and it would contain:

{ events: Array, categories: Object }

My thinking is that if we hit this additional endpoint from the map app, the user will be paying for it in terms of longer initial loading time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aclu-people-power/map/issues/88#issuecomment-296689460, or mute the thread https://github.com/notifications/unsubscribe-auth/AADW0-4sey2GJFNZbTkMxubP6ovdooEuks5rzLQwgaJpZM4NDMOY .

kpenning commented 7 years ago

Hey @ejucovy where are we at on this front?

ejucovy commented 7 years ago

@kpenning @stuartsan How's this? http://d3r5pbxngwkvri.cloudfront.net/action_events_v2.json

Structure is { "events": [...], "categories": {...} } and the categories are now coming in directly as json so you wouldn't need to jump through the JSON.parse(resp[0].value)) hoops anymore. (But each event's categories are still a comma separated string.)

stuartsan commented 7 years ago

@ejucovy this is great! Thanks. Using a version number is also great cause there is some code in production using the old json file already. If we can rely on this v2 file in the location you've indicated LMK and I'll swap it in.

ejucovy commented 7 years ago

Yup, you can rely on it!

On Tue, May 2, 2017 at 10:30 AM, Stuart Sandine notifications@github.com wrote:

@ejucovy https://github.com/ejucovy this is great! Thanks. Using a version number is also great cause there is some code in production using the old json file already. If we can rely on this v2 file in the location you've indicated LMK and I'll swap it in.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aclu-people-power/map/issues/88#issuecomment-298652582, or mute the thread https://github.com/notifications/unsubscribe-auth/AADW01Dm6ghVRsqw9Kx4HkUYv38GK99eks5r1z4BgaJpZM4NDMOY .

stuartsan commented 7 years ago

👍

stuartsan commented 7 years ago

@ejucovy , I noticed that in the v2 file http://d3r5pbxngwkvri.cloudfront.net/action_events_v2.json -- it looks like the "is_official" field is 0 for every single event.

But I'm also seeing that for the v1 file now. Is there anything busted here? I feel like there used to be quite a lot of official events...

kpenning commented 7 years ago

Stuart -- this is accurate. Official events will be pretty rare and we haven't yet figured out on the ActionKit side how to mark all events where host email ends with @aclu.org as "official events."

On Wed, May 3, 2017 at 9:42 PM, Stuart Sandine notifications@github.com wrote:

@ejucovy https://github.com/ejucovy , I noticed that in the v2 file http://d3r5pbxngwkvri.cloudfront.net/action_events_v2.json -- it looks like the "is_official" field is 0 for every single event.

But I'm also seeing that for the v1 file now. Is there anything busted here? I feel like there used to be quite a lot of official events...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aclu-people-power/map/issues/88#issuecomment-299079984, or mute the thread https://github.com/notifications/unsubscribe-auth/AEkVKD9cjqXTRTjHEUuWY5vpO68_rJNYks5r2S0hgaJpZM4NDMOY .

stuartsan commented 7 years ago

Ah ok cool, thanks @kpenning -- just wanted to make sure nothing changed.