-
-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom court report templates per org #1942
Custom court report templates per org #1942
Conversation
exciting! :) |
87eba01
to
4f3ba75
Compare
@@ -10,29 +10,26 @@ def initialize(args = {}) | |||
@casa_case = CasaCase.find(args[:case_id]) | |||
@volunteer = Volunteer.find(args[:volunteer_id]) | |||
|
|||
@context = prepare_context | |||
@context = prepare_context(args[:path_to_template].end_with?("default_report_template.docx")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to make this string a variable default_report_template.docx
app/models/case_court_report.rb
Outdated
def generate_to_string | ||
puts @context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove
desc "Deployment task: set_custom_court_docs_for_orgs" | ||
task task_name: :environment do | ||
CasaOrg.where(name: "Prince George CASA").map do |casa_org| | ||
court_report_template.attach(io: File.new(Rails.root.join("app", "documents", "templates", "prince_george_report_template.docx")), filename: "prince_george_report_template.docx") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing casa_org.
@@ -67,7 +58,7 @@ | |||
|
|||
it "has the following keys [:created_date, :casa_case, :case_contacts, :volunteer]" do | |||
expected = %i[created_date casa_case case_contacts volunteer] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to refactor this test to be more clear someday, doesn't have to be in this PR tho
50a20a8
to
5ef5a76
Compare
What github issue is this PR for, if any?
Resolves #1826
What changed, and why?
There is a default court report template
Admins can upload a custom court report template
Generated court reports use the template
Pruned unused code
How will this affect user permissions?
admins can upload a custom court report template
How is this tested? (please write tests!) 💖💪
just manually for now
Screenshots please :)
Default generation
![image](https://user-images.githubusercontent.com/8918762/114462647-f4467000-9ba8-11eb-89be-701c5d0a4178.png)
![image](https://user-images.githubusercontent.com/8918762/114462774-1d670080-9ba9-11eb-9067-3619680d053a.png)
those dates are broken on QA too
Custom Template
![image](https://user-images.githubusercontent.com/8918762/114462871-49828180-9ba9-11eb-8a9e-6cbfee71b3f0.png)
![image](https://user-images.githubusercontent.com/8918762/114463009-75056c00-9ba9-11eb-9d71-a8ae27bfb8ae.png)
![image](https://user-images.githubusercontent.com/8918762/114462976-69b24080-9ba9-11eb-9317-d565092ec0e2.png)