-
Notifications
You must be signed in to change notification settings - Fork 3
Make PDF generation Url based instead of htmlbased #1212
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
base: staging
Are you sure you want to change the base?
Changes from all commits
b203e36
c160e77
3079185
f7468d5
9340de0
9f0932b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -48,6 +48,7 @@ | |||||||||||||||||
| <%= Rails.application.config.x.company_kvk %> | ||||||||||||||||||
| </td> | ||||||||||||||||||
| </tr> | ||||||||||||||||||
| <% if current_user&.treasurer? %> | ||||||||||||||||||
| <tr> | ||||||||||||||||||
| <th scope="row"> | ||||||||||||||||||
| Status | ||||||||||||||||||
|
|
@@ -60,10 +61,11 @@ | |||||||||||||||||
| <% end %> | ||||||||||||||||||
| </td> | ||||||||||||||||||
| </tr> | ||||||||||||||||||
| <% end %> | ||||||||||||||||||
| </tbody> | ||||||||||||||||||
| </table> | ||||||||||||||||||
|
|
||||||||||||||||||
| <% unless @invoice.paid? %> | ||||||||||||||||||
| <% if !@invoice.paid? && Rails.application.config.x.mollie_api_key.present? %> | ||||||||||||||||||
| <%= link_to pay_invoice_url @invoice.token do %> | ||||||||||||||||||
| <button class="col-sm-3 offset-sm-9 btn btn-primary">Betalen</button> | ||||||||||||||||||
|
Comment on lines
+68
to
70
|
||||||||||||||||||
| <% if !@invoice.paid? && Rails.application.config.x.mollie_api_key.present? %> | |
| <%= link_to pay_invoice_url @invoice.token do %> | |
| <button class="col-sm-3 offset-sm-9 btn btn-primary">Betalen</button> | |
| <% if Rails.application.config.x.mollie_api_key.present? %> | |
| <% unless @invoice.paid? %> | |
| <%= link_to pay_invoice_url @invoice.token do %> | |
| <button class="col-sm-3 offset-sm-9 btn btn-primary">Betalen</button> | |
| <% end %> |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,22 @@ | ||
| # Grover Global Configuration | ||
| # | ||
| # Use this to set up shared configuration options for your entire application. | ||
| # Any of the configuration options shown here can also be applied to single | ||
| # models by passing arguments to the Grover.new call. | ||
| # | ||
| # To learn more, check out the README: | ||
| # https://github.com/Studiosity/grover | ||
|
|
||
| Grover.configure do |config| | ||
| options = { | ||
| format: 'A4', | ||
| config.options = { | ||
| viewport: { | ||
| width: 794, # A4 width in pixels at 96 DPI (210mm) | ||
| height: 1123 # Starting height, will expand as needed | ||
| }, | ||
| emulate_media: 'screen', | ||
| print_background: true, | ||
| prefer_css_page_size: false, | ||
| display_url: "https://#{Rails.application.config.x.sofia_host}" | ||
| executable_path: Rails.env.development? ? nil : '/usr/bin/chromium', | ||
| launch_args: if Rails.env.development? | ||
| [] | ||
| else | ||
| [ | ||
| '--no-sandbox', | ||
| '--disable-setuid-sandbox', | ||
| '--disable-dev-shm-usage', | ||
| '--disable-gpu', | ||
| '--disable-software-rasterizer' | ||
| ] | ||
| end | ||
| } | ||
|
|
||
| unless Rails.env.development? | ||
| options[:executable_path] = '/usr/bin/chromium' | ||
| options[:launch_args] = [ | ||
| '--no-sandbox', | ||
| '--disable-setuid-sandbox', | ||
| '--disable-dev-shm-usage', | ||
| '--disable-gpu', | ||
| '--disable-software-rasterizer', | ||
| '--hide-scrollbars' | ||
| ] | ||
| end | ||
|
|
||
| config.options = options | ||
| end |
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.
The new URL-based PDF attachment generation lacks test coverage. Since the codebase has comprehensive test coverage for controllers, this change should include tests that verify the PDF attachment is correctly generated and attached to the email, including tests for error handling when PDF generation fails.