fecgov / openFEC-web-app

DEPRECATED See https://github.com/18F/fec-cms for fec.gov's code
Other
43 stars 31 forks source link

Feature/candidate other spending totals #2119

Closed noahmanger closed 7 years ago

noahmanger commented 7 years ago

This adds total support and oppose numbers to the other spending tab on candidate profiles:

image

image

image

Because these numbers aren't available over the API directly, this PR does it all with client-side code that runs when you go to this tab for the first time. It calls each endpoint (and if there's more than 100 records, calls it multiple times to get all of them) and then totals them all up.

@jenniferthibault let me know if you want to pair to fine-tune styles.

cc @LindsayYoung @xtine

Resolves https://github.com/18F/fec-cms/issues/839

codecov-io commented 7 years ago

Codecov Report

Merging #2119 into release/public-20170614 will decrease coverage by 0.42%. The diff coverage is 20.93%.

Impacted file tree graph

@@                     Coverage Diff                     @@
##           release/public-20170614    #2119      +/-   ##
===========================================================
- Coverage                    54.95%   54.53%   -0.43%     
===========================================================
  Files                           48       49       +1     
  Lines                         3299     3341      +42     
  Branches                       388      391       +3     
===========================================================
+ Hits                          1813     1822       +9     
- Misses                        1470     1503      +33     
  Partials                        16       16
Impacted Files Coverage Δ
openfecwebapp/views.py 39.41% <0%> (-0.29%) :arrow_down:
static/js/modules/other-spending-totals.js 21.95% <21.95%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 60d741d...f07a356. Read the comment docs.

jenniferthibault commented 7 years ago

@noahmanger thanks so much for including multiple screen shots lined up, super helpful!

I might have commented on the design issue too late, but what did you think of adding the "Support/Oppose" headers to the IE's & CC's ?

If we're not going that route, the only unexpected style I'm seeing is that there's more space between the totals numbers and the border line on IEs than on CCs and ECs. The larger unit of spacing on IE's the the correct amount to use here.

Mocked up over your screen shots:

screen shot 2017-06-12 at 12 55 47 pm

noahmanger commented 7 years ago

Oh! I misunderstood that point. Yeah I think that's a good idea. I was wanting an extra label too.

noahmanger commented 7 years ago

That work? image

jenniferthibault commented 7 years ago

Yes! ❤️ it, thank you!

noahmanger commented 7 years ago

I also added a loading indicator: loading