From c455367b000812a5417e0dce6168f7c42057cec5 Mon Sep 17 00:00:00 2001 From: Ryan Wold <64987852+ryanwoldatwork@users.noreply.github.com> Date: Tue, 19 Sep 2023 07:32:09 -0700 Subject: [PATCH] a-11 v2 updates * update gems * show a /docs page in the Development environment * comment on tables and fields * translate characters allowed and remaining * add seeds for digital service accounts and products * change id to class for form privacy element, in case 2 or more forms are embedded on a webpage * begin icon_checkboxes element * remove role="group" per w3c checker * deactivate users after 30 days, instead of 90 days; per SSPP * refactor to exclude experimental ServiceProvider fields * update browser-tools for circle ci --- .circleci/config.yml | 13 +- Gemfile.lock | 142 +++++++++--------- app/assets/stylesheets/site.scss | 17 +++ app/controllers/site_controller.rb | 12 ++ app/helpers/application_helper.rb | 2 + app/models/question.rb | 1 + app/models/user.rb | 2 +- .../service_provider_serializer.rb | 12 +- app/views/admin/collections/_form.html.erb | 2 +- .../cscrm_data_collections/_form.html.erb | 2 +- .../cscrm_data_collections/index.html.erb | 9 +- .../admin/question_options/create.js.erb | 2 + .../admin/question_options/update.js.erb | 2 + app/views/admin/questions/_question.html.erb | 2 + app/views/admin/submissions/index.html.erb | 7 +- app/views/admin/websites/index.html.erb | 2 +- app/views/components/forms/_custom.html.erb | 2 + app/views/components/forms/_footer.html.erb | 10 +- .../components/forms/edit/_builder.html.erb | 20 +-- .../question_types/_checkbox_option.html.erb | 2 +- .../question_types/_icon_checkboxes.html.erb | 22 +++ .../_radio_button_option.html.erb | 2 +- .../_big_thumbs_up_down_buttons.html.erb | 92 ++++-------- .../forms/question_types/_checkbox.html.erb | 4 +- .../question_types/_icon_checkboxes.html.erb | 39 +++++ .../question_types/_radio_buttons.html.erb | 2 +- .../_star_radio_buttons.html.erb | 2 +- .../forms/question_types/_text_field.html.erb | 7 +- app/views/components/widget/_fba.js.erb | 4 +- app/views/site/docs.html.erb | 58 +++++++ config/locales/en.yml | 2 + config/locales/es.yml | 2 + config/locales/zh-CN.yml | 2 + config/routes.rb | 1 + .../20230905201752_add_table_comments.rb | 50 ++++++ db/schema.rb | 86 +++++------ db/seeds.rb | 16 ++ spec/rails_helper.rb | 2 +- 38 files changed, 425 insertions(+), 231 deletions(-) create mode 100644 app/views/components/forms/edit/question_types/_icon_checkboxes.html.erb create mode 100644 app/views/components/forms/question_types/_icon_checkboxes.html.erb create mode 100644 app/views/site/docs.html.erb create mode 100644 db/migrate/20230905201752_add_table_comments.rb diff --git a/.circleci/config.yml b/.circleci/config.yml index 6f72fafc4..6c71e6393 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ # version: 2.1 orbs: - browser-tools: circleci/browser-tools@1.4.3 + browser-tools: circleci/browser-tools@1.4.4 jobs: build: @@ -26,7 +26,9 @@ jobs: working_directory: ~/repo steps: - - browser-tools/install-browser-tools + - run: sudo apt-get update + - browser-tools/install-chrome: # required for selenium used by tachometer benchmark smoke tests + chrome-version: 116.0.5845.96 - checkout @@ -46,13 +48,6 @@ jobs: - run: bundle exec rake db:create - run: bundle exec rake db:schema:load - # Install chrome driver - - run: - name: Setup Chrome - command: | - wget https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.198-1_amd64.deb - sudo apt install ./google-chrome-stable_114.0.5735.198-1_amd64.deb - # run tests! - run: name: run tests diff --git a/Gemfile.lock b/Gemfile.lock index 1e3987979..6d46a8963 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,47 +18,47 @@ GEM aasm-diagram (0.1.3) aasm (~> 5.0, >= 4.12) ruby-graphviz (~> 1.2) - actioncable (7.0.7) - actionpack (= 7.0.7) - activesupport (= 7.0.7) + actioncable (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.7) - actionpack (= 7.0.7) - activejob (= 7.0.7) - activerecord (= 7.0.7) - activestorage (= 7.0.7) - activesupport (= 7.0.7) + actionmailbox (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.7) - actionpack (= 7.0.7) - actionview (= 7.0.7) - activejob (= 7.0.7) - activesupport (= 7.0.7) + actionmailer (7.0.8) + actionpack (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activesupport (= 7.0.8) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.7) - actionview (= 7.0.7) - activesupport (= 7.0.7) + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.7) - actionpack (= 7.0.7) - activerecord (= 7.0.7) - activestorage (= 7.0.7) - activesupport (= 7.0.7) + actiontext (7.0.8) + actionpack (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.7) - activesupport (= 7.0.7) + actionview (7.0.8) + activesupport (= 7.0.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -68,22 +68,22 @@ GEM activemodel (>= 4.1, < 7.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (7.0.7) - activesupport (= 7.0.7) + activejob (7.0.8) + activesupport (= 7.0.8) globalid (>= 0.3.6) - activemodel (7.0.7) - activesupport (= 7.0.7) - activerecord (7.0.7) - activemodel (= 7.0.7) - activesupport (= 7.0.7) - activestorage (7.0.7) - actionpack (= 7.0.7) - activejob (= 7.0.7) - activerecord (= 7.0.7) - activesupport (= 7.0.7) + activemodel (7.0.8) + activesupport (= 7.0.8) + activerecord (7.0.8) + activemodel (= 7.0.8) + activesupport (= 7.0.8) + activestorage (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activesupport (= 7.0.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.7) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -96,10 +96,10 @@ GEM aes_key_wrap (1.1.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-partitions (1.805.0) + aws-partitions (1.824.0) aws-record (2.11.0) aws-sdk-dynamodb (~> 1, >= 1.85.0) - aws-sdk-core (3.180.3) + aws-sdk-core (3.181.1) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) @@ -118,7 +118,7 @@ GEM aws-sdk-ses (1.55.0) aws-sdk-core (~> 3, >= 3.177.0) aws-sigv4 (~> 1.1) - aws-sdk-sesv2 (1.38.0) + aws-sdk-sesv2 (1.39.0) aws-sdk-core (~> 3, >= 3.177.0) aws-sigv4 (~> 1.1) aws-sdk-sqs (1.62.0) @@ -192,7 +192,7 @@ GEM dotenv (= 2.8.1) railties (>= 3.2) erubi (1.12.0) - excon (0.100.0) + excon (0.103.0) factory_bot (6.2.1) activesupport (>= 5.0.0) factory_bot_rails (6.2.0) @@ -217,8 +217,8 @@ GEM fog-core nokogiri (>= 1.5.11, < 2.0.0) formatador (1.1.0) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) hashie (5.0.0) httpclient (2.8.3) i18n (1.14.1) @@ -275,13 +275,13 @@ GEM marcel (1.0.2) matrix (0.4.2) method_source (1.0.0) - mime-types (3.5.0) + mime-types (3.5.1) mime-types-data (~> 3.2015) mime-types-data (3.2023.0808) mini_magick (4.12.0) mini_mime (1.1.5) mini_portile2 (2.8.4) - minitest (5.19.0) + minitest (5.20.0) msgpack (1.7.2) multi_json (1.15.0) multi_xml (0.6.0) @@ -295,7 +295,7 @@ GEM timeout net-smtp (0.3.3) net-protocol - newrelic_rpm (9.3.1) + newrelic_rpm (9.4.2) nio4r (2.5.9) nokogiri (1.15.4) mini_portile2 (~> 2.8.2) @@ -327,7 +327,7 @@ GEM parser (3.2.2.3) ast (~> 2.4.1) racc - pg (1.5.3) + pg (1.5.4) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -342,20 +342,20 @@ GEM rack (~> 2.2, >= 2.2.4) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.7) - actioncable (= 7.0.7) - actionmailbox (= 7.0.7) - actionmailer (= 7.0.7) - actionpack (= 7.0.7) - actiontext (= 7.0.7) - actionview (= 7.0.7) - activejob (= 7.0.7) - activemodel (= 7.0.7) - activerecord (= 7.0.7) - activestorage (= 7.0.7) - activesupport (= 7.0.7) + rails (7.0.8) + actioncable (= 7.0.8) + actionmailbox (= 7.0.8) + actionmailer (= 7.0.8) + actionpack (= 7.0.8) + actiontext (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activemodel (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) bundler (>= 1.15.0) - railties (= 7.0.7) + railties (= 7.0.8) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -372,9 +372,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.7) - actionpack (= 7.0.7) - activesupport (= 7.0.7) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) method_source rake (>= 12.2) thor (~> 1.0) @@ -414,7 +414,7 @@ GEM rspec-support (3.12.1) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.56.0) + rubocop (1.56.3) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -430,13 +430,13 @@ GEM parser (>= 3.2.1.0) rubocop-capybara (2.18.0) rubocop (~> 1.41) - rubocop-factory_bot (2.23.1) + rubocop-factory_bot (2.24.0) rubocop (~> 1.33) - rubocop-rails (2.20.2) + rubocop-rails (2.21.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-rspec (2.23.2) + rubocop-rspec (2.24.0) rubocop (~> 1.33) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) @@ -473,18 +473,18 @@ GEM snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) - sprockets (4.2.0) + sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - ssrf_filter (1.1.1) + ssrf_filter (1.1.2) stimulus-rails (1.2.2) railties (>= 6.0.0) thor (1.2.2) - tilt (2.2.0) + tilt (2.3.0) timeout (0.4.0) turbo-rails (1.4.0) actionpack (>= 6.0.0) @@ -497,7 +497,7 @@ GEM version_gem (1.1.3) warden (1.2.9) rack (>= 2.0.9) - web-console (4.2.0) + web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) diff --git a/app/assets/stylesheets/site.scss b/app/assets/stylesheets/site.scss index 82ba24a90..3ab73b542 100644 --- a/app/assets/stylesheets/site.scss +++ b/app/assets/stylesheets/site.scss @@ -482,10 +482,27 @@ span.usa-hint.save-notice { padding-bottom: 20px; padding-left: 20px; padding-top: 1px; + padding-right: 1rem; } .word-break { word-wrap: break-word; } + + // A-11 V2 customizations + .question-options.icons .usa-checkbox__input--tile+.usa-checkbox__label, + .question-options.icons .usa-radio__input--tile+.usa-radio__label { + padding: 0; + } + .question-options.icons .usa-checkbox__input--tile+[class*=__label]:before { + margin-top: 20px; + bottom: 10px; + left: 48%; + margin-left: -10px; + } + .question-options.icons .usa-checkbox__label { + text-align: center; + } + // end A-11 V2 customizations } .usa-button.full-width { diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 0ef7b1fce..fecc156f4 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -7,6 +7,18 @@ def index def agencies; end + def docs + tables = ActiveRecord::Base.connection.tables + tables_specific_to_rails = [ + "active_storage_variant_records", + "active_storage_blobs", + "active_storage_attachments", + "schema_migrations", + "ar_internal_metadata" + ] + @tables = tables - tables_specific_to_rails + end + def registry @results = nil end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fe143d5bd..ea878752d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -102,6 +102,8 @@ def question_type_javascript_params(question) "form.querySelector(\"##{question.answer_field}\") && form.querySelector(\"##{question.answer_field}\").value" elsif question.question_type == 'radio_buttons' "form.querySelector(\"input[name=#{question.answer_field}]:checked\") && form.querySelector(\"input[name=#{question.answer_field}]:checked\").value" + elsif question.question_type == 'icon_checkboxes' + "form.querySelector(\"input[name=#{question.answer_field}]:checked\") && form.querySelector(\"input[name=#{question.answer_field}]:checked\").value" elsif question.question_type == 'star_radio_buttons' "form.querySelector(\"input[name=#{question.answer_field}]:checked\") && form.querySelector(\"input[name=#{question.answer_field}]:checked\").value" elsif question.question_type == 'thumbs_up_down_buttons' diff --git a/app/models/question.rb b/app/models/question.rb index bef0261d3..25bbfdac2 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -26,6 +26,7 @@ class Question < ApplicationRecord 'text_display', 'custom_text_display', 'states_dropdown', + 'icon_checkboxes', 'star_radio_buttons', 'thumbs_up_down_buttons', 'big_thumbs_up_down_buttons', diff --git a/app/models/user.rb b/app/models/user.rb index 494c89d31..c52645354 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -123,7 +123,7 @@ def self.deactivation_pending(expire_days) def self.deactivate_inactive_accounts! # Find all accounts scheduled to be deactivated in 14 days - users = User.active.where('(current_sign_in_at ISNULL AND created_at <= ?) OR (current_sign_in_at <= ?)', 90.days.ago, 90.days.ago) + users = User.active.where('(current_sign_in_at ISNULL AND created_at <= ?) OR (current_sign_in_at <= ?)', 30.days.ago, 30.days.ago) users.each(&:deactivate!) end diff --git a/app/serializers/service_provider_serializer.rb b/app/serializers/service_provider_serializer.rb index 3251844cf..ae1808671 100644 --- a/app/serializers/service_provider_serializer.rb +++ b/app/serializers/service_provider_serializer.rb @@ -18,15 +18,13 @@ class ServiceProviderSerializer < ActiveModel::Serializer :service_provider_managers, :services_count - attribute :cx_maturity_mapping_value, if: :service_manager_permissions? - attribute :impact_mapping_value, if: :service_manager_permissions? - - # TODO: use #service_manager_permissions? in ApplicationController instead - def service_manager_permissions? - current_user.service_manager? || - current_user.admin? + def show_experimental_fields? + @instance_options[:show_extra] == true end + attribute :cx_maturity_mapping_value, if: :show_experimental_fields? + attribute :impact_mapping_value, if: :show_experimental_fields? + def service_provider_managers ActiveModel::Serializer::CollectionSerializer.new(object.service_provider_managers, serializer: UserSerializer) end diff --git a/app/views/admin/collections/_form.html.erb b/app/views/admin/collections/_form.html.erb index 69e211114..a7093f70d 100644 --- a/app/views/admin/collections/_form.html.erb +++ b/app/views/admin/collections/_form.html.erb @@ -82,7 +82,7 @@ <%= f.label :quarter, "Fiscal quarter", class: "usa-label" %> -
+
Quarter
<% (1..4).each do |i| %> diff --git a/app/views/admin/cscrm_data_collections/_form.html.erb b/app/views/admin/cscrm_data_collections/_form.html.erb index d456d2617..27bb48986 100644 --- a/app/views/admin/cscrm_data_collections/_form.html.erb +++ b/app/views/admin/cscrm_data_collections/_form.html.erb @@ -273,7 +273,7 @@ <%= form.text_area :enterprise_risk_management_function_established_comments, class: "usa-textarea" %>
-
+
<%= "#{CscrmDataCollection.question_11[:number]}. #{CscrmDataCollection.question_11[:text]}" %> <%= form.label :roles_and_responsibilities, "#{CscrmDataCollection.question_11[:number]}. #{CscrmDataCollection.question_11[:text]}", diff --git a/app/views/admin/cscrm_data_collections/index.html.erb b/app/views/admin/cscrm_data_collections/index.html.erb index 8fbb7b9b0..e284950a8 100644 --- a/app/views/admin/cscrm_data_collections/index.html.erb +++ b/app/views/admin/cscrm_data_collections/index.html.erb @@ -15,7 +15,7 @@

The Office of Management and Budget (OMB) requires all executive branch agencies to report on the status of their implementation of C-SCRM foundational elements and practices by completing and submitting this C-SCRM self-assessment, - in accordance with statutory requirements noted below + in accordance with statutory requirements noted below.

@@ -68,18 +68,18 @@ Take steps to ensure responses submitted reflect an appropriate level of and span of internally coordinated input;

  • - Assess the status of their implementation and application of the foundational practices as described in + Assess the status of their implementation and application of the foundational practices as described in National Institute of Standards and Technology SP 800-161 Rev. 1 Cybersecurity Supply Chain Risk Management for Systems and Organizations, May 2022;
  • - Reference foundational practices and recommendations described in + Reference foundational practices and recommendations described in GAO-21-171 - Information Technology: Federal Agencies Need to Take Urgent Action to Manage Supply Chain Risks; and
  • Report self-assessment data semi-annually, here, in GSA’s Touchpoints application. - OMB may change the vehicle for collecting this information, if changes are made, + OMB may change the vehicle for collecting this information, if changes are made, announcements will be communicated to the Agency C-SCRM Program Manager.
  • @@ -126,4 +126,3 @@

    <% end %> - diff --git a/app/views/admin/question_options/create.js.erb b/app/views/admin/question_options/create.js.erb index bec371d96..93df56b61 100644 --- a/app/views/admin/question_options/create.js.erb +++ b/app/views/admin/question_options/create.js.erb @@ -1,5 +1,7 @@ <% if @question.question_type == "radio_buttons" %> <% @form_component_path = "components/forms/edit/question_types/radio_button_option" %> +<% elsif @question.question_type == "icon_checkboxes" %> + <% @form_component_path = "components/forms/edit/question_types/radio_button_option" %> <% elsif @question.question_type == "thumbs_up_down_buttons" %> <% @form_component_path = 'components/forms/question_types/thumbs_up_down_buttons' %> <% elsif @question.question_type == "dropdown" %> diff --git a/app/views/admin/question_options/update.js.erb b/app/views/admin/question_options/update.js.erb index bc9f86924..fd000acb0 100644 --- a/app/views/admin/question_options/update.js.erb +++ b/app/views/admin/question_options/update.js.erb @@ -1,5 +1,7 @@ <% if @question_option.question.question_type == "radio_buttons" %> <% @form_component_path = "components/forms/edit/question_types/radio_button_option" %> +<% elsif @question_option.question.question_type == "icon_checkboxes" %> + <% @form_component_path = "components/forms/question_types/icon_radio_button_option" %> <% elsif @question_option.question.question_type == "thumbs_up_down_buttons" %> <% @form_component_path = 'components/forms/question_types/thumbs_up_down_buttons' %> <% elsif @question_option.question.question_type == "dropdown" %> diff --git a/app/views/admin/questions/_question.html.erb b/app/views/admin/questions/_question.html.erb index 86b2ae145..7dd18da69 100644 --- a/app/views/admin/questions/_question.html.erb +++ b/app/views/admin/questions/_question.html.erb @@ -33,6 +33,8 @@ <% @form_component_path = 'components/forms/edit/question_types/hidden_field' %> <% elsif question.question_type == "custom_text_display" %> <% @form_component_path = 'components/forms/question_types/custom_text_display' %> +<% elsif question.question_type == "icon_checkboxes" %> +<% @form_component_path = 'components/forms/edit/question_types/icon_checkboxes' %> <% elsif question.question_type == "star_radio_buttons" %> <% @form_component_path = 'components/forms/question_types/star_radio_buttons' %> <% elsif question.question_type == "yes_no_buttons" %> diff --git a/app/views/admin/submissions/index.html.erb b/app/views/admin/submissions/index.html.erb index 858c7eccb..acb925bc1 100644 --- a/app/views/admin/submissions/index.html.erb +++ b/app/views/admin/submissions/index.html.erb @@ -6,9 +6,10 @@ <%= link_to "Export All Responses to CSV", export_submissions_admin_form_url(form, start_date: "2019-10-01", format: "json"), class: "usa-button export-btn" %>
    <% if @form.kind == "a11_v2" %> - <%= link_to "Export A11-v2 Responses to CSV", export_a11_v2_submissions_admin_form_url(form, start_date: "2019-10-01", format: "json"), class: "usa-button export-btn" %> -
    - <% end %> +

    + <%= link_to "Export A11-v2 Responses to CSV", export_a11_v2_submissions_admin_form_url(form, start_date: "2019-10-01", format: "json"), class: "usa-button export-btn" %> +

    + <% end -%>

    <%= link_to "Export FY2020", export_submissions_admin_form_url(form, start_date: "2019-10-01", end_date: "2020-09-30", format: "json"), class: "usa-button usa-button--outline export-btn" %> <%= link_to "Export FY2021", export_submissions_admin_form_url(form, start_date: "2020-10-01", end_date: "2021-09-30", format: "json"), class: "usa-button usa-button--outline export-btn" %> diff --git a/app/views/admin/websites/index.html.erb b/app/views/admin/websites/index.html.erb index d9336cdd1..48eabad77 100644 --- a/app/views/admin/websites/index.html.erb +++ b/app/views/admin/websites/index.html.erb @@ -39,7 +39,7 @@ -
    +

    diff --git a/app/views/components/forms/_custom.html.erb b/app/views/components/forms/_custom.html.erb index ccdebe704..08b0ff0de 100644 --- a/app/views/components/forms/_custom.html.erb +++ b/app/views/components/forms/_custom.html.erb @@ -52,6 +52,8 @@ <%= render 'components/forms/question_types/text_email_field', form: form, question: question, question_number: multi_section_question_number %> <% elsif question.question_type == "text_phone_field" %> <%= render 'components/forms/question_types/text_phone_field', form: form, question: question, question_number: multi_section_question_number %> + <% elsif question.question_type == "icon_checkboxes" %> + <%= render 'components/forms/question_types/icon_checkboxes', form: form, question: question, question_number: multi_section_question_number %> <% elsif question.question_type == "star_radio_buttons" %> <%= render 'components/forms/question_types/star_radio_buttons', form: form, question: question, question_number: multi_section_question_number %> <% elsif question.question_type == "thumbs_up_down_buttons" %> diff --git a/app/views/components/forms/_footer.html.erb b/app/views/components/forms/_footer.html.erb index 0e5b3c728..73aaff644 100644 --- a/app/views/components/forms/_footer.html.erb +++ b/app/views/components/forms/_footer.html.erb @@ -5,14 +5,14 @@
    <% if form.disclaimer_text? %> - - <%= form.disclaimer_text.html_safe %> - - <% end %> + + <%= form.disclaimer_text.html_safe %> + + <% end -%>
    -<% end %> +<% end -%> <%= render "components/forms/footer_banner", form: form %> diff --git a/app/views/components/forms/edit/_builder.html.erb b/app/views/components/forms/edit/_builder.html.erb index 90cdee03b..559c85a99 100644 --- a/app/views/components/forms/edit/_builder.html.erb +++ b/app/views/components/forms/edit/_builder.html.erb @@ -21,12 +21,13 @@ Instructions -
    +
    saved - <%= @instruction_text_limit %> characters allowed + <%= @instruction_text_limit %> + <%= t :characters_allowed %>
    @@ -45,8 +46,8 @@ Add Section <% end %> -
    -
    +
    +

    @@ -54,14 +55,15 @@ - +

    saved - <%= @disclaimer_text_limit %> characters allowed + <%= @disclaimer_text_limit %> + <%= t :characters_allowed %>

    <%= form.disclaimer_text.present? ? sanitize(form.disclaimer_text) : 'Survey Disclaimer Text' %>

    @@ -69,7 +71,7 @@
    -
    +

    <%= render "admin/questions/success_text", {form: form} %> @@ -343,10 +345,10 @@ function textCounter(field,maxlimit) { var countfield = field.parentNode.querySelector(".counter-msg"); if ( field.value.length > maxlimit ) { field.value = field.value.substring( 0, maxlimit ); - countfield.innerText = '0 characters left'; + countfield.innerText = '0 <%= t :characters_left %>'; return false; } else { - countfield.innerText = "" + (maxlimit - field.value.length) + " characters left"; + countfield.innerText = "" + (maxlimit - field.value.length) + " <%= t :characters_left %>"; } } diff --git a/app/views/components/forms/edit/question_types/_checkbox_option.html.erb b/app/views/components/forms/edit/question_types/_checkbox_option.html.erb index ac5d0b2ca..044962014 100644 --- a/app/views/components/forms/edit/question_types/_checkbox_option.html.erb +++ b/app/views/components/forms/edit/question_types/_checkbox_option.html.erb @@ -7,6 +7,6 @@ <% if ["OTHER", "OTRO"].include?(option.text.upcase) %> <%= label_tag(nil, for: "#{question.answer_field}_other", class: "usa-input__label") do %><%= t 'form.enter_other_text' %><% end %> -
    +
    <% end %>
    diff --git a/app/views/components/forms/edit/question_types/_icon_checkboxes.html.erb b/app/views/components/forms/edit/question_types/_icon_checkboxes.html.erb new file mode 100644 index 000000000..4ec998a34 --- /dev/null +++ b/app/views/components/forms/edit/question_types/_icon_checkboxes.html.erb @@ -0,0 +1,22 @@ +
    + <%= question.text %> + <%= render 'components/question_title', question: question, form_builder: true %> +
    + <% question.question_options.each_with_index do |option, index| %> + <%= render "components/forms/edit/question_types/checkbox_option", question: question, option: option, index: index %> + <% end %> +
    +
    +
    +
    + <%= link_to new_admin_form_question_question_option_path(question.form, question), class: "usa-button usa-button--outline form-add-question-option" do %> + + Add Checkbox Option + <% end %> + <% if !question.question_options.detect{ | option | option.value.upcase == 'OTHER' || option.value.upcase == 'OTRO'} %> + <%= link_to create_other_admin_form_question_question_options_path(question.form, question),method: :post, remote: true, class: "usa-button usa-button--outline form-add-other-question-option" do %> + + Add Other Option + <% end %> + <% end %> +
    diff --git a/app/views/components/forms/edit/question_types/_radio_button_option.html.erb b/app/views/components/forms/edit/question_types/_radio_button_option.html.erb index ac03d201f..8d1816628 100644 --- a/app/views/components/forms/edit/question_types/_radio_button_option.html.erb +++ b/app/views/components/forms/edit/question_types/_radio_button_option.html.erb @@ -7,6 +7,6 @@ <% if ["OTHER", "OTRO"].include?(option.text.upcase) %> <%= label_tag(nil, for: "#{question.answer_field}_other", class: "usa-input__label") do %><%= t 'form.enter_other_text' %><% end %> -
    +
    <% end %> diff --git a/app/views/components/forms/question_types/_big_thumbs_up_down_buttons.html.erb b/app/views/components/forms/question_types/_big_thumbs_up_down_buttons.html.erb index 32b26d304..b7735295e 100644 --- a/app/views/components/forms/question_types/_big_thumbs_up_down_buttons.html.erb +++ b/app/views/components/forms/question_types/_big_thumbs_up_down_buttons.html.erb @@ -1,69 +1,35 @@ - - -
    +
    + + <%= question.text %> + <%= render 'components/question_title', question: question %> -
    -
    - -   -   - -
    -
    - -
    - <%= question.text %> - <%= render 'components/question_title', question: question %>
    -
    - aria-describedby="<%#= "question-id-#{question.id}-help-text" %>" - <% end %> - > - <%= radio_button_tag("yes", "yes", nil, { id: "yes", name: question.answer_field, class: "usa-radio__input usa-radio__input--tile", required: question.is_required }) %> - <%= label_tag("yes", nil, class: "usa-radio__label") do %><%#= option.text %><% end %> - - +
    + <% question.question_options.each_with_index do |option, index| %> +
    +
    + aria-describedby="<%= "question-id-#{question.id}-help-text" %>" + <% end %> + > + <% @option_id = "#{question.answer_field}_#{(index + 1).to_s}" %> + <%= radio_button_tag(@option_id, option.value, nil, { id: @option_id, name: question.answer_field, class: "usa-radio__input usa-radio__input--tile", required: question.is_required }) %> + <%= label_tag(@option_id, nil, class: "usa-radio__label font-sans-3xl text-center") do %><%= option.text %><% end %> + <% if ["OTHER", "OTRO"].include?(option.text.upcase) %> + <%= label_tag(nil, for: "#{question.answer_field}_other", class: "usa-input__label") do %><%= t 'form.enter_other_text' %><% end %> + +
    + <% end %> +
    +
    + <% end %>
    -
    diff --git a/app/views/components/forms/question_types/_checkbox.html.erb b/app/views/components/forms/question_types/_checkbox.html.erb index a7e86c504..e61adcd3b 100644 --- a/app/views/components/forms/question_types/_checkbox.html.erb +++ b/app/views/components/forms/question_types/_checkbox.html.erb @@ -1,4 +1,4 @@ -
    +
    <%= question.text %> <%= render 'components/question_title', question: question %>
    @@ -16,7 +16,7 @@ <% if ["OTHER", "OTRO"].include?(option.text.upcase) %> <%= label_tag(nil, for: "#{question.answer_field}_other", class: "usa-input__label") do %><%= t 'form.enter_other_text' %><% end %> -
    +
    <% end %>
    <% end %> diff --git a/app/views/components/forms/question_types/_icon_checkboxes.html.erb b/app/views/components/forms/question_types/_icon_checkboxes.html.erb new file mode 100644 index 000000000..2965a2b2f --- /dev/null +++ b/app/views/components/forms/question_types/_icon_checkboxes.html.erb @@ -0,0 +1,39 @@ +
    + <%= question.text %> + <%= render 'components/question_title', question: question %> +
    +
    + <% question.question_options.each_with_index do |option, index| %> +
    +
    + aria-describedby="<%= "question-id-#{question.id}-help-text" %>" + <% end -%> + > + + <% @option_id = "#{question.answer_field}_#{(index + 1).to_s}" %> + <%= check_box_tag(@option_id, option.value, false, { name: question.answer_field, class: "usa-checkbox__input usa-checkbox__input--tile", required: question.is_required }) %> + <%= label_tag(nil, for: @option_id, class: "usa-checkbox__label") do %> + +
    + + <%= option.text %> + + <% end %> + + <% if ["OTHER", "OTRO"].include?(option.text.upcase) %> + <%= label_tag(nil, for: "#{question.answer_field}_other", class: "usa-input__label") do %><%= t 'form.enter_other_text' %><% end %> + +
    + <% end %> + +
    +
    + <% end %> +
    +
    +
    diff --git a/app/views/components/forms/question_types/_radio_buttons.html.erb b/app/views/components/forms/question_types/_radio_buttons.html.erb index 920faf99e..5830a0917 100644 --- a/app/views/components/forms/question_types/_radio_buttons.html.erb +++ b/app/views/components/forms/question_types/_radio_buttons.html.erb @@ -16,7 +16,7 @@ <% if ["OTHER", "OTRO"].include?(option.text.upcase) %> <%= label_tag(nil, for: "#{question.answer_field}_other", class: "usa-input__label") do %><%= t 'form.enter_other_text' %><% end %> -
    +
    <% end %> <% end %> diff --git a/app/views/components/forms/question_types/_star_radio_buttons.html.erb b/app/views/components/forms/question_types/_star_radio_buttons.html.erb index 241176234..e422574f1 100644 --- a/app/views/components/forms/question_types/_star_radio_buttons.html.erb +++ b/app/views/components/forms/question_types/_star_radio_buttons.html.erb @@ -1,4 +1,4 @@ -
    +
    <%= question.answer_field %> <%= render 'components/question_title', question: question %>
    diff --git a/app/views/components/forms/question_types/_text_field.html.erb b/app/views/components/forms/question_types/_text_field.html.erb index f683de346..75c5586d1 100644 --- a/app/views/components/forms/question_types/_text_field.html.erb +++ b/app/views/components/forms/question_types/_text_field.html.erb @@ -23,8 +23,9 @@ end <%= text_field_tag question.answer_field.to_sym, nil, form_options %> <% if question.character_limit && question.character_limit > 0 %> - - <%= question.max_length %> characters allowed - + + <%= question.max_length %> + <%= t :characters_allowed %> + <% end %> diff --git a/app/views/components/widget/_fba.js.erb b/app/views/components/widget/_fba.js.erb index f738c5069..7c061f5ef 100644 --- a/app/views/components/widget/_fba.js.erb +++ b/app/views/components/widget/_fba.js.erb @@ -362,10 +362,10 @@ function FBAform(d, N) { var countfield = field.parentNode.querySelector(".counter-msg"); if ( field.value.length > maxlimit ) { field.value = field.value.substring( 0, maxlimit ); - countfield.innerText = '0 characters left'; + countfield.innerText = '0 <%= t :characters_left %>'; return false; } else { - countfield.innerText = "" + (maxlimit - field.value.length) + " characters left"; + countfield.innerText = "" + (maxlimit - field.value.length) + " <%= t :characters_left %>"; } }, loadButton: function() diff --git a/app/views/site/docs.html.erb b/app/views/site/docs.html.erb new file mode 100644 index 000000000..d0024583b --- /dev/null +++ b/app/views/site/docs.html.erb @@ -0,0 +1,58 @@ +

    + Touchpoints Data Documentation +

    + +
    + +

    + Database tables +

    + +

    + Here is a list of the PostgreSQL database tables used by the Touchpoints application, + which is a Ruby on Rails application, hosted in cloud.gov. +

    + +

    + The tables, field names, field data types, and field comments are retrieved dynamically from the database. +

    + +<% @tables.each do |table| %> + <%= link_to table, "##{table}"%> +
    +<% end %> + +
    + +
    + Services +
    + + + + + + + + + +<% Service.columns.sort_by(&:name).each do |column| %> + + + + + +<% end %> +
    + Name + + Column Type + + Comment +
    + <%= column.name %> + + <%= column.type %> + + <%= column.comment %> +
    \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index c93c5731d..500f93346 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -135,6 +135,8 @@ en-US: "yes": "yes" "no": "no" the_feedback_and_analytics_team: " the Feedback and Analytics Team" + characters_allowed: "characters allowed" + characters_left: "characters left" form: submit: "Submit" submit_thankyou: "Thank you. Your feedback has been received." diff --git a/config/locales/es.yml b/config/locales/es.yml index e24553a2f..04331cd21 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -23,6 +23,8 @@ es: sign_in_text: Touchpoints usa Login.gov para manejar cuentas de usuario. Una vez que se autentique con Login.gov, se iniciará sesión y se le redirigirá a Touchpoints. sign_in_with: Inicia sesión con if_github: Si tiene una cuenta de GitHub, + characters_allowed: "caracteres permitidos" + characters_left: "caracteres restantes" form: submit: "Enviar" submit_thankyou: "Gracias. Su comentario ha sido recibido." diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 28ef14495..740b29950 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -43,6 +43,8 @@ zh-CN: sign_in_text: Touchpoints 使用 Login.gov 来处理用户帐户。使用 Login.gov 进行身份验证后,您将登录并重定向回 Touchpoints。 sign_in_with: 登陆使用 if_github: 如果您有 GitHub 帐户, + characters_allowed: "允许的字符" + characters_left: "剩余字符数" form: submit: "提交" submit_thankyou: "谢谢. 已收到您的反馈." diff --git a/config/routes.rb b/config/routes.rb index 995c716f3..4dce97061 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,6 +11,7 @@ end get 'hello_stimulus', to: 'site#hello_stimulus', as: :hello_stimulus if Rails.env.development? + get 'docs', to: 'site#docs', as: :docs if Rails.env.development? unless Rails.env.development? match '/404', to: 'errors#not_found', via: :all diff --git a/db/migrate/20230905201752_add_table_comments.rb b/db/migrate/20230905201752_add_table_comments.rb new file mode 100644 index 000000000..bda7ea305 --- /dev/null +++ b/db/migrate/20230905201752_add_table_comments.rb @@ -0,0 +1,50 @@ +class AddTableComments < ActiveRecord::Migration[7.0] + def change + change_table_comment(:service_providers, "A Service Provider, or HISP, as defined in OMB Circular A-11 Section 280") + change_table_comment(:services, "Services provided by an Agency, often by a Service Provider within an Agency") + change_table_comment(:service_stages, "A step or stage within a Service, as used in a Business Process Model. eg: start, middle, end") + change_table_comment(:collections, "Quarterly CX Data Collection") + change_table_comment(:omb_cx_reporting_collections, "A detailed record belonging to a Collection; a quarterly CX Data Collection") + change_table_comment(:cscrm_data_collections, "Data Collection for C-SCRM in Q2 of FY 2023") + change_table_comment(:cscrm_data_collections2, "Data Collection for C-SCRM in Q4 of FY 2023") + + change_column_comment(:services, :id, "Unique identifier for a Service") + change_column_comment(:services, :service_owner_id, "ID of the User record for which a Service is owned or managed by") + change_column_comment(:services, :name, "Name of the service") + change_column_comment(:services, :description, "Description of the designated service") + change_column_comment(:services, :organization_id, "Unique number for each department. A department may contain several HISPs") + change_column_comment(:services, :service_provider_id, "Unique number for each Service Provider") + change_column_comment(:services, :multi_agency_service, "Do multiple agencies collaborate to provide this service?") + change_column_comment(:services, :multi_agency_explanation, "If applicable, describe how multiple agencies collaborate to provide this service") + change_column_comment(:services, :justification_text, "HISP provides a description for why this service was selected for priority designation") + change_column_comment(:services, :contact_center, "True or False for whether the service involves a contact center and/or an interaction with a contact center") + change_column_comment(:services, :kind, "Identifies the category of service: compliance, administrative, benefits, recreation, informational, data and research, and regulatory") + change_column_comment(:services, :other_service_type, "") + change_column_comment(:services, :estimated_annual_volume_of_customers, "Estimated volume of customers on an annual basis") + change_column_comment(:services, :customer_volume_explanation, "") + change_column_comment(:services, :digital_service, "Is this a digital service or not?") + change_column_comment(:services, :fully_digital_service, "Is this a fully digital service or not?") + change_column_comment(:services, :barriers_to_fully_digital_service, "If applicable, describe the barriers preventing this service from being a fully digital service") + change_column_comment(:services, :resources_needed_to_provide_digital_service, "If applicable, what resources are needed to provide this service digitally?") + change_column_comment(:services, :non_digital_explanation, "If applicable, explain why a service is not available via a digital channel") + change_column_comment(:services, :transactional, "True or False for whether the service is transactional") + change_column_comment(:services, :where_customers_interact, "Where customers interact") + change_column_comment(:services, :notes, "Field for HISP to provide additional notes") + change_column_comment(:services, :hisp, "True or False - Is this Service considered a HISP service?") + change_column_comment(:services, :department, "Abbreviation of department name") + change_column_comment(:services, :bureau, "Name of the Bureau to which a service belongs") + change_column_comment(:services, :bureau_abbreviation, "Abbreviatioon of the Bureau to which a service belongs") + change_column_comment(:services, :bureau_id, "Reference to the Organization ID that is the Bureau for this Service") + change_column_comment(:services, :office, "Text description for the office (below a Bureau)") + change_column_comment(:services, :service_abbreviation, "a unique text string to identify the service") + change_column_comment(:services, :service_slug, "a unique text string to identify the service") + change_column_comment(:services, :url, "A website link to their service") + change_column_comment(:services, :homepage_url, "A primary website link to the service") + change_column_comment(:services, :channels, "One or more channels where the service is delivered") + change_column_comment(:services, :service_stages_count, "Helper field that counts how many Service Stages this Service has") + change_column_comment(:services, :budget_code, "The budget code for this service") + change_column_comment(:services, :uii_code, "The UII code for this service") + change_column_comment(:services, :designated_for_improvement_a11_280, "Is this Service designated, per the OMB Circular A-11 Section 280") + change_column_comment(:services, :aasm_state, "State/status that a Service is in. eg: created, submitted, approved, verified, archived") + end +end diff --git a/db/schema.rb b/db/schema.rb index f76edaee8..d2d31788d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_08_03_012458) do +ActiveRecord::Schema[7.0].define(version: 2023_09_05_201752) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -49,7 +49,7 @@ t.datetime "updated_at", precision: nil, null: false end - create_table "collections", force: :cascade do |t| + create_table "collections", comment: "Quarterly CX Data Collection", force: :cascade do |t| t.string "name" t.date "start_date" t.date "end_date" @@ -69,7 +69,7 @@ t.index ["user_id"], name: "index_collections_on_user_id" end - create_table "cscrm_data_collections", force: :cascade do |t| + create_table "cscrm_data_collections", comment: "Data Collection for C-SCRM in Q2 of FY 2023", force: :cascade do |t| t.string "leadership_roles" t.string "stakeholder_champion_identified" t.string "pmo_established" @@ -123,7 +123,7 @@ t.index ["user_id"], name: "index_cscrm_data_collections_on_user_id" end - create_table "cscrm_data_collections2", force: :cascade do |t| + create_table "cscrm_data_collections2", comment: "Data Collection for C-SCRM in Q4 of FY 2023", force: :cascade do |t| t.string "interdisciplinary_team" t.text "interdisciplinary_team_comments" t.string "pmo_established" @@ -430,7 +430,7 @@ t.datetime "updated_at", null: false end - create_table "omb_cx_reporting_collections", force: :cascade do |t| + create_table "omb_cx_reporting_collections", comment: "A detailed record belonging to a Collection; a quarterly CX Data Collection", force: :cascade do |t| t.integer "collection_id" t.string "service_provided" t.text "transaction_point" @@ -599,7 +599,7 @@ t.index ["resource_type", "resource_id"], name: "index_roles_on_resource" end - create_table "service_providers", force: :cascade do |t| + create_table "service_providers", comment: "A Service Provider, or HISP, as defined in OMB Circular A-11 Section 280", force: :cascade do |t| t.integer "organization_id" t.string "name" t.text "description" @@ -628,7 +628,7 @@ t.datetime "updated_at", precision: nil, null: false end - create_table "service_stages", force: :cascade do |t| + create_table "service_stages", comment: "A step or stage within a Service, as used in a Business Process Model. eg: start, middle, end", force: :cascade do |t| t.string "name" t.text "description" t.integer "service_id" @@ -642,46 +642,46 @@ t.index ["service_id"], name: "index_service_stages_on_service_id" end - create_table "services", force: :cascade do |t| - t.string "name" - t.text "description" - t.integer "organization_id" - t.text "notes" + create_table "services", id: { comment: "Unique identifier for a Service" }, comment: "Services provided by an Agency, often by a Service Provider within an Agency", force: :cascade do |t| + t.string "name", comment: "Name of the service" + t.text "description", comment: "Description of the designated service" + t.integer "organization_id", comment: "Unique number for each department. A department may contain several HISPs" + t.text "notes", comment: "Field for HISP to provide additional notes" t.datetime "created_at", precision: nil, null: false t.datetime "updated_at", precision: nil, null: false - t.boolean "hisp", default: false - t.string "department", default: "" - t.string "bureau", default: "" - t.string "bureau_abbreviation", default: "" - t.string "service_abbreviation", default: "" - t.string "service_slug", default: "" - t.string "url", default: "" - t.integer "service_provider_id" - t.integer "service_owner_id" - t.text "justification_text" - t.text "where_customers_interact" - t.string "kind", array: true - t.string "aasm_state", default: "created" - t.text "non_digital_explanation" - t.integer "service_stages_count", default: 0 - t.string "homepage_url" - t.string "budget_code" - t.string "uii_code" - t.boolean "transactional", default: false - t.boolean "digital_service", default: false - t.string "estimated_annual_volume_of_customers", default: "" - t.string "channels", array: true - t.boolean "fully_digital_service", default: false - t.text "barriers_to_fully_digital_service" - t.boolean "multi_agency_service", default: false - t.text "multi_agency_explanation" + t.boolean "hisp", default: false, comment: "True or False - Is this Service considered a HISP service?" + t.string "department", default: "", comment: "Abbreviation of department name" + t.string "bureau", default: "", comment: "Name of the Bureau to which a service belongs" + t.string "bureau_abbreviation", default: "", comment: "Abbreviatioon of the Bureau to which a service belongs" + t.string "service_abbreviation", default: "", comment: "a unique text string to identify the service" + t.string "service_slug", default: "", comment: "a unique text string to identify the service" + t.string "url", default: "", comment: "A website link to their service" + t.integer "service_provider_id", comment: "Unique number for each Service Provider" + t.integer "service_owner_id", comment: "ID of the User record for which a Service is owned or managed by" + t.text "justification_text", comment: "HISP provides a description for why this service was selected for priority designation" + t.text "where_customers_interact", comment: "Where customers interact" + t.string "kind", comment: "Identifies the category of service: compliance, administrative, benefits, recreation, informational, data and research, and regulatory", array: true + t.string "aasm_state", default: "created", comment: "State/status that a Service is in. eg: created, submitted, approved, verified, archived" + t.text "non_digital_explanation", comment: "If applicable, explain why a service is not available via a digital channel" + t.integer "service_stages_count", default: 0, comment: "Helper field that counts how many Service Stages this Service has" + t.string "homepage_url", comment: "A primary website link to the service" + t.string "budget_code", comment: "The budget code for this service" + t.string "uii_code", comment: "The UII code for this service" + t.boolean "transactional", default: false, comment: "True or False for whether the service is transactional" + t.boolean "digital_service", default: false, comment: "Is this a digital service or not?" + t.string "estimated_annual_volume_of_customers", default: "", comment: "Estimated volume of customers on an annual basis" + t.string "channels", comment: "One or more channels where the service is delivered", array: true + t.boolean "fully_digital_service", default: false, comment: "Is this a fully digital service or not?" + t.text "barriers_to_fully_digital_service", comment: "If applicable, describe the barriers preventing this service from being a fully digital service" + t.boolean "multi_agency_service", default: false, comment: "Do multiple agencies collaborate to provide this service?" + t.text "multi_agency_explanation", comment: "If applicable, describe how multiple agencies collaborate to provide this service" t.string "other_service_type" t.string "customer_volume_explanation" - t.text "resources_needed_to_provide_digital_service" - t.integer "bureau_id" - t.string "office" - t.boolean "designated_for_improvement_a11_280", default: false - t.boolean "contact_center", default: false + t.text "resources_needed_to_provide_digital_service", comment: "If applicable, what resources are needed to provide this service digitally?" + t.integer "bureau_id", comment: "Reference to the Organization ID that is the Bureau for this Service" + t.string "office", comment: "Text description for the office (below a Bureau)" + t.boolean "designated_for_improvement_a11_280", default: false, comment: "Is this Service designated, per the OMB Circular A-11 Section 280" + t.boolean "contact_center", default: false, comment: "True or False for whether the service involves a contact center and/or an interaction with a contact center" t.index ["organization_id"], name: "index_services_on_organization_id" end diff --git a/db/seeds.rb b/db/seeds.rb index 55d963f98..9b7756551 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -830,3 +830,19 @@ def random_words comments: random_words, }) end + +for i in (1..20) do + DigitalServiceAccount.create!({ + organization_list: [@gsa.id], + name: "Social Media Account #{i}", + account: DigitalServiceAccount.list.sample, + aasm_state: DigitalServiceAccount.aasm.states.map(&:name).sample, + service_url: "https://example.lvh.me/account#{i}" + }) + + DigitalProduct.create({ + organization_list: [@gsa.id], + name: "Digital Product #{i}", + aasm_state: DigitalProduct.aasm.states.map(&:name).sample + }) +end \ No newline at end of file diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 2e4271ca2..8ca4b0f2f 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -36,7 +36,7 @@ exit 1 end -Webdrivers::Chromedriver.required_version = "114.0.5735.90" +Webdrivers::Chromedriver.required_version = "116.0.5845.96" # for Capybara Capybara.register_driver :selenium do |app|