diff --git a/fec/data/templates/macros/filters/ie-reports.jinja b/fec/data/templates/macros/filters/ie-reports.jinja index 9e70392a75..150ba7ab5d 100644 --- a/fec/data/templates/macros/filters/ie-reports.jinja +++ b/fec/data/templates/macros/filters/ie-reports.jinja @@ -1,5 +1,5 @@ {% macro type(id_suffix) %} -
+
Report type
@@ -24,7 +24,7 @@ {% macro form(id_suffix) %}
- Regularly scheduled report form + Report form
  • diff --git a/fec/fec/static/js/modules/tables.js b/fec/fec/static/js/modules/tables.js index 297c36f43e..54bea181cc 100644 --- a/fec/fec/static/js/modules/tables.js +++ b/fec/fec/static/js/modules/tables.js @@ -651,6 +651,16 @@ DataTable.prototype.fetch = function(data, callback) { ); return; } + + // If 24- and 48-Hour report is selected, set the filing form to F24. + // Otherwise, it's a regularly scheduled report, keep the filing + // form as F3X + if (self.filters && self.filters.filing_form) { + var F3X_index = self.filters.filing_form.indexOf('F3X'); + if (self.filters.is_notice == 'true' && F3X_index > -1) { + self.filters.filing_form[F3X_index] = 'F24'; + } + } } var url = self.buildUrl(data); diff --git a/fec/fec/tests/js/tables.js b/fec/fec/tests/js/tables.js index 27ac19713e..ac359fcdfb 100644 --- a/fec/fec/tests/js/tables.js +++ b/fec/fec/tests/js/tables.js @@ -550,4 +550,34 @@ describe('data table', function() { ).to.be.above(0); }); }); + + describe('Update to F24', function() { + beforeEach(function() { + this.table.xhr = null; + $('body').append( + '
    ' + ); + }); + + it('filing form updates to F24 when is_notice is true', function() { + var serialized = { + is_notice: 'true', + filing_form: ['F3X'] + }; + this.table.filterSet = { + serialize: function() { + return serialized; + }, + fields: ['is_notice', 'filing_form'] + }; + this.table.filterSet.isValid = true; + var callback = sinon.stub(); + this.table.fetch({}, callback); + expect(this.table.filters).to.deep.equal(serialized); + expect( + this.table.filters.filing_form, + 'Expected filing form to be F24' + ).to.deep.equal(['F24']); + }); + }); });