-
-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In #5388 I added ContacTopics and ContactTopicAnswers to CaseContacts. This allowed CasaOrgs to set topics and Users to create ContactTopicAnswers on specific CaseContacts. Now we want to have those answers appear in the court reports. This PR modifies CourtReportContext to include topic information, as well as modifies CourtReport templates to accept that information. Modified the templates to render the correct information. If an org has no topics the fallback is the old values. Additionally if a org has no topics the form/details page should not show the card for court topics. Adds after_party update task to update prod organizations with new templates.
- Loading branch information
1 parent
c652ecc
commit 6377f2b
Showing
12 changed files
with
284 additions
and
2 deletions.
There are no files selected for viewing
Binary file modified
BIN
+1.59 KB
(100%)
app/documents/templates/default_report_template.docx
100755 → 100644
Binary file not shown.
Binary file modified
BIN
+654 Bytes
(100%)
app/documents/templates/howard_county_report_template.docx
Binary file not shown.
Binary file modified
BIN
+39.9 KB
(290%)
app/documents/templates/montgomery_report_template.docx
100755 → 100644
Binary file not shown.
Binary file modified
BIN
-90.3 KB
(95%)
app/documents/templates/prince_george_report_template.docx
100755 → 100644
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
lib/tasks/deployment/20240420230126_update_org_templates.rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace :after_party do | ||
desc "Deployment task: Updates_production_casa_orgs_with_new_templates" | ||
task update_org_templates: :environment do | ||
puts "Running deploy task 'update_org_templates'" | ||
|
||
mapping = { | ||
"Howard County CASA" => "howard_county_report_template.docx", | ||
"Voices for Children Montgomery" => "montgomery_report_template.docx", | ||
"Prince George CASA" => "prince_george_report_template.docx" | ||
} | ||
|
||
mapping.each do |casa_org_name, template_file_name| | ||
casa_org = CasaOrg.find_by(name: casa_org_name) | ||
if casa_org | ||
casa_org.court_report_template.attach( | ||
io: File.new(Rails.root.join("app", "documents", "templates", template_file_name)), | ||
filename: template_file_name | ||
) | ||
else | ||
Bugsnag.notify("No #{casa_org_name} found for rake task update_org_templates") | ||
end | ||
end | ||
|
||
# Update task as completed. If you remove the line below, the task will | ||
# run with every deploy (or every time you call after_party:run). | ||
AfterParty::TaskRecord | ||
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters