Compare commits

...
39 Commits
Author SHA1 Message Date
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
Alex Turchyn 6c416dd76e Merge from docusealco/wip 2026-11-02 14:44:26 +02:00
Pete Matsyburka 1cc4ca6251 adjust events log 2026-11-02 12:28:21 +02:00
Pete Matsyburka a27423c845 update gem 2026-11-02 11:19:14 +02:00
Pete Matsyburka 2692b8a1b5 add index 2026-11-02 10:18:16 +02:00
Pete Matsyburka 7a75a6c887 optimize query 2026-11-02 09:48:37 +02:00
Pete Matsyburka 236b882558 update security.md 2026-11-01 13:42:44 +02:00
Pete Matsyburka 7ee648dacb add index 2026-11-01 12:38:59 +02:00
Pete Matsyburka 9bfa6f7f4a fix rubocop 2026-10-30 11:03:27 +02:00
Pete Matsyburka f9c12b9d78 mobile fixes 2026-10-29 21:24:07 +02:00
Pete Matsyburka 0a3f182e70 fix timezone 2026-10-29 10:51:45 +02:00
Pete Matsyburka 9c5c1f47f8 update gems 2026-10-29 10:36:11 +02:00
Pete Matsyburka 14c0ad2d16 add json log formatter 2026-10-29 09:59:21 +02:00
Pete Matsyburka 6736d8fe68 mobile fixes 2026-10-28 19:01:18 +02:00
Pete Matsyburka 4ecd830587 android fixes 2026-10-28 15:35:43 +02:00
Alex Turchyn a0ecc8e823 support the android app 2026-10-28 10:47:26 +02:00
Pete Matsyburka 8334b612a8 fix enable shared link 2026-10-28 09:33:46 +02:00
Pete Matsyburka 349c0b0537 optimize query 2026-10-27 15:44:08 +02:00
Pete Matsyburka 2af09afc66 add lang 2026-10-27 15:31:15 +02:00
Pete Matsyburka e22a3d9ef3 use uuid v7 2026-10-27 11:24:42 +02:00
Pete Matsyburka d3c92cecfa carry lang param 2026-10-26 17:57:03 +02:00
Pete Matsyburka af4672084d optimize query 2026-10-26 17:14:45 +02:00
Pete Matsyburka b7103cf010 cleanup 2026-10-26 16:33:55 +02:00
125 changed files with 580 additions and 393 deletions

No files matched your search

+88 -88
View File
@@ -3,29 +3,29 @@ GEM
specs:
action_text-trix (2.1.19)
railties
actioncable (8.1.3.1)
actionpack (= 8.1.3.1)
activesupport (= 8.1.3.1)
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.3.1)
actionpack (= 8.1.3.1)
activejob (= 8.1.3.1)
activerecord (= 8.1.3.1)
activestorage (= 8.1.3.1)
activesupport (= 8.1.3.1)
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.3.1)
actionpack (= 8.1.3.1)
actionview (= 8.1.3.1)
activejob (= 8.1.3.1)
activesupport (= 8.1.3.1)
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.3.1)
actionview (= 8.1.3.1)
activesupport (= 8.1.3.1)
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.3.1)
actiontext (8.1.4.1)
action_text-trix (~> 2.1.15)
actionpack (= 8.1.3.1)
activerecord (= 8.1.3.1)
activestorage (= 8.1.3.1)
activesupport (= 8.1.3.1)
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.3.1)
activesupport (= 8.1.3.1)
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.3.1)
activesupport (= 8.1.3.1)
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.3.1)
activesupport (= 8.1.3.1)
activerecord (8.1.3.1)
activemodel (= 8.1.3.1)
activesupport (= 8.1.3.1)
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.3.1)
actionpack (= 8.1.3.1)
activejob (= 8.1.3.1)
activerecord (= 8.1.3.1)
activesupport (= 8.1.3.1)
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.3.1)
activesupport (8.1.4.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
@@ -116,7 +116,7 @@ GEM
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
bigdecimal (4.1.2)
bigdecimal (4.1.3)
bindex (0.8.1)
bootsnap (1.23.0)
msgpack (~> 1.2)
@@ -149,14 +149,14 @@ GEM
crack (1.0.1)
bigdecimal
rexml
crass (1.0.7)
crass (1.0.8)
csv (3.3.5)
csv-safe (3.3.1)
csv (~> 3.0)
cuprite (0.17)
capybara (~> 3.0)
ferrum (~> 0.17.0)
date (3.5.1)
date (3.6.0)
debug (1.11.1)
irb (~> 1.10)
reline (>= 0.3.8)
@@ -179,7 +179,7 @@ GEM
dotenv (3.2.0)
drb (2.2.3)
email_typo (0.2.3)
erb (6.0.6)
erb (6.0.7)
erb_lint (0.9.0)
activesupport
better_html (>= 2.0.1)
@@ -195,8 +195,8 @@ GEM
railties (>= 6.1.0)
faker (3.6.1)
i18n (>= 1.8.11, < 2)
faraday (2.14.3)
faraday-net_http (>= 2.0, < 3.5)
faraday (2.15.1)
faraday-net_http (>= 2.0, < 3.6)
json
logger
faraday-follow_redirects (0.5.0)
@@ -264,14 +264,14 @@ GEM
strscan (>= 3.1.2)
i18n (1.15.2)
concurrent-ruby (~> 1.0)
io-console (0.8.2)
io-console (0.9.5)
irb (1.18.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jmespath (1.6.2)
json (2.21.2)
json (3.1.0)
jwt (3.2.0)
base64
language_server-protocol (3.17.0.5)
@@ -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)
@@ -310,28 +310,28 @@ GEM
drb (~> 2.0)
prism (~> 1.5)
msgpack (1.8.4)
multi_json (1.19.1)
multi_json (1.21.2)
net-http (0.9.1)
uri (>= 0.11.1)
net-imap (0.6.6)
net-imap (0.6.8)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
net-protocol (0.4.0)
timeout
net-smtp (0.5.1)
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)
@@ -361,7 +361,7 @@ GEM
prettyprint
pretender (1.0.0)
actionpack (>= 7.2)
prettyprint (0.2.0)
prettyprint (0.2.1)
prism (1.9.0)
pry (0.16.0)
coderay (~> 1.1)
@@ -373,43 +373,43 @@ GEM
puma (8.0.2)
nio4r (~> 2.0)
racc (1.8.1)
rack (3.2.6)
rack (3.2.8)
rack-proxy (0.7.7)
rack
rack-session (2.1.2)
base64 (>= 0.1.0)
rack (>= 3.0.0)
rack-test (2.2.0)
rack-test (2.3.0)
rack (>= 1.3)
rackup (2.3.1)
rack (>= 3)
rails (8.1.3.1)
actioncable (= 8.1.3.1)
actionmailbox (= 8.1.3.1)
actionmailer (= 8.1.3.1)
actionpack (= 8.1.3.1)
actiontext (= 8.1.3.1)
actionview (= 8.1.3.1)
activejob (= 8.1.3.1)
activemodel (= 8.1.3.1)
activerecord (= 8.1.3.1)
activestorage (= 8.1.3.1)
activesupport (= 8.1.3.1)
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.3.1)
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.3.1)
actionpack (= 8.1.3.1)
activesupport (= 8.1.3.1)
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)
@@ -418,11 +418,11 @@ GEM
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.4.2)
rbs (4.1.0)
rbs (4.2.0)
logger
prism (>= 1.6.0)
tsort
rdoc (8.0.0)
rdoc (8.1.0)
erb
prism (>= 1.6.0)
rbs (>= 4.0.0)
@@ -430,7 +430,7 @@ GEM
redis-client (0.29.0)
connection_pool
regexp_parser (2.11.3)
reline (0.6.3)
reline (0.7.0)
io-console (~> 0.5)
representable (3.2.0)
declarative (< 0.1.0)
@@ -466,14 +466,14 @@ GEM
rspec-mocks (>= 3.13.0, < 5.0.0)
rspec-support (>= 3.13.0, < 5.0.0)
rspec-support (3.13.7)
rubocop (1.86.0)
json (~> 2.3)
rubocop (1.92.1)
json (>= 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
regexp_parser (>= 2.11.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
@@ -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)
@@ -555,7 +555,7 @@ GEM
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
uniform_notifier (1.18.0)
uri (1.1.1)
uri (1.1.2)
useragent (0.16.11)
warden (1.2.9)
rack (>= 2.0.9)
@@ -587,7 +587,7 @@ GEM
xpath (3.2.0)
nokogiri (~> 1.8)
yaml (0.4.0)
zeitwerk (2.8.2)
zeitwerk (2.8.3)
zip_kit (6.3.4)
PLATFORMS
+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
+2
View File
@@ -9,6 +9,8 @@ Out of scope vulnerabilities:
- CSRF
- 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.
+1 -2
View File
@@ -54,14 +54,13 @@ class AccountsController < ApplicationController
email: true_user.email.sub('@', '+removed@'))
true_user.account.update!(archived_at: Time.current)
# rubocop:disable Layout/LineLength
# rubocop:disable-next Layout/LineLength
render turbo_stream: turbo_stream.replace(
:account_delete_button,
html: helpers.tag.p(I18n.t('your_account_will_be_permanently_deleted_within_2_months_please_contact_us_if_you_want_to_keep_your_account')) +
helpers.tag.br +
helpers.tag.p(I18n.t('your_email_address_has_been_released_immediately_you_can_now_be_added_to_your_company_team_without_waiting_for_the_deletion_period_to_end'))
)
# rubocop:enable Layout/LineLength
end
private
@@ -11,7 +11,7 @@ module Api
before_action :set_noindex_headers
before_action :set_security_headers
# rubocop:disable Metrics
# rubocop:disable-next Metrics
def show
blob_uuid, purp, exp = ApplicationRecord.signed_id_verifier.verified(params[:signed_uuid])
@@ -34,6 +34,12 @@ 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)
if request.headers['Range'].present?
@@ -53,7 +59,6 @@ module Api
end
end
end
# rubocop:enable Metrics
private
@@ -1,53 +0,0 @@
# frozen_string_literal: true
module Api
class ActiveStorageBlobsProxyLegacyController < ApiBaseController
include ActiveStorage::Streaming
skip_before_action :authenticate_user!
skip_authorization_check
before_action :set_cors_headers
before_action :set_noindex_headers
before_action :set_security_headers
# rubocop:disable Metrics
def show
Rollbar.info('Blob legacy') if defined?(Rollbar)
blob = ActiveStorage::Blob.find_signed(params[:signed_blob_id] || params[:signed_id])
return head :not_found unless blob
if FilenameUtils.dangerous_extension(blob.filename)
Rollbar.error('Dangerous extension') if defined?(Rollbar)
return head :unprocessable_content
end
is_permitted = blob.attachments.any? do |a|
(current_user && a.record.account.id == current_user.account_id) ||
a.record.account.account_configs.any? { |e| e.key == 'legacy_blob_proxy' } ||
a.name == 'logo'
end
unless is_permitted
Rollbar.error("Blob account not found: #{blob.id}") if defined?(Rollbar)
return render json: { error: 'Not authenticated' }, status: :unauthorized
end
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'
response.headers['Content-Length'] = blob.byte_size.to_s
send_blob_stream blob, disposition: params[:disposition]
end
end
end
# rubocop:enable Metrics
end
end
@@ -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
+20 -3
View File
@@ -36,7 +36,7 @@ module Api
render json: Submitters::SerializeForApi.call(@submitter, with_template: true, with_events: true, params:)
end
# rubocop:disable Metrics/MethodLength
# rubocop:disable-next Metrics/MethodLength
def update
submission = @submitter.submission
role = submission.template_submitters.find { |e| e['uuid'] == @submitter.uuid }['name']
@@ -84,7 +84,6 @@ module Api
render json: { error: e.message }, status: :unprocessable_content
end
# rubocop:enable Metrics/MethodLength
def submitter_params
submitter_params = params.key?(:submitter) ? params.require(:submitter) : params
@@ -179,11 +178,29 @@ module Api
submitters = submitters.where(external_id: params[:external_id]) if params[:external_id].present?
submitters = submitters.where(slug: params[:slug]) if params[:slug].present?
submitters = submitters.where(submission_id: params[:submission_id]) if params[:submission_id].present?
submitters = submitters.where(template_id: params[:template_id]) if params[:template_id].present?
submitters = filter_submitters_by_template_id(submitters, params) if params[:template_id].present?
maybe_filter_by_completed_at(submitters, params)
end
def filter_submitters_by_template_id(submitters, params)
return submitters.where(template_id: params[:template_id]) if params[:template_id].is_a?(Array)
template = Template.find_by(id: params[:template_id])
return submitters.none if template.nil? || !can?(:read, template)
if template.account_id == current_user.account_id &&
params[:completed_after].blank? && params[:completed_before].blank?
account_id_bind = Submitter.predicate_builder.build_bind_attribute('account_id', current_user.account_id)
submitters = submitters.unscope(where: :account_id)
.where((Submitter.arel_table[:account_id] + 0).eq(account_id_bind))
end
submitters.where(template_id: template.id)
end
def assign_external_id(submitter, attrs)
submitter.external_id = attrs[:application_key] if attrs.key?(:application_key)
submitter.external_id = attrs[:external_id] if attrs.key?(:external_id)
@@ -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)
@@ -30,7 +30,7 @@ module Mcp
}
}.freeze
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
# rubocop:disable-next Metrics/AbcSize, Metrics/MethodLength
def call
account = current_user.account
@@ -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)
@@ -87,6 +89,5 @@ module Mcp
edit_url: edit_template_url(@template)
)
end
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
end
end
@@ -66,7 +66,7 @@ module Mcp
}
}.freeze
# rubocop:disable Metrics
# rubocop:disable-next Metrics
def call
@template = Template.accessible_by(current_ability).find(mcp_params['template_id'])
@@ -115,6 +115,5 @@ module Mcp
rescue Submissions::CreateFromSubmitters::BaseError => e
render_tool_error(e.message)
end
# rubocop:enable Metrics
end
end
+1 -2
View File
@@ -1,9 +1,8 @@
# frozen_string_literal: true
class PasswordsController < Devise::PasswordsController
# rubocop:disable Rails/LexicallyScopedActionFilter
# rubocop:disable-next Rails/LexicallyScopedActionFilter
skip_before_action :require_no_authentication, only: %i[edit update]
# rubocop:enable Rails/LexicallyScopedActionFilter
around_action :with_browser_locale
@@ -53,7 +53,7 @@ class PreviewDocumentPageController < ActionController::API
File.open(file_path, File::RDWR | File::CREAT, 0o644) do |file|
file.flock(File::LOCK_EX)
# rubocop:disable Style/ZeroLengthPredicate
# rubocop:disable-next Style/ZeroLengthPredicate
if file.size.zero?
cleanup_stale_tempfiles
@@ -63,7 +63,6 @@ class PreviewDocumentPageController < ActionController::API
else
FileUtils.touch(file_path)
end
# rubocop:enable Style/ZeroLengthPredicate
file.flock(File::LOCK_UN)
@@ -14,7 +14,7 @@ class SendSubmissionEmailController < ApplicationController
template = Template.find_by!(slug: params[:template_slug])
@submitter =
Submitter.completed.where(submission: template.submissions).find_by(email: params[:email].to_s.downcase)
Submitter.completed.where(template_id: template.id).find_by(email: params[:email].to_s.downcase)
elsif params[:submission_slug]
submission = Submission.find_by!(slug: params[:submission_slug])
+20 -7
View File
@@ -34,7 +34,7 @@ class StartFormController < ApplicationController
@submitter = find_or_initialize_submitter(@template, submitter_params)
if @submitter.completed_at?
redirect_to start_form_completed_path(@template.slug, submitter_params.compact_blank)
redirect_to start_form_completed_path(@template.slug, submitter_params.compact_blank.merge(lang:))
else
if Templates.filter_undefined_submitters(@template.submitters).size > 1 && @submitter.new_record?
@error_message = multiple_submitters_error_message
@@ -59,7 +59,7 @@ class StartFormController < ApplicationController
Submitters::StartForm.assign_start_form_cookie(@submitter, request)
redirect_to submit_form_path(@submitter.slug)
redirect_to submit_form_path(@submitter.slug, lang:)
else
render :show, status: :unprocessable_content
end
@@ -80,7 +80,7 @@ class StartFormController < ApplicationController
raise ActionController::RoutingError, I18n.t('not_found') if required_params.any? { |_, v| v.blank? } ||
required_params.except('name').compact_blank.blank?
@submitter = Submitter.where(submission: @template.submissions)
@submitter = Submitter.where(template_id: @template.id)
.where.not(completed_at: nil)
.find_by!(required_params.except('name'))
end
@@ -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
@@ -150,7 +159,7 @@ class StartFormController < ApplicationController
return render :show, status: :unprocessable_content if submitter.errors.present?
if Submitters::StartForm.verify_2fa_and_save_submitter(submitter, request, is_new_record: submitter.new_record?)
redirect_to submit_form_path(submitter.slug)
redirect_to submit_form_path(submitter.slug, lang:)
else
if defined?(Rollbar) && template.preferences['shared_link_2fa'] != true
Rollbar.info("2FA link requested: #{submitter.id}")
@@ -167,10 +176,14 @@ class StartFormController < ApplicationController
render :error, status: :unprocessable_content
rescue Submitters::UnableToSendCode, Submitters::InvalidOtp => e
redirect_to start_form_path(template.slug, params: submitter_params.merge(email_verification: true)),
redirect_to start_form_path(template.slug, lang:, params: submitter_params.merge(email_verification: true)),
alert: e.message
rescue RateLimit::LimitApproached
redirect_to start_form_path(template.slug, params: submitter_params.merge(email_verification: true)),
redirect_to start_form_path(template.slug, lang:, params: submitter_params.merge(email_verification: true)),
alert: I18n.t(:too_many_attempts)
end
def lang
params[:lang].presence
end
end
@@ -16,21 +16,21 @@ class StartFormEmail2faSendController < ApplicationController
.submitters.new(**submitter_params, account_id: @template.account_id)
if @submitter.email.blank?
return redirect_to start_form_path(@template.slug), alert: I18n.t(:provide_your_email_to_start)
return redirect_to start_form_path(@template.slug, lang:), alert: I18n.t(:provide_your_email_to_start)
end
Submitters.send_shared_link_email_verification_code(@submitter, request:)
redir_params = { notice: I18n.t(:code_has_been_resent) } if params[:resend]
redirect_to start_form_path(@template.slug, params: submitter_params.merge(email_verification: true)),
redirect_to start_form_path(@template.slug, lang:, params: submitter_params.merge(email_verification: true)),
**redir_params
rescue Submitters::BouncedEmail => e
@error_message = e.message
render 'start_form/error', status: :unprocessable_content
rescue Submitters::UnableToSendCode => e
redirect_to start_form_path(@template.slug, params: submitter_params.merge(email_verification: true)),
redirect_to start_form_path(@template.slug, lang:, params: submitter_params.merge(email_verification: true)),
alert: e.message
end
@@ -66,4 +66,8 @@ class StartFormEmail2faSendController < ApplicationController
attrs[:email] = Submissions.normalize_email(attrs[:email])
end
end
def lang
params[:lang].presence
end
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',
@@ -25,5 +25,7 @@ class SubmissionsExportController < ApplicationController
end
end
def new; end
def new
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]
render params[:name], layout: 'plain'
end
end
+16 -3
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]
@@ -20,7 +21,7 @@ class SubmitFormController < ApplicationController
return render :email_2fa unless Submitters::AuthorizedForForm.pass_email_2fa?(@submitter, request)
if @submitter.completed_at? || submission.completed_at?
return redirect_to submit_form_completed_path(@submitter.slug)
return redirect_to submit_form_completed_path(@submitter.slug, lang:)
end
@form_configs = Submitters::FormConfigs.call(@submitter, CONFIG_KEYS)
@@ -96,7 +97,7 @@ class SubmitFormController < ApplicationController
return if Submitters::AuthorizedForForm.call(@submitter, current_user, request)
redirect_to submit_form_path(params[:submit_form_slug])
redirect_to submit_form_path(params[:submit_form_slug], lang:)
end
def success; end
@@ -111,10 +112,18 @@ 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)
redirect_to start_form_path(@submitter.submission.template.slug)
redirect_to start_form_path(@submitter.submission.template.slug, lang:)
end
def maybe_render_locked_page
@@ -144,4 +153,8 @@ class SubmitFormController < ApplicationController
ActiveStorage::Attachment.where(record: submission.submitters, name: :attachments)
.preload(:blob).index_by(&:uuid)
end
def lang
params[:lang].presence
end
end
@@ -20,17 +20,17 @@ class SubmitFormEmail2fasController < ApplicationController
{ value: @submitter.slug, expires: Submitters::StartForm::COOKIES_TTL.from_now,
**Submitters::StartForm::COOKIES_DEFAULTS }
redirect_to submit_form_path(@submitter.slug)
redirect_to submit_form_path(@submitter.slug, lang:)
else
redirect_to submit_form_path(@submitter.slug, status: :error), alert: I18n.t(:invalid_code)
redirect_to submit_form_path(@submitter.slug, status: :error, lang:), alert: I18n.t(:invalid_code)
end
rescue RateLimit::LimitApproached
redirect_to submit_form_path(@submitter.slug, status: :error), alert: I18n.t(:too_many_attempts)
redirect_to submit_form_path(@submitter.slug, status: :error, lang:), alert: I18n.t(:too_many_attempts)
end
def update
if @submitter.submission_events.where(event_type: 'send_2fa_email').exists?(created_at: 15.seconds.ago..)
return redirect_to submit_form_path(@submitter.slug, status: :error), alert: I18n.t(:rate_limit_exceeded)
return redirect_to submit_form_path(@submitter.slug, status: :error, lang:), alert: I18n.t(:rate_limit_exceeded)
end
RateLimit.call("send-email-code-#{@submitter.id}", limit: 2, ttl: 45.seconds, enabled: true)
@@ -38,19 +38,24 @@ class SubmitFormEmail2fasController < ApplicationController
if Docuseal.multitenant? && Submitters.email_bounced_recently?(@submitter.email)
Rollbar.warning("Bounced OTP email for submitter: #{@submitter.id}") if defined?(Rollbar)
return redirect_to submit_form_path(@submitter.slug, status: :error), alert: I18n.t(:verification_email_bounced)
return redirect_to submit_form_path(@submitter.slug, status: :error, lang:),
alert: I18n.t(:verification_email_bounced)
end
SendSubmitterVerificationEmailJob.perform_async('submitter_id' => @submitter.id, 'locale' => I18n.locale.to_s)
redir_params = params[:resend] ? { alert: I18n.t(:code_has_been_resent) } : {}
redirect_to submit_form_path(@submitter.slug, status: :sent), **redir_params
redirect_to submit_form_path(@submitter.slug, status: :sent, lang:), **redir_params
rescue RateLimit::LimitApproached
redirect_to submit_form_path(@submitter.slug, status: :error), alert: I18n.t(:too_many_attempts)
redirect_to submit_form_path(@submitter.slug, status: :error, lang:), alert: I18n.t(:too_many_attempts)
end
def load_submitter
@submitter = Submitter.find_by!(slug: params[:submitter_slug])
end
def lang
params[:lang].presence
end
end
@@ -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: {
@@ -41,7 +41,9 @@ class TemplateFoldersController < ApplicationController
render_infinite_scroll(@pagy, @templates, @template_folders) if turbo_infinite_scroll?
end
def edit; end
def edit
render layout: 'plain'
end
def update
if @template_folder != current_account.default_template_folder &&
@@ -7,6 +7,8 @@ class TemplatesCloneController < ApplicationController
authorize!(:create, Template)
@template = Template.new(name: "#{@base_template.name} (#{I18n.t('clone')})")
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
@@ -3,7 +3,9 @@
class TemplatesFoldersController < ApplicationController
load_and_authorize_resource :template
def edit; end
def edit
render layout: 'plain'
end
def update
authorize!(:update, @template)
@@ -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)
+3 -1
View File
@@ -4,7 +4,9 @@ class UserInitialsController < ApplicationController
before_action :load_user_config
authorize_resource :user_config
def edit; end
def edit
render layout: 'plain'
end
def update
file = params[:file]
@@ -4,7 +4,9 @@ class UserSignaturesController < ApplicationController
before_action :load_user_config
authorize_resource :user_config
def edit; end
def edit
render layout: 'plain'
end
def update
file = params[:file]
+6 -2
View File
@@ -31,9 +31,13 @@ class UsersController < ApplicationController
end
end
def new; end
def new
render layout: turbo_native_app? ? 'plain' : true
end
def edit; end
def edit
render layout: turbo_native_app? ? 'plain' : true
end
def create
existing_user = User.accessible_by(current_ability).find_by(email: @user.email)
@@ -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
@@ -66,7 +70,7 @@ class WebhookSettingsController < ApplicationController
SendTestWebhookRequestJob.perform_async(
'submitter_id' => submitter.id,
'event_uuid' => SecureRandom.uuid,
'event_uuid' => SecureRandom.uuid_v7,
'webhook_url_id' => @webhook_url.id
)
+1 -1
View File
@@ -55,7 +55,7 @@ export default targetable(class extends HTMLElement {
this.input.files = dataTransfer.files
if (this.input.webkitEntries.length) {
if (this.input.webkitEntries?.length) {
this.input.dataset.file = `${dataTransfer.files[0].name}`
}
+2 -2
View File
@@ -772,7 +772,7 @@
class="sticky bottom-0 z-20"
>
<native-action
v-if="nativePlatform && withDocumentsList && (isBreakpointLg || isMobile) && sortedDocuments.length && editable"
v-if="nativePlatform && withDocumentsList && (isBreakpointLg || isMobile) && editable"
data-placement="drawer"
data-side="leading"
data-icon="files"
@@ -782,7 +782,7 @@
data-view="documents"
/>
<native-action
v-if="nativePlatform && withFieldsList && isBreakpointLg && sortedDocuments.length && editable"
v-if="nativePlatform && withFieldsList && isBreakpointLg && editable"
data-placement="drawer"
data-side="trailing"
data-icon="plus"
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')"
/>
<div :class="inline ? '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"
@@ -33,7 +33,7 @@
>{{ t('available_in_pro') }}</a>
</div>
<form @submit.prevent="validateSaveAndClose">
<div class="my-4">
<div :class="inline && nativePlatform === 'android' ? 'mt-1 mb-4' : 'my-4'">
<div
v-for="(condition, cindex) in conditions"
:key="cindex"
@@ -168,7 +168,7 @@
<script>
export default {
name: 'ConditionModal',
inject: ['t', 'template', 'withConditions'],
inject: ['t', 'template', 'withConditions', 'nativePlatform'],
props: {
item: {
type: Object,
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')"
/>
<div :class="inline ? '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"
@@ -27,7 +27,7 @@
<div>
<label
dir="auto"
class="label text-sm"
:class="['label text-sm', { 'pt-0 mt-1': inline && nativePlatform === 'android' }]"
for="description_field"
>
{{ t('description') }}
@@ -71,7 +71,7 @@
<script>
export default {
name: 'DescriptionModal',
inject: ['t', 'template'],
inject: ['t', 'template', 'nativePlatform'],
props: {
field: {
type: Object,
@@ -36,7 +36,7 @@
<CropView
v-if="cropPageItem"
class="absolute inset-0 z-10 bg-base-100"
:style="inline ? { paddingTop: '70px' } : null"
:style="inline && nativePlatform === 'ios' ? { paddingTop: '70px' } : null"
:template-id="template.id"
:page="cropPageItem"
:image-url="thumbUrl(cropPageItem)"
@@ -47,7 +47,7 @@
<RedactView
v-else-if="redactPageItem"
class="absolute inset-0 z-10 bg-base-100"
:style="inline ? { paddingTop: '70px' } : null"
:style="inline && nativePlatform === 'ios' ? { paddingTop: '70px' } : null"
:template-id="template.id"
:page="redactPageItem"
:image-url="thumbUrl(redactPageItem)"
@@ -63,14 +63,14 @@
>
<div
class="flex-1 overflow-y-auto overflow-x-hidden px-4 md:px-6 py-4 space-y-4"
:style="inline ? { paddingTop: '86px' } : null"
:style="inline ? { paddingInline: '18px', ...(nativePlatform === 'ios' ? { paddingTop: '86px' } : {}) } : null"
>
<div
v-for="(doc, docIndex) in layout"
:key="doc.attachmentUuid"
:data-uuid="doc.attachmentUuid"
class="relative"
:style="inline ? { scrollMarginTop: '86px' } : null"
:style="inline && nativePlatform === 'ios' ? { scrollMarginTop: '86px' } : null"
>
<div
class="flex items-center pb-2"
@@ -191,7 +191,7 @@
:key="page.id"
:data-page-id="page.id"
class="relative min-w-0 cursor-pointer group"
:style="inline ? { scrollMarginTop: '86px' } : null"
:style="inline && nativePlatform === 'ios' ? { scrollMarginTop: '86px' } : null"
draggable="true"
@click="selectedPageId = page.id"
@mousedown="onPageMousedown(page, $event)"
@@ -260,7 +260,7 @@
</div>
<div
class="flex-none px-4 border-t pt-3 flex flex-col gap-3 md:w-56 md:border-t-0 md:border-l md:py-4 md:gap-0"
:class="{ 'pb-3': !inline }"
:class="{ 'pb-3': !inline || nativePlatform === 'android' }"
>
<div class="grid grid-cols-4 gap-2 md:block md:space-y-2">
<button
@@ -419,7 +419,7 @@ export default {
IconEraser,
IconCrop
},
inject: ['t', 'baseFetch'],
inject: ['t', 'baseFetch', 'nativePlatform'],
props: {
template: {
type: Object,
@@ -608,10 +608,10 @@ export default {
return !['stamp', 'heading', 'strikethrough'].includes(this.field.type)
},
showCondition () {
return this.withCondition && (this.withConditions || this.nativePlatform !== 'ios') && !['stamp', 'heading'].includes(this.field.type)
return this.withCondition && (this.withConditions || !this.nativePlatform) && !['stamp', 'heading'].includes(this.field.type)
},
showFormula () {
return (this.field.type === 'number' || this.field.type === 'date' || this.field.type === 'payment' || !!this.field.preferences?.formula) && (this.withFormula || this.nativePlatform !== 'ios')
return (this.field.type === 'number' || this.field.type === 'date' || this.field.type === 'payment' || !!this.field.preferences?.formula) && (this.withFormula || !this.nativePlatform)
},
showRequired () {
return this.withRequired && !['phone', 'stamp', 'verification', 'strikethrough', 'heading'].includes(this.field.type)
@@ -484,7 +484,7 @@
</label>
</li>
<li
v-if="withCondition && (withConditions || nativePlatform !== 'ios') && field.type != 'stamp' && field.type != 'heading'"
v-if="withCondition && (withConditions || !nativePlatform) && field.type != 'stamp' && field.type != 'heading'"
class="field-settings-condition"
>
<label
@@ -500,7 +500,7 @@
</label>
</li>
<li
v-if="(field.type == 'number' || field.type == 'date' || field.preferences?.formula) && (withFormula || nativePlatform !== 'ios')"
v-if="(field.type == 'number' || field.type == 'date' || field.preferences?.formula) && (withFormula || !nativePlatform)"
class="field-settings-formula"
>
<label
+1 -1
View File
@@ -275,7 +275,7 @@
</div>
</button>
<div
v-else-if="type == 'phone' && nativePlatform !== 'ios' && (fieldTypes.length === 0 || fieldTypes.includes(type))"
v-else-if="type == 'phone' && !nativePlatform && (fieldTypes.length === 0 || fieldTypes.includes(type))"
class="tooltip tooltip-bottom flex"
:class="{'tooltip-bottom-end': withPayment, 'tooltip-bottom': !withPayment }"
:data-tip="t('unlock_sms_verified_phone_number_field_with_paid_plan_use_text_field_for_phone_numbers_without_verification')"
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')"
/>
<div :class="inline ? '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"
@@ -21,7 +21,7 @@
@click.prevent="$emit('close')"
>&times;</a>
</div>
<div class="mt-4">
<div :class="inline && nativePlatform === 'android' ? 'mt-1' : 'mt-4'">
<div>
<div class="flex flex-wrap items-center gap-1.5">
<span>
@@ -200,7 +200,7 @@ export default {
components: {
IconChevronDown
},
inject: ['t', 'template'],
inject: ['t', 'template', 'nativePlatform'],
props: {
field: {
type: Object,
@@ -7,7 +7,7 @@
class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')"
/>
<div :class="inline ? '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"
@@ -32,7 +32,7 @@
class="link"
>{{ t('available_in_pro') }}</a>
</div>
<div class="flex flex-wrap mb-2 gap-y-1 pt-1">
<div :class="['flex flex-wrap mb-2 gap-y-1', inline && nativePlatform === 'android' ? 'mt-1' : 'pt-1']">
<button
v-for="f in fields"
:key="f.uuid"
@@ -152,7 +152,7 @@ export default {
IconCodePlus,
IconMathFunction
},
inject: ['t', 'template', 'withFormula'],
inject: ['t', 'template', 'withFormula', 'nativePlatform'],
props: {
field: {
type: Object,
@@ -203,7 +203,7 @@
>{{ t('learn_more') }}</a>
</div>
<li
v-if="withFormula || nativePlatform !== 'ios'"
v-if="withFormula || !nativePlatform"
class="field-settings-formula mb-1"
>
<label
@@ -233,7 +233,7 @@
</label>
</li>
<li
v-if="withCondition && (withConditions || nativePlatform !== 'ios')"
v-if="withCondition && (withConditions || !nativePlatform)"
class="field-settings-condition mt-1"
>
<label
@@ -5,7 +5,7 @@
class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="$emit('close')"
/>
<div :class="inline ? '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"
@@ -63,7 +63,7 @@ import { IconUser, IconInnerShadowTop } from '@tabler/icons-vue'
export default {
name: 'RevisionsModal',
components: { IconUser, IconInnerShadowTop },
inject: ['t', 'baseFetch'],
inject: ['t', 'baseFetch', 'nativePlatform'],
props: {
template: {
type: Object,
@@ -259,7 +259,7 @@ export default {
return true
},
showCondition () {
return this.withCondition && (this.withConditions || this.nativePlatform !== 'ios')
return this.withCondition && (this.withConditions || !this.nativePlatform)
},
fieldNames: FieldType.computed.fieldNames,
fieldLabels: FieldType.computed.fieldLabels
+2 -2
View File
@@ -100,7 +100,7 @@ class ProcessSubmitterCompletionJob
WebhookUrls.for_account_id(submitter.account_id, %w[form.completed submission.completed]).each do |webhook|
if webhook.events.include?('form.completed')
event_uuids['form.completed'] ||= SecureRandom.uuid
event_uuids['form.completed'] ||= SecureRandom.uuid_v7
SendFormCompletedWebhookRequestJob.perform_async('submitter_id' => submitter.id,
'event_uuid' => event_uuids['form.completed'],
@@ -109,7 +109,7 @@ class ProcessSubmitterCompletionJob
next unless webhook.events.include?('submission.completed') && is_last
event_uuids['submission.completed'] ||= SecureRandom.uuid
event_uuids['submission.completed'] ||= SecureRandom.uuid_v7
SendSubmissionCompletedWebhookRequestJob.perform_async('submission_id' => submitter.submission_id,
'event_uuid' => event_uuids['submission.completed'],
+2 -1
View File
@@ -15,7 +15,8 @@
#
# Indexes
#
# index_accounts_on_uuid (uuid) UNIQUE
# index_accounts_on_created_at (created_at)
# index_accounts_on_uuid (uuid) UNIQUE
#
class Account < ApplicationRecord
attribute :uuid, :string, default: -> { SecureRandom.uuid }
+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!)
+1 -1
View File
@@ -22,7 +22,7 @@
# index_webhook_events_on_webhook_url_id_and_id (webhook_url_id,id)
#
class WebhookEvent < ApplicationRecord
attribute :uuid, :string, default: -> { SecureRandom.uuid }
attribute :uuid, :string, default: -> { SecureRandom.uuid_v7 }
belongs_to :webhook_url, optional: true
belongs_to :account, optional: true
+2 -2
View File
@@ -133,7 +133,7 @@
<% end %>
<% end %>
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::ALLOW_TO_DECLINE_KEY) %>
<% if can?(:manage, account_config) && (!turbo_native_ios? || !Docuseal.multitenant? || can?(:manage, :disable_decline)) %>
<% if can?(:manage, account_config) && (!turbo_native_app? || !Docuseal.multitenant? || can?(:manage, :disable_decline)) %>
<%= form_for account_config, url: account_configs_path, method: :post do |f| %>
<%= f.hidden_field :key %>
<div class="flex items-center justify-between gap-4 py-2.5">
@@ -156,7 +156,7 @@
<% end %>
<% end %>
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::ALLOW_TO_DELEGATE_KEY) %>
<% if can?(:manage, account_config) && (!turbo_native_ios? || !Docuseal.multitenant? || can?(:manage, :delegate_form)) %>
<% if can?(:manage, account_config) && (!turbo_native_app? || !Docuseal.multitenant? || can?(:manage, :delegate_form)) %>
<%= form_for account_config, url: account_configs_path, method: :post do |f| %>
<%= f.hidden_field :key %>
<div class="flex items-center justify-between gap-4 py-2.5">
@@ -1,4 +1,4 @@
<% unless turbo_native_ios? %>
<% unless turbo_native_app? %>
<tr class="group">
<td>
<div class="flex items-center space-x-1">
+17
View File
@@ -7,4 +7,21 @@
-webkit-user-drag: none;
-webkit-touch-callout: none;
}
<% if turbo_native_android? %>
input[type="date"] {
appearance: none;
-webkit-appearance: none;
}
input[type="date"]::-webkit-calendar-picker-indicator {
display: none;
}
@media (max-width: 767px) {
div:has(> #account_settings_menu) + * {
margin-top: 0 !important;
}
}
<% end %>
</style>
+1 -3
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="modal"></turbo-frame>
<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">
@@ -22,7 +22,7 @@
<% end %>
</div>
<%= render 'bcc_form', config: @bcc_config %>
<% unless can?(:manage, :personalization_restricted) || (turbo_native_ios? && !can?(:manage, :email_reminders)) %>
<% unless can?(:manage, :personalization_restricted) || (turbo_native_app? && !can?(:manage, :email_reminders)) %>
<div class="flex justify-between items-end mb-4 mt-8">
<h2 class="text-2xl md:text-3xl font-bold">
<%= t('sign_request_email_reminders') %>
@@ -10,7 +10,7 @@
<%= render 'documents_copy_email_form' %>
<%= render 'submitter_completed_email_form' %>
</div>
<% if !turbo_native_ios? || can?(:manage, :custom_logo) %>
<% if !turbo_native_app? || can?(:manage, :custom_logo) %>
<p class="text-3xl md:text-4xl font-bold mb-4 mt-8">
<%= t('company_logo') %>
</p>
@@ -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>
+8 -6
View File
@@ -1,11 +1,13 @@
<script type="application/json" id="native_path_configuration"><%= render partial: 'layouts/native_path_configuration', formats: :json %></script>
<% if signed_in? %>
<native-action data-placement="profile" data-icon="user">
<%= link_to t('profile'), settings_profile_index_path %>
</native-action>
<native-action data-placement="profile" data-icon="settings">
<%= link_to t('settings'), settings_path %>
</native-action>
<% unless turbo_native_android? %>
<native-action data-placement="profile" data-icon="user">
<%= link_to t('profile'), settings_profile_index_path %>
</native-action>
<native-action data-placement="profile" data-icon="settings">
<%= link_to t('settings'), settings_path %>
</native-action>
<% end %>
<% if current_account.testing? && (can?(:manage, EncryptedConfig) || current_user != true_user) %>
<native-action data-placement="test_mode" data-icon="code" data-label="<%= t('exit_test_mode') %>">
<%= button_to '', testing_account_path, method: :delete, form: { data: { turbo_action: 'replace' } } %>
+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">
+3 -3
View File
@@ -43,7 +43,7 @@
<%= link_to t('storage'), settings_storage_index_path, class: 'text-base hover:bg-base-300', data: nav_link_data %>
</li>
<% end %>
<% if can?(:read, EncryptedConfig.new(key: 'submitter_invitation_sms', account: current_account)) && true_user == current_user && (!turbo_native_ios? || can?(:manage, :sms_verification)) %>
<% if can?(:read, EncryptedConfig.new(key: 'submitter_invitation_sms', account: current_account)) && true_user == current_user && (!turbo_native_app? || can?(:manage, :sms_verification)) %>
<li>
<%= link_to 'SMS', settings_sms_path, class: 'text-base hover:bg-base-300', data: nav_link_data %>
</li>
@@ -84,7 +84,7 @@
</li>
<% end %>
<% end %>
<% if !Docuseal.demo? && !turbo_native_ios? && can?(:manage, EncryptedConfig) && (current_user != true_user || !current_account.linked_account_account) %>
<% if !Docuseal.demo? && !turbo_native_app? && can?(:manage, EncryptedConfig) && (current_user != true_user || !current_account.linked_account_account) %>
<li>
<%= content_for(:pro_link) || link_to(Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/plans") : "#{Docuseal::CLOUD_URL}/sign_up?#{{ redir: "#{Docuseal::CONSOLE_URL}/on_premises" }.to_query}", class: 'text-base hover:bg-base-300', data: { turbo: false }) do %>
<%= t('plans') %>
@@ -107,7 +107,7 @@
<% end %>
</li>
<% end %>
<% if (!Docuseal.multitenant? || can?(:manage, :saml_sso)) && can?(:read, EncryptedConfig.new(key: 'saml_configs', account: current_account)) && true_user == current_user && (!turbo_native_ios? || can?(:manage, :saml_sso)) %>
<% if (!Docuseal.multitenant? || can?(:manage, :saml_sso)) && can?(:read, EncryptedConfig.new(key: 'saml_configs', account: current_account)) && true_user == current_user && (!turbo_native_app? || can?(:manage, :saml_sso)) %>
<li>
<%= link_to 'SSO', settings_sso_index_path, class: 'text-base hover:bg-base-300', data: nav_link_data %>
</li>
@@ -1,7 +1,9 @@
<form action="<%= url_for %>" method="get" class="dropdown dropdown-top hidden md:inline">
<label tabindex="0" class="btn btn-sm h-10">
<%= svg_icon('arrow_sort', class: 'w-5 h-5') %>
</label>
<% unless turbo_native_app? %>
<label tabindex="0" class="btn btn-sm h-10">
<%= svg_icon('arrow_sort', class: 'w-5 h-5') %>
</label>
<% end %>
<ul tabindex="0" class="dropdown-content z-[10] menu p-2 shadow bg-base-100 rounded-box mb-1 min-w-48">
<native-action class="contents" data-menu="<%= t('sort_by') %>" data-menu-icon="arrow_sort" data-icon="sort_descending_numbers" data-selected="<%= selected_order == 'created_at' %>">
<toggle-cookies data-value="created_at" data-key="dashboard_templates_order">
+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>
+2 -3
View File
@@ -1,8 +1,7 @@
<% 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 pb-6" 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>
+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">
@@ -23,7 +23,7 @@
<div>
<%= t('we_sent_a_one_time_verification_code_to_your_email_address_please_enter_the_code_below_to_continue') %>
</div>
<%= form_for '', url: @resubmit_submitter ? resubmit_form_path : start_form_path(@template.slug), method: :put, html: { class: 'space-y-4', id: 'code_form' } do |f| %>
<%= form_for '', url: @resubmit_submitter ? resubmit_form_path : start_form_path(@template.slug, lang: params[:lang].presence), method: :put, html: { class: 'space-y-4', id: 'code_form' } do |f| %>
<div dir="auto" class="form-control !mt-0">
<%= f.hidden_field 'resubmit', value: params[:resubmit] %>
<%= f.hidden_field 'submitter[name]', value: params[:name] || params.dig(:submitter, :name) %>
@@ -52,7 +52,7 @@
<% if @resubmit_submitter %>
<%= button_to t(:re_send_email), resubmit_form_path, params: { resubmit: @resubmit_submitter.slug }, method: :put, id: 'resend_code', class: 'hidden' %>
<% else %>
<%= button_to t(:re_send_email), start_form_email_2fa_send_index_path, params: { slug: @template.slug, resend: true, submitter: { name: params[:name] || params.dig(:submitter, :name), email: params[:email] || params.dig(:submitter, :email), phone: params[:phone] || params.dig(:submitter, :phone) } }.compact, method: :post, id: 'resend_code', class: 'hidden' %>
<%= button_to t(:re_send_email), start_form_email_2fa_send_index_path, params: { slug: @template.slug, resend: true, submitter: { name: params[:name] || params.dig(:submitter, :name), email: params[:email] || params.dig(:submitter, :email), phone: params[:phone] || params.dig(:submitter, :phone) }, lang: params[:lang] }.compact, method: :post, id: 'resend_code', class: 'hidden' %>
<% end %>
</div>
</div>
+1 -1
View File
@@ -28,7 +28,7 @@
</div>
</div>
<% if !@template.archived_at? && !@template.account.archived_at? %>
<%= form_for @submitter, url: @resubmit_submitter ? resubmit_form_path : start_form_path(@template.slug), data: { turbo_frame: :_top }, method: :put, html: { class: 'space-y-4' } do |f| %>
<%= form_for @submitter, url: @resubmit_submitter ? resubmit_form_path : start_form_path(@template.slug, lang: params[:lang].presence), data: { turbo_frame: :_top }, method: :put, html: { class: 'space-y-4' } do |f| %>
<%= hidden_field_tag :resubmit, @resubmit_submitter.slug if @resubmit_submitter %>
<% if @error_message %>
<div class="alert items-start bg-base-100 border border-red-400 text-red-400">
+6 -2
View File
@@ -43,14 +43,18 @@
</div>
<p class="text-base-content/80 mt-1">
<% if event.event_type == 'complete_verification' %>
<%= t('submission_event_names.complete_verification_by_html', provider: event.data['method'], submitter_name:) %>
<% identity_name = [event.data['firstname'], event.data['lastname']].compact_blank.join(' ') %>
<%= t('submission_event_names.complete_verification_by_html', provider: event.data['method'], submitter_name: identity_name.presence || submitter_name) %>
<% elsif event.event_type == 'invite_party' && (invited_submitter = @submission.submitters.find { |e| e.uuid == event.data['uuid'] }) && (name = @submission.template_submitters.find { |e| e['uuid'] == event.data['uuid'] }&.dig('name')) %>
<%= t('submission_event_names.invite_party_by_html', invited_submitter_name: [invited_submitter.name || invited_submitter.email || invited_submitter.phone, name].join(' '), submitter_name:) %>
<% 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
@@ -1,4 +1,4 @@
<% unless turbo_native_ios? %>
<% unless turbo_native_app? %>
<toggle-on-checked data-names="is_custom_message" class="block">
<div class="form-control">
<%= render 'sms_settings/placeholder' %>
@@ -1,4 +1,4 @@
<% unless turbo_native_ios? %>
<% unless turbo_native_app? %>
<div class="mt-2 mb-1">
<div class="tooltip tooltip-no-touch w-full" data-tip="<%= t('unlock_with_docuseal_pro') %>">
<%= link_to submitter.sent_at? ? t('re_send_sms') : t('send_sms'), Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/plans") : "#{Docuseal::CLOUD_URL}/sign_up?#{{ redir: "#{Docuseal::CONSOLE_URL}/on_premises" }.to_query}", class: 'btn btn-sm btn-primary text-gray-400 w-full' %>
+4 -4
View File
@@ -6,14 +6,14 @@
<% recipient_form_fields = Accounts.load_recipient_form_fields(current_account) if prefillable_fields.blank? %>
<% can_send_emails = Accounts.can_send_emails?(current_account) %>
<% only_detailed = require_phone_2fa || require_email_2fa || prefillable_fields.present? || recipient_form_fields.present? %>
<% with_list = @template.variables_schema.blank? && (!turbo_native_ios? || can?(:manage, :bulk_send)) %>
<% with_phone = !turbo_native_ios? || can?(:manage, :sms_verification) %>
<% with_list = @template.variables_schema.blank? && (!turbo_native_app? || can?(:manage, :bulk_send)) %>
<% with_phone = !turbo_native_app? || can?(:manage, :sms_verification) %>
<% default_tab = 'email' if default_tab == 'phone' && !with_phone %>
<% variables_form = render 'variables_form', schema: @template.variables_schema if @template.variables_schema.present? && @template.variables_schema.any? { |_, v| !v['disabled'] } %>
<%= render 'shared/turbo_modal_large', title: params[:selfsign] ? t('add_recipients') : t('add_new_recipients') do %>
<% options = [only_detailed ? nil : [t('via_email'), 'email'], only_detailed || !with_phone ? nil : [t('via_phone'), 'phone'], [t('detailed'), 'detailed'], with_list ? [t('upload_list'), 'list'] : nil].compact %>
<% if options.size > 1 %>
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center px-2 block <%= 'mt-4' unless turbo_native_app? %>">
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center px-2 block <%= turbo_native_app? ? ('mt-1.5' if turbo_native_android?) : 'mt-4' %> <%= 'max-sm:hidden' if options.one? { |_, value| value != 'list' } %>">
<div class="flex justify-center">
<% options.each_with_index do |(label, value), index| %>
<%= content_tag(value == 'list' ? 'span' : 'toggle-cookies', data: { value:, key: 'add_recipients_tab' }) do %>
@@ -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">
<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 } 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? %>
@@ -3,11 +3,11 @@
<div class="flex flex-col md:flex-row gap-2">
<div class="form-control w-full">
<%= label_tag 'completed_at_from', t('from'), for: 'date_from', class: 'label text-sm' %>
<%= date_field_tag 'completed_at_from', params[:completed_at_from], id: 'date_from', class: 'base-input !h-10', autocomplete: 'off' %>
<%= date_field_tag 'completed_at_from', params[:completed_at_from], id: 'date_from', class: "base-input !h-10 #{'w-full' if turbo_native_android?}", autocomplete: 'off' %>
</div>
<div class="form-control w-full">
<%= label_tag 'completed_at_to', t('to'), for: 'date_to', class: 'label text-sm' %>
<%= date_field_tag 'completed_at_to', params[:completed_at_to], id: 'date_to', class: 'base-input !h-10', autocomplete: 'off' %>
<%= date_field_tag 'completed_at_to', params[:completed_at_to], id: 'date_to', class: "base-input !h-10 #{'w-full' if turbo_native_android?}", autocomplete: 'off' %>
</div>
</div>
<%= render 'date_buttons' %>
@@ -3,11 +3,11 @@
<div class="flex flex-col md:flex-row gap-2">
<div class="form-control w-full">
<%= label_tag 'created_at_from', t('from'), for: 'date_from', class: 'label text-sm' %>
<%= date_field_tag 'created_at_from', params[:created_at_from], id: 'date_from', class: 'base-input !h-10', autocomplete: 'off' %>
<%= date_field_tag 'created_at_from', params[:created_at_from], id: 'date_from', class: "base-input !h-10 #{'w-full' if turbo_native_android?}", autocomplete: 'off' %>
</div>
<div class="form-control w-full">
<%= label_tag 'created_at_to', t('to'), for: 'date_to', class: 'label text-sm' %>
<%= date_field_tag 'created_at_to', params[:created_at_to], id: 'date_to', class: 'base-input !h-10', autocomplete: 'off' %>
<%= date_field_tag 'created_at_to', params[:created_at_to], id: 'date_to', class: "base-input !h-10 #{'w-full' if turbo_native_android?}", autocomplete: 'off' %>
</div>
</div>
<%= render 'date_buttons' %>
+3 -2
View File
@@ -34,6 +34,7 @@
<%= form_for '', url: submit_form_email_2fa_path, method: :post, html: { class: 'space-y-4', id: 'code_form' } do |f| %>
<div dir="auto" class="form-control !mt-0">
<%= f.hidden_field :submitter_slug, value: @submitter.slug %>
<%= f.hidden_field :lang, value: params[:lang] if params[:lang].present? %>
<%= f.text_field :one_time_code, required: true, inputmode: 'numeric', class: 'base-input text-center', placeholder: 'XXXXXX' %>
<div class="flex justify-between items-center mt-1">
<span>
@@ -55,7 +56,7 @@
<%= f.button button_title(title: t('submit')), class: 'base-button' %>
</toggle-submit>
<% end %>
<%= button_to t(:re_send_email), submit_form_email_2fa_path, params: { submitter_slug: @submitter.slug, resend: true }, method: :put, form: { id: 'resend_code_form', class: 'hidden' } %>
<%= button_to t(:re_send_email), submit_form_email_2fa_path, params: { submitter_slug: @submitter.slug, resend: true, lang: params[:lang] }.compact_blank, method: :put, form: { id: 'resend_code_form', class: 'hidden' } %>
<% else %>
<% if params[:t] %>
<fetch-form data-onload="true">
@@ -63,7 +64,7 @@
</fetch-form>
<% end %>
<toggle-submit dir="auto" class="form-control">
<%= button_to button_title(title: t('send_verification_code')), submit_form_email_2fa_path, params: { submitter_slug: @submitter.slug }, method: :put, class: 'base-button w-full' %>
<%= button_to button_title(title: t('send_verification_code')), submit_form_email_2fa_path, params: { submitter_slug: @submitter.slug, lang: params[:lang] }.compact_blank, method: :put, class: 'base-button w-full' %>
</toggle-submit>
<% end %>
<% else %>
+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">
+2 -2
View File
@@ -1,6 +1,6 @@
<%= 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 } do |f| %>
<div class="form-control my-6">
<%= 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>
<div class="form-control">
+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 %>
+3 -1
View File
@@ -5,7 +5,9 @@
<% is_show_header = submissions_count != 0 || params[:q].present? || params[:status].present? || filter_params.present? %>
<%= render 'title', template: @template, with_export: is_show_header %>
<% if turbo_native_app? %>
<native-action data-placement="search" data-native="search" data-label="<%= t('search') %>" data-url="<%= search_index_path(filter_params.to_h.merge({ 'scope' => 'submissions', 'template_id' => @template.id, 'archived' => ('true' if @template.archived_at?) }.compact)) %>"></native-action>
<% if !turbo_native_android? || submissions_count >= 5 || params[:q].present? || params[:status].present? || filter_params.present? %>
<native-action data-placement="search" data-native="search" data-label="<%= t('search') %>" data-url="<%= search_index_path(filter_params.to_h.merge({ 'scope' => 'submissions', 'template_id' => @template.id, 'archived' => ('true' if @template.archived_at?) }.compact)) %>"></native-action>
<% end %>
<% if !@template.archived_at? && can?(:create, Submission) %>
<native-action data-placement="footer" data-icon="send" data-haptic="true" data-label="<%= t('send_to_recipients') %>">
<a href="<%= new_template_submission_path(@template) %>" data-turbo-frame="modal" data-native-modal="<%= 'medium' if @template.submitters.size < 3 %>"></a>
+5 -4
View File
@@ -1,11 +1,12 @@
<%= form_for @template, url: template_clone_index_path(@base_template), data: { turbo_frame: :_top }, html: { autocomplete: :off } 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 %>
<% if (can?(:manage, :tenants) || true_user != current_user) && accounts.where.not(id: current_account.id).exists? %>
<div class="form-control -mb-2 mt-2">
<% with_accounts = (can?(:manage, :tenants) || true_user != current_user) && accounts.where.not(id: current_account.id).exists? %>
<% if with_accounts %>
<div class="form-control -mb-2 <%= turbo_native_android? ? 'mt-1.5' : 'mt-2' %>">
<%= select_tag :account_id, options_for_select([current_account, *accounts.order(:name)].uniq.map { |e| [e.name, e.id] }, current_account.id), required: true, class: 'base-select' %>
</div>
<% end %>
<div class="form-control mt-4">
<div class="form-control <%= turbo_native_android? && !with_accounts ? 'mt-1.5' : 'mt-4' %>">
<%= f.text_field :name, required: true, placeholder: t('document_name'), class: 'base-input', dir: 'auto' %>
</div>
<div class="mt-3 mb-4 flex items-center justify-between">
@@ -1,4 +1,4 @@
<% unless turbo_native_ios? %>
<% unless turbo_native_app? %>
<div class="alert">
<%= svg_icon('info_circle', class: 'w-6 h-6') %>
<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 } 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: "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 %>
@@ -5,7 +5,7 @@
<% options << [t('recipients'), 'recipients'] if show_recipients %>
<% options << [safe_join([tag.span('API', class: 'md:hidden'), tag.span(t('api_and_embedding'), class: 'hidden md:inline')]), 'api'] if show_api %>
<% if options.size > 1 %>
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= 'mt-3' unless turbo_native_app? %>">
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= turbo_native_app? ? ('mt-1.5' if turbo_native_android?) : 'mt-3' %>">
<div class="join">
<% options.each_with_index do |(label, value), index| %>
<span>
@@ -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') %>
+4 -4
View File
@@ -1,21 +1,21 @@
<% 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 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') %>
<div><%= t('dynamic_template_with_variables_cannot_be_used_via_shared_link') %></div>
</div>
<% end %>
<%= form_for @template, url: template_share_link_path(@template), method: :post, html: { id: 'shared_link_form', autocomplete: 'off', class: 'mt-3' }, data: { close_on_submit: false } do |f| %>
<%= form_for @template, url: template_share_link_path(@template), method: :post, html: { id: 'shared_link_form', autocomplete: 'off', class: turbo_native_android? ? 'mt-1' : 'mt-3' }, data: { close_on_submit: false } do |f| %>
<% if @template.preferences&.dig('require_email_2fa') || @template.preferences&.dig('require_phone_2fa') %>
<label for="template_shared_link" class="tooltip tooltip-bottom tooltip-no-touch flex items-center my-4 justify-between gap-4 p-4 border border-base-300 rounded-2xl bg-base-100" data-tip="<%= t(:templates_that_require_email_or_phone_2fa_cannot_be_used_via_a_shared_link) %>">
<label for="template_shared_link" class="tooltip tooltip-bottom tooltip-no-touch flex items-center <%= turbo_native_android? ? 'mb-4' : 'my-4' %> justify-between gap-4 p-4 border border-base-300 rounded-2xl bg-base-100" data-tip="<%= t(:templates_that_require_email_or_phone_2fa_cannot_be_used_via_a_shared_link) %>">
<span><%= t('enable_shared_link') %></span>
<%= check_box_tag 'shared_link', 'true', false, disabled: true, class: 'toggle' %>
</label>
<% else %>
<label for="template_shared_link" class="flex items-center my-4 justify-between gap-4 p-4 border border-base-300 rounded-2xl bg-base-100">
<label for="template_shared_link" class="flex items-center <%= turbo_native_android? ? 'mb-4' : 'my-4' %> justify-between gap-4 p-4 border border-base-300 rounded-2xl bg-base-100">
<span><%= t('enable_shared_link') %></span>
<submit-form data-on="change" class="flex">
<%= f.check_box :shared_link, { disabled: !can?(:update, @template) || @template.variables_schema.present?, class: 'toggle' }, 'true', 'false' %>
@@ -4,7 +4,7 @@
</p>
<% if can?(:update, @template) %>
<toggle-submit class="block">
<%= button_to button_title(title: t('enable_shared_link'), icon: svg_icon('lock_open', class: 'w-6 h-6')), template_share_link_path(@template), params: { template: { shared_link: true }, redir: template_share_link_qr_path(@template) }, method: :post, data: { turbo: false }, class: 'base-button w-full' %>
<%= button_to button_title(title: t('enable_shared_link'), icon: svg_icon('lock_open', class: 'w-6 h-6')), template_share_link_path(@template), params: { template: { shared_link: true }, redir: template_share_link_qr_path(@template) }, method: :post, class: 'base-button w-full' %>
</toggle-submit>
<% end %>
</div>
+3 -3
View File
@@ -1,6 +1,6 @@
<%= render 'shared/turbo_modal', title: t('update_initials') do %>
<% options = [[t('draw'), 'draw'], [t('upload'), 'upload']] %>
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= 'mt-4' unless turbo_native_app? %>">
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= turbo_native_app? ? ('mt-1.5' if turbo_native_android?) : 'mt-4' %>">
<div class="join">
<% options.each_with_index do |(label, value), index| %>
<span>
@@ -12,7 +12,7 @@
<% end %>
</div>
</toggle-visible>
<div id="draw" class="mt-3">
<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">
<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">
+3 -3
View File
@@ -1,6 +1,6 @@
<%= render 'shared/turbo_modal', title: t('update_signature') do %>
<% options = [[t('draw'), 'draw'], [t('upload'), 'upload']] %>
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= 'mt-4' unless turbo_native_app? %>">
<toggle-visible data-element-ids="<%= options.map(&:last).to_json %>" class="relative text-center block <%= turbo_native_app? ? ('mt-1.5' if turbo_native_android?) : 'mt-4' %>">
<div class="join">
<% options.each_with_index do |(label, value), index| %>
<span>
@@ -12,7 +12,7 @@
<% end %>
</div>
</toggle-visible>
<div id="draw" class="mt-3">
<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">
<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' }, 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
@@ -12,7 +12,7 @@
</span>
</label>
<% end %>
<% unless turbo_native_ios? %>
<% unless turbo_native_app? %>
<a class="text-sm mt-3 px-4 py-2 bg-base-300 rounded-full block" target="_blank" href="<%= Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/plans") : "#{Docuseal::CLOUD_URL}/sign_up?#{{ redir: "#{Docuseal::CONSOLE_URL}/on_premises" }.to_query}" %>">
<%= svg_icon('info_circle', class: 'w-4 h-4 inline align-text-bottom') %>
<%= t('unlock_more_user_roles_with_docuseal_pro') %>
+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 = []
+30 -3
View File
@@ -103,7 +103,22 @@ Rails.application.configure do
config.active_support.report_deprecations = false
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = Logger::Formatter.new
json_formatter = Logger::Formatter.new
json_formatter.define_singleton_method(:call) do |severity, time, _progname, msg|
data = { ts: time.utc.iso8601(3), pid: Process.pid, lvl: severity }
data[:tags] = current_tags.join(',') if current_tags.any?
if msg.is_a?(Hash)
data.merge!(msg)
else
data[:msg] = msg2str(msg)
end
"#{data.to_json}\n"
end
json_formatter.define_singleton_method(:tags_text) { '' }
config.log_formatter = ENV['LOG_FORMATTER'] == 'json' ? json_formatter : Logger::Formatter.new
# Use a different logger for distributed setups.
# require "syslog/logger"
@@ -129,7 +144,12 @@ Rails.application.configure do
config.lograge.enabled = true
config.lograge.base_controller_class = ['ActionController::API', 'ActionController::Base']
config.lograge.formatter = ->(data) { data.except(:path, :location).to_json }
config.lograge.formatter =
if ENV['LOG_FORMATTER'] == 'json'
->(data) { data.except(:path, :location) }
else
->(data) { data.except(:path, :location).to_json }
end
config.lograge.custom_payload do |controller|
params =
@@ -146,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,
+3 -22
View File
@@ -22,7 +22,7 @@ ActiveSupport.on_load(:active_storage_attachment) do
end
end
# rubocop:disable Metrics/BlockLength
# rubocop:disable-next Metrics/BlockLength
ActiveSupport.on_load(:active_storage_blob) do
attribute :uuid, :string, default: -> { SecureRandom.uuid }
attribute :io_data, :string, default: ''
@@ -59,31 +59,12 @@ ActiveSupport.on_load(:active_storage_blob) do
service.delete(key)
end
end
# rubocop:enable Metrics/BlockLength
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
+1 -2
View File
@@ -34,7 +34,7 @@ end
#
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
# rubocop:disable Metrics/BlockLength
# rubocop:disable-next Metrics/BlockLength
Devise.setup do |config|
config.warden do |manager|
manager.default_strategies(scope: :user).unshift(:two_factor_authenticatable)
@@ -336,4 +336,3 @@ Devise.setup do |config|
ActiveSupport.run_load_hooks(:devise_config, config)
end
# rubocop:enable Metrics/BlockLength
+1 -2
View File
@@ -10,9 +10,8 @@ ActionView::Base.field_error_proc = proc do |html_tag, instance|
parsed_html_tag = Nokogiri::HTML::DocumentFragment.parse(html_tag)
parsed_html_tag.children.add_class 'input-error'
# rubocop:disable Rails/OutputSafety
# rubocop:disable-next Rails/OutputSafety
html_tag = parsed_html_tag.to_s.html_safe
# rubocop:enable Rails/OutputSafety
result = html_tag
+1 -2
View File
@@ -72,9 +72,8 @@ module HexaPDF
def terminal_field?
kids = self[:Kids]
# rubocop:disable Rails/Blank
# rubocop:disable-next Rails/Blank
kids.nil? || kids.empty? || kids.none? { |kid| kid&.key?(:T) }
# rubocop:enable Rails/Blank
end
end
+4
View File
@@ -12,3 +12,7 @@ if !ENV['SIDEKIQ_BASIC_AUTH_PASSWORD'].to_s.empty? && defined?(Sidekiq::Web)
end
Sidekiq.strict_args!
Sidekiq.configure_server do |config|
config.logger.formatter = Sidekiq::Logger::Formatters::JSON.new if ENV['LOG_FORMATTER'] == 'json'
end
+28
View File
@@ -830,6 +830,8 @@ 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.'
@@ -1046,10 +1048,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,6 +1992,8 @@ 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.'
@@ -2196,10 +2202,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,6 +3160,8 @@ 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.'
@@ -3360,10 +3370,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,6 +4314,8 @@ 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.'
@@ -4507,10 +4521,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,6 +5478,8 @@ 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.'
@@ -5670,10 +5688,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,6 +6645,8 @@ 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.'
@@ -6833,10 +6855,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,6 +8340,8 @@ 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.'
@@ -8520,10 +8546,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
@@ -2,9 +2,8 @@
class AddIsFirstToCompletedSubmitters < ActiveRecord::Migration[8.0]
def change
# rubocop:disable Rails/ThreeStateBooleanColumn
# rubocop:disable-next Rails/ThreeStateBooleanColumn
add_column :completed_submitters, :is_first, :boolean
# rubocop:enable Rails/ThreeStateBooleanColumn
add_index :completed_submitters, %i[account_id completed_at],
where: 'is_first = TRUE',
@@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddAccountsCreatedAtIndex < ActiveRecord::Migration[8.1]
def change
add_index :accounts, :created_at, if_not_exists: true
end
end
Loaded 100 of 125 files, more files were not shown because too many files have changed in this diff. Show more