Skip to content
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

Merged

Conversation

FireLemons
Copy link
Collaborator

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?

  • Admin 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
image
those dates are broken on QA too

Custom Template
image
image
image

@github-actions github-actions bot added ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels Apr 12, 2021
@compwron
Copy link
Collaborator

exciting! :)

@FireLemons FireLemons force-pushed the custom_court_report_templates_per_org branch from 87eba01 to 4f3ba75 Compare April 14, 2021 22:47
@FireLemons FireLemons marked this pull request as ready for review April 15, 2021 02:46
@@ -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"))
Copy link
Collaborator

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

def generate_to_string
puts @context
Copy link
Collaborator

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")
Copy link
Collaborator

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]
Copy link
Collaborator

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

@FireLemons FireLemons force-pushed the custom_court_report_templates_per_org branch from 50a20a8 to 5ef5a76 Compare April 15, 2021 02:55
@compwron compwron merged commit ef1f75b into rubyforgood:main Apr 15, 2021
@FireLemons FireLemons deleted the custom_court_report_templates_per_org branch March 8, 2023 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Pull requests that update Ruby code Tests! 🎉💖👏
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Give Montgomery their own logo and format for court report
2 participants