From 167bc1836d970b556defb8eb357387becc0db3b5 Mon Sep 17 00:00:00 2001 From: Ryan Wold Date: Tue, 11 Apr 2023 16:30:57 -0700 Subject: [PATCH 1/4] update site scanner url --- app/models/website.rb | 2 +- .../components/_site_scanner_results.html.erb | 31 +++++++++---------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/app/models/website.rb b/app/models/website.rb index caa1dfb62..e0887c911 100644 --- a/app/models/website.rb +++ b/app/models/website.rb @@ -188,7 +188,7 @@ def validate_domain_suffix end def site_scanner_json_request - url = "https://api.gsa.gov/technology/site-scanning/v1/websites/#{domain}?api_key=#{ENV.fetch('API_DATA_GOV_KEY')}&limit=10" + url = "https://api.gsa.gov/technology/site-scanning/v1/websites?target_url_domain=#{domain}&api_key=GTanZOFHw4ilAiAXtnPkHOLyfEcnmww9GabQwinn&limit=10" text = URI.open(url).read rescue StandardError => e "Error during Site Scanner API request for #{domain}.\n\n#{e}" diff --git a/app/views/components/_site_scanner_results.html.erb b/app/views/components/_site_scanner_results.html.erb index 90a674ba6..3b83c5d61 100644 --- a/app/views/components/_site_scanner_results.html.erb +++ b/app/views/components/_site_scanner_results.html.erb @@ -1,29 +1,26 @@ <% begin %> <% text = @website.site_scanner_json_request %> -<% hash = JSON.parse(text) %> +<% hash = JSON.parse(text)["items"].select { |item| item["final_url"] == "https://#{website.domain}/" }.first %>

Site Scanner results

-
-
-
-
-
-
- -
-
- -
-
-
-
-
+
+ Target URL Domain +
+ <%= hash["target_url_domain"] %> +
+
+
+ Scan date +
+ <%= hash["scan_date"] %> +
+
Web Domain
@@ -121,7 +118,7 @@ Latest Version
- 2.11.2 + 3.4.1
From acd363d27c1dc4aa1228a499a4df1552506ebe84 Mon Sep 17 00:00:00 2001 From: Ryan Wold Date: Tue, 11 Apr 2023 16:31:17 -0700 Subject: [PATCH 2/4] add organization name to website .csv export --- app/models/service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/service.rb b/app/models/service.rb index 71b0d5e6e..e980f9ad5 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -149,7 +149,7 @@ def self.to_csv services = Service.order('organizations.name').includes(:organization) example_service_attributes = Service.new.attributes - attributes = example_service_attributes.keys + attributes = example_service_attributes.keys + [:organization_name] CSV.generate(headers: true) do |csv| csv << attributes From 4eee2047e721480e1d790ad0bda9c531bd16cfc2 Mon Sep 17 00:00:00 2001 From: Ryan Wold Date: Tue, 11 Apr 2023 16:31:35 -0700 Subject: [PATCH 3/4] add help text to omb cx reporting collection --- .../_form.html.erb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/app/views/admin/omb_cx_reporting_collections/_form.html.erb b/app/views/admin/omb_cx_reporting_collections/_form.html.erb index 84aa13872..3e12b712e 100644 --- a/app/views/admin/omb_cx_reporting_collections/_form.html.erb +++ b/app/views/admin/omb_cx_reporting_collections/_form.html.erb @@ -30,16 +30,22 @@
<%= form.label :service_provided, class: "usa-label" %> +

+ Describe the service that is being measured. +

<%= form.text_field :service_provided, class: "usa-input", placeholder: "Description of the service provided", required: true %>
-
- <%= form.label :transaction_point, class: "usa-label" %> - <%= form.text_field :transaction_point, class: "usa-input", placeholder: "Transaction point at which survey is provided" %> -
<%= form.label :channel, class: "usa-label" %> <%= form.select :channel, Service.channels, { prompt: "What type of response channel?" }, class: "usa-select" %>
+
+ <%= form.label :transaction_point, class: "usa-label" %> +

+ Describe at what point in the user journey is the user prompted to complete the survey. +

+ <%= form.text_field :transaction_point, class: "usa-input" %> +
<%= form.label :volume_of_customers, class: "usa-label" %> <%= form.number_field :volume_of_customers, class: "usa-input", placeholder: "# of customers (total volume)" %> @@ -58,7 +64,10 @@
<%= form.label :federal_register_url, class: "usa-label" %> - <%= form.text_field :federal_register_url, class: "usa-input", placeholder: "https://federalregister.gov/..." %> +

+ Enter the reginfo.gov URL for the survey form. +

+ <%= form.text_field :federal_register_url, class: "usa-input", placeholder: "https://www.reginfo.gov/...", required: true %>
<%= form.label :operational_metrics, class: "usa-label" %> From e46349850c639415c18fd6a9bc95e4abe0b348c9 Mon Sep 17 00:00:00 2001 From: Ryan Wold Date: Tue, 11 Apr 2023 16:32:05 -0700 Subject: [PATCH 4/4] pass website to site scanner results --- app/views/admin/websites/statuscard.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/websites/statuscard.html.erb b/app/views/admin/websites/statuscard.html.erb index c4c787d33..4baed2168 100644 --- a/app/views/admin/websites/statuscard.html.erb +++ b/app/views/admin/websites/statuscard.html.erb @@ -36,7 +36,7 @@ Website Status card for <%= @website.domain %>
- <%= render 'components/site_scanner_results' %> + <%= render 'components/site_scanner_results', website: @website %>