Conversation
* to trigger an automated import of CxResponses
* because expiration is now a date_field
Bumps [pbkdf2](https://github.com/crypto-browserify/pbkdf2) from 3.1.2 to 3.1.3. - [Changelog](https://github.com/browserify/pbkdf2/blob/master/CHANGELOG.md) - [Commits](browserify/pbkdf2@v3.1.2...v3.1.3) --- updated-dependencies: - dependency-name: pbkdf2 dependency-version: 3.1.3 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-RACK-10303186
Signed-off-by: Jonathan Hutchison <jonathanhutchison@navapbc.com>
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-RACK-10303186 - https://snyk.io/vuln/SNYK-RUBY-THOR-10843853
…48e529 [Snyk] Fix for 2 vulnerabilities
Signed-off-by: Riley Seaburg <riley.seaburg@gsa.gov>
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.8 to 1.18.9. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](sparklemotion/nokogiri@v1.18.8...v1.18.9) --- updated-dependencies: - dependency-name: nokogiri dependency-version: 1.18.9 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [thor](https://github.com/rails/thor) from 1.3.2 to 1.4.0. - [Release notes](https://github.com/rails/thor/releases) - [Commits](rails/thor@v1.3.2...v1.4.0) --- updated-dependencies: - dependency-name: thor dependency-version: 1.4.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
initial updates for 30 answers
Bump nokogiri from 1.18.8 to 1.18.9
Bump thor from 1.3.2 to 1.4.0
Fix thumbs up/thumbs down accessibility
Signed-off-by: Riley Seaburg <riley.seaburg@gsa.gov>
app/models/form.rb
Outdated
| if questions.size > 12 | ||
| errors.add(:base, "Touchpoints supports a maximum of 20 questions. There are currently #{questions_count} questions. Fewer questions tend to yield higher response rates.") | ||
| end | ||
| errors.add(:base, "Touchpoints supports a maximum of 30 questions. There are currently #{questions_count} questions. Fewer questions tend to yield higher response rates.") if questions.size > 20 |
There was a problem hiding this comment.
@MrNagoo we need to change this to 30 right?
There was a problem hiding this comment.
@rileyseaburg This is actually the warning for when you're adding too many questions. It used to warn at 12 to get a total of 20, now it will start warning you at 20 to get a total of 30. If we move to >= 30 it will never warn because there isn't an option of going beyond 30.
Sorry I didn't see this sooner
Update question limit warning logic in form test
Upgrade dependencies
Bump pbkdf2 from 3.1.2 to 3.1.3
…784e68 [Snyk] Fix for 1 vulnerabilities
Signed-off-by: Riley Seaburg <riley.seaburg@gsa.gov>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Riley Seaburg <riley@rileyseaburg.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Riley Seaburg <riley@rileyseaburg.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Riley Seaburg <riley@rileyseaburg.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Riley Seaburg <riley@rileyseaburg.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Riley Seaburg <riley@rileyseaburg.com>
…-a11 pre-fill Cx Collection Detail if using an A11 form
There was a problem hiding this comment.
Pull Request Overview
This is a production release that significantly expands form capacity by adding support for 10 additional answer fields (21-30) and introduces new A-11 v2 form integration features with CX Collections. The release also includes various code style improvements and minor bug fixes.
- Increases the maximum number of form questions from 20 to 30 with corresponding schema and API updates
- Adds integration between A-11 v2 forms and CX Collections for automated response data transfer
- Updates dependencies and implements code style improvements with consistent single-quote usage
Reviewed Changes
Copilot reviewed 30 out of 33 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| db/migrate/20250717034402_increase_submission_questions.rb | Adds 10 new answer columns (answer_21 to answer_30) to submissions table |
| app/models/form.rb | Updates question limit validation from 20 to 30 and extensive code style refactoring |
| app/controllers/admin/questions_controller.rb | Updates answer field range from 1-20 to 1-30 |
| app/serializers/submission_serializer.rb | Adds serialization support for new answer fields 21-30 |
| public/api/v1/openapi.yml | Documents new answer fields in API v1 specification |
| public/api/v0/openapi.yml | Documents new answer fields in API v0 specification |
| spec/models/form_spec.rb | Adds tests for new question limit validation |
| lib/fiscal_year.rb | Implements fiscal_quarter_dates method for date range calculations |
| app/models/cx_collection_detail.rb | Adds optional form association |
| app/controllers/admin/cx_collection_details_controller.rb | Adds form integration logic for CX collection details |
| # It's strongly recommended that you check this file into your version control system. | ||
|
|
||
| ActiveRecord::Schema[8.0].define(version: 2025_04_23_163606) do | ||
| ActiveRecord::Schema[8.0].define(version: 20_250_717_034_402) do |
There was a problem hiding this comment.
The schema version format appears to have incorrect underscores. Rails migration timestamps should be formatted as '20250717034402', not '20_250_717_034_402'.
| ActiveRecord::Schema[8.0].define(version: 20_250_717_034_402) do | |
| ActiveRecord::Schema[8.0].define(version: 20250717034402) do |
| t.string 'variation_digest', null: false | ||
| t.index %w[blob_id variation_digest], name: 'index_active_storage_variant_records_uniqueness', unique: true | ||
| end | ||
|
|
There was a problem hiding this comment.
The schema file contains duplicate table definitions and enable_extension calls starting at line 780. This appears to be a merge conflict or duplicate content that should be removed.
| gem 'rack-cors', require: 'rack/cors' | ||
| # Use Redis to cache Touchpoints in all envs | ||
| gem 'rack-cors', '>= 3.0.0', require: 'rack/cors' | ||
| # Use Redis to cache Touchpoints in all envs= |
There was a problem hiding this comment.
There's an extra '=' character at the end of the comment line.
| # Use Redis to cache Touchpoints in all envs= | |
| # Use Redis to cache Touchpoints in all envs |
| gem 'redis-client' | ||
| gem 'redis-namespace' | ||
| gem 'rolify' | ||
| gem 'sidekiq', '>= 6.5.0' |
There was a problem hiding this comment.
The sidekiq gem is declared twice with different version constraints ('>= 8.0.4' on line 69 and '>= 6.5.0' on line 79). This creates conflicting requirements and the duplicate should be removed.
| gem 'sidekiq', '>= 6.5.0' |
| gem 'json-jwt' | ||
| gem 'aasm' | ||
| gem 'acts-as-taggable-on' | ||
| gem 'json-jwt' |
There was a problem hiding this comment.
The 'json-jwt' gem is declared twice (lines 70 and 73). The duplicate declaration should be removed.
| gem 'json-jwt' |
| gem 'acts-as-taggable-on' | ||
| gem "rolify" | ||
| gem 'redis-client' | ||
| gem 'redis-namespace' |
There was a problem hiding this comment.
The 'redis-namespace' gem is declared twice (lines 68 and 77). The duplicate declaration should be removed.
| gem 'redis-namespace' |
| .order('created_at') | ||
| return nil if non_flagged_submissions.blank? | ||
|
|
||
| answer_02_options = self.questions.where(answer_field: "answer_02").first.question_options.collect(&:value) |
There was a problem hiding this comment.
[nitpick] Using 'self.' is unnecessary in this context and inconsistent with the style changes in the rest of the file. Should be 'questions.where(answer_field: "answer_02")' to match the refactoring pattern used elsewhere.
| answer_02_options = self.questions.where(answer_field: "answer_02").first.question_options.collect(&:value) | |
| answer_02_options = questions.where(answer_field: "answer_02").first.question_options.collect(&:value) |
| def warn_about_not_too_many_questions | ||
| if questions.size > 12 | ||
| errors.add(:base, "Touchpoints supports a maximum of 20 questions. There are currently #{questions_count} questions. Fewer questions tend to yield higher response rates.") | ||
| if questions.size >= 30 |
There was a problem hiding this comment.
The condition should use '>' instead of '>=' since the error message indicates 30 questions is the maximum allowed. Currently, forms with exactly 30 questions will trigger the warning when they should be valid.
| if questions.size >= 30 | |
| if questions.size > 30 |
| def process_csv_in_a_worker | ||
| process_csv | ||
| def process_records_in_a_worker | ||
| if self.key? |
There was a problem hiding this comment.
[nitpick] Using 'self.' is unnecessary here. Should be 'if key?' to follow Ruby conventions.
| if self.key? | |
| if key? |
| @cx_collection_detail.form = @form | ||
| @cx_collection_detail.service_stage_id = @form.service_stage_id | ||
| @cx_collection_detail.transaction_point = 'post_interaction' | ||
| @cx_collection_detail.survey_type = 'thumbs_up_down' if @form.kind == "a11_v2" |
There was a problem hiding this comment.
[nitpick] Inconsistent quote usage. Should use single quotes for 'a11_v2' to match the style used for 'thumbs_up_down'.
| @cx_collection_detail.survey_type = 'thumbs_up_down' if @form.kind == "a11_v2" | |
| @cx_collection_detail.survey_type = 'thumbs_up_down' if @form.kind == 'a11_v2' |
No description provided.