Skip to content
This repository has been archived by the owner on Dec 23, 2017. It is now read-only.

Link to disbursements by purpose from committee summary page #508

Closed
jmcarp opened this issue Aug 24, 2015 · 4 comments
Closed

Link to disbursements by purpose from committee summary page #508

jmcarp opened this issue Aug 24, 2015 · 4 comments
Assignees

Comments

@jmcarp
Copy link
Contributor

jmcarp commented Aug 24, 2015

Reported by @jwchumley in Slack:

Disbursement tab: https://fec-dev-web.18f.gov/committee/C00140715?cycle=2016&tab=disbursements The amounts don't link to transactions like receipt amounts do.

This one's potentially a little complicated. We have a purpose filter for the browse disbursements page, which is a full-text search against the disbursement text field. But the disbursement purposes we show on the committee detail page are grouped by disbursement purpose categories, which often don't include the same text as the raw purpose (e.g., if the purpose field includes "radio", the disbursement is categorized as "advertising"). I can see a few ways to implement the requested behavior:

  • Search disbursement text by category name. For example, if the category is "advertising", search purpose text by "advertising". This has the advantage of being simple to implement, but the disadvantage that some relevant disbursements will be excluded (e.g., disbursements with the purpose "radio").
  • Add a separate filter by disbursement purpose category (maybe a dropdown, since there aren't many options). This makes sense to me, but would add another filter and potentially clutter the interface.
  • Alter the current purpose filter to search against both text and category. This has the advantage of not adding any new filters, but could also be confusing to users.

What do you think @noahmanger @onezerojeremy?

@noahmanger
Copy link
Contributor

Great question. Here's a fourth solution (in two variants :):

A: If you're coming from a disbursements page and click on one of the categories, the purpose filter is populated with all of the terms that make up that purpose (maybe separated by commas or not).

B: Alternatively, it could be the same thing except the purpose field takes terms separated by commas and spits them out as filter checkboxes above the filter, similar to how the dropdowns work.

Either way, we're giving people insight into how the categories are defined and we give them the opportunity to tweak the queries themselves. So if they find one of the purposes too broad or too narrow, they could add or remove terms as they see fit.

@jmcarp
Copy link
Contributor Author

jmcarp commented Aug 25, 2015

@noahmanger given the way we infer purpose from the raw data, I'm not sure the fourth approach would work. Purpose can be inferred from both disbursement codes and purpose description: for example, if disb_tp is 20F, then the purpose is LOAN-REPAYMENTS, and if the purpose description matches *travel reimbursement*, then the purpose is TRAVEL. We also use regular expressions that we might not want to expose to users directly--campaign rall(y|ies) is a valid regex, but I'm not sure we should allow it in the filter fields.

I think this will make more sense if you take a look at the code: https://github.com/18F/openFEC/blob/develop/data/sql_incremental_aggregates/prepare_schedule_b_aggregate_purpose.sql#L5-L19

@noahmanger
Copy link
Contributor

Aaaah that makes sense. So in that case, I think I like your second option most: make a separate filter for "Purpose Category" (possibly with a tooltip with explanation how it's computed?) in addition to the "Purpose Field". We should see if we can think of better language for these, though, to further distinguish them.

@jmcarp jmcarp self-assigned this Aug 31, 2015
@jmcarp
Copy link
Contributor Author

jmcarp commented Aug 31, 2015

Sounds good, I'll take this on. We'll probably need to work on language around the updated filters once this is working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants