Compare commits

..
40 Commits
Author SHA1 Message Date
Alex Turchyn 0dac1abe84 Merge from docusealco/wip 2026-11-16 12:28:11 +02:00
Pete Matsyburka d45ff6b2af fix remove account 2026-11-15 09:49:17 +02:00
Pete Matsyburka 3b4fdd1615 validate timezone 2026-11-15 08:34:27 +02:00
Pete Matsyburka cd5cb9c082 zip size limit 2026-11-14 15:47:16 +02:00
Pete Matsyburka e5b9ee9502 skip unsafe keys 2026-11-14 15:46:25 +02:00
Pete Matsyburka 1cd3212736 drop turbo attrs 2026-11-14 15:45:34 +02:00
Pete Matsyburka 82a6910181 mcp variables error 2026-11-14 15:44:43 +02:00
Pete Matsyburka 353a0bc39c no blob cache 2026-11-14 15:43:30 +02:00
Pete Matsyburka dd790be5cb url escape 2026-11-14 14:49:39 +02:00
Pete Matsyburka 1b50efe511 add with order 2026-11-14 08:38:23 +02:00
Pete Matsyburka c364746f62 fix ci 2026-11-13 21:36:18 +02:00
Pete Matsyburka a44a2dcdaf update deps 2026-11-13 21:01:40 +02:00
Pete Matsyburka 0490ff4835 formula condition 2026-11-13 20:58:38 +02:00
Pete Matsyburka 06c44e8b2f shift enter value 2026-11-12 20:12:53 +02:00
Pete Matsyburka 4fb3e5bd47 add with order check 2026-11-12 14:58:14 +02:00
Pete Matsyburka 4702a68ad1 adjust variables schema 2026-11-11 14:33:46 +02:00
Pete Matsyburka 704bb2219e i18n 2026-11-10 19:36:37 +02:00
Pete Matsyburka a24e2532d5 fix i18n 2026-11-10 16:26:08 +02:00
Pete Matsyburka 0aaaac8066 adjust padding 2026-11-10 13:42:19 +02:00
Pete Matsyburka de08736b16 do not show steps if 2 fields 2026-11-10 13:14:48 +02:00
Pete Matsyburka a33dc9d657 add submission email variables 2026-11-10 11:43:40 +02:00
Pete Matsyburka e947c9269b 19k stars 2026-11-10 08:57:58 +02:00
Pete Matsyburka c45ad2f4e9 show submissions toggle 2026-11-09 19:00:29 +02:00
Alex Turchyn 5a00d4ad5c Merge from docusealco/wip 2026-11-09 15:41:58 +02:00
Pete Matsyburka 30704b59c2 optimize query 2026-11-09 12:06:04 +02:00
Pete Matsyburka d56c903596 update readme 2026-11-08 16:05:24 +02:00
Pete Matsyburka 5353e8fa23 install app message 2026-11-08 10:58:10 +02:00
Pete Matsyburka 038d780265 sms fail event 2026-11-08 10:27:40 +02:00
Pete Matsyburka f3a8100734 app os 2026-11-08 09:59:56 +02:00
Pete Matsyburka dbf446efe1 block search bots 2026-11-08 09:48:22 +02:00
Pete Matsyburka 621431166b update security.md 2026-11-07 10:00:28 +02:00
Pete Matsyburka 92cfd5624d validate email 2026-11-07 09:37:32 +02:00
Pete Matsyburka e39e84adfa update gem 2026-11-05 23:04:12 +02:00
Pete Matsyburka 1b63b16691 adjust filename 2026-11-05 01:15:16 +02:00
Pete Matsyburka 256d14eb94 update rails 2026-11-04 14:32:43 +02:00
Pete Matsyburka 49463d611c unify native modals 2026-11-04 12:36:47 +02:00
Alex Turchyn 4fec8db589 fix native turbo modal 2026-11-04 12:36:47 +02:00
Pete Matsyburka 0bc620fa90 cleanup routes 2026-11-04 00:26:50 +02:00
Pete Matsyburka c0c5ba48a0 block active storage routes 2026-11-04 00:05:39 +02:00
Alex Turchyn 8fe0293ebe update hero image 2026-11-02 20:50:32 +02:00
85 changed files with 455 additions and 241 deletions

No files matched your search

+1 -1
View File
@@ -104,7 +104,7 @@ jobs:
bundle install --jobs 4 --retry 4
yarn install
sudo apt-get update
sudo apt-get install libvips liblept5
sudo apt-get install libvips libleptonica6
- name: Run Brakeman
run: bundle exec brakeman -q --exit-on-warn
+67 -67
View File
@@ -3,29 +3,29 @@ GEM
specs:
action_text-trix (2.1.19)
railties
actioncable (8.1.4)
actionpack (= 8.1.4)
activesupport (= 8.1.4)
actioncable (8.1.4.1)
actionpack (= 8.1.4.1)
activesupport (= 8.1.4.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (8.1.4)
actionpack (= 8.1.4)
activejob (= 8.1.4)
activerecord (= 8.1.4)
activestorage (= 8.1.4)
activesupport (= 8.1.4)
actionmailbox (8.1.4.1)
actionpack (= 8.1.4.1)
activejob (= 8.1.4.1)
activerecord (= 8.1.4.1)
activestorage (= 8.1.4.1)
activesupport (= 8.1.4.1)
mail (>= 2.8.0)
actionmailer (8.1.4)
actionpack (= 8.1.4)
actionview (= 8.1.4)
activejob (= 8.1.4)
activesupport (= 8.1.4)
actionmailer (8.1.4.1)
actionpack (= 8.1.4.1)
actionview (= 8.1.4.1)
activejob (= 8.1.4.1)
activesupport (= 8.1.4.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (8.1.4)
actionview (= 8.1.4)
activesupport (= 8.1.4)
actionpack (8.1.4.1)
actionview (= 8.1.4.1)
activesupport (= 8.1.4.1)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
@@ -33,36 +33,36 @@ GEM
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (8.1.4)
actiontext (8.1.4.1)
action_text-trix (~> 2.1.15)
actionpack (= 8.1.4)
activerecord (= 8.1.4)
activestorage (= 8.1.4)
activesupport (= 8.1.4)
actionpack (= 8.1.4.1)
activerecord (= 8.1.4.1)
activestorage (= 8.1.4.1)
activesupport (= 8.1.4.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (8.1.4)
activesupport (= 8.1.4)
actionview (8.1.4.1)
activesupport (= 8.1.4.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (8.1.4)
activesupport (= 8.1.4)
rails-html-sanitizer (~> 1.6, >= 1.7.2)
activejob (8.1.4.1)
activesupport (= 8.1.4.1)
globalid (>= 0.3.6)
activemodel (8.1.4)
activesupport (= 8.1.4)
activerecord (8.1.4)
activemodel (= 8.1.4)
activesupport (= 8.1.4)
activemodel (8.1.4.1)
activesupport (= 8.1.4.1)
activerecord (8.1.4.1)
activemodel (= 8.1.4.1)
activesupport (= 8.1.4.1)
timeout (>= 0.4.0)
activestorage (8.1.4)
actionpack (= 8.1.4)
activejob (= 8.1.4)
activerecord (= 8.1.4)
activesupport (= 8.1.4)
activestorage (8.1.4.1)
actionpack (= 8.1.4.1)
activejob (= 8.1.4.1)
activerecord (= 8.1.4.1)
activesupport (= 8.1.4.1)
marcel (~> 1.0)
activesupport (8.1.4)
activesupport (8.1.4.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
@@ -75,7 +75,7 @@ GEM
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.9.0)
addressable (2.9.2)
public_suffix (>= 2.0.2, < 8.0)
annotaterb (4.22.0)
activerecord (>= 6.0.0)
@@ -293,9 +293,9 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.25.2)
loofah (2.25.3)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
nokogiri (>= 1.19.5)
mail (2.9.1)
logger
mini_mime (>= 0.1.1)
@@ -309,7 +309,7 @@ GEM
minitest (6.0.6)
drb (~> 2.0)
prism (~> 1.5)
msgpack (1.8.4)
msgpack (1.8.7)
multi_json (1.21.2)
net-http (0.9.1)
uri (>= 0.11.1)
@@ -323,15 +323,15 @@ GEM
net-smtp (0.5.2)
net-protocol
nio4r (2.7.5)
nokogiri (1.19.4-aarch64-linux-gnu)
nokogiri (1.19.7-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.19.4-aarch64-linux-musl)
nokogiri (1.19.7-aarch64-linux-musl)
racc (~> 1.4)
nokogiri (1.19.4-arm64-darwin)
nokogiri (1.19.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.19.4-x86_64-linux-gnu)
nokogiri (1.19.7-x86_64-linux-gnu)
racc (~> 1.4)
nokogiri (1.19.4-x86_64-linux-musl)
nokogiri (1.19.7-x86_64-linux-musl)
racc (~> 1.4)
numo-narray-alt (0.10.3)
onnxruntime (0.10.1-aarch64-linux)
@@ -373,7 +373,7 @@ GEM
puma (8.0.2)
nio4r (~> 2.0)
racc (1.8.1)
rack (3.2.7)
rack (3.2.8)
rack-proxy (0.7.7)
rack
rack-session (2.1.2)
@@ -383,33 +383,33 @@ GEM
rack (>= 1.3)
rackup (2.3.1)
rack (>= 3)
rails (8.1.4)
actioncable (= 8.1.4)
actionmailbox (= 8.1.4)
actionmailer (= 8.1.4)
actionpack (= 8.1.4)
actiontext (= 8.1.4)
actionview (= 8.1.4)
activejob (= 8.1.4)
activemodel (= 8.1.4)
activerecord (= 8.1.4)
activestorage (= 8.1.4)
activesupport (= 8.1.4)
rails (8.1.4.1)
actioncable (= 8.1.4.1)
actionmailbox (= 8.1.4.1)
actionmailer (= 8.1.4.1)
actionpack (= 8.1.4.1)
actiontext (= 8.1.4.1)
actionview (= 8.1.4.1)
activejob (= 8.1.4.1)
activemodel (= 8.1.4.1)
activerecord (= 8.1.4.1)
activestorage (= 8.1.4.1)
activesupport (= 8.1.4.1)
bundler (>= 1.15.0)
railties (= 8.1.4)
railties (= 8.1.4.1)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.7.1)
loofah (~> 2.25, >= 2.25.2)
rails-html-sanitizer (1.7.2)
loofah (~> 2.25, >= 2.25.3)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails-i18n (8.1.0)
i18n (>= 0.7, < 2)
railties (>= 8.0.0, < 9)
railties (8.1.4)
actionpack (= 8.1.4)
activesupport (= 8.1.4)
railties (8.1.4.1)
actionpack (= 8.1.4.1)
activesupport (= 8.1.4.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
@@ -535,7 +535,7 @@ GEM
thor (1.5.0)
timeout (0.6.1)
trailblazer-option (0.1.2)
trilogy (2.12.2)
trilogy (2.13.3)
bigdecimal
tsort (0.2.0)
turbo-rails (2.0.23)
+3 -2
View File
@@ -30,7 +30,7 @@ DocuSeal is an open source platform that provides secure and efficient digital d
<a href="https://docuseal.com/sign_up">☁️ Try in Cloud</a>
</h2>
[![Demo](https://github.com/docusealco/docuseal/assets/5418788/d8703ea3-361a-423f-8bfe-eff1bd9dbe14)](https://demo.docuseal.tech)
[![Demo](https://github.com/user-attachments/assets/8344a341-96cf-4df3-aaae-5458a21a65b3)](https://demo.docuseal.tech)
## Features
- PDF form fields builder (WYSIWYG)
@@ -41,10 +41,11 @@ DocuSeal is an open source platform that provides secure and efficient digital d
- Automatic PDF eSignature
- PDF signature verification
- User management
- Mobile-optimized
- Mobile-optimized signing
- 7 UI languages with signing available in 14 languages
- API and Webhooks for integrations
- Easy to deploy in minutes
- Mobile apps for [iOS](https://apps.apple.com/us/app/docuseal-e-signature/id6823564236) and [Android](https://play.google.com/store/apps/details?id=com.docuseal.app)
## Pro Features
- Company logo and white-label
+1
View File
@@ -10,6 +10,7 @@ Out of scope vulnerabilities:
- DNSSEC, CAA, CSP headers
- DNS or email security related
- SSRF
- DoS
- Rate Limiting
Note: We reserve the right to classify any reported vulnerability as out of scope for the bug bounty program.
+4 -2
View File
@@ -49,9 +49,11 @@ class AccountsController < ApplicationController
def destroy
authorize!(:manage, current_account)
removed_email = true_user.email.sub('@', '+removed@')
removed_email = true_user.email.sub('@', "+removed#{Time.current.to_i}@") if User.exists?(email: removed_email)
true_user.skip_reconfirmation!
true_user.update!(locked_at: Time.current, archived_at: Time.current,
email: true_user.email.sub('@', '+removed@'))
true_user.update!(locked_at: Time.current, archived_at: Time.current, email: removed_email)
true_user.account.update!(archived_at: Time.current)
# rubocop:disable-next Layout/LineLength
@@ -34,12 +34,19 @@ module Api
@record = attachment.record
@record = @record.record if @record.is_a?(ActiveStorage::Attachment)
if DetectBrowserDevice.search_bot?(request.user_agent)
Rollbar.warning("Search bot: #{@record.class.name} #{@record.id}") if defined?(Rollbar)
raise ActionController::RoutingError, 'Not Found'
end
authorization_check!(attachment, @record, exp)
no_store
if request.headers['Range'].present?
send_blob_byte_range_data blob, request.headers['Range']
else
http_cache_forever public: true do
response.headers['Accept-Ranges'] = 'bytes'
if request.head?
@@ -52,7 +59,6 @@ module Api
response.headers['Content-Length'] = blob.byte_size.to_s
end
end
end
private
@@ -22,7 +22,7 @@ module Api
render json: {
id: @submission.id,
documents: documents.map do |attachment|
{ name: attachment.filename.base, url: ActiveStorage::Blob.proxy_url(attachment.blob, expires_at:) }
{ name: FilenameUtils.basename(attachment.blob[:filename]), url: ActiveStorage::Blob.proxy_url(attachment.blob, expires_at:) }
end
}
end
+3 -1
View File
@@ -158,7 +158,9 @@ module Api
if attrs[:completed]
submitter.values = Submitters::SubmitValues.merge_default_values(submitter)
submitter.values = Submitters::SubmitValues.maybe_remove_condition_values(submitter)
submitter.values = Submitters::SubmitValues.maybe_remove_condition_values(
submitter, formula_values: Submitters::SubmitValues.build_formula_values(submitter)
)
formula_values = Submitters::SubmitValues.build_formula_values(submitter)
@@ -22,6 +22,7 @@ class ApplicationController < ActionController::Base
:true_ability,
:form_link_host,
:svg_icon,
:browser_os,
:turbo_native_ios?,
:turbo_native_android?
@@ -58,6 +59,10 @@ class ApplicationController < ActionController::Base
request.session[:impersonated_user_id] = user.uuid
end
def browser_os
@browser_os ||= DetectBrowserDevice.os(request.user_agent)
end
def pagy_auto(collection, **keyword_args)
if current_ability.can?(:manage, :countless)
pagy(:countless, collection, **keyword_args)
@@ -66,7 +66,9 @@ module Mcp
@template.save!
documents, = Templates::CreateAttachments.call(@template, { files: [file] }, extract_fields: true)
schema = documents.map { |doc| { attachment_uuid: doc.uuid, name: doc.filename.base } }
schema = documents.map do |doc|
{ attachment_uuid: doc.uuid, name: FilenameUtils.basename(doc.blob[:filename]) }
end
if @template.fields.blank?
@template.fields = Templates::ProcessDocument.normalize_attachment_fields(@template, documents)
@@ -78,6 +78,12 @@ module Mcp
return render_tool_error('Template has no fields') if @template.fields.blank?
if @template.variables_schema.present?
Rollbar.warning("MCP send variables template: #{@template.id}") if defined?(Rollbar)
return render_tool_error('Templates with variables are not supported')
end
submitters = (mcp_params['submitters'] || []).map do |s|
attrs = s.slice('email', 'name', 'role', 'phone').compact_blank
+10 -1
View File
@@ -92,8 +92,11 @@ class StartFormController < ApplicationController
blank_fields = required_fields.select { |key| submitter_params[key].blank? }
is_invalid_email = required_fields.include?('email') && submitter_params[:email].present? &&
!submitter_params[:email].match?(User::VALIDATE_EMAIL_REGEXP)
submitter =
if blank_fields.present?
if blank_fields.present? || is_invalid_email
Submitter.new(submitter_params)
else
Submitters::StartForm.find_or_initialize_submitter(
@@ -104,6 +107,12 @@ class StartFormController < ApplicationController
blank_fields.each { |key| submitter.errors.add(key.to_sym, :blank) }
if is_invalid_email
Rollbar.warning("Invalid start form email: #{submitter_params[:email]}") if defined?(Rollbar)
submitter.errors.add(:email, :invalid)
end
submitter
end
@@ -12,6 +12,7 @@ class SubmissionEventsController < ApplicationController
'send_2fa_sms' => '2fa',
'send_2fa_email' => '2fa',
'send_sms' => 'send',
'fail_sms' => 'alert_circle',
'phone_verified' => 'phone_check',
'email_verified' => 'email_check',
'click_sms' => 'hand_click',
@@ -26,6 +26,6 @@ class SubmissionsExportController < ApplicationController
end
def new
render layout: turbo_native_android? ? 'plain' : true
render layout: 'plain'
end
end
@@ -14,6 +14,6 @@ class SubmissionsFiltersController < ApplicationController
def show
return head :not_found unless ALLOWED_NAMES.include?(params[:name])
render params[:name], layout: turbo_native_android? ? 'plain' : true
render params[:name], layout: 'plain'
end
end
+15 -1
View File
@@ -8,6 +8,7 @@ class SubmitFormController < ApplicationController
skip_authorization_check
before_action :load_submitter, only: %i[show update completed]
before_action :maybe_render_not_found_for_search_bot, only: %i[show completed]
before_action :maybe_redirect_delegated, only: %i[show completed]
before_action :maybe_render_locked_page, only: :show
before_action :maybe_require_link_2fa, only: %i[show]
@@ -50,7 +51,7 @@ class SubmitFormController < ApplicationController
end
def update
unless Submitters::AuthorizedForForm.call(@submitter, current_user, request)
unless Submitters::AuthorizedForForm.call(@submitter, current_user, request, with_order: with_order(@submitter))
return render json: { error: I18n.t('verification_required_refresh_the_page_and_pass_2fa') },
status: :unprocessable_content
end
@@ -111,6 +112,14 @@ class SubmitFormController < ApplicationController
private
def maybe_render_not_found_for_search_bot
return unless DetectBrowserDevice.search_bot?(request.user_agent)
Rollbar.warning("Search bot: submitter #{@submitter&.id}") if defined?(Rollbar)
raise ActionController::RoutingError, I18n.t('not_found')
end
def maybe_require_link_2fa
return if Submitters::AuthorizedForForm.pass_link_2fa?(@submitter, current_user, request)
@@ -145,6 +154,11 @@ class SubmitFormController < ApplicationController
.preload(:blob).index_by(&:uuid)
end
def with_order(submitter)
params[:completed] == 'true' && submitter.present? &&
submitter.submission.template&.preferences&.dig('submitters_order') == 'preserved'
end
def lang
params[:lang].presence
end
@@ -16,7 +16,8 @@ class SubmitFormDeclineController < ApplicationController
@submitter.viewer? ||
!Submitters::AuthorizedForForm.call(@submitter,
current_user,
request)
request,
with_order: true)
ApplicationRecord.transaction do
@submitter.update!(declined_at: Time.current, values: @submitter.preferences['default_values'] || {})
@@ -49,7 +49,7 @@ class SubmitFormInviteController < ApplicationController
!submitter.submission.expired? &&
!submitter.submission.template&.archived_at? &&
!submitter.viewer? &&
Submitters::AuthorizedForForm.call(submitter, current_user, request)
Submitters::AuthorizedForForm.call(submitter, current_user, request, with_order: true)
end
def filter_invite_submitters(submitter, key = 'invite_by_uuid')
@@ -31,7 +31,7 @@ class TemplateDocumentsController < ApplicationController
documents, = Templates::CreateAttachments.call(@template, params, extract_fields: true)
schema = documents.map do |doc|
{ attachment_uuid: doc.uuid, name: doc.filename.base }
{ attachment_uuid: doc.uuid, name: FilenameUtils.basename(doc.blob[:filename]) }
end
render json: {
@@ -42,7 +42,7 @@ class TemplateFoldersController < ApplicationController
end
def edit
render layout: turbo_native_android? ? 'plain' : true
render layout: 'plain'
end
def update
@@ -8,7 +8,7 @@ class TemplatesCloneController < ApplicationController
@template = Template.new(name: "#{@base_template.name} (#{I18n.t('clone')})")
render layout: turbo_native_android? ? 'plain' : true
render layout: 'plain'
end
def create
@@ -67,7 +67,7 @@ class TemplatesDebugController < ApplicationController
schema = documents.map do |doc|
{
attachment_uuid: doc.uuid,
name: doc.filename.base,
name: FilenameUtils.basename(doc.blob[:filename]),
dynamic: dynamic_documents.find { |e| e.uuid == doc.uuid }.present?
}
end
@@ -4,7 +4,7 @@ class TemplatesFoldersController < ApplicationController
load_and_authorize_resource :template
def edit
render layout: turbo_native_android? ? 'plain' : true
render layout: 'plain'
end
def update
@@ -17,7 +17,7 @@ class TemplatesUploadsController < ApplicationController
save_template!(@template, url_params)
documents, = Templates::CreateAttachments.call(@template, url_params || params, extract_fields: true)
schema = documents.map { |doc| { attachment_uuid: doc.uuid, name: doc.filename.base } }
schema = documents.map { |doc| { attachment_uuid: doc.uuid, name: FilenameUtils.basename(doc.blob[:filename]) } }
if @template.fields.blank?
@template.fields = Templates::ProcessDocument.normalize_attachment_fields(@template, documents)
+1 -1
View File
@@ -5,7 +5,7 @@ class UserInitialsController < ApplicationController
authorize_resource :user_config
def edit
render layout: turbo_native_android? ? 'plain' : true
render layout: 'plain'
end
def update
@@ -5,7 +5,7 @@ class UserSignaturesController < ApplicationController
authorize_resource :user_config
def edit
render layout: turbo_native_android? ? 'plain' : true
render layout: 'plain'
end
def update
+2 -2
View File
@@ -32,11 +32,11 @@ class UsersController < ApplicationController
end
def new
render layout: turbo_native_android? ? 'plain' : true
render layout: turbo_native_app? ? 'plain' : true
end
def edit
render layout: turbo_native_android? ? 'plain' : true
render layout: turbo_native_app? ? 'plain' : true
end
def create
@@ -13,7 +13,9 @@ class WebhookSettingsController < ApplicationController
else
@webhook_events = @webhook_url.webhook_events
@webhook_events = @webhook_events.where(status: params[:status]) if %w[success error].include?(params[:status])
if %w[success error].include?(params[:status])
@webhook_events = @webhook_events.where(WebhookEvent.arel_table[:status].eq(params[:status]))
end
@pagy, @webhook_events = pagy(:countless, @webhook_events.order(id: :desc))
@@ -24,7 +26,9 @@ class WebhookSettingsController < ApplicationController
def show
@webhook_events = @webhook_url.webhook_events
@webhook_events = @webhook_events.where(status: params[:status]) if %w[success error].include?(params[:status])
if %w[success error].include?(params[:status])
@webhook_events = @webhook_events.where(WebhookEvent.arel_table[:status].eq(params[:status]))
end
@pagy, @webhook_events = pagy(:countless, @webhook_events.order(id: :desc))
end
+49 -12
View File
@@ -660,7 +660,7 @@
:native-platform="nativePlatform"
/>
<nav
v-if="stepFields.length < 80"
v-if="stepFields.length > 2 && stepFields.length < 80"
:aria-label="t('form_progress')"
:aria-hidden="isCompleted"
class="flex justify-center mt-3 sm:mt-4 mb-0 sm:mb-1 select-none"
@@ -684,7 +684,7 @@
</nav>
<div
v-else
class="mt-5"
class="mt-3"
/>
</div>
</div>
@@ -1093,7 +1093,8 @@ export default {
submittedValues: {},
isFormStarted: false,
recalculateButtonDisabledKey: '',
isAccessibilityMode: false
isAccessibilityMode: false,
isMathLoaded: false
}
},
computed: {
@@ -1197,6 +1198,24 @@ export default {
return acc
}, {})
},
formulaFieldsUuidIndex () {
return this.fields.reduce((acc, f) => {
if (f.preferences?.formula && f.type !== 'payment') {
acc[f.uuid] = f
}
return acc
}, {})
},
readonlyValues () {
return this.fields.reduce((acc, f) => {
if (f.readonly) {
acc[f.uuid] = isEmpty(this.values[f.uuid]) ? f.default_value : this.values[f.uuid]
}
return acc
}, {})
},
previousInitialsValue () {
if (this.reuseSignature !== false) {
const initialsField = this.fields.findLast
@@ -1449,6 +1468,16 @@ export default {
})
},
methods: {
normalizeFormula: FormulaFieldAreas.methods.normalizeFormula,
calculateFormula: FormulaFieldAreas.methods.calculateFormula,
dateFormulaValue: FormulaFieldAreas.methods.dateFormulaValue,
evalTextFormula: FormulaFieldAreas.methods.evalTextFormula,
loadCalculator () {
this.calculatorPromise ||= import('./calculator').then(({ Calculator }) => {
this.math = new Calculator()
this.isMathLoaded = true
})
},
t (key) {
return this.i18n[key] || i18n[this.language?.toLowerCase()]?.[key] || i18n[this.browserLanguage]?.[key] || i18n.en[key] || key
},
@@ -1497,17 +1526,25 @@ export default {
}
const defaultValue = !field || isEmpty(field.default_value) ? null : field.default_value
const isFormulaField = !!field?.preferences?.formula && field.type !== 'payment'
if (isFormulaField && !this.isMathLoaded) {
this.loadCalculator()
}
const formulaValue = isFormulaField && this.isMathLoaded
? (field.type === 'text' ? this.evalTextFormula(field) : this.calculateFormula(field))
: null
const fieldValue = formulaValue ?? this.values[condition.field_uuid] ?? defaultValue
if (['empty', 'unchecked'].includes(condition.action)) {
return isEmpty(this.values[condition.field_uuid] ?? defaultValue)
return isEmpty(fieldValue)
} else if (['not_empty', 'checked'].includes(condition.action)) {
return !isEmpty(this.values[condition.field_uuid] ?? defaultValue)
return !isEmpty(fieldValue)
} else if (field?.type === 'number' && ['equal', 'not_equal', 'greater_than', 'less_than'].includes(condition.action)) {
const value = this.values[condition.field_uuid] ?? defaultValue
if (isEmpty(fieldValue) || isEmpty(condition.value)) return false
if (isEmpty(value) || isEmpty(condition.value)) return false
const actual = parseFloat(value)
const actual = parseFloat(fieldValue)
const expected = parseFloat(condition.value)
if (Number.isNaN(actual) || Number.isNaN(expected)) return false
@@ -1523,21 +1560,21 @@ export default {
const option = field.options.find((o) => o.uuid === condition.value)
if (option) {
const values = [this.values[condition.field_uuid] ?? defaultValue].flat()
const values = [fieldValue].flat()
return values.includes(this.optionValue(option, field.options.indexOf(option)))
} else {
return false
}
} else {
return [this.values[condition.field_uuid] ?? defaultValue].flat().includes(condition.value)
return [fieldValue].flat().includes(condition.value)
}
} else if (['not_equal', 'does_not_contain'].includes(condition.action) && field) {
if (field.options) {
const option = field.options.find((o) => o.uuid === condition.value)
if (option) {
const values = [this.values[condition.field_uuid] ?? defaultValue].flat()
const values = [fieldValue].flat()
return !values.includes(this.optionValue(option, field.options.indexOf(option)))
} else {
+1 -1
View File
@@ -557,7 +557,7 @@ export default {
}, {})
try {
const resp = await fetch(this.baseUrl + `/s/${this.submitterSlug}/kba/${this.field.uuid}`, {
const resp = await fetch(this.baseUrl + `/s/${this.submitterSlug}/kba/${encodeURIComponent(this.field.uuid)}`, {
method: 'PUT',
body: JSON.stringify({
token: this.token,
@@ -253,7 +253,7 @@ export default {
},
async submit () {
if (this.sessionId) {
return fetch(this.baseUrl + this.paymentEndpoint + '/' + this.sessionId, {
return fetch(this.baseUrl + this.paymentEndpoint + '/' + encodeURIComponent(this.sessionId), {
method: 'PUT',
...this.fetchOptions,
headers: { 'Content-Type': 'application/json', ...this.fetchOptions.headers }
@@ -162,7 +162,7 @@ export default {
},
methods: {
start () {
return fetch(this.baseUrl + `/s/${this.submitterSlug}/identity_verification/${this.field.uuid}`, {
return fetch(this.baseUrl + `/s/${this.submitterSlug}/identity_verification/${encodeURIComponent(this.field.uuid)}`, {
method: 'PUT',
body: JSON.stringify({
redirect_url: document.location.href
+3 -2
View File
@@ -700,11 +700,12 @@ export default {
this.save()
},
onDefaultValueEnter (e) {
if (this.field.type !== 'heading') {
if (this.field.type === 'heading') return
if (e.shiftKey && this.field.type === 'text') return
e.preventDefault()
this.$refs.defaultValue.blur()
}
},
resize (e) {
if (e.target.id === 'mask') {
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')"
/>
<div :class="inline ? (nativePlatform === 'android' ? 'px-4 pt-1.5 pb-6' : 'px-4 pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 w-full max-w-xl'">
<div :class="inline ? (nativePlatform === 'android' ? 'pt-1.5 pb-6' : 'pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 w-full max-w-xl'" :style="inline ? { paddingInline: '18px' } : null">
<div
v-if="!inline"
class="flex justify-between items-center border-b pb-2 mb-2 font-medium"
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')"
/>
<div :class="inline ? (nativePlatform === 'android' ? 'px-4 pt-1.5 pb-6' : 'px-4 pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'">
<div :class="inline ? (nativePlatform === 'android' ? 'pt-1.5 pb-6' : 'pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'" :style="inline ? { paddingInline: '18px' } : null">
<div
v-if="!inline"
class="flex justify-between items-center border-b pb-2 mb-2 font-medium"
@@ -63,7 +63,7 @@
>
<div
class="flex-1 overflow-y-auto overflow-x-hidden px-4 md:px-6 py-4 space-y-4"
:style="inline && nativePlatform === 'ios' ? { paddingTop: '86px' } : null"
:style="inline ? { paddingInline: '18px', ...(nativePlatform === 'ios' ? { paddingTop: '86px' } : {}) } : null"
>
<div
v-for="(doc, docIndex) in layout"
@@ -178,7 +178,7 @@ const SAFE_URL_REGEXP = /^(?:https?:\/\/|data:image\/|blob:|mailto:|tel:|\{|#)/i
function isSafeAttr (name, value) {
const lowerName = name.toLowerCase()
if (lowerName.startsWith('on') || DROP_ATTRS.includes(lowerName)) return false
if (lowerName.startsWith('on') || lowerName.startsWith('data-turbo') || DROP_ATTRS.includes(lowerName)) return false
if ((lowerName === 'href' || lowerName === 'src') && !SAFE_URL_REGEXP.test(value.trim())) return false
return true
@@ -432,8 +432,25 @@ function buildOperators (tags) {
return operators
}
const UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype']
function hasBlankKey (keyString) {
return !keyString || keyString.split('.').some((key) => !key.trim())
return !keyString || keyString.split('.').some((key) => !key.trim() || UNSAFE_KEYS.includes(key.trim()))
}
function digProperties (properties, keys) {
return keys.reduce((current, key) => {
if (!current[key]) current[key] = { type: 'object', properties: {} }
const item = current[key].type === 'array' ? current[key].items : current[key]
if (!item.properties) {
item.type = 'object'
item.properties = {}
}
return item.properties
}, properties)
}
function assignNestedSchema (propertiesHash, parentProperties, keyString, value) {
@@ -442,23 +459,7 @@ function assignNestedSchema (propertiesHash, parentProperties, keyString, value)
const keys = keyString.split('.')
const lastKey = keys.pop()
let currentLevel = null
if (keys.length > 0 && parentProperties[keys[0]]) {
currentLevel = keys.reduce((current, key) => {
if (!current[key]) current[key] = { type: 'object', properties: {} }
return current[key].properties
}, parentProperties)
}
if (!currentLevel) {
currentLevel = keys.reduce((current, key) => {
if (!current[key]) current[key] = { type: 'object', properties: {} }
return current[key].properties
}, propertiesHash)
}
const currentLevel = digProperties(keys.length > 0 && parentProperties[keys[0]] ? parentProperties : propertiesHash, keys)
currentLevel[lastKey] = value
}
@@ -469,23 +470,7 @@ function assignNestedSchemaWithPriority (propertiesHash, parentProperties, keySt
const keys = keyString.split('.')
const lastKey = keys.pop()
let currentLevel = null
if (keys.length > 0 && parentProperties[keys[0]]) {
currentLevel = keys.reduce((current, key) => {
if (!current[key]) current[key] = { type: 'object', properties: {} }
return current[key].properties
}, parentProperties)
}
if (!currentLevel) {
currentLevel = keys.reduce((current, key) => {
if (!current[key]) current[key] = { type: 'object', properties: {} }
return current[key].properties
}, propertiesHash)
}
const currentLevel = digProperties(keys.length > 0 && parentProperties[keys[0]] ? parentProperties : propertiesHash, keys)
const existing = currentLevel[lastKey]
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')"
/>
<div :class="inline ? (nativePlatform === 'android' ? 'px-4 pt-1.5 pb-6' : 'px-4 pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'">
<div :class="inline ? (nativePlatform === 'android' ? 'pt-1.5 pb-6' : 'pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'" :style="inline ? { paddingInline: '18px' } : null">
<div
v-if="!inline"
class="flex justify-between items-center border-b pb-2 mb-2 font-medium"
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')"
/>
<div :class="inline ? (nativePlatform === 'android' ? 'px-4 pt-1.5 pb-6' : 'px-4 pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'">
<div :class="inline ? (nativePlatform === 'android' ? 'pt-1.5 pb-6' : 'pt-3 pb-6') : 'modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl'" :style="inline ? { paddingInline: '18px' } : null">
<div
v-if="!inline"
class="flex justify-between items-center border-b pb-2 mb-2 font-medium"
@@ -5,7 +5,7 @@
class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')"
/>
<div :class="inline ? (nativePlatform === 'android' ? 'px-4 pt-1.5 pb-6' : 'px-4 pt-3 pb-6') : 'modal-box pt-4 pb-6 mt-20 w-full'">
<div :class="inline ? (nativePlatform === 'android' ? 'pt-1.5 pb-6' : 'pt-3 pb-6') : 'modal-box pt-4 pb-6 mt-20 w-full'" :style="inline ? { paddingInline: '18px' } : null">
<div
v-if="!inline"
class="flex justify-between items-center border-b pb-2 mb-3 font-medium"
+1
View File
@@ -45,6 +45,7 @@ class SubmissionEvent < ApplicationRecord
send_email: 'send_email',
bounce_email: 'bounce_email',
complaint_email: 'complaint_email',
fail_sms: 'fail_sms',
send_reminder_email: 'send_reminder_email',
send_sms: 'send_sms',
send_2fa_sms: 'send_2fa_sms',
+3 -1
View File
@@ -56,6 +56,8 @@ class User < ApplicationRecord
FULL_EMAIL_REGEXP =
/\A[a-z0-9][.']?(?:(?:[a-z0-9_-]+[.+'])*[a-z0-9_-]+)*@(?:[a-z0-9]+[.-])*[a-z0-9]+\.[a-z]{2,}\z/i
VALIDATE_EMAIL_REGEXP = /\A[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\z/
has_one_attached :signature
has_one_attached :initials
@@ -78,7 +80,7 @@ class User < ApplicationRecord
scope :archived, -> { where.not(archived_at: nil) }
scope :admins, -> { where(role: ADMIN_ROLE) }
validates :email, format: { with: /\A[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\z/ }
validates :email, format: { with: VALIDATE_EMAIL_REGEXP }
def access_token
super || build_access_token.tap(&:save!)
-2
View File
@@ -28,9 +28,7 @@
<open-modal src="<%= url_for(**url_params, params: modal_uri.query_values) %>"></open-modal>
<% end %>
<% end %>
<% unless content_for?(:native_modal) %>
<turbo-frame id="modal"></turbo-frame>
<% end %>
<turbo-frame id="drawer"></turbo-frame>
<%= render turbo_native_app? ? 'shared/native_navbar' : 'shared/navbar' %>
<main class="max-w-6xl mx-auto px-4 md:px-2 mb-8">
+1 -1
View File
@@ -1,6 +1,6 @@
<a target="_blank" href="<%= Docuseal::GITHUB_URL %>" rel="noopener noreferrer nofollow" class="relative flex items-center rounded-full px-2 py-0.5 text-xs leading-4 mt-1 text-base-content border border-base-300 tooltip tooltip-bottom tooltip-no-touch" data-tip="Give a star on GitHub">
<span class="flex items-center justify-between space-x-0.5 font-medium">
<%= svg_icon('start', class: 'h-3 w-3') %>
<span>18k</span>
<span>19k</span>
</span>
</a>
@@ -0,0 +1,13 @@
<div id="mobile_app_alert" class="px-4 md:px-2 py-2 text-center bg-yellow-300 text-base-content w-full flex items-center justify-center gap-2">
<span>
<%= t('get_the_docuseal_app_for_a_better_mobile_experience') %>
<%= link_to t('install_app'), browser_os == 'ios' ? Docuseal::APP_STORE_URL : Docuseal::GOOGLE_PLAY_URL, class: 'link font-medium', target: '_blank', rel: 'noopener noreferrer nofollow' %>
</span>
<toggle-cookies data-key="mobile_app_alert" data-value="hidden" class="flex">
<remove-on-event data-selector-id="mobile_app_alert" class="flex">
<button type="button" class="btn btn-ghost btn-circle btn-sm" aria-label="<%= t('close') %>">
<%= svg_icon('x', class: 'w-5 h-5') %>
</button>
</remove-on-event>
</toggle-cookies>
</div>
+1
View File
@@ -1,4 +1,5 @@
<%= render 'shared/navbar_warning' %>
<%= render 'shared/mobile_app_alert' if signed_in? && cookies[:mobile_app_alert].blank? && (browser_os == 'ios' || browser_os == 'android') %>
<nav class="max-w-6xl mb-4 mx-auto px-4 md:px-2 py-3 flex items-center justify-between">
<div class="flex items-center space-x-4">
<a href="<%= root_path %>" class="text-2xl font-bold items-center flex space-x-2">
+2 -2
View File
@@ -1,7 +1,7 @@
<% if turbo_native_app? && !turbo_frame_request? %>
<% if turbo_native_app? %>
<% content_for(:native_title, local_assigns[:title]) if local_assigns[:title] %>
<turbo-frame id="drawer">
<native-modal class="block w-full" data-close-after-submit="<%= local_assigns.key?(:close_after_submit) ? local_assigns[:close_after_submit] : true %>">
<native-modal class="block max-w-lg mx-auto <%= turbo_native_android? ? 'pb-4' : 'pb-6' %>" data-close-after-submit="<%= local_assigns.key?(:close_after_submit) ? local_assigns[:close_after_submit] : true %>">
<%= yield %>
</native-modal>
</turbo-frame>
+1 -2
View File
@@ -1,5 +1,4 @@
<% if turbo_native_ios? || (turbo_native_app? && !turbo_frame_request?) %>
<% content_for(:native_modal, 'true') %>
<% if turbo_native_app? %>
<% content_for(:native_title, local_assigns[:title]) if local_assigns[:title] %>
<turbo-frame id="modal">
<native-modal class="block max-w-lg mx-auto <%= turbo_native_android? ? 'pb-4' : 'pb-6' %>" data-close-after-submit="<%= local_assigns.key?(:close_after_submit) ? local_assigns[:close_after_submit] : true %>">
+8 -6
View File
@@ -1,4 +1,11 @@
<% if turbo_frame_request? %>
<% if turbo_native_app? %>
<% content_for(:native_title, local_assigns[:title]) if local_assigns[:title] %>
<turbo-frame id="modal">
<native-modal class="block max-w-lg mx-auto <%= turbo_native_android? ? 'pb-4' : 'pb-6' %>" data-close-after-submit="<%= local_assigns.key?(:close_after_submit) ? local_assigns[:close_after_submit] : true %>">
<%= yield %>
</native-modal>
</turbo-frame>
<% elsif turbo_frame_request? %>
<turbo-frame id="modal">
<turbo-modal class="modal modal-open items-start !animate-none overflow-y-auto !justify-normal md:!justify-center" data-close-after-submit="<%= local_assigns.key?(:close_after_submit) ? local_assigns[:close_after_submit] : true %>">
<div class="absolute top-0 bottom-0 right-0 left-0" data-action="click:turbo-modal#close"></div>
@@ -17,11 +24,6 @@
</div>
</turbo-modal>
</turbo-frame>
<% elsif turbo_native_app? %>
<% content_for(:native_title, local_assigns[:title]) if local_assigns[:title] %>
<native-modal class="block w-full [&>.px-5]:px-4" data-close-after-submit="<%= local_assigns.key?(:close_after_submit) ? local_assigns[:close_after_submit] : true %>">
<%= yield %>
</native-modal>
<% else %>
<% if local_assigns[:title] %>
<div class="sticky top-0 z-10 flex justify-between bg-base-100 py-2 px-5 items-center border-b pb-2 font-medium">
+4 -1
View File
@@ -50,8 +50,11 @@
<% elsif event.event_type == 'delegate_form' %>
<% delegate_from = event.data['old_email'].presence || versions.rfind { |v| v.created_at <= event.event_timestamp }&.then { |v| v.name || v.phone } %>
<%= t('submission_event_names.delegate_form_by_html', from: delegate_from, to: event.data['email']) %>
<% elsif event.event_type.include?('send_') %>
<% elsif event.event_type.include?('send_') || event.event_type == 'fail_sms' %>
<%= t("submission_event_names.#{event.event_type}_to_html", submitter_name:) %>
<% if event.data['error_code'].present? %>
<span class="text-base-content/60">(<%= t('error') %>: <%= event.data['error_code'] %>)</span>
<% end %>
<% elsif event.event_type.start_with?('bounce_') || event.event_type.start_with?('complaint_') %>
<%= t("submission_event_names.#{event.event_type}_html", submitter_name:) %>
<% else %>
+1 -1
View File
@@ -26,7 +26,7 @@
</div>
</toggle-visible>
<% end %>
<div class="px-5 mb-5 mt-5">
<div class="px-5 mt-5 <%= 'mb-5' unless turbo_native_app? %>" style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<% unless only_detailed %>
<div id="email" class="<%= 'hidden' if default_tab != 'email' %>">
<%= render 'email_form', template: @template, variables_form:, can_send_emails:, viewer_submitter_uuids: %>
+2 -2
View File
@@ -134,9 +134,9 @@
<% document = @submission.schema_documents.find { |a| item['attachment_uuid'] == a.uuid } %>
<% if document.preview_images.first %>
<scroll-to data-selector-id="page-<%= document.uuid %>-0" class="block cursor-pointer">
<img src="<%= (document.preview_images.find { |e| e.filename.base.to_i.zero? } || document.preview_images.first).url(time: service_url_time) %>" width="<%= document.preview_images.first.metadata['width'] %>" height="<%= document.preview_images.first.metadata['height'] %>" class="rounded border" loading="lazy" alt="<%= item['name'].presence || document.filename.base %>">
<img src="<%= (document.preview_images.find { |e| e.filename.base.to_i.zero? } || document.preview_images.first).url(time: service_url_time) %>" width="<%= document.preview_images.first.metadata['width'] %>" height="<%= document.preview_images.first.metadata['height'] %>" class="rounded border" loading="lazy" alt="<%= item['name'].presence || FilenameUtils.basename(document.blob[:filename]) %>">
<div class="pb-2 pt-1.5 text-center" dir="auto">
<%= item['name'].presence || document.filename.base %>
<%= item['name'].presence || FilenameUtils.basename(document.blob[:filename]) %>
</div>
</scroll-to>
<% end %>
+1 -1
View File
@@ -1,6 +1,6 @@
<% filter_params = params.permit(:q, :archived, *Submissions::Filter::ALLOWED_PARAMS) %>
<%= render 'shared/turbo_modal', title: t('export'), close_after_submit: false do %>
<div class="space-y-2 <%= 'mt-1.5 px-4' if turbo_native_android? %>">
<div class="space-y-2 <%= 'mt-1.5' if turbo_native_android? %>" style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<%= button_to template_submissions_export_index_path(@template), params: { format: :xlsx, **filter_params }, method: :get, data: { turbo_frame: :_top } do %>
<div class="flex items-center p-4 text-left rounded-2xl border border-neutral-300 hover:cursor-pointer hover:bg-neutral hover:text-gray-300">
<div class="enabled">
@@ -1,7 +1,7 @@
<% path_uri = Addressable::URI.parse(params[:path].to_s) %>
<% path = url_for(**Rails.application.routes.recognize_path(path_uri.path, method: :get)) %>
<%= render 'shared/turbo_modal', title: local_assigns[:title] do %>
<%= form_for '', url: path, method: :get, data: { turbo_frame: :_top }, html: { autocomplete: :off, class: ('px-4' if turbo_native_android?) } do |f| %>
<%= form_for '', url: path, method: :get, data: { turbo_frame: :_top }, html: { autocomplete: :off, style: ('padding-inline: 18px' if turbo_native_app?) } do |f| %>
<%= hidden_field_tag :q, params[:q] if params[:q].present? %>
<%= hidden_field_tag :scope, params[:scope] if params[:scope].present? %>
<%= hidden_field_tag :archived, params[:archived] if params[:archived].present? %>
+1 -1
View File
@@ -1,5 +1,5 @@
<%= render 'shared/turbo_modal_large', title: t('edit_recipient') do %>
<div class="px-5 mb-5 mt-4">
<div class="px-5 mt-4 <%= 'mb-5' unless turbo_native_app? %>" style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<%= form_for '', url: submitter_path(@submitter), method: :patch, html: { autocomplete: 'off' }, data: { turbo_frame: :_top } do |f| %>
<div class="mb-2">
<submitter-item class="form-control">
+1 -1
View File
@@ -1,5 +1,5 @@
<%= render 'shared/turbo_modal', title: t('rename_folder') do %>
<%= form_for @template_folder, url: folder_path(@template_folder), data: { turbo_frame: :_top }, html: { autocomplete: :off, class: ('px-4' if turbo_native_android?) } do |f| %>
<%= form_for @template_folder, url: folder_path(@template_folder), data: { turbo_frame: :_top }, html: { autocomplete: :off, style: ('padding-inline: 18px' if turbo_native_app?) } do |f| %>
<div class="form-control <%= turbo_native_android? ? 'mt-1.5 mb-6' : 'my-6' %>">
<%= f.text_field :name, required: true, placeholder: "#{t('folder_name')}...", class: 'base-input w-full', autofocus: true, dir: 'auto' %>
</div>
+1 -1
View File
@@ -1,5 +1,5 @@
<%= render 'shared/turbo_modal', title: @base_template ? t('clone_template') : t('new_document_template') do %>
<div class="<%= 'px-4' if turbo_native_app? %>">
<div style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<%= render 'templates/file_form' %>
</div>
<% end %>
+1 -1
View File
@@ -1,4 +1,4 @@
<%= form_for @template, url: template_clone_index_path(@base_template), data: { turbo_frame: :_top }, html: { autocomplete: :off, class: ('px-4' if turbo_native_android?) } do |f| %>
<%= form_for @template, url: template_clone_index_path(@base_template), data: { turbo_frame: :_top }, html: { autocomplete: :off, style: ('padding-inline: 18px' if turbo_native_app?) } do |f| %>
<% accounts = Account.accessible_by(true_ability).where.not(id: true_user.account.testing_accounts).where(User.where(User.arel_table[:account_id].eq(Account.arel_table[:id])).arel.exists).active %>
<% with_accounts = (can?(:manage, :tenants) || true_user != current_user) && accounts.where.not(id: current_account.id).exists? %>
<% if with_accounts %>
+1 -1
View File
@@ -14,7 +14,7 @@
<% end %>
<%= render 'templates/dashboard_folder_dropzone', style: 'height: 114px' %>
<div class="flex items-center flex-grow min-w-0 max-md:group-has-[search-input:focus-within]/header:hidden <%= 'max-md:hidden' if params[:q].present? %>">
<% if has_archived || @pagy.count.nil? || @pagy.count > 0 || @template_folders.present? %>
<% if current_account.created_at < 1.day.ago || has_archived || @pagy.count.nil? || @pagy.count > 0 || @template_folders.present? %>
<div class="mr-2">
<%= render 'dashboard/toggle_view', selected: 'templates' %>
</div>
+2 -2
View File
@@ -1,7 +1,7 @@
<% with_subfolder = @template.folder.name != TemplateFolder::DEFAULT_NAME && params[:subfolder] != 'false' %>
<%= render 'shared/turbo_modal', title: t('move_into_folder') do %>
<% if with_subfolder %>
<%= form_for '', url: template_folder_path(@template), method: :put, data: { turbo_frame: :_top }, html: { id: 'subfolder_form', autocomplete: :off, class: ('px-4' if turbo_native_android?) } do |f| %>
<%= form_for '', url: template_folder_path(@template), method: :put, data: { turbo_frame: :_top }, html: { id: 'subfolder_form', autocomplete: :off, style: ('padding-inline: 18px' if turbo_native_app?) } do |f| %>
<%= f.hidden_field :parent_name, value: @template.folder.parent_folder&.name || @template.folder.name %>
<toggle-visible data-element-ids="<%= %w[folder_form subfolder_form].to_json %>" class="block relative" data-focus-id="name">
<div class="flex items-center justify-between mb-2.5">
@@ -25,7 +25,7 @@
</div>
<% end %>
<% end %>
<%= form_for '', url: template_folder_path(@template), method: :put, data: { turbo_frame: :_top }, html: { id: 'folder_form', autocomplete: :off, class: "#{turbo_native_android? ? 'mt-1.5 px-4' : 'mt-6'} #{'hidden' if with_subfolder}" } do |f| %>
<%= form_for '', url: template_folder_path(@template), method: :put, data: { turbo_frame: :_top }, html: { id: 'folder_form', autocomplete: :off, class: "#{turbo_native_android? ? 'mt-1.5' : 'mt-6'} #{'hidden' if with_subfolder}", style: ('padding-inline: 18px' if turbo_native_app?) } do |f| %>
<div class="form-control mb-6">
<folder-autocomplete class="block" data-submit-on-select="true" data-enabled="<%= params[:autocomplete] != 'false' %>">
<%= f.text_field :name, required: true, placeholder: "#{t('new_folder_name')}...", class: 'base-input w-full', autofocus: true %>
@@ -18,7 +18,7 @@
</div>
</toggle-visible>
<% end %>
<div id="general" class="px-5 mb-4">
<div id="general" class="px-5 mb-4" style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<%= render 'access' %>
<%= form_for @template, url: template_preferences_path(@template), method: :post, html: { autocomplete: 'off', class: 'mt-2' }, data: { close_on_submit: false } do |f| %>
<toggle-on-submit data-element-id="bcc_saved_alert"></toggle-on-submit>
@@ -146,14 +146,14 @@
<%= render 'templates_code_modal/preferences', class: 'pt-2' %>
</div>
<% if show_recipients %>
<div id="recipients" class="hidden mt-2 mb-4 px-5 pt-1 pb-2">
<div id="recipients" class="hidden mt-2 mb-4 px-5 pt-1 pb-2" style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<native-event data-on="submit" data-name="template-builder:update" class="block">
<%= render 'recipients', template: @template %>
</native-event>
</div>
<% end %>
<% if show_api %>
<div id="api" class="hidden mt-2 mb-4 px-5">
<div id="api" class="hidden mt-2 mb-4 px-5" style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<div>
<label class="text-sm font-semibold" for="template_id">
<%= t('template_id') %>
+1 -1
View File
@@ -1,7 +1,7 @@
<% multiple_submitters = @template.submitters.to_a.length > 1 %>
<% enough_defined_submitters = Templates.filter_undefined_submitters(@template.submitters).size < 2 %>
<%= render 'shared/turbo_modal_large', title: t('share_link') do %>
<div class="<%= 'mt-2' unless turbo_native_android? %> mb-4 px-5">
<div class="<%= 'mt-2' unless turbo_native_android? %> <%= 'mb-4' unless turbo_native_app? %> px-5" style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<% if @template.variables_schema.present? %>
<div class="flex items-start gap-4 p-4 border border-base-300 rounded-2xl bg-base-100 mt-4">
<%= svg_icon('info_circle', class: 'stroke-current shrink-0 h-6 w-6') %>
+2 -2
View File
@@ -12,7 +12,7 @@
<% end %>
</div>
</toggle-visible>
<div id="draw" class="mt-3 <%= 'px-4' if turbo_native_android? %>">
<div id="draw" class="mt-3" style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<%= form_for @user_config, url: user_initials_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %>
<signature-form class="relative block">
<a class="absolute top-1 right-1 link text-sm" data-target="signature-form.clear" href="#"><%= t('clear') %></a>
@@ -24,7 +24,7 @@
</signature-form>
<% end %>
</div>
<div id="upload" class="hidden mt-3 <%= 'px-4' if turbo_native_android? %>">
<div id="upload" class="hidden mt-3" style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<%= form_for @user_config, url: user_initials_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %>
<file-dropzone data-submit-on-upload="true" class="w-full">
<label for="file" class="w-full block h-32 relative bg-base-200 hover:bg-base-200/70 rounded-md border border-base-content border-dashed">
+2 -2
View File
@@ -12,7 +12,7 @@
<% end %>
</div>
</toggle-visible>
<div id="draw" class="mt-3 <%= 'px-4' if turbo_native_android? %>">
<div id="draw" class="mt-3" style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<%= form_for @user_config, url: user_signature_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %>
<signature-form class="relative block">
<a class="absolute top-1 right-1 link text-sm" data-target="signature-form.clear" href="#"><%= t('clear') %></a>
@@ -24,7 +24,7 @@
</signature-form>
<% end %>
</div>
<div id="upload" class="hidden mt-3 <%= 'px-4' if turbo_native_android? %>">
<div id="upload" class="hidden mt-3" style="<%= 'padding-inline: 18px' if turbo_native_app? %>">
<%= form_for @user_config, url: user_signature_path, method: :put, data: { turbo_frame: :_top }, html: { autocomplete: :off, enctype: 'multipart/form-data' } do |f| %>
<file-dropzone data-submit-on-upload="true" class="w-full">
<label for="file" class="w-full block h-32 relative bg-base-200 hover:bg-base-200/70 rounded-md border border-base-content border-dashed">
+1 -1
View File
@@ -1,4 +1,4 @@
<%= form_for user, html: { class: "space-y-4 #{'px-4' if turbo_native_android?}" }, data: { turbo_frame: :_top } do |f| %>
<%= form_for user, html: { class: 'space-y-4', style: ('padding-inline: 18px' if turbo_native_app?) }, data: { turbo_frame: :_top } do |f| %>
<div class="space-y-2">
<div class="flex space-x-4">
<div class="w-full">
+1 -1
View File
@@ -25,7 +25,7 @@ module DocuSeal
config.active_storage.routes_prefix = ''
config.active_storage.draw_routes = ENV['MULTITENANT'] != 'true'
config.active_storage.draw_routes = false
config.active_storage.analyzers = []
+8 -1
View File
@@ -166,7 +166,14 @@ Rails.application.configure do
current_user = controller.instance_variable_get(:@current_user)
os = DetectBrowserDevice.os(controller.request.user_agent) if ENV['MULTITENANT'] == 'true'
if ENV['MULTITENANT'] == 'true'
os =
if defined?(controller.browser_os)
controller.browser_os
else
DetectBrowserDevice.os(controller.request.user_agent)
end
end
{
host: controller.request.host,
+2 -20
View File
@@ -63,26 +63,8 @@ end
ActiveStorage::LogSubscriber.detach_from(:active_storage) if Rails.env.production?
Rails.configuration.to_prepare do
ActiveStorage::DiskController.after_action do
response.set_header('cache-control', 'public, max-age=31536000') if action_name == 'show'
end
ActiveStorage::Blobs::ProxyController.before_action do
response.set_header('Access-Control-Allow-Origin', '*')
response.set_header('Access-Control-Allow-Methods', 'GET')
response.set_header('Access-Control-Allow-Headers', '*')
response.set_header('Access-Control-Max-Age', '1728000')
end
ActiveStorage::Blobs::RedirectController.before_action do
response.set_header('Access-Control-Allow-Origin', '*')
response.set_header('Access-Control-Allow-Methods', 'GET')
response.set_header('Access-Control-Allow-Headers', '*')
response.set_header('Access-Control-Max-Age', '1728000')
end
ActiveStorage::DirectUploadsController.before_action do
head :forbidden
ActiveStorage::DiskController.after_action(only: :show) do
response.set_header('cache-control', 'public, max-age=31536000')
end
LoadActiveStorageConfigs.call
+49
View File
@@ -830,9 +830,14 @@ en: &en
click_here_to_update_your_payment_details_and_clear_the_invoice_to_ensure_uninterrupted_service_html: <a href="%{url}" class="link">Click here</a> to update your payment details and clear the invoice to ensure uninterrupted service.
overdue_payment: Overdue Payment
your_pro_plan_has_been_suspended_due_to_unpaid_invoices_you_can_update_your_payment_details_to_settle_the_invoice_and_continue_using_docuseal_or_cancel_your_subscription: Your Pro Plan has been suspended due to unpaid invoices. You can update your payment details to settle the invoice and continue using DocuSeal or cancel your subscription.
get_the_docuseal_app_for_a_better_mobile_experience: Get the DocuSeal app for a better mobile experience.
install_app: Install app
manage_subscription: Manage Subscription
docuseal_version_security_release_is_available: "DocuSeal v%{version} security release is available."
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Click here</a> to view the instructions and update your app.'
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
one: 'Your Pro subscription includes <b>%{count}</b> user seat, but there are <b>%{users}</b> active users in your account.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Upgrade</a> your plan to cover <b>%{users}</b> users or remove inactive users via <a href="%{settings_url}" class="link font-bold">Settings</a>.'
other: 'Your Pro subscription includes <b>%{count}</b> user seats, but there are <b>%{users}</b> active users in your account.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Upgrade</a> your plan to cover <b>%{users}</b> users or remove inactive users via <a href="%{settings_url}" class="link font-bold">Settings</a>.'
submission_created_by_email_html: '<b>Submission created</b> by %{email}'
submission_created_by_email_via_source_html: '<b>Submission created</b> by %{email} via %{source}'
submission_created_via_source_html: '<b>Submission created</b> via %{source}'
@@ -1046,10 +1051,12 @@ en: &en
link: Link
mcp: MCP
self: Sign Yourself
error: Error
submission_event_names:
send_email_to_html: '<b>Email sent</b> to %{submitter_name}'
bounce_email_html: '<b>Email bounced</b> %{submitter_name}'
complaint_email_html: '<b>Spam complaint</b> %{submitter_name}'
fail_sms_to_html: '<b>SMS failed</b> to %{submitter_name}'
send_reminder_email_to_html: '<b>Reminder email sent</b> to %{submitter_name}'
send_sms_to_html: '<b>SMS sent</b> to %{submitter_name}'
send_2fa_sms_to_html: '<b>Verification SMS sent</b> to %{submitter_name}'
@@ -1988,9 +1995,14 @@ es: &es
click_here_to_update_your_payment_details_and_clear_the_invoice_to_ensure_uninterrupted_service_html: '<a href="%{url}" class="link">Haz clic aquí</a> para actualizar tus datos de pago y liquidar la factura para garantizar un servicio ininterrumpido.'
overdue_payment: Pago Atrasado
your_pro_plan_has_been_suspended_due_to_unpaid_invoices_you_can_update_your_payment_details_to_settle_the_invoice_and_continue_using_docuseal_or_cancel_your_subscription: Tu plan Pro ha sido suspendido debido a facturas impagas. Puedes actualizar tus datos de pago para liquidar la factura y seguir usando DocuSeal o cancelar tu suscripción.
get_the_docuseal_app_for_a_better_mobile_experience: Descarga la app de DocuSeal para una mejor experiencia móvil.
install_app: Instalar app
manage_subscription: Gestionar Suscripción
docuseal_version_security_release_is_available: "La versión de seguridad DocuSeal v%{version} está disponible."
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Haz clic aquí</a> para ver las instrucciones y actualizar tu aplicación.'
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
one: 'Tu suscripción Pro incluye <b>%{count}</b> plaza de usuario, pero hay <b>%{users}</b> usuarios activos en tu cuenta.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Amplía</a> tu plan para cubrir <b>%{users}</b> usuarios o elimina los usuarios inactivos en la <a href="%{settings_url}" class="link font-bold">Configuración</a>.'
other: 'Tu suscripción Pro incluye <b>%{count}</b> plazas de usuario, pero hay <b>%{users}</b> usuarios activos en tu cuenta.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Amplía</a> tu plan para cubrir <b>%{users}</b> usuarios o elimina los usuarios inactivos en la <a href="%{settings_url}" class="link font-bold">Configuración</a>.'
submission_created_by_email_html: '<b>Envío creado</b> por %{email}'
submission_created_by_email_via_source_html: '<b>Envío creado</b> por %{email} a través de %{source}'
submission_created_via_source_html: '<b>Envío creado</b> a través de %{source}'
@@ -2196,10 +2208,12 @@ es: &es
link: Enlace
mcp: MCP
self: Firma tú mismo
error: Error
submission_event_names:
send_email_to_html: '<b>Correo electrónico enviado</b> a %{submitter_name}'
bounce_email_html: '<b>Correo electrónico rebotado</b> %{submitter_name}'
complaint_email_html: '<b>Queja de spam</b> %{submitter_name}'
fail_sms_to_html: '<b>SMS fallido</b> a %{submitter_name}'
send_reminder_email_to_html: '<b>Correo de recordatorio enviado</b> a %{submitter_name}'
send_sms_to_html: '<b>SMS enviado</b> a %{submitter_name}'
send_2fa_sms_to_html: '<b>SMS de verificación enviado</b> a %{submitter_name}'
@@ -3152,9 +3166,14 @@ it: &it
click_here_to_update_your_payment_details_and_clear_the_invoice_to_ensure_uninterrupted_service_html: '<a href="%{url}" class="link">Fai clic qui</a> per aggiornare i tuoi dati di pagamento e saldare la fattura per garantire un servizio ininterrotto.'
overdue_payment: Pagamento Scaduto
your_pro_plan_has_been_suspended_due_to_unpaid_invoices_you_can_update_your_payment_details_to_settle_the_invoice_and_continue_using_docuseal_or_cancel_your_subscription: Il tuo piano Pro è stato sospeso a causa di fatture non pagate. Puoi aggiornare i tuoi dati di pagamento per saldare la fattura e continuare a utilizzare DocuSeal o annullare l'abbonamento.
get_the_docuseal_app_for_a_better_mobile_experience: Scarica l'app DocuSeal per un'esperienza mobile migliore.
install_app: Installa app
manage_subscription: Gestisci Abbonamento
docuseal_version_security_release_is_available: "È disponibile il rilascio di sicurezza DocuSeal v%{version}."
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Fai clic qui</a> per vedere le istruzioni e aggiornare la tua app.'
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
one: 'Il tuo abbonamento Pro include <b>%{count}</b> posto utente, ma nel tuo account ci sono <b>%{users}</b> utenti attivi.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Aggiorna</a> il tuo piano per coprire <b>%{users}</b> utenti oppure rimuovi gli utenti inattivi dalle <a href="%{settings_url}" class="link font-bold">Impostazioni</a>.'
other: 'Il tuo abbonamento Pro include <b>%{count}</b> posti utente, ma nel tuo account ci sono <b>%{users}</b> utenti attivi.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Aggiorna</a> il tuo piano per coprire <b>%{users}</b> utenti oppure rimuovi gli utenti inattivi dalle <a href="%{settings_url}" class="link font-bold">Impostazioni</a>.'
submission_created_by_email_html: '<b>Invio creato</b> da %{email}'
submission_created_by_email_via_source_html: '<b>Invio creato</b> da %{email} tramite %{source}'
submission_created_via_source_html: '<b>Invio creato</b> tramite %{source}'
@@ -3360,10 +3379,12 @@ it: &it
link: Link
mcp: MCP
self: Firma te stesso
error: Errore
submission_event_names:
send_email_to_html: '<b>Email inviata</b> a %{submitter_name}'
bounce_email_html: '<b>Email respinta</b> %{submitter_name}'
complaint_email_html: '<b>Segnalazione spam</b> %{submitter_name}'
fail_sms_to_html: '<b>SMS non consegnato</b> a %{submitter_name}'
send_reminder_email_to_html: '<b>E-mail di promemoria inviata</b> a %{submitter_name}'
send_sms_to_html: '<b>SMS inviato</b> a %{submitter_name}'
send_2fa_sms_to_html: '<b>SMS di verifica inviato</b> a %{submitter_name}'
@@ -4302,9 +4323,14 @@ fr: &fr
click_here_to_update_your_payment_details_and_clear_the_invoice_to_ensure_uninterrupted_service_html: <a href="%{url}" class="link">Cliquez ici</a> pour mettre à jour vos informations de paiement et régler la facture afin de garantir la continuité du service.
overdue_payment: Paiement en retard
your_pro_plan_has_been_suspended_due_to_unpaid_invoices_you_can_update_your_payment_details_to_settle_the_invoice_and_continue_using_docuseal_or_cancel_your_subscription: "Votre offre Pro a été suspendue en raison de factures impayées.\nVous pouvez mettre à jour vos informations de paiement pour régler la facture et continuer à utiliser DocuSeal, ou annuler votre abonnement."
get_the_docuseal_app_for_a_better_mobile_experience: Téléchargez l’application DocuSeal pour une meilleure expérience mobile.
install_app: Installer l’application
manage_subscription: Gérer l’abonnement
docuseal_version_security_release_is_available: "La mise à jour de sécurité DocuSeal v%{version} est disponible."
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Cliquez ici</a> pour voir les instructions et mettre à jour votre application.'
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
one: 'Votre abonnement Pro inclut <b>%{count}</b> place d’utilisateur, mais votre compte compte <b>%{users}</b> utilisateurs actifs.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Mettez à niveau</a> votre offre pour couvrir <b>%{users}</b> utilisateurs ou supprimez les utilisateurs inactifs dans les <a href="%{settings_url}" class="link font-bold">Paramètres</a>.'
other: 'Votre abonnement Pro inclut <b>%{count}</b> places d’utilisateur, mais votre compte compte <b>%{users}</b> utilisateurs actifs.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Mettez à niveau</a> votre offre pour couvrir <b>%{users}</b> utilisateurs ou supprimez les utilisateurs inactifs dans les <a href="%{settings_url}" class="link font-bold">Paramètres</a>.'
submission_created_by_email_html: "<b>Soumission créée</b> par %{email}"
submission_created_by_email_via_source_html: "<b>Soumission créée</b> par %{email} via %{source}"
submission_created_via_source_html: "<b>Soumission créée</b> via %{source}"
@@ -4507,10 +4533,12 @@ fr: &fr
link: Lien
mcp: MCP
self: Signer vous-même
error: Erreur
submission_event_names:
send_email_to_html: "<b>E‑mail envoyé</b> à %{submitter_name}"
bounce_email_html: "<b>E‑mail rejeté</b> %{submitter_name}"
complaint_email_html: "<b>Plainte spam</b> %{submitter_name}"
fail_sms_to_html: "<b>SMS non distribué</b> à %{submitter_name}"
send_reminder_email_to_html: "<b>E‑mail de rappel envoyé</b> à %{submitter_name}"
send_sms_to_html: "<b>SMS envoyé</b> à %{submitter_name}"
send_2fa_sms_to_html: "<b>SMS de vérification envoyé</b> à %{submitter_name}"
@@ -5462,9 +5490,14 @@ pt: &pt
click_here_to_update_your_payment_details_and_clear_the_invoice_to_ensure_uninterrupted_service_html: '<a href="%{url}" class="link">Clique aqui</a> para atualizar seus dados de pagamento e quitar a fatura para garantir um serviço ininterrupto.'
overdue_payment: Pagamento Atrasado
your_pro_plan_has_been_suspended_due_to_unpaid_invoices_you_can_update_your_payment_details_to_settle_the_invoice_and_continue_using_docuseal_or_cancel_your_subscription: Seu plano Pro foi suspenso devido a faturas não pagas. Você pode atualizar seus dados de pagamento para quitar a fatura e continuar usando o DocuSeal ou cancelar sua assinatura.
get_the_docuseal_app_for_a_better_mobile_experience: Baixe o app DocuSeal para uma melhor experiência no celular.
install_app: Instalar app
manage_subscription: Gerenciar Assinatura
docuseal_version_security_release_is_available: "A versão de segurança DocuSeal v%{version} está disponível."
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Clique aqui</a> para ver as instruções e atualizar seu aplicativo.'
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
one: 'Sua assinatura Pro inclui <b>%{count}</b> lugar de usuário, mas há <b>%{users}</b> usuários ativos na sua conta.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Atualize</a> seu plano para cobrir <b>%{users}</b> usuários ou remova os usuários inativos nas <a href="%{settings_url}" class="link font-bold">Configurações</a>.'
other: 'Sua assinatura Pro inclui <b>%{count}</b> lugares de usuário, mas há <b>%{users}</b> usuários ativos na sua conta.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Atualize</a> seu plano para cobrir <b>%{users}</b> usuários ou remova os usuários inativos nas <a href="%{settings_url}" class="link font-bold">Configurações</a>.'
submission_created_by_email_html: '<b>Envio criado</b> por %{email}'
submission_created_by_email_via_source_html: '<b>Envio criado</b> por %{email} via %{source}'
submission_created_via_source_html: '<b>Envio criado</b> via %{source}'
@@ -5670,10 +5703,12 @@ pt: &pt
link: Link
mcp: MCP
self: Assine você mesmo
error: Erro
submission_event_names:
send_email_to_html: '<b>Email enviado</b> para %{submitter_name}'
bounce_email_html: '<b>Email não entregue</b> %{submitter_name}'
complaint_email_html: '<b>Reclamação de spam</b> %{submitter_name}'
fail_sms_to_html: '<b>SMS não entregue</b> para %{submitter_name}'
send_reminder_email_to_html: '<b>Email de lembrete enviado</b> para %{submitter_name}'
send_sms_to_html: '<b>SMS enviado</b> para %{submitter_name}'
send_2fa_sms_to_html: '<b>SMS de verificação enviado</b> para %{submitter_name}'
@@ -6625,9 +6660,14 @@ de: &de
click_here_to_update_your_payment_details_and_clear_the_invoice_to_ensure_uninterrupted_service_html: '<a href="%{url}" class="link">Klicken Sie hier</a>, um Ihre Zahlungsdaten zu aktualisieren und die Rechnung zu begleichen, um einen unterbrechungsfreien Service sicherzustellen.'
overdue_payment: Überfällige Zahlung
your_pro_plan_has_been_suspended_due_to_unpaid_invoices_you_can_update_your_payment_details_to_settle_the_invoice_and_continue_using_docuseal_or_cancel_your_subscription: Ihr Pro-Plan wurde aufgrund unbezahlter Rechnungen ausgesetzt. Sie können Ihre Zahlungsdaten aktualisieren, um die Rechnung zu begleichen und DocuSeal weiterhin zu nutzen, oder Ihr Abonnement kündigen.
get_the_docuseal_app_for_a_better_mobile_experience: Holen Sie sich die DocuSeal-App für ein besseres mobiles Erlebnis.
install_app: App installieren
manage_subscription: Abonnement verwalten
docuseal_version_security_release_is_available: "Das Sicherheitsupdate DocuSeal v%{version} ist verfügbar."
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Klicken Sie hier</a>, um die Anleitung anzuzeigen und Ihre App zu aktualisieren.'
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
one: 'Ihr Pro-Abonnement umfasst <b>%{count}</b> Benutzerplatz, aber in Ihrem Konto gibt es <b>%{users}</b> aktive Benutzer.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Erweitern</a> Sie Ihren Plan auf <b>%{users}</b> Benutzer oder entfernen Sie inaktive Benutzer in den <a href="%{settings_url}" class="link font-bold">Einstellungen</a>.'
other: 'Ihr Pro-Abonnement umfasst <b>%{count}</b> Benutzerplätze, aber in Ihrem Konto gibt es <b>%{users}</b> aktive Benutzer.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Erweitern</a> Sie Ihren Plan auf <b>%{users}</b> Benutzer oder entfernen Sie inaktive Benutzer in den <a href="%{settings_url}" class="link font-bold">Einstellungen</a>.'
submission_created_by_email_html: '<b>Einreichung erstellt</b> von %{email}'
submission_created_by_email_via_source_html: '<b>Einreichung erstellt</b> von %{email} über %{source}'
submission_created_via_source_html: '<b>Einreichung erstellt</b> über %{source}'
@@ -6833,10 +6873,12 @@ de: &de
link: Link
mcp: MCP
self: Selbst unterschreiben
error: Fehler
submission_event_names:
send_email_to_html: '<b>E-Mail gesendet</b> an %{submitter_name}'
bounce_email_html: '<b>E-Mail unzustellbar</b> %{submitter_name}'
complaint_email_html: '<b>Spam-Beschwerde</b> %{submitter_name}'
fail_sms_to_html: '<b>SMS unzustellbar</b> an %{submitter_name}'
send_reminder_email_to_html: '<b>Erinnerungs-E-Mail gesendet</b> an %{submitter_name}'
send_sms_to_html: '<b>SMS gesendet</b> an %{submitter_name}'
send_2fa_sms_to_html: '<b>Verifizierungs-SMS gesendet</b> an %{submitter_name}'
@@ -8316,9 +8358,14 @@ nl: &nl
click_here_to_update_your_payment_details_and_clear_the_invoice_to_ensure_uninterrupted_service_html: <a href="%{url}" class="link">Klik hier</a> om uw betaalgegevens bij te werken en de factuur te voldoen om ononderbroken service te garanderen.
overdue_payment: Achterstallige betaling
your_pro_plan_has_been_suspended_due_to_unpaid_invoices_you_can_update_your_payment_details_to_settle_the_invoice_and_continue_using_docuseal_or_cancel_your_subscription: Uw Pro-abonnement is opgeschort vanwege onbetaalde facturen. U kunt uw betaalgegevens bijwerken om de factuur te voldoen en DocuSeal te blijven gebruiken of uw abonnement opzeggen.
get_the_docuseal_app_for_a_better_mobile_experience: Download de DocuSeal-app voor een betere mobiele ervaring.
install_app: App installeren
manage_subscription: Abonnement beheren
docuseal_version_security_release_is_available: "Beveiligingsupdate DocuSeal v%{version} is beschikbaar."
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Klik hier</a> om de instructies te bekijken en uw app bij te werken.'
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
one: 'Uw Pro-abonnement omvat <b>%{count}</b> gebruikersplaats, maar er zijn <b>%{users}</b> actieve gebruikers in uw account.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Upgrade</a> uw abonnement naar <b>%{users}</b> gebruikers of verwijder inactieve gebruikers via de <a href="%{settings_url}" class="link font-bold">Instellingen</a>.'
other: 'Uw Pro-abonnement omvat <b>%{count}</b> gebruikersplaatsen, maar er zijn <b>%{users}</b> actieve gebruikers in uw account.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Upgrade</a> uw abonnement naar <b>%{users}</b> gebruikers of verwijder inactieve gebruikers via de <a href="%{settings_url}" class="link font-bold">Instellingen</a>.'
submission_created_by_email_html: "<b>Inzending aangemaakt</b> door %{email}"
submission_created_by_email_via_source_html: "<b>Inzending aangemaakt</b> door %{email} via %{source}"
submission_created_via_source_html: "<b>Inzending aangemaakt</b> via %{source}"
@@ -8520,10 +8567,12 @@ nl: &nl
link: Link
mcp: MCP
self: Zelf ondertekenen
error: Fout
submission_event_names:
send_email_to_html: "<b>E-mail verzonden</b> naar %{submitter_name}"
bounce_email_html: "<b>E-mail geretourneerd</b> %{submitter_name}"
complaint_email_html: "<b>Spamklacht</b> %{submitter_name}"
fail_sms_to_html: "<b>SMS niet afgeleverd</b> naar %{submitter_name}"
send_reminder_email_to_html: "<b>Herinneringsmail verzonden</b> naar %{submitter_name}"
send_sms_to_html: "<b>SMS verzonden</b> naar %{submitter_name}"
send_2fa_sms_to_html: "<b>Verificatie-SMS verzonden</b> naar %{submitter_name}"
+4 -4
View File
@@ -125,12 +125,12 @@ Rails.application.routes.draw do
resource :blobs_proxy, only: %i[show], path: '/blobs_proxy/:signed_uuid/*filename',
controller: 'api/active_storage_blobs_proxy'
if Docuseal.multitenant?
get '/disk/:encoded_key/*filename' => 'active_storage/disk#show', as: :rails_disk_service if Rails.env.local?
ActiveSupport.run_load_hooks(:multitenant_routes, self)
if !Docuseal.multitenant? || Rails.env.local?
get '/disk/:encoded_key/*filename' => 'active_storage/disk#show', as: :rails_disk_service
end
ActiveSupport.run_load_hooks(:multitenant_routes, self) if Docuseal.multitenant?
resources :start_form, only: %i[show update], path: 'd', param: 'slug' do
get :completed
end
+45
View File
@@ -26,6 +26,9 @@ module DetectBrowserDevice
Silk
/ix
IOS_APP_USER_AGENT_REGEXP = /Hotwire Native iOS/
ANDROID_APP_USER_AGENT_REGEXP = /Hotwire Native Android/
WINDOWS_USER_AGENT_REGEXP = /
Windows|
Win64 |
@@ -63,6 +66,42 @@ module DetectBrowserDevice
NetBSD
/ix
SEARCH_BOT_USER_AGENT_REGEXP = /
Googlebot |
Google-InspectionTool|
Storebot-Google |
AdsBot-Google |
Mediapartners-Google |
bingbot |
BingPreview |
adidxbot |
msnbot |
Slurp |
DuckDuckBot |
Baiduspider |
YandexBot |
YandexImages |
Applebot |
PetalBot |
SeznamBot |
Sogou |
Exabot |
Qwantify |
YisouSpider |
Bytespider |
AhrefsBot |
SemrushBot |
MJ12bot |
DotBot |
GPTBot |
OAI-SearchBot |
ClaudeBot |
Claude-SearchBot |
PerplexityBot |
CCBot |
Amazonbot
/ix
SDK_USER_AGENT_REGEXP = /\ADocuSeal (?<sdk>Ruby|Python|PHP|Java|C#|JS|Go|CLI) v/i
def call(user_agent)
@@ -74,6 +113,10 @@ module DetectBrowserDevice
'desktop'
end
def search_bot?(user_agent)
SEARCH_BOT_USER_AGENT_REGEXP.match?(user_agent.to_s)
end
def os(user_agent)
return if user_agent.blank?
@@ -82,6 +125,8 @@ module DetectBrowserDevice
return sdk.downcase if sdk
case user_agent
when IOS_APP_USER_AGENT_REGEXP then 'iosapp'
when ANDROID_APP_USER_AGENT_REGEXP then 'andapp'
when WINDOWS_USER_AGENT_REGEXP then 'windows'
when ANDROID_USER_AGENT_REGEXP then 'android'
when IOS_USER_AGENT_REGEXP then 'ios'
+2
View File
@@ -11,6 +11,8 @@ module Docuseal
TWITTER_URL = 'https://twitter.com/docusealco'
TWITTER_HANDLE = '@docusealco'
CHATGPT_URL = "#{PRODUCT_URL}/chat".freeze
APP_STORE_URL = 'https://apps.apple.com/us/app/docuseal-e-signature/id6823564236'
GOOGLE_PLAY_URL = 'https://play.google.com/store/apps/details?id=com.docuseal.app'
SUPPORT_EMAIL = 'support@docuseal.com'
HOST = ENV.fetch('HOST', 'localhost')
AATL_CERT_NAME = 'docuseal_aatl'
+4
View File
@@ -18,4 +18,8 @@ module FilenameUtils
def dangerous_extension(filename)
ActiveStorage::Filename.wrap(filename).sanitized[DANGEROUS_EXTENSIONS_REGEXP, 1]&.downcase
end
def basename(filename)
File.basename(filename, File.extname(filename))
end
end
+11
View File
@@ -18,6 +18,7 @@ module ReplaceEmailVariables
SUBMISSION_LINK = /\{+submission\.link\}+/i
SUBMISSION_ID = /\{+submission\.id\}+/i
SUBMISSION_EXPIRE_AT = /\{+submission\.expire_at\}+/i
SUBMISSION_VARIABLE = /\{+submission\.(?<variable_name>[^}]+)\}+/i
SUBMITTERS = /\{+(?:submission\.)?submitters\}+/i
SUBMITTERS_N_EMAIL = /\{+submitters\[(?<index>\d+)\]\.email\}+/i
SUBMITTERS_N_NAME = /\{+submitters\[(?<index>\d+)\]\.name\}+/i
@@ -65,6 +66,10 @@ module ReplaceEmailVariables
end
end
text = replace(text, SUBMISSION_VARIABLE, html_escape:) do |match|
build_submission_variable(submitter.submission, match[:variable_name].to_s.strip)
end
text = replace(text, SUBMITTERS_N_NAME, html_escape:) do |match|
build_submitters_n_field(submitter.submission, match[:index].to_i - 1, :name)
end
@@ -103,6 +108,12 @@ module ReplaceEmailVariables
)
end
def build_submission_variable(submission, variable_name)
variable_name.split('.').reduce(submission.variables) do |value, key|
value[key] if value.is_a?(Hash)
end
end
def build_submitters_n_field(submission, index, field_name, value_name = nil)
uuid = (submission.template_submitters || submission.template.submitters).dig(index, 'uuid')
+3 -1
View File
@@ -459,7 +459,9 @@ module Submissions
def assign_completed_attributes(submitter, with_verification: true)
submitter.values = Submitters::SubmitValues.merge_default_values(submitter, with_verification:)
submitter.values = Submitters::SubmitValues.maybe_remove_condition_values(submitter)
submitter.values = Submitters::SubmitValues.maybe_remove_condition_values(
submitter, formula_values: Submitters::SubmitValues.build_formula_values(submitter)
)
formula_values = Submitters::SubmitValues.build_formula_values(submitter)
+4 -4
View File
@@ -231,7 +231,7 @@ module Submissions
document.metadata['sha256'] || document.checksum,
"\n",
{ text: "#{I18n.t('generated_at')}: ", font: [FONT_NAME, { variant: :bold }] },
"#{I18n.l(document.created_at.in_time_zone(timezone), format: :long, locale: account.locale)} " \
"#{I18n.l(document.created_at.in_time_zone(timezone), format: :long)} " \
"#{TimeUtils.timezone_abbr(timezone, document.created_at)}"
], line_spacing: 1.3
)
@@ -440,7 +440,7 @@ module Submissions
composer.formatted_text_box([{ text: value.to_s.titleize }], padding: [0, 0, 10, 0])
else
if field['type'] == 'date'
value = TimeUtils.format_date_string(value, field.dig('preferences', 'format'), account.locale,
value = TimeUtils.format_date_string(value, field.dig('preferences', 'format'), I18n.locale,
timezone:)
end
@@ -469,7 +469,7 @@ module Submissions
end
events_data = submission.submission_events.sort_by(&:event_timestamp).filter_map do |event|
next if event.event_type.in?(%w[bounce_email complaint_email])
next if event.event_type.in?(%w[bounce_email complaint_email fail_sms])
submitter = submission.submitters.find { |e| e.id == event.submitter_id }
versions = submitter_versions_index[submitter.id] || []
@@ -533,7 +533,7 @@ module Submissions
time_format = with_timestamp_seconds ? :detailed : :long
[
"#{I18n.l(event.event_timestamp.in_time_zone(timezone), format: time_format, locale: account.locale)} " \
"#{I18n.l(event.event_timestamp.in_time_zone(timezone), format: time_format)} " \
"#{TimeUtils.timezone_abbr(timezone, event.event_timestamp)}",
composer.document.layout.formatted_text_box(text_box)
]
+1 -1
View File
@@ -232,7 +232,7 @@ module Submitters
def build_document_filename(submitter, blob, filename_format)
return blob.filename.to_s if filename_format.blank?
filename = filename_format.gsub('{document.name}', blob.filename.base)
filename = filename_format.gsub('{document.name}', FilenameUtils.basename(blob[:filename]))
filename = ReplaceEmailVariables.call(filename, submitter:)
filename = filename.gsub(' - {submission.status}') do
+8 -1
View File
@@ -8,6 +8,13 @@ module Submitters
methods: %i[status application_key]
}.freeze
EVENT_DATA_KEYS = {
'decline_form' => %w[reason],
'complete_verification' => %w[firstname lastname method country idcode],
'fail_kba' => %w[issues],
'fail_sms' => %w[status error_code]
}.freeze
module_function
def call(submitter, with_template: false, with_events: false, with_documents: true, with_urls: false,
@@ -55,7 +62,7 @@ module Submitters
def serialize_events(events)
events.map do |event|
event.as_json(only: %i[id submitter_id event_type event_timestamp])
.merge('data' => event.data.slice('reason', 'firstname', 'lastname', 'method', 'country', 'idcode'))
.merge('data' => event.data.slice(*EVENT_DATA_KEYS[event.event_type]))
end
end
end
+4 -1
View File
@@ -104,7 +104,10 @@ module Submitters
def build_documents_array(submitter, expires_at: nil)
submitter.documents.map do |attachment|
{ 'name' => attachment.filename.base, 'url' => rails_storage_proxy_url(attachment, expires_at:) }
{
'name' => FilenameUtils.basename(attachment.blob[:filename]),
'url' => rails_storage_proxy_url(attachment, expires_at:)
}
end
end
+9 -8
View File
@@ -75,13 +75,14 @@ module Submitters
submitter.completed_at = Time.current
submitter.ip = request.remote_ip
submitter.ua = request.user_agent
submitter.timezone = request.params[:timezone]
submitter.timezone = request.params[:timezone] if ActiveSupport::TimeZone[request.params[:timezone].to_s]
submitter.values = merge_default_values(submitter)
required_field_uuids_acc = Set.new
submitter.values = maybe_remove_condition_values(submitter, required_field_uuids_acc:)
submitter.values = maybe_remove_condition_values(submitter, formula_values: build_formula_values(submitter),
required_field_uuids_acc:)
formula_values = build_formula_values(submitter)
@@ -204,10 +205,10 @@ module Submitters
default_values.compact_blank.merge(submitter.values)
end
def build_formula_values(submitter)
submission_values = nil
def build_formula_values(submitter, submission_values: nil)
submission = submitter.submission
computed_values = submitter.submission.template_fields.each_with_object({}) do |field, acc|
computed_values = (submission.template_fields || submission.template.fields).each_with_object({}) do |field, acc|
next if field['submitter_uuid'] != submitter.uuid
next if field['type'] == 'payment'
@@ -297,17 +298,17 @@ module Submitters
field:)
end
def maybe_remove_condition_values(submitter, required_field_uuids_acc: nil)
def maybe_remove_condition_values(submitter, formula_values: {}, required_field_uuids_acc: nil)
submission = submitter.submission
submitters_values = nil
submitters_values = formula_values.merge(merge_submitters_values(submitter)) if formula_values.present?
has_other_submitters = submission.template_submitters.size > 1
has_document_conditions = submission_has_document_conditions?(submission)
attachments_index =
if has_document_conditions
submitters_values = merge_submitters_values(submitter)
submitters_values ||= merge_submitters_values(submitter)
Submissions.filtered_conditions_schema(submission, values: submitters_values)
.index_by { |i| i['attachment_uuid'] }
+6 -4
View File
@@ -100,13 +100,15 @@ module Templates
Zip::File.open(file.tempfile).each do |entry|
next if entry.directory?
total_size += entry.size
tempfile = Tempfile.new(entry.name)
tempfile.binmode
total_size += entry.get_input_stream do |in_stream|
IO.copy_stream(in_stream, tempfile, MAX_ZIP_SIZE - total_size + 1)
end
raise InvalidFileType, 'zip_too_large' if total_size > MAX_ZIP_SIZE
tempfile = Tempfile.new(entry.name)
tempfile.binmode
entry.get_input_stream { |in_stream| IO.copy_stream(in_stream, tempfile) }
tempfile.rewind
type = Marcel::MimeType.for(tempfile, name: entry.name)
+1 -1
View File
@@ -26,7 +26,7 @@ module Templates
def create_document!(template, attachment, data, scan)
blob = ActiveStorage::Blob.create_and_upload!(
io: StringIO.new(data),
filename: "#{attachment.filename.base}.#{scan ? 'png' : 'jpg'}",
filename: "#{FilenameUtils.basename(attachment.blob[:filename])}.#{scan ? 'png' : 'jpg'}",
metadata: { identified: true, analyzed: true },
content_type: scan ? 'image/png' : 'image/jpeg'
)
+3 -3
View File
@@ -52,7 +52,7 @@ module Templates
schema_item =
template.schema.find { |item| item['attachment_uuid'] == entry['attachment_uuid'] } ||
{ 'attachment_uuid' => entry['attachment_uuid'],
'name' => attachments_index[entry['attachment_uuid']].filename.base }
'name' => FilenameUtils.basename(attachments_index[entry['attachment_uuid']].blob[:filename]) }
next if entry['pages'].blank?
@@ -270,7 +270,7 @@ module Templates
blob = ActiveStorage::Blob.create_and_upload!(
io: StringIO.new(data),
filename: "#{attachment.filename.base}#{extension}",
filename: "#{FilenameUtils.basename(attachment.blob[:filename])}#{extension}",
metadata: { identified: true, analyzed: true },
content_type:
)
@@ -439,7 +439,7 @@ module Templates
blob = ActiveStorage::Blob.create_and_upload!(
io: StringIO.new(data),
filename: "#{old_attachment.filename.base}.pdf",
filename: "#{FilenameUtils.basename(old_attachment.blob[:filename])}.pdf",
metadata: { identified: true, analyzed: true,
pdf: { annotations: }.compact_blank, sha256: }.compact_blank,
content_type: Templates::ProcessDocument::PDF_CONTENT_TYPE
+4 -1
View File
@@ -12,7 +12,10 @@ module Templates
documents.each_with_index do |document, index|
replaced_document_schema = template.schema[index]
template.schema[index] = { attachment_uuid: document.uuid, name: document.filename.base }
template.schema[index] = {
attachment_uuid: document.uuid,
name: FilenameUtils.basename(document.blob[:filename])
}
if replaced_document_schema
template.fields.each do |field|