From e4f8d3924a18b303c2bb7da9472cf0c060060e4e Mon Sep 17 00:00:00 2001 From: David Battersby Date: Mon, 31 Jul 2023 10:14:12 +0800 Subject: [PATCH] FIX: update report url to work with subfolder installs (#255) This change includes the Discourse base url to allow for subfolder installs, it will also fix another potential issue where reports are sent via email (since we use the email_group_user component) that would require the base_url to know which domain to point to. --- lib/report_generator.rb | 2 +- spec/report_generator_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/report_generator.rb b/lib/report_generator.rb index 8680f05..67b730b 100644 --- a/lib/report_generator.rb +++ b/lib/report_generator.rb @@ -66,7 +66,7 @@ module ::DiscourseDataExplorer pm["target_usernames"] = Array(username) pm["raw"] = "Hi #{username}, your data explorer report is ready.\n\n" + "Query Name:\n#{query.name}\n\nHere are the results:\n#{table}\n\n" + - "View query in Data Explorer\n\n" + + "View query in Data Explorer\n\n" + "Report created at #{Time.zone.now.strftime("%Y-%m-%d at %H:%M:%S")} (#{Time.zone.name})" pms << pm end diff --git a/spec/report_generator_spec.rb b/spec/report_generator_spec.rb index 74e54e1..79a8a03 100644 --- a/spec/report_generator_spec.rb +++ b/spec/report_generator_spec.rb @@ -48,7 +48,7 @@ describe DiscourseDataExplorer::ReportGenerator do "raw" => "Hi #{user.username}, your data explorer report is ready.\n\n" + "Query Name:\n#{query.name}\n\nHere are the results:\nle table\n\n" + - "View query in Data Explorer\n\n" + + "View query in Data Explorer\n\n" + "Report created at #{Time.zone.now.strftime("%Y-%m-%d at %H:%M:%S")} (#{Time.zone.name})", }, ],