From 43ae8fa45a1a0dc196d454d642188f352666e426 Mon Sep 17 00:00:00 2001 From: Ryan Wold <64987852+ryanwoldatwork@users.noreply.github.com> Date: Thu, 20 Feb 2025 17:51:54 -0800 Subject: [PATCH 1/3] update gems --- Gemfile.lock | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2cba46de3..e3968fd56 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -111,10 +111,10 @@ GEM aes_key_wrap (1.1.0) ast (2.4.2) aws-eventstream (1.3.1) - aws-partitions (1.1050.0) + aws-partitions (1.1052.0) aws-record (2.13.2) aws-sdk-dynamodb (~> 1, >= 1.85.0) - aws-sdk-core (3.218.1) + aws-sdk-core (3.219.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) @@ -137,7 +137,7 @@ GEM aws-sessionstore-dynamodb (~> 2) concurrent-ruby (~> 1.3, >= 1.3.1) railties (>= 7.0.0) - aws-sdk-s3 (1.180.0) + aws-sdk-s3 (1.181.0) aws-sdk-core (~> 3, >= 3.216.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) @@ -374,24 +374,24 @@ GEM net-protocol newrelic_rpm (9.17.0) nio4r (2.7.4) - nokogiri (1.18.2) + nokogiri (1.18.3) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.18.2-aarch64-linux-gnu) + nokogiri (1.18.3-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.2-aarch64-linux-musl) + nokogiri (1.18.3-aarch64-linux-musl) racc (~> 1.4) - nokogiri (1.18.2-arm-linux-gnu) + nokogiri (1.18.3-arm-linux-gnu) racc (~> 1.4) - nokogiri (1.18.2-arm-linux-musl) + nokogiri (1.18.3-arm-linux-musl) racc (~> 1.4) - nokogiri (1.18.2-arm64-darwin) + nokogiri (1.18.3-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.2-x86_64-darwin) + nokogiri (1.18.3-x86_64-darwin) racc (~> 1.4) - nokogiri (1.18.2-x86_64-linux-gnu) + nokogiri (1.18.3-x86_64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.2-x86_64-linux-musl) + nokogiri (1.18.3-x86_64-linux-musl) racc (~> 1.4) oauth2 (2.0.9) faraday (>= 0.17.3, < 3.0) @@ -511,7 +511,7 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.4.0) + rexml (3.4.1) rolify (6.0.1) rspec-core (3.13.3) rspec-support (~> 3.13.0) @@ -532,7 +532,7 @@ GEM rspec-support (3.13.2) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.72.0) + rubocop (1.72.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -545,13 +545,15 @@ GEM unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.38.0) parser (>= 3.3.1.0) - rubocop-rails (2.29.1) + rubocop-rails (2.30.1) activesupport (>= 4.2.0) + lint_roller (~> 1.1) rack (>= 1.1) - rubocop (>= 1.52.0, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (3.4.0) - rubocop (~> 1.61) + rubocop (>= 1.72.1, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) + rubocop-rspec (3.5.0) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) ruby-graphviz (1.2.5) rexml ruby-progressbar (1.13.0) @@ -574,7 +576,7 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sidekiq (7.3.8) + sidekiq (7.3.9) base64 connection_pool (>= 2.3.0) logger @@ -634,7 +636,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.7.1) + zeitwerk (2.7.2) PLATFORMS aarch64-linux From 8d28ec13b6d0716cb1c8e0d931dad60c8805e706 Mon Sep 17 00:00:00 2001 From: Ryan Wold <64987852+ryanwoldatwork@users.noreply.github.com> Date: Fri, 21 Feb 2025 10:06:59 -0800 Subject: [PATCH 2/3] no new relic in dev, constrain form logo options, remove duplicative url in email --- app/views/admin/forms/_logo_display.html.erb | 2 +- app/views/user_mailer/form_feedback.html.erb | 3 --- config/newrelic.yml | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/admin/forms/_logo_display.html.erb b/app/views/admin/forms/_logo_display.html.erb index 908f4a9fc..674c6fe3d 100644 --- a/app/views/admin/forms/_logo_display.html.erb +++ b/app/views/admin/forms/_logo_display.html.erb @@ -1,5 +1,5 @@
Please take this <%= link_to "short survey", @feedback_url %>
to provide feedback regarding the Touchpoints application and/or the Touchpoints team.
-
-
- <%= link_to @feedback_url, @feedback_url %>
We want to know what you thought of Touchpoints and how CX feedback is going. diff --git a/config/newrelic.yml b/config/newrelic.yml index 73febc961..fe4e0607f 100644 --- a/config/newrelic.yml +++ b/config/newrelic.yml @@ -27,6 +27,7 @@ common: &default_settings development: <<: *default_settings app_name: touchpoints-development + monitor_mode: false test: <<: *default_settings From 53fad2a28bd9da131916ab364a69081d66596a0a Mon Sep 17 00:00:00 2001 From: Ryan Wold <64987852+ryanwoldatwork@users.noreply.github.com> Date: Fri, 21 Feb 2025 10:49:39 -0800 Subject: [PATCH 3/3] Cache submission preview text * add links to filtered folder views --- app/models/submission.rb | 7 +++- app/views/admin/forms/responses.html.erb | 3 -- .../components/_responses_by_status.html.erb | 14 +++++-- ...20250214194816_cache_submission_preview.rb | 11 ++++++ db/schema.rb | 3 +- spec/factories/form.rb | 3 ++ spec/features/admin/forms_spec.rb | 1 - spec/models/submission_spec.rb | 38 +++++++++++++++++++ 8 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 db/migrate/20250214194816_cache_submission_preview.rb diff --git a/app/models/submission.rb b/app/models/submission.rb index ef1c76fa6..9efb6fffd 100644 --- a/app/models/submission.rb +++ b/app/models/submission.rb @@ -11,6 +11,7 @@ class Submission < ApplicationRecord before_create :set_uuid after_create :update_form + after_create :set_preview after_commit :send_notifications, on: :create scope :active, -> { where(flagged: false, spam: false, archived: false, deleted: false) } @@ -69,6 +70,7 @@ def validate_custom_form answered_questions.delete('spam') answered_questions.delete('archived') answered_questions.delete('deleted') + answered_questions.delete('preview') answered_questions.delete('created_at') answered_questions.delete('updated_at') answered_questions.delete('deleted_at') @@ -207,12 +209,13 @@ def organization_name form.organization.present? ? form.organization.name : 'Org Name' end - def preview + def set_preview # only select the answer fields fields = attributes.select { |attr| attr.include?("answer")} # only select text fields text_fields = fields.values.select { |v| v.is_a?(String) } - text_fields.join(" - ").truncate(120) + preview_text = text_fields.join(" - ").truncate(120) + self.update_attribute(:preview, preview_text) end def set_uuid diff --git a/app/views/admin/forms/responses.html.erb b/app/views/admin/forms/responses.html.erb index 9b287689d..e7f8b2f51 100644 --- a/app/views/admin/forms/responses.html.erb +++ b/app/views/admin/forms/responses.html.erb @@ -10,9 +10,6 @@ <% end %>
<%= render 'admin/forms/nav', form: @form %> -