fecgov / openFEC-web-app

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

Fixing sort problems on committee filing tables #2095

Closed noahmanger closed 7 years ago

noahmanger commented 7 years ago

The committee filings table isn't manually sortable, since it uses a complex sorting query to get filings to display in a certain order. However, due to a quirk in the datatables library, it was rendering it as if the first column was sorting, which made it seem like you should be able to sort it in the other direction. This removes the apparent (but not functional) sort styling from the document description and receipt date columns:

image

Resolves https://github.com/18F/FEC/issues/4155 Resolves https://github.com/18F/openFEC-web-app/issues/2041

This also makes it so that reports tables only show links to PDFs if the pdf_url is actually present for a given report.

Resolves https://github.com/18F/FEC/issues/4158


Update

This also fixes an issue we're experiencing with wonky column widths in Firefox as a result of using table-layout: fixed with a mix of percentage and px based column widths. Firefox is using the percentage value and actually calculating the width correctly, whereas Chrome expands the column if there's space available. The better way to go, however, is to just use table-layout: auto and let the browser handle all the work of sizing the columns. This works well in general, and so I removed the column size classes in almost all instances.

The places where I kept it was column--med for the version columns, but changed it to a min-width value set in px and then column--small for all date columns, because those have predictable widths and so can be constrained in order to give more space to other columns.

This requires an update to fec-style.

The end result is no more of this: image image

And more of this: image

image

Resolves https://github.com/18F/FEC/issues/4153 Resolves https://github.com/18F/openFEC-web-app/issues/2093

codecov-io commented 7 years ago

Codecov Report

Merging #2095 into develop will increase coverage by 0.29%. The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2095      +/-   ##
===========================================
+ Coverage    55.06%   55.36%   +0.29%     
===========================================
  Files           48       48              
  Lines         3265     3291      +26     
  Branches       385      392       +7     
===========================================
+ Hits          1798     1822      +24     
- Misses        1451     1453       +2     
  Partials        16       16
Impacted Files Coverage Δ
static/js/modules/columns.js 21.85% <0%> (-0.67%) :arrow_down:
static/js/modules/download.js 91.15% <0%> (+1.07%) :arrow_up:

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 cd32215...b84389d. Read the comment docs.