-
Notifications
You must be signed in to change notification settings - Fork 40
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
Remove legacy reporting dates JS #6512
Remove legacy reporting dates JS #6512
Conversation
@@ -11,7 +11,7 @@ const states_dropdown_template = ` | |||
<option value="CO">Colorado</option> | |||
<option value="CT">Connecticut</option> | |||
<option value="DE">Delaware</option> | |||
<option value="DC">District Of Columbia</option> | |||
<option value="DC">District of Columbia</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
@@ -164,49 +168,26 @@ ReportingDates.prototype.buildStaticElements = function() { | |||
|
|||
table_parent.insertBefore(dropdown_wrapper, this.dates_table); | |||
|
|||
//Create static footnote/header note list | |||
//Create header note list for modal dialogue | |||
let hdr_str = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we run the formatter on this file to fix the indentation spacing and spaces between functions' ){
ReportingDates.prototype.handleStateChange = function() { | ||
const state = this.states.value.toLowerCase(); | ||
|
||
//TODO: Should this be `this.dates_table.querySelectorAll` ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it works, I always prefer more specific selectors. In this case, 'tr'
would grab all rows on every table of the page, good or bad. 'tr.footnote_row'
would likewise grab every tr
with that class, in every table on the page
const date_sups = document.querySelectorAll('td sup'); | ||
|
||
if (typeof footnotes_array == 'object') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to handle the else here or just skip them it's not an object? (Hasn't typeof
been tricky lately, identifying Arrays as objects, too?)
Summary (required)
NOTE: Please merge this PR before merging #6597
Resolves Tech-debt: Remove reporting-dates-tables.js by converting legacy tables to use new template and JS #6491
Remove the legacy
eporting-dates-tables.js
Rename the new
election-reporting-dates-tables.js
toreporting-dates-tables.js
so template and JS files have the same name for clarityRemove references to JS in
full_width_page.html
Required reviewers
one frontend and optionally one content (@djgarr)
Impacted areas of the application
Reporting dates tables from 2020 to present
deleted: fec/static/js/pages/election-reporting-dates-tables.js
modified: fec/static/js/pages/reporting-dates-tables.js
modified: home/templates/home/full_width_page.html
modified: home/templates/home/reporting_dates_table.html
Related issues/PRs
Issues:
#5153
PRs:
New:
#5786
#5798
Legacy:
#3227
How to test
npm run build-js
reporting_dates_table.html
for JS functionality (footnotes, state dropdown, header notes)http://127.0.0.1:8000/ /help-candidates-and-committees/dates-and-deadlines/2020-reporting-dates/electioneering-communications-periods-special-elections-2020/