mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 06:42:32 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5684baf1e0 | ||
|
|
b6f307690d | ||
|
|
66c44f8ff5 | ||
|
|
8f3592c481 | ||
|
|
dc8b1e0741 | ||
|
|
b806a6afc5 | ||
|
|
d43f8f4dd8 | ||
|
|
37c9bf5741 | ||
|
|
a0d37f516f | ||
|
|
2764a18252 | ||
|
|
96cf228e74 | ||
|
|
ff6ff3a51e | ||
|
|
9472a6b5b0 | ||
|
|
5f3a8bf391 | ||
|
|
a0a0fdd1b5 | ||
|
|
7a6f901b09 | ||
|
|
c4f05fbd9e | ||
|
|
50c342ec5c | ||
|
|
a9cfd2bcfc | ||
|
|
e2bdb2acee | ||
|
|
b8828b503c | ||
|
|
d63f62109b | ||
|
|
c04483f0ea | ||
|
|
1efaf30fb7 | ||
|
|
2e462e9633 | ||
|
|
838df5f41d | ||
|
|
32445f0e19 | ||
|
|
5f9067baee | ||
|
|
ad56d5ee14 | ||
|
|
a091d121d9 | ||
|
|
cd9c3ee3c1 | ||
|
|
534c3a2e10 | ||
|
|
7bc8e194df | ||
|
|
de5c4d5bcd | ||
|
|
1e6b5c684f | ||
|
|
4651f6b652 | ||
|
|
e5b0a2355f | ||
|
|
db22fe7518 | ||
|
|
0dcd97f49b | ||
|
|
de14330449 | ||
|
|
173658138c | ||
|
|
000f3c72fc | ||
|
|
561b16e9fb | ||
|
|
507ca49112 | ||
|
|
94d5ab4ace | ||
|
|
91d44a3e31 |
No files matched your search
@@ -107,6 +107,8 @@ jobs:
|
|||||||
node-version: 20.9.0
|
node-version: 20.9.0
|
||||||
- name: Install Chrome
|
- name: Install Chrome
|
||||||
uses: browser-actions/setup-chrome@latest
|
uses: browser-actions/setup-chrome@latest
|
||||||
|
with:
|
||||||
|
chrome-version: 125
|
||||||
- name: Cache node_modules
|
- name: Cache node_modules
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ FROM ruby:3.3.3-alpine as fonts
|
|||||||
|
|
||||||
WORKDIR /fonts
|
WORKDIR /fonts
|
||||||
|
|
||||||
RUN apk --no-cache add fontforge wget && wget https://github.com/satbyy/go-noto-universal/releases/download/v7.0/GoNotoKurrent-Regular.ttf && wget https://github.com/satbyy/go-noto-universal/releases/download/v7.0/GoNotoKurrent-Bold.ttf && wget https://github.com/impallari/DancingScript/raw/master/fonts/v2031/DancingScript-Regular.otf && wget https://cdn.jsdelivr.net/gh/notofonts/notofonts.github.io/fonts/NotoSansSymbols2/hinted/ttf/NotoSansSymbols2-Regular.ttf && wget https://github.com/Maxattax97/gnu-freefont/raw/master/ttf/FreeSans.ttf && wget https://github.com/impallari/DancingScript/raw/master/OFL.txt
|
RUN apk --no-cache add fontforge wget && wget https://github.com/satbyy/go-noto-universal/releases/download/v7.0/GoNotoKurrent-Regular.ttf && wget https://github.com/satbyy/go-noto-universal/releases/download/v7.0/GoNotoKurrent-Bold.ttf && wget https://github.com/impallari/DancingScript/raw/master/fonts/DancingScript-Regular.otf && wget https://cdn.jsdelivr.net/gh/notofonts/notofonts.github.io/fonts/NotoSansSymbols2/hinted/ttf/NotoSansSymbols2-Regular.ttf && wget https://github.com/Maxattax97/gnu-freefont/raw/master/ttf/FreeSans.ttf && wget https://github.com/impallari/DancingScript/raw/master/OFL.txt
|
||||||
|
|
||||||
RUN fontforge -lang=py -c 'font1 = fontforge.open("FreeSans.ttf"); font2 = fontforge.open("NotoSansSymbols2-Regular.ttf"); font1.mergeFonts(font2); font1.generate("FreeSans.ttf")'
|
RUN fontforge -lang=py -c 'font1 = fontforge.open("FreeSans.ttf"); font2 = fontforge.open("NotoSansSymbols2-Regular.ttf"); font1.mergeFonts(font2); font1.generate("FreeSans.ttf")'
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ ruby '3.3.3'
|
|||||||
|
|
||||||
gem 'arabic-letter-connector', require: 'arabic-letter-connector/logic'
|
gem 'arabic-letter-connector', require: 'arabic-letter-connector/logic'
|
||||||
gem 'aws-sdk-s3', require: false
|
gem 'aws-sdk-s3', require: false
|
||||||
|
gem 'aws-sdk-secretsmanager', require: false
|
||||||
gem 'azure-storage-blob', require: false
|
gem 'azure-storage-blob', require: false
|
||||||
gem 'bootsnap', require: false
|
gem 'bootsnap', require: false
|
||||||
gem 'cancancan'
|
gem 'cancancan'
|
||||||
@@ -22,6 +23,7 @@ gem 'image_processing'
|
|||||||
gem 'jwt'
|
gem 'jwt'
|
||||||
gem 'lograge'
|
gem 'lograge'
|
||||||
gem 'mysql2', require: false
|
gem 'mysql2', require: false
|
||||||
|
gem 'net-smtp', '0.4.0'
|
||||||
gem 'oj'
|
gem 'oj'
|
||||||
gem 'pagy'
|
gem 'pagy'
|
||||||
gem 'pg', require: false
|
gem 'pg', require: false
|
||||||
|
|||||||
+72
-68
@@ -1,35 +1,35 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (7.1.3.2)
|
actioncable (7.1.3.4)
|
||||||
actionpack (= 7.1.3.2)
|
actionpack (= 7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
zeitwerk (~> 2.6)
|
zeitwerk (~> 2.6)
|
||||||
actionmailbox (7.1.3.2)
|
actionmailbox (7.1.3.4)
|
||||||
actionpack (= 7.1.3.2)
|
actionpack (= 7.1.3.4)
|
||||||
activejob (= 7.1.3.2)
|
activejob (= 7.1.3.4)
|
||||||
activerecord (= 7.1.3.2)
|
activerecord (= 7.1.3.4)
|
||||||
activestorage (= 7.1.3.2)
|
activestorage (= 7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
mail (>= 2.7.1)
|
mail (>= 2.7.1)
|
||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
net-smtp
|
net-smtp
|
||||||
actionmailer (7.1.3.2)
|
actionmailer (7.1.3.4)
|
||||||
actionpack (= 7.1.3.2)
|
actionpack (= 7.1.3.4)
|
||||||
actionview (= 7.1.3.2)
|
actionview (= 7.1.3.4)
|
||||||
activejob (= 7.1.3.2)
|
activejob (= 7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
net-smtp
|
net-smtp
|
||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
actionpack (7.1.3.2)
|
actionpack (7.1.3.4)
|
||||||
actionview (= 7.1.3.2)
|
actionview (= 7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
racc
|
racc
|
||||||
rack (>= 2.2.4)
|
rack (>= 2.2.4)
|
||||||
@@ -37,35 +37,35 @@ GEM
|
|||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
rails-html-sanitizer (~> 1.6)
|
rails-html-sanitizer (~> 1.6)
|
||||||
actiontext (7.1.3.2)
|
actiontext (7.1.3.4)
|
||||||
actionpack (= 7.1.3.2)
|
actionpack (= 7.1.3.4)
|
||||||
activerecord (= 7.1.3.2)
|
activerecord (= 7.1.3.4)
|
||||||
activestorage (= 7.1.3.2)
|
activestorage (= 7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
globalid (>= 0.6.0)
|
globalid (>= 0.6.0)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (7.1.3.2)
|
actionview (7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.11)
|
erubi (~> 1.11)
|
||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
rails-html-sanitizer (~> 1.6)
|
rails-html-sanitizer (~> 1.6)
|
||||||
activejob (7.1.3.2)
|
activejob (7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (7.1.3.2)
|
activemodel (7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
activerecord (7.1.3.2)
|
activerecord (7.1.3.4)
|
||||||
activemodel (= 7.1.3.2)
|
activemodel (= 7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
timeout (>= 0.4.0)
|
timeout (>= 0.4.0)
|
||||||
activestorage (7.1.3.2)
|
activestorage (7.1.3.4)
|
||||||
actionpack (= 7.1.3.2)
|
actionpack (= 7.1.3.4)
|
||||||
activejob (= 7.1.3.2)
|
activejob (= 7.1.3.4)
|
||||||
activerecord (= 7.1.3.2)
|
activerecord (= 7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
marcel (~> 1.0)
|
marcel (~> 1.0)
|
||||||
activesupport (7.1.3.2)
|
activesupport (7.1.3.4)
|
||||||
base64
|
base64
|
||||||
bigdecimal
|
bigdecimal
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
@@ -96,6 +96,9 @@ GEM
|
|||||||
aws-sdk-core (~> 3, >= 3.191.0)
|
aws-sdk-core (~> 3, >= 3.191.0)
|
||||||
aws-sdk-kms (~> 1)
|
aws-sdk-kms (~> 1)
|
||||||
aws-sigv4 (~> 1.8)
|
aws-sigv4 (~> 1.8)
|
||||||
|
aws-sdk-secretsmanager (1.91.0)
|
||||||
|
aws-sdk-core (~> 3, >= 3.191.0)
|
||||||
|
aws-sigv4 (~> 1.1)
|
||||||
aws-sigv4 (1.8.0)
|
aws-sigv4 (1.8.0)
|
||||||
aws-eventstream (~> 1, >= 1.0.2)
|
aws-eventstream (~> 1, >= 1.0.2)
|
||||||
azure-storage-blob (2.0.3)
|
azure-storage-blob (2.0.3)
|
||||||
@@ -119,7 +122,7 @@ GEM
|
|||||||
bindex (0.8.1)
|
bindex (0.8.1)
|
||||||
bootsnap (1.18.3)
|
bootsnap (1.18.3)
|
||||||
msgpack (~> 1.2)
|
msgpack (~> 1.2)
|
||||||
builder (3.2.4)
|
builder (3.3.0)
|
||||||
bullet (7.1.6)
|
bullet (7.1.6)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
uniform_notifier (~> 1.11)
|
uniform_notifier (~> 1.11)
|
||||||
@@ -139,7 +142,7 @@ GEM
|
|||||||
cldr-plurals-runtime-rb (1.1.0)
|
cldr-plurals-runtime-rb (1.1.0)
|
||||||
cmdparse (3.0.7)
|
cmdparse (3.0.7)
|
||||||
coderay (1.1.3)
|
coderay (1.1.3)
|
||||||
concurrent-ruby (1.2.3)
|
concurrent-ruby (1.3.4)
|
||||||
connection_pool (2.4.1)
|
connection_pool (2.4.1)
|
||||||
crack (1.0.0)
|
crack (1.0.0)
|
||||||
bigdecimal
|
bigdecimal
|
||||||
@@ -181,7 +184,7 @@ GEM
|
|||||||
rainbow
|
rainbow
|
||||||
rubocop
|
rubocop
|
||||||
smart_properties
|
smart_properties
|
||||||
erubi (1.12.0)
|
erubi (1.13.0)
|
||||||
factory_bot (6.4.6)
|
factory_bot (6.4.6)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
factory_bot_rails (6.4.3)
|
factory_bot_rails (6.4.3)
|
||||||
@@ -308,8 +311,8 @@ GEM
|
|||||||
method_source (1.1.0)
|
method_source (1.1.0)
|
||||||
mini_magick (4.12.0)
|
mini_magick (4.12.0)
|
||||||
mini_mime (1.1.5)
|
mini_mime (1.1.5)
|
||||||
mini_portile2 (2.8.6)
|
mini_portile2 (2.8.7)
|
||||||
minitest (5.23.0)
|
minitest (5.24.1)
|
||||||
msgpack (1.7.2)
|
msgpack (1.7.2)
|
||||||
multi_json (1.15.0)
|
multi_json (1.15.0)
|
||||||
multipart-post (2.4.0)
|
multipart-post (2.4.0)
|
||||||
@@ -317,22 +320,21 @@ GEM
|
|||||||
mysql2 (0.5.6)
|
mysql2 (0.5.6)
|
||||||
net-http-persistent (4.0.2)
|
net-http-persistent (4.0.2)
|
||||||
connection_pool (~> 2.2)
|
connection_pool (~> 2.2)
|
||||||
net-imap (0.4.10)
|
net-imap (0.4.14)
|
||||||
date
|
date
|
||||||
net-protocol
|
net-protocol
|
||||||
net-pop (0.1.2)
|
net-pop (0.1.2)
|
||||||
net-protocol
|
|
||||||
net-protocol (0.2.2)
|
net-protocol (0.2.2)
|
||||||
timeout
|
timeout
|
||||||
net-smtp (0.4.0)
|
net-smtp (0.4.0)
|
||||||
net-protocol
|
net-protocol
|
||||||
nio4r (2.7.1)
|
nio4r (2.7.1)
|
||||||
nokogiri (1.16.5)
|
nokogiri (1.16.7)
|
||||||
mini_portile2 (~> 2.8.2)
|
mini_portile2 (~> 2.8.2)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.5-aarch64-linux)
|
nokogiri (1.16.7-aarch64-linux)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.5-x86_64-linux)
|
nokogiri (1.16.7-x86_64-linux)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
oj (3.16.3)
|
oj (3.16.3)
|
||||||
bigdecimal (>= 3.0)
|
bigdecimal (>= 3.0)
|
||||||
@@ -366,8 +368,8 @@ GEM
|
|||||||
public_suffix (5.0.5)
|
public_suffix (5.0.5)
|
||||||
puma (6.4.2)
|
puma (6.4.2)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
racc (1.8.0)
|
racc (1.8.1)
|
||||||
rack (3.0.11)
|
rack (3.1.7)
|
||||||
rack-proxy (0.7.7)
|
rack-proxy (0.7.7)
|
||||||
rack
|
rack
|
||||||
rack-session (2.0.0)
|
rack-session (2.0.0)
|
||||||
@@ -377,20 +379,20 @@ GEM
|
|||||||
rackup (2.1.0)
|
rackup (2.1.0)
|
||||||
rack (>= 3)
|
rack (>= 3)
|
||||||
webrick (~> 1.8)
|
webrick (~> 1.8)
|
||||||
rails (7.1.3.2)
|
rails (7.1.3.4)
|
||||||
actioncable (= 7.1.3.2)
|
actioncable (= 7.1.3.4)
|
||||||
actionmailbox (= 7.1.3.2)
|
actionmailbox (= 7.1.3.4)
|
||||||
actionmailer (= 7.1.3.2)
|
actionmailer (= 7.1.3.4)
|
||||||
actionpack (= 7.1.3.2)
|
actionpack (= 7.1.3.4)
|
||||||
actiontext (= 7.1.3.2)
|
actiontext (= 7.1.3.4)
|
||||||
actionview (= 7.1.3.2)
|
actionview (= 7.1.3.4)
|
||||||
activejob (= 7.1.3.2)
|
activejob (= 7.1.3.4)
|
||||||
activemodel (= 7.1.3.2)
|
activemodel (= 7.1.3.4)
|
||||||
activerecord (= 7.1.3.2)
|
activerecord (= 7.1.3.4)
|
||||||
activestorage (= 7.1.3.2)
|
activestorage (= 7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
bundler (>= 1.15.0)
|
bundler (>= 1.15.0)
|
||||||
railties (= 7.1.3.2)
|
railties (= 7.1.3.4)
|
||||||
rails-dom-testing (2.2.0)
|
rails-dom-testing (2.2.0)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
minitest
|
minitest
|
||||||
@@ -405,9 +407,9 @@ GEM
|
|||||||
actionview (> 3.1)
|
actionview (> 3.1)
|
||||||
activesupport (> 3.1)
|
activesupport (> 3.1)
|
||||||
railties (> 3.1)
|
railties (> 3.1)
|
||||||
railties (7.1.3.2)
|
railties (7.1.3.4)
|
||||||
actionpack (= 7.1.3.2)
|
actionpack (= 7.1.3.4)
|
||||||
activesupport (= 7.1.3.2)
|
activesupport (= 7.1.3.4)
|
||||||
irb
|
irb
|
||||||
rackup (>= 1.0.0)
|
rackup (>= 1.0.0)
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
@@ -417,7 +419,7 @@ GEM
|
|||||||
rake (13.2.1)
|
rake (13.2.1)
|
||||||
rdoc (6.6.3.1)
|
rdoc (6.6.3.1)
|
||||||
psych (>= 4.0.0)
|
psych (>= 4.0.0)
|
||||||
redis-client (0.22.0)
|
redis-client (0.22.2)
|
||||||
connection_pool
|
connection_pool
|
||||||
regexp_parser (2.9.2)
|
regexp_parser (2.9.2)
|
||||||
reline (0.5.7)
|
reline (0.5.7)
|
||||||
@@ -432,7 +434,7 @@ GEM
|
|||||||
actionpack (>= 5.2)
|
actionpack (>= 5.2)
|
||||||
railties (>= 5.2)
|
railties (>= 5.2)
|
||||||
retriable (3.1.2)
|
retriable (3.1.2)
|
||||||
rexml (3.3.2)
|
rexml (3.3.6)
|
||||||
strscan
|
strscan
|
||||||
rotp (6.3.0)
|
rotp (6.3.0)
|
||||||
rqrcode (2.2.0)
|
rqrcode (2.2.0)
|
||||||
@@ -494,7 +496,7 @@ GEM
|
|||||||
rack-proxy (>= 0.6.1)
|
rack-proxy (>= 0.6.1)
|
||||||
railties (>= 5.2)
|
railties (>= 5.2)
|
||||||
semantic_range (>= 2.3.0)
|
semantic_range (>= 2.3.0)
|
||||||
sidekiq (7.2.2)
|
sidekiq (7.2.4)
|
||||||
concurrent-ruby (< 2)
|
concurrent-ruby (< 2)
|
||||||
connection_pool (>= 2.3.0)
|
connection_pool (>= 2.3.0)
|
||||||
rack (>= 2.2.4)
|
rack (>= 2.2.4)
|
||||||
@@ -563,6 +565,7 @@ DEPENDENCIES
|
|||||||
annotate
|
annotate
|
||||||
arabic-letter-connector
|
arabic-letter-connector
|
||||||
aws-sdk-s3
|
aws-sdk-s3
|
||||||
|
aws-sdk-secretsmanager
|
||||||
azure-storage-blob
|
azure-storage-blob
|
||||||
better_html
|
better_html
|
||||||
bootsnap
|
bootsnap
|
||||||
@@ -588,6 +591,7 @@ DEPENDENCIES
|
|||||||
letter_opener_web
|
letter_opener_web
|
||||||
lograge
|
lograge
|
||||||
mysql2
|
mysql2
|
||||||
|
net-smtp (= 0.4.0)
|
||||||
oj
|
oj
|
||||||
pagy
|
pagy
|
||||||
pg
|
pg
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ class AccountConfigsController < ApplicationController
|
|||||||
AccountConfig::DOWNLOAD_LINKS_AUTH_KEY,
|
AccountConfig::DOWNLOAD_LINKS_AUTH_KEY,
|
||||||
AccountConfig::FORCE_SSO_AUTH_KEY,
|
AccountConfig::FORCE_SSO_AUTH_KEY,
|
||||||
AccountConfig::FLATTEN_RESULT_PDF_KEY,
|
AccountConfig::FLATTEN_RESULT_PDF_KEY,
|
||||||
AccountConfig::WITH_SIGNATURE_ID
|
AccountConfig::WITH_SIGNATURE_ID,
|
||||||
|
AccountConfig::COMBINE_PDF_RESULT_KEY,
|
||||||
|
AccountConfig::REQUIRE_SIGNING_REASON_KEY
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
InvalidKey = Class.new(StandardError)
|
InvalidKey = Class.new(StandardError)
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ module Api
|
|||||||
params[:before] = Time.zone.at(params[:before].to_i) if params[:before].present?
|
params[:before] = Time.zone.at(params[:before].to_i) if params[:before].present?
|
||||||
|
|
||||||
submitters = paginate(
|
submitters = paginate(
|
||||||
submitters.preload(template: :folder, submission: [:submitters, { audit_trail_attachment: :blob }],
|
submitters.preload(template: :folder, submission: [:submitters, { audit_trail_attachment: :blob,
|
||||||
|
combined_document_attachment: :blob }],
|
||||||
documents_attachments: :blob, attachments_attachments: :blob),
|
documents_attachments: :blob, attachments_attachments: :blob),
|
||||||
field: :completed_at
|
field: :completed_at
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Api
|
||||||
|
class SubmissionEventsController < ApiBaseController
|
||||||
|
load_and_authorize_resource :submission, parent: false
|
||||||
|
|
||||||
|
def index
|
||||||
|
submissions = build_completed_query(@submissions)
|
||||||
|
|
||||||
|
params[:after] = Time.zone.at(params[:after].to_i) if params[:after].present?
|
||||||
|
params[:before] = Time.zone.at(params[:before].to_i) if params[:before].present?
|
||||||
|
|
||||||
|
submissions = paginate(submissions.preload(
|
||||||
|
:created_by_user, :submission_events,
|
||||||
|
template: :folder,
|
||||||
|
submitters: { documents_attachments: :blob, attachments_attachments: :blob },
|
||||||
|
audit_trail_attachment: :blob
|
||||||
|
),
|
||||||
|
field: :completed_at)
|
||||||
|
|
||||||
|
render json: {
|
||||||
|
data: submissions.map do |s|
|
||||||
|
{
|
||||||
|
event_type: 'submission.completed',
|
||||||
|
timestamp: s.completed_at,
|
||||||
|
data: Submissions::SerializeForApi.call(s, s.submitters)
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
pagination: {
|
||||||
|
count: submissions.size,
|
||||||
|
next: submissions.last&.completed_at&.to_i,
|
||||||
|
prev: submissions.first&.completed_at&.to_i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def build_completed_query(submissions)
|
||||||
|
submissions = submissions.where(
|
||||||
|
Submitter.where(completed_at: nil).where(
|
||||||
|
Submitter.arel_table[:submission_id].eq(Submission.arel_table[:id])
|
||||||
|
).select(1).arel.exists.not
|
||||||
|
)
|
||||||
|
|
||||||
|
submissions.joins(:submitters)
|
||||||
|
.group(:id)
|
||||||
|
.select(Submission.arel_table[Arel.star],
|
||||||
|
Submitter.arel_table[:completed_at].maximum.as('completed_at'))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -19,6 +19,7 @@ module Api
|
|||||||
|
|
||||||
submissions = paginate(submissions.preload(:created_by_user, :submitters,
|
submissions = paginate(submissions.preload(:created_by_user, :submitters,
|
||||||
template: :folder,
|
template: :folder,
|
||||||
|
combined_document_attachment: :blob,
|
||||||
audit_trail_attachment: :blob))
|
audit_trail_attachment: :blob))
|
||||||
|
|
||||||
render json: {
|
render json: {
|
||||||
|
|||||||
@@ -77,6 +77,10 @@ module Api
|
|||||||
with_urls: true,
|
with_urls: true,
|
||||||
with_events: false,
|
with_events: false,
|
||||||
params:)
|
params:)
|
||||||
|
rescue Submitters::NormalizeValues::BaseError => e
|
||||||
|
Rollbar.warning(e) if defined?(Rollbar)
|
||||||
|
|
||||||
|
render json: { error: e.message }, status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
|
|
||||||
def submitter_params
|
def submitter_params
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ module Api
|
|||||||
def template_params
|
def template_params
|
||||||
permitted_params = [
|
permitted_params = [
|
||||||
:name,
|
:name,
|
||||||
|
:external_id,
|
||||||
{
|
{
|
||||||
submitters: [%i[name uuid]],
|
submitters: [%i[name uuid]],
|
||||||
fields: [[:uuid, :submitter_uuid, :name, :type,
|
fields: [[:uuid, :submitter_uuid, :name, :type,
|
||||||
|
|||||||
@@ -14,5 +14,29 @@ module Api
|
|||||||
data: Base64.encode64(PdfUtils.merge(files.map { |base64| StringIO.new(Base64.decode64(base64)) }).string)
|
data: Base64.encode64(PdfUtils.merge(files.map { |base64| StringIO.new(Base64.decode64(base64)) }).string)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def verify
|
||||||
|
file = Base64.decode64(params[:file])
|
||||||
|
pdf = HexaPDF::Document.new(io: StringIO.new(file))
|
||||||
|
|
||||||
|
trusted_certs = Accounts.load_trusted_certs(current_account)
|
||||||
|
|
||||||
|
is_checksum_found = ActiveStorage::Attachment.joins(:blob)
|
||||||
|
.where(name: 'documents', record_type: 'Submitter')
|
||||||
|
.exists?(blob: { checksum: Digest::MD5.base64digest(file) })
|
||||||
|
|
||||||
|
render json: {
|
||||||
|
checksum_status: is_checksum_found ? 'verified' : 'not_found',
|
||||||
|
signatures: pdf.signatures.map do |sig|
|
||||||
|
{
|
||||||
|
verification_result: sig.verify(trusted_certs:).messages,
|
||||||
|
signer_name: sig.signer_name,
|
||||||
|
signing_reason: sig.signing_reason,
|
||||||
|
signing_time: sig.signing_time,
|
||||||
|
signature_type: sig.signature_type
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -17,11 +17,7 @@ class StartFormController < ApplicationController
|
|||||||
def update
|
def update
|
||||||
return redirect_to start_form_path(@template.slug) if @template.archived_at?
|
return redirect_to start_form_path(@template.slug) if @template.archived_at?
|
||||||
|
|
||||||
@submitter = Submitter.where(submission: @template.submissions.where(expire_at: Time.current..)
|
@submitter = find_or_initialize_submitter(@template, submitter_params)
|
||||||
.or(@template.submissions.where(expire_at: nil)).where(archived_at: nil))
|
|
||||||
.order(id: :desc)
|
|
||||||
.then { |rel| params[:resubmit].present? ? rel.where(completed_at: nil) : rel }
|
|
||||||
.find_or_initialize_by(**submitter_params.compact_blank)
|
|
||||||
|
|
||||||
if @submitter.completed_at?
|
if @submitter.completed_at?
|
||||||
redirect_to start_form_completed_path(@template.slug, email: submitter_params[:email])
|
redirect_to start_form_completed_path(@template.slug, email: submitter_params[:email])
|
||||||
@@ -56,6 +52,15 @@ class StartFormController < ApplicationController
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def find_or_initialize_submitter(template, submitter_params)
|
||||||
|
Submitter.where(submission: template.submissions.where(expire_at: Time.current..)
|
||||||
|
.or(template.submissions.where(expire_at: nil)).where(archived_at: nil))
|
||||||
|
.order(id: :desc)
|
||||||
|
.where(declined_at: nil)
|
||||||
|
.then { |rel| params[:resubmit].present? ? rel.where(completed_at: nil) : rel }
|
||||||
|
.find_or_initialize_by(**submitter_params.compact_blank)
|
||||||
|
end
|
||||||
|
|
||||||
def assign_submission_attributes(submitter, template)
|
def assign_submission_attributes(submitter, template)
|
||||||
resubmit_submitter =
|
resubmit_submitter =
|
||||||
if params[:resubmit].present?
|
if params[:resubmit].present?
|
||||||
@@ -82,6 +87,8 @@ class StartFormController < ApplicationController
|
|||||||
template_submitters: template.submitters,
|
template_submitters: template.submitters,
|
||||||
source: :link)
|
source: :link)
|
||||||
|
|
||||||
|
submitter.account_id = submitter.submission.account_id
|
||||||
|
|
||||||
submitter
|
submitter
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class SubmissionsDownloadController < ApplicationController
|
|||||||
return head :not_found
|
return head :not_found
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:combined]
|
if params[:combined] == 'true'
|
||||||
url = build_combined_url(submitter)
|
url = build_combined_url(submitter)
|
||||||
|
|
||||||
if url
|
if url
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class SubmitFormController < ApplicationController
|
|||||||
return redirect_to submit_form_completed_path(@submitter.slug) if @submitter.completed_at?
|
return redirect_to submit_form_completed_path(@submitter.slug) if @submitter.completed_at?
|
||||||
return render :archived if @submitter.submission.template.archived_at? || @submitter.submission.archived_at?
|
return render :archived if @submitter.submission.template.archived_at? || @submitter.submission.archived_at?
|
||||||
return render :expired if @submitter.submission.expired?
|
return render :expired if @submitter.submission.expired?
|
||||||
|
return render :declined if @submitter.declined_at?
|
||||||
|
|
||||||
Submitters.preload_with_pages(@submitter)
|
Submitters.preload_with_pages(@submitter)
|
||||||
|
|
||||||
@@ -56,6 +57,8 @@ class SubmitFormController < ApplicationController
|
|||||||
return render json: { error: 'Form has been expired.' }, status: :unprocessable_entity
|
return render json: { error: 'Form has been expired.' }, status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return render json: { error: 'Form has been declined.' }, status: :unprocessable_entity if submitter.declined_at?
|
||||||
|
|
||||||
Submitters::SubmitValues.call(submitter, params, request)
|
Submitters::SubmitValues.call(submitter, params, request)
|
||||||
|
|
||||||
head :ok
|
head :ok
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class SubmitFormDeclineController < ApplicationController
|
||||||
|
skip_before_action :authenticate_user!
|
||||||
|
skip_authorization_check
|
||||||
|
|
||||||
|
def create
|
||||||
|
submitter = Submitter.find_by!(slug: params[:submit_form_slug])
|
||||||
|
|
||||||
|
return redirect_to submit_form_path(submitter.slug) if submitter.declined_at? ||
|
||||||
|
submitter.completed_at? ||
|
||||||
|
submitter.submission.archived_at? ||
|
||||||
|
submitter.submission.expired? ||
|
||||||
|
submitter.submission.template.archived_at?
|
||||||
|
|
||||||
|
ApplicationRecord.transaction do
|
||||||
|
submitter.update!(declined_at: Time.current)
|
||||||
|
|
||||||
|
SubmissionEvents.create_with_tracking_data(submitter, 'decline_form', request, { reason: params[:reason] })
|
||||||
|
end
|
||||||
|
|
||||||
|
user = submitter.submission.created_by_user || submitter.template.author
|
||||||
|
|
||||||
|
SubmitterMailer.declined_email(submitter, user).deliver_later!
|
||||||
|
SendFormDeclinedWebhookRequestJob.perform_async('submitter_id' => submitter.id)
|
||||||
|
|
||||||
|
redirect_to submit_form_path(submitter.slug)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class SubmitFormDownloadController < ApplicationController
|
||||||
|
skip_before_action :authenticate_user!
|
||||||
|
skip_authorization_check
|
||||||
|
|
||||||
|
FILES_TTL = 5.minutes
|
||||||
|
|
||||||
|
def index
|
||||||
|
submitter = Submitter.find_by!(slug: params[:submit_form_slug])
|
||||||
|
|
||||||
|
return redirect_to submitter_download_index_path(submitter.slug) if submitter.completed_at?
|
||||||
|
|
||||||
|
return head :unprocessable_entity if submitter.declined_at? ||
|
||||||
|
submitter.submission.archived_at? ||
|
||||||
|
submitter.submission.expired? ||
|
||||||
|
submitter.submission.template.archived_at?
|
||||||
|
|
||||||
|
last_completed_submitter = submitter.submission.submitters
|
||||||
|
.where.not(id: submitter.id)
|
||||||
|
.where.not(completed_at: nil)
|
||||||
|
.max_by(&:completed_at)
|
||||||
|
|
||||||
|
attachments =
|
||||||
|
if last_completed_submitter
|
||||||
|
Submitters.select_attachments_for_download(last_completed_submitter)
|
||||||
|
else
|
||||||
|
submitter.submission.template.schema_documents.preload(:blob)
|
||||||
|
end
|
||||||
|
|
||||||
|
urls = attachments.map do |attachment|
|
||||||
|
ActiveStorage::Blob.proxy_url(attachment.blob, expires_at: FILES_TTL.from_now.to_i)
|
||||||
|
end
|
||||||
|
|
||||||
|
render json: urls
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -9,26 +9,7 @@ class VerifyPdfSignatureController < ApplicationController
|
|||||||
HexaPDF::Document.new(io: file.open)
|
HexaPDF::Document.new(io: file.open)
|
||||||
end
|
end
|
||||||
|
|
||||||
cert_data =
|
trusted_certs = Accounts.load_trusted_certs(current_account)
|
||||||
if Docuseal.multitenant?
|
|
||||||
value = EncryptedConfig.find_by(account: current_account, key: EncryptedConfig::ESIGN_CERTS_KEY)&.value || {}
|
|
||||||
|
|
||||||
Docuseal::CERTS.merge(value)
|
|
||||||
else
|
|
||||||
EncryptedConfig.find_by(key: EncryptedConfig::ESIGN_CERTS_KEY)&.value || {}
|
|
||||||
end
|
|
||||||
|
|
||||||
default_pkcs = GenerateCertificate.load_pkcs(cert_data)
|
|
||||||
|
|
||||||
custom_certs = cert_data.fetch('custom', []).map do |e|
|
|
||||||
OpenSSL::PKCS12.new(Base64.urlsafe_decode64(e['data']), e['password'].to_s)
|
|
||||||
end
|
|
||||||
|
|
||||||
trusted_certs = [default_pkcs.certificate,
|
|
||||||
*default_pkcs.ca_certs,
|
|
||||||
*custom_certs.map(&:certificate),
|
|
||||||
*custom_certs.flat_map(&:ca_certs).compact,
|
|
||||||
*Docuseal.trusted_certs]
|
|
||||||
|
|
||||||
render turbo_stream: turbo_stream.replace('result', partial: 'result',
|
render turbo_stream: turbo_stream.replace('result', partial: 'result',
|
||||||
locals: { pdfs:, files: params[:files], trusted_certs: })
|
locals: { pdfs:, files: params[:files], trusted_certs: })
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ class WebhookPreferencesController < ApplicationController
|
|||||||
form.viewed
|
form.viewed
|
||||||
form.started
|
form.started
|
||||||
form.completed
|
form.completed
|
||||||
|
form.declined
|
||||||
template.created
|
template.created
|
||||||
template.updated
|
template.updated
|
||||||
submission.created
|
submission.created
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import PromptPassword from './elements/prompt_password'
|
|||||||
import EmailsTextarea from './elements/emails_textarea'
|
import EmailsTextarea from './elements/emails_textarea'
|
||||||
import ToggleOnSubmit from './elements/toggle_on_submit'
|
import ToggleOnSubmit from './elements/toggle_on_submit'
|
||||||
import PasswordInput from './elements/password_input'
|
import PasswordInput from './elements/password_input'
|
||||||
|
import SearchInput from './elements/search_input'
|
||||||
|
|
||||||
import * as TurboInstantClick from './lib/turbo_instant_click'
|
import * as TurboInstantClick from './lib/turbo_instant_click'
|
||||||
|
|
||||||
@@ -87,6 +88,7 @@ safeRegisterElement('emails-textarea', EmailsTextarea)
|
|||||||
safeRegisterElement('toggle-cookies', ToggleCookies)
|
safeRegisterElement('toggle-cookies', ToggleCookies)
|
||||||
safeRegisterElement('toggle-on-submit', ToggleOnSubmit)
|
safeRegisterElement('toggle-on-submit', ToggleOnSubmit)
|
||||||
safeRegisterElement('password-input', PasswordInput)
|
safeRegisterElement('password-input', PasswordInput)
|
||||||
|
safeRegisterElement('search-input', SearchInput)
|
||||||
|
|
||||||
safeRegisterElement('template-builder', class extends HTMLElement {
|
safeRegisterElement('template-builder', class extends HTMLElement {
|
||||||
connectedCallback () {
|
connectedCallback () {
|
||||||
@@ -97,6 +99,7 @@ safeRegisterElement('template-builder', class extends HTMLElement {
|
|||||||
this.app = createApp(TemplateBuilder, {
|
this.app = createApp(TemplateBuilder, {
|
||||||
template: reactive(JSON.parse(this.dataset.template)),
|
template: reactive(JSON.parse(this.dataset.template)),
|
||||||
backgroundColor: '#faf7f5',
|
backgroundColor: '#faf7f5',
|
||||||
|
locale: this.dataset.locale,
|
||||||
withPhone: this.dataset.withPhone === 'true',
|
withPhone: this.dataset.withPhone === 'true',
|
||||||
withLogo: this.dataset.withLogo !== 'false',
|
withLogo: this.dataset.withLogo !== 'false',
|
||||||
editable: this.dataset.editable !== 'false',
|
editable: this.dataset.editable !== 'false',
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
export default class extends HTMLElement {
|
||||||
|
connectedCallback () {
|
||||||
|
this.input.addEventListener('focus', () => {
|
||||||
|
if (this.title) {
|
||||||
|
this.title.classList.add('hidden', 'md:block')
|
||||||
|
this.input.classList.add('w-60')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
this.input.addEventListener('blur', (e) => {
|
||||||
|
if (this.title && !e.target.value) {
|
||||||
|
this.title.classList.remove('hidden')
|
||||||
|
this.input.classList.remove('w-60')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
get input () {
|
||||||
|
return this.querySelector('input')
|
||||||
|
}
|
||||||
|
|
||||||
|
get title () {
|
||||||
|
return document.querySelector(this.dataset.title)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,6 +23,7 @@ safeRegisterElement('submission-form', class extends HTMLElement {
|
|||||||
dryRun: this.dataset.dryRun === 'true',
|
dryRun: this.dataset.dryRun === 'true',
|
||||||
expand: ['true', 'false'].includes(this.dataset.expand) ? this.dataset.expand === 'true' : null,
|
expand: ['true', 'false'].includes(this.dataset.expand) ? this.dataset.expand === 'true' : null,
|
||||||
withSignatureId: this.dataset.withSignatureId === 'true',
|
withSignatureId: this.dataset.withSignatureId === 'true',
|
||||||
|
requireSigningReason: this.dataset.requireSigningReason === 'true',
|
||||||
withConfetti: this.dataset.withConfetti !== 'false',
|
withConfetti: this.dataset.withConfetti !== 'false',
|
||||||
withDisclosure: this.dataset.withDisclosure === 'true',
|
withDisclosure: this.dataset.withDisclosure === 'true',
|
||||||
withTypedSignature: this.dataset.withTypedSignature !== 'false',
|
withTypedSignature: this.dataset.withTypedSignature !== 'false',
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
ID: {{ signature.uuid }}
|
ID: {{ signature.uuid }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ t('reason') }}: {{ t('digitally_signed_by') }} {{ submitter.name }}
|
{{ t('reason') }}: {{ values[field.preferences?.reason_field_uuid] || t('digitally_signed_by') }} {{ submitter.name }}
|
||||||
<template v-if="submitter.email">
|
<template v-if="submitter.email">
|
||||||
<{{ submitter.email }}>
|
<{{ submitter.email }}>
|
||||||
</template>
|
</template>
|
||||||
@@ -258,6 +258,11 @@ export default {
|
|||||||
required: false,
|
required: false,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
|
values: {
|
||||||
|
type: Object,
|
||||||
|
required: false,
|
||||||
|
default: () => ({})
|
||||||
|
},
|
||||||
isActive: {
|
isActive: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<template
|
<template
|
||||||
v-for="step in steps"
|
v-for="(step, stepIndex) in steps"
|
||||||
:key="step[0].uuid"
|
:key="step[0].uuid"
|
||||||
>
|
>
|
||||||
<template
|
<template
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
<FieldArea
|
<FieldArea
|
||||||
:ref="setAreaRef"
|
:ref="setAreaRef"
|
||||||
v-model="values[field.uuid]"
|
v-model="values[field.uuid]"
|
||||||
|
:values="values"
|
||||||
:field="field"
|
:field="field"
|
||||||
:area="area"
|
:area="area"
|
||||||
:submittable="true"
|
:submittable="true"
|
||||||
@@ -30,7 +31,7 @@
|
|||||||
:with-label="withLabel && !withFieldPlaceholder"
|
:with-label="withLabel && !withFieldPlaceholder"
|
||||||
:is-value-set="step.some((f) => f.uuid in values)"
|
:is-value-set="step.some((f) => f.uuid in values)"
|
||||||
:attachments-index="attachmentsIndex"
|
:attachments-index="attachmentsIndex"
|
||||||
@click="$emit('focus-step', step)"
|
@click="$emit('focus-step', stepIndex)"
|
||||||
/>
|
/>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -181,6 +181,10 @@ export default {
|
|||||||
spread: 140
|
spread: 140
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.decline_button) {
|
||||||
|
window.decline_button.setAttribute('disabled', 'true')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
sendCopyToEmail () {
|
sendCopyToEmail () {
|
||||||
|
|||||||
@@ -327,17 +327,20 @@
|
|||||||
ref="currentStep"
|
ref="currentStep"
|
||||||
:key="currentField.uuid"
|
:key="currentField.uuid"
|
||||||
v-model="values[currentField.uuid]"
|
v-model="values[currentField.uuid]"
|
||||||
|
:reason="values[currentField.preferences?.reason_field_uuid]"
|
||||||
:field="currentField"
|
:field="currentField"
|
||||||
:previous-value="previousSignatureValueFor(currentField) || previousSignatureValue"
|
:previous-value="previousSignatureValueFor(currentField) || previousSignatureValue"
|
||||||
:with-typed-signature="withTypedSignature"
|
:with-typed-signature="withTypedSignature"
|
||||||
:remember-signature="rememberSignature"
|
:remember-signature="rememberSignature"
|
||||||
:attachments-index="attachmentsIndex"
|
:attachments-index="attachmentsIndex"
|
||||||
|
:require-signing-reason="requireSigningReason"
|
||||||
:button-text="buttonText"
|
:button-text="buttonText"
|
||||||
:dry-run="dryRun"
|
:dry-run="dryRun"
|
||||||
:with-disclosure="withDisclosure"
|
:with-disclosure="withDisclosure"
|
||||||
:with-qr-button="withQrButton"
|
:with-qr-button="withQrButton"
|
||||||
:submitter="submitter"
|
:submitter="submitter"
|
||||||
:show-field-names="showFieldNames"
|
:show-field-names="showFieldNames"
|
||||||
|
@update:reason="values[currentField.preferences?.reason_field_uuid] = $event"
|
||||||
@attached="attachments.push($event)"
|
@attached="attachments.push($event)"
|
||||||
@start="scrollIntoField(currentField)"
|
@start="scrollIntoField(currentField)"
|
||||||
@minimize="isFormVisible = false"
|
@minimize="isFormVisible = false"
|
||||||
@@ -450,7 +453,7 @@
|
|||||||
href="#"
|
href="#"
|
||||||
class="inline border border-base-300 h-3 w-3 rounded-full mx-1 mt-1"
|
class="inline border border-base-300 h-3 w-3 rounded-full mx-1 mt-1"
|
||||||
:class="{ 'bg-base-300': index === currentStep, 'bg-base-content': (index < currentStep && stepFields[index].every((f) => !f.required || ![null, undefined, ''].includes(values[f.uuid]))) || isCompleted, 'bg-white': index > currentStep }"
|
:class="{ 'bg-base-300': index === currentStep, 'bg-base-content': (index < currentStep && stepFields[index].every((f) => !f.required || ![null, undefined, ''].includes(values[f.uuid]))) || isCompleted, 'bg-white': index > currentStep }"
|
||||||
@click.prevent="isCompleted ? '' : [saveStep(), goToStep(step, true)]"
|
@click.prevent="isCompleted ? '' : [saveStep(), goToStep(index, true)]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -549,6 +552,11 @@ export default {
|
|||||||
required: false,
|
required: false,
|
||||||
default: '-80px'
|
default: '-80px'
|
||||||
},
|
},
|
||||||
|
requireSigningReason: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
canSendEmail: {
|
canSendEmail: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
@@ -915,18 +923,22 @@ export default {
|
|||||||
checkFieldConditions (field) {
|
checkFieldConditions (field) {
|
||||||
if (field.conditions?.length) {
|
if (field.conditions?.length) {
|
||||||
return field.conditions.reduce((acc, c) => {
|
return field.conditions.reduce((acc, c) => {
|
||||||
|
const field = this.fieldsUuidIndex[c.field_uuid]
|
||||||
|
|
||||||
|
if (['not_empty', 'checked', 'equal', 'contains'].includes(c.action) && field && !this.checkFieldConditions(field)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if (['empty', 'unchecked'].includes(c.action)) {
|
if (['empty', 'unchecked'].includes(c.action)) {
|
||||||
return acc && isEmpty(this.values[c.field_uuid])
|
return acc && isEmpty(this.values[c.field_uuid])
|
||||||
} else if (['not_empty', 'checked'].includes(c.action)) {
|
} else if (['not_empty', 'checked'].includes(c.action)) {
|
||||||
return acc && !isEmpty(this.values[c.field_uuid])
|
return acc && !isEmpty(this.values[c.field_uuid])
|
||||||
} else if (['equal', 'contains'].includes(c.action)) {
|
} else if (['equal', 'contains'].includes(c.action)) {
|
||||||
const field = this.fieldsUuidIndex[c.field_uuid]
|
|
||||||
const option = field.options.find((o) => o.uuid === c.value)
|
const option = field.options.find((o) => o.uuid === c.value)
|
||||||
const values = [this.values[c.field_uuid]].flat()
|
const values = [this.values[c.field_uuid]].flat()
|
||||||
|
|
||||||
return acc && values.includes(this.optionValue(option, field.options.indexOf(option)))
|
return acc && values.includes(this.optionValue(option, field.options.indexOf(option)))
|
||||||
} else if (['not_equal', 'does_not_contain'].includes(c.action)) {
|
} else if (['not_equal', 'does_not_contain'].includes(c.action)) {
|
||||||
const field = this.fieldsUuidIndex[c.field_uuid]
|
|
||||||
const option = field.options.find((o) => o.uuid === c.value)
|
const option = field.options.find((o) => o.uuid === c.value)
|
||||||
const values = [this.values[c.field_uuid]].flat()
|
const values = [this.values[c.field_uuid]].flat()
|
||||||
|
|
||||||
@@ -1016,8 +1028,8 @@ export default {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
goToStep (step, scrollToArea = false, clickUpload = false) {
|
goToStep (stepIndex, scrollToArea = false, clickUpload = false) {
|
||||||
this.currentStep = this.stepFields.indexOf(step)
|
this.currentStep = stepIndex
|
||||||
this.showFillAllRequiredFields = false
|
this.showFillAllRequiredFields = false
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -1025,7 +1037,7 @@ export default {
|
|||||||
|
|
||||||
if (!this.isCompleted) {
|
if (!this.isCompleted) {
|
||||||
if (scrollToArea) {
|
if (scrollToArea) {
|
||||||
this.scrollIntoField(step[0])
|
this.scrollIntoField(this.currentField)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.enableScrollIntoField = false
|
this.enableScrollIntoField = false
|
||||||
@@ -1132,7 +1144,7 @@ export default {
|
|||||||
this.isFormVisible = false
|
this.isFormVisible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
this.goToStep(nextStep, this.autoscrollFields)
|
this.goToStep(this.stepFields.indexOf(nextStep), this.autoscrollFields)
|
||||||
|
|
||||||
if (emptyRequiredField === nextStep) {
|
if (emptyRequiredField === nextStep) {
|
||||||
this.showFillAllRequiredFields = true
|
this.showFillAllRequiredFields = true
|
||||||
|
|||||||
@@ -6,6 +6,14 @@ const en = {
|
|||||||
signature: 'Signature',
|
signature: 'Signature',
|
||||||
initials: 'Initials',
|
initials: 'Initials',
|
||||||
drawn_signature_on_a_touchscreen_device: 'Drawn signature on a touchscreen device',
|
drawn_signature_on_a_touchscreen_device: 'Drawn signature on a touchscreen device',
|
||||||
|
approved: 'Approved',
|
||||||
|
reviewed: 'Reviewed',
|
||||||
|
other: 'Other',
|
||||||
|
authored_by_me: 'Authored by me',
|
||||||
|
approved_by: 'Approved by',
|
||||||
|
reviewed_by: 'Reviewed by',
|
||||||
|
authored_by: 'Authored by',
|
||||||
|
select_a_reason: 'Select a reason',
|
||||||
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Scan the QR code with the camera app to open the form on mobile and draw your signature',
|
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Scan the QR code with the camera app to open the form on mobile and draw your signature',
|
||||||
date: 'Date',
|
date: 'Date',
|
||||||
number: 'Number',
|
number: 'Number',
|
||||||
@@ -77,6 +85,14 @@ const en = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const es = {
|
const es = {
|
||||||
|
approved: 'Aprobado',
|
||||||
|
reviewed: 'Revisado',
|
||||||
|
other: 'Otro',
|
||||||
|
authored_by_me: 'Escrito por mí',
|
||||||
|
approved_by: 'Aprobado por',
|
||||||
|
reviewed_by: 'Revisado por',
|
||||||
|
authored_by: 'Escrito por',
|
||||||
|
select_a_reason: 'Selecciona una razón',
|
||||||
value_is_invalid: 'El valor no es válido',
|
value_is_invalid: 'El valor no es válido',
|
||||||
verification_code_is_invalid: 'El código de verificación no es válido',
|
verification_code_is_invalid: 'El código de verificación no es válido',
|
||||||
drawn_signature_on_a_touchscreen_device: 'Firma dibujada en un dispositivo con pantalla táctil',
|
drawn_signature_on_a_touchscreen_device: 'Firma dibujada en un dispositivo con pantalla táctil',
|
||||||
@@ -154,6 +170,14 @@ const es = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const it = {
|
const it = {
|
||||||
|
approved: 'Approvato',
|
||||||
|
reviewed: 'Revisionato',
|
||||||
|
other: 'Altro',
|
||||||
|
authored_by_me: 'Creato da me',
|
||||||
|
approved_by: 'Approvato da',
|
||||||
|
reviewed_by: 'Revisionato da',
|
||||||
|
authored_by: 'Creato da',
|
||||||
|
select_a_reason: 'Seleziona una ragione',
|
||||||
value_is_invalid: 'Il valore non è valido',
|
value_is_invalid: 'Il valore non è valido',
|
||||||
verification_code_is_invalid: 'Il codice di verifica non è valido',
|
verification_code_is_invalid: 'Il codice di verifica non è valido',
|
||||||
drawn_signature_on_a_touchscreen_device: 'Firma disegnata su un dispositivo con schermo tattile',
|
drawn_signature_on_a_touchscreen_device: 'Firma disegnata su un dispositivo con schermo tattile',
|
||||||
@@ -231,6 +255,14 @@ const it = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const de = {
|
const de = {
|
||||||
|
approved: 'Genehmigt',
|
||||||
|
reviewed: 'Überprüft',
|
||||||
|
other: 'Andere',
|
||||||
|
authored_by_me: 'Von mir verfasst',
|
||||||
|
approved_by: 'Genehmigt von',
|
||||||
|
reviewed_by: 'Überprüft von',
|
||||||
|
authored_by: 'Verfasst von',
|
||||||
|
select_a_reason: 'Grund auswählen',
|
||||||
value_is_invalid: 'Wert ist ungültig',
|
value_is_invalid: 'Wert ist ungültig',
|
||||||
verification_code_is_invalid: 'Bestätigungscode ist ungültig',
|
verification_code_is_invalid: 'Bestätigungscode ist ungültig',
|
||||||
drawn_signature_on_a_touchscreen_device: 'Gezeichnete Unterschrift auf einem Touchscreen-Gerät',
|
drawn_signature_on_a_touchscreen_device: 'Gezeichnete Unterschrift auf einem Touchscreen-Gerät',
|
||||||
@@ -308,6 +340,14 @@ const de = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fr = {
|
const fr = {
|
||||||
|
approved: 'Approuvé',
|
||||||
|
reviewed: 'Révisé',
|
||||||
|
other: 'Autre',
|
||||||
|
authored_by_me: 'Rédigé par moi',
|
||||||
|
approved_by: 'Approuvé par',
|
||||||
|
reviewed_by: 'Révisé par',
|
||||||
|
authored_by: 'Rédigé par',
|
||||||
|
select_a_reason: 'Sélectionnez une raison',
|
||||||
value_is_invalid: 'La valeur est invalide',
|
value_is_invalid: 'La valeur est invalide',
|
||||||
verification_code_is_invalid: 'Le code de vérification est invalide',
|
verification_code_is_invalid: 'Le code de vérification est invalide',
|
||||||
drawn_signature_on_a_touchscreen_device: 'Signature dessinée sur un appareil à écran tactile',
|
drawn_signature_on_a_touchscreen_device: 'Signature dessinée sur un appareil à écran tactile',
|
||||||
@@ -385,6 +425,14 @@ const fr = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pl = {
|
const pl = {
|
||||||
|
approved: 'Zaakceptowany',
|
||||||
|
reviewed: 'Przejrzany',
|
||||||
|
other: 'Inny',
|
||||||
|
authored_by_me: 'Napisane przeze mnie',
|
||||||
|
approved_by: 'Zaakceptowany przez',
|
||||||
|
reviewed_by: 'Przejrzany przez',
|
||||||
|
authored_by: 'Napisane przez',
|
||||||
|
select_a_reason: 'Wybierz powód',
|
||||||
value_is_invalid: 'Wartość jest nieprawidłowa',
|
value_is_invalid: 'Wartość jest nieprawidłowa',
|
||||||
verification_code_is_invalid: 'Kod weryfikacyjny jest nieprawidłowy',
|
verification_code_is_invalid: 'Kod weryfikacyjny jest nieprawidłowy',
|
||||||
drawn_signature_on_a_touchscreen_device: 'Podpis odręczny na urządzeniu z ekranem dotykowym',
|
drawn_signature_on_a_touchscreen_device: 'Podpis odręczny na urządzeniu z ekranem dotykowym',
|
||||||
@@ -462,6 +510,14 @@ const pl = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const uk = {
|
const uk = {
|
||||||
|
approved: 'Затверджено',
|
||||||
|
reviewed: 'Переглянуто',
|
||||||
|
other: 'Інше',
|
||||||
|
authored_by_me: 'Авторство моє',
|
||||||
|
approved_by: 'Затверджено',
|
||||||
|
reviewed_by: 'Переглянуто',
|
||||||
|
authored_by: 'Автор',
|
||||||
|
select_a_reason: 'Виберіть причину',
|
||||||
value_is_invalid: 'Значення є неправильним',
|
value_is_invalid: 'Значення є неправильним',
|
||||||
verification_code_is_invalid: 'Код підтвердження є неправильним',
|
verification_code_is_invalid: 'Код підтвердження є неправильним',
|
||||||
drawn_signature_on_a_touchscreen_device: 'Підпис на сенсорному пристрої',
|
drawn_signature_on_a_touchscreen_device: 'Підпис на сенсорному пристрої',
|
||||||
@@ -539,6 +595,14 @@ const uk = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const cs = {
|
const cs = {
|
||||||
|
approved: 'Schváleno',
|
||||||
|
reviewed: 'Zkontrolováno',
|
||||||
|
other: 'Jiné',
|
||||||
|
authored_by_me: 'Autorem jsem já',
|
||||||
|
approved_by: 'Schváleno kým',
|
||||||
|
reviewed_by: 'Zkontrolováno kým',
|
||||||
|
authored_by: 'Autorem',
|
||||||
|
select_a_reason: 'Vyberte důvod',
|
||||||
value_is_invalid: 'Hodnota je neplatná',
|
value_is_invalid: 'Hodnota je neplatná',
|
||||||
verification_code_is_invalid: 'Ověřovací kód je neplatný',
|
verification_code_is_invalid: 'Ověřovací kód je neplatný',
|
||||||
drawn_signature_on_a_touchscreen_device: 'Namalovaný podpis na dotykovém zařízení',
|
drawn_signature_on_a_touchscreen_device: 'Namalovaný podpis na dotykovém zařízení',
|
||||||
@@ -616,6 +680,14 @@ const cs = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pt = {
|
const pt = {
|
||||||
|
approved: 'Aprovado',
|
||||||
|
reviewed: 'Revisado',
|
||||||
|
other: 'Outro',
|
||||||
|
authored_by_me: 'Autorizado por mim',
|
||||||
|
approved_by: 'Aprovado por',
|
||||||
|
reviewed_by: 'Revisado por',
|
||||||
|
authored_by: 'Autorizado por',
|
||||||
|
select_a_reason: 'Selecione um motivo',
|
||||||
value_is_invalid: 'Valor é inválido',
|
value_is_invalid: 'Valor é inválido',
|
||||||
verification_code_is_invalid: 'Código de verificação é inválido',
|
verification_code_is_invalid: 'Código de verificação é inválido',
|
||||||
drawn_signature_on_a_touchscreen_device: 'Assinatura desenhada em um dispositivo com tela sensível ao toque',
|
drawn_signature_on_a_touchscreen_device: 'Assinatura desenhada em um dispositivo com tela sensível ao toque',
|
||||||
@@ -693,6 +765,14 @@ const pt = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const he = {
|
const he = {
|
||||||
|
approved: 'מאושר',
|
||||||
|
reviewed: 'נסקר',
|
||||||
|
other: 'אחר',
|
||||||
|
authored_by_me: 'נכתב על ידי',
|
||||||
|
approved_by: 'אושר על ידי',
|
||||||
|
reviewed_by: 'נסקר על ידי',
|
||||||
|
authored_by: 'נכתב על ידי',
|
||||||
|
select_a_reason: 'בחר סיבה',
|
||||||
value_is_invalid: 'ערך לא תקין',
|
value_is_invalid: 'ערך לא תקין',
|
||||||
verification_code_is_invalid: 'קוד האימות אינו תקין',
|
verification_code_is_invalid: 'קוד האימות אינו תקין',
|
||||||
drawn_signature_on_a_touchscreen_device: 'חתימה שנוצרה במכשיר עם מסך מגע',
|
drawn_signature_on_a_touchscreen_device: 'חתימה שנוצרה במכשיר עם מסך מגע',
|
||||||
@@ -771,6 +851,14 @@ const he = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const nl = {
|
const nl = {
|
||||||
|
approved: 'Goedgekeurd',
|
||||||
|
reviewed: 'Beoordeeld',
|
||||||
|
other: 'Anders',
|
||||||
|
authored_by_me: 'Door mij geschreven',
|
||||||
|
approved_by: 'Goedgekeurd door',
|
||||||
|
reviewed_by: 'Beoordeeld door',
|
||||||
|
authored_by: 'Geschreven door',
|
||||||
|
select_a_reason: 'Selecteer een reden',
|
||||||
value_is_invalid: 'Waarde is ongeldig',
|
value_is_invalid: 'Waarde is ongeldig',
|
||||||
verification_code_is_invalid: 'Verificatiecode is ongeldig',
|
verification_code_is_invalid: 'Verificatiecode is ongeldig',
|
||||||
drawn_signature_on_a_touchscreen_device: 'Getekende handtekening op een apparaat met een touchscreen',
|
drawn_signature_on_a_touchscreen_device: 'Getekende handtekening op een apparaat met een touchscreen',
|
||||||
@@ -849,6 +937,14 @@ const nl = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ar = {
|
const ar = {
|
||||||
|
approved: 'موافق عليه',
|
||||||
|
reviewed: 'تمت مراجعته',
|
||||||
|
other: 'آخر',
|
||||||
|
authored_by_me: 'مؤلف بواسطتي',
|
||||||
|
approved_by: 'موافق عليه من قبل',
|
||||||
|
reviewed_by: 'مراجع من قبل',
|
||||||
|
authored_by: 'مؤلف من قبل',
|
||||||
|
select_a_reason: 'اختر سببًا',
|
||||||
value_is_invalid: 'القيمة غير صالحة',
|
value_is_invalid: 'القيمة غير صالحة',
|
||||||
verification_code_is_invalid: 'رمز التحقق غير صالح',
|
verification_code_is_invalid: 'رمز التحقق غير صالح',
|
||||||
drawn_signature_on_a_touchscreen_device: 'توقيع مرسوم على جهاز بشاشة تعمل باللمس',
|
drawn_signature_on_a_touchscreen_device: 'توقيع مرسوم على جهاز بشاشة تعمل باللمس',
|
||||||
@@ -926,6 +1022,14 @@ const ar = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ko = {
|
const ko = {
|
||||||
|
approved: '승인됨',
|
||||||
|
reviewed: '검토됨',
|
||||||
|
other: '기타',
|
||||||
|
authored_by_me: '내가 작성한',
|
||||||
|
approved_by: '승인자',
|
||||||
|
reviewed_by: '검토자',
|
||||||
|
authored_by: '작성자',
|
||||||
|
select_a_reason: '이유 선택',
|
||||||
drawn_signature_on_a_touchscreen_device: '터치스크린 장치에서 그린 서명',
|
drawn_signature_on_a_touchscreen_device: '터치스크린 장치에서 그린 서명',
|
||||||
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: '카메라 앱으로 QR 코드를 스캔하여 모바일에서 양식을 열고 서명을 그리세요',
|
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: '카메라 앱으로 QR 코드를 스캔하여 모바일에서 양식을 열고 서명을 그리세요',
|
||||||
by_clicking_you_agree_to_the: '"{button}"를 클릭함으로써, 다음에 동의하게 됩니다',
|
by_clicking_you_agree_to_the: '"{button}"를 클릭함으로써, 다음에 동의하게 됩니다',
|
||||||
|
|||||||
@@ -50,6 +50,26 @@
|
|||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
<span
|
||||||
|
class="tooltip"
|
||||||
|
:data-tip="t('click_to_upload')"
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
class="btn btn-outline btn-sm font-medium inline-flex flex-nowrap"
|
||||||
|
>
|
||||||
|
<IconUpload :width="16" />
|
||||||
|
<input
|
||||||
|
:key="uploadImageInputKey"
|
||||||
|
type="file"
|
||||||
|
hidden
|
||||||
|
accept="image/*"
|
||||||
|
@change="drawImage"
|
||||||
|
>
|
||||||
|
<span class="hidden sm:inline">
|
||||||
|
{{ t('upload') }}
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</span>
|
||||||
<a
|
<a
|
||||||
v-if="modelValue || computedPreviousValue"
|
v-if="modelValue || computedPreviousValue"
|
||||||
href="#"
|
href="#"
|
||||||
@@ -97,7 +117,7 @@
|
|||||||
<img
|
<img
|
||||||
v-if="modelValue || computedPreviousValue"
|
v-if="modelValue || computedPreviousValue"
|
||||||
:src="attachmentsIndex[modelValue || computedPreviousValue].url"
|
:src="attachmentsIndex[modelValue || computedPreviousValue].url"
|
||||||
class="mx-auto bg-white border border-base-300 rounded max-h-72"
|
class="mx-auto bg-white border border-base-300 rounded max-h-44"
|
||||||
>
|
>
|
||||||
<canvas
|
<canvas
|
||||||
v-show="!modelValue && !computedPreviousValue"
|
v-show="!modelValue && !computedPreviousValue"
|
||||||
@@ -120,16 +140,18 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { cropCanvasAndExportToPNG } from './crop_canvas'
|
import { cropCanvasAndExportToPNG } from './crop_canvas'
|
||||||
import { IconReload, IconTextSize, IconSignature, IconArrowsDiagonalMinimize2 } from '@tabler/icons-vue'
|
import { IconReload, IconTextSize, IconUpload, IconSignature, IconArrowsDiagonalMinimize2 } from '@tabler/icons-vue'
|
||||||
import SignaturePad from 'signature_pad'
|
import SignaturePad from 'signature_pad'
|
||||||
import AppearsOn from './appears_on'
|
import AppearsOn from './appears_on'
|
||||||
import MarkdownContent from './markdown_content'
|
import MarkdownContent from './markdown_content'
|
||||||
|
import SignatureStep from './signature_step'
|
||||||
|
|
||||||
const scale = 3
|
const scale = 3
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'InitialsStep',
|
name: 'InitialsStep',
|
||||||
components: {
|
components: {
|
||||||
|
IconUpload,
|
||||||
AppearsOn,
|
AppearsOn,
|
||||||
IconReload,
|
IconReload,
|
||||||
IconTextSize,
|
IconTextSize,
|
||||||
@@ -178,7 +200,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
isInitialsStarted: !!this.previousValue,
|
isInitialsStarted: !!this.previousValue,
|
||||||
isUsePreviousValue: true,
|
isUsePreviousValue: true,
|
||||||
isDrawInitials: false
|
isDrawInitials: false,
|
||||||
|
uploadImageInputKey: Math.random().toString()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -229,6 +252,15 @@ export default {
|
|||||||
this.intersectionObserver?.disconnect()
|
this.intersectionObserver?.disconnect()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
drawOnCanvas: SignatureStep.methods.drawOnCanvas,
|
||||||
|
drawImage (event) {
|
||||||
|
this.remove()
|
||||||
|
this.isInitialsStarted = true
|
||||||
|
|
||||||
|
this.drawOnCanvas(event.target.files[0], this.$refs.canvas)
|
||||||
|
|
||||||
|
this.uploadImageInputKey = Math.random().toString()
|
||||||
|
},
|
||||||
remove () {
|
remove () {
|
||||||
this.$emit('update:model-value', '')
|
this.$emit('update:model-value', '')
|
||||||
|
|
||||||
|
|||||||
@@ -194,6 +194,48 @@
|
|||||||
type="text"
|
type="text"
|
||||||
@input="updateWrittenSignature"
|
@input="updateWrittenSignature"
|
||||||
>
|
>
|
||||||
|
<select
|
||||||
|
v-if="requireSigningReason && !isOtherReason"
|
||||||
|
class="select base-input !text-2xl w-full mt-6 text-center"
|
||||||
|
required
|
||||||
|
:name="`values[${field.preferences.reason_field_uuid}]`"
|
||||||
|
@change="$event.target.value === 'other' ? [reason = '', isOtherReason = true] : $emit('update:reason', $event.target.value)"
|
||||||
|
>
|
||||||
|
<option
|
||||||
|
value=""
|
||||||
|
disabled
|
||||||
|
:selected="!reason"
|
||||||
|
>
|
||||||
|
{{ t('select_a_reason') }}
|
||||||
|
</option>
|
||||||
|
<option
|
||||||
|
v-for="(label, option) in defaultReasons"
|
||||||
|
:key="option"
|
||||||
|
:value="option"
|
||||||
|
:selected="reason === option"
|
||||||
|
>
|
||||||
|
{{ label }}
|
||||||
|
</option>
|
||||||
|
<option value="other">
|
||||||
|
{{ t('other') }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<input
|
||||||
|
v-if="requireSigningReason && isOtherReason"
|
||||||
|
class="base-input !text-2xl w-full mt-6"
|
||||||
|
required
|
||||||
|
:name="`values[${field.preferences.reason_field_uuid}]`"
|
||||||
|
:placeholder="t('type_here_')"
|
||||||
|
:value="reason"
|
||||||
|
type="text"
|
||||||
|
@input="$emit('update:reason', $event.target.value)"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
v-if="requireSigningReason"
|
||||||
|
hidden
|
||||||
|
name="with_reason"
|
||||||
|
:value="field.preferences.reason_field_uuid"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
v-if="isShowQr"
|
v-if="isShowQr"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
@@ -231,6 +273,7 @@ import { cropCanvasAndExportToPNG } from './crop_canvas'
|
|||||||
import SignaturePad from 'signature_pad'
|
import SignaturePad from 'signature_pad'
|
||||||
import AppearsOn from './appears_on'
|
import AppearsOn from './appears_on'
|
||||||
import MarkdownContent from './markdown_content'
|
import MarkdownContent from './markdown_content'
|
||||||
|
import { v4 } from 'uuid'
|
||||||
|
|
||||||
let isFontLoaded = false
|
let isFontLoaded = false
|
||||||
|
|
||||||
@@ -255,6 +298,11 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
requireSigningReason: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
submitter: {
|
submitter: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
@@ -304,17 +352,23 @@ export default {
|
|||||||
required: false,
|
required: false,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
|
reason: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: ['attached', 'update:model-value', 'start', 'minimize'],
|
emits: ['attached', 'update:model-value', 'start', 'minimize', 'update:reason'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isSignatureStarted: !!this.previousValue,
|
isSignatureStarted: !!this.previousValue,
|
||||||
isShowQr: false,
|
isShowQr: false,
|
||||||
|
isOtherReason: false,
|
||||||
isUsePreviousValue: true,
|
isUsePreviousValue: true,
|
||||||
isTextSignature: this.field.preferences?.format === 'typed',
|
isTextSignature: this.field.preferences?.format === 'typed',
|
||||||
uploadImageInputKey: Math.random().toString()
|
uploadImageInputKey: Math.random().toString()
|
||||||
@@ -324,6 +378,13 @@ export default {
|
|||||||
submitterSlug () {
|
submitterSlug () {
|
||||||
return this.submitter.slug
|
return this.submitter.slug
|
||||||
},
|
},
|
||||||
|
defaultReasons () {
|
||||||
|
return {
|
||||||
|
[this.t('approved_by')]: this.t('approved'),
|
||||||
|
[this.t('reviewed_by')]: this.t('reviewed'),
|
||||||
|
[this.t('authored_by')]: this.t('authored_by_me')
|
||||||
|
}
|
||||||
|
},
|
||||||
computedPreviousValue () {
|
computedPreviousValue () {
|
||||||
if (this.isUsePreviousValue) {
|
if (this.isUsePreviousValue) {
|
||||||
return this.previousValue
|
return this.previousValue
|
||||||
@@ -332,6 +393,13 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created () {
|
||||||
|
if (this.requireSigningReason) {
|
||||||
|
this.field.preferences ||= {}
|
||||||
|
this.field.preferences.reason_field_uuid ||= v4()
|
||||||
|
this.isOtherReason = this.reason && !this.defaultReasons[this.reason]
|
||||||
|
}
|
||||||
|
},
|
||||||
async mounted () {
|
async mounted () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$refs.canvas) {
|
if (this.$refs.canvas) {
|
||||||
@@ -501,8 +569,11 @@ export default {
|
|||||||
this.remove()
|
this.remove()
|
||||||
this.isSignatureStarted = true
|
this.isSignatureStarted = true
|
||||||
|
|
||||||
const file = event.target.files[0]
|
this.drawOnCanvas(event.target.files[0], this.$refs.canvas)
|
||||||
|
|
||||||
|
this.uploadImageInputKey = Math.random().toString()
|
||||||
|
},
|
||||||
|
drawOnCanvas (file, canvas) {
|
||||||
if (file && file.type.match('image.*')) {
|
if (file && file.type.match('image.*')) {
|
||||||
const reader = new FileReader()
|
const reader = new FileReader()
|
||||||
|
|
||||||
@@ -512,7 +583,6 @@ export default {
|
|||||||
img.src = event.target.result
|
img.src = event.target.result
|
||||||
|
|
||||||
img.onload = () => {
|
img.onload = () => {
|
||||||
const canvas = this.$refs.canvas
|
|
||||||
const context = canvas.getContext('2d')
|
const context = canvas.getContext('2d')
|
||||||
|
|
||||||
const aspectRatio = img.width / img.height
|
const aspectRatio = img.width / img.height
|
||||||
@@ -547,8 +617,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reader.readAsDataURL(file)
|
reader.readAsDataURL(file)
|
||||||
|
|
||||||
this.uploadImageInputKey = Math.random().toString()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
maybeSetSignedUuid (signedUuid) {
|
maybeSetSignedUuid (signedUuid) {
|
||||||
|
|||||||
@@ -435,6 +435,7 @@ export default {
|
|||||||
save: this.save,
|
save: this.save,
|
||||||
t: this.t,
|
t: this.t,
|
||||||
currencies: this.currencies,
|
currencies: this.currencies,
|
||||||
|
locale: this.locale,
|
||||||
baseFetch: this.baseFetch,
|
baseFetch: this.baseFetch,
|
||||||
fieldTypes: this.fieldTypes,
|
fieldTypes: this.fieldTypes,
|
||||||
backgroundColor: this.backgroundColor,
|
backgroundColor: this.backgroundColor,
|
||||||
@@ -468,6 +469,11 @@ export default {
|
|||||||
required: false,
|
required: false,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
|
locale: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
editable: {
|
editable: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
@@ -649,6 +655,20 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
selectedAreaRef: () => ref(),
|
selectedAreaRef: () => ref(),
|
||||||
fieldsDragFieldRef: () => ref(),
|
fieldsDragFieldRef: () => ref(),
|
||||||
|
defaultDateFormat () {
|
||||||
|
const isUsBrowser = Intl.DateTimeFormat().resolvedOptions().locale.endsWith('-US')
|
||||||
|
const isUsTimezone = new Intl.DateTimeFormat('en-US', { timeZoneName: 'short' }).format(new Date()).match(/\s(?:CST|CDT|PST|PDT|EST|EDT)$/)
|
||||||
|
|
||||||
|
return this.localeDateFormats[this.locale] || ((isUsBrowser || isUsTimezone) ? 'MM/DD/YYYY' : 'DD/MM/YYYY')
|
||||||
|
},
|
||||||
|
localeDateFormats () {
|
||||||
|
return {
|
||||||
|
'de-DE': 'DD.MM.YYYY',
|
||||||
|
'fr-FR': 'DD/MM/YYYY',
|
||||||
|
'it-IT': 'DD/MM/YYYY',
|
||||||
|
'es-ES': 'DD/MM/YYYY'
|
||||||
|
}
|
||||||
|
},
|
||||||
fieldAreasIndex () {
|
fieldAreasIndex () {
|
||||||
const areas = {}
|
const areas = {}
|
||||||
|
|
||||||
@@ -768,7 +788,7 @@ export default {
|
|||||||
|
|
||||||
if (type === 'date') {
|
if (type === 'date') {
|
||||||
field.preferences = {
|
field.preferences = {
|
||||||
format: Intl.DateTimeFormat().resolvedOptions().locale.endsWith('-US') || new Intl.DateTimeFormat('en-US', { timeZoneName: 'short' }).format(new Date()).match(/\s(?:CST|CDT|PST|PDT|EST|EDT)$/) ? 'MM/DD/YYYY' : 'DD/MM/YYYY'
|
format: this.defaultDateFormat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -801,7 +821,7 @@ export default {
|
|||||||
|
|
||||||
if (type === 'date') {
|
if (type === 'date') {
|
||||||
field.preferences = {
|
field.preferences = {
|
||||||
format: Intl.DateTimeFormat().resolvedOptions().locale.endsWith('-US') || new Intl.DateTimeFormat('en-US', { timeZoneName: 'short' }).format(new Date()).match(/\s(?:CST|CDT|PST|PDT|EST|EDT)$/) ? 'MM/DD/YYYY' : 'DD/MM/YYYY'
|
format: this.defaultDateFormat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1138,7 +1158,7 @@ export default {
|
|||||||
|
|
||||||
if (field.type === 'date') {
|
if (field.type === 'date') {
|
||||||
field.preferences = {
|
field.preferences = {
|
||||||
format: Intl.DateTimeFormat().resolvedOptions().locale.endsWith('-US') || new Intl.DateTimeFormat('en-US', { timeZoneName: 'short' }).format(new Date()).match(/\s(?:CST|CDT|PST|PDT|EST|EDT)$/) ? 'MM/DD/YYYY' : 'DD/MM/YYYY'
|
format: this.defaultDateFormat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,6 +130,7 @@
|
|||||||
@click-description="isShowDescriptionModal = true"
|
@click-description="isShowDescriptionModal = true"
|
||||||
@click-condition="isShowConditionsModal = true"
|
@click-condition="isShowConditionsModal = true"
|
||||||
@set-draw="$emit('set-draw', $event)"
|
@set-draw="$emit('set-draw', $event)"
|
||||||
|
@remove-area="removeArea"
|
||||||
@scroll-to="$emit('scroll-to', $event)"
|
@scroll-to="$emit('scroll-to', $event)"
|
||||||
/>
|
/>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -281,7 +282,7 @@ export default {
|
|||||||
IconMathFunction,
|
IconMathFunction,
|
||||||
FieldType
|
FieldType
|
||||||
},
|
},
|
||||||
inject: ['template', 'save', 'backgroundColor', 'selectedAreaRef', 't'],
|
inject: ['template', 'save', 'backgroundColor', 'selectedAreaRef', 't', 'locale'],
|
||||||
props: {
|
props: {
|
||||||
field: {
|
field: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -341,10 +342,15 @@ export default {
|
|||||||
|
|
||||||
if (this.field.type === 'date') {
|
if (this.field.type === 'date') {
|
||||||
this.field.preferences.format ||=
|
this.field.preferences.format ||=
|
||||||
(Intl.DateTimeFormat().resolvedOptions().locale.endsWith('-US') || new Intl.DateTimeFormat('en-US', { timeZoneName: 'short' }).format(new Date()).match(/\s(?:CST|CDT|PST|PDT|EST|EDT)$/) ? 'MM/DD/YYYY' : 'DD/MM/YYYY')
|
({ 'de-DE': 'DD.MM.YYYY' }[this.locale] || ((Intl.DateTimeFormat().resolvedOptions().locale.endsWith('-US') || new Intl.DateTimeFormat('en-US', { timeZoneName: 'short' }).format(new Date()).match(/\s(?:CST|CDT|PST|PDT|EST|EDT)$/)) ? 'MM/DD/YYYY' : 'DD/MM/YYYY'))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
removeArea (area) {
|
||||||
|
this.field.areas.splice(this.field.areas.indexOf(area), 1)
|
||||||
|
|
||||||
|
this.save()
|
||||||
|
},
|
||||||
buildDefaultName (field, fields) {
|
buildDefaultName (field, fields) {
|
||||||
if (field.type === 'payment' && field.preferences?.price && !field.preferences?.formula) {
|
if (field.type === 'payment' && field.preferences?.price && !field.preferences?.formula) {
|
||||||
const { price, currency } = field.preferences || {}
|
const { price, currency } = field.preferences || {}
|
||||||
|
|||||||
@@ -358,7 +358,7 @@
|
|||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
class="text-sm py-1 px-2"
|
class="text-sm py-1 px-2 group/1"
|
||||||
@click.prevent="$emit('scroll-to', area)"
|
@click.prevent="$emit('scroll-to', area)"
|
||||||
>
|
>
|
||||||
<IconShape
|
<IconShape
|
||||||
@@ -367,6 +367,11 @@
|
|||||||
/>
|
/>
|
||||||
{{ t('page') }}
|
{{ t('page') }}
|
||||||
<template v-if="template.schema.length > 1">{{ template.schema.findIndex((item) => item.attachment_uuid === area.attachment_uuid) + 1 }}-</template>{{ area.page + 1 }}
|
<template v-if="template.schema.length > 1">{{ template.schema.findIndex((item) => item.attachment_uuid === area.attachment_uuid) + 1 }}-</template>{{ area.page + 1 }}
|
||||||
|
<IconX
|
||||||
|
:width="12"
|
||||||
|
class="group-hover/1:inline hidden"
|
||||||
|
@click.prevent.stop="[$emit('remove-area', area), $event.target.closest('.dropdown').querySelector('label').focus()]"
|
||||||
|
/>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="!field.areas?.length || !['radio', 'multiple'].includes(field.type)">
|
<li v-if="!field.areas?.length || !['radio', 'multiple'].includes(field.type)">
|
||||||
@@ -399,7 +404,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { IconRouteAltLeft, IconShape, IconMathFunction, IconNewSection, IconInfoCircle, IconCopy } from '@tabler/icons-vue'
|
import { IconRouteAltLeft, IconShape, IconX, IconMathFunction, IconNewSection, IconInfoCircle, IconCopy } from '@tabler/icons-vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'FieldSettings',
|
name: 'FieldSettings',
|
||||||
@@ -409,7 +414,8 @@ export default {
|
|||||||
IconMathFunction,
|
IconMathFunction,
|
||||||
IconRouteAltLeft,
|
IconRouteAltLeft,
|
||||||
IconCopy,
|
IconCopy,
|
||||||
IconNewSection
|
IconNewSection,
|
||||||
|
IconX
|
||||||
},
|
},
|
||||||
inject: ['template', 'save', 't'],
|
inject: ['template', 'save', 't'],
|
||||||
props: {
|
props: {
|
||||||
@@ -443,7 +449,7 @@ export default {
|
|||||||
default: true
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: ['set-draw', 'scroll-to', 'click-formula', 'click-description', 'click-condition'],
|
emits: ['set-draw', 'scroll-to', 'click-formula', 'click-description', 'click-condition', 'remove-area'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<template
|
<template
|
||||||
v-for="(icon, type) in fieldIcons"
|
v-for="(icon, type) in fieldIconsSorted"
|
||||||
:key="type"
|
:key="type"
|
||||||
>
|
>
|
||||||
<li v-if="(fieldTypes.length === 0 || fieldTypes.includes(type)) && (withPhone || type != 'phone') && (withPayment || type != 'payment')">
|
<li v-if="(fieldTypes.length === 0 || fieldTypes.includes(type)) && (withPhone || type != 'phone') && (withPayment || type != 'payment')">
|
||||||
|
|||||||
@@ -15,15 +15,19 @@ class ProcessSubmitterCompletionJob
|
|||||||
Submissions::EnsureResultGenerated.call(submitter)
|
Submissions::EnsureResultGenerated.call(submitter)
|
||||||
|
|
||||||
if is_all_completed && submitter.completed_at == submitter.submission.submitters.maximum(:completed_at)
|
if is_all_completed && submitter.completed_at == submitter.submission.submitters.maximum(:completed_at)
|
||||||
|
if submitter.submission.account.account_configs.exists?(key: AccountConfig::COMBINE_PDF_RESULT_KEY, value: true)
|
||||||
|
Submissions::GenerateCombinedAttachment.call(submitter)
|
||||||
|
end
|
||||||
|
|
||||||
Submissions::GenerateAuditTrail.call(submitter.submission)
|
Submissions::GenerateAuditTrail.call(submitter.submission)
|
||||||
|
|
||||||
enqueue_completed_emails(submitter)
|
enqueue_completed_emails(submitter)
|
||||||
end
|
end
|
||||||
|
|
||||||
enqueue_completed_webhooks(submitter)
|
enqueue_completed_webhooks(submitter, is_all_completed:)
|
||||||
end
|
end
|
||||||
|
|
||||||
def enqueue_completed_webhooks(submitter)
|
def enqueue_completed_webhooks(submitter, is_all_completed: false)
|
||||||
webhook_config = Accounts.load_webhook_config(submitter.account)
|
webhook_config = Accounts.load_webhook_config(submitter.account)
|
||||||
|
|
||||||
if webhook_config
|
if webhook_config
|
||||||
@@ -31,13 +35,26 @@ class ProcessSubmitterCompletionJob
|
|||||||
'encrypted_config_id' => webhook_config.id })
|
'encrypted_config_id' => webhook_config.id })
|
||||||
end
|
end
|
||||||
|
|
||||||
webhook_ids = submitter.account.webhook_urls.where(
|
webhook_urls = submitter.account.webhook_urls
|
||||||
Arel::Table.new(:webhook_urls)[:events].matches('%"form.completed"%')
|
|
||||||
).pluck(:id)
|
|
||||||
|
|
||||||
webhook_ids.each do |webhook_id|
|
webhook_urls = webhook_urls.where(
|
||||||
SendFormCompletedWebhookRequestJob.perform_async({ 'submitter_id' => submitter.id,
|
Arel::Table.new(:webhook_urls)[:events].matches('%"form.completed"%')
|
||||||
'webhook_url_id' => webhook_id })
|
).or(
|
||||||
|
webhook_urls.where(
|
||||||
|
Arel::Table.new(:webhook_urls)[:events].matches('%"submission.completed"%')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
webhook_urls.each do |webhook|
|
||||||
|
if webhook.events.include?('form.completed')
|
||||||
|
SendFormCompletedWebhookRequestJob.perform_async({ 'submitter_id' => submitter.id,
|
||||||
|
'webhook_url_id' => webhook.id })
|
||||||
|
end
|
||||||
|
|
||||||
|
if webhook.events.include?('submission.completed') && is_all_completed
|
||||||
|
SendSubmissionCompletedWebhookRequestJob.perform_async({ 'submission_id' => submitter.submission_id,
|
||||||
|
'webhook_url_id' => webhook.id })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class SendFormDeclinedWebhookRequestJob
|
||||||
|
include Sidekiq::Job
|
||||||
|
|
||||||
|
sidekiq_options queue: :webhooks
|
||||||
|
|
||||||
|
USER_AGENT = 'DocuSeal.co Webhook'
|
||||||
|
|
||||||
|
MAX_ATTEMPTS = 10
|
||||||
|
|
||||||
|
def perform(params = {})
|
||||||
|
submitter = Submitter.find(params['submitter_id'])
|
||||||
|
|
||||||
|
attempt = params['attempt'].to_i
|
||||||
|
config = Accounts.load_webhook_config(submitter.submission.account)
|
||||||
|
url = config&.value.presence
|
||||||
|
|
||||||
|
return if url.blank?
|
||||||
|
|
||||||
|
preferences = Accounts.load_webhook_preferences(submitter.submission.account)
|
||||||
|
|
||||||
|
return if preferences['form.declined'] == false
|
||||||
|
|
||||||
|
ActiveStorage::Current.url_options = Docuseal.default_url_options
|
||||||
|
|
||||||
|
resp = begin
|
||||||
|
Faraday.post(url,
|
||||||
|
{
|
||||||
|
event_type: 'form.declined',
|
||||||
|
timestamp: Time.current,
|
||||||
|
data: Submitters::SerializeForWebhook.call(submitter)
|
||||||
|
}.to_json,
|
||||||
|
**EncryptedConfig.find_or_initialize_by(account_id: config.account_id,
|
||||||
|
key: EncryptedConfig::WEBHOOK_SECRET_KEY)&.value.to_h,
|
||||||
|
'Content-Type' => 'application/json',
|
||||||
|
'User-Agent' => USER_AGENT)
|
||||||
|
rescue Faraday::Error
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if (resp.nil? || resp.status.to_i >= 400) && attempt <= MAX_ATTEMPTS &&
|
||||||
|
(!Docuseal.multitenant? || submitter.account.account_configs.exists?(key: :plan))
|
||||||
|
SendFormDeclinedWebhookRequestJob.perform_in((2**attempt).minutes, {
|
||||||
|
'submitter_id' => submitter.id,
|
||||||
|
'attempt' => attempt + 1,
|
||||||
|
'last_status' => resp&.status.to_i
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class SendSubmissionCompletedWebhookRequestJob
|
||||||
|
include Sidekiq::Job
|
||||||
|
|
||||||
|
sidekiq_options queue: :webhooks
|
||||||
|
|
||||||
|
USER_AGENT = 'DocuSeal.co Webhook'
|
||||||
|
|
||||||
|
MAX_ATTEMPTS = 10
|
||||||
|
|
||||||
|
def perform(params = {})
|
||||||
|
submission = Submission.find(params['submission_id'])
|
||||||
|
|
||||||
|
attempt = params['attempt'].to_i
|
||||||
|
|
||||||
|
webhook_url = submission.account.webhook_urls.find(params['webhook_url_id'])
|
||||||
|
|
||||||
|
url = webhook_url.url if webhook_url.events.include?('submission.completed')
|
||||||
|
|
||||||
|
return if url.blank?
|
||||||
|
|
||||||
|
resp = begin
|
||||||
|
Faraday.post(url,
|
||||||
|
{
|
||||||
|
event_type: 'submission.completed',
|
||||||
|
timestamp: Time.current,
|
||||||
|
data: Submissions::SerializeForApi.call(submission)
|
||||||
|
}.to_json,
|
||||||
|
**EncryptedConfig.find_or_initialize_by(account_id: submission.account_id,
|
||||||
|
key: EncryptedConfig::WEBHOOK_SECRET_KEY)&.value.to_h,
|
||||||
|
'Content-Type' => 'application/json',
|
||||||
|
'User-Agent' => USER_AGENT)
|
||||||
|
rescue Faraday::Error
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if (resp.nil? || resp.status.to_i >= 400) && attempt <= MAX_ATTEMPTS &&
|
||||||
|
(!Docuseal.multitenant? || submission.account.account_configs.exists?(key: :plan))
|
||||||
|
SendSubmissionCompletedWebhookRequestJob.perform_in((2**attempt).minutes, {
|
||||||
|
**params,
|
||||||
|
'attempt' => attempt + 1,
|
||||||
|
'last_status' => resp&.status.to_i
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -78,6 +78,24 @@ class SubmitterMailer < ApplicationMailer
|
|||||||
subject:)
|
subject:)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def declined_email(submitter, user)
|
||||||
|
@current_account = submitter.submission.account
|
||||||
|
@submitter = submitter
|
||||||
|
@submission = submitter.submission
|
||||||
|
@user = user
|
||||||
|
|
||||||
|
assign_message_metadata('submitter_declined', @submitter)
|
||||||
|
|
||||||
|
I18n.with_locale(submitter.account.locale) do
|
||||||
|
mail(from: from_address_for_submitter(submitter),
|
||||||
|
to: user.role == 'integration' ? user.friendly_name.sub(/\+\w+@/, '@') : user.friendly_name,
|
||||||
|
reply_to: @submitter.friendly_name,
|
||||||
|
subject: I18n.t(:name_declined_by_submitter,
|
||||||
|
name: @submission.template.name.truncate(20),
|
||||||
|
submitter: @submitter.name || @submitter.email || @submitter.phone))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def documents_copy_email(submitter, to: nil, sig: false)
|
def documents_copy_email(submitter, to: nil, sig: false)
|
||||||
@current_account = submitter.submission.account
|
@current_account = submitter.submission.account
|
||||||
@submitter = submitter
|
@submitter = submitter
|
||||||
@@ -139,7 +157,7 @@ class SubmitterMailer < ApplicationMailer
|
|||||||
total_size = 0
|
total_size = 0
|
||||||
audit_trail_data = nil
|
audit_trail_data = nil
|
||||||
|
|
||||||
if with_audit_log && submitter.submission.audit_trail.present?
|
if with_audit_log && submitter.submission.audit_trail.present? && documents.first&.name != 'combined_document'
|
||||||
audit_trail_data = submitter.submission.audit_trail.download
|
audit_trail_data = submitter.submission.audit_trail.download
|
||||||
|
|
||||||
total_size = audit_trail_data.size
|
total_size = audit_trail_data.size
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class Account < ApplicationRecord
|
|||||||
has_one :default_template_folder, -> { where(name: TemplateFolder::DEFAULT_NAME) },
|
has_one :default_template_folder, -> { where(name: TemplateFolder::DEFAULT_NAME) },
|
||||||
class_name: 'TemplateFolder', dependent: :destroy, inverse_of: :account
|
class_name: 'TemplateFolder', dependent: :destroy, inverse_of: :account
|
||||||
has_many :submissions, dependent: :destroy
|
has_many :submissions, dependent: :destroy
|
||||||
has_many :submitters, through: :submissions
|
has_many :submitters, dependent: :destroy
|
||||||
has_many :account_linked_accounts, dependent: :destroy
|
has_many :account_linked_accounts, dependent: :destroy
|
||||||
has_many :email_events, dependent: :destroy
|
has_many :email_events, dependent: :destroy
|
||||||
has_many :webhook_urls, dependent: :destroy
|
has_many :webhook_urls, dependent: :destroy
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ class AccountConfig < ApplicationRecord
|
|||||||
FORCE_SSO_AUTH_KEY = 'force_sso_auth'
|
FORCE_SSO_AUTH_KEY = 'force_sso_auth'
|
||||||
FLATTEN_RESULT_PDF_KEY = 'flatten_result_pdf'
|
FLATTEN_RESULT_PDF_KEY = 'flatten_result_pdf'
|
||||||
WITH_SIGNATURE_ID = 'with_signature_id'
|
WITH_SIGNATURE_ID = 'with_signature_id'
|
||||||
|
REQUIRE_SIGNING_REASON_KEY = 'require_signing_reason'
|
||||||
|
COMBINE_PDF_RESULT_KEY = 'combine_pdf_result_key'
|
||||||
|
|
||||||
DEFAULT_VALUES = {
|
DEFAULT_VALUES = {
|
||||||
SUBMITTER_INVITATION_EMAIL_KEY => {
|
SUBMITTER_INVITATION_EMAIL_KEY => {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#
|
#
|
||||||
# Indexes
|
# Indexes
|
||||||
#
|
#
|
||||||
# index_submissions_on_account_id (account_id)
|
# index_submissions_on_account_id_and_id (account_id,id)
|
||||||
# index_submissions_on_created_by_user_id (created_by_user_id)
|
# index_submissions_on_created_by_user_id (created_by_user_id)
|
||||||
# index_submissions_on_slug (slug) UNIQUE
|
# index_submissions_on_slug (slug) UNIQUE
|
||||||
# index_submissions_on_template_id (template_id)
|
# index_submissions_on_template_id (template_id)
|
||||||
@@ -86,4 +86,10 @@ class Submission < ApplicationRecord
|
|||||||
ActiveStorage::Blob.proxy_url(audit_trail.blob)
|
ActiveStorage::Blob.proxy_url(audit_trail.blob)
|
||||||
end
|
end
|
||||||
alias audit_log_url audit_trail_url
|
alias audit_log_url audit_trail_url
|
||||||
|
|
||||||
|
def combined_document_url
|
||||||
|
return if combined_document.blank?
|
||||||
|
|
||||||
|
ActiveStorage::Blob.proxy_url(combined_document.blob)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@@ -48,6 +48,7 @@ class SubmissionEvent < ApplicationRecord
|
|||||||
start_form: 'start_form',
|
start_form: 'start_form',
|
||||||
view_form: 'view_form',
|
view_form: 'view_form',
|
||||||
complete_form: 'complete_form',
|
complete_form: 'complete_form',
|
||||||
|
decline_form: 'decline_form',
|
||||||
api_complete_form: 'api_complete_form'
|
api_complete_form: 'api_complete_form'
|
||||||
}, scope: false
|
}, scope: false
|
||||||
|
|
||||||
|
|||||||
+12
-7
@@ -6,6 +6,7 @@
|
|||||||
#
|
#
|
||||||
# id :bigint not null, primary key
|
# id :bigint not null, primary key
|
||||||
# completed_at :datetime
|
# completed_at :datetime
|
||||||
|
# declined_at :datetime
|
||||||
# email :string
|
# email :string
|
||||||
# ip :string
|
# ip :string
|
||||||
# metadata :text not null
|
# metadata :text not null
|
||||||
@@ -20,15 +21,17 @@
|
|||||||
# values :text not null
|
# values :text not null
|
||||||
# created_at :datetime not null
|
# created_at :datetime not null
|
||||||
# updated_at :datetime not null
|
# updated_at :datetime not null
|
||||||
|
# account_id :bigint not null
|
||||||
# external_id :string
|
# external_id :string
|
||||||
# submission_id :bigint not null
|
# submission_id :bigint not null
|
||||||
#
|
#
|
||||||
# Indexes
|
# Indexes
|
||||||
#
|
#
|
||||||
# index_submitters_on_email (email)
|
# index_submitters_on_account_id_and_id (account_id,id)
|
||||||
# index_submitters_on_external_id (external_id)
|
# index_submitters_on_email (email)
|
||||||
# index_submitters_on_slug (slug) UNIQUE
|
# index_submitters_on_external_id (external_id)
|
||||||
# index_submitters_on_submission_id (submission_id)
|
# index_submitters_on_slug (slug) UNIQUE
|
||||||
|
# index_submitters_on_submission_id (submission_id)
|
||||||
#
|
#
|
||||||
# Foreign Keys
|
# Foreign Keys
|
||||||
#
|
#
|
||||||
@@ -36,8 +39,8 @@
|
|||||||
#
|
#
|
||||||
class Submitter < ApplicationRecord
|
class Submitter < ApplicationRecord
|
||||||
belongs_to :submission
|
belongs_to :submission
|
||||||
|
belongs_to :account
|
||||||
has_one :template, through: :submission
|
has_one :template, through: :submission
|
||||||
has_one :account, through: :submission
|
|
||||||
|
|
||||||
attribute :values, :string, default: -> { {} }
|
attribute :values, :string, default: -> { {} }
|
||||||
attribute :preferences, :string, default: -> { {} }
|
attribute :preferences, :string, default: -> { {} }
|
||||||
@@ -57,7 +60,9 @@ class Submitter < ApplicationRecord
|
|||||||
scope :completed, -> { where.not(completed_at: nil) }
|
scope :completed, -> { where.not(completed_at: nil) }
|
||||||
|
|
||||||
def status
|
def status
|
||||||
if completed_at?
|
if declined_at?
|
||||||
|
'declined'
|
||||||
|
elsif completed_at?
|
||||||
'completed'
|
'completed'
|
||||||
elsif opened_at?
|
elsif opened_at?
|
||||||
'opened'
|
'opened'
|
||||||
@@ -81,6 +86,6 @@ class Submitter < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def status_event_at
|
def status_event_at
|
||||||
completed_at || opened_at || sent_at || created_at
|
declined_at || completed_at || opened_at || sent_at || created_at
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -63,6 +63,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::REQUIRE_SIGNING_REASON_KEY) %>
|
||||||
|
<% if can?(:manage, account_config) %>
|
||||||
|
<%= form_for account_config, url: account_configs_path, method: :post do |f| %>
|
||||||
|
<%= f.hidden_field :key %>
|
||||||
|
<div class="flex items-center justify-between py-2.5">
|
||||||
|
<span>
|
||||||
|
Require signing reason
|
||||||
|
</span>
|
||||||
|
<%= f.check_box :value, class: 'toggle', checked: account_config.value, onchange: 'this.form.requestSubmit()' %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::ALLOW_TYPED_SIGNATURE) %>
|
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::ALLOW_TYPED_SIGNATURE) %>
|
||||||
<% if can?(:manage, account_config) %>
|
<% if can?(:manage, account_config) %>
|
||||||
<%= form_for account_config, url: account_configs_path, method: :post do |f| %>
|
<%= form_for account_config, url: account_configs_path, method: :post do |f| %>
|
||||||
@@ -111,6 +123,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::COMBINE_PDF_RESULT_KEY) %>
|
||||||
|
<% if can?(:manage, account_config) %>
|
||||||
|
<%= form_for account_config, url: account_configs_path, method: :post do |f| %>
|
||||||
|
<%= f.hidden_field :key %>
|
||||||
|
<div class="flex items-center justify-between py-2.5">
|
||||||
|
<span>
|
||||||
|
Combine completed documents and Audit Log
|
||||||
|
</span>
|
||||||
|
<%= f.check_box :value, class: 'toggle', checked: account_config.value, onchange: 'this.form.requestSubmit()' %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= render 'integrations' %>
|
<%= render 'integrations' %>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form action="<%= root_path %>" method="get" class="bg-base-200 px-1.5 rounded-xl py-1">
|
<form action="<%= root_path %>" method="get" class="bg-base-200 px-1.5 rounded-xl py-1 whitespace-nowrap">
|
||||||
<toggle-cookies data-value="templates" data-key="dashboard_view" class="sm:tooltip tooltip-top" data-tip="Templates">
|
<toggle-cookies data-value="templates" data-key="dashboard_view" class="sm:tooltip tooltip-top" data-tip="Templates">
|
||||||
<button class="<%= local_assigns[:selected] == 'submissions' ? 'btn !border !rounded-lg btn-square !p-0 !btn-sm !h-8 !w-9' : 'btn btn-neutral !rounded-lg btn-square !p-0 hover:text-neutral-300 !btn-sm !h-8 !w-9 disabled:btn-neutral' %>">
|
<button class="<%= local_assigns[:selected] == 'submissions' ? 'btn !border !rounded-lg btn-square !p-0 !btn-sm !h-8 !w-9' : 'btn btn-neutral !rounded-lg btn-square !p-0 hover:text-neutral-300 !btn-sm !h-8 !w-9 disabled:btn-neutral' %>">
|
||||||
<%= svg_icon('layout_grid', class: 'w-6 h-6 stroke-2') %>
|
<%= svg_icon('layout_grid', class: 'w-6 h-6 stroke-2') %>
|
||||||
|
|||||||
@@ -13,20 +13,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.error-page h1 {
|
.error-page h1 {
|
||||||
font-weight: 700;
|
|
||||||
font-size: 3em;
|
|
||||||
color: #291434;
|
|
||||||
margin: 0 0 0.1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.error-page h2 {
|
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 10em;
|
font-size: 10em;
|
||||||
color: #3BBFF7;
|
color: #3BBFF7;
|
||||||
margin: 0 0 0.1em;
|
margin: 0 0 0.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-page h3 {
|
.error-page h2 {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 1.75em;
|
font-size: 1.75em;
|
||||||
color: #291434;
|
color: #291434;
|
||||||
@@ -56,9 +49,8 @@
|
|||||||
<body class="error-page">
|
<body class="error-page">
|
||||||
<div class="dialog">
|
<div class="dialog">
|
||||||
<div>
|
<div>
|
||||||
<h1>DocuSeal</h1>
|
<h1>404</h1>
|
||||||
<h2>404</h2>
|
<h2>Sorry, we couldn't find this page.</h2>
|
||||||
<h3>Sorry, we couldn't find this page.</h3>
|
|
||||||
</div>
|
</div>
|
||||||
<a rel="noopener noreferrer" href="/" class="btn">Back to homepage</a>
|
<a rel="noopener noreferrer" href="/" class="btn">Back to homepage</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,20 +13,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.error-page h1 {
|
.error-page h1 {
|
||||||
font-weight: 700;
|
|
||||||
font-size: 3em;
|
|
||||||
color: #291434;
|
|
||||||
margin: 0 0 0.1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.error-page h2 {
|
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 10em;
|
font-size: 10em;
|
||||||
color: #FABE22;
|
color: #FABE22;
|
||||||
margin: 0 0 0.1em;
|
margin: 0 0 0.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-page h3 {
|
.error-page h2 {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 1.75em;
|
font-size: 1.75em;
|
||||||
color: #291434;
|
color: #291434;
|
||||||
@@ -56,9 +49,8 @@
|
|||||||
<body class="error-page">
|
<body class="error-page">
|
||||||
<div class="dialog">
|
<div class="dialog">
|
||||||
<div>
|
<div>
|
||||||
<h1>DocuSeal</h1>
|
<h1>422</h1>
|
||||||
<h2>422</h2>
|
<h2>You're not allowed to access this page</h2>
|
||||||
<h3>You're not allowed to access this page</h3>
|
|
||||||
</div>
|
</div>
|
||||||
<a rel="noopener noreferrer" href="/" class="btn">Back to homepage</a>
|
<a rel="noopener noreferrer" href="/" class="btn">Back to homepage</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,20 +13,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.error-page h1 {
|
.error-page h1 {
|
||||||
font-weight: 700;
|
|
||||||
font-size: 3em;
|
|
||||||
color: #291434;
|
|
||||||
margin: 0 0 0.1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.error-page h2 {
|
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 10em;
|
font-size: 10em;
|
||||||
color: #F97272;
|
color: #F97272;
|
||||||
margin: 0 0 0.1em;
|
margin: 0 0 0.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-page h3 {
|
.error-page h2 {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 1.75em;
|
font-size: 1.75em;
|
||||||
color: #291434;
|
color: #291434;
|
||||||
@@ -56,9 +49,8 @@
|
|||||||
<body class="error-page">
|
<body class="error-page">
|
||||||
<div class="dialog">
|
<div class="dialog">
|
||||||
<div>
|
<div>
|
||||||
<h1>DocuSeal</h1>
|
<h1>500</h1>
|
||||||
<h2>500</h2>
|
<h2>We're sorry, but something went wrong</h2>
|
||||||
<h3>We're sorry, but something went wrong</h3>
|
|
||||||
</div>
|
</div>
|
||||||
<a rel="noopener noreferrer" href="/" class="btn">Back to homepage</a>
|
<a rel="noopener noreferrer" href="/" class="btn">Back to homepage</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html data-theme="docuseal" lang="<%= I18n.locale %>">
|
<html data-theme="docuseal" lang="<%= I18n.locale %>">
|
||||||
<head>
|
<head>
|
||||||
<%= render 'layouts/head_tags' %>
|
<%= render 'layouts/head_tags' %>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
<%= csrf_meta_tags %>
|
<%= csrf_meta_tags %>
|
||||||
<%= csp_meta_tag %>
|
<%= csp_meta_tag %>
|
||||||
<% if ENV['ROLLBAR_CLIENT_TOKEN'] %>
|
<% if ENV['ROLLBAR_CLIENT_TOKEN'] %>
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<% uuid = SecureRandom.uuid %>
|
||||||
|
<label id="<%= local_assigns[:button_id] %>" for="<%= uuid %>" class="<%= local_assigns[:btn_class] %>"><%= local_assigns[:btn_text] %></label>
|
||||||
|
<input type="checkbox" id="<%= uuid %>" class="modal-toggle">
|
||||||
|
<div id="<%= local_assigns[:id] %>" class="modal items-start !animate-none overflow-y-auto">
|
||||||
|
<div class="modal-box pt-4 pb-6 px-6 mt-20 max-h-none">
|
||||||
|
<% if local_assigns[:title] %>
|
||||||
|
<div class="flex justify-between items-center border-b pb-2 mb-2 font-medium">
|
||||||
|
<span>
|
||||||
|
<%= local_assigns[:title] %>
|
||||||
|
</span>
|
||||||
|
<label for="<%= uuid %>" class="text-xl">×</label>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<%= yield %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<label class="modal-backdrop" for="<%= uuid %>">Close</label>
|
||||||
|
</div>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<form action="<%= url_for %>" method="get" class="items-center hidden md:flex">
|
<form action="<%= url_for %>" method="get" class="items-center flex">
|
||||||
<% if params[:status].present? %>
|
<% if params[:status].present? %>
|
||||||
<input name="status" value="<%= params[:status] %>" class="hidden">
|
<input name="status" value="<%= params[:status] %>" class="hidden">
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -9,7 +9,9 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<input id="search" name="q" value="<%= params[:q] %>" class="input input-ghost text-lg pr-10 -mr-12 <%= 'pl-8 input-outlined' if params[:q].present? %>" placeholder="<%= local_assigns[:placeholder] %>">
|
<search-input data-title="<%= local_assigns[:title_selector] || 'h1' %>">
|
||||||
|
<input id="search" name="q" value="<%= params[:q] %>" class="input input-ghost text-lg pr-10 -mr-12 w-0 md:w-64 <%= 'pl-8 input-outlined w-64' if params[:q].present? %>" placeholder="<%= local_assigns[:placeholder] %>">
|
||||||
|
</search-input>
|
||||||
<button type="submit" title="Search" class="btn btn-ghost btn-circle" onclick="window.search.value || document.activeElement === window.search ? null : [event.preventDefault(), window.search.focus()]">
|
<button type="submit" title="Search" class="btn btn-ghost btn-circle" onclick="window.search.value || document.activeElement === window.search ? null : [event.preventDefault(), window.search.focus()]">
|
||||||
<span class="enabled">
|
<span class="enabled">
|
||||||
<%= svg_icon('search', class: 'w-6 h-6 stroke-2') %>
|
<%= svg_icon('search', class: 'w-6 h-6 stroke-2') %>
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
<%= svg_icon('brand_discord', class: 'w-8 h-8') %>
|
<%= svg_icon('brand_discord', class: 'w-8 h-8') %>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<%= content_for(:gpt_link) || capture do %>
|
<%= capture do %>
|
||||||
<div class="tooltip" data-tip="AI Assistant">
|
<div class="tooltip" data-tip="AI Assistant">
|
||||||
<a href="<%= Docuseal::CHATGPT_URL %>" target="_blank" class="btn btn-circle btn-primary btn-md">
|
<a href="<%= Docuseal::CHATGPT_URL %>" target="_blank" class="btn btn-circle btn-primary btn-md">
|
||||||
<%= svg_icon('brand_openai', class: 'w-8 h-8') %>
|
<%= svg_icon('brand_openai', class: 'w-8 h-8') %>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
ID: <%= attachment.uuid %>
|
ID: <%= attachment.uuid %>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<%= t('reason') %>: <%= t('digitally_signed_by') %> <%= submitter.name %>
|
<%= t('reason') %>: <%= submitter.values[field.dig('preferences', 'reason_field_uuid')].presence || t('digitally_signed_by') %> <%= submitter.name %>
|
||||||
<% if submitter.email %>
|
<% if submitter.email %>
|
||||||
<<%= submitter.email %>>
|
<<%= submitter.email %>>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<% if params[:controller] == 'submissions_preview' %>
|
<% if params[:controller] == 'submissions_preview' %>
|
||||||
<%= render 'submissions/preview_tags' %>
|
<%= render 'submissions/preview_tags' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% with_signature_id = @submission.account.account_configs.exists?(key: AccountConfig::WITH_SIGNATURE_ID, value: true) %>
|
<% with_signature_id, is_combined_enabled = AccountConfig.where(account_id: @submission.account_id, key: [AccountConfig::COMBINE_PDF_RESULT_KEY, AccountConfig::WITH_SIGNATURE_ID], value: true).then { |configs| [configs.any? { |e| e.key == AccountConfig::WITH_SIGNATURE_ID }, configs.any? { |e| e.key == AccountConfig::COMBINE_PDF_RESULT_KEY }] } %>
|
||||||
<div style="max-width: 1600px" class="mx-auto pl-4">
|
<div style="max-width: 1600px" class="mx-auto pl-4">
|
||||||
<div class="flex justify-between py-1.5 items-center pr-4 sticky top-0 md:relative z-10 bg-base-100">
|
<div class="flex justify-between py-1.5 items-center pr-4 sticky top-0 md:relative z-10 bg-base-100">
|
||||||
<a href="<%= signed_in? && @submission.account_id == current_account&.id ? template_path(@submission.template) : '/' %>" class="flex items-center space-x-3 py-1">
|
<a href="<%= signed_in? && @submission.account_id == current_account&.id ? template_path(@submission.template) : '/' %>" class="flex items-center space-x-3 py-1">
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<% if last_submitter = @submission.submitters.to_a.select(&:completed_at?).max_by(&:completed_at) %>
|
<% if last_submitter = @submission.submitters.to_a.select(&:completed_at?).max_by(&:completed_at) %>
|
||||||
<% is_all_completed = @submission.submitters.to_a.all?(&:completed_at?) %>
|
<% is_all_completed = @submission.submitters.to_a.all?(&:completed_at?) %>
|
||||||
<div class="join relative">
|
<div class="join relative">
|
||||||
<download-button data-src="<%= submitter_download_index_path(last_submitter.slug, { sig: params[:sig] }.compact) %>" class="base-button <%= '!rounded-r-none !pr-2' if is_all_completed %>">
|
<download-button data-src="<%= submitter_download_index_path(last_submitter.slug, { sig: params[:sig], combined: is_combined_enabled }.compact) %>" class="base-button <%= '!rounded-r-none !pr-2' if is_all_completed && !is_combined_enabled %>">
|
||||||
<span class="flex items-center justify-center space-x-2" data-target="download-button.defaultButton">
|
<span class="flex items-center justify-center space-x-2" data-target="download-button.defaultButton">
|
||||||
<%= svg_icon('download', class: 'w-6 h-6') %>
|
<%= svg_icon('download', class: 'w-6 h-6') %>
|
||||||
<span class="hidden md:inline">Download</span>
|
<span class="hidden md:inline">Download</span>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<span class="hidden md:inline">Downloading</span>
|
<span class="hidden md:inline">Downloading</span>
|
||||||
</span>
|
</span>
|
||||||
</download-button>
|
</download-button>
|
||||||
<% if is_all_completed %>
|
<% if is_all_completed && !is_combined_enabled %>
|
||||||
<div class="dropdown dropdown-end">
|
<div class="dropdown dropdown-end">
|
||||||
<label tabindex="0" class="base-button !rounded-l-none !pl-1 !pr-2 !border-l-neutral-500">
|
<label tabindex="0" class="base-button !rounded-l-none !pl-1 !pr-2 !border-l-neutral-500">
|
||||||
<span class="text-sm align-text-top">
|
<span class="text-sm align-text-top">
|
||||||
@@ -54,8 +54,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% elsif @submission.submitters.to_a.size == 1 && !@submission.expired? %>
|
<% elsif @submission.submitters.to_a.size == 1 && !@submission.expired? && !@submission.submitters.to_a.first.declined_at? %>
|
||||||
<%= render 'shared/clipboard_copy', text: start_form_url(slug: @submission.template.slug), class: 'base-button', icon_class: 'w-6 h-6 text-white', copy_title: 'Copy Share Link', copied_title: 'Copied to Clipboard' %>
|
<%= render 'shared/clipboard_copy', text: submit_form_url(slug: @submission.submitters.to_a.first.slug), class: 'base-button', icon_class: 'w-6 h-6 text-white', copy_title: 'Copy Share Link', copied_title: 'Copied to Clipboard' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -143,18 +143,30 @@
|
|||||||
<div class="flex items-center space-x-1 mt-1">
|
<div class="flex items-center space-x-1 mt-1">
|
||||||
<%= svg_icon('writing', class: 'w-5 h-5') %>
|
<%= svg_icon('writing', class: 'w-5 h-5') %>
|
||||||
<span>
|
<span>
|
||||||
<%= submitter&.completed_at? ? l(submitter.completed_at.in_time_zone(@submission.account.timezone), format: :long, locale: @submission.account.locale) : 'Not completed yet' %>
|
<% if submitter&.declined_at? %>
|
||||||
|
Declined on <%= l(submitter.declined_at.in_time_zone(@submission.account.timezone), format: :short, locale: @submission.account.locale) %>
|
||||||
|
<% else %>
|
||||||
|
<%= submitter&.completed_at? ? l(submitter.completed_at.in_time_zone(@submission.account.timezone), format: :long, locale: @submission.account.locale) : 'Not completed yet' %>
|
||||||
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<% if signed_in? && submitter && submitter.email && !submitter.completed_at && !@submission.archived_at? && can?(:update, submitter) && Accounts.can_send_emails?(current_account) && !@submission.expired? %>
|
<% if submitter&.declined_at? %>
|
||||||
|
<div class="flex items-center space-x-1 mt-1">
|
||||||
|
<span>
|
||||||
|
Reason:
|
||||||
|
<%= simple_format(submitter.submission_events.find_by(event_type: :decline_form).data['reason']) %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% if signed_in? && submitter && submitter.email && !submitter.completed_at && !@submission.archived_at? && can?(:update, submitter) && Accounts.can_send_emails?(current_account) && !@submission.expired? && !submitter.declined_at? %>
|
||||||
<div class="mt-2 mb-1">
|
<div class="mt-2 mb-1">
|
||||||
<%= button_to button_title(title: submitter.sent_at? ? 'Re-send Email' : 'Send Email', disabled_with: 'Sending'), submitter_send_email_index_path(submitter_slug: submitter.slug), class: 'btn btn-sm btn-primary w-full' %>
|
<%= button_to button_title(title: submitter.sent_at? ? 'Re-send Email' : 'Send Email', disabled_with: 'Sending'), submitter_send_email_index_path(submitter_slug: submitter.slug), class: 'btn btn-sm btn-primary w-full' %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if signed_in? && submitter && submitter.phone && !submitter.completed_at && !@submission.archived_at? && can?(:update, submitter) && !@submission.expired? %>
|
<% if signed_in? && submitter && submitter.phone && !submitter.completed_at && !@submission.archived_at? && can?(:update, submitter) && !@submission.expired? && !submitter.declined_at? %>
|
||||||
<%= render 'submissions/send_sms_button', submitter: %>
|
<%= render 'submissions/send_sms_button', submitter: %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if signed_in? && submitter && !submitter.completed_at? && !@submission.archived_at? && can?(:create, submitter) && !@submission.expired? %>
|
<% if signed_in? && submitter && !submitter.completed_at? && !@submission.archived_at? && can?(:create, submitter) && !@submission.expired? && !submitter.declined_at? %>
|
||||||
<div class="mt-2 mb-1">
|
<div class="mt-2 mb-1">
|
||||||
<a class="btn btn-sm btn-primary w-full" target="_blank" href="<%= submit_form_path(slug: submitter.slug) %>">
|
<a class="btn btn-sm btn-primary w-full" target="_blank" href="<%= submit_form_path(slug: submitter.slug) %>">
|
||||||
Sign In-person
|
Sign In-person
|
||||||
|
|||||||
@@ -5,7 +5,9 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between mb-4 items-center">
|
<div class="flex justify-between mb-4 items-center">
|
||||||
<h1 class="text-4xl font-bold">Submissions <span class="badge badge-outline badge-lg align-middle">Archived</span></h1>
|
<div>
|
||||||
|
<h1 class="text-4xl font-bold md:block <%= 'hidden' if params[:q].present? %>">Submissions <span class="badge badge-outline badge-lg align-middle">Archived</span></h1>
|
||||||
|
</div>
|
||||||
<% if params[:q].present? || @pagy.pages > 1 %>
|
<% if params[:q].present? || @pagy.pages > 1 %>
|
||||||
<%= render 'shared/search_input', placeholder: 'Search...' %>
|
<%= render 'shared/search_input', placeholder: 'Search...' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="mr-2">
|
<div class="mr-2">
|
||||||
<%= render 'dashboard/toggle_view', selected: 'submissions' %>
|
<%= render 'dashboard/toggle_view', selected: 'submissions' %>
|
||||||
</div>
|
</div>
|
||||||
<h1 class="text-3xl sm:text-4xl font-bold">Submissions</h1>
|
<h1 class="text-2xl md:text-3xl sm:text-4xl font-bold md:block <%= 'hidden' if params[:q].present? %>">Submissions</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<% if params[:q].present? || @pagy.pages > 1 %>
|
<% if params[:q].present? || @pagy.pages > 1 %>
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<%= form_for '', url: submit_form_decline_index_path(submitter.slug), method: :post do |f| %>
|
||||||
|
<div class="mt-4 text-center">
|
||||||
|
<%= t(:notify_the_sender_with_the_reason_you_declined) %>
|
||||||
|
</div>
|
||||||
|
<div class="form-control mt-2">
|
||||||
|
<%= f.text_area :reason, required: true, class: 'base-input w-full py-2 h-40', dir: 'auto', placeholder: t('provide_a_reason'), style: 'height: 200px', rows: '10' %>
|
||||||
|
</div>
|
||||||
|
<toggle-submit dir="auto" class="form-control mt-4">
|
||||||
|
<%= f.button button_title(title: t(:decline)), class: 'base-button' %>
|
||||||
|
</toggle-submit>
|
||||||
|
<% end %>
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
<% data_attachments = attachments_index.values.select { |e| e.record_id == submitter.id }.to_json(only: %i[uuid created_at], methods: %i[url filename content_type]) %>
|
<% data_attachments = attachments_index.values.select { |e| e.record_id == submitter.id }.to_json(only: %i[uuid created_at], methods: %i[url filename content_type]) %>
|
||||||
<% data_fields = (submitter.submission.template_fields || submitter.submission.template.fields).select { |f| f['submitter_uuid'] == submitter.uuid }.to_json %>
|
<% data_fields = (submitter.submission.template_fields || submitter.submission.template.fields).select { |f| f['submitter_uuid'] == submitter.uuid }.to_json %>
|
||||||
<submission-form data-is-demo="<%= Docuseal.demo? %>" data-with-signature-id="<%= configs[:with_signature_id] %>" data-with-confetti="<%= configs[:with_confetti] %>" data-completed-redirect-url="<%= submitter.preferences['completed_redirect_url'] %>" data-completed-message="<%= configs[:completed_message].to_json %>" data-completed-button="<%= configs[:completed_button].to_json %>" data-go-to-last="<%= submitter.preferences.key?('go_to_last') ? submitter.preferences['go_to_last'] : submitter.opened_at? %>" data-submitter="<%= submitter.to_json(only: %i[uuid slug name phone email]) %>" data-can-send-email="<%= Accounts.can_send_emails?(submitter.submission.account) %>" data-attachments="<%= data_attachments %>" data-fields="<%= data_fields %>" data-values="<%= submitter.values.to_json %>" data-with-typed-signature="<%= configs[:with_typed_signature] %>" data-previous-signature-value="<%= local_assigns[:signature_attachment]&.uuid %>" data-remember-signature="<%= configs[:prefill_signature] %>" data-dry-run="<%= local_assigns[:dry_run] %>" data-expand="<%= local_assigns[:expand] %>" data-scroll-padding="<%= local_assigns[:scroll_padding] %>"></submission-form>
|
<submission-form data-is-demo="<%= Docuseal.demo? %>" data-require-signing-reason="<%= configs[:require_signing_reason] %>" data-with-signature-id="<%= configs[:with_signature_id] %>" data-with-confetti="<%= configs[:with_confetti] %>" data-completed-redirect-url="<%= submitter.preferences['completed_redirect_url'] %>" data-completed-message="<%= configs[:completed_message].to_json %>" data-completed-button="<%= configs[:completed_button].to_json %>" data-go-to-last="<%= submitter.preferences.key?('go_to_last') ? submitter.preferences['go_to_last'] : submitter.opened_at? %>" data-submitter="<%= submitter.to_json(only: %i[uuid slug name phone email]) %>" data-can-send-email="<%= Accounts.can_send_emails?(submitter.submission.account) %>" data-attachments="<%= data_attachments %>" data-fields="<%= data_fields %>" data-values="<%= submitter.values.to_json %>" data-with-typed-signature="<%= configs[:with_typed_signature] %>" data-previous-signature-value="<%= local_assigns[:signature_attachment]&.uuid %>" data-remember-signature="<%= configs[:prefill_signature] %>" data-dry-run="<%= local_assigns[:dry_run] %>" data-expand="<%= local_assigns[:expand] %>" data-scroll-padding="<%= local_assigns[:scroll_padding] %>"></submission-form>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<div class="max-w-md mx-auto px-2 mt-12 mb-4">
|
||||||
|
<div class="space-y-6 mx-auto">
|
||||||
|
<div class="space-y-6">
|
||||||
|
<div class="flex items-center justify-center">
|
||||||
|
<%= render 'start_form/banner' %>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center bg-base-200 rounded-xl p-4 mb-4">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="mr-3">
|
||||||
|
<%= svg_icon('writing_sign', class: 'w-10 h-10') %>
|
||||||
|
</div>
|
||||||
|
<div dir="auto">
|
||||||
|
<p class="text-lg font-bold mb-1"><%= @submitter.submission.template.name %></p>
|
||||||
|
<p class="text-sm"><%= t('form_has_been_declined_on_html', time: l(@submitter.declined_at, format: :long)) %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%= render 'shared/attribution', link_path: '/start', account: @submitter.account %>
|
||||||
@@ -2,12 +2,36 @@
|
|||||||
<% content_for(:html_description, "#{@submitter.account.name} has invited you to fill and sign documents online effortlessly with a secure, fast, and user-friendly digital document signing solution.") %>
|
<% content_for(:html_description, "#{@submitter.account.name} has invited you to fill and sign documents online effortlessly with a secure, fast, and user-friendly digital document signing solution.") %>
|
||||||
<% fields_index = Templates.build_field_areas_index(@submitter.submission.template_fields || @submitter.submission.template.fields) %>
|
<% fields_index = Templates.build_field_areas_index(@submitter.submission.template_fields || @submitter.submission.template.fields) %>
|
||||||
<% values = @submitter.submission.submitters.reduce({}) { |acc, sub| acc.merge(sub.values) } %>
|
<% values = @submitter.submission.submitters.reduce({}) { |acc, sub| acc.merge(sub.values) } %>
|
||||||
|
<% submitters_index = @submitter.submission.submitters.index_by(&:uuid) %>
|
||||||
<% page_blob_struct = Struct.new(:url, :metadata, keyword_init: true) %>
|
<% page_blob_struct = Struct.new(:url, :metadata, keyword_init: true) %>
|
||||||
<div style="max-height: -webkit-fill-available;">
|
<div style="max-height: -webkit-fill-available;">
|
||||||
<div id="scrollbox">
|
<div id="scrollbox">
|
||||||
<div class="mx-auto block pb-72" style="max-width: 1000px">
|
<div class="mx-auto block pb-72" style="max-width: 1000px">
|
||||||
<%# flex block w-full sticky top-0 z-50 space-x-2 items-center bg-yellow-100 p-2 border-y border-yellow-200 %>
|
<%# flex block w-full sticky top-0 z-50 space-x-2 items-center bg-yellow-100 p-2 border-y border-yellow-200 %>
|
||||||
<%= local_assigns[:banner_html] || render('submit_form/banner') %>
|
<%= local_assigns[:banner_html] || capture do %>
|
||||||
|
<%= render('submit_form/banner') %>
|
||||||
|
<div class="sticky top-0 z-50 bg-base-100 py-2 px-2 flex items-center md:-mx-[8px]" style="margin-bottom: -16px">
|
||||||
|
<div class="text-xl md:text-2xl font-medium focus:text-clip" style="width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
||||||
|
<%= @submitter.submission.template.name %>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center space-x-2" style="margin-left: 20px; flex-shrink: 0">
|
||||||
|
<div>
|
||||||
|
<%= render 'shared/html_modal', title: t(:decline), btn_text: t(:decline), btn_class: 'btn btn-sm !px-5', button_id: 'decline_button' do %>
|
||||||
|
<%= render 'submit_form/decline_form', submitter: @submitter %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<download-button data-src="<%= submit_form_download_index_path(@submitter.slug) %>" class="btn btn-neutral text-white btn-sm !px-4">
|
||||||
|
<span class="flex items-center justify-center space-x-2" data-target="download-button.defaultButton">
|
||||||
|
<span><%= t('download') %></span>
|
||||||
|
</span>
|
||||||
|
<span class="flex items-center justify-center space-x-2 hidden" data-target="download-button.loadingButton">
|
||||||
|
<%= svg_icon('loader', class: 'w-6 h-6 animate-spin') %>
|
||||||
|
<span><%= t('downloading') %></span>
|
||||||
|
</span>
|
||||||
|
</download-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<% (@submitter.submission.template_schema || @submitter.submission.template.schema).each do |item| %>
|
<% (@submitter.submission.template_schema || @submitter.submission.template.schema).each do |item| %>
|
||||||
<% document = @submitter.submission.template_schema_documents.find { |a| a.uuid == item['attachment_uuid'] } %>
|
<% document = @submitter.submission.template_schema_documents.find { |a| a.uuid == item['attachment_uuid'] } %>
|
||||||
<% document_annots_index = document.metadata.dig('pdf', 'annotations')&.group_by { |e| e['page'] } || {} %>
|
<% document_annots_index = document.metadata.dig('pdf', 'annotations')&.group_by { |e| e['page'] } || {} %>
|
||||||
@@ -28,7 +52,7 @@
|
|||||||
<% next if field['redacted'] && field['submitter_uuid'] != @submitter.uuid %>
|
<% next if field['redacted'] && field['submitter_uuid'] != @submitter.uuid %>
|
||||||
<% next if value == '{{date}}' && field['submitter_uuid'] != @submitter.uuid %>
|
<% next if value == '{{date}}' && field['submitter_uuid'] != @submitter.uuid %>
|
||||||
<% next if field.dig('preferences', 'formula').present? && field['submitter_uuid'] == @submitter.uuid %>
|
<% next if field.dig('preferences', 'formula').present? && field['submitter_uuid'] == @submitter.uuid %>
|
||||||
<%= render 'submissions/value', area:, field:, attachments_index: @attachments_index, value:, locale: @submitter.account.locale, timezone: @submitter.account.timezone, submitter: @submitter, with_signature_id: @form_configs[:with_signature_id] %>
|
<%= render 'submissions/value', area:, field:, attachments_index: @attachments_index, value:, locale: @submitter.account.locale, timezone: @submitter.account.timezone, submitter: submitters_index[field['submitter_uuid']], with_signature_id: @form_configs[:with_signature_id] %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<p><%= t('hi_there') %>,</p>
|
||||||
|
<p><%= t('name_declined_by_submitter_with_the_following_reason', name: @submitter.submission.template.name, submitter: @submitter.name || @submitter.email || @submitter.phone) %></p>
|
||||||
|
<%= simple_format(@submitter.submission_events.find_by(event_type: :decline_form).data['reason']) %>
|
||||||
|
<p><%= link_to t('view'), submission_url(@submitter.submission) %></p>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<% if @email_config || @body.present? %>
|
<% if @email_config || @body.present? %>
|
||||||
<% body = (@body.presence || @email_config.value['body']).to_s %>
|
<% body = (@body.presence || @email_config.value['body']).to_s %>
|
||||||
<%= render 'custom_content', content: body, submitter: @submitter %>
|
<%= render 'custom_content', content: body, submitter: @submitter %>
|
||||||
<% if !body.include?(ReplaceEmailVariables::SUBMITTER_LINK) && !body.include?(ReplaceEmailVariables::SUBMITTER_ID) && !body.include?(ReplaceEmailVariables::SUBMISSION_LINK) && !body.include?(ReplaceEmailVariables::TEMPLATE_ID) && !@submitter.submission.source.in?(%w[api embed]) %>
|
<% if !body.match?(ReplaceEmailVariables::SUBMITTER_LINK) && !body.match?(ReplaceEmailVariables::SUBMITTER_ID) && !body.match?(ReplaceEmailVariables::SUBMISSION_LINK) && !body.match?(ReplaceEmailVariables::TEMPLATE_ID) && !@submitter.submission.source.in?(%w[api embed]) %>
|
||||||
<p><%= link_to nil, submit_form_url(slug: @submitter.slug, t: SubmissionEvents.build_tracking_param(@submitter, 'click_email')) %></p>
|
<p><%= link_to nil, submit_form_url(slug: @submitter.slug, t: SubmissionEvents.build_tracking_param(@submitter, 'click_email')) %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between mb-4 items-center">
|
<div class="flex justify-between mb-4 items-center">
|
||||||
<h1 class="text-4xl font-bold flex items-center space-x-2">
|
<h1 class="text-4xl font-bold flex items-center space-x-2 md:flex <%= 'hidden' if params[:q].present? %>">
|
||||||
<%= svg_icon('folder', class: 'w-9 h-9 flex-shrink-0') %>
|
<%= svg_icon('folder', class: 'w-9 h-9 flex-shrink-0') %>
|
||||||
<span class="peer">
|
<span class="peer">
|
||||||
<%= @template_folder.name %>
|
<%= @template_folder.name %>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<% status_badges = { 'awaiting' => 'badge-info', 'sent' => 'badge-info', 'completed' => 'badge-success', 'opened' => 'badge-warning' } %>
|
<% status_badges = { 'awaiting' => 'badge-info', 'sent' => 'badge-info', 'completed' => 'badge-success', 'opened' => 'badge-warning', 'declined' => 'badge-error' } %>
|
||||||
<div class="bg-base-200 rounded-2xl flex flex-col sm:flex-row items-strech">
|
<div class="bg-base-200 rounded-2xl flex flex-col sm:flex-row items-strech">
|
||||||
<% if local_assigns[:with_template] %>
|
<% if local_assigns[:with_template] %>
|
||||||
<% template = submission.template %>
|
<% template = submission.template %>
|
||||||
@@ -7,12 +7,12 @@
|
|||||||
<div class="font-medium items-start w-full group-hover:link text-sm flex space-x-1">
|
<div class="font-medium items-start w-full group-hover:link text-sm flex space-x-1">
|
||||||
<%= svg_icon('file_text', class: 'w-4 h-4 mt-0.5 flex-shrink-0') %>
|
<%= svg_icon('file_text', class: 'w-4 h-4 mt-0.5 flex-shrink-0') %>
|
||||||
<span style="overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;">
|
<span style="overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;">
|
||||||
<%= template.name %>
|
<% template.name.split(/(_)/).each do |item| %><%= item %><wbr><% end %>
|
||||||
<%= svg_icon('arrow_right', class: 'w-4 h-4 sm:inline group-hover:visible invisible hidden') %>
|
<%= svg_icon('arrow_right', class: 'w-4 h-4 sm:inline group-hover:visible invisible hidden') %>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-shrink-0 sm:mt-2">
|
<div class="flex-shrink-0 sm:mt-2 max-w-[50%] md:max-w-full">
|
||||||
<div class="flex text-xs flex-col text-base-content/60 space-y-0.5">
|
<div class="flex text-xs flex-col text-base-content/60 space-y-0.5">
|
||||||
<span class="flex items-center space-x-1">
|
<span class="flex items-center space-x-1">
|
||||||
<%= svg_icon('user', class: 'w-4 h-4 flex-shrink-0') %>
|
<%= svg_icon('user', class: 'w-4 h-4 flex-shrink-0') %>
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
</download-button>
|
</download-button>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<% elsif !submission.archived_at? && !template.archived_at? && !submission.expired? %>
|
<% elsif !submission.archived_at? && !template.archived_at? && !submission.expired? && !submitter.declined_at? %>
|
||||||
<% if current_user.email == submitter.email %>
|
<% if current_user.email == submitter.email %>
|
||||||
<form data-turbo="false" method="get" action="<%= submit_form_url(slug: submitter.slug) %>" class="flex-1 md:flex-none">
|
<form data-turbo="false" method="get" action="<%= submit_form_url(slug: submitter.slug) %>" class="flex-1 md:flex-none">
|
||||||
<button onclick="event.stopPropagation()" class="btn btn-sm btn-neutral btn-outline bg-white w-full md:w-36 flex">
|
<button onclick="event.stopPropagation()" class="btn btn-sm btn-neutral btn-outline bg-white w-full md:w-36 flex">
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
</download-button>
|
</download-button>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<% elsif !template.archived_at? && !submission.archived_at? && !is_submission_completed && !submission.expired? %>
|
<% elsif !template.archived_at? && !submission.archived_at? && !is_submission_completed && !submission.expired? && !submitter.declined_at? %>
|
||||||
<div class="relative flex items-center space-x-3">
|
<div class="relative flex items-center space-x-3">
|
||||||
<% if current_user.email == submitter.email %>
|
<% if current_user.email == submitter.email %>
|
||||||
<form data-turbo="false" method="get" action="<%= submit_form_url(slug: submitter.slug) %>">
|
<form data-turbo="false" method="get" action="<%= submit_form_url(slug: submitter.slug) %>">
|
||||||
@@ -195,6 +195,11 @@
|
|||||||
<%= button_to button_title(title: nil, disabled_with: 'Arch', icon: svg_icon('archive', class: 'w-6 h-6')), submission_path(submission), class: 'btn btn-outline btn-sm w-full md:w-fit', form: { class: 'flex' }, title: 'Archive', method: :delete, onclick: 'event.stopPropagation()' %>
|
<%= button_to button_title(title: nil, disabled_with: 'Arch', icon: svg_icon('archive', class: 'w-6 h-6')), submission_path(submission), class: 'btn btn-outline btn-sm w-full md:w-fit', form: { class: 'flex' }, title: 'Archive', method: :delete, onclick: 'event.stopPropagation()' %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if local_assigns[:archived] && can?(:destroy, submission) %>
|
||||||
|
<span data-tip="Remove" class="sm:tooltip tooltip-top">
|
||||||
|
<%= button_to button_title(title: nil, disabled_with: 'Rem', icon: svg_icon('trash', class: 'w-6 h-6')), submission_path(submission, permanently: true), class: 'btn btn-outline btn-sm w-full md:w-fit', form: { class: 'flex' }, title: 'Remove', method: :delete, data: { turbo_confirm: 'Submission deletion is irreversible and will permanently remove all associated signed documents with it. Are you sure?' }, onclick: 'event.stopPropagation()' %>
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="h-36 relative group">
|
<div class="h-36 relative group">
|
||||||
<a href="<%= template_path(template) %>" class="flex h-full flex-col justify-between rounded-2xl pt-6 px-7 w-full bg-base-200 peer">
|
<a href="<%= template_path(template) %>" class="flex h-full flex-col justify-between rounded-2xl pt-6 px-7 w-full bg-base-200 peer">
|
||||||
<div class="pb-4 text-xl font-semibold" style="overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;">
|
<div class="pb-4 text-xl font-semibold" style="overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;">
|
||||||
<%= template.name %>
|
<% template.name.split(/(_)/).each do |item| %><%= item %><wbr><% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="pb-6 pt-1 space-y-1">
|
<div class="pb-6 pt-1 space-y-1">
|
||||||
<p class="flex items-center space-x-1 text-xs text-base-content/60">
|
<p class="flex items-center space-x-1 text-xs text-base-content/60">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="flex flex-col items-start md:flex-row space-y-2 md:space-y-0 md:space-x-2 md:justify-between md:items-start mb-6 md:mb-3">
|
<div class="flex flex-col items-start md:flex-row space-y-2 md:space-y-0 md:space-x-2 md:justify-between md:items-start mb-6 md:mb-3">
|
||||||
<div class="relative flex items-start justify-between w-full space-x-0">
|
<div class="relative flex items-start justify-between w-full space-x-0">
|
||||||
<div>
|
<div>
|
||||||
<h1 class="text-4xl font-semibold" style="overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;">
|
<h1 class="text-3xl md:text-4xl font-semibold" style="overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;">
|
||||||
<% template.name.split(/(_)/).each do |item| %><%= item %><wbr><% end %>
|
<% template.name.split(/(_)/).each do |item| %><%= item %><wbr><% end %>
|
||||||
<% if template.archived_at? %>
|
<% if template.archived_at? %>
|
||||||
<span class="ml-1 badge badge-outline badge-lg align-middle">Archived</span>
|
<span class="ml-1 badge badge-outline badge-lg align-middle">Archived</span>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<template-builder class="grid" data-template="<%= @template_data %>"></template-builder>
|
<template-builder class="grid" data-template="<%= @template_data %>" data-locale="<%= current_account.locale %>"></template-builder>
|
||||||
@@ -3,10 +3,12 @@
|
|||||||
<% if !@pagy.count.zero? || params[:q].present? || params[:status].present? %>
|
<% if !@pagy.count.zero? || params[:q].present? || params[:status].present? %>
|
||||||
<div class="<%= is_show_tabs ? 'mb-4' : 'mb-6' %>">
|
<div class="<%= is_show_tabs ? 'mb-4' : 'mb-6' %>">
|
||||||
<div class="flex justify-between items-center md:items-end">
|
<div class="flex justify-between items-center md:items-end">
|
||||||
<p class="text-3xl font-bold">Submissions</p>
|
<div>
|
||||||
|
<h2 class="text-3xl font-bold md:block <%= 'hidden' if params[:q].present? %>">Submissions</h2>
|
||||||
|
</div>
|
||||||
<div class="flex justify-end space-x-2">
|
<div class="flex justify-end space-x-2">
|
||||||
<% if params[:q].present? || params[:status].present? || @pagy.pages > 1 %>
|
<% if params[:q].present? || params[:status].present? || @pagy.pages > 1 %>
|
||||||
<%= render 'shared/search_input' %>
|
<%= render 'shared/search_input', title_selector: 'h2' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= link_to new_template_submissions_export_path(@template), class: 'hidden md:flex btn btn-ghost text-base', data: { turbo_frame: 'modal' } do %>
|
<%= link_to new_template_submissions_export_path(@template), class: 'hidden md:flex btn btn-ghost text-base', data: { turbo_frame: 'modal' } do %>
|
||||||
<%= svg_icon('download', class: 'w-6 h-6 stroke-2') %>
|
<%= svg_icon('download', class: 'w-6 h-6 stroke-2') %>
|
||||||
|
|||||||
@@ -5,7 +5,9 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between mb-4 items-center">
|
<div class="flex justify-between mb-4 items-center">
|
||||||
<h1 class="text-4xl font-bold"><span class="hidden md:inline">Document</span> Templates <span class="badge badge-outline badge-lg align-middle">Archived</span></h1>
|
<div>
|
||||||
|
<h1 class="text-4xl font-bold md:block <%= 'hidden' if params[:q].present? %>"><span class="hidden md:inline">Document</span> Templates <span class="badge badge-outline badge-lg align-middle">Archived</span></h1>
|
||||||
|
</div>
|
||||||
<% if params[:q].present? || @pagy.pages > 1 %>
|
<% if params[:q].present? || @pagy.pages > 1 %>
|
||||||
<%= render 'shared/search_input', placeholder: 'Search...' %>
|
<%= render 'shared/search_input', placeholder: 'Search...' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between mb-6 md:items-end flex-col md:flex-row">
|
<div class="flex justify-between mb-6 md:items-end flex-col md:flex-row">
|
||||||
<p class="text-3xl font-bold">Submissions <span class="badge badge-outline badge-lg align-middle">Archived</span></p>
|
<div>
|
||||||
<div class="flex space-x-2 mt-3 md:mt-0">
|
<h1 class="text-3xl font-bold md:block">Submissions <span class="badge badge-outline badge-lg align-middle">Archived</span></h1>
|
||||||
<% if params[:q].present? || @pagy.pages > 1 %>
|
</div>
|
||||||
<%= render 'shared/search_input' %>
|
<div class="flex space-x-2 mt-3 md:mt-0 justify-end">
|
||||||
<% end %>
|
<%= render 'shared/search_input' %>
|
||||||
<%= link_to new_template_submissions_export_path(@template), class: 'order-3 md:order-1 btn btn-ghost text-base', data: { turbo_frame: 'modal' } do %>
|
<%= link_to new_template_submissions_export_path(@template), class: 'order-3 md:order-1 btn btn-ghost text-base', data: { turbo_frame: 'modal' } do %>
|
||||||
<%= svg_icon('download', class: 'w-6 h-6 stroke-2') %>
|
<%= svg_icon('download', class: 'w-6 h-6 stroke-2') %>
|
||||||
<span>Export</span>
|
<span>Export</span>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<%= render 'dashboard/toggle_view', selected: 'templates' %>
|
<%= render 'dashboard/toggle_view', selected: 'templates' %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<h1 class="text-3xl sm:text-4xl font-bold"><span class="hidden md:inline">Document</span> Templates</h1>
|
<h1 class="text-2xl md:text-3xl sm:text-4xl font-bold md:block <%= 'hidden' if params[:q].present? %>"><span class="hidden md:inline">Document</span> Templates</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<% if params[:q].present? || @pagy.pages > 1 || @template_folders.present? %>
|
<% if params[:q].present? || @pagy.pages > 1 || @template_folders.present? %>
|
||||||
|
|||||||
+32
-16
@@ -1,25 +1,41 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
if ENV['RAILS_ENV'] == 'production' && ENV['SECRET_KEY_BASE'].to_s.empty?
|
if ENV['RAILS_ENV'] == 'production'
|
||||||
require 'dotenv'
|
if !ENV['AWS_SECRET_MANAGER_ID'].to_s.empty?
|
||||||
require 'securerandom'
|
require 'aws-sdk-secretsmanager'
|
||||||
|
|
||||||
dotenv_path = "#{ENV.fetch('WORKDIR', '.')}/docuseal.env"
|
client = Aws::SecretsManager::Client.new
|
||||||
|
|
||||||
unless File.exist?(dotenv_path)
|
secret_id = ENV.fetch('AWS_SECRET_MANAGER_ID', '')
|
||||||
default_env = <<~TEXT
|
|
||||||
DATABASE_URL= # keep empty to use sqlite or specify postgresql database URL
|
|
||||||
SECRET_KEY_BASE=#{SecureRandom.hex(64)}
|
|
||||||
TEXT
|
|
||||||
|
|
||||||
File.write(dotenv_path, default_env)
|
client.get_secret_value(secret_id:).secret_string.split("\n").each do |line|
|
||||||
|
key, value = line.split('=', 2)
|
||||||
|
|
||||||
|
ENV[key] = value if !key.to_s.empty? && !value.to_s.empty?
|
||||||
|
end
|
||||||
|
|
||||||
|
RubyVM::YJIT.enable if ENV['RUBY_YJIT_ENABLE'] == 'true'
|
||||||
|
elsif ENV['SECRET_KEY_BASE'].to_s.empty?
|
||||||
|
require 'dotenv'
|
||||||
|
require 'securerandom'
|
||||||
|
|
||||||
|
dotenv_path = "#{ENV.fetch('WORKDIR', '.')}/docuseal.env"
|
||||||
|
|
||||||
|
unless File.exist?(dotenv_path)
|
||||||
|
default_env = <<~TEXT
|
||||||
|
DATABASE_URL= # keep empty to use sqlite or specify postgresql database URL
|
||||||
|
SECRET_KEY_BASE=#{SecureRandom.hex(64)}
|
||||||
|
TEXT
|
||||||
|
|
||||||
|
File.write(dotenv_path, default_env)
|
||||||
|
end
|
||||||
|
|
||||||
|
database_url = ENV.fetch('DATABASE_URL', nil)
|
||||||
|
|
||||||
|
Dotenv.load(dotenv_path)
|
||||||
|
|
||||||
|
ENV['DATABASE_URL'] = ENV['DATABASE_URL'].to_s.empty? ? database_url : ENV.fetch('DATABASE_URL', nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
database_url = ENV.fetch('DATABASE_URL', nil)
|
|
||||||
|
|
||||||
Dotenv.load(dotenv_path)
|
|
||||||
|
|
||||||
ENV['DATABASE_URL'] = ENV['DATABASE_URL'].to_s.empty? ? database_url : ENV.fetch('DATABASE_URL', nil)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if ENV['DATABASE_URL'].to_s.split('@').last.to_s.split('/').first.to_s.include?('_')
|
if ENV['DATABASE_URL'].to_s.split('@').last.to_s.split('/').first.to_s.include?('_')
|
||||||
|
|||||||
@@ -126,39 +126,32 @@ Rails.application.configure do
|
|||||||
config.lograge.enabled = true
|
config.lograge.enabled = true
|
||||||
config.lograge.base_controller_class = ['ActionController::API', 'ActionController::Base']
|
config.lograge.base_controller_class = ['ActionController::API', 'ActionController::Base']
|
||||||
|
|
||||||
if ENV['MULTITENANT'] == 'true'
|
config.lograge.formatter = ->(data) { data.except(:path, :location).to_json }
|
||||||
config.lograge.formatter = ->(data) { data.except(:path, :location).to_json }
|
|
||||||
|
|
||||||
config.lograge.custom_payload do |controller|
|
config.lograge.custom_payload do |controller|
|
||||||
params =
|
params =
|
||||||
begin
|
begin
|
||||||
controller.request.try(:params) || {}
|
controller.request.try(:params) || {}
|
||||||
rescue StandardError
|
rescue StandardError
|
||||||
{}
|
{}
|
||||||
end
|
end
|
||||||
|
|
||||||
{
|
{
|
||||||
fwd: controller.request.remote_ip,
|
fwd: controller.request.remote_ip,
|
||||||
params: {
|
params: {
|
||||||
id: params[:id],
|
id: params[:id],
|
||||||
sig: (params[:signed_uuid] || params[:signed_id]).to_s.split('--').first,
|
template_id: params[:template_id],
|
||||||
slug: (params[:slug] ||
|
submission_id: params[:submission_id],
|
||||||
params[:submitter_slug] ||
|
submitter_id: params[:submitter_id],
|
||||||
params[:submission_slug] ||
|
sig: (params[:signed_uuid] || params[:signed_id]).to_s.split('--').first,
|
||||||
params[:submit_form_slug] ||
|
slug: (params[:slug] ||
|
||||||
params[:template_slug]).to_s.last(5)
|
params[:submitter_slug] ||
|
||||||
}.compact_blank,
|
params[:submission_slug] ||
|
||||||
host: controller.request.host,
|
params[:submit_form_slug] ||
|
||||||
uid: controller.instance_variable_get(:@current_user).try(:id)
|
params[:template_slug]).to_s.first(5)
|
||||||
}
|
}.compact_blank,
|
||||||
end
|
host: controller.request.host,
|
||||||
else
|
uid: controller.instance_variable_get(:@current_user).try(:id)
|
||||||
config.lograge.formatter = Lograge::Formatters::Json.new
|
}
|
||||||
|
|
||||||
config.lograge.custom_payload do |controller|
|
|
||||||
{
|
|
||||||
fwd: controller.request.remote_ip
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -11,6 +11,20 @@ module HexaPDF
|
|||||||
string_algorithm.encrypt(key, str).dup
|
string_algorithm.encrypt(key, str).dup
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module AES
|
||||||
|
module ClassMethods
|
||||||
|
def unpad(data)
|
||||||
|
padding_length = data.getbyte(-1)
|
||||||
|
if !padding_length || padding_length > BLOCK_SIZE || padding_length.zero? ||
|
||||||
|
data[-padding_length, padding_length].each_byte.any? { |byte| byte != padding_length }
|
||||||
|
data
|
||||||
|
else
|
||||||
|
data[0...-padding_length]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module Type
|
module Type
|
||||||
|
|||||||
+146
-5
@@ -18,6 +18,8 @@ en: &en
|
|||||||
language_nl: Nederlands
|
language_nl: Nederlands
|
||||||
language_ar: العربية
|
language_ar: العربية
|
||||||
language_ko: 한국어
|
language_ko: 한국어
|
||||||
|
view: View
|
||||||
|
hi_there: Hi there
|
||||||
email: Email
|
email: Email
|
||||||
form_expired_at_html: 'Form expired on <span class="font-semibold">%{time}</span>'
|
form_expired_at_html: 'Form expired on <span class="font-semibold">%{time}</span>'
|
||||||
verification_code_code: 'Verification code: %{code}'
|
verification_code_code: 'Verification code: %{code}'
|
||||||
@@ -39,6 +41,15 @@ en: &en
|
|||||||
or: or
|
or: or
|
||||||
download_documents: Download documents
|
download_documents: Download documents
|
||||||
downloading: Downloading
|
downloading: Downloading
|
||||||
|
download: Download
|
||||||
|
decline: Decline
|
||||||
|
declined: Declined
|
||||||
|
decline_reason: Decline reason
|
||||||
|
provide_a_reason: Provide a reason
|
||||||
|
notify_the_sender_with_the_reason_you_declined: Notify the sender with the reason you declined
|
||||||
|
form_has_been_declined_on_html: 'Form has been declined on <span class="font-semibold">%{time}</span>'
|
||||||
|
name_declined_by_submitter: '"%{name}" declined by %{submitter}'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" has been declined by %{submitter} with the following reason:'
|
||||||
completed_successfully: Completed Successfully
|
completed_successfully: Completed Successfully
|
||||||
password: Password
|
password: Password
|
||||||
sign_in: Sign In
|
sign_in: Sign In
|
||||||
@@ -65,6 +76,17 @@ en: &en
|
|||||||
read: Read your data
|
read: Read your data
|
||||||
|
|
||||||
es: &es
|
es: &es
|
||||||
|
view: Vista
|
||||||
|
hi_there: Hola
|
||||||
|
download: Descargar
|
||||||
|
decline: Rechazar
|
||||||
|
declined: Rechazado
|
||||||
|
decline_reason: Motivo de rechazo
|
||||||
|
provide_a_reason: Proporcione un motivo
|
||||||
|
notify_the_sender_with_the_reason_you_declined: Notifique al remitente con el motivo por el que rechazó
|
||||||
|
form_has_been_declined_on_html: 'El formulario ha sido rechazado el <span class="font-semibold">%{time}</span>'
|
||||||
|
name_declined_by_submitter: '"%{name}" rechazado por %{submitter}'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" ha sido rechazado por %{submitter} con el siguiente motivo:'
|
||||||
role: Rol
|
role: Rol
|
||||||
reason: Razón
|
reason: Razón
|
||||||
form_expired_at_html: 'El formulario expiró el <span class="font-semibold">%{time}</span>'
|
form_expired_at_html: 'El formulario expiró el <span class="font-semibold">%{time}</span>'
|
||||||
@@ -109,6 +131,17 @@ es: &es
|
|||||||
enter_email_to_continue: Ingresa tu correo electrónico para continuar
|
enter_email_to_continue: Ingresa tu correo electrónico para continuar
|
||||||
|
|
||||||
it: &it
|
it: &it
|
||||||
|
view: View
|
||||||
|
hi_there: Bonjour,
|
||||||
|
download: Télécharger
|
||||||
|
decline: Refuser
|
||||||
|
declined: Refusé
|
||||||
|
decline_reason: Raison du refus
|
||||||
|
provide_a_reason: Fournir une raison
|
||||||
|
notify_the_sender_with_the_reason_you_declined: Informer l'expéditeur de la raison pour laquelle vous avez refusé
|
||||||
|
form_has_been_declined_on_html: 'Le formulaire a été refusé le <span class="font-semibold">%{time}</span>'
|
||||||
|
name_declined_by_submitter: '"%{name}" refusé par %{submitter}'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" a été refusé par %{submitter} pour la raison suivante :'
|
||||||
role: Rôle
|
role: Rôle
|
||||||
reason: Ragione
|
reason: Ragione
|
||||||
verification_code_code: 'Codice di verifica: %{code}'
|
verification_code_code: 'Codice di verifica: %{code}'
|
||||||
@@ -152,6 +185,17 @@ it: &it
|
|||||||
enter_email_to_continue: Inserisci l'email per continuare
|
enter_email_to_continue: Inserisci l'email per continuare
|
||||||
|
|
||||||
fr: &fr
|
fr: &fr
|
||||||
|
view: Vue
|
||||||
|
hi_there: Salut,
|
||||||
|
download: Télécharger
|
||||||
|
decline: Refuser
|
||||||
|
declined: Refusé
|
||||||
|
decline_reason: Raison du refus
|
||||||
|
provide_a_reason: Fournir une raison
|
||||||
|
notify_the_sender_with_the_reason_you_declined: Informer l'expéditeur de la raison pour laquelle vous avez refusé
|
||||||
|
form_has_been_declined_on_html: 'Le formulaire a été refusé le <span class="font-semibold">%{time}</span>'
|
||||||
|
name_declined_by_submitter: '"%{name}" a été refusé par %{submitter}'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" a été refusé par %{submitter} avec la raison suivante :'
|
||||||
email: Email
|
email: Email
|
||||||
verification_code_code: 'Code de vérification: %{code}'
|
verification_code_code: 'Code de vérification: %{code}'
|
||||||
digitally_signed_by: Signé numériquement par
|
digitally_signed_by: Signé numériquement par
|
||||||
@@ -195,13 +239,23 @@ fr: &fr
|
|||||||
enter_email_to_continue: Entrez votre e-mail pour continuer
|
enter_email_to_continue: Entrez votre e-mail pour continuer
|
||||||
|
|
||||||
pt: &pt
|
pt: &pt
|
||||||
|
view: Visualizar
|
||||||
|
hi_there: Olá,
|
||||||
|
download: Baixar
|
||||||
|
decline: Recusar
|
||||||
|
declined: Recusado
|
||||||
|
decline_reason: Motivo da recusa
|
||||||
|
provide_a_reason: Forneça um motivo
|
||||||
|
notify_the_sender_with_the_reason_you_declined: Notifique o remetente com o motivo que você recusou
|
||||||
|
form_has_been_declined_on_html: 'O formulário foi recusado em <span class="font-semibold">%{time}</span>'
|
||||||
|
name_declined_by_submitter: '"%{name}" foi recusado por %{submitter}'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" foi recusado por %{submitter} com o seguinte motivo:'
|
||||||
role: Função
|
role: Função
|
||||||
email: Email
|
email: Email
|
||||||
reason: Razão
|
reason: Razão
|
||||||
verification_code_code: 'Código de verificação: %{code}'
|
verification_code_code: 'Código de verificação: %{code}'
|
||||||
digitally_signed_by: Assinado digitalmente por
|
digitally_signed_by: Assinado digitalmente por
|
||||||
form_expired_at_html: 'O formulário expirou em <span class="font-semibold">%{time}</span>'
|
form_expired_at_html: 'O formulário expirou em <span class="font-semibold">%{time}</span>'
|
||||||
role: Função
|
|
||||||
provide_your_email_to_start: Forneça o seu email para começar
|
provide_your_email_to_start: Forneça o seu email para começar
|
||||||
start: Iniciar
|
start: Iniciar
|
||||||
starting: Iniciando
|
starting: Iniciando
|
||||||
@@ -238,13 +292,23 @@ pt: &pt
|
|||||||
enter_email_to_continue: Insira o e-mail para continuar
|
enter_email_to_continue: Insira o e-mail para continuar
|
||||||
|
|
||||||
de: &de
|
de: &de
|
||||||
|
view: Ansicht
|
||||||
|
hi_there: Hallo,
|
||||||
|
download: Herunterladen
|
||||||
|
decline: Ablehnen
|
||||||
|
declined: Abgelehnt
|
||||||
|
decline_reason: Ablehnungsgrund
|
||||||
|
provide_a_reason: Geben Sie einen Grund an
|
||||||
|
notify_the_sender_with_the_reason_you_declined: Benachrichtigen Sie den Absender über den Grund für Ihre Ablehnung
|
||||||
|
form_has_been_declined_on_html: 'Das Formular wurde am <span class="font-semibold">%{time}</span> abgelehnt'
|
||||||
|
name_declined_by_submitter: '"%{name}" wurde von %{submitter} abgelehnt'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" wurde von %{submitter} mit folgendem Grund abgelehnt:'
|
||||||
role: Rolle
|
role: Rolle
|
||||||
verification_code_code: 'Verifizierungscode: %{code}'
|
verification_code_code: 'Verifizierungscode: %{code}'
|
||||||
reason: Grund
|
reason: Grund
|
||||||
email: E-Mail
|
email: E-Mail
|
||||||
form_expired_at_html: 'Das Formular ist am <span class="font-semibold">%{time}</span> abgelaufen'
|
form_expired_at_html: 'Das Formular ist am <span class="font-semibold">%{time}</span> abgelaufen'
|
||||||
digitally_signed_by: Digital signiert von
|
digitally_signed_by: Digital signiert von
|
||||||
role: Rolle
|
|
||||||
provide_your_email_to_start: Gib deine E-Mail-Adresse ein, um zu starten
|
provide_your_email_to_start: Gib deine E-Mail-Adresse ein, um zu starten
|
||||||
start: Starten
|
start: Starten
|
||||||
starting: Starten
|
starting: Starten
|
||||||
@@ -281,7 +345,18 @@ de: &de
|
|||||||
enter_email_to_continue: E-Mail eingeben, um fortzufahren
|
enter_email_to_continue: E-Mail eingeben, um fortzufahren
|
||||||
|
|
||||||
pl:
|
pl:
|
||||||
email: Email
|
view: Widok
|
||||||
|
hi_there: Cześć,
|
||||||
|
download: Pobierz
|
||||||
|
decline: Odrzuć
|
||||||
|
declined: Odrzucono
|
||||||
|
decline_reason: Powód odrzucenia
|
||||||
|
provide_a_reason: Podaj powód
|
||||||
|
notify_the_sender_with_the_reason_you_declined: Powiadom nadawcę o powodzie, dla którego odrzuciłeś
|
||||||
|
form_has_been_declined_on_html: 'Formularz został odrzucony o <span class="font-semibold">%{time}</span>'
|
||||||
|
name_declined_by_submitter: '"%{name}" odrzucono przez %{submitter}'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" został odrzucony przez %{submitter} z następującym powodem:'
|
||||||
|
email: E-mail
|
||||||
verification_code_code: 'Kod weryfikacyjny: %{code}'
|
verification_code_code: 'Kod weryfikacyjny: %{code}'
|
||||||
digitally_signed_by: Podpis cyfrowy przez
|
digitally_signed_by: Podpis cyfrowy przez
|
||||||
form_expired_at_html: 'Formularz wygasł o <span class="font-semibold">%{time}</span>'
|
form_expired_at_html: 'Formularz wygasł o <span class="font-semibold">%{time}</span>'
|
||||||
@@ -323,7 +398,18 @@ pl:
|
|||||||
enter_email_to_continue: Wprowadź e-mail, aby kontynuować
|
enter_email_to_continue: Wprowadź e-mail, aby kontynuować
|
||||||
|
|
||||||
uk:
|
uk:
|
||||||
email: Email
|
view: Переглянути
|
||||||
|
hi_there: Привіт,
|
||||||
|
download: Завантажити
|
||||||
|
decline: Відхилити
|
||||||
|
declined: Відхилено
|
||||||
|
decline_reason: Причина відхилення
|
||||||
|
provide_a_reason: Надайте причину
|
||||||
|
notify_the_sender_with_the_reason_you_declined: Повідомте відправника про причину, з якої ви відхилили
|
||||||
|
form_has_been_declined_on_html: 'Форму було відхилено о <span class="font-semibold">%{time}</span>'
|
||||||
|
name_declined_by_submitter: '"%{name}" відхилено %{submitter}'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" було відхилено %{submitter} з такою причиною:'
|
||||||
|
email: E-mail
|
||||||
digitally_signed_by: Цифровий підпис від
|
digitally_signed_by: Цифровий підпис від
|
||||||
verification_code_code: 'Код підтвердження: %{code}'
|
verification_code_code: 'Код підтвердження: %{code}'
|
||||||
role: Роль
|
role: Роль
|
||||||
@@ -365,7 +451,18 @@ uk:
|
|||||||
enter_email_to_continue: Введіть електронну пошту, щоб продовжити
|
enter_email_to_continue: Введіть електронну пошту, щоб продовжити
|
||||||
|
|
||||||
cs:
|
cs:
|
||||||
email: Email
|
view: Zobrazit
|
||||||
|
hi_there: Ahoj,
|
||||||
|
download: Stáhnout
|
||||||
|
decline: Odmítnout
|
||||||
|
declined: Odmítnuto
|
||||||
|
decline_reason: Důvod odmítnutí
|
||||||
|
provide_a_reason: Uveďte důvod
|
||||||
|
notify_the_sender_with_the_reason_you_declined: Informujte odesílatele o důvodu odmítnutí
|
||||||
|
form_has_been_declined_on_html: 'Formulář byl odmítnut dne <span class="font-semibold">%{time}</span>'
|
||||||
|
name_declined_by_submitter: '"%{name}" odmítnuto %{submitter}'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" bylo odmítnuto %{submitter} s následujícím důvodem:'
|
||||||
|
email: E-mail
|
||||||
digitally_signed_by: Digitálně podepsáno uživatelem
|
digitally_signed_by: Digitálně podepsáno uživatelem
|
||||||
verification_code_code: 'Ověřovací kód: %{code}'
|
verification_code_code: 'Ověřovací kód: %{code}'
|
||||||
role: Role
|
role: Role
|
||||||
@@ -407,6 +504,17 @@ cs:
|
|||||||
enter_email_to_continue: Zadejte e-mail pro pokračování
|
enter_email_to_continue: Zadejte e-mail pro pokračování
|
||||||
|
|
||||||
he:
|
he:
|
||||||
|
view: תצוגה
|
||||||
|
hi_there: שלום,
|
||||||
|
download: הורד
|
||||||
|
decline: דחייה
|
||||||
|
declined: דחוי
|
||||||
|
decline_reason: סיבת דחייה
|
||||||
|
provide_a_reason: אנא ספק סיבה
|
||||||
|
notify_the_sender_with_the_reason_you_declined: הודע לשולח על הסיבה לדחייה
|
||||||
|
form_has_been_declined_on_html: 'הטופס נדחה בתאריך <span class="font-semibold">%{time}</span>'
|
||||||
|
name_declined_by_submitter: '"%{name}" נדחה על ידי %{submitter}'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" נדחה על ידי %{submitter} עם הסיבה הבאה:'
|
||||||
email: דוא"ל
|
email: דוא"ל
|
||||||
digitally_signed_by: חתום דיגיטלית על ידי
|
digitally_signed_by: חתום דיגיטלית על ידי
|
||||||
role: תפקיד
|
role: תפקיד
|
||||||
@@ -449,6 +557,17 @@ he:
|
|||||||
enter_email_to_continue: הכנס דוא"ל כדי להמשיך
|
enter_email_to_continue: הכנס דוא"ל כדי להמשיך
|
||||||
|
|
||||||
nl:
|
nl:
|
||||||
|
view: Bekijken
|
||||||
|
hi_there: Hallo,
|
||||||
|
download: Downloaden
|
||||||
|
decline: Weigeren
|
||||||
|
declined: Geweigerd
|
||||||
|
decline_reason: Weigeringsreden
|
||||||
|
provide_a_reason: Geef een reden op
|
||||||
|
notify_the_sender_with_the_reason_you_declined: Informeer de afzender over de reden waarom je hebt geweigerd
|
||||||
|
form_has_been_declined_on_html: 'Formulier is afgewezen op <span class="font-semibold">%{time}</span>'
|
||||||
|
name_declined_by_submitter: '"%{name}" is geweigerd door %{submitter}'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" is geweigerd door %{submitter} met de volgende reden:'
|
||||||
email: E-mail
|
email: E-mail
|
||||||
digitally_signed_by: Digitaal ondertekend door
|
digitally_signed_by: Digitaal ondertekend door
|
||||||
role: Rol
|
role: Rol
|
||||||
@@ -492,6 +611,17 @@ nl:
|
|||||||
enter_email_to_continue: Voer e-mail in om door te gaan
|
enter_email_to_continue: Voer e-mail in om door te gaan
|
||||||
|
|
||||||
ar:
|
ar:
|
||||||
|
view: عرض
|
||||||
|
hi_there: مرحبا,
|
||||||
|
download: تحميل
|
||||||
|
decline: رفض
|
||||||
|
declined: مرفوض
|
||||||
|
decline_reason: سبب الرفض
|
||||||
|
provide_a_reason: قدم سببًا
|
||||||
|
notify_the_sender_with_the_reason_you_declined: أخطر المرسل بسبب الرفض
|
||||||
|
form_has_been_declined_on_html: 'تم رفض النموذج في <span class="font-semibold">%{time}</span>'
|
||||||
|
name_declined_by_submitter: '"%{name}" مرفوض بواسطة %{submitter}'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}" تم رفضه بواسطة %{submitter} مع السبب التالي:'
|
||||||
email: البريد الإلكتروني
|
email: البريد الإلكتروني
|
||||||
digitally_signed_by: تم التوقيع الرقمي بواسطة
|
digitally_signed_by: تم التوقيع الرقمي بواسطة
|
||||||
role: الدور
|
role: الدور
|
||||||
@@ -535,6 +665,17 @@ ar:
|
|||||||
enter_email_to_continue: أدخل البريد الإلكتروني للمتابعة
|
enter_email_to_continue: أدخل البريد الإلكتروني للمتابعة
|
||||||
|
|
||||||
ko:
|
ko:
|
||||||
|
view: 보기
|
||||||
|
hi_there: 안녕하세요,
|
||||||
|
download: 다운로드
|
||||||
|
decline: 거절
|
||||||
|
declined: 거절됨
|
||||||
|
decline_reason: 거절 사유
|
||||||
|
provide_a_reason: 사유를 제공하세요
|
||||||
|
notify_the_sender_with_the_reason_you_declined: 거절한 이유로 발신자에게 알리기
|
||||||
|
form_has_been_declined_on_html: '양식이 <span class="font-semibold">%{time}</span>에 거절되었습니다.'
|
||||||
|
name_declined_by_submitter: '"%{name}"이(가) %{submitter}에 의해 거절되었습니다.'
|
||||||
|
name_declined_by_submitter_with_the_following_reason: '"%{name}"이(가) %{submitter}에 의해 다음과 같은 사유로 거절되었습니다:'
|
||||||
email: 이메일
|
email: 이메일
|
||||||
digitally_signed_by: 디지털로 서명됨
|
digitally_signed_by: 디지털로 서명됨
|
||||||
role: 역할
|
role: 역할
|
||||||
|
|||||||
@@ -45,9 +45,11 @@ Rails.application.routes.draw do
|
|||||||
end
|
end
|
||||||
resources :tools, only: %i[] do
|
resources :tools, only: %i[] do
|
||||||
post :merge, on: :collection
|
post :merge, on: :collection
|
||||||
|
post :verify, on: :collection
|
||||||
end
|
end
|
||||||
scope 'events' do
|
scope 'events' do
|
||||||
resources :form_events, only: %i[index], path: 'form/:type'
|
resources :form_events, only: %i[index], path: 'form/:type'
|
||||||
|
resources :submission_events, only: %i[index], path: 'submission/:type'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -123,6 +125,8 @@ Rails.application.routes.draw do
|
|||||||
|
|
||||||
resources :submit_form, only: %i[show update], path: 's', param: 'slug' do
|
resources :submit_form, only: %i[show update], path: 's', param: 'slug' do
|
||||||
resources :values, only: %i[index], controller: 'submit_form_values'
|
resources :values, only: %i[index], controller: 'submit_form_values'
|
||||||
|
resources :download, only: %i[index], controller: 'submit_form_download'
|
||||||
|
resources :decline, only: %i[create], controller: 'submit_form_decline'
|
||||||
get :completed
|
get :completed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,4 +7,4 @@ queues:
|
|||||||
|
|
||||||
production:
|
production:
|
||||||
:concurrency: 15
|
:concurrency: 15
|
||||||
:max_retries: 5
|
:max_retries: 3
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class AddAccountIdToSubmitters < ActiveRecord::Migration[7.1]
|
||||||
|
def change
|
||||||
|
add_reference :submitters, :account, index: false, null: true
|
||||||
|
|
||||||
|
add_index :submitters, %i[account_id id]
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class PopulateSubmitterAccountId < ActiveRecord::Migration[7.1]
|
||||||
|
disable_ddl_transaction
|
||||||
|
|
||||||
|
class MigrationSubmitter < ApplicationRecord
|
||||||
|
self.table_name = 'submitters'
|
||||||
|
belongs_to :submission, class_name: 'MigrationSubmission'
|
||||||
|
end
|
||||||
|
|
||||||
|
class MigrationSubmission < ApplicationRecord
|
||||||
|
self.table_name = 'submissions'
|
||||||
|
end
|
||||||
|
|
||||||
|
def up
|
||||||
|
MigrationSubmitter.where(account_id: nil).preload(:submission).find_each do |submitter|
|
||||||
|
submitter.update_columns(account_id: submitter.submission.account_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
if MigrationSubmitter.exists?(account_id: nil)
|
||||||
|
MigrationSubmitter.where(account_id: nil).preload(:submission).find_each do |submitter|
|
||||||
|
submitter.update_columns(account_id: submitter.submission.account_id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
change_column_null :submitters, :account_id, false
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class UpdateSubmissionAccountIdIndex < ActiveRecord::Migration[7.1]
|
||||||
|
def change
|
||||||
|
add_index :submissions, %i[account_id id]
|
||||||
|
remove_index :submissions, :account_id
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class RemoveActiveStorageUniqIndex < ActiveRecord::Migration[7.1]
|
||||||
|
def change
|
||||||
|
remove_index :active_storage_attachments, %i[record_type record_id name blob_id],
|
||||||
|
unique: true,
|
||||||
|
name: 'index_active_storage_attachments_uniqueness'
|
||||||
|
|
||||||
|
add_index :active_storage_attachments, %i[record_type record_id name blob_id]
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class AddDeclinedAtToSubmitters < ActiveRecord::Migration[7.1]
|
||||||
|
def change
|
||||||
|
add_column :submitters, :declined_at, :datetime
|
||||||
|
end
|
||||||
|
end
|
||||||
+6
-3
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.1].define(version: 2024_08_01_125558) do
|
ActiveRecord::Schema[7.1].define(version: 2024_08_20_180922) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_01_125558) do
|
|||||||
t.bigint "blob_id", null: false
|
t.bigint "blob_id", null: false
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
||||||
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
t.index ["record_type", "record_id", "name", "blob_id"], name: "idx_on_record_type_record_id_name_blob_id_0be5805727"
|
||||||
t.index ["uuid"], name: "index_active_storage_attachments_on_uuid"
|
t.index ["uuid"], name: "index_active_storage_attachments_on_uuid"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_01_125558) do
|
|||||||
t.text "preferences", null: false
|
t.text "preferences", null: false
|
||||||
t.bigint "account_id", null: false
|
t.bigint "account_id", null: false
|
||||||
t.datetime "expire_at"
|
t.datetime "expire_at"
|
||||||
t.index ["account_id"], name: "index_submissions_on_account_id"
|
t.index ["account_id", "id"], name: "index_submissions_on_account_id_and_id"
|
||||||
t.index ["created_by_user_id"], name: "index_submissions_on_created_by_user_id"
|
t.index ["created_by_user_id"], name: "index_submissions_on_created_by_user_id"
|
||||||
t.index ["slug"], name: "index_submissions_on_slug", unique: true
|
t.index ["slug"], name: "index_submissions_on_slug", unique: true
|
||||||
t.index ["template_id"], name: "index_submissions_on_template_id"
|
t.index ["template_id"], name: "index_submissions_on_template_id"
|
||||||
@@ -243,6 +243,9 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_01_125558) do
|
|||||||
t.string "external_id"
|
t.string "external_id"
|
||||||
t.text "preferences", null: false
|
t.text "preferences", null: false
|
||||||
t.text "metadata", null: false
|
t.text "metadata", null: false
|
||||||
|
t.bigint "account_id", null: false
|
||||||
|
t.datetime "declined_at"
|
||||||
|
t.index ["account_id", "id"], name: "index_submitters_on_account_id_and_id"
|
||||||
t.index ["email"], name: "index_submitters_on_email"
|
t.index ["email"], name: "index_submitters_on_email"
|
||||||
t.index ["external_id"], name: "index_submitters_on_external_id"
|
t.index ["external_id"], name: "index_submitters_on_external_id"
|
||||||
t.index ["slug"], name: "index_submitters_on_slug", unique: true
|
t.index ["slug"], name: "index_submitters_on_slug", unique: true
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ class Ability
|
|||||||
can :manage, TemplateFolder, account_id: user.account_id
|
can :manage, TemplateFolder, account_id: user.account_id
|
||||||
can :manage, TemplateSharing, template: { account_id: user.account_id }
|
can :manage, TemplateSharing, template: { account_id: user.account_id }
|
||||||
can :manage, Submission, account_id: user.account_id
|
can :manage, Submission, account_id: user.account_id
|
||||||
can :manage, Submitter, submission: { account_id: user.account_id }
|
can :manage, Submitter, account_id: user.account_id
|
||||||
can :manage, User, account_id: user.account_id
|
can :manage, User, account_id: user.account_id
|
||||||
can :manage, EncryptedConfig, account_id: user.account_id
|
can :manage, EncryptedConfig, account_id: user.account_id
|
||||||
can :manage, EncryptedUserConfig, user_id: user.id
|
can :manage, EncryptedUserConfig, user_id: user.id
|
||||||
|
|||||||
@@ -137,6 +137,29 @@ module Accounts
|
|||||||
end.presence
|
end.presence
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def load_trusted_certs(account)
|
||||||
|
cert_data =
|
||||||
|
if Docuseal.multitenant?
|
||||||
|
value = EncryptedConfig.find_by(account:, key: EncryptedConfig::ESIGN_CERTS_KEY)&.value || {}
|
||||||
|
|
||||||
|
Docuseal::CERTS.merge(value)
|
||||||
|
else
|
||||||
|
EncryptedConfig.find_by(key: EncryptedConfig::ESIGN_CERTS_KEY)&.value || {}
|
||||||
|
end
|
||||||
|
|
||||||
|
default_pkcs = GenerateCertificate.load_pkcs(cert_data)
|
||||||
|
|
||||||
|
custom_certs = cert_data.fetch('custom', []).map do |e|
|
||||||
|
OpenSSL::PKCS12.new(Base64.urlsafe_decode64(e['data']), e['password'].to_s)
|
||||||
|
end
|
||||||
|
|
||||||
|
[default_pkcs.certificate,
|
||||||
|
*default_pkcs.ca_certs,
|
||||||
|
*custom_certs.map(&:certificate),
|
||||||
|
*custom_certs.flat_map(&:ca_certs).compact,
|
||||||
|
*Docuseal.trusted_certs]
|
||||||
|
end
|
||||||
|
|
||||||
def can_send_emails?(_account, **_params)
|
def can_send_emails?(_account, **_params)
|
||||||
return true if Docuseal.multitenant?
|
return true if Docuseal.multitenant?
|
||||||
return true if ENV['SMTP_ADDRESS'].present?
|
return true if ENV['SMTP_ADDRESS'].present?
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionMailerConfigsInterceptor
|
module ActionMailerConfigsInterceptor
|
||||||
OPEN_TIMEOUT = 15
|
OPEN_TIMEOUT = ENV.fetch('SMTP_OPEN_TIMEOUT', '15').to_i
|
||||||
READ_TIMEOUT = 25
|
READ_TIMEOUT = ENV.fetch('SMTP_READ_TIMEOUT', '25').to_i
|
||||||
|
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@ module Docuseal
|
|||||||
NEWSLETTER_URL = "#{PRODUCT_URL}/newsletters".freeze
|
NEWSLETTER_URL = "#{PRODUCT_URL}/newsletters".freeze
|
||||||
ENQUIRIES_URL = "#{PRODUCT_URL}/enquiries".freeze
|
ENQUIRIES_URL = "#{PRODUCT_URL}/enquiries".freeze
|
||||||
PRODUCT_NAME = 'DocuSeal'
|
PRODUCT_NAME = 'DocuSeal'
|
||||||
DEFAULT_APP_URL = 'http://localhost:3000'
|
DEFAULT_APP_URL = ENV.fetch('APP_URL', 'http://localhost:3000')
|
||||||
GITHUB_URL = 'https://github.com/docusealco/docuseal'
|
GITHUB_URL = 'https://github.com/docusealco/docuseal'
|
||||||
DISCORD_URL = 'https://discord.gg/qygYCDGck9'
|
DISCORD_URL = 'https://discord.gg/qygYCDGck9'
|
||||||
TWITTER_URL = 'https://twitter.com/docusealco'
|
TWITTER_URL = 'https://twitter.com/docusealco'
|
||||||
@@ -76,7 +76,7 @@ module Docuseal
|
|||||||
return DEFAULT_URL_OPTIONS if multitenant?
|
return DEFAULT_URL_OPTIONS if multitenant?
|
||||||
|
|
||||||
@default_url_options ||= begin
|
@default_url_options ||= begin
|
||||||
value = EncryptedConfig.find_by(key: EncryptedConfig::APP_URL_KEY)&.value
|
value = EncryptedConfig.find_by(key: EncryptedConfig::APP_URL_KEY)&.value if ENV['APP_URL'].blank?
|
||||||
value ||= DEFAULT_APP_URL
|
value ||= DEFAULT_APP_URL
|
||||||
url = Addressable::URI.parse(value)
|
url = Addressable::URI.parse(value)
|
||||||
{ host: url.host, port: url.port, protocol: url.scheme }
|
{ host: url.host, port: url.port, protocol: url.scheme }
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ReplaceEmailVariables
|
module ReplaceEmailVariables
|
||||||
TEMPLATE_NAME = '{{template.name}}'
|
TEMPLATE_NAME = /\{+template\.name\}+/i
|
||||||
TEMPLATE_ID = '{{template.id}}'
|
TEMPLATE_ID = /\{+template\.id\}+/i
|
||||||
SUBMITTER_LINK = '{{submitter.link}}'
|
SUBMITTER_LINK = /\{+submitter\.link\}+/i
|
||||||
ACCOUNT_NAME = '{{account.name}}'
|
ACCOUNT_NAME = /\{+account\.name\}+/i
|
||||||
SENDER_NAME = '{{sender.name}}'
|
SENDER_NAME = /\{+sender\.name\}+/i
|
||||||
SENDER_EMAIL = '{{sender.email}}'
|
SENDER_EMAIL = /\{+sender\.email\}+/i
|
||||||
SUBMITTER_EMAIL = '{{submitter.email}}'
|
SUBMITTER_EMAIL = /\{+submitter\.email\}+/i
|
||||||
SUBMITTER_NAME = '{{submitter.name}}'
|
SUBMITTER_NAME = /\{+submitter\.name\}+/i
|
||||||
SUBMITTER_ID = '{{submitter.id}}'
|
SUBMITTER_ID = /\{+submitter\.id\}+/i
|
||||||
SUBMITTER_SLUG = '{{submitter.slug}}'
|
SUBMITTER_SLUG = /\{+submitter\.slug\}+/i
|
||||||
SUBMISSION_LINK = '{{submission.link}}'
|
SUBMISSION_LINK = /\{+submission\.link\}+/i
|
||||||
SUBMISSION_ID = '{{submission.id}}'
|
SUBMISSION_ID = /\{+submission\.id\}+/i
|
||||||
SUBMISSION_SUBMITTERS = '{{submission.submitters}}'
|
SUBMISSION_SUBMITTERS = /\{+submission\.submitters\}+/i
|
||||||
DOCUMENTS_LINKS = '{{documents.links}}'
|
DOCUMENTS_LINKS = /\{+documents\.links\}+/i
|
||||||
DOCUMENTS_LINK = '{{documents.link}}'
|
DOCUMENTS_LINK = /\{+documents\.link\}+/i
|
||||||
|
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ module Submissions
|
|||||||
|
|
||||||
submission.submitters.new(email: normalize_email(email),
|
submission.submitters.new(email: normalize_email(email),
|
||||||
uuid: template.submitters.first['uuid'],
|
uuid: template.submitters.first['uuid'],
|
||||||
|
account_id: user.account_id,
|
||||||
preferences:,
|
preferences:,
|
||||||
sent_at: mark_as_sent ? Time.current : nil)
|
sent_at: mark_as_sent ? Time.current : nil)
|
||||||
|
|
||||||
|
|||||||
@@ -155,16 +155,14 @@ module Submissions
|
|||||||
submitter_preferences = Submitters.normalize_preferences(submission.account, user, attrs)
|
submitter_preferences = Submitters.normalize_preferences(submission.account, user, attrs)
|
||||||
values = attrs[:values] || {}
|
values = attrs[:values] || {}
|
||||||
|
|
||||||
phone_field_uuid =
|
phone_field_uuid = find_phone_field(submission, values)&.dig('uuid')
|
||||||
(submission.template_fields || submission.template.fields).find do |f|
|
|
||||||
values[f['uuid']].present? && f['type'] == 'phone'
|
|
||||||
end&.dig('uuid')
|
|
||||||
|
|
||||||
submitter =
|
submitter =
|
||||||
submission.submitters.new(
|
submission.submitters.new(
|
||||||
email:,
|
email:,
|
||||||
phone: (attrs[:phone] || values[phone_field_uuid]).to_s.gsub(/[^0-9+]/, ''),
|
phone: (attrs[:phone] || values[phone_field_uuid]).to_s.gsub(/[^0-9+]/, ''),
|
||||||
name: attrs[:name],
|
name: attrs[:name],
|
||||||
|
account_id: user.account_id,
|
||||||
external_id: attrs[:external_id].presence || attrs[:application_key],
|
external_id: attrs[:external_id].presence || attrs[:application_key],
|
||||||
completed_at: attrs[:completed].present? ? Time.current : nil,
|
completed_at: attrs[:completed].present? ? Time.current : nil,
|
||||||
values: values.except(phone_field_uuid),
|
values: values.except(phone_field_uuid),
|
||||||
@@ -183,6 +181,12 @@ module Submissions
|
|||||||
submitter
|
submitter
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_phone_field(submission, values)
|
||||||
|
(submission.template_fields || submission.template.fields).find do |f|
|
||||||
|
values[f['uuid']].present? && f['type'] == 'phone'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def assign_completed_attributes(submitter)
|
def assign_completed_attributes(submitter)
|
||||||
submitter.values = Submitters::SubmitValues.merge_default_values(submitter)
|
submitter.values = Submitters::SubmitValues.merge_default_values(submitter)
|
||||||
submitter.values = Submitters::SubmitValues.merge_formula_values(submitter)
|
submitter.values = Submitters::SubmitValues.merge_formula_values(submitter)
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ module Submissions
|
|||||||
'GBP' => '£'
|
'GBP' => '£'
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
|
TESTING_FOOTER = GenerateResultAttachments::TESTING_FOOTER
|
||||||
|
|
||||||
RTL_REGEXP = TextUtils::RTL_REGEXP
|
RTL_REGEXP = TextUtils::RTL_REGEXP
|
||||||
MAX_IMAGE_HEIGHT = 100
|
MAX_IMAGE_HEIGHT = 100
|
||||||
|
|
||||||
@@ -105,6 +107,31 @@ module Submissions
|
|||||||
|
|
||||||
maybe_add_background(canvas, submission, page_size)
|
maybe_add_background(canvas, submission, page_size)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
with_signature_id = submission.account.account_configs
|
||||||
|
.exists?(key: AccountConfig::WITH_SIGNATURE_ID, value: true)
|
||||||
|
|
||||||
|
if with_signature_id || submission.account.testing?
|
||||||
|
canvas.save_graphics_state do
|
||||||
|
document_id = Digest::MD5.hexdigest(submission.slug).upcase
|
||||||
|
|
||||||
|
canvas.font(FONT_NAME, size: FONT_SIZE)
|
||||||
|
|
||||||
|
text =
|
||||||
|
if submission.account.testing?
|
||||||
|
if with_signature_id
|
||||||
|
"#{TESTING_FOOTER} | ID: #{document_id}"
|
||||||
|
else
|
||||||
|
TESTING_FOOTER
|
||||||
|
end
|
||||||
|
else
|
||||||
|
"Document ID: #{document_id}"
|
||||||
|
end
|
||||||
|
|
||||||
|
canvas.text(text, at: [2, 4])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
style.frame = style.create_frame(canvas.context, 50)
|
style.frame = style.create_frame(canvas.context, 50)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -58,13 +58,15 @@ module Submissions
|
|||||||
submitter.submission.template_schema.map do |item|
|
submitter.submission.template_schema.map do |item|
|
||||||
pdf = pdfs_index[item['attachment_uuid']]
|
pdf = pdfs_index[item['attachment_uuid']]
|
||||||
|
|
||||||
attachment = build_pdf_attachment(pdf:, submitter:, pkcs:, tsa_url:,
|
if original_documents.find { |a| a.uuid == item['attachment_uuid'] }.image?
|
||||||
uuid: item['attachment_uuid'],
|
pdf = normalize_image_pdf(pdf)
|
||||||
name: item['name'])
|
|
||||||
|
|
||||||
image_pdfs << pdf if original_documents.find { |a| a.uuid == item['attachment_uuid'] }.image?
|
image_pdfs << pdf
|
||||||
|
end
|
||||||
|
|
||||||
attachment
|
build_pdf_attachment(pdf:, submitter:, pkcs:, tsa_url:,
|
||||||
|
uuid: item['attachment_uuid'],
|
||||||
|
name: item['name'])
|
||||||
end
|
end
|
||||||
|
|
||||||
return result_attachments.map { |e| e.tap(&:save!) } if image_pdfs.size < 2
|
return result_attachments.map { |e| e.tap(&:save!) } if image_pdfs.size < 2
|
||||||
@@ -74,6 +76,8 @@ module Submissions
|
|||||||
pdf.pages.each { |page| doc.pages << doc.import(page) }
|
pdf.pages.each { |page| doc.pages << doc.import(page) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
images_pdf = normalize_image_pdf(images_pdf)
|
||||||
|
|
||||||
images_pdf_attachment =
|
images_pdf_attachment =
|
||||||
build_pdf_attachment(
|
build_pdf_attachment(
|
||||||
pdf: images_pdf,
|
pdf: images_pdf,
|
||||||
@@ -184,7 +188,7 @@ module Submissions
|
|||||||
canvas.font(FONT_NAME, size: font_size)
|
canvas.font(FONT_NAME, size: font_size)
|
||||||
|
|
||||||
case field['type']
|
case field['type']
|
||||||
when ->(type) { type == 'signature' && with_signature_id }
|
when ->(type) { type == 'signature' && (with_signature_id || field.dig('preferences', 'reason_field_uuid')) }
|
||||||
attachment = submitter.attachments.find { |a| a.uuid == value }
|
attachment = submitter.attachments.find { |a| a.uuid == value }
|
||||||
|
|
||||||
attachments_data_cache[attachment.uuid] ||= attachment.download
|
attachments_data_cache[attachment.uuid] ||= attachment.download
|
||||||
@@ -207,8 +211,10 @@ module Submissions
|
|||||||
break if id_string.length < 8
|
break if id_string.length < 8
|
||||||
end
|
end
|
||||||
|
|
||||||
|
reason_value = submitter.values[field.dig('preferences', 'reason_field_uuid')].presence
|
||||||
|
|
||||||
reason_string =
|
reason_string =
|
||||||
"#{I18n.t('reason')}: #{I18n.t('digitally_signed_by')} " \
|
"#{I18n.t('reason')}: #{reason_value || I18n.t('digitally_signed_by')} " \
|
||||||
"#{submitter.name}#{submitter.email.present? ? " <#{submitter.email}>" : ''}\n" \
|
"#{submitter.name}#{submitter.email.present? ? " <#{submitter.email}>" : ''}\n" \
|
||||||
"#{I18n.l(attachment.created_at.in_time_zone(submitter.account.timezone),
|
"#{I18n.l(attachment.created_at.in_time_zone(submitter.account.timezone),
|
||||||
format: :long, locale: submitter.account.locale)} " \
|
format: :long, locale: submitter.account.locale)} " \
|
||||||
@@ -588,6 +594,14 @@ module Submissions
|
|||||||
pdf
|
pdf
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def normalize_image_pdf(pdf)
|
||||||
|
io = StringIO.new
|
||||||
|
pdf.write(io)
|
||||||
|
io.rewind
|
||||||
|
|
||||||
|
HexaPDF::Document.new(io:)
|
||||||
|
end
|
||||||
|
|
||||||
def sign_reason(name)
|
def sign_reason(name)
|
||||||
format(SIGN_REASON, name:)
|
format(SIGN_REASON, name:)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ module Submissions
|
|||||||
module SerializeForApi
|
module SerializeForApi
|
||||||
SERIALIZE_PARAMS = {
|
SERIALIZE_PARAMS = {
|
||||||
only: %i[id slug source submitters_order expire_at created_at updated_at archived_at],
|
only: %i[id slug source submitters_order expire_at created_at updated_at archived_at],
|
||||||
methods: %i[audit_log_url],
|
methods: %i[audit_log_url combined_document_url],
|
||||||
include: {
|
include: {
|
||||||
submitters: { only: %i[id slug uuid name email phone
|
submitters: { only: %i[id slug uuid name email phone
|
||||||
completed_at opened_at sent_at
|
completed_at opened_at sent_at declined_at
|
||||||
created_at updated_at external_id metadata],
|
created_at updated_at external_id metadata],
|
||||||
methods: %i[status application_key] },
|
methods: %i[status application_key] },
|
||||||
template: { only: %i[id name external_id created_at updated_at],
|
template: { only: %i[id name external_id created_at updated_at],
|
||||||
@@ -23,25 +23,24 @@ module Submissions
|
|||||||
|
|
||||||
serialized_submitters = submitters.map { |submitter| Submitters::SerializeForApi.call(submitter, params:) }
|
serialized_submitters = submitters.map { |submitter| Submitters::SerializeForApi.call(submitter, params:) }
|
||||||
|
|
||||||
json = submission.as_json(
|
json = submission.as_json(SERIALIZE_PARAMS)
|
||||||
SERIALIZE_PARAMS.deep_merge(
|
|
||||||
include: { submission_events: { only: %i[id submitter_id event_type event_timestamp] } }
|
json['submission_events'] = Submitters::SerializeForApi.serialize_events(submission.submission_events)
|
||||||
)
|
json['combined_document_url'] ||= maybe_build_combined_url(submitters, submission, params)
|
||||||
)
|
|
||||||
|
|
||||||
if submitters.all?(&:completed_at?)
|
if submitters.all?(&:completed_at?)
|
||||||
last_submitter = submitters.max_by(&:completed_at)
|
last_submitter = submitters.max_by(&:completed_at)
|
||||||
|
|
||||||
if params[:include].to_s.include?('combined_document_url')
|
|
||||||
json[:combined_document_url] = build_combined_url(submitters.max_by(&:completed_at), submission)
|
|
||||||
end
|
|
||||||
|
|
||||||
json[:documents] = serialized_submitters.find { |e| e['id'] == last_submitter.id }['documents']
|
json[:documents] = serialized_submitters.find { |e| e['id'] == last_submitter.id }['documents']
|
||||||
json[:status] = 'completed'
|
json[:status] = 'completed'
|
||||||
json[:completed_at] = last_submitter.completed_at
|
json[:completed_at] = last_submitter.completed_at
|
||||||
else
|
else
|
||||||
json[:documents] = []
|
json[:documents] = []
|
||||||
json[:status] = submission.expired? ? 'expired' : 'pending'
|
json[:status] = if submitters.any?(&:declined_at?)
|
||||||
|
'declined'
|
||||||
|
else
|
||||||
|
submission.expired? ? 'expired' : 'pending'
|
||||||
|
end
|
||||||
json[:completed_at] = nil
|
json[:completed_at] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -50,13 +49,18 @@ module Submissions
|
|||||||
json
|
json
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_combined_url(submitter, submission)
|
def maybe_build_combined_url(submitters, submission, params)
|
||||||
return unless submitter.completed_at?
|
return unless submitters.all?(&:completed_at?)
|
||||||
|
|
||||||
attachment = submission.combined_document_attachment
|
attachment = submission.combined_document_attachment
|
||||||
attachment ||= Submissions::GenerateCombinedAttachment.call(submitter)
|
|
||||||
|
|
||||||
ActiveStorage::Blob.proxy_url(attachment.blob)
|
if !attachment && params[:include].to_s.include?('combined_document_url')
|
||||||
|
submitter = submitters.max_by(&:completed_at)
|
||||||
|
|
||||||
|
attachment = Submissions::GenerateCombinedAttachment.call(submitter)
|
||||||
|
end
|
||||||
|
|
||||||
|
ActiveStorage::Blob.proxy_url(attachment.blob) if attachment
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -21,6 +21,12 @@ module Submitters
|
|||||||
end
|
end
|
||||||
|
|
||||||
def select_attachments_for_download(submitter)
|
def select_attachments_for_download(submitter)
|
||||||
|
if AccountConfig.exists?(account_id: submitter.submission.account_id,
|
||||||
|
key: AccountConfig::COMBINE_PDF_RESULT_KEY,
|
||||||
|
value: true) && submitter.submission.combined_document_attachment
|
||||||
|
return [submitter.submission.combined_document_attachment]
|
||||||
|
end
|
||||||
|
|
||||||
original_documents = submitter.submission.template.documents.preload(:blob)
|
original_documents = submitter.submission.template.documents.preload(:blob)
|
||||||
is_more_than_two_images = original_documents.count(&:image?) > 1
|
is_more_than_two_images = original_documents.count(&:image?) > 1
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module Submitters
|
|||||||
AccountConfig::FORM_WITH_CONFETTI_KEY,
|
AccountConfig::FORM_WITH_CONFETTI_KEY,
|
||||||
AccountConfig::FORM_PREFILL_SIGNATURE_KEY,
|
AccountConfig::FORM_PREFILL_SIGNATURE_KEY,
|
||||||
AccountConfig::WITH_SIGNATURE_ID,
|
AccountConfig::WITH_SIGNATURE_ID,
|
||||||
|
AccountConfig::REQUIRE_SIGNING_REASON_KEY,
|
||||||
AccountConfig::ALLOW_TYPED_SIGNATURE].freeze
|
AccountConfig::ALLOW_TYPED_SIGNATURE].freeze
|
||||||
|
|
||||||
module_function
|
module_function
|
||||||
@@ -20,11 +21,13 @@ module Submitters
|
|||||||
with_confetti = find_safe_value(configs, AccountConfig::FORM_WITH_CONFETTI_KEY) != false
|
with_confetti = find_safe_value(configs, AccountConfig::FORM_WITH_CONFETTI_KEY) != false
|
||||||
prefill_signature = find_safe_value(configs, AccountConfig::FORM_PREFILL_SIGNATURE_KEY) != false
|
prefill_signature = find_safe_value(configs, AccountConfig::FORM_PREFILL_SIGNATURE_KEY) != false
|
||||||
with_signature_id = find_safe_value(configs, AccountConfig::WITH_SIGNATURE_ID) == true
|
with_signature_id = find_safe_value(configs, AccountConfig::WITH_SIGNATURE_ID) == true
|
||||||
|
require_signing_reason = find_safe_value(configs, AccountConfig::REQUIRE_SIGNING_REASON_KEY) == true
|
||||||
|
|
||||||
attrs = { completed_button:,
|
attrs = { completed_button:,
|
||||||
with_typed_signature:,
|
with_typed_signature:,
|
||||||
with_confetti:,
|
with_confetti:,
|
||||||
completed_message:,
|
completed_message:,
|
||||||
|
require_signing_reason:,
|
||||||
prefill_signature:,
|
prefill_signature:,
|
||||||
with_signature_id: }
|
with_signature_id: }
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
module Submitters
|
module Submitters
|
||||||
module SerializeForApi
|
module SerializeForApi
|
||||||
SERIALIZE_PARAMS = {
|
SERIALIZE_PARAMS = {
|
||||||
only: %i[id slug uuid name email phone completed_at external_id
|
only: %i[id slug uuid name email phone completed_at declined_at external_id
|
||||||
submission_id metadata opened_at sent_at created_at updated_at],
|
submission_id metadata opened_at sent_at created_at updated_at],
|
||||||
methods: %i[status application_key]
|
methods: %i[status application_key]
|
||||||
}.freeze
|
}.freeze
|
||||||
@@ -29,6 +29,7 @@ module Submitters
|
|||||||
additional_attrs['values'] = SerializeForWebhook.build_values_array(submitter)
|
additional_attrs['values'] = SerializeForWebhook.build_values_array(submitter)
|
||||||
additional_attrs['documents'] = SerializeForWebhook.build_documents_array(submitter) if with_documents
|
additional_attrs['documents'] = SerializeForWebhook.build_documents_array(submitter) if with_documents
|
||||||
additional_attrs['preferences'] = submitter.preferences.except('default_values')
|
additional_attrs['preferences'] = submitter.preferences.except('default_values')
|
||||||
|
additional_attrs['submission_events'] = serialize_events(submitter.submission_events) if with_events
|
||||||
|
|
||||||
additional_attrs['role'] =
|
additional_attrs['role'] =
|
||||||
(submitter.submission.template_submitters ||
|
(submitter.submission.template_submitters ||
|
||||||
@@ -41,9 +42,14 @@ module Submitters
|
|||||||
|
|
||||||
include_params = {}
|
include_params = {}
|
||||||
include_params[:template] = { only: %i[id name created_at updated_at] } if with_template
|
include_params[:template] = { only: %i[id name created_at updated_at] } if with_template
|
||||||
include_params[:submission_events] = { only: %i[id submitter_id event_type event_timestamp] } if with_events
|
|
||||||
|
|
||||||
submitter.as_json(SERIALIZE_PARAMS.merge(include: include_params)).merge(additional_attrs)
|
submitter.as_json(SERIALIZE_PARAMS.merge(include: include_params)).merge(additional_attrs)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def serialize_events(events)
|
||||||
|
events.map do |event|
|
||||||
|
event.as_json(only: %i[id submitter_id event_type event_timestamp]).merge('data' => event.data.slice('reason'))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -5,7 +5,7 @@ module Submitters
|
|||||||
SERIALIZE_PARAMS = {
|
SERIALIZE_PARAMS = {
|
||||||
methods: %i[status application_key],
|
methods: %i[status application_key],
|
||||||
only: %i[id submission_id email phone name ua ip sent_at opened_at
|
only: %i[id submission_id email phone name ua ip sent_at opened_at
|
||||||
completed_at created_at updated_at external_id metadata]
|
completed_at declined_at created_at updated_at external_id metadata]
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
module_function
|
module_function
|
||||||
@@ -33,8 +33,8 @@ module Submitters
|
|||||||
'template' => submitter.template.as_json(only: %i[id name external_id created_at updated_at],
|
'template' => submitter.template.as_json(only: %i[id name external_id created_at updated_at],
|
||||||
methods: %i[folder_name]),
|
methods: %i[folder_name]),
|
||||||
'submission' => {
|
'submission' => {
|
||||||
**submitter.submission.slice(:id, :audit_log_url, :created_at),
|
**submitter.submission.slice(:id, :audit_log_url, :combined_document_url, :created_at),
|
||||||
status: submitter.submission.submitters.all?(&:completed_at?) ? 'completed' : 'pending',
|
status: build_submission_status(submitter.submission),
|
||||||
url: r.submissions_preview_url(submitter.submission.slug, **Docuseal.default_url_options)
|
url: r.submissions_preview_url(submitter.submission.slug, **Docuseal.default_url_options)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@@ -83,6 +83,18 @@ module Submitters
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def build_submission_status(submission)
|
||||||
|
submitters = submission.submitters
|
||||||
|
|
||||||
|
if submitters.all?(&:completed_at?)
|
||||||
|
'completed'
|
||||||
|
elsif submitters.any?(&:declined_at?)
|
||||||
|
'declined'
|
||||||
|
else
|
||||||
|
submission.expired? ? 'expired' : 'pending'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def build_documents_array(submitter)
|
def build_documents_array(submitter)
|
||||||
submitter.documents.map do |attachment|
|
submitter.documents.map do |attachment|
|
||||||
{ name: attachment.filename.base, url: rails_storage_proxy_url(attachment) }
|
{ name: attachment.filename.base, url: rails_storage_proxy_url(attachment) }
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ module Submitters
|
|||||||
assign_completed_attributes(submitter, request) if params[:completed] == 'true'
|
assign_completed_attributes(submitter, request) if params[:completed] == 'true'
|
||||||
|
|
||||||
ApplicationRecord.transaction do
|
ApplicationRecord.transaction do
|
||||||
|
maybe_set_signature_reason!(values, submitter, params)
|
||||||
validate_values!(values, submitter, params, request)
|
validate_values!(values, submitter, params, request)
|
||||||
|
|
||||||
SubmissionEvents.create_with_tracking_data(submitter, 'complete_form', request) if params[:completed] == 'true'
|
SubmissionEvents.create_with_tracking_data(submitter, 'complete_form', request) if params[:completed] == 'true'
|
||||||
@@ -59,6 +60,31 @@ module Submitters
|
|||||||
submitter
|
submitter
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def maybe_set_signature_reason!(values, submitter, params)
|
||||||
|
return if params[:with_reason].blank?
|
||||||
|
|
||||||
|
reason_field_uuid = params[:with_reason]
|
||||||
|
signature_field_uuid = values.except(reason_field_uuid).keys.first
|
||||||
|
|
||||||
|
signature_field = submitter.submission.template_fields.find { |e| e['uuid'] == signature_field_uuid }
|
||||||
|
|
||||||
|
signature_field['preferences'] ||= {}
|
||||||
|
signature_field['preferences']['reason_field_uuid'] = reason_field_uuid
|
||||||
|
|
||||||
|
unless submitter.submission.template_fields.find { |e| e['uuid'] == reason_field_uuid }
|
||||||
|
reason_field = { 'type' => 'text',
|
||||||
|
'uuid' => reason_field_uuid,
|
||||||
|
'name' => I18n.t(:reason),
|
||||||
|
'readonly' => true,
|
||||||
|
'submitter_uuid' => submitter.uuid }
|
||||||
|
|
||||||
|
submitter.submission.template_fields.insert(submitter.submission.template_fields.index(signature_field) + 1,
|
||||||
|
reason_field)
|
||||||
|
end
|
||||||
|
|
||||||
|
submitter.submission.save!
|
||||||
|
end
|
||||||
|
|
||||||
def normalized_values(params)
|
def normalized_values(params)
|
||||||
params.fetch(:values, {}).to_unsafe_h.transform_values do |v|
|
params.fetch(:values, {}).to_unsafe_h.transform_values do |v|
|
||||||
if params[:cast_boolean] == 'true'
|
if params[:cast_boolean] == 'true'
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
module Templates
|
module Templates
|
||||||
module SerializeForApi
|
module SerializeForApi
|
||||||
SERIALIZE_PARAMS = {
|
SERIALIZE_PARAMS = {
|
||||||
|
only: %w[
|
||||||
|
id archived_at fields name preferences schema
|
||||||
|
slug source submitters created_at updated_at
|
||||||
|
author_id external_id folder_id
|
||||||
|
],
|
||||||
methods: %i[application_key folder_name],
|
methods: %i[application_key folder_name],
|
||||||
include: { author: { only: %i[id email first_name last_name] } }
|
include: { author: { only: %i[id email first_name last_name] } }
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
"daisyui": "^3.9.4",
|
"daisyui": "^3.9.4",
|
||||||
"mathjs": "^12.4.0",
|
"mathjs": "^12.4.0",
|
||||||
"mini-css-extract-plugin": "^2.7.5",
|
"mini-css-extract-plugin": "^2.7.5",
|
||||||
"postcss": "^8.4.23",
|
"postcss": "^8.4.31",
|
||||||
"postcss-import": "^15.1.0",
|
"postcss-import": "^15.1.0",
|
||||||
"postcss-loader": "^7.3.0",
|
"postcss-loader": "^7.3.0",
|
||||||
"qr-creator": "^1.0.0",
|
"qr-creator": "^1.0.0",
|
||||||
|
|||||||
@@ -4,5 +4,9 @@ FactoryBot.define do
|
|||||||
factory :submitter do
|
factory :submitter do
|
||||||
submission
|
submission
|
||||||
email { Faker::Internet.email }
|
email { Faker::Internet.email }
|
||||||
|
|
||||||
|
before(:create) do |submitter, _|
|
||||||
|
submitter.account_id = submitter.submission.account_id
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -11,6 +11,12 @@ class SubmitterMailerPreview < ActionMailer::Preview
|
|||||||
SubmitterMailer.completed_email(submitter, User.last)
|
SubmitterMailer.completed_email(submitter, User.last)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def declined_email
|
||||||
|
submitter = Submitter.where.not(declined_at: nil).last
|
||||||
|
|
||||||
|
SubmitterMailer.declined_email(submitter, User.last)
|
||||||
|
end
|
||||||
|
|
||||||
def documents_copy_email
|
def documents_copy_email
|
||||||
submitter = Submitter.where.not(completed_at: nil).joins(:documents_attachments).last
|
submitter = Submitter.where.not(completed_at: nil).joins(:documents_attachments).last
|
||||||
|
|
||||||
|
|||||||
Loaded 100 of 102 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user