From 1367b527869307c7a25e46ca9856498040c7a7a6 Mon Sep 17 00:00:00 2001 From: Bernardo Anderson Date: Mon, 1 Jun 2026 17:02:54 -0500 Subject: [PATCH 1/2] CP-12559 - Add Pendo integration partial Add a new shared partial `_pendo.html.erb` that loads the Pendo agent script and initializes it with visitor and account data for signed-in users, or empty initialization for anonymous sessions. The partial is conditionally rendered in the application layout when the `PENDO_API_KEY` environment variable is set. --- app/views/layouts/application.html.erb | 1 + app/views/shared/_pendo.html.erb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 app/views/shared/_pendo.html.erb diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index df578657f..03d18850e 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -20,6 +20,7 @@ <%= stylesheet_pack_tag 'application', media: 'all' %> <%= render 'shared/posthog' if ENV['POSTHOG_TOKEN'] %> <%= render 'shared/plausible' if !signed_in? && ENV['PLAUSIBLE_DOMAIN'] %> + <%= render 'shared/pendo' if ENV['PENDO_API_KEY'] %> diff --git a/app/views/shared/_pendo.html.erb b/app/views/shared/_pendo.html.erb new file mode 100644 index 000000000..7f6e68447 --- /dev/null +++ b/app/views/shared/_pendo.html.erb @@ -0,0 +1,17 @@ + From ebe41c396e5fe676fbd7e531c3b368f4fd14c13f Mon Sep 17 00:00:00 2001 From: Bernardo Anderson Date: Mon, 1 Jun 2026 17:05:59 -0500 Subject: [PATCH 2/2] CP-12559 - Remove redundant parentheses from range argument Simplify the call to `generate_document_preview_images` by removing unnecessary parentheses around the range literal. Also remove a trailing blank line at the end of the file for consistent formatting. --- lib/templates/process_document.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/templates/process_document.rb b/lib/templates/process_document.rb index 92988e991..687ccd082 100644 --- a/lib/templates/process_document.rb +++ b/lib/templates/process_document.rb @@ -94,7 +94,7 @@ def generate_pdf_preview_images(attachment, data, pdf = nil) attachment.save! end - generate_document_preview_images(attachment, data, (0..number_of_pages - 1)) + generate_document_preview_images(attachment, data, 0..number_of_pages - 1) end def generate_document_preview_images(attachment, data, range, concurrency: CONCURRENCY) @@ -196,6 +196,5 @@ def normalize_attachment_fields(template, attachments = template.documents) pdf_fields end end - end end