From 56c0926b8ebda641c97724e3e5a947fda97ca343 Mon Sep 17 00:00:00 2001 From: Ryan Wold Date: Thu, 14 Dec 2023 14:41:33 -0800 Subject: [PATCH 1/2] update CX Collection page --- app/views/admin/cx_collection_details/_form.html.erb | 2 +- app/views/admin/cx_collections/show.html.erb | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/admin/cx_collection_details/_form.html.erb b/app/views/admin/cx_collection_details/_form.html.erb index 35b1266f4..543d399f7 100644 --- a/app/views/admin/cx_collection_details/_form.html.erb +++ b/app/views/admin/cx_collection_details/_form.html.erb @@ -45,7 +45,7 @@
<%= form.label :service_stage_id, "Stage of Service Journey", class: "usa-label" %> - <% if cx_collection_detail.service %> + <% if cx_collection_detail.cx_collection.service %> <%= form.select :service_stage_id, options_for_select(cx_collection_detail.cx_collection.service.service_stages.map { |stage| [stage.name, stage.id]}), { include_blank: true }, { class: "usa-select" } %> diff --git a/app/views/admin/cx_collections/show.html.erb b/app/views/admin/cx_collections/show.html.erb index 349c80204..71416fa51 100644 --- a/app/views/admin/cx_collections/show.html.erb +++ b/app/views/admin/cx_collections/show.html.erb @@ -108,7 +108,8 @@ - + + @@ -117,7 +118,12 @@ <% @cx_collection.cx_collection_details.order(:channel).each do |cx_collection| %> +
ServiceSurvey titleStage Transaction point Channel
- <%= cx_collection.try(:service).try(:name) %> + <%= cx_collection.survey_title %> + + <% if cx_collection.service_stage %> + <%= cx_collection.service_stage.name %> + <% end %> <%= link_to cx_collection.transaction_point, admin_cx_collection_detail_path(cx_collection) %> From c954d23f23fd0b2ac501aa41011d413b3bd28aeb Mon Sep 17 00:00:00 2001 From: Ryan Wold Date: Fri, 15 Dec 2023 09:21:52 -0800 Subject: [PATCH 2/2] comma separate large numbers * display a form's timezone --- app/helpers/application_helper.rb | 5 +++++ app/views/admin/forms/index.html.erb | 4 ++-- app/views/admin/forms/show.html.erb | 11 +++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ea878752d..09afa476e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -166,6 +166,11 @@ def format_time(time, timezone) I18n.l time.to_time.in_time_zone(timezone), format: :long end + def timezone_abbreviation(timezone) + zone = ActiveSupport::TimeZone.new(timezone) + zone.now.strftime('%Z') + end + def form_integrity_checksum(form:) data_to_encode = render(partial: 'components/widget/fba', formats: :js, locals: { form: }) Digest::SHA256.base64digest(data_to_encode) diff --git a/app/views/admin/forms/index.html.erb b/app/views/admin/forms/index.html.erb index c4db58003..22ce9b655 100644 --- a/app/views/admin/forms/index.html.erb +++ b/app/views/admin/forms/index.html.erb @@ -63,10 +63,10 @@ <%= form.questions_count %> - <%= form.survey_form_activations %> + <%= number_with_delimiter(form.survey_form_activations) %> - <%= form.response_count %> + <%= number_with_delimiter(form.response_count) %> <%= form.completion_rate %> diff --git a/app/views/admin/forms/show.html.erb b/app/views/admin/forms/show.html.erb index 8670db986..78025bdb8 100644 --- a/app/views/admin/forms/show.html.erb +++ b/app/views/admin/forms/show.html.erb @@ -28,22 +28,25 @@ <% if is_at_least_form_manager?(user: current_user, form: @form) %>
-

+

- <%= pluralize @form.response_count, "response" %> + <%= pluralize number_with_delimiter(@form.response_count), "response" %>
<% if @form.last_response_created_at.present? %> - Latest response: + + Latest response +
<%= time_ago_in_words(@form.last_response_created_at) %> ago at <%= format_time(@form.last_response_created_at, current_user.time_zone) %> + <%= timezone_abbreviation(current_user.time_zone) %>
<% end %> -

+