Compare commits

...
170 Commits
Author SHA1 Message Date
Alex Turchyn 9011e3f4b4 Merge from docusealco/wip 2026-01-12 13:25:54 +02:00
Pete Matsyburka 0b45ce5c0c update model 2026-01-12 12:05:54 +02:00
Pete Matsyburka a8ab93a4cc adjust sort 2026-01-12 11:27:19 +02:00
Pete Matsyburka d1768be636 secure env 2026-01-12 11:27:17 +02:00
Pete Matsyburka b2cd7c82a7 insert new field at page position 2026-01-11 14:45:42 +02:00
Pete Matsyburka b88d99afe0 merge preview docs 2026-01-11 11:09:00 +02:00
Pete Matsyburka 4523d38551 direct links option 2026-01-09 22:05:37 +02:00
Pete Matsyburka c4ba892559 refactor clone 2026-01-08 09:34:45 +02:00
Pete Matsyburka 40f8093e00 adjust onnx 2026-01-07 14:50:27 +02:00
Pete Matsyburka 4375459856 add nmm 2026-01-07 12:19:05 +02:00
Pete Matsyburka b3eb8a70bf fix submitter uuid 2026-01-07 00:01:47 +02:00
Pete Matsyburka 6245a487b6 add kba countdown 2026-01-06 11:24:30 +02:00
Pete Matsyburka a89f4c1b10 adjust trim 2026-01-06 10:22:34 +02:00
Pete Matsyburka 7df729b8b5 containment threshold 2026-01-06 09:04:25 +02:00
Pete Matsyburka f1db7c7e82 adjust trim 2026-01-06 08:54:29 +02:00
Alex Turchyn 00af69cbf2 Merge from docusealco/wip 2026-01-05 21:46:19 +02:00
Pete Matsyburka c6819a19bd adjust inference 2026-01-05 18:36:50 +02:00
Pete Matsyburka f5cbcb3d24 adjust kba 2026-01-05 13:45:41 +02:00
Pete Matsyburka 6ca75c53ef fix condition 2026-01-05 12:46:43 +02:00
Pete Matsyburka e0ec443e10 fix mysql migration 2026-01-05 12:34:50 +02:00
Pete Matsyburka 9eed2fc2ef fix 2026-01-05 12:21:34 +02:00
Pete Matsyburka b9c6d3ff9f model v2 2026-01-05 09:18:38 +02:00
Pete Matsyburka 03c25a89b2 fix save 2026-01-04 13:16:57 +02:00
Pete Matsyburka f5b4a0c5ab inference v2 2026-01-03 16:55:05 +02:00
Pete Matsyburka b10ed46ccc add kba 2026-01-02 17:02:45 +02:00
Pete Matsyburka c55036a1b1 update gem 2025-12-31 23:27:41 +02:00
Pete Matsyburka 962a5dade5 add preview url 2025-12-31 22:32:27 +02:00
Pete Matsyburka 369a09a6df fix upload 2025-12-26 12:13:30 +02:00
Pete Matsyburka e9a39e2571 add s3 endpoint variable 2025-12-25 14:03:57 +02:00
Pete Matsyburka 1cf9cc18f1 do not retry 2025-12-23 10:17:19 +02:00
Pete Matsyburka 1984d4ec8d fix sync 2025-12-22 20:31:00 +02:00
Alex Turchyn fa99b4ebdc Merge from docusealco/wip 2025-12-22 02:27:47 +02:00
Pete Matsyburka 83c793a2a5 reorder field options 2025-12-21 16:12:57 +02:00
Pete Matsyburka d078727070 recipient fields condition 2025-12-21 13:19:16 +02:00
Pete Matsyburka 0d8e2c5ff0 adjust signature size 2025-12-20 17:12:15 +02:00
Pete Matsyburka ea062d7494 update gem 2025-12-19 12:26:01 +02:00
Pete Matsyburka d525e0597a recipient fields config 2025-12-19 12:26:00 +02:00
Pete Matsyburka 964b5d4e74 validate webhook 2025-12-18 12:45:33 +02:00
Pete Matsyburka abf17eb09f localhost list 2025-12-18 12:12:40 +02:00
Pete Matsyburka 178809dad7 fix field render 2025-12-16 21:54:36 +02:00
Pete Matsyburka 881d189715 fix phone 2025-12-16 12:34:18 +02:00
Pete Matsyburka 48a8973910 add with field labels 2025-12-16 11:38:37 +02:00
Alex Turchyn ae891932c5 Merge from docusealco/wip 2025-12-15 13:19:09 +02:00
Alex Turchyn a8b5e00814 show field boxes on the submissions page 2025-12-15 12:05:37 +02:00
Alex Turchyn e98432d7e4 update docs 2025-12-15 11:11:00 +02:00
Pete Matsyburka 29ff58ed98 fix drawing 2025-12-15 10:22:27 +02:00
Pete Matsyburka a621575ffc 11k 2025-12-14 22:24:07 +02:00
Alex Turchyn d7c7efc203 update brakeman ignore rules 2025-12-12 21:44:54 +02:00
Pete Matsyburka 4f013ca927 do not combine with verification 2025-12-12 20:39:18 +02:00
Pete Matsyburka d9823feef7 fix option 2025-12-12 09:22:42 +02:00
Pete Matsyburka 676d775544 fix generation 2025-12-12 09:14:23 +02:00
Pete Matsyburka 840ad17258 fix locale 2025-12-11 11:11:46 +02:00
Alex Turchyn ce0cd09b70 add translations 2025-12-11 10:28:35 +02:00
Alex Turchyn bb752fbc00 update translations 2025-12-11 10:28:07 +02:00
Pete Matsyburka c71fb04404 fix mysql migration 2025-12-10 13:43:34 +02:00
Pete Matsyburka e856cf8787 validate redirect url 2025-12-10 09:13:55 +02:00
Pete Matsyburka 71aae65bc6 add require email 2fa param 2025-12-09 11:46:57 +02:00
Pete Matsyburka 7a33444f9b add invite_by 2025-12-09 11:39:15 +02:00
Pete Matsyburka e12ec9d986 fix build 2025-12-08 16:26:45 +02:00
Alex Turchyn 94d1fb7dcb Merge from docusealco/wip 2025-12-08 15:31:19 +02:00
Alex Turchyn 6e43a42274 add email 2FA 2025-12-08 14:51:49 +02:00
Pete Matsyburka 0e0aa0259e add validate prop 2025-12-07 15:31:20 +02:00
Pete Matsyburka 75ab6d39ef adjust unarchive 2025-12-07 14:57:21 +02:00
Pete Matsyburka 6f84d84f96 use newer model 2025-12-05 15:17:50 +02:00
Pete Matsyburka cf46593e9b fix required checbox 2025-12-04 21:41:36 +02:00
Pete Matsyburka 1808346348 fix build 2025-12-04 15:38:55 +02:00
Pete Matsyburka ea59a68499 adjust active job log 2025-12-04 14:54:55 +02:00
Pete Matsyburka cba2d02990 skip webhook not found 2025-12-03 13:20:52 +02:00
Pete Matsyburka e92fc0d3e1 adjust mobile field types 2025-12-03 10:33:22 +02:00
Pete Matsyburka f1eaa77092 password reset i18n 2025-12-02 14:25:45 +02:00
Alex Turchyn 5934bdec55 use set_reset_password_token 2025-12-02 14:00:51 +02:00
Alex Turchyn 7a7d3c6ee3 add translations for reset password instructions email 2025-12-02 14:00:51 +02:00
Pete Matsyburka cb2f58c04c fix i18n 2025-12-02 13:31:35 +02:00
Pete Matsyburka a1c117f1ca add i18n 2025-12-02 12:50:58 +02:00
Alex Turchyn 1aacd98460 Merge from docusealco/wip 2025-12-01 17:09:47 +02:00
Pete Matsyburka 840162c9ca fix sort 2025-12-01 10:37:58 +02:00
Pete Matsyburka 3519b0e009 fix typo 2025-12-01 10:15:23 +02:00
Pete Matsyburka 53fae56c51 fix regexp field types 2025-12-01 10:09:27 +02:00
Pete Matsyburka f4552dbaa8 skip reconfirmation 2025-11-30 16:30:56 +02:00
Pete Matsyburka dfab4c331c send confirmation 2025-11-30 16:04:30 +02:00
Pete Matsyburka d2a0937038 fix pdf text emoji 2025-11-30 14:37:05 +02:00
Pete Matsyburka fa1ef44b22 add tabs 2025-11-30 12:41:16 +02:00
Pete Matsyburka c1a5c91299 adjust detection 2025-11-30 11:11:08 +02:00
Pete Matsyburka e6280e8f5a optimize text nodes 2025-11-29 18:28:10 +02:00
Pete Matsyburka fd2ba57325 adjust invitation 2025-11-29 10:34:13 +02:00
Pete Matsyburka dc178ef03f adjust router 2025-11-28 16:15:57 +02:00
Alex Turchyn 68936e10c5 add confirmation columns 2025-11-28 15:57:36 +02:00
Pete Matsyburka 41f16e7d39 adjust detection 2025-11-27 17:00:26 +02:00
Pete Matsyburka 453ebbf90a adjust start form 2025-11-27 12:23:45 +02:00
Pete Matsyburka 7ca290c080 adjust detection 2025-11-25 13:43:35 +02:00
Alex Turchyn dd5b6a6aa6 Merge from docusealco/wip 2025-11-24 17:43:59 +02:00
Pete Matsyburka bf2ebb995b add tz info 2025-11-24 15:46:50 +02:00
Alex Turchyn 3e929758fb add the reports page 2025-11-24 15:46:04 +02:00
Pete Matsyburka 4a53116586 adjust links 2025-11-24 12:28:13 +02:00
Pete Matsyburka 2d1981acfa adjust billing link 2025-11-24 11:13:00 +02:00
Pete Matsyburka c610df269f adjust populate 2025-11-22 13:02:58 +02:00
Pete Matsyburka 96dac635f5 add us timezones 2025-11-21 17:50:04 +02:00
Pete Matsyburka abd579103d add index 2025-11-21 13:41:51 +02:00
Pete Matsyburka 7ed27bb413 populate columns 2025-11-21 12:33:43 +02:00
Pete Matsyburka 180c542a9f add index 2025-11-21 11:45:19 +02:00
Pete Matsyburka 89613113de set is first completed submitter 2025-11-21 11:31:02 +02:00
Pete Matsyburka 3102900776 add is first to completed submitters 2025-11-21 11:27:28 +02:00
Pete Matsyburka 1a68053f4e set submission event account id 2025-11-21 11:18:28 +02:00
Pete Matsyburka 5d4a032763 add submission event account id 2025-11-21 11:17:20 +02:00
Pete Matsyburka 7481d27822 add tsa timeout 2025-11-18 22:17:05 +02:00
Alex Turchyn 22afd01fd2 Merge from docusealco/wip 2025-11-17 13:20:44 +02:00
Pete Matsyburka fd9eb09dd6 use can? 2025-11-17 10:21:38 +02:00
Alex Turchyn c53ed7f984 add custom invitation reminder emails 2025-11-17 10:05:52 +02:00
Pete Matsyburka 1d87e210be optimize detect fields 2025-11-16 19:05:54 +02:00
Pete Matsyburka 5fec952b8c adjust detections 2025-11-15 19:48:42 +02:00
Pete Matsyburka c4fbcc103a autocorrect pdf 2025-11-15 10:46:54 +02:00
Pete Matsyburka 9333a1ba45 fix fields error alert 2025-11-14 16:35:02 +02:00
Pete Matsyburka de5cd92dba adjust send email 2025-11-13 19:36:06 +02:00
Pete Matsyburka 83e32bec9f fix preferences form 2025-11-13 10:34:52 +02:00
Pete Matsyburka 4603efc04e refactor toggles form 2025-11-13 09:50:26 +02:00
Alex Turchyn 6c73c82a27 add ability to reset custom template emails to default 2025-11-13 08:56:09 +02:00
Pete Matsyburka 8e71d9f9e9 skip email 2025-11-13 08:29:27 +02:00
Pete Matsyburka 80f60a5d88 re-invite archived user 2025-11-12 20:33:52 +02:00
Pete Matsyburka 2c33ec382d fix device icon 2025-11-12 16:48:33 +02:00
Pete Matsyburka 884865cffc adjust size 2025-11-12 16:39:29 +02:00
Alex Turchyn 9537fe8c91 update constants 2025-11-12 16:33:51 +02:00
Alex Turchyn c8fe36a2b6 add desktop/mobile/tablet badges to events log 2025-11-12 16:33:51 +02:00
Pete Matsyburka 7ec3282b56 i18n 2025-11-11 17:34:50 +02:00
Pete Matsyburka ab8c41a520 add signature reasons param 2025-11-11 13:42:01 +02:00
Pete Matsyburka 4c1c70ff04 fix audit generation 2025-11-11 12:08:16 +02:00
Pete Matsyburka d7a6e80bb1 html escape font signature 2025-11-11 11:11:07 +02:00
Alex Turchyn f87ef670d1 Merge from docusealco/wip 2025-11-10 13:08:28 +02:00
Pete Matsyburka daba2505bc fix detection 2025-11-09 21:33:47 +02:00
Pete Matsyburka 71528eda45 map page nodes 2025-11-09 08:51:00 +02:00
Pete Matsyburka 269e2beeaa fix preview 2025-11-07 10:20:41 +02:00
Pete Matsyburka 72dd2c6bc5 add template download 2025-11-05 12:07:11 +02:00
Pete Matsyburka 9758f7a15f adjust detection 2025-11-04 16:17:13 +02:00
Alex Turchyn 2521eb5a4a Merge from docusealco/wip 2025-11-03 20:16:45 +02:00
Pete Matsyburka bf6afc5e61 adjust detection 2025-11-03 19:24:09 +02:00
Pete Matsyburka 291d869843 adjust detect 2025-11-03 09:49:25 +02:00
Pete Matsyburka cdfecb2a8f fix role validation 2025-11-03 09:17:50 +02:00
Pete Matsyburka c0df8e0ec3 close doc 2025-11-02 08:57:58 +02:00
Pete Matsyburka a21f7d1653 fix padding 2025-11-02 08:13:40 +02:00
Pete Matsyburka 79e2514416 fix model name 2025-11-02 08:11:31 +02:00
Pete Matsyburka 80a7385183 fix redirect 2025-11-02 08:09:54 +02:00
Pete Matsyburka 1c8a7b6a7c detect fields 2025-11-02 08:09:54 +02:00
Pete Matsyburka b46ced2b6f add log 2025-10-31 10:26:10 +02:00
Pete Matsyburka 5ae479644e focus on canvas click 2025-10-31 10:18:39 +02:00
Pete Matsyburka cb66eb1293 fix redirect 2025-10-31 10:10:19 +02:00
Pete Matsyburka b4d5a2cad4 dangerous extension error 2025-10-30 08:47:01 +02:00
Pete Matsyburka 32691b0c0d add background 2025-10-29 10:10:04 +02:00
Pete Matsyburka 9163f744a3 remove sign up button 2025-10-27 20:03:33 +02:00
Pete Matsyburka 23ecce51a3 hide archived completed page 2025-10-22 22:03:39 +03:00
Pete Matsyburka 747ffa8cf1 adjust signature ID size 2025-10-15 13:38:53 +03:00
Alex Turchyn 4e230899ed Merge from docusealco/wip 2025-10-13 13:50:54 +03:00
Pete Matsyburka aff9f753c7 adjust style 2025-10-11 18:20:59 +03:00
Pete Matsyburka 1127fac500 update gem 2025-10-11 11:09:24 +03:00
Pete Matsyburka 7707e1cd2b adjust style 2025-10-11 10:58:09 +03:00
Pete Matsyburka 30274f7f1a fix sync button 2025-10-10 23:03:19 +03:00
Pete Matsyburka a5da6cc781 fix i18n 2025-10-10 14:04:27 +03:00
Pete Matsyburka 201e4010c5 fix german i18n 2025-10-10 13:15:41 +03:00
Pete Matsyburka b9bbdbffae fix french i18n 2025-10-10 11:01:01 +03:00
Alex Turchyn 9e8e1996e8 google drive file picker 2025-10-09 16:43:11 +03:00
Pete Matsyburka b99235397a update gem 2025-10-07 21:15:58 +03:00
Pete Matsyburka c0fd06daf3 adjust i18n 2025-10-07 13:57:36 +03:00
Pete Matsyburka 90536294df adjust i18n 2025-10-07 09:34:39 +03:00
Pete Matsyburka f8e9787675 fix edit email detailed 2025-10-07 08:59:01 +03:00
Pete Matsyburka bf9b785946 adjust i18n 2025-10-07 08:45:40 +03:00
Pete Matsyburka dab3a6f031 fix typo 2025-10-06 21:45:46 +03:00
Pete Matsyburka 88466193c5 fix i18n 2025-10-06 20:05:14 +03:00
Pete Matsyburka c2f7601dad update readme 2025-10-06 18:44:29 +03:00
Pete Matsyburka 189f7b2d7b add dutch langauge 2025-10-06 17:43:51 +03:00
Pete Matsyburka 5d87160ee9 fix rubocop 2025-10-04 18:33:37 +03:00
Pete Matsyburka 0cdcdb8898 update rubocop 2025-10-01 13:31:40 +03:00
Pete Matsyburka c20619b5c8 adjust completed email delivery 2025-09-30 13:49:45 +03:00
211 changed files with 31927 additions and 28086 deletions

No files matched your search

+7 -22
View File
@@ -1,27 +1,14 @@
name: Build Docker Images name: Build Docker Images
on: on:
workflow_dispatch: push:
inputs: tags:
version: - "*.*.*"
description: Version
type: string
required: true
image:
description: QEMU image
type: string
required: false
default: tonistiigi/binfmt:latest
os:
description: OS
type: string
required: false
default: ubuntu-24.04-arm
jobs: jobs:
build: build:
runs-on: ${{ inputs.os }} runs-on: ubuntu-24.04-arm
timeout-minutes: 20 timeout-minutes: 30
steps: steps:
- name: Checkout code - name: Checkout code
@@ -34,18 +21,16 @@ jobs:
uses: docker/metadata-action@v4 uses: docker/metadata-action@v4
with: with:
images: docuseal/docuseal images: docuseal/docuseal
tags: latest,${{ inputs.version }} tags: type=semver,pattern={{version}}
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
with:
image: ${{ inputs.image }}
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Create .version file - name: Create .version file
run: echo ${{ inputs.version }} > .version run: echo ${{ github.ref_name }} > .version
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@v3
+1
View File
@@ -37,3 +37,4 @@ yarn-debug.log*
/docuseal /docuseal
/ee /ee
dump.rdb dump.rdb
*.onnx
+12
View File
@@ -42,6 +42,18 @@ Metrics/CyclomaticComplexity:
Metrics/PerceivedComplexity: Metrics/PerceivedComplexity:
Max: 15 Max: 15
Style/MultipleComparison:
Enabled: false
Style/NumericPredicate:
Enabled: false
Style/MinMaxComparison:
Enabled: false
Naming/PredicateMethod:
Enabled: false
Layout/LineLength: Layout/LineLength:
AllowedPatterns: ['\A\s*#'] AllowedPatterns: ['\A\s*#']
+12 -3
View File
@@ -9,6 +9,7 @@ RUN apk --no-cache add fontforge wget && \
wget https://cdn.jsdelivr.net/gh/notofonts/notofonts.github.io/fonts/NotoSansSymbols2/hinted/ttf/NotoSansSymbols2-Regular.ttf && \ 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/Maxattax97/gnu-freefont/raw/master/ttf/FreeSans.ttf && \
wget https://github.com/impallari/DancingScript/raw/master/OFL.txt && \ wget https://github.com/impallari/DancingScript/raw/master/OFL.txt && \
wget -O /model.onnx "https://github.com/docusealco/fields-detection/releases/download/2.1.0/model_704_int8.onnx" && \
wget -O pdfium-linux.tgz "https://github.com/docusealco/pdfium-binaries/releases/latest/download/pdfium-linux-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tgz" && \ wget -O pdfium-linux.tgz "https://github.com/docusealco/pdfium-binaries/releases/latest/download/pdfium-linux-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tgz" && \
mkdir -p /pdfium-linux && \ mkdir -p /pdfium-linux && \
tar -xzf pdfium-linux.tgz -C /pdfium-linux tar -xzf pdfium-linux.tgz -C /pdfium-linux
@@ -50,7 +51,9 @@ ENV OPENSSL_CONF=/app/openssl_legacy.cnf
WORKDIR /app WORKDIR /app
RUN echo '@edge https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && apk add --no-cache sqlite-dev libpq-dev mariadb-dev vips-dev@edge yaml-dev redis libheif@edge vips-heif@edge gcompat ttf-freefont && mkdir /fonts && rm /usr/share/fonts/freefont/FreeSans.otf RUN apk add --no-cache sqlite-dev libpq-dev mariadb-dev vips-dev yaml-dev redis libheif vips-heif gcompat ttf-freefont && mkdir /fonts && rm /usr/share/fonts/freefont/FreeSans.otf
RUN addgroup -g 2000 docuseal && adduser -u 2000 -G docuseal -s /bin/sh -D -h /home/docuseal docuseal
RUN echo $'.include = /etc/ssl/openssl.cnf\n\ RUN echo $'.include = /etc/ssl/openssl.cnf\n\
\n\ \n\
@@ -66,7 +69,9 @@ activate = 1' >> /app/openssl_legacy.cnf
COPY ./Gemfile ./Gemfile.lock ./ COPY ./Gemfile ./Gemfile.lock ./
RUN apk add --no-cache build-base && bundle install && apk del --no-cache build-base && rm -rf ~/.bundle /usr/local/bundle/cache && ruby -e "puts Dir['/usr/local/bundle/**/{spec,rdoc,resources/shared,resources/collation,resources/locales}']" | xargs rm -rf RUN apk add --no-cache build-base && bundle install && apk del --no-cache build-base && rm -rf ~/.bundle /usr/local/bundle/cache && ruby -e "puts Dir['/usr/local/bundle/**/{spec,rdoc,resources/shared,resources/collation,resources/locales}']" | xargs rm -rf && ln -sf /usr/lib/libonnxruntime.so.1 $(ruby -e "print Dir[Gem::Specification.find_by_name('onnxruntime').gem_dir + '/vendor/*.so'].first")
RUN echo 'https://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories && echo 'https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && apk add --no-cache onnxruntime
COPY ./bin ./bin COPY ./bin ./bin
COPY ./app ./app COPY ./app ./app
@@ -83,12 +88,16 @@ COPY --from=download /fonts/GoNotoKurrent-Regular.ttf /fonts/GoNotoKurrent-Bold.
COPY --from=download /fonts/FreeSans.ttf /usr/share/fonts/freefont COPY --from=download /fonts/FreeSans.ttf /usr/share/fonts/freefont
COPY --from=download /pdfium-linux/lib/libpdfium.so /usr/lib/libpdfium.so COPY --from=download /pdfium-linux/lib/libpdfium.so /usr/lib/libpdfium.so
COPY --from=download /pdfium-linux/licenses/pdfium.txt /usr/lib/libpdfium-LICENSE.txt COPY --from=download /pdfium-linux/licenses/pdfium.txt /usr/lib/libpdfium-LICENSE.txt
COPY --from=download /model.onnx /app/tmp/model.onnx
COPY --from=webpack /app/public/packs ./public/packs COPY --from=webpack /app/public/packs ./public/packs
RUN ln -s /fonts /app/public/fonts RUN ln -s /fonts /app/public/fonts
RUN bundle exec bootsnap precompile --gemfile app/ lib/ RUN bundle exec bootsnap precompile -j 1 --gemfile app/ lib/
RUN chown -R docuseal:docuseal /app
WORKDIR /data/docuseal WORKDIR /data/docuseal
ENV HOME=/home/docuseal
ENV WORKDIR=/data/docuseal ENV WORKDIR=/data/docuseal
EXPOSE 3000 EXPOSE 3000
+2
View File
@@ -24,7 +24,9 @@ gem 'image_processing'
gem 'jwt' gem 'jwt'
gem 'lograge' gem 'lograge'
gem 'mysql2', require: false gem 'mysql2', require: false
gem 'numo-narray'
gem 'oj' gem 'oj'
gem 'onnxruntime'
gem 'pagy' gem 'pagy'
gem 'pg', require: false gem 'pg', require: false
gem 'premailer-rails' gem 'premailer-rails'
+42 -24
View File
@@ -76,25 +76,28 @@ GEM
public_suffix (>= 2.0.2, < 7.0) public_suffix (>= 2.0.2, < 7.0)
annotaterb (4.14.0) annotaterb (4.14.0)
arabic-letter-connector (0.1.1) arabic-letter-connector (0.1.1)
ast (2.4.2) ast (2.4.3)
aws-eventstream (1.3.0) aws-eventstream (1.4.0)
aws-partitions (1.1027.0) aws-partitions (1.1197.0)
aws-sdk-core (3.214.0) aws-sdk-core (3.240.0)
aws-eventstream (~> 1, >= 1.3.0) aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0) aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9) aws-sigv4 (~> 1.9)
base64
bigdecimal
jmespath (~> 1, >= 1.6.1) jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.96.0) logger
aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (1.118.0)
aws-sdk-core (~> 3, >= 3.239.1)
aws-sigv4 (~> 1.5) aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.176.1) aws-sdk-s3 (1.208.0)
aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-core (~> 3, >= 3.234.0)
aws-sdk-kms (~> 1) aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5) aws-sigv4 (~> 1.5)
aws-sdk-secretsmanager (1.110.0) aws-sdk-secretsmanager (1.110.0)
aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5) aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.1) aws-sigv4 (1.12.1)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
azure-storage-blob (2.0.3) azure-storage-blob (2.0.3)
azure-storage-common (~> 2.0) azure-storage-common (~> 2.0)
@@ -291,10 +294,10 @@ GEM
rdoc (>= 4.0.0) rdoc (>= 4.0.0)
reline (>= 0.4.2) reline (>= 0.4.2)
jmespath (1.6.2) jmespath (1.6.2)
json (2.13.2) json (2.15.0)
jwt (2.9.3) jwt (2.9.3)
base64 base64
language_server-protocol (3.17.0.3) language_server-protocol (3.17.0.5)
launchy (3.0.1) launchy (3.0.1)
addressable (~> 2.8) addressable (~> 2.8)
childprocess (~> 5.0) childprocess (~> 5.0)
@@ -305,6 +308,7 @@ GEM
letter_opener (~> 1.9) letter_opener (~> 1.9)
railties (>= 6.1) railties (>= 6.1)
rexml rexml
lint_roller (1.1.0)
logger (1.7.0) logger (1.7.0)
lograge (0.14.0) lograge (0.14.0)
actionpack (>= 4) actionpack (>= 4)
@@ -356,17 +360,26 @@ GEM
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.18.9-x86_64-linux-musl) nokogiri (1.18.9-x86_64-linux-musl)
racc (~> 1.4) racc (~> 1.4)
numo-narray (0.9.2.1)
oj (3.16.11) oj (3.16.11)
bigdecimal (>= 3.0) bigdecimal (>= 3.0)
ostruct (>= 0.2) ostruct (>= 0.2)
onnxruntime (0.10.1)
ffi
onnxruntime (0.10.1-aarch64-linux)
ffi
onnxruntime (0.10.1-arm64-darwin)
ffi
onnxruntime (0.10.1-x86_64-linux)
ffi
openssl (3.3.0) openssl (3.3.0)
orm_adapter (0.5.0) orm_adapter (0.5.0)
os (1.1.4) os (1.1.4)
ostruct (0.6.3) ostruct (0.6.3)
package_json (0.1.0) package_json (0.1.0)
pagy (9.3.3) pagy (9.3.3)
parallel (1.26.3) parallel (1.27.0)
parser (3.3.6.0) parser (3.3.9.0)
ast (~> 2.4.1) ast (~> 2.4.1)
racc racc
pg (1.5.9) pg (1.5.9)
@@ -383,6 +396,7 @@ GEM
pretender (0.5.0) pretender (0.5.0)
actionpack (>= 6.1) actionpack (>= 6.1)
prettyprint (0.2.0) prettyprint (0.2.0)
prism (1.5.1)
pry (0.15.0) pry (0.15.0)
coderay (~> 1.1) coderay (~> 1.1)
method_source (~> 1.0) method_source (~> 1.0)
@@ -395,7 +409,7 @@ GEM
puma (6.5.0) puma (6.5.0)
nio4r (~> 2.0) nio4r (~> 2.0)
racc (1.8.1) racc (1.8.1)
rack (3.2.0) rack (3.2.3)
rack-proxy (0.7.7) rack-proxy (0.7.7)
rack rack
rack-session (2.1.1) rack-session (2.1.1)
@@ -448,7 +462,7 @@ GEM
psych (>= 4.0.0) psych (>= 4.0.0)
redis-client (0.23.0) redis-client (0.23.0)
connection_pool connection_pool
regexp_parser (2.9.3) regexp_parser (2.11.3)
reline (0.6.2) reline (0.6.2)
io-console (~> 0.5) io-console (~> 0.5)
representable (3.2.0) representable (3.2.0)
@@ -485,18 +499,20 @@ GEM
rspec-mocks (~> 3.13) rspec-mocks (~> 3.13)
rspec-support (~> 3.13) rspec-support (~> 3.13)
rspec-support (3.13.2) rspec-support (3.13.2)
rubocop (1.69.2) rubocop (1.81.1)
json (~> 2.3) json (~> 2.3)
language_server-protocol (>= 3.17.0) language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 3.3.0.2) parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0) regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0) rubocop-ast (>= 1.47.1, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0) unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0) rubocop-ast (1.47.1)
parser (>= 3.3.1.0) parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-performance (1.23.0) rubocop-performance (1.23.0)
rubocop (>= 1.48.1, < 2.0) rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0)
@@ -567,11 +583,11 @@ GEM
tzinfo-data (1.2024.2) tzinfo-data (1.2024.2)
tzinfo (>= 1.0.0) tzinfo (>= 1.0.0)
uber (0.1.0) uber (0.1.0)
unicode-display_width (3.1.2) unicode-display_width (3.2.0)
unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (~> 4.1)
unicode-emoji (4.0.4) unicode-emoji (4.1.0)
uniform_notifier (1.16.0) uniform_notifier (1.16.0)
uri (1.0.3) uri (1.1.1)
useragent (0.16.11) useragent (0.16.11)
warden (1.2.9) warden (1.2.9)
rack (>= 2.0.9) rack (>= 2.0.9)
@@ -634,7 +650,9 @@ DEPENDENCIES
letter_opener_web letter_opener_web
lograge lograge
mysql2 mysql2
numo-narray
oj oj
onnxruntime
pagy pagy
pg pg
premailer-rails premailer-rails
+1 -1
View File
@@ -42,7 +42,7 @@ DocuSeal is an open source platform that provides secure and efficient digital d
- PDF signature verification - PDF signature verification
- Users management - Users management
- Mobile-optimized - Mobile-optimized
- 6 UI languages with signing available in 14 languages - 7 UI languages with signing available in 14 languages
- API and Webhooks for integrations - API and Webhooks for integrations
- Easy to deploy in minutes - Easy to deploy in minutes
+4 -1
View File
@@ -8,7 +8,8 @@ class AccountsController < ApplicationController
'es-ES' => 'Español', 'es-ES' => 'Español',
'pt-PT' => 'Português', 'pt-PT' => 'Português',
'de-DE' => 'Deutsch', 'de-DE' => 'Deutsch',
'it-IT' => 'Italiano' 'it-IT' => 'Italiano',
'nl-NL' => 'Nederlands'
}.freeze }.freeze
before_action :load_account before_action :load_account
@@ -45,7 +46,9 @@ class AccountsController < ApplicationController
def destroy def destroy
authorize!(:manage, current_account) authorize!(:manage, current_account)
true_user.skip_reconfirmation!
true_user.update!(locked_at: Time.current, email: true_user.email.sub('@', '+removed@')) true_user.update!(locked_at: Time.current, email: true_user.email.sub('@', '+removed@'))
true_user.account.update!(archived_at: Time.current)
# rubocop:disable Layout/LineLength # rubocop:disable Layout/LineLength
render turbo_stream: turbo_stream.replace( render turbo_stream: turbo_stream.replace(
@@ -34,6 +34,10 @@ module Api
end end
render json: attachment.as_json(only: %i[uuid created_at], methods: %i[url filename content_type]) render json: attachment.as_json(only: %i[uuid created_at], methods: %i[url filename content_type])
rescue Submitters::MaliciousFileExtension => e
Rollbar.error(e) if defined?(Rollbar)
render json: { error: e.message }, status: :unprocessable_content
end end
def build_new_cookie_signatures_json(submitter, attachment) def build_new_cookie_signatures_json(submitter, attachment)
@@ -5,34 +5,17 @@ module Api
load_and_authorize_resource :submission load_and_authorize_resource :submission
def index def index
is_merge = params[:merge] == 'true' &&
(@submission.schema_documents || @submission.template.schema_documents).size > 1
documents = documents =
if @submission.submitters.all?(&:completed_at?) if @submission.submitters.all?(&:completed_at?)
last_submitter = @submission.submitters.max_by(&:completed_at) build_completed_documents(@submission, merge: is_merge)
if last_submitter.documents_attachments.blank?
last_submitter.documents_attachments = Submissions::EnsureResultGenerated.call(last_submitter)
end
last_submitter.documents_attachments
else else
values_hash = Submissions::GeneratePreviewAttachments.build_values_hash(@submission) build_preview_documents(@submission, merge: is_merge)
if @submission.preview_documents.present? &&
@submission.preview_documents.all? { |s| s.metadata['values_hash'] == values_hash }
@submission.preview_documents
else
ApplicationRecord.no_touching do
@submission.preview_documents.each(&:destroy)
end
Submissions::GeneratePreviewAttachments.call(@submission, values_hash:)
end
end end
ActiveRecord::Associations::Preloader.new( ActiveRecord::Associations::Preloader.new(records: documents, associations: [:blob]).call
records: documents,
associations: [:blob]
).call
expires_at = Accounts.link_expires_at(current_account) expires_at = Accounts.link_expires_at(current_account)
@@ -43,5 +26,50 @@ module Api
end end
} }
end end
private
def build_completed_documents(submission, merge: false)
last_submitter = submission.submitters.max_by(&:completed_at)
if merge
if submission.merged_document_attachment.blank?
submission.merged_document_attachment =
Submissions::GenerateCombinedAttachment.call(last_submitter, with_audit: false)
end
[submission.merged_document_attachment]
else
if last_submitter.documents_attachments.blank?
last_submitter.documents_attachments = Submissions::EnsureResultGenerated.call(last_submitter)
end
last_submitter.documents_attachments
end
end
def build_preview_documents(submission, merge: false)
values_hash = Submissions::GeneratePreviewAttachments.build_values_hash(submission)
if merge
if submission.preview_merged_document_attachment.present? &&
submission.preview_merged_document_attachment.metadata['values_hash'] == values_hash
[submission.preview_merged_document_attachment]
else
ApplicationRecord.no_touching { submission.preview_merged_document_attachment&.destroy }
Submissions::GeneratePreviewAttachments.call(submission, values_hash:, merge: true)
end
elsif submission.preview_documents.present? &&
submission.preview_documents.all? { |s| s.metadata['values_hash'] == values_hash }
submission.preview_documents
else
ApplicationRecord.no_touching do
submission.preview_documents.each(&:destroy)
end
Submissions::GeneratePreviewAttachments.call(submission, values_hash:)
end
end
end end
end end
@@ -147,7 +147,7 @@ module Api
is_send_email = !params[:send_email].in?(['false', false]) is_send_email = !params[:send_email].in?(['false', false])
if (emails = (params[:emails] || params[:email]).presence) && if (emails = (params[:emails] || params[:email]).presence) &&
(params[:submission].blank? && params[:submitters].blank?) params[:submission].blank? && params[:submitters].blank?
Submissions.create_from_emails(template:, Submissions.create_from_emails(template:,
user: current_user, user: current_user,
source: :api, source: :api,
@@ -182,13 +182,13 @@ module Api
def submissions_params def submissions_params
permitted_attrs = [ permitted_attrs = [
:send_email, :send_sms, :bcc_completed, :completed_redirect_url, :reply_to, :go_to_last, :send_email, :send_sms, :bcc_completed, :completed_redirect_url, :reply_to, :go_to_last,
:require_phone_2fa, :expire_at, :name, :require_phone_2fa, :require_email_2fa, :expire_at, :name,
{ {
variables: {}, variables: {},
message: %i[subject body], message: %i[subject body],
submitters: [[:send_email, :send_sms, :completed_redirect_url, :uuid, :name, :email, :role, submitters: [[:send_email, :send_sms, :completed_redirect_url, :uuid, :name, :email, :role,
:completed, :phone, :application_key, :external_id, :reply_to, :go_to_last, :completed, :phone, :application_key, :external_id, :reply_to, :go_to_last,
:require_phone_2fa, :order, :require_phone_2fa, :require_email_2fa, :order, :invite_by,
{ metadata: {}, values: {}, roles: [], readonly_fields: [], message: %i[subject body], { metadata: {}, values: {}, roles: [], readonly_fields: [], message: %i[subject body],
fields: [:name, :uuid, :default_value, :value, :title, :description, fields: [:name, :uuid, :default_value, :value, :title, :description,
:readonly, :required, :validation_pattern, :invalid_message, :readonly, :required, :validation_pattern, :invalid_message,
+1 -1
View File
@@ -84,7 +84,7 @@ module Api
submitter_params.permit( submitter_params.permit(
:send_email, :send_sms, :reply_to, :completed_redirect_url, :uuid, :name, :email, :role, :send_email, :send_sms, :reply_to, :completed_redirect_url, :uuid, :name, :email, :role,
:completed, :phone, :application_key, :external_id, :go_to_last, :require_phone_2fa, :completed, :phone, :application_key, :external_id, :go_to_last, :require_phone_2fa, :require_email_2fa,
{ metadata: {}, values: {}, readonly_fields: [], message: %i[subject body], { metadata: {}, values: {}, readonly_fields: [], message: %i[subject body],
fields: [[:name, :uuid, :default_value, :value, :required, fields: [[:name, :uuid, :default_value, :value, :required,
:readonly, :validation_pattern, :invalid_message, :readonly, :validation_pattern, :invalid_message,
@@ -17,6 +17,7 @@ class ApplicationController < ActionController::Base
helper_method :button_title, helper_method :button_title,
:current_account, :current_account,
:true_ability,
:form_link_host, :form_link_host,
:svg_icon :svg_icon
@@ -102,6 +103,10 @@ class ApplicationController < ActionController::Base
current_user&.account current_user&.account
end end
def true_ability
@true_ability ||= Ability.new(true_user)
end
def maybe_redirect_to_setup def maybe_redirect_to_setup
redirect_to setup_index_path unless User.exists? redirect_to setup_index_path unless User.exists?
end end
@@ -17,8 +17,10 @@ class ConsoleRedirectController < ApplicationController
scope: :console, scope: :console,
exp: 1.minute.from_now.to_i) exp: 1.minute.from_now.to_i)
path = Addressable::URI.parse(params[:redir]).path if params[:redir].to_s.starts_with?(Docuseal::CONSOLE_URL) redir_uri = Addressable::URI.parse(params[:redir])
path = redir_uri.path if params[:redir].to_s.starts_with?(Docuseal::CONSOLE_URL)
redirect_to("#{Docuseal::CONSOLE_URL}#{path}?#{{ auth: }.to_query}", allow_other_host: true) redirect_to "#{Docuseal::CONSOLE_URL}#{path}?#{{ **redir_uri&.query_values, 'auth' => auth }.to_query}",
allow_other_host: true
end end
end end
@@ -1,4 +1,11 @@
# frozen_string_literal: true # frozen_string_literal: true
class InvitationsController < Devise::PasswordsController class InvitationsController < Devise::PasswordsController
def update
super do |resource|
resource.confirmed_at ||= Time.current if resource.errors.empty?
PasswordsController::Current.user = resource
end
end
end end
+2
View File
@@ -5,6 +5,8 @@ class PasswordsController < Devise::PasswordsController
skip_before_action :require_no_authentication, only: %i[edit update] skip_before_action :require_no_authentication, only: %i[edit update]
# rubocop:enable Rails/LexicallyScopedActionFilter # rubocop:enable Rails/LexicallyScopedActionFilter
around_action :with_browser_locale
class Current < ActiveSupport::CurrentAttributes class Current < ActiveSupport::CurrentAttributes
attribute :user attribute :user
end end
@@ -4,6 +4,7 @@ class PersonalizationSettingsController < ApplicationController
ALLOWED_KEYS = [ ALLOWED_KEYS = [
AccountConfig::FORM_COMPLETED_BUTTON_KEY, AccountConfig::FORM_COMPLETED_BUTTON_KEY,
AccountConfig::SUBMITTER_INVITATION_EMAIL_KEY, AccountConfig::SUBMITTER_INVITATION_EMAIL_KEY,
AccountConfig::SUBMITTER_INVITATION_REMINDER_EMAIL_KEY,
AccountConfig::SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY, AccountConfig::SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY,
AccountConfig::SUBMITTER_COMPLETED_EMAIL_KEY, AccountConfig::SUBMITTER_COMPLETED_EMAIL_KEY,
AccountConfig::FORM_COMPLETED_MESSAGE_KEY, AccountConfig::FORM_COMPLETED_MESSAGE_KEY,
+8 -1
View File
@@ -9,7 +9,14 @@ class ProfileController < ApplicationController
def update_contact def update_contact
if current_user.update(contact_params) if current_user.update(contact_params)
redirect_to settings_profile_index_path, notice: I18n.t('contact_information_has_been_update') if current_user.try(:pending_reconfirmation?) && current_user.previous_changes.key?(:unconfirmed_email)
SendConfirmationInstructionsJob.perform_async('user_id' => current_user.id)
redirect_to settings_profile_index_path,
notice: I18n.t('a_confirmation_email_has_been_sent_to_the_new_email_address')
else
redirect_to settings_profile_index_path, notice: I18n.t('contact_information_has_been_update')
end
else else
render :index, status: :unprocessable_content render :index, status: :unprocessable_content
end end
@@ -29,7 +29,7 @@ class SendSubmissionEmailController < ApplicationController
RateLimit.call("send-email-#{@submitter.id}", limit: 2, ttl: 5.minutes) RateLimit.call("send-email-#{@submitter.id}", limit: 2, ttl: 5.minutes)
SubmitterMailer.documents_copy_email(@submitter, sig: true).deliver_later! unless already_sent?(@submitter) SubmitterMailer.documents_copy_email(@submitter, sig: true).deliver_later! if can_send?(@submitter)
respond_to do |f| respond_to do |f|
f.html { render :success } f.html { render :success }
@@ -39,8 +39,11 @@ class SendSubmissionEmailController < ApplicationController
private private
def already_sent?(submitter) def can_send?(submitter)
EmailEvent.exists?(tag: :submitter_documents_copy, email: submitter.email, emailable: submitter, return false if submitter.account.archived_at?
event_type: :send, created_at: SEND_DURATION.ago..Time.current) return false if EmailEvent.exists?(tag: :submitter_documents_copy, email: submitter.email, emailable: submitter,
event_type: :send, created_at: SEND_DURATION.ago..Time.current)
true
end end
end end
+4 -2
View File
@@ -16,7 +16,9 @@ class StartFormController < ApplicationController
COOKIES_DEFAULTS = { httponly: true, secure: Rails.env.production? }.freeze COOKIES_DEFAULTS = { httponly: true, secure: Rails.env.production? }.freeze
def show def show
raise ActionController::RoutingError, I18n.t('not_found') if @template.preferences['require_phone_2fa'] if @template.preferences['require_phone_2fa'] || @template.preferences['require_email_2fa']
raise ActionController::RoutingError, I18n.t('not_found')
end
if @template.shared_link? if @template.shared_link?
@submitter = @template.submissions.new(account_id: @template.account_id) @submitter = @template.submissions.new(account_id: @template.account_id)
@@ -81,7 +83,7 @@ class StartFormController < ApplicationController
@submitter = Submitter.where(submission: @template.submissions) @submitter = Submitter.where(submission: @template.submissions)
.where.not(completed_at: nil) .where.not(completed_at: nil)
.find_by!(required_params) .find_by!(required_params.except('name'))
end end
private private
@@ -10,6 +10,7 @@ class SubmissionEventsController < ApplicationController
'api_complete_form' => 'check', 'api_complete_form' => 'check',
'send_reminder_email' => 'mail_forward', 'send_reminder_email' => 'mail_forward',
'send_2fa_sms' => '2fa', 'send_2fa_sms' => '2fa',
'send_2fa_email' => '2fa',
'send_sms' => 'send', 'send_sms' => 'send',
'phone_verified' => 'phone_check', 'phone_verified' => 'phone_check',
'email_verified' => 'email_check', 'email_verified' => 'email_check',
+11 -2
View File
@@ -12,6 +12,14 @@ class SubmissionsController < ApplicationController
authorize!(:create, Submission) authorize!(:create, Submission)
end end
FIELD_ICONS = {
'text' => 'text_size', 'signature' => 'writing_sign', 'date' => 'calendar_event',
'number' => 'square_number_1', 'image' => 'photo', 'initials' => 'letter_case_upper',
'file' => 'paperclip', 'select' => 'select', 'checkbox' => 'checkbox', 'radio' => 'circle_dot',
'stamp' => 'rubber_stamp', 'cells' => 'columns_3', 'multiple' => 'checks', 'phone' => 'phone_check',
'payment' => 'credit_card', 'verification' => 'id', 'kba' => 'user_scan'
}.freeze
def show def show
@submission = Submissions.preload_with_pages(@submission) @submission = Submissions.preload_with_pages(@submission)
@@ -45,14 +53,15 @@ class SubmissionsController < ApplicationController
else else
submissions_attrs = submissions_params[:submission].to_h.values submissions_attrs = submissions_params[:submission].to_h.values
submissions_attrs, = submissions_attrs, _, new_fields =
Submissions::NormalizeParamUtils.normalize_submissions_params!(submissions_attrs, @template) Submissions::NormalizeParamUtils.normalize_submissions_params!(submissions_attrs, @template, add_fields: true)
Submissions.create_from_submitters(template: @template, Submissions.create_from_submitters(template: @template,
user: current_user, user: current_user,
source: :invite, source: :invite,
submitters_order: params[:preserve_order] == '1' ? 'preserved' : 'random', submitters_order: params[:preserve_order] == '1' ? 'preserved' : 'random',
submissions_attrs:, submissions_attrs:,
new_fields:,
params: params.merge('send_completed_email' => true)) params: params.merge('send_completed_email' => true))
end end
@@ -41,6 +41,9 @@ class SubmissionsPreviewController < ApplicationController
def completed def completed
@submission = Submission.find_by!(slug: params[:submissions_preview_slug]) @submission = Submission.find_by!(slug: params[:submissions_preview_slug])
raise ActionController::RoutingError, I18n.t('not_found') if @submission.account.archived_at?
@template = @submission.template @template = @submission.template
render :completed, layout: 'form' render :completed, layout: 'form'
@@ -50,8 +53,11 @@ class SubmissionsPreviewController < ApplicationController
def use_signature?(submission) def use_signature?(submission)
return false if current_user && can?(:read, submission) return false if current_user && can?(:read, submission)
return true if submission.submitters.any? { |e| e.preferences['require_phone_2fa'] } return true if submission.submitters.any? do |e|
e.preferences['require_phone_2fa'] || e.preferences['require_email_2fa']
end
return true if submission.template&.preferences&.dig('require_phone_2fa') return true if submission.template&.preferences&.dig('require_phone_2fa')
return true if submission.template&.preferences&.dig('require_email_2fa')
!submission_valid_ttl?(submission) !submission_valid_ttl?(submission)
end end
+19 -1
View File
@@ -17,6 +17,7 @@ class SubmitFormController < ApplicationController
submission = @submitter.submission submission = @submitter.submission
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 :email_2fa if require_email_2fa?(@submitter)
@form_configs = Submitters::FormConfigs.call(@submitter, CONFIG_KEYS) @form_configs = Submitters::FormConfigs.call(@submitter, CONFIG_KEYS)
@@ -47,6 +48,11 @@ class SubmitFormController < ApplicationController
end end
def update def update
if require_email_2fa?(@submitter)
return render json: { error: I18n.t('verification_required_refresh_the_page_and_pass_2fa') },
status: :unprocessable_content
end
if @submitter.completed_at? if @submitter.completed_at?
return render json: { error: I18n.t('form_has_been_completed_already') }, status: :unprocessable_content return render json: { error: I18n.t('form_has_been_completed_already') }, status: :unprocessable_content
end end
@@ -75,7 +81,11 @@ class SubmitFormController < ApplicationController
render json: { error: e.message }, status: :unprocessable_content render json: { error: e.message }, status: :unprocessable_content
end end
def completed; end def completed
raise ActionController::RoutingError, I18n.t('not_found') if @submitter.account.archived_at?
redirect_to submit_form_path(params[:submit_form_slug]) if require_email_2fa?(@submitter)
end
def success; end def success; end
@@ -107,4 +117,12 @@ class SubmitFormController < ApplicationController
ActiveStorage::Attachment.where(record: submission.submitters, name: :attachments) ActiveStorage::Attachment.where(record: submission.submitters, name: :attachments)
.preload(:blob).index_by(&:uuid) .preload(:blob).index_by(&:uuid)
end end
def require_email_2fa?(submitter)
return false if submitter.submission.template&.preferences&.dig('require_email_2fa') != true &&
submitter.preferences['require_email_2fa'] != true
return false if cookies.encrypted[:email_2fa_slug] == submitter.slug
true
end
end end
@@ -0,0 +1,52 @@
# frozen_string_literal: true
class SubmitFormEmail2fasController < ApplicationController
around_action :with_browser_locale
skip_before_action :authenticate_user!
skip_authorization_check
before_action :load_submitter
COOKIES_TTL = 12.hours
COOKIES_DEFAULTS = { httponly: true, secure: Rails.env.production? }.freeze
def create
RateLimit.call("verify-2fa-code-#{@submitter.id}", limit: 2, ttl: 45.seconds, enabled: true)
value = [@submitter.email.downcase.strip, @submitter.slug].join(':')
if EmailVerificationCodes.verify(params[:one_time_code].to_s.gsub(/\D/, ''), value)
SubmissionEvents.create_with_tracking_data(@submitter, 'email_verified', request, { email: @submitter.email })
cookies.encrypted[:email_2fa_slug] =
{ value: @submitter.slug, expires: COOKIES_TTL.from_now, **COOKIES_DEFAULTS }
redirect_to submit_form_path(@submitter.slug)
else
redirect_to submit_form_path(@submitter.slug, status: :error), alert: I18n.t(:invalid_code)
end
rescue RateLimit::LimitApproached
redirect_to submit_form_path(@submitter.slug, status: :error), alert: I18n.t(:too_many_attempts)
end
def update
if @submitter.submission_events.where(event_type: 'send_2fa_email').exists?(created_at: 15.seconds.ago..)
return redirect_to submit_form_path(@submitter.slug, status: :error), alert: I18n.t(:rate_limit_exceeded)
end
RateLimit.call("send-email-code-#{@submitter.id}", limit: 2, ttl: 45.seconds, enabled: true)
SendSubmitterVerificationEmailJob.perform_async('submitter_id' => @submitter.id, 'locale' => I18n.locale.to_s)
redir_params = params[:resend] ? { alert: I18n.t(:code_has_been_resent) } : {}
redirect_to submit_form_path(@submitter.slug, status: :sent), **redir_params
rescue RateLimit::LimitApproached
redirect_to submit_form_path(@submitter.slug, status: :error), alert: I18n.t(:too_many_attempts)
end
def load_submitter
@submitter = Submitter.find_by!(slug: params[:submitter_slug])
end
end
@@ -3,6 +3,12 @@
class TemplateDocumentsController < ApplicationController class TemplateDocumentsController < ApplicationController
load_and_authorize_resource :template load_and_authorize_resource :template
FILES_TTL = 5.minutes
def index
render json: @template.schema_documents.map { |d| ActiveStorage::Blob.proxy_url(d.blob, expires_at: FILES_TTL.from_now.to_i) }
end
def create def create
if params[:blobs].blank? && params[:files].blank? if params[:blobs].blank? && params[:files].blank?
return render json: { error: I18n.t('file_is_missing') }, status: :unprocessable_content return render json: { error: I18n.t('file_is_missing') }, status: :unprocessable_content
@@ -0,0 +1,56 @@
# frozen_string_literal: true
class TemplatesCloneController < ApplicationController
load_and_authorize_resource :template, instance_name: :base_template
def new
authorize!(:create, Template)
@template = Template.new(name: "#{@base_template.name} (#{I18n.t('clone')})")
end
def create
ActiveRecord::Associations::Preloader.new(
records: [@base_template],
associations: [schema_documents: :preview_images_attachments]
).call
@template = Templates::Clone.call(@base_template, author: current_user,
name: params.dig(:template, :name),
folder_name: params[:folder_name])
authorize!(:create, @template)
if params[:account_id].present? && true_ability.authorize!(:manage, Account.find(params[:account_id]))
@template.account_id = params[:account_id]
@template.author = true_user if true_user.account_id == @template.account_id
@template.folder = @template.account.default_template_folder if @template.account_id != current_account.id
else
@template.account = current_account
end
Templates.maybe_assign_access(@template)
if @template.save
Templates::CloneAttachments.call(template: @template, original_template: @base_template)
SearchEntries.enqueue_reindex(@template)
WebhookUrls.enqueue_events(@template, 'template.created')
maybe_redirect_to_template(@template)
else
render turbo_stream: turbo_stream.replace(:modal, partial: 'templates_clone/form'), status: :unprocessable_content
end
end
private
def maybe_redirect_to_template(template)
if template.account == current_account
redirect_to(edit_template_path(template))
else
redirect_back(fallback_location: root_path, notice: I18n.t('template_has_been_cloned'))
end
end
end
+7 -48
View File
@@ -3,8 +3,6 @@
class TemplatesController < ApplicationController class TemplatesController < ApplicationController
load_and_authorize_resource :template load_and_authorize_resource :template
before_action :load_base_template, only: %i[new create]
def show def show
submissions = @template.submissions.accessible_by(current_ability) submissions = @template.submissions.accessible_by(current_ability)
submissions = submissions.active if @template.archived_at.blank? submissions = submissions.active if @template.archived_at.blank?
@@ -26,9 +24,7 @@ class TemplatesController < ApplicationController
redirect_to root_path redirect_to root_path
end end
def new def new; end
@template.name = "#{@base_template.name} (#{I18n.t('clone')})" if @base_template
end
def edit def edit
ActiveRecord::Associations::Preloader.new( ActiveRecord::Associations::Preloader.new(
@@ -48,37 +44,18 @@ class TemplatesController < ApplicationController
end end
def create def create
if @base_template @template.author = current_user
ActiveRecord::Associations::Preloader.new( @template.folder = TemplateFolders.find_or_create_by_name(current_user, params[:folder_name])
records: [@base_template], @template.account = current_account
associations: [schema_documents: :preview_images_attachments]
).call
@template = Templates::Clone.call(@base_template, author: current_user,
name: params.dig(:template, :name),
folder_name: params[:folder_name])
else
@template.author = current_user
@template.folder = TemplateFolders.find_or_create_by_name(current_user, params[:folder_name])
end
if params[:account_id].present? && authorized_clone_account_id?(params[:account_id])
@template.account_id = params[:account_id]
@template.folder = @template.account.default_template_folder if @template.account_id != current_account.id
else
@template.account = current_account
end
Templates.maybe_assign_access(@template) Templates.maybe_assign_access(@template)
if @template.save if @template.save
Templates::CloneAttachments.call(template: @template, original_template: @base_template) if @base_template
SearchEntries.enqueue_reindex(@template) SearchEntries.enqueue_reindex(@template)
WebhookUrls.enqueue_events(@template, 'template.created') WebhookUrls.enqueue_events(@template, 'template.created')
maybe_redirect_to_template(@template) redirect_to(edit_template_path(@template))
else else
render turbo_stream: turbo_stream.replace(:modal, template: 'templates/new'), status: :unprocessable_content render turbo_stream: turbo_stream.replace(:modal, template: 'templates/new'), status: :unprocessable_content
end end
@@ -118,7 +95,8 @@ class TemplatesController < ApplicationController
def template_params def template_params
params.require(:template).permit( params.require(:template).permit(
:name, :name,
{ schema: [[:attachment_uuid, :name, { conditions: [%i[field_uuid value action operation]] }]], { schema: [[:attachment_uuid, :google_drive_file_id, :name,
{ conditions: [%i[field_uuid value action operation]] }]],
submitters: [%i[name uuid is_requester linked_to_uuid invite_by_uuid optional_invite_by_uuid email order]], submitters: [%i[name uuid is_requester linked_to_uuid invite_by_uuid optional_invite_by_uuid email order]],
fields: [[:uuid, :submitter_uuid, :name, :type, fields: [[:uuid, :submitter_uuid, :name, :type,
:required, :readonly, :default_value, :required, :readonly, :default_value,
@@ -131,23 +109,4 @@ class TemplatesController < ApplicationController
areas: [%i[x y w h cell_w attachment_uuid option_uuid page]] }]] } areas: [%i[x y w h cell_w attachment_uuid option_uuid page]] }]] }
) )
end end
def authorized_clone_account_id?(account_id)
true_user.account_id.to_s == account_id.to_s ||
true_user.account.linked_accounts.accessible_by(current_ability).exists?(id: account_id)
end
def maybe_redirect_to_template(template)
if template.account == current_account
redirect_to(edit_template_path(@template))
else
redirect_back(fallback_location: root_path, notice: I18n.t('template_has_been_cloned'))
end
end
def load_base_template
return if params[:base_template_id].blank?
@base_template = Template.accessible_by(current_ability).find_by(id: params[:base_template_id])
end
end end
@@ -6,12 +6,18 @@ class TemplatesDebugController < ApplicationController
DEBUG_FILE = '' DEBUG_FILE = ''
def show def show
attachment = @template.documents.first schema_uuids = @template.schema.index_by { |e| e['attachment_uuid'] }
attachment = @template.documents.find { |a| schema_uuids[a.uuid] }
data = attachment.download data = attachment.download
pdf = HexaPDF::Document.new(io: StringIO.new(data))
fields = Templates::FindAcroFields.call(pdf, attachment, data) unless attachment.image?
pdf = HexaPDF::Document.new(io: StringIO.new(data))
fields = Templates::FindAcroFields.call(pdf, attachment, data)
end
fields, = Templates::DetectFields.call(StringIO.new(data), attachment:) if fields.blank?
attachment.metadata['pdf'] ||= {} attachment.metadata['pdf'] ||= {}
attachment.metadata['pdf']['fields'] = fields attachment.metadata['pdf']['fields'] = fields
@@ -0,0 +1,27 @@
# frozen_string_literal: true
class TemplatesDetectFieldsController < ApplicationController
include ActionController::Live
load_and_authorize_resource :template
def create
response.headers['Content-Type'] = 'text/event-stream'
sse = SSE.new(response.stream)
documents = @template.schema_documents.preload(:blob)
documents.each do |document|
io = StringIO.new(document.download)
Templates::DetectFields.call(io, attachment: document) do |(attachment_uuid, page, fields)|
sse.write({ attachment_uuid:, page:, fields: })
end
end
sse.write({ completed: true })
ensure
response.stream.close
end
end
@@ -3,6 +3,15 @@
class TemplatesPreferencesController < ApplicationController class TemplatesPreferencesController < ApplicationController
load_and_authorize_resource :template load_and_authorize_resource :template
RESETTABLE_PREFERENCE_KEYS = {
AccountConfig::SUBMITTER_INVITATION_EMAIL_KEY => %w[request_email_subject request_email_body submitters],
AccountConfig::SUBMITTER_INVITATION_REMINDER_EMAIL_KEY => %w[invitation_reminder_email_subject
invitation_reminder_email_body],
AccountConfig::SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY => %w[documents_copy_email_subject documents_copy_email_body],
AccountConfig::SUBMITTER_COMPLETED_EMAIL_KEY => %w[completed_notification_email_subject
completed_notification_email_body]
}.freeze
def show; end def show; end
def create def create
@@ -15,19 +24,38 @@ class TemplatesPreferencesController < ApplicationController
head :ok head :ok
end end
def destroy
authorize!(:update, @template)
config_key = params[:config_key]
preferences_to_delete = RESETTABLE_PREFERENCE_KEYS[config_key]
return head :ok if preferences_to_delete.blank?
preferences_to_delete.each do |key|
@template.preferences.delete(key)
end
@template.save!
render turbo_stream: turbo_stream.replace("#{config_key}_form",
partial: "templates_preferences/#{config_key}_form"),
status: :ok
end
private private
def template_params def template_params
params.require(:template).permit( params.require(:template).permit(
preferences: %i[bcc_completed request_email_subject request_email_body preferences: %i[bcc_completed request_email_subject request_email_body
invitation_reminder_email_subject invitation_reminder_email_body
documents_copy_email_subject documents_copy_email_body documents_copy_email_subject documents_copy_email_body
documents_copy_email_enabled documents_copy_email_attach_audit documents_copy_email_enabled documents_copy_email_attach_audit
documents_copy_email_attach_documents documents_copy_email_reply_to documents_copy_email_attach_documents documents_copy_email_reply_to
completed_notification_email_attach_documents completed_notification_email_attach_documents
completed_redirect_url validate_unique_submitters completed_redirect_url validate_unique_submitters
require_all_submitters submitters_order require_phone_2fa require_all_submitters submitters_order require_phone_2fa require_email_2fa
default_expire_at_duration shared_link_2fa default_expire_at_duration shared_link_2fa default_expire_at request_email_enabled
default_expire_at request_email_enabled
completed_notification_email_subject completed_notification_email_body completed_notification_email_subject completed_notification_email_body
completed_notification_email_enabled completed_notification_email_attach_audit] + completed_notification_email_enabled completed_notification_email_attach_audit] +
[completed_message: %i[title body], [completed_message: %i[title body],
+22 -5
View File
@@ -24,10 +24,19 @@ class UsersController < ApplicationController
def edit; end def edit; end
def create def create
if User.accessible_by(current_ability).exists?(email: @user.email) existing_user = User.accessible_by(current_ability).find_by(email: @user.email)
@user.errors.add(:email, I18n.t('already_exists'))
return render turbo_stream: turbo_stream.replace(:modal, template: 'users/new'), status: :unprocessable_content if existing_user
if existing_user.archived_at? &&
current_ability.can?(:manage, existing_user) && current_ability.can?(:manage, @user.account)
existing_user.assign_attributes(@user.slice(:first_name, :last_name, :role, :account_id))
existing_user.archived_at = nil
@user = existing_user
else
@user.errors.add(:email, I18n.t('already_exists'))
return render turbo_stream: turbo_stream.replace(:modal, template: 'users/new'), status: :unprocessable_content
end
end end
@user.password = SecureRandom.hex if @user.password.blank? @user.password = SecureRandom.hex if @user.password.blank?
@@ -45,7 +54,8 @@ class UsersController < ApplicationController
def update def update
return redirect_to settings_users_path, notice: I18n.t('unable_to_update_user') if Docuseal.demo? return redirect_to settings_users_path, notice: I18n.t('unable_to_update_user') if Docuseal.demo?
attrs = user_params.compact_blank.merge(user_params.slice(:archived_at)) attrs = user_params.compact_blank
attrs = attrs.merge(user_params.slice(:archived_at)) if current_ability.can?(:create, @user)
if params.dig(:user, :account_id).present? if params.dig(:user, :account_id).present?
account = Account.accessible_by(current_ability).find(params.dig(:user, :account_id)) account = Account.accessible_by(current_ability).find(params.dig(:user, :account_id))
@@ -56,7 +66,14 @@ class UsersController < ApplicationController
end end
if @user.update(attrs.except(*(current_user == @user ? %i[password otp_required_for_login role] : %i[password]))) if @user.update(attrs.except(*(current_user == @user ? %i[password otp_required_for_login role] : %i[password])))
redirect_back fallback_location: settings_users_path, notice: I18n.t('user_has_been_updated') if @user.try(:pending_reconfirmation?) && @user.previous_changes.key?(:unconfirmed_email)
SendConfirmationInstructionsJob.perform_async('user_id' => @user.id)
redirect_back fallback_location: settings_users_path,
notice: I18n.t('a_confirmation_email_has_been_sent_to_the_new_email_address')
else
redirect_back fallback_location: settings_users_path, notice: I18n.t('user_has_been_updated')
end
else else
render turbo_stream: turbo_stream.replace(:modal, template: 'users/edit'), status: :unprocessable_content render turbo_stream: turbo_stream.replace(:modal, template: 'users/edit'), status: :unprocessable_content
end end
+12
View File
@@ -49,6 +49,10 @@ import ShowOnValue from './elements/show_on_value'
import CustomValidation from './elements/custom_validation' import CustomValidation from './elements/custom_validation'
import ToggleClasses from './elements/toggle_classes' import ToggleClasses from './elements/toggle_classes'
import AutosizeField from './elements/autosize_field' import AutosizeField from './elements/autosize_field'
import GoogleDriveFilePicker from './elements/google_drive_file_picker'
import OpenModal from './elements/open_modal'
import BarChart from './elements/bar_chart'
import FieldCondition from './elements/field_condition'
import * as TurboInstantClick from './lib/turbo_instant_click' import * as TurboInstantClick from './lib/turbo_instant_click'
@@ -136,6 +140,10 @@ safeRegisterElement('show-on-value', ShowOnValue)
safeRegisterElement('custom-validation', CustomValidation) safeRegisterElement('custom-validation', CustomValidation)
safeRegisterElement('toggle-classes', ToggleClasses) safeRegisterElement('toggle-classes', ToggleClasses)
safeRegisterElement('autosize-field', AutosizeField) safeRegisterElement('autosize-field', AutosizeField)
safeRegisterElement('google-drive-file-picker', GoogleDriveFilePicker)
safeRegisterElement('open-modal', OpenModal)
safeRegisterElement('bar-chart', BarChart)
safeRegisterElement('field-condition', FieldCondition)
safeRegisterElement('template-builder', class extends HTMLElement { safeRegisterElement('template-builder', class extends HTMLElement {
connectedCallback () { connectedCallback () {
@@ -151,7 +159,9 @@ safeRegisterElement('template-builder', class extends HTMLElement {
locale: this.dataset.locale, locale: this.dataset.locale,
withPhone: this.dataset.withPhone === 'true', withPhone: this.dataset.withPhone === 'true',
withVerification: ['true', 'false'].includes(this.dataset.withVerification) ? this.dataset.withVerification === 'true' : null, withVerification: ['true', 'false'].includes(this.dataset.withVerification) ? this.dataset.withVerification === 'true' : null,
withKba: ['true', 'false'].includes(this.dataset.withKba) ? this.dataset.withKba === 'true' : null,
withLogo: this.dataset.withLogo !== 'false', withLogo: this.dataset.withLogo !== 'false',
withFieldsDetection: this.dataset.withFieldsDetection === 'true',
editable: this.dataset.editable !== 'false', editable: this.dataset.editable !== 'false',
authenticityToken: document.querySelector('meta[name="csrf-token"]')?.content, authenticityToken: document.querySelector('meta[name="csrf-token"]')?.content,
withPayment: this.dataset.withPayment === 'true', withPayment: this.dataset.withPayment === 'true',
@@ -160,7 +170,9 @@ safeRegisterElement('template-builder', class extends HTMLElement {
withSendButton: this.dataset.withSendButton !== 'false', withSendButton: this.dataset.withSendButton !== 'false',
withSignYourselfButton: this.dataset.withSignYourselfButton !== 'false', withSignYourselfButton: this.dataset.withSignYourselfButton !== 'false',
withConditions: this.dataset.withConditions === 'true', withConditions: this.dataset.withConditions === 'true',
withGoogleDrive: this.dataset.withGoogleDrive === 'true',
withReplaceAndCloneUpload: true, withReplaceAndCloneUpload: true,
withDownload: true,
currencies: (this.dataset.currencies || '').split(',').filter(Boolean), currencies: (this.dataset.currencies || '').split(',').filter(Boolean),
acceptFileTypes: this.dataset.acceptFileTypes, acceptFileTypes: this.dataset.acceptFileTypes,
showTourStartForm: this.dataset.showTourStartForm === 'true' showTourStartForm: this.dataset.showTourStartForm === 'true'
+50
View File
@@ -0,0 +1,50 @@
export default class extends HTMLElement {
connectedCallback () {
this.chartLabels = JSON.parse(this.dataset.labels || '[]')
this.chartDatasets = JSON.parse(this.dataset.datasets || '[]')
this.initChart()
}
disconnectedCallback () {
if (this.chartInstance) {
this.chartInstance.destroy()
this.chartInstance = null
}
}
async initChart () {
const { default: Chart } = await import(/* webpackChunkName: "chartjs" */ 'chart.js/auto')
const canvas = this.querySelector('canvas')
const ctx = canvas.getContext('2d')
this.chartInstance = new Chart(ctx, {
type: 'bar',
data: {
labels: this.chartLabels,
datasets: this.chartDatasets
},
options: {
responsive: true,
maintainAspectRatio: true,
animation: false,
scales: {
y: {
beginAtZero: true,
grace: '20%',
ticks: {
precision: 0
}
}
},
plugins: {
legend: {
display: false
}
}
}
})
}
}
+151
View File
@@ -0,0 +1,151 @@
export default class extends HTMLElement {
connectedCallback () {
this.targetId = this.dataset.targetId
this.fieldId = this.dataset.fieldId
this.action = (this.dataset.action || '').trim()
this.expectedValue = this.dataset.value
this.targetEl = document.getElementById(this.targetId)
this.sourceEl = document.getElementById(this.fieldId)
this.bindListeners()
this.evaluateAndApply()
}
disconnectedCallback () {
this.unbindListeners()
}
bindListeners () {
this.eventsFor(this.sourceEl).forEach((ev) => {
this.sourceEl.addEventListener(ev, this.evaluateAndApply)
})
}
unbindListeners () {
this.eventsFor(this.sourceEl).forEach((ev) => {
this.sourceEl.removeEventListener(ev, this.evaluateAndApply)
})
}
eventsFor (el) {
if (!el) return []
const tag = el.tagName.toLowerCase()
if (tag === 'textarea') return ['input']
if (tag === 'input') return ['input', 'change']
return ['change']
}
evaluateAndApply = () => {
const fieldConditions = document.querySelectorAll(`field-condition[data-target-id="${this.targetId}"]`)
const result = [...fieldConditions].reduce((acc, cond) => {
if (cond.dataset.operation === 'or') {
acc.push(acc.pop() || cond.checkCondition())
} else {
acc.push(cond.checkCondition())
}
return acc
}, [])
this.apply(!result.includes(false))
}
checkCondition () {
const action = this.action
const actual = this.getSourceValue()
const expected = this.expectedValue
if (action === 'empty' || action === 'unchecked') return this.isEmpty(actual)
if (action === 'not_empty' || action === 'checked') return !this.isEmpty(actual)
if (action === 'equal') {
const list = Array.isArray(actual) ? actual : [actual]
return list.filter((v) => v !== null && v !== undefined).map(String).includes(String(expected))
}
if (action === 'contains') return this.contains(actual, expected)
if (action === 'not_equal') {
const list = Array.isArray(actual) ? actual : [actual]
return !list.filter((v) => v !== null && v !== undefined).map(String).includes(String(expected))
}
if (action === 'does_not_contain') return !this.contains(actual, expected)
return true
}
getSourceValue () {
const el = this.sourceEl
if (!el) return
const tag = el.tagName.toLowerCase()
const type = (el.getAttribute('type') || '').toLowerCase()
if (tag === 'select') return el.value
if (tag === 'textarea') return el.value
if (tag === 'input' && type === 'checkbox') return el.checked ? (el.value || '1') : null
if (tag === 'input') return el.value
return el.value ?? null
}
isEmpty (obj) {
if (obj == null) return true
if (Array.isArray(obj)) {
return obj.length === 0
}
if (typeof obj === 'string') {
return obj.trim().length === 0
}
if (typeof obj === 'object') {
return Object.keys(obj).length === 0
}
if (obj === false) {
return true
}
return false
}
contains (actual, expected) {
if (expected === null || expected === undefined) return false
const exp = String(expected)
if (Array.isArray(actual)) return actual.filter((v) => v !== null && v !== undefined).map(String).includes(exp)
if (typeof actual === 'string') return actual.includes(exp)
return actual !== null && actual !== undefined && String(actual) === exp
}
apply (passed) {
const controls = this.targetEl.matches('input, select, textarea, button')
? [this.targetEl]
: Array.from(this.targetEl.querySelectorAll('input, select, textarea, button'))
if (passed) {
this.targetEl.style.display = ''
this.targetEl.labels.forEach((label) => { label.style.display = '' })
controls.forEach((c) => (c.disabled = false))
} else {
this.targetEl.style.display = 'none'
this.targetEl.labels.forEach((label) => { label.style.display = 'none' })
controls.forEach((c) => (c.disabled = true))
}
}
}
@@ -0,0 +1,55 @@
export default class extends HTMLElement {
connectedCallback () {
const iframeTemplate = this.querySelector('template')
this.observer = new IntersectionObserver((entries) => {
if (entries.some(e => e.isIntersecting)) {
iframeTemplate.parentElement.prepend(iframeTemplate.content)
this.observer.disconnect()
}
})
this.observer.observe(this)
window.addEventListener('message', this.messageHandler)
}
messageHandler = (event) => {
if (event.data.type === 'google-drive-files-picked') {
this.form.querySelectorAll('input[name="google_drive_file_ids[]"]').forEach(el => el.remove())
const files = event.data.files || []
files.forEach((file) => {
const input = document.createElement('input')
input.type = 'hidden'
input.name = 'google_drive_file_ids[]'
input.value = file.id
this.form.appendChild(input)
})
this.form.querySelector('button[type="submit"]').click()
this.loader.classList.remove('hidden')
} else if (event.data.type === 'google-drive-picker-loaded') {
this.loader.classList.add('hidden')
this.form.classList.remove('hidden')
} else if (event.data.type === 'google-drive-picker-request-oauth') {
document.getElementById(this.dataset.oauthButtonId).classList.remove('hidden')
this.classList.add('hidden')
}
}
disconnectedCallback () {
this.observer?.unobserve(this)
window.removeEventListener('message', this.messageHandler)
}
get form () {
return this.querySelector('form')
}
get loader () {
return document.getElementById('google_drive_loader')
}
}
+16
View File
@@ -0,0 +1,16 @@
export default class extends HTMLElement {
connectedCallback () {
const src = this.getAttribute('src')
const link = document.createElement('a')
link.href = src
link.setAttribute('data-turbo-frame', 'modal')
link.style.display = 'none'
this.appendChild(link)
link.click()
window.history.replaceState({}, document.title, window.location.pathname)
}
}
+1
View File
@@ -37,6 +37,7 @@ safeRegisterElement('submission-form', class extends HTMLElement {
withSignatureId: this.dataset.withSignatureId === 'true', withSignatureId: this.dataset.withSignatureId === 'true',
requireSigningReason: this.dataset.requireSigningReason === 'true', requireSigningReason: this.dataset.requireSigningReason === 'true',
withConfetti: this.dataset.withConfetti !== 'false', withConfetti: this.dataset.withConfetti !== 'false',
withFieldLabels: this.dataset.withFieldLabels !== 'false',
withDisclosure: this.dataset.withDisclosure === 'true', withDisclosure: this.dataset.withDisclosure === 'true',
reuseSignature: this.dataset.reuseSignature !== 'false', reuseSignature: this.dataset.reuseSignature !== 'false',
withTypedSignature: this.dataset.withTypedSignature !== 'false', withTypedSignature: this.dataset.withTypedSignature !== 'false',
+22 -4
View File
@@ -60,6 +60,11 @@
class="object-contain mx-auto" class="object-contain mx-auto"
:src="stamp.url" :src="stamp.url"
> >
<img
v-else-if="field.type === 'kba' && kba"
class="object-contain mx-auto"
:src="kba.url"
>
<div <div
v-else-if="field.type === 'signature' && signature" v-else-if="field.type === 'signature' && signature"
class="flex justify-between h-full gap-1 overflow-hidden w-full" class="flex justify-between h-full gap-1 overflow-hidden w-full"
@@ -272,7 +277,7 @@
<script> <script>
import MarkdownContent from './markdown_content' import MarkdownContent from './markdown_content'
import { IconTextSize, IconWritingSign, IconCalendarEvent, IconPhoto, IconCheckbox, IconPaperclip, IconSelect, IconCircleDot, IconChecks, IconCheck, IconColumns3, IconPhoneCheck, IconLetterCaseUpper, IconCreditCard, IconRubberStamp, IconSquareNumber1, IconId } from '@tabler/icons-vue' import { IconTextSize, IconWritingSign, IconCalendarEvent, IconPhoto, IconCheckbox, IconPaperclip, IconSelect, IconCircleDot, IconChecks, IconCheck, IconColumns3, IconPhoneCheck, IconLetterCaseUpper, IconCreditCard, IconRubberStamp, IconSquareNumber1, IconId, IconUserScan } from '@tabler/icons-vue'
export default { export default {
name: 'FieldArea', name: 'FieldArea',
@@ -391,7 +396,8 @@ export default {
stamp: this.t('stamp'), stamp: this.t('stamp'),
payment: this.t('payment'), payment: this.t('payment'),
phone: this.t('phone'), phone: this.t('phone'),
verification: this.t('verify_id') verification: this.t('verify_id'),
kba: this.t('kba')
} }
}, },
strikethroughWidth () { strikethroughWidth () {
@@ -454,7 +460,8 @@ export default {
multiple: IconChecks, multiple: IconChecks,
phone: IconPhoneCheck, phone: IconPhoneCheck,
payment: IconCreditCard, payment: IconCreditCard,
verification: IconId verification: IconId,
kba: IconUserScan
} }
}, },
image () { image () {
@@ -471,6 +478,13 @@ export default {
return null return null
} }
}, },
kba () {
if (this.field.type === 'kba') {
return this.attachmentsIndex[this.modelValue]
} else {
return null
}
},
signature () { signature () {
if (this.field.type === 'signature') { if (this.field.type === 'signature') {
return this.attachmentsIndex[this.modelValue] return this.attachmentsIndex[this.modelValue]
@@ -553,10 +567,14 @@ export default {
style.color = this.field.preferences.color style.color = this.field.preferences.color
} }
if (this.field.preferences?.background) {
style.background = this.field.preferences.background
}
return style return style
}, },
isNarrow () { isNarrow () {
return this.area.h > 0 && (this.area.w / this.area.h) > 6 return this.area.h > 0 && ((this.area.w * this.pageWidth) / (this.area.h * this.pageHeight)) > 4.5
} }
}, },
watch: { watch: {
+11 -3
View File
@@ -163,12 +163,20 @@ export default {
return fetch(this.baseUrl + '/api/attachments', { return fetch(this.baseUrl + '/api/attachments', {
method: 'POST', method: 'POST',
body: formData body: formData
}).then(resp => resp.json()).then((data) => { }).then(async (resp) => {
return data const data = await resp.json()
if (resp.status === 422) {
alert(data.error)
} else {
return data
}
}) })
} }
})).then((result) => { })).then((result) => {
this.$emit('upload', result) if (result && result[0]) {
this.$emit('upload', result)
}
}).finally(() => { }).finally(() => {
this.isLoading = false this.isLoading = false
}) })
+34 -7
View File
@@ -8,7 +8,7 @@
:scroll-el="scrollEl" :scroll-el="scrollEl"
:with-signature-id="withSignatureId" :with-signature-id="withSignatureId"
:attachments-index="attachmentsIndex" :attachments-index="attachmentsIndex"
:with-label="!isAnonymousChecboxes && showFieldNames" :with-label="withFieldLabels && !isAnonymousChecboxes && showFieldNames"
:current-step="currentStepFields" :current-step="currentStepFields"
:scroll-padding="scrollPadding" :scroll-padding="scrollPadding"
@focus-step="[saveStep(), currentField.type !== 'checkbox' ? isFormVisible = true : '', goToStep($event, false, true)]" @focus-step="[saveStep(), currentField.type !== 'checkbox' ? isFormVisible = true : '', goToStep($event, false, true)]"
@@ -133,6 +133,12 @@
name="_method" name="_method"
type="hidden" type="hidden"
> >
<input
v-if="validate === false"
value="false"
name="validate"
type="hidden"
>
<div class="md:mt-4"> <div class="md:mt-4">
<div v-if="['cells', 'text'].includes(currentField.type)"> <div v-if="['cells', 'text'].includes(currentField.type)">
<TextStep <TextStep
@@ -351,8 +357,6 @@
class="base-checkbox !h-7 !w-7" class="base-checkbox !h-7 !w-7"
:required="field.required" :required="field.required"
:checked="!!values[field.uuid]" :checked="!!values[field.uuid]"
@invalid="$event.target.setCustomValidity(t('please_check_the_box_to_continue'))"
@change="$event.target.setCustomValidity($event.target.validity.valueMissing ? t('please_check_the_box_to_continue') : '')"
@click="[scrollIntoField(field), values[field.uuid] = !values[field.uuid]]" @click="[scrollIntoField(field), values[field.uuid] = !values[field.uuid]]"
> >
<span <span
@@ -461,6 +465,17 @@
@focus="scrollIntoField(currentField)" @focus="scrollIntoField(currentField)"
@submit="!isSubmitting && submitStep()" @submit="!isSubmitting && submitStep()"
/> />
<KbaStep
v-else-if="currentField.type === 'kba'"
ref="currentStep"
:key="currentField.uuid"
:submitter="submitter"
:empty-value-required-step="emptyValueRequiredStep"
:field="currentField"
:submitter-slug="submitterSlug"
:values="values"
@submit="!isSubmitting && submitStep()"
/>
<VerificationStep <VerificationStep
v-else-if="currentField.type === 'verification'" v-else-if="currentField.type === 'verification'"
ref="currentStep" ref="currentStep"
@@ -476,7 +491,7 @@
/> />
</div> </div>
<div <div
v-if="(currentField.type !== 'payment' && currentField.type !== 'verification') || submittedValues[currentField.uuid]" v-if="(currentField.type !== 'payment' && currentField.type !== 'verification' && currentField.type !== 'kba') || submittedValues[currentField.uuid]"
:class="currentField.type === 'signature' ? 'mt-2' : 'mt-4 md:mt-6'" :class="currentField.type === 'signature' ? 'mt-2' : 'mt-4 md:mt-6'"
> >
<button <button
@@ -533,7 +548,7 @@
/> />
<div <div
v-if="stepFields.length < 80" v-if="stepFields.length < 80"
class="flex justify-center mt-3 sm:mt-4 mb-0 sm:mb-1" class="flex justify-center mt-3 sm:mt-4 mb-0 sm:mb-1 select-none"
> >
<div class="flex items-center flex-wrap steps-progress"> <div class="flex items-center flex-wrap steps-progress">
<a <a
@@ -565,6 +580,7 @@ import MultiSelectStep from './multi_select_step'
import PhoneStep from './phone_step' import PhoneStep from './phone_step'
import PaymentStep from './payment_step' import PaymentStep from './payment_step'
import VerificationStep from './verification_step' import VerificationStep from './verification_step'
import KbaStep from './kba_step'
import TextStep from './text_step' import TextStep from './text_step'
import NumberStep from './number_step' import NumberStep from './number_step'
import DateStep from './date_step' import DateStep from './date_step'
@@ -609,6 +625,7 @@ export default {
AttachmentStep, AttachmentStep,
InitialsStep, InitialsStep,
VerificationStep, VerificationStep,
KbaStep,
InviteForm, InviteForm,
MultiSelectStep, MultiSelectStep,
IconInnerShadowTop, IconInnerShadowTop,
@@ -718,6 +735,11 @@ export default {
required: false, required: false,
default: false default: false
}, },
validate: {
type: Boolean,
required: false,
default: true
},
withDisclosure: { withDisclosure: {
type: Boolean, type: Boolean,
required: false, required: false,
@@ -728,6 +750,11 @@ export default {
required: false, required: false,
default: true default: true
}, },
withFieldLabels: {
type: Boolean,
required: false,
default: true
},
withConfetti: { withConfetti: {
type: Boolean, type: Boolean,
required: false, required: false,
@@ -990,7 +1017,7 @@ export default {
const verificationFields = [] const verificationFields = []
const sortedFields = this.fields.reduce((acc, f) => { const sortedFields = this.fields.reduce((acc, f) => {
if (f.type === 'verification') { if (f.type === 'verification' || f.type === 'kba') {
verificationFields.push(f) verificationFields.push(f)
} else if (!f.readonly) { } else if (!f.readonly) {
acc.push(f) acc.push(f)
@@ -1387,7 +1414,7 @@ export default {
const submitStep = this.currentStep const submitStep = this.currentStep
const stepPromise = ['signature', 'phone', 'initials', 'payment', 'verification'].includes(this.currentField.type) const stepPromise = ['signature', 'phone', 'initials', 'payment', 'verification', 'kba'].includes(this.currentField.type)
? this.$refs.currentStep.submit ? this.$refs.currentStep.submit
: () => Promise.resolve({}) : () => Promise.resolve({})
+135 -121
View File
@@ -1,4 +1,5 @@
const en = { const en = {
kba: 'KBA',
please_upload_an_image_file: 'Please upload an image file', please_upload_an_image_file: 'Please upload an image file',
must_be_characters_length: 'Must be {number} characters length', must_be_characters_length: 'Must be {number} characters length',
complete_all_required_fields_to_proceed_with_identity_verification: 'Complete all required fields to proceed with identity verification.', complete_all_required_fields_to_proceed_with_identity_verification: 'Complete all required fields to proceed with identity verification.',
@@ -13,7 +14,7 @@ const en = {
esignature_disclosure: 'eSignature Disclosure', esignature_disclosure: 'eSignature Disclosure',
signature: 'Signature', signature: 'Signature',
initials: 'Initials', initials: 'Initials',
drawn_signature_on_a_touchscreen_device: 'Drawn signature on a touchscreen device', sign_on_the_touchscreen: 'Sign on the touchscreen',
approved: 'Approved', approved: 'Approved',
reviewed: 'Reviewed', reviewed: 'Reviewed',
other: 'Other', other: 'Other',
@@ -91,7 +92,7 @@ const en = {
type_text: 'Type text', type_text: 'Type text',
email_has_been_sent: 'Email has been sent', email_has_been_sent: 'Email has been sent',
processing: 'Processing', processing: 'Processing',
pay_with_strip: 'Pay with Stripe', pay_with_stripe: 'Pay with Stripe',
reupload: 'Reupload', reupload: 'Reupload',
upload: 'Upload', upload: 'Upload',
files: 'Files', files: 'Files',
@@ -100,6 +101,7 @@ const en = {
} }
const es = { const es = {
kba: 'KBA',
please_upload_an_image_file: 'Por favor, sube un archivo de imagen', please_upload_an_image_file: 'Por favor, sube un archivo de imagen',
must_be_characters_length: 'Debe tener {number} caracteres de longitud', must_be_characters_length: 'Debe tener {number} caracteres de longitud',
complete_all_required_fields_to_proceed_with_identity_verification: 'Complete todos los campos requeridos para continuar con la verificación de identidad.', complete_all_required_fields_to_proceed_with_identity_verification: 'Complete todos los campos requeridos para continuar con la verificación de identidad.',
@@ -120,7 +122,7 @@ const es = {
select_a_reason: 'Selecciona una razón', 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', sign_on_the_touchscreen: 'Firmar en pantalla táctil',
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Escanea el código QR con la aplicación de la cámara para abrir el formulario en el móvil y dibujar tu firma', scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Escanea el código QR con la aplicación de la cámara para abrir el formulario en el móvil y dibujar tu firma',
by_clicking_you_agree_to_the: 'Al hacer clic en "{button}", usted acepta el', by_clicking_you_agree_to_the: 'Al hacer clic en "{button}", usted acepta el',
electronic_signature_disclosure: 'Divulgación de Firma Electrónica', electronic_signature_disclosure: 'Divulgación de Firma Electrónica',
@@ -192,7 +194,7 @@ const es = {
type_text: 'Escribir texto', type_text: 'Escribir texto',
email_has_been_sent: 'El correo electrónico ha sido enviado', email_has_been_sent: 'El correo electrónico ha sido enviado',
processing: 'Procesando', processing: 'Procesando',
pay_with_strip: 'Pagar con Stripe', pay_with_stripe: 'Pagar con Stripe',
reupload: 'Volver a subir', reupload: 'Volver a subir',
upload: 'Subir', upload: 'Subir',
files: 'Archivos', files: 'Archivos',
@@ -201,6 +203,7 @@ const es = {
} }
const it = { const it = {
kba: 'KBA',
please_upload_an_image_file: 'Per favore carica un file immagine', please_upload_an_image_file: 'Per favore carica un file immagine',
must_be_characters_length: 'Deve essere lungo {number} caratteri', must_be_characters_length: 'Deve essere lungo {number} caratteri',
complete_all_required_fields_to_proceed_with_identity_verification: "Compila tutti i campi obbligatori per procedere con la verifica dell'identità.", complete_all_required_fields_to_proceed_with_identity_verification: "Compila tutti i campi obbligatori per procedere con la verifica dell'identità.",
@@ -221,8 +224,8 @@ const it = {
select_a_reason: 'Seleziona una ragione', 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', sign_on_the_touchscreen: 'Firma su schermo tattile',
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Scansiona il codice QR con l\'app della fotocamera per aprire il modulo sul cellulare e disegnare la tua firma', scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: "Scansiona il codice QR con l'app della fotocamera per aprire il modulo sul cellulare e disegnare la tua firma",
by_clicking_you_agree_to_the: 'Cliccando su "{button}", accetti il', by_clicking_you_agree_to_the: 'Cliccando su "{button}", accetti il',
electronic_signature_disclosure: 'Divulgazione della Firma Elettronica', electronic_signature_disclosure: 'Divulgazione della Firma Elettronica',
esignature_disclosure: 'Divulgazione della eFirma', esignature_disclosure: 'Divulgazione della eFirma',
@@ -293,7 +296,7 @@ const it = {
toggle_multiline_text: 'Attiva Testo Multilinea', toggle_multiline_text: 'Attiva Testo Multilinea',
email_has_been_sent: "L'email è stata inviata", email_has_been_sent: "L'email è stata inviata",
processing: 'Elaborazione', processing: 'Elaborazione',
pay_with_strip: 'Paga con Stripe', pay_with_stripe: 'Paga con Stripe',
reupload: 'Ricarica', reupload: 'Ricarica',
upload: 'Carica', upload: 'Carica',
files: 'File', files: 'File',
@@ -302,66 +305,67 @@ const it = {
} }
const de = { const de = {
kba: 'KBA',
please_upload_an_image_file: 'Bitte laden Sie eine Bilddatei hoch', please_upload_an_image_file: 'Bitte laden Sie eine Bilddatei hoch',
must_be_characters_length: 'Muss {number} Zeichen lang sein', must_be_characters_length: 'Muss {number} Zeichen lang sein',
complete_all_required_fields_to_proceed_with_identity_verification: 'Vervollständigen Sie alle erforderlichen Felder, um mit der Identitätsverifizierung fortzufahren.', complete_all_required_fields_to_proceed_with_identity_verification: 'Füllen Sie alle Pflichtfelder aus, um mit der Identitätsprüfung fortzufahren.',
verify_id: 'ID überprüfen', verify_id: 'ID überprüfen',
identity_verification: 'Identitätsüberprüfung', identity_verification: 'Identitätsprüfung',
complete: 'Abschließen', complete: 'Abschließen',
fill_all_required_fields_to_complete: 'Alle erforderlichen Felder ausfüllen, um abzuschließen', fill_all_required_fields_to_complete: 'Füllen Sie alle Pflichtfelder aus, um abzuschließen',
sign_and_complete: 'Signieren und Abschließen', sign_and_complete: 'Unterzeichnen und abschließen',
text: 'Text',
by_clicking_you_agree_to_the: 'Durch Klicken auf "{button}" stimmen Sie dem',
electronic_signature_disclosure: 'Hinweis zur E-Signatur',
esignature_disclosure: 'Hinweis zur eSignatur',
signature: 'Unterschrift',
initials: 'Initialen',
sign_on_the_touchscreen: 'Auf Touchscreen signieren',
approved: 'Genehmigt',
reviewed: 'Geprüft',
other: 'Sonstiges',
authored_by_me: 'Von mir erstellt',
invite: 'Einladen', invite: 'Einladen',
email: 'E-Mail', email: 'E-Mail',
approved: 'Genehmigt',
reviewed: 'Überprüft',
other: 'Andere',
authored_by_me: 'Von mir verfasst',
approved_by: 'Genehmigt von', approved_by: 'Genehmigt von',
reviewed_by: 'Überprüft von', reviewed_by: 'Geprüft von',
authored_by: 'Verfasst von', authored_by: 'Erstellt von',
select_a_reason: 'Grund auswählen', select_a_reason: 'Grund auswählen',
value_is_invalid: 'Wert ist ungültig', scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Scannen Sie den QR-Code mit der Kamera-App, um das Formular auf dem Mobilgerät zu öffnen und Ihre Unterschrift zu zeichnen',
verification_code_is_invalid: 'Bestätigungscode ist ungültig',
drawn_signature_on_a_touchscreen_device: 'Gezeichnete Unterschrift auf einem Touchscreen-Gerät',
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Scannen Sie den QR-Code mit der Kamera-App, um das Formular auf dem Handy zu öffnen und Ihre Unterschrift zu zeichnen',
by_clicking_you_agree_to_the: 'Durch Klicken auf "{button}" stimmen Sie zu, dass Sie die',
electronic_signature_disclosure: 'Elektronische Unterschriftenoffenlegung',
esignature_disclosure: 'eSignatur Offenlegung',
already_paid: 'Bereits bezahlt',
minimize: 'Minimieren',
text: 'Text',
signature: 'Unterschrift',
digitally_signed_by: 'Digital unterschrieben von',
reason: 'Grund',
initials: 'Initialen',
date: 'Datum', date: 'Datum',
number: 'Nummer', number: 'Zahl',
value_is_invalid: 'Wert ist ungültig',
verification_code_is_invalid: 'Verifizierungscode ist ungültig',
already_paid: 'Bereits bezahlt',
image: 'Bild', image: 'Bild',
pay: 'Bezahlen', pay: 'Bezahlen',
take_photo: 'Foto aufnehmen',
number_phone_is_invalid: 'Telefonnummer ({number}) ist ungültig',
file: 'Datei', file: 'Datei',
select: 'Auswählen', digitally_signed_by: 'Elektronisch signiert von',
reason: 'Grund',
select: 'Auswahl',
checkbox: 'Checkbox', checkbox: 'Checkbox',
multiple: 'Mehrere', multiple: 'Mehrfach',
radio: 'Radio', radio: 'Radio',
cells: 'Zellen', cells: 'Zellen',
stamp: 'Stempel', stamp: 'Stempel',
minimize: 'Minimieren',
payment: 'Zahlung', payment: 'Zahlung',
number_phone_is_invalid: '{number} Telefonnummer ist ungültig',
phone: 'Telefon', phone: 'Telefon',
start_now: 'Jetzt starten', start_now: 'Jetzt starten',
continue: 'Fortsetzen', continue: 'Weiter',
sign_now: 'Jetzt unterschreiben', sign_now: 'Jetzt unterzeichnen',
type_here_: 'Hier eingeben...', type_here_: 'Hier eingeben...',
optional: 'optional', optional: 'optional',
option: 'Option', option: 'Option',
appears_on: 'Erscheint auf', appears_on: 'Erscheint auf',
page: 'Seite', page: 'Seite',
take_photo: 'Foto aufnehmen', select_your_option: 'Option auswählen',
select_your_option: 'Wähle deine Option', complete_hightlighted_checkboxes_and_click: 'Füllen Sie die markierten Kontrollkästchen aus und klicken Sie auf',
complete_hightlighted_checkboxes_and_click: 'Markierte Kontrollkästchen ausfüllen und klicken', submit: 'Einreichen',
submit: 'absenden', next: 'Weiter',
next: 'weiter', click_to_upload: 'Zum Hochladen klicken',
click_to_upload: 'Klicken zum Hochladen',
or_drag_and_drop_files: 'oder Dateien hierher ziehen und ablegen', or_drag_and_drop_files: 'oder Dateien hierher ziehen und ablegen',
send_copy_via_email: 'Kopie per E-Mail senden', send_copy_via_email: 'Kopie per E-Mail senden',
download: 'Herunterladen', download: 'Herunterladen',
@@ -370,140 +374,142 @@ const de = {
draw_initials: 'Initialen zeichnen', draw_initials: 'Initialen zeichnen',
type_signature_here: 'Unterschrift hier eingeben', type_signature_here: 'Unterschrift hier eingeben',
type_initial_here: 'Initialen hier eingeben', type_initial_here: 'Initialen hier eingeben',
form_has_been_completed: 'Formular wurde ausgefüllt!', form_has_been_completed: 'Formular wurde abgeschlossen!',
document_has_been_signed: 'Dokument wurde unterschrieben!', document_has_been_signed: 'Dokument wurde unterzeichnet!',
documents_have_been_signed: 'Dokumente wurden unterschrieben!', documents_have_been_signed: 'Dokumente wurden unterzeichnet!',
create_a_free_account: 'Kostenloses Konto erstellen', create_a_free_account: 'Kostenloses Konto erstellen',
powered_by: 'Bereitgestellt von', powered_by: 'Bereitgestellt von',
please_check_the_box_to_continue: 'Bitte setzen Sie das Häkchen, um fortzufahren.', please_check_the_box_to_continue: 'Bitte aktivieren Sie das Kontrollkästchen, um fortzufahren.',
open_source_documents_software: 'Open-Source-Dokumentensoftware', open_source_documents_software: 'Open-Source-Dokumentensoftware',
verified_phone_number: 'Telefonnummer überprüfen', verified_phone_number: 'Telefonnummer verifizieren',
use_international_format: 'Internationales Format verwenden: +1xxx', use_international_format: 'Internationales Format verwenden: +1xxx',
six_digits_code: '6-stelliger Code', six_digits_code: '6-stelliger Code',
change_phone_number: 'Telefonnummer ändern', change_phone_number: 'Telefonnummer ändern',
sending: 'Senden...', sending: 'Senden...',
resend_code: 'Code erneut senden', resend_code: 'Code erneut senden',
verification_code_has_been_resent: 'Die Verifizierungscode wurde erneut per SMS gesendet', verification_code_has_been_resent: 'Der Verifizierungscode wurde per SMS erneut gesendet',
please_fill_all_required_fields: 'Bitte füllen Sie alle erforderlichen Felder aus', please_fill_all_required_fields: 'Bitte füllen Sie alle Pflichtfelder aus',
set_today: 'Heute einstellen', set_today: 'Heute',
toggle_multiline_text: 'Mehrzeiligen Text umschalten',
draw_signature: 'Unterschrift zeichnen', draw_signature: 'Unterschrift zeichnen',
type_initial: 'Initialen eingeben', type_initial: 'Initialen eingeben',
draw: 'Zeichnen', draw: 'Zeichnen',
type: 'Eingeben', type: 'Eingeben',
type_text: 'Text eingeben', type_text: 'Text eingeben',
toggle_multiline_text: 'Mehrzeiligen Text umschalten', email_has_been_sent: 'E-Mail wurde gesendet',
email_has_been_sent: 'Die E-Mail wurde gesendet',
processing: 'Verarbeitung', processing: 'Verarbeitung',
pay_with_strip: 'Mit Stripe bezahlen', pay_with_stripe: 'Mit Stripe bezahlen',
reupload: 'Erneut hochladen', reupload: 'Erneut hochladen',
upload: 'Hochladen', upload: 'Hochladen',
files: 'Dateien', files: 'Dateien',
signature_is_too_small_or_simple_please_redraw: 'Die Unterschrift ist zu klein oder zu einfach. Bitte erneut zeichnen.', signature_is_too_small_or_simple_please_redraw: 'Die Unterschrift ist zu klein oder zu einfach. Bitte neu zeichnen.',
wait_countdown_seconds: 'Warte {countdown} Sekunden' wait_countdown_seconds: 'Bitte {countdown} Sekunden warten'
} }
const fr = { const fr = {
please_upload_an_image_file: 'Veuillez télécharger un fichier image', kba: 'KBA',
must_be_characters_length: 'Doit contenir {number} caractères', please_upload_an_image_file: 'Veuillez téléverser un fichier image',
complete_all_required_fields_to_proceed_with_identity_verification: "Veuillez remplir tous les champs obligatoires pour continuer la vérification de l'identité.", must_be_characters_length: 'Doit comporter {number} caractères',
verify_id: "Vérification de l'ID", complete_all_required_fields_to_proceed_with_identity_verification: "Veuillez remplir tous les champs obligatoires pour poursuivre la vérification d'identité.",
identity_verification: "Vérification de l'identité", verify_id: "Vérifier l'ID",
identity_verification: "Vérification d'identité",
complete: 'Terminer', complete: 'Terminer',
fill_all_required_fields_to_complete: 'Veuillez remplir tous les champs obligatoires pour compléter', fill_all_required_fields_to_complete: 'Remplissez tous les champs obligatoires pour terminer',
sign_and_complete: 'Signer et Terminer', sign_and_complete: 'Signer et terminer',
invite: 'Inviter', text: 'Texte',
email: 'Courriel', by_clicking_you_agree_to_the: 'En cliquant sur "{button}", vous acceptez la',
electronic_signature_disclosure: 'Déclaration relative à la signature électronique',
esignature_disclosure: 'Déclaration eSignature',
signature: 'Signature',
initials: 'Initiales',
sign_on_the_touchscreen: 'Signer sur écran tactile',
approved: 'Approuvé', approved: 'Approuvé',
reviewed: 'Révisé', reviewed: 'Révisé',
other: 'Autre', other: 'Autre',
authored_by_me: 'Rédigé par moi', authored_by_me: 'Rédigé par moi',
invite: 'Inviter',
email: 'E-mail',
approved_by: 'Approuvé par', approved_by: 'Approuvé par',
reviewed_by: 'Révisé par', reviewed_by: 'Révisé par',
authored_by: 'Rédigé par', authored_by: 'Rédigé par',
select_a_reason: 'Sélectionnez une raison', select_a_reason: 'Sélectionnez une raison',
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Scannez le QR avec l’appareil photo pour ouvrir le formulaire et signer sur mobile',
date: 'Date',
number: 'Nombre',
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',
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Scannez le code QR avec l\'application de l\'appareil photo pour ouvrir le formulaire sur mobile et dessiner votre signature',
by_clicking_you_agree_to_the: 'En cliquant sur "{button}", vous acceptez la',
electronic_signature_disclosure: 'Divulgation de Signature Électronique',
esignature_disclosure: 'Divulgation de la eSignature',
minimize: 'Réduire',
text: 'Texte',
already_paid: 'Déjà payé', already_paid: 'Déjà payé',
signature: 'Signature',
initials: 'Initiales',
digitally_signed_by: 'Signé numériquement par',
reason: 'Raison',
pay: 'Payer',
date: 'Date',
number: 'Numéro',
image: 'Image', image: 'Image',
pay: 'Payer',
take_photo: 'Prendre une photo',
number_phone_is_invalid: "Le numéro de téléphone {number} n'est pas valide",
file: 'Fichier', file: 'Fichier',
select: 'Choisir', digitally_signed_by: 'Signé électroniquement par',
reason: 'Motif',
select: 'Sélectionner',
checkbox: 'Coche', checkbox: 'Coche',
multiple: 'Multiple', multiple: 'Multiple',
radio: 'Radio', radio: 'Radio',
cells: 'Cellules', cells: 'Cellules',
stamp: 'Tampon', stamp: 'Tampon',
minimize: 'Réduire',
payment: 'Paiement', payment: 'Paiement',
number_phone_is_invalid: '{number} téléphone est invalide',
phone: 'Téléphone', phone: 'Téléphone',
start_now: 'Commencer maintenant', start_now: 'Commencer maintenant',
continue: 'Continuer', continue: 'Continuer',
sign_now: 'Signer maintenant', sign_now: 'Signer maintenant',
type_here_: 'Tapez ici...', type_here_: 'Saisissez ici...',
optional: 'facultatif', optional: 'facultatif',
option: 'Option', option: 'Option',
appears_on: 'Apparaît sur', appears_on: 'Apparaît sur',
page: 'Page', page: 'Page',
take_photo: 'Prendre une photo',
select_your_option: 'Sélectionnez votre option', select_your_option: 'Sélectionnez votre option',
complete_hightlighted_checkboxes_and_click: 'Complétez les cases à cocher en surbrillance et cliquez', complete_hightlighted_checkboxes_and_click: 'Cochez les cases mises en évidence puis cliquez',
submit: 'envoyer', submit: 'soumettre',
next: 'suivant', next: 'suivant',
click_to_upload: 'Cliquez pour télécharger', click_to_upload: 'Cliquez pour téléverser',
or_drag_and_drop_files: 'ou faites glisser-déposer les fichiers', or_drag_and_drop_files: 'ou faites glisser et déposez des fichiers',
send_copy_via_email: 'Envoyer une copie par e-mail', send_copy_via_email: 'Envoyer une copie par e-mail',
download: 'Télécharger', download: 'Télécharger',
clear: 'Effacer', clear: 'Effacer',
redraw: 'Redessiner', redraw: 'Redessiner',
draw_initials: 'Dessiner les initiales', draw_initials: 'Dessiner les initiales',
type_signature_here: 'Tapez la signature ici', type_signature_here: 'Saisissez la signature ici',
type_initial_here: 'Tapez les initiales ici', type_initial_here: 'Saisissez les initiales ici',
form_has_been_completed: 'Le formulaire a été complété !', form_has_been_completed: 'Le formulaire a été rempli !',
document_has_been_signed: 'Le document a été signé!', document_has_been_signed: 'Le document a été signé !',
documents_have_been_signed: 'Les documents ont été signés!', documents_have_been_signed: 'Les documents ont été signés !',
create_a_free_account: 'Créer un Compte Gratuit', create_a_free_account: 'Créer un compte gratuit',
powered_by: 'Propulsé par', powered_by: 'Propulsé par',
please_check_the_box_to_continue: 'Veuillez cocher la case pour continuer.', please_check_the_box_to_continue: 'Veuillez cocher la case pour continuer.',
open_source_documents_software: 'logiciel de documents open source', open_source_documents_software: 'logiciel de documents open source',
verified_phone_number: 'Vérifier le numéro de téléphone', verified_phone_number: 'Vérifier le numéro de téléphone',
use_international_format: 'Utiliser le format international : +1xxx', use_international_format: 'Utilisez le format international : +1xxx',
six_digits_code: 'Code à 6 chiffres', six_digits_code: 'Code à 6 chiffres',
change_phone_number: 'Changer le numéro de téléphone', change_phone_number: 'Changer de numéro de téléphone',
sending: 'Envoi en cours...', sending: 'Envoi...',
resend_code: 'Renvoyer le code', resend_code: 'Renvoyer le code',
verification_code_has_been_resent: 'Le code de vérification a été renvoyé par SMS', verification_code_has_been_resent: 'Le code de vérification a été renvoyé par SMS',
please_fill_all_required_fields: 'Veuillez remplir tous les champs obligatoires', please_fill_all_required_fields: 'Veuillez remplir tous les champs obligatoires',
set_today: "Définir Aujourd'hui", set_today: "Définir à aujourd'hui",
draw_signature: 'Dessiner une signature', toggle_multiline_text: 'Basculer le texte multiligne',
draw_signature: 'Dessiner la signature',
type_initial: 'Saisir les initiales', type_initial: 'Saisir les initiales',
draw: 'Dessiner', draw: 'Dessiner',
type: 'Saisir', type: 'Saisir',
type_text: 'Saisir du texte', type_text: 'Saisir du texte',
toggle_multiline_text: 'Basculer le Texte Multiligne', email_has_been_sent: "L'e-mail a été envoyé",
email_has_been_sent: "L'email a été envoyé", processing: 'Traitement en cours',
processing: 'Traitement', pay_with_stripe: 'Payer avec Stripe',
pay_with_strip: 'Paiement avec Stripe', reupload: 'Retéléverser',
reupload: 'Recharger', upload: 'Téléverser',
upload: 'Télécharger',
files: 'Fichiers', files: 'Fichiers',
signature_is_too_small_or_simple_please_redraw: 'La signature est trop petite ou trop simple. Veuillez la redessiner.', signature_is_too_small_or_simple_please_redraw: 'La signature est trop petite ou trop simple. Veuillez la redessiner.',
wait_countdown_seconds: 'Attendez {countdown} secondes' wait_countdown_seconds: 'Veuillez patienter {countdown} secondes'
} }
const pl = { const pl = {
kba: 'KBA',
please_upload_an_image_file: 'Proszę przesłać plik obrazu', please_upload_an_image_file: 'Proszę przesłać plik obrazu',
must_be_characters_length: 'Musi mieć długość {number} znaków', must_be_characters_length: 'Musi mieć długość {number} znaków',
complete_all_required_fields_to_proceed_with_identity_verification: 'Uzupełnij wszystkie wymagane pola, aby kontynuować weryfikację tożsamości.', complete_all_required_fields_to_proceed_with_identity_verification: 'Uzupełnij wszystkie wymagane pola, aby kontynuować weryfikację tożsamości.',
@@ -524,7 +530,7 @@ const pl = {
select_a_reason: 'Wybierz powód', 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', sign_on_the_touchscreen: 'Podpisz na ekranie dotykowym',
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Zeskanuj kod QR za pomocą aplikacji aparatu, aby otworzyć formularz na telefonie i narysować swój podpis', scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Zeskanuj kod QR za pomocą aplikacji aparatu, aby otworzyć formularz na telefonie i narysować swój podpis',
by_clicking_you_agree_to_the: 'Klikając na "{button}", zgadzasz się na', by_clicking_you_agree_to_the: 'Klikając na "{button}", zgadzasz się na',
electronic_signature_disclosure: 'Ujawnienie Elektronicznej Sygnatury', electronic_signature_disclosure: 'Ujawnienie Elektronicznej Sygnatury',
@@ -596,7 +602,7 @@ const pl = {
toggle_multiline_text: 'Przełącz Tekst Wielolinijkowy', toggle_multiline_text: 'Przełącz Tekst Wielolinijkowy',
email_has_been_sent: 'E-mail został wysłany', email_has_been_sent: 'E-mail został wysłany',
processing: 'Przetwarzanie', processing: 'Przetwarzanie',
pay_with_strip: 'Płatność za pomocą Stripe', pay_with_stripe: 'Płatność za pomocą Stripe',
reupload: 'Ponowne przesłanie', reupload: 'Ponowne przesłanie',
upload: 'Przesyłanie', upload: 'Przesyłanie',
files: 'Pliki', files: 'Pliki',
@@ -605,6 +611,7 @@ const pl = {
} }
const uk = { const uk = {
kba: 'KBA',
please_upload_an_image_file: 'Будь ласка, завантажте файл зображення', please_upload_an_image_file: 'Будь ласка, завантажте файл зображення',
must_be_characters_length: 'Має містити {number} символів', must_be_characters_length: 'Має містити {number} символів',
complete_all_required_fields_to_proceed_with_identity_verification: "Заповніть всі обов'язкові поля, щоб продовжити перевірку особи.", complete_all_required_fields_to_proceed_with_identity_verification: "Заповніть всі обов'язкові поля, щоб продовжити перевірку особи.",
@@ -625,7 +632,7 @@ const uk = {
select_a_reason: 'Виберіть причину', select_a_reason: 'Виберіть причину',
value_is_invalid: 'Значення є неправильним', value_is_invalid: 'Значення є неправильним',
verification_code_is_invalid: 'Код підтвердження є неправильним', verification_code_is_invalid: 'Код підтвердження є неправильним',
drawn_signature_on_a_touchscreen_device: 'Підпис на сенсорному пристрої', sign_on_the_touchscreen: 'Підписати на сенсорному екрані',
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}", ви погоджуєтеся з',
electronic_signature_disclosure: 'Розголошення Електронного Підпису', electronic_signature_disclosure: 'Розголошення Електронного Підпису',
@@ -706,6 +713,7 @@ const uk = {
} }
const cs = { const cs = {
kba: 'KBA',
please_upload_an_image_file: 'Nahrajte prosím obrázkový soubor', please_upload_an_image_file: 'Nahrajte prosím obrázkový soubor',
must_be_characters_length: 'Musí mít délku {number} znaků', must_be_characters_length: 'Musí mít délku {number} znaků',
complete_all_required_fields_to_proceed_with_identity_verification: 'Vyplňte všechna povinná pole, abyste mohli pokračovat v ověření identity.', complete_all_required_fields_to_proceed_with_identity_verification: 'Vyplňte všechna povinná pole, abyste mohli pokračovat v ověření identity.',
@@ -726,7 +734,7 @@ const cs = {
select_a_reason: 'Vyberte důvod', 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í', sign_on_the_touchscreen: 'Podepsat na dotykové obrazovce',
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Naskenujte QR kód pomocí aplikace fotoaparátu, abyste otevřeli formulář na mobilním zařízení a nakreslili svůj podpis', scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Naskenujte QR kód pomocí aplikace fotoaparátu, abyste otevřeli formulář na mobilním zařízení a nakreslili svůj podpis',
by_clicking_you_agree_to_the: 'Kliknutím na "{button}" souhlasíte s', by_clicking_you_agree_to_the: 'Kliknutím na "{button}" souhlasíte s',
electronic_signature_disclosure: 'Zveřejněním Elektronického Podpisu', electronic_signature_disclosure: 'Zveřejněním Elektronického Podpisu',
@@ -798,7 +806,7 @@ const cs = {
toggle_multiline_text: 'Přepnout Víceřádkový Text', toggle_multiline_text: 'Přepnout Víceřádkový Text',
email_has_been_sent: 'E-mail byl odeslán', email_has_been_sent: 'E-mail byl odeslán',
processing: 'Zpracování', processing: 'Zpracování',
pay_with_strip: 'Zaplacení přes Stripe', pay_with_stripe: 'Zaplacení přes Stripe',
reupload: 'Znovu nahrát', reupload: 'Znovu nahrát',
upload: 'Nahrát', upload: 'Nahrát',
files: 'Soubory', files: 'Soubory',
@@ -807,6 +815,7 @@ const cs = {
} }
const pt = { const pt = {
kba: 'KBA',
please_upload_an_image_file: 'Por favor, envie um arquivo de imagem', please_upload_an_image_file: 'Por favor, envie um arquivo de imagem',
must_be_characters_length: 'Deve ter {number} caracteres', must_be_characters_length: 'Deve ter {number} caracteres',
complete_all_required_fields_to_proceed_with_identity_verification: 'Preencha todos os campos obrigatórios para prosseguir com a verificação de identidade.', complete_all_required_fields_to_proceed_with_identity_verification: 'Preencha todos os campos obrigatórios para prosseguir com a verificação de identidade.',
@@ -827,7 +836,7 @@ const pt = {
select_a_reason: 'Selecione um motivo', 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', sign_on_the_touchscreen: 'Assinar na tela sensível',
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Escaneie o código QR com o aplicativo da câmera para abrir o formulário no celular e desenhar sua assinatura', scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Escaneie o código QR com o aplicativo da câmera para abrir o formulário no celular e desenhar sua assinatura',
by_clicking_you_agree_to_the: 'Ao clicar em "{button}", você concorda com o', by_clicking_you_agree_to_the: 'Ao clicar em "{button}", você concorda com o',
electronic_signature_disclosure: 'Divulgação de Assinatura Eletrônica', electronic_signature_disclosure: 'Divulgação de Assinatura Eletrônica',
@@ -899,7 +908,7 @@ const pt = {
toggle_multiline_text: 'Alternar Texto Multilinha', toggle_multiline_text: 'Alternar Texto Multilinha',
email_has_been_sent: 'Email enviado', email_has_been_sent: 'Email enviado',
processing: 'Processamento', processing: 'Processamento',
pay_with_strip: 'Pagar com Stripe', pay_with_stripe: 'Pagar com Stripe',
reupload: 'Reenviar', reupload: 'Reenviar',
upload: 'Carregar', upload: 'Carregar',
files: 'Arquivos', files: 'Arquivos',
@@ -908,6 +917,7 @@ const pt = {
} }
const he = { const he = {
kba: 'KBA',
please_upload_an_image_file: 'אנא העלה קובץ תמונה', please_upload_an_image_file: 'אנא העלה קובץ תמונה',
must_be_characters_length: 'חייב להיות באורך של {number} תווים', must_be_characters_length: 'חייב להיות באורך של {number} תווים',
complete_all_required_fields_to_proceed_with_identity_verification: 'מלא את כל השדות הנדרשים כדי להמשיך עם אימות זהות.', complete_all_required_fields_to_proceed_with_identity_verification: 'מלא את כל השדות הנדרשים כדי להמשיך עם אימות זהות.',
@@ -928,7 +938,7 @@ const he = {
select_a_reason: 'בחר סיבה', select_a_reason: 'בחר סיבה',
value_is_invalid: 'ערך לא תקין', value_is_invalid: 'ערך לא תקין',
verification_code_is_invalid: 'קוד האימות אינו תקין', verification_code_is_invalid: 'קוד האימות אינו תקין',
drawn_signature_on_a_touchscreen_device: 'חתימה שנוצרה במכשיר עם מסך מגע', sign_on_the_touchscreen: 'חתום על מסך המגע',
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}", אתה מסכים ל',
electronic_signature_disclosure: 'חשיפת חתימה אלקטרונית', electronic_signature_disclosure: 'חשיפת חתימה אלקטרונית',
@@ -1000,7 +1010,7 @@ const he = {
type_text: 'הקלד טקסט', type_text: 'הקלד טקסט',
email_has_been_sent: 'האימייל נשלח', email_has_been_sent: 'האימייל נשלח',
processing: 'מעבד', processing: 'מעבד',
pay_with_strip: 'שלם עם סטרייפ', pay_with_stripe: 'שלם עם סטרייפ',
reupload: 'העלה שוב', reupload: 'העלה שוב',
upload: 'העלאה', upload: 'העלאה',
files: 'קבצים', files: 'קבצים',
@@ -1009,6 +1019,7 @@ const he = {
} }
const nl = { const nl = {
kba: 'KBA',
please_upload_an_image_file: 'Upload alstublieft een afbeeldingsbestand', please_upload_an_image_file: 'Upload alstublieft een afbeeldingsbestand',
must_be_characters_length: 'Moet {number} tekens lang zijn', must_be_characters_length: 'Moet {number} tekens lang zijn',
complete_all_required_fields_to_proceed_with_identity_verification: 'Vul alle verplichte velden in om door te gaan met de identiteitsverificatie.', complete_all_required_fields_to_proceed_with_identity_verification: 'Vul alle verplichte velden in om door te gaan met de identiteitsverificatie.',
@@ -1029,7 +1040,7 @@ const nl = {
select_a_reason: 'Selecteer een reden', 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', sign_on_the_touchscreen: 'Onderteken op touchscreen',
scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Scan de QR-code met de camera-app om het formulier op mobiel te openen en uw handtekening te tekenen', scan_the_qr_code_with_the_camera_app_to_open_the_form_on_mobile_and_draw_your_signature: 'Scan de QR-code met de camera-app om het formulier op mobiel te openen en uw handtekening te tekenen',
by_clicking_you_agree_to_the: 'Door op "{button}" te klikken, gaat u akkoord met de', by_clicking_you_agree_to_the: 'Door op "{button}" te klikken, gaat u akkoord met de',
electronic_signature_disclosure: 'Openbaarmaking van Elektronische Handtekening', electronic_signature_disclosure: 'Openbaarmaking van Elektronische Handtekening',
@@ -1101,7 +1112,7 @@ const nl = {
type_text: 'Typ tekst', type_text: 'Typ tekst',
email_has_been_sent: 'E-mail is verzonden', email_has_been_sent: 'E-mail is verzonden',
processing: 'Verwerken', processing: 'Verwerken',
pay_with_strip: 'Betalen met Stripe', pay_with_stripe: 'Betalen met Stripe',
reupload: 'Opnieuw uploaden', reupload: 'Opnieuw uploaden',
upload: 'Uploaden', upload: 'Uploaden',
files: 'Bestanden', files: 'Bestanden',
@@ -1110,6 +1121,7 @@ const nl = {
} }
const ar = { const ar = {
kba: 'KBA',
please_upload_an_image_file: 'يرجى تحميل ملف صورة', please_upload_an_image_file: 'يرجى تحميل ملف صورة',
must_be_characters_length: 'يجب أن يكون الطول {number} حرفًا', must_be_characters_length: 'يجب أن يكون الطول {number} حرفًا',
complete_all_required_fields_to_proceed_with_identity_verification: 'أكمل جميع الحقول المطلوبة للمتابعة في التحقق من الهوية.', complete_all_required_fields_to_proceed_with_identity_verification: 'أكمل جميع الحقول المطلوبة للمتابعة في التحقق من الهوية.',
@@ -1131,7 +1143,7 @@ const ar = {
value_is_invalid: 'القيمة غير صالحة', value_is_invalid: 'القيمة غير صالحة',
verification_code_is_invalid: 'رمز التحقق غير صالح', verification_code_is_invalid: 'رمز التحقق غير صالح',
already_paid: 'تم الدفع بالفعل', already_paid: 'تم الدفع بالفعل',
drawn_signature_on_a_touchscreen_device: 'توقيع مرسوم على جهاز بشاشة تعمل باللمس', sign_on_the_touchscreen: 'وقع على شاشة اللمس',
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: 'امسح رمز الاستجابة السريعة باستخدام تطبيق الكاميرا لفتح النموذج على الهاتف المحمول ورسم توقيعك',
by_clicking_you_agree_to_the: 'بالنقر فوق "{button}"، أنت توافق على', by_clicking_you_agree_to_the: 'بالنقر فوق "{button}"، أنت توافق على',
electronic_signature_disclosure: 'كشف التوقيع الإلكتروني', electronic_signature_disclosure: 'كشف التوقيع الإلكتروني',
@@ -1211,6 +1223,7 @@ const ar = {
} }
const ko = { const ko = {
kba: 'KBA',
please_upload_an_image_file: '이미지 파일을 업로드해 주세요', please_upload_an_image_file: '이미지 파일을 업로드해 주세요',
must_be_characters_length: '{number}자여야 합니다', must_be_characters_length: '{number}자여야 합니다',
complete_all_required_fields_to_proceed_with_identity_verification: '신원 확인을 진행하려면 모든 필수 필드를 작성하십시오.', complete_all_required_fields_to_proceed_with_identity_verification: '신원 확인을 진행하려면 모든 필수 필드를 작성하십시오.',
@@ -1229,7 +1242,7 @@ const ko = {
reviewed_by: '검토자', reviewed_by: '검토자',
authored_by: '작성자', authored_by: '작성자',
select_a_reason: '이유 선택', select_a_reason: '이유 선택',
drawn_signature_on_a_touchscreen_device: '터치스크린 장치에서 그린 서명', sign_on_the_touchscreen: '터치스크린에서 서명',
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}"를 클릭함으로써, 다음에 동의하게 됩니다',
electronic_signature_disclosure: '전자 서명 공개', electronic_signature_disclosure: '전자 서명 공개',
@@ -1303,7 +1316,7 @@ const ko = {
type_text: '텍스트 입력', type_text: '텍스트 입력',
email_has_been_sent: '이메일이 전송되었습니다', email_has_been_sent: '이메일이 전송되었습니다',
processing: '처리 중', processing: '처리 중',
pay_with_strip: '스트라이프로 결제', pay_with_stripe: '스트라이프로 결제',
reupload: '다시 업로드', reupload: '다시 업로드',
upload: '업로드', upload: '업로드',
files: '파일', files: '파일',
@@ -1312,6 +1325,7 @@ const ko = {
} }
const ja = { const ja = {
kba: 'KBA',
please_upload_an_image_file: '画像ファイルをアップロードしてください', please_upload_an_image_file: '画像ファイルをアップロードしてください',
must_be_characters_length: '{number}文字でなければなりません', must_be_characters_length: '{number}文字でなければなりません',
complete_all_required_fields_to_proceed_with_identity_verification: '本人確認を進めるには、すべての必須項目を入力してください。', complete_all_required_fields_to_proceed_with_identity_verification: '本人確認を進めるには、すべての必須項目を入力してください。',
@@ -1326,7 +1340,7 @@ const ja = {
esignature_disclosure: '電子署名開示', esignature_disclosure: '電子署名開示',
signature: '署名', signature: '署名',
initials: 'イニシャル', initials: 'イニシャル',
drawn_signature_on_a_touchscreen_device: 'タッチスクリーンデバイスで描かれた署名', sign_on_the_touchscreen: 'タッチスクリーンで署名',
approved: '承認済み', approved: '承認済み',
reviewed: '確認済み', reviewed: '確認済み',
other: 'その他', other: 'その他',
@@ -1404,7 +1418,7 @@ const ja = {
type_text: 'テキストを入力', type_text: 'テキストを入力',
email_has_been_sent: 'メールが送信されました', email_has_been_sent: 'メールが送信されました',
processing: '処理中', processing: '処理中',
pay_with_strip: 'Stripeで支払う', pay_with_stripe: 'Stripeで支払う',
reupload: '再アップロード', reupload: '再アップロード',
upload: 'アップロード', upload: 'アップロード',
files: 'ファイル', files: 'ファイル',
@@ -19,7 +19,7 @@
<div class="space-x-2 flex flex-none"> <div class="space-x-2 flex flex-none">
<span <span
v-if="isDrawInitials" v-if="isDrawInitials"
class="tooltip" class="md:tooltip"
:data-tip="t('type_initial')" :data-tip="t('type_initial')"
> >
<a <a
@@ -36,7 +36,7 @@
</span> </span>
<span <span
v-else v-else
class="tooltip ml-2" class="md:tooltip ml-2"
:data-tip="t('draw_initials')" :data-tip="t('draw_initials')"
> >
<a <a
@@ -52,7 +52,7 @@
</a> </a>
</span> </span>
<span <span
class="tooltip" class="md:tooltip"
:data-tip="t('click_to_upload')" :data-tip="t('click_to_upload')"
> >
<label class="btn btn-outline btn-sm font-medium inline-flex flex-nowrap upload-image-button"> <label class="btn btn-outline btn-sm font-medium inline-flex flex-nowrap upload-image-button">
@@ -123,6 +123,11 @@
v-if="!isDrawInitials" v-if="!isDrawInitials"
class="absolute top-0 right-0 left-0 bottom-0" class="absolute top-0 right-0 left-0 bottom-0"
/> />
<label
v-if="!isDrawInitials && !modelValue && !computedPreviousValue"
for="initials_text_input"
class="absolute top-0 right-0 left-0 bottom-0"
/>
<canvas <canvas
v-show="!modelValue && !computedPreviousValue" v-show="!modelValue && !computedPreviousValue"
ref="canvas" ref="canvas"
+576
View File
@@ -0,0 +1,576 @@
<template>
<label
v-if="!error"
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5 field-name-label"
>
<MarkdownContent
v-if="field.title"
:string="field.title"
/>
<template v-else>{{ field.name || 'Knowledge Based Authentication' }}</template>
<span
v-if="questions"
class="float-right font-normal text-neutral-500 mt-1 whitespace-nowrap text-right text-sm"
>
<span>Question {{ currentQuestionIndex + 1 }} / {{ questions.length }}</span>
<span
v-if="timeLeftSeconds !== null"
class="block"
>
Time left: {{ formattedTimeLeft }}
</span>
</span>
</label>
<div
v-if="field.description"
dir="auto"
class="mb-4 px-1 field-description-text"
>
<MarkdownContent :string="field.description" />
</div>
<div
v-if="isRequiredFieldEmpty"
class="px-1 field-description-text"
>
{{ t('complete_all_required_fields_to_proceed_with_identity_verification') }}
</div>
<div
v-if="error"
class="mb-4 text-center"
>
<div class="text-xl mb-4">
{{ error }}
</div>
<button
class="base-button w-full flex justify-center submit-form-button"
@click="restartKba"
>
{{ questions ? 'Restart KBA' : 'Retry' }}
</button>
</div>
<div
v-if="isLoading"
class="w-full flex space-x-2 justify-center mb-2"
>
<IconInnerShadowTop
width="40"
class="animate-spin h-10"
/>
</div>
<div v-else-if="questions && !error">
<form @submit.prevent="nextQuestion">
<div class="mb-6 px-1">
<p class="font-semibold mb-4 text-lg">
{{ currentQuestion.prompt }}
</p>
<div class="space-y-3.5 mx-auto">
<div
v-for="(answer, index) in currentQuestion.answers"
:key="`${currentQuestion.id}_${index}`"
>
<label
:for="`${currentQuestion.id}_${index}`"
class="flex items-center space-x-3 radio-label"
>
<input
:id="`${currentQuestion.id}_${index}`"
v-model="answers[currentQuestion.id]"
type="radio"
:name="currentQuestion.id"
:value="answer.text"
class="base-radio !h-7 !w-7"
required
>
<span class="text-xl">{{ answer.text }}</span>
</label>
</div>
</div>
</div>
<div class="mt-6">
<button
type="submit"
class="base-button w-full flex justify-center submit-form-button"
:disabled="isSubmitting || !answers[currentQuestion.id]"
>
<span class="flex">
<IconInnerShadowTop
v-if="isSubmitting"
class="mr-1 animate-spin"
/>
<span>
{{ isLastQuestion ? (isSubmitting ? t('submitting_') : t('complete')) : t('next') }}
</span><span
v-if="isSubmitting"
class="w-6 flex justify-start mr-1"
><span>...</span></span>
</span>
</button>
</div>
</form>
</div>
<div v-else-if="!error && !isRequiredFieldEmpty">
<form @submit.prevent="startKba">
<div class="grid grid-cols-6 gap-x-2 md:gap-x-4 md:gap-y-2 mb-4">
<div class="col-span-3">
<label
for="kba_fn"
class="label text-sm md:text-base"
>First Name</label>
<input
id="kba_fn"
v-model="form.fn"
type="text"
class="input input-bordered !h-10 w-full bg-white"
required
>
</div>
<div class="col-span-3">
<label
for="kba_ln"
class="label text-sm md:text-base"
>Last Name</label>
<input
id="kba_ln"
v-model="form.ln"
type="text"
class="input input-bordered !h-10 w-full bg-white"
required
>
</div>
<div class="col-span-6">
<label
for="kba_addr"
class="label text-sm md:text-base"
>Address</label>
<input
id="kba_addr"
v-model="form.addr"
type="text"
class="input input-bordered !h-10 w-full bg-white"
required
>
</div>
<div class="col-span-2">
<label
for="kba_city"
class="label text-sm md:text-base"
>City</label>
<input
id="kba_city"
v-model="form.city"
type="text"
class="input input-bordered !h-10 w-full bg-white"
required
>
</div>
<div class="col-span-2">
<label
for="kba_state"
class="label text-sm md:text-base"
>State</label>
<select
id="kba_state"
v-model="form.state"
class="select select-bordered !h-10 min-h-[2.5rem] w-full bg-white font-normal !text-base"
required
>
<option
value=""
disabled
>
Select State
</option>
<option
v-for="state in states"
:key="state.code"
:value="state.code"
>
{{ state.name }}
</option>
</select>
</div>
<div class="col-span-2">
<label
for="kba_zip"
class="label text-sm md:text-base"
>Zip</label>
<input
id="kba_zip"
v-model="form.zip"
type="text"
class="input input-bordered !h-10 w-full bg-white"
required
>
</div>
<div class="col-span-3">
<label
for="kba_phone"
class="label text-sm md:text-base"
>Phone</label>
<input
id="kba_phone"
v-model="form.phone"
type="text"
class="input input-bordered !h-10 w-full bg-white"
required
>
</div>
<div class="col-span-3">
<label
for="kba_email"
class="label text-sm md:text-base"
>Email</label>
<input
id="kba_email"
v-model="form.email"
type="email"
class="input input-bordered !h-10 w-full bg-white"
required
>
</div>
<div class="col-span-3">
<label
for="kba_dob"
class="label text-sm md:text-base"
>DOB</label>
<input
id="kba_dob"
v-model="form.dob"
type="date"
class="input input-bordered !h-10 md:w-full bg-white"
required
>
</div>
<div class="col-span-3">
<label
for="kba_ssn"
class="label text-sm md:text-base"
>SSN</label>
<input
id="kba_ssn"
v-model="form.ssn"
type="text"
class="input input-bordered !h-10 w-full bg-white"
required
>
</div>
</div>
<div class="mt-6">
<button
type="submit"
class="base-button w-full flex justify-center submit-form-button"
:disabled="isLoading"
>
<span class="flex">
<IconInnerShadowTop
v-if="isLoading"
class="mr-1 animate-spin"
/>
<span>
{{ isLoading ? 'Loading...' : 'Start Verification' }}
</span><span
v-if="isLoading"
class="w-6 flex justify-start mr-1"
><span>...</span></span>
</span>
</button>
</div>
</form>
</div>
</template>
<script>
import MarkdownContent from './markdown_content'
import { IconInnerShadowTop } from '@tabler/icons-vue'
export default {
name: 'KbaStep',
components: {
MarkdownContent,
IconInnerShadowTop
},
inject: ['baseUrl', 't'],
props: {
field: {
type: Object,
required: true
},
submitter: {
type: Object,
required: true
},
submitterSlug: {
type: String,
required: true
},
emptyValueRequiredStep: {
type: Object,
required: false,
default: null
},
values: {
type: Object,
required: true
}
},
emits: ['submit'],
data () {
return {
isLoading: false,
isSubmitting: false,
questions: null,
currentQuestionIndex: 0,
token: null,
reference: null,
answers: {},
error: null,
timeLeftSeconds: null,
countdownIntervalId: null,
form: {
fn: '',
ln: '',
addr: '',
city: '',
state: '',
zip: '',
dob: '',
ssn: '',
phone: '',
email: ''
}
}
},
computed: {
currentQuestion () {
return this.questions ? this.questions[this.currentQuestionIndex] : null
},
isRequiredFieldEmpty () {
return this.emptyValueRequiredStep && this.emptyValueRequiredStep[0] !== this.field
},
kbaTimeLimitSeconds () {
return 90
},
states () {
return [
{ code: 'AL', name: 'Alabama' },
{ code: 'AK', name: 'Alaska' },
{ code: 'AZ', name: 'Arizona' },
{ code: 'AR', name: 'Arkansas' },
{ code: 'CA', name: 'California' },
{ code: 'CO', name: 'Colorado' },
{ code: 'CT', name: 'Connecticut' },
{ code: 'DE', name: 'Delaware' },
{ code: 'DC', name: 'District of Columbia' },
{ code: 'FL', name: 'Florida' },
{ code: 'GA', name: 'Georgia' },
{ code: 'HI', name: 'Hawaii' },
{ code: 'ID', name: 'Idaho' },
{ code: 'IL', name: 'Illinois' },
{ code: 'IN', name: 'Indiana' },
{ code: 'IA', name: 'Iowa' },
{ code: 'KS', name: 'Kansas' },
{ code: 'KY', name: 'Kentucky' },
{ code: 'LA', name: 'Louisiana' },
{ code: 'ME', name: 'Maine' },
{ code: 'MD', name: 'Maryland' },
{ code: 'MA', name: 'Massachusetts' },
{ code: 'MI', name: 'Michigan' },
{ code: 'MN', name: 'Minnesota' },
{ code: 'MS', name: 'Mississippi' },
{ code: 'MO', name: 'Missouri' },
{ code: 'MT', name: 'Montana' },
{ code: 'NE', name: 'Nebraska' },
{ code: 'NV', name: 'Nevada' },
{ code: 'NH', name: 'New Hampshire' },
{ code: 'NJ', name: 'New Jersey' },
{ code: 'NM', name: 'New Mexico' },
{ code: 'NY', name: 'New York' },
{ code: 'NC', name: 'North Carolina' },
{ code: 'ND', name: 'North Dakota' },
{ code: 'OH', name: 'Ohio' },
{ code: 'OK', name: 'Oklahoma' },
{ code: 'OR', name: 'Oregon' },
{ code: 'PA', name: 'Pennsylvania' },
{ code: 'RI', name: 'Rhode Island' },
{ code: 'SC', name: 'South Carolina' },
{ code: 'SD', name: 'South Dakota' },
{ code: 'TN', name: 'Tennessee' },
{ code: 'TX', name: 'Texas' },
{ code: 'UT', name: 'Utah' },
{ code: 'VT', name: 'Vermont' },
{ code: 'VA', name: 'Virginia' },
{ code: 'WA', name: 'Washington' },
{ code: 'WV', name: 'West Virginia' },
{ code: 'WI', name: 'Wisconsin' },
{ code: 'WY', name: 'Wyoming' }
]
},
isLastQuestion () {
return this.questions && this.currentQuestionIndex === this.questions.length - 1
},
formattedTimeLeft () {
if (this.timeLeftSeconds === null) return ''
const minutes = Math.floor(this.timeLeftSeconds / 60)
const seconds = this.timeLeftSeconds % 60
return `${minutes}:${String(seconds).padStart(2, '0')}`
}
},
beforeUnmount () {
this.clearCountdown()
},
methods: {
clearCountdown () {
if (this.countdownIntervalId) {
clearInterval(this.countdownIntervalId)
this.countdownIntervalId = null
}
this.timeLeftSeconds = null
},
startCountdown () {
this.clearCountdown()
this.timeLeftSeconds = this.kbaTimeLimitSeconds
this.countdownIntervalId = setInterval(() => {
if (this.timeLeftSeconds === null) return
this.timeLeftSeconds -= 1
if (this.timeLeftSeconds <= 0) {
this.handleTimeout()
}
}, 1000)
},
handleTimeout () {
this.clearCountdown()
this.questions = null
this.token = null
this.reference = null
this.answers = {}
this.currentQuestionIndex = 0
this.error = `Knowledge Based Authentication timed out. You only have ${this.kbaTimeLimitSeconds} seconds to complete the verification. Please retry.`
},
nextQuestion () {
if (this.isLastQuestion) {
this.$emit('submit')
} else {
this.currentQuestionIndex++
}
},
restartKba () {
this.clearCountdown()
this.questions = null
this.token = null
this.reference = null
this.answers = {}
this.currentQuestionIndex = 0
this.error = null
},
async startKba () {
this.isLoading = true
this.error = null
this.clearCountdown()
try {
const payload = { ...this.form, submitter_slug: this.submitterSlug }
if (payload.dob) {
payload.dob = payload.dob.replace(/-/g, '')
}
if (payload.ssn) {
payload.ssn = payload.ssn.replace(/\D/g, '')
}
if (payload.phone) {
payload.phone = payload.phone.replace(/^\+1/, '')
}
const resp = await fetch(this.baseUrl + '/api/kba', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
})
if (!resp.ok) throw new Error('Failed to start KBA')
const data = await resp.json()
if (data.result && data.result.action === 'FAIL') {
if (data.result.detail === 'NO MATCH') {
throw new Error('Unfortunately, we were unable to start Knowledge Based Authentication with the details provided. Please review and confirm that all your personal details are correct.')
}
throw new Error(data.result.detail || 'KBA Start Failed')
}
if (data.output && data.output.questions && data.output.questions.questions) {
this.questions = data.output.questions.questions
this.token = data.continuations.questions.template.token
this.reference = data.meta.reference
this.questions.forEach(q => {
this.answers[q.id] = null
})
this.startCountdown()
} else {
throw new Error('Invalid KBA response')
}
} catch (e) {
this.error = e.message
} finally {
this.isLoading = false
}
},
async submit () {
this.clearCountdown()
this.isSubmitting = true
this.error = null
const formattedAnswers = Object.keys(this.answers).reduce((acc, key) => {
acc[key] = [this.answers[key]]
return acc
}, {})
try {
const resp = await fetch(this.baseUrl + `/api/kba/${this.field.uuid}`, {
method: 'PUT',
body: JSON.stringify({
token: this.token,
answers: formattedAnswers,
reference: this.reference,
submitter_slug: this.submitterSlug
}),
headers: { 'Content-Type': 'application/json' }
})
const data = await resp.json()
if (data.result?.action !== 'PASS') {
this.error = 'Knowledge Based Authentication Failed - make sure you provide correct answers for the Knowledge Based authentication.'
throw new Error('Knowledge Based Authentication Failed')
}
if (!resp.ok) {
this.error = 'Failed to submit answers'
throw new Error('Failed to submit answers')
}
return resp
} finally {
this.isSubmitting = false
}
}
}
}
</script>
@@ -62,7 +62,7 @@
width="22" width="22"
/> />
<span> <span>
{{ t('pay_with_strip') }} {{ t('pay_with_stripe') }}
</span> </span>
</button> </button>
</div> </div>
@@ -100,7 +100,7 @@
<input <input
:id="field.uuid" :id="field.uuid"
ref="phone" ref="phone"
:value="phoneValue" :value="defaultValue && detectedPhoneValueDialCode ? phoneValue.split('+' + detectedPhoneValueDialCode).slice(-1).join('') : phoneValue"
:readonly="!!defaultValue" :readonly="!!defaultValue"
class="base-input !text-2xl !rounded-l-none !border-l-0 !outline-none w-full" class="base-input !text-2xl !rounded-l-none !border-l-0 !outline-none w-full"
autocomplete="tel" autocomplete="tel"
@@ -22,7 +22,7 @@
<div class="space-x-2 flex flex-none"> <div class="space-x-2 flex flex-none">
<span <span
v-if="isTextSignature && format !== 'typed_or_upload' && format !== 'typed' && format !== 'upload'" v-if="isTextSignature && format !== 'typed_or_upload' && format !== 'typed' && format !== 'upload'"
class="tooltip" class="md:tooltip"
:data-tip="t('draw_signature')" :data-tip="t('draw_signature')"
> >
<a <a
@@ -39,7 +39,7 @@
</span> </span>
<span <span
v-else-if="withTypedSignature && format !== 'drawn_or_upload' && format !== 'typed_or_upload' && format !== 'typed' && format !== 'drawn' && format !== 'upload'" v-else-if="withTypedSignature && format !== 'drawn_or_upload' && format !== 'typed_or_upload' && format !== 'typed' && format !== 'drawn' && format !== 'upload'"
class="tooltip ml-2" class="md:tooltip ml-2"
:class="{ 'hidden sm:inline': modelValue || computedPreviousValue }" :class="{ 'hidden sm:inline': modelValue || computedPreviousValue }"
:data-tip="t('type_text')" :data-tip="t('type_text')"
> >
@@ -57,7 +57,7 @@
</span> </span>
<span <span
v-if="format !== 'typed' && format !== 'drawn' && format !== 'upload' && format !== 'drawn_or_typed'" v-if="format !== 'typed' && format !== 'drawn' && format !== 'upload' && format !== 'drawn_or_typed'"
class="tooltip" class="md:tooltip"
:class="{ 'hidden sm:inline': modelValue || computedPreviousValue }" :class="{ 'hidden sm:inline': modelValue || computedPreviousValue }"
:data-tip="t('take_photo')" :data-tip="t('take_photo')"
> >
@@ -86,8 +86,8 @@
</a> </a>
<span <span
v-if="withQrButton && !modelValue && !computedPreviousValue && format !== 'typed_or_upload' && format !== 'typed' && format !== 'upload'" v-if="withQrButton && !modelValue && !computedPreviousValue && format !== 'typed_or_upload' && format !== 'typed' && format !== 'upload'"
class="tooltip before:translate-x-[-90%]" class="md:tooltip before:translate-x-[-90%]"
:data-tip="t('drawn_signature_on_a_touchscreen_device')" :data-tip="t('sign_on_the_touchscreen')"
> >
<a <a
href="#" href="#"
@@ -142,7 +142,7 @@
/> />
<div <div
v-else v-else
class="relative" class="relative select-none"
> >
<div <div
v-if="!modelValue && !computedPreviousValue && !isShowQr && !isTextSignature && isSignatureStarted" v-if="!modelValue && !computedPreviousValue && !isShowQr && !isTextSignature && isSignatureStarted"
@@ -176,7 +176,7 @@
class="top-0 bottom-0 right-0 left-0 absolute bg-base-content/10 rounded-2xl" class="top-0 bottom-0 right-0 left-0 absolute bg-base-content/10 rounded-2xl"
> >
<div <div
class="absolute top-1.5 right-1.5 tooltip" class="absolute top-1.5 right-1.5 md:tooltip"
> >
<a <a
href="#" href="#"
@@ -211,7 +211,7 @@
@input="updateWrittenSignature" @input="updateWrittenSignature"
> >
<select <select
v-if="requireSigningReason && !isOtherReason" v-if="withSigningReason && !isOtherReason"
class="select base-input !text-2xl w-full mt-6 text-center" class="select base-input !text-2xl w-full mt-6 text-center"
:class="{ 'text-gray-300': !reason }" :class="{ 'text-gray-300': !reason }"
required required
@@ -226,24 +226,37 @@
> >
{{ t('select_a_reason') }} {{ t('select_a_reason') }}
</option> </option>
<option <template v-if="field.preferences?.reasons">
v-for="(label, option) in defaultReasons" <option
:key="option" v-for="option in field.preferences.reasons"
:value="option" :key="option"
:selected="reason === option" :value="option"
class="text-base-content" :selected="reason === option"
> class="text-base-content"
{{ label }} >
</option> {{ option }}
<option </option>
value="other" </template>
class="text-base-content" <template v-else>
> <option
{{ t('other') }} v-for="(label, option) in defaultReasons"
</option> :key="option"
:value="option"
:selected="reason === option"
class="text-base-content"
>
{{ label }}
</option>
<option
value="other"
class="text-base-content"
>
{{ t('other') }}
</option>
</template>
</select> </select>
<input <input
v-if="requireSigningReason && isOtherReason" v-if="withSigningReason && isOtherReason"
class="base-input !text-2xl w-full mt-6" class="base-input !text-2xl w-full mt-6"
required required
:name="`values[${field.preferences.reason_field_uuid}]`" :name="`values[${field.preferences.reason_field_uuid}]`"
@@ -253,7 +266,7 @@
@input="$emit('update:reason', $event.target.value)" @input="$emit('update:reason', $event.target.value)"
> >
<input <input
v-if="requireSigningReason" v-if="withSigningReason"
hidden hidden
name="with_reason" name="with_reason"
:value="field.preferences.reason_field_uuid" :value="field.preferences.reason_field_uuid"
@@ -268,7 +281,7 @@
<div <div
v-else-if="withDisclosure" v-else-if="withDisclosure"
dir="auto" dir="auto"
class="text-base-content/60 text-xs text-center w-full mt-1" class="text-base-content/60 text-xs text-center w-full mt-1 select-none"
> >
{{ t('by_clicking_you_agree_to_the').replace('{button}', buttonText.charAt(0).toUpperCase() + buttonText.slice(1)) }} <a {{ t('by_clicking_you_agree_to_the').replace('{button}', buttonText.charAt(0).toUpperCase() + buttonText.slice(1)) }} <a
href="https://www.docuseal.com/esign-disclosure" href="https://www.docuseal.com/esign-disclosure"
@@ -406,6 +419,9 @@ export default {
format () { format () {
return this.field.preferences?.format return this.field.preferences?.format
}, },
withSigningReason () {
return this.requireSigningReason || this.field.preferences?.reasons?.length
},
defaultReasons () { defaultReasons () {
return { return {
[this.t('approved_by')]: this.t('approved'), [this.t('approved_by')]: this.t('approved'),
@@ -424,10 +440,11 @@ export default {
created () { created () {
this.isSignatureStarted = !!this.computedPreviousValue this.isSignatureStarted = !!this.computedPreviousValue
if (this.requireSigningReason) { if (this.withSigningReason) {
this.field.preferences ||= {} this.field.preferences ||= {}
this.field.preferences.reason_field_uuid ||= v4() this.field.preferences.reason_field_uuid ||= v4()
this.isOtherReason = this.reason && !this.defaultReasons[this.reason] this.isOtherReason = this.reason && !this.defaultReasons[this.reason] &&
(!this.field.preferences?.reasons?.length || !this.field.preferences.reasons.includes(this.reason))
} }
}, },
async mounted () { async mounted () {
+219 -18
View File
@@ -175,7 +175,10 @@
{{ t('save') }} {{ t('save') }}
</span> </span>
</button> </button>
<div class="dropdown dropdown-end"> <div
class="dropdown dropdown-end"
:class="{ 'dropdown-open': isDownloading }"
>
<label <label
tabindex="0" tabindex="0"
class="base-button !rounded-l-none !pl-1 !pr-2 !border-l-neutral-500" class="base-button !rounded-l-none !pl-1 !pr-2 !border-l-neutral-500"
@@ -209,6 +212,30 @@
<span class="whitespace-nowrap">{{ t('preferences') }}</span> <span class="whitespace-nowrap">{{ t('preferences') }}</span>
</a> </a>
</li> </li>
<li v-if="withDownload">
<button
class="flex space-x-2"
:disabled="isDownloading"
@click.stop.prevent="download"
>
<IconInnerShadowTop
v-if="isDownloading"
class="animate-spin w-6 h-6 flex-shrink-0"
/>
<IconDownload
v-else
class="w-6 h-6 flex-shrink-0"
/>
<span
v-if="isDownloading"
class="whitespace-nowrap"
>{{ t('downloading_') }}</span>
<span
v-else
class="whitespace-nowrap"
>{{ t('download') }}</span>
</button>
</li>
</ul> </ul>
</div> </div>
</span> </span>
@@ -260,8 +287,12 @@
:style="{ backgroundColor }" :style="{ backgroundColor }"
> >
<Upload <Upload
v-if="sortedDocuments.length && editable && withUploadButton" v-if="editable && withUploadButton"
v-show="sortedDocuments.length"
ref="upload"
:accept-file-types="acceptFileTypes" :accept-file-types="acceptFileTypes"
:authenticity-token="authenticityToken"
:with-google-drive="withGoogleDrive"
:template-id="template.id" :template-id="template.id"
@success="updateFromUpload" @success="updateFromUpload"
/> />
@@ -297,6 +328,8 @@
v-if="withUploadButton" v-if="withUploadButton"
:template-id="template.id" :template-id="template.id"
:accept-file-types="acceptFileTypes" :accept-file-types="acceptFileTypes"
:with-google-drive="withGoogleDrive"
@click-google-drive="$refs.upload.openGoogleDriveModal()"
@success="updateFromUpload" @success="updateFromUpload"
/> />
<button <button
@@ -368,6 +401,8 @@
v-if="withUploadButton" v-if="withUploadButton"
:template-id="template.id" :template-id="template.id"
:accept-file-types="acceptFileTypes" :accept-file-types="acceptFileTypes"
:authenticity-token="authenticityToken"
:with-google-drive="withGoogleDrive"
@success="updateFromUpload" @success="updateFromUpload"
/> />
<button <button
@@ -441,6 +476,7 @@
:default-required-fields="defaultRequiredFields" :default-required-fields="defaultRequiredFields"
:field-types="fieldTypes" :field-types="fieldTypes"
:with-sticky-submitters="withStickySubmitters" :with-sticky-submitters="withStickySubmitters"
:with-fields-detection="withFieldsDetection"
:with-signature-id="withSignatureId" :with-signature-id="withSignatureId"
:with-prefillable="withPrefillable" :with-prefillable="withPrefillable"
:only-defined-fields="onlyDefinedFields" :only-defined-fields="onlyDefinedFields"
@@ -448,6 +484,7 @@
:show-tour-start-form="showTourStartForm" :show-tour-start-form="showTourStartForm"
@add-field="addField" @add-field="addField"
@set-draw="[drawField = $event.field, drawOption = $event.option]" @set-draw="[drawField = $event.field, drawOption = $event.option]"
@select-submitter="selectedSubmitter = $event"
@set-draw-type="[drawFieldType = $event, showDrawField = true]" @set-draw-type="[drawFieldType = $event, showDrawField = true]"
@set-drag="dragField = $event" @set-drag="dragField = $event"
@set-drag-placeholder="$refs.dragPlaceholder.dragPlaceholder = $event" @set-drag-placeholder="$refs.dragPlaceholder.dragPlaceholder = $event"
@@ -502,7 +539,7 @@ import DocumentPreview from './preview'
import DocumentControls from './controls' import DocumentControls from './controls'
import MobileFields from './mobile_fields' import MobileFields from './mobile_fields'
import FieldSubmitter from './field_submitter' import FieldSubmitter from './field_submitter'
import { IconPlus, IconUsersPlus, IconDeviceFloppy, IconChevronDown, IconEye, IconWritingSign, IconInnerShadowTop, IconInfoCircle, IconAdjustments } from '@tabler/icons-vue' import { IconPlus, IconUsersPlus, IconDeviceFloppy, IconChevronDown, IconEye, IconWritingSign, IconInnerShadowTop, IconInfoCircle, IconAdjustments, IconDownload } from '@tabler/icons-vue'
import { v4 } from 'uuid' import { v4 } from 'uuid'
import { ref, computed, toRaw } from 'vue' import { ref, computed, toRaw } from 'vue'
import * as i18n from './i18n' import * as i18n from './i18n'
@@ -528,6 +565,7 @@ export default {
Contenteditable, Contenteditable,
IconUsersPlus, IconUsersPlus,
IconChevronDown, IconChevronDown,
IconDownload,
IconAdjustments, IconAdjustments,
IconEye, IconEye,
IconDeviceFloppy IconDeviceFloppy
@@ -545,6 +583,7 @@ export default {
backgroundColor: this.backgroundColor, backgroundColor: this.backgroundColor,
withPhone: this.withPhone, withPhone: this.withPhone,
withVerification: this.withVerification, withVerification: this.withVerification,
withKba: this.withKba,
withPayment: this.withPayment, withPayment: this.withPayment,
isPaymentConnected: this.isPaymentConnected, isPaymentConnected: this.isPaymentConnected,
withFormula: this.withFormula, withFormula: this.withFormula,
@@ -575,6 +614,11 @@ export default {
required: false, required: false,
default: null default: null
}, },
withDownload: {
type: Boolean,
required: false,
default: false
},
backgroundColor: { backgroundColor: {
type: String, type: String,
required: false, required: false,
@@ -610,6 +654,11 @@ export default {
required: false, required: false,
default: true default: true
}, },
withFieldsDetection: {
type: Boolean,
required: false,
default: false
},
withAddPageButton: { withAddPageButton: {
type: Boolean, type: Boolean,
required: false, required: false,
@@ -746,6 +795,11 @@ export default {
required: false, required: false,
default: null default: null
}, },
withKba: {
type: Boolean,
required: false,
default: null
},
withPayment: { withPayment: {
type: Boolean, type: Boolean,
required: false, required: false,
@@ -766,6 +820,11 @@ export default {
required: false, required: false,
default: false default: false
}, },
withGoogleDrive: {
type: Boolean,
required: false,
default: false
},
onlyDefinedFields: { onlyDefinedFields: {
type: Boolean, type: Boolean,
required: false, required: false,
@@ -786,6 +845,7 @@ export default {
return { return {
documentRefs: [], documentRefs: [],
isBreakpointLg: false, isBreakpointLg: false,
isDownloading: false,
isLoadingBlankPage: false, isLoadingBlankPage: false,
isSaving: false, isSaving: false,
selectedSubmitter: null, selectedSubmitter: null,
@@ -944,6 +1004,75 @@ export default {
}, },
methods: { methods: {
toRaw, toRaw,
download () {
this.isDownloading = true
this.baseFetch(`/templates/${this.template.id}/documents`).then(async (response) => {
if (response.ok) {
const urls = await response.json()
const isMobileSafariIos = 'ontouchstart' in window && navigator.maxTouchPoints > 0 && /AppleWebKit/i.test(navigator.userAgent)
const isSafariIos = isMobileSafariIos || /iPhone|iPad|iPod/i.test(navigator.userAgent)
if (isSafariIos && urls.length > 1) {
this.downloadSafariIos(urls)
} else {
this.downloadUrls(urls)
}
} else {
alert(this.t('failed_to_download_files'))
}
})
},
downloadUrls (urls) {
const fileRequests = urls.map((url) => {
return () => {
return fetch(url).then(async (resp) => {
const blobUrl = URL.createObjectURL(await resp.blob())
const link = document.createElement('a')
link.href = blobUrl
link.setAttribute('download', decodeURI(url.split('/').pop()))
link.click()
URL.revokeObjectURL(blobUrl)
})
}
})
fileRequests.reduce(
(prevPromise, request) => prevPromise.then(() => request()),
Promise.resolve()
).finally(() => {
this.isDownloading = false
})
},
downloadSafariIos (urls) {
const fileRequests = urls.map((url) => {
return fetch(url).then(async (resp) => {
const blob = await resp.blob()
const blobUrl = URL.createObjectURL(blob.slice(0, blob.size, 'application/octet-stream'))
const link = document.createElement('a')
link.href = blobUrl
link.setAttribute('download', decodeURI(url.split('/').pop()))
return link
})
})
Promise.all(fileRequests).then((links) => {
links.forEach((link, index) => {
setTimeout(() => {
link.click()
URL.revokeObjectURL(link.href)
}, index * 50)
})
}).finally(() => {
this.isDownloading = false
})
},
onDragover (e) { onDragover (e) {
if (this.$refs.dragPlaceholder?.dragPlaceholder) { if (this.$refs.dragPlaceholder?.dragPlaceholder) {
this.$refs.dragPlaceholder.isMask = e.target.id === 'mask' this.$refs.dragPlaceholder.isMask = e.target.id === 'mask'
@@ -987,14 +1116,17 @@ export default {
const sortArea = (aArea, bArea) => { const sortArea = (aArea, bArea) => {
if (aArea.attachment_uuid === bArea.attachment_uuid) { if (aArea.attachment_uuid === bArea.attachment_uuid) {
if (aArea.page === bArea.page) { if (aArea.page === bArea.page) {
if (Math.abs(aArea.y - bArea.y) < 0.01) { const aY = aArea.y + aArea.h
const bY = bArea.y + bArea.h
if (Math.abs(aY - bY) < 0.01 || (aArea.h < bArea.h ? (aArea.y >= bArea.y && aY <= bY) : (bArea.y >= aArea.y && bY <= aY))) {
if (aArea.x === bArea.x) { if (aArea.x === bArea.x) {
return 0 return 0
} else { } else {
return aArea.x - bArea.x return aArea.x - bArea.x
} }
} else { } else {
return aArea.y - bArea.y return (aArea.y + aArea.h) - (bArea.y + bArea.h)
} }
} else { } else {
return aArea.page - bArea.page return aArea.page - bArea.page
@@ -1044,6 +1176,72 @@ export default {
this.save() this.save()
} }
}, },
findFieldInsertIndex (field) {
if (!field.areas?.length) return -1
const area = field.areas[0]
const attachmentUuidsIndex = this.template.schema.reduce((acc, e, index) => {
acc[e.attachment_uuid] = index
return acc
}, {})
const compareAreas = (a, b) => {
const aAttIdx = attachmentUuidsIndex[a.attachment_uuid]
const bAttIdx = attachmentUuidsIndex[b.attachment_uuid]
if (aAttIdx !== bAttIdx) return aAttIdx - bAttIdx
if (a.page !== b.page) return a.page - b.page
const aY = a.y + a.h
const bY = b.y + b.h
if (Math.abs(aY - bY) < 0.01) return a.x - b.x
if (a.h < b.h ? a.y >= b.y && aY <= bY : b.y >= a.y && bY <= aY) return a.x - b.x
return aY - bY
}
let closestBeforeIndex = -1
let closestBeforeArea = null
let closestAfterIndex = -1
let closestAfterArea = null
this.template.fields.forEach((f, index) => {
if (f.submitter_uuid === field.submitter_uuid) {
(f.areas || []).forEach((a) => {
const cmp = compareAreas(a, area)
if (cmp < 0) {
if (!closestBeforeArea || (compareAreas(a, closestBeforeArea) > 0 && closestBeforeIndex < index)) {
closestBeforeIndex = index
closestBeforeArea = a
}
} else {
if (!closestAfterArea || (compareAreas(a, closestAfterArea) < 0 && closestAfterIndex > index)) {
closestAfterIndex = index
closestAfterArea = a
}
}
})
}
})
if (closestBeforeIndex !== -1) return closestBeforeIndex + 1
if (closestAfterIndex !== -1) return closestAfterIndex
return -1
},
insertField (field) {
const insertIndex = this.findFieldInsertIndex(field)
if (insertIndex !== -1) {
this.template.fields.splice(insertIndex, 0, field)
} else {
this.template.fields.push(field)
}
},
closeDropdown () { closeDropdown () {
document.activeElement.blur() document.activeElement.blur()
}, },
@@ -1097,7 +1295,7 @@ export default {
field.preferences.with_signature_id = this.withSignatureId field.preferences.with_signature_id = this.withSignatureId
} }
this.template.fields.push(field) this.insertField(field)
this.save() this.save()
}, },
@@ -1326,11 +1524,13 @@ export default {
field.areas.push(area) field.areas.push(area)
} else { } else {
this.template.fields.push({ const newField = {
...JSON.parse(JSON.stringify(field)), ...JSON.parse(JSON.stringify(field)),
uuid: v4(), uuid: v4(),
areas: [area] areas: [area]
}) }
this.insertField(newField)
} }
this.selectedAreaRef.value = area this.selectedAreaRef.value = area
@@ -1353,13 +1553,13 @@ export default {
const documentRef = this.documentRefs.find((e) => e.document.uuid === area.attachment_uuid) const documentRef = this.documentRefs.find((e) => e.document.uuid === area.attachment_uuid)
const pageMask = documentRef.pageRefs[area.page].$refs.mask const pageMask = documentRef.pageRefs[area.page].$refs.mask
if (type === 'checkbox') { if (type === 'checkbox' || type === 'radio' || type === 'multiple') {
area.w = pageMask.clientWidth / 30 / pageMask.clientWidth area.w = pageMask.clientWidth / 30 / pageMask.clientWidth
area.h = (pageMask.clientWidth / 30 / pageMask.clientWidth) * (pageMask.clientWidth / pageMask.clientHeight) area.h = (pageMask.clientWidth / 30 / pageMask.clientWidth) * (pageMask.clientWidth / pageMask.clientHeight)
} else if (type === 'image') { } else if (type === 'image') {
area.w = pageMask.clientWidth / 5 / pageMask.clientWidth area.w = pageMask.clientWidth / 5 / pageMask.clientWidth
area.h = (pageMask.clientWidth / 5 / pageMask.clientWidth) * (pageMask.clientWidth / pageMask.clientHeight) area.h = (pageMask.clientWidth / 5 / pageMask.clientWidth) * (pageMask.clientWidth / pageMask.clientHeight)
} else if (type === 'signature' || type === 'stamp' || type === 'verification') { } else if (type === 'signature' || type === 'stamp' || type === 'verification' || type === 'kba') {
area.w = pageMask.clientWidth / 5 / pageMask.clientWidth area.w = pageMask.clientWidth / 5 / pageMask.clientWidth
area.h = (pageMask.clientWidth / 5 / pageMask.clientWidth) * (pageMask.clientWidth / pageMask.clientHeight) / 2 area.h = (pageMask.clientWidth / 5 / pageMask.clientWidth) * (pageMask.clientWidth / pageMask.clientHeight) / 2
} else if (type === 'initials') { } else if (type === 'initials') {
@@ -1415,7 +1615,7 @@ export default {
} }
if (this.template.fields.indexOf(this.drawField) === -1) { if (this.template.fields.indexOf(this.drawField) === -1) {
this.template.fields.push(this.drawField) this.insertField(this.drawField)
} }
this.drawField = null this.drawField = null
@@ -1443,8 +1643,8 @@ export default {
const previousArea = previousField?.areas?.[previousField.areas.length - 1] const previousArea = previousField?.areas?.[previousField.areas.length - 1]
if (previousArea || area.w) { if (previousArea || area.w) {
const areaW = previousArea?.w || (30 / pageMask.clientWidth) const areaW = previousArea?.w || area.w || (30 / pageMask.clientWidth)
const areaH = previousArea?.h || (30 / pageMask.clientHeight) const areaH = previousArea?.h || area.h || (30 / pageMask.clientHeight)
if ((pageMask.clientWidth * area.w) < 5) { if ((pageMask.clientWidth * area.w) < 5) {
area.x = area.x - (areaW / 2) area.x = area.x - (areaW / 2)
@@ -1554,7 +1754,7 @@ export default {
this.selectedAreaRef.value = fieldArea this.selectedAreaRef.value = fieldArea
if (this.template.fields.indexOf(field) === -1) { if (this.template.fields.indexOf(field) === -1) {
this.template.fields.push(field) this.insertField(field)
} }
this.save() this.save()
@@ -1584,7 +1784,7 @@ export default {
} else if (previousField?.areas?.length) { } else if (previousField?.areas?.length) {
baseArea = previousField.areas[previousField.areas.length - 1] baseArea = previousField.areas[previousField.areas.length - 1]
} else { } else {
if (['checkbox'].includes(fieldType)) { if (['checkbox', 'radio', 'multiple'].includes(fieldType)) {
baseArea = { baseArea = {
w: area.maskW / 30 / area.maskW, w: area.maskW / 30 / area.maskW,
h: area.maskW / 30 / area.maskW * (area.maskW / area.maskH) h: area.maskW / 30 / area.maskW * (area.maskW / area.maskH)
@@ -1594,7 +1794,7 @@ export default {
w: area.maskW / 5 / area.maskW, w: area.maskW / 5 / area.maskW,
h: (area.maskW / 5 / area.maskW) * (area.maskW / area.maskH) h: (area.maskW / 5 / area.maskW) * (area.maskW / area.maskH)
} }
} else if (fieldType === 'signature' || fieldType === 'stamp' || fieldType === 'verification') { } else if (fieldType === 'signature' || fieldType === 'stamp' || fieldType === 'verification' || fieldType === 'kba') {
baseArea = { baseArea = {
w: area.maskW / 5 / area.maskW, w: area.maskW / 5 / area.maskW,
h: (area.maskW / 5 / area.maskW) * (area.maskW / area.maskH) / 2 h: (area.maskW / 5 / area.maskW) * (area.maskW / area.maskH) / 2
@@ -1716,7 +1916,7 @@ export default {
attachment.metadata.pdf.fields.forEach((field) => { attachment.metadata.pdf.fields.forEach((field) => {
field.submitter_uuid = this.selectedSubmitter.uuid field.submitter_uuid = this.selectedSubmitter.uuid
this.template.fields.push(field) this.insertField(field)
}) })
} }
}) })
@@ -1757,8 +1957,9 @@ export default {
}, },
onDocumentReplace (data) { onDocumentReplace (data) {
const { replaceSchemaItem, schema, documents } = data const { replaceSchemaItem, schema, documents } = data
const { google_drive_file_id, ...cleanedReplaceSchemaItem } = replaceSchemaItem
this.template.schema.splice(this.template.schema.indexOf(replaceSchemaItem), 1, { ...replaceSchemaItem, ...schema[0] }) this.template.schema.splice(this.template.schema.indexOf(replaceSchemaItem), 1, { ...cleanedReplaceSchemaItem, ...schema[0] })
this.template.documents.push(...documents) this.template.documents.push(...documents)
if (data.fields) { if (data.fields) {
@@ -8,8 +8,8 @@
dir="auto" dir="auto"
:contenteditable="editable" :contenteditable="editable"
style="min-width: 2px" style="min-width: 2px"
:class="iconInline ? 'inline' : 'block'" :class="[iconInline ? 'inline' : 'block', hideIcon ? 'focus:block' : '']"
class="peer outline-none focus:block" class="peer outline-none"
@paste.prevent="onPaste" @paste.prevent="onPaste"
@keydown.enter.prevent="blurContenteditable" @keydown.enter.prevent="blurContenteditable"
@focus="$emit('focus', $event)" @focus="$emit('focus', $event)"
@@ -18,22 +18,19 @@
{{ value }} {{ value }}
</span> </span>
<span <span
v-if="withRequired" class="relative inline"
title="Required" :class="{ 'peer-focus:hidden': hideIcon, 'peer-focus:invisible': !hideIcon }"
class="text-red-500 peer-focus:hidden"
@click="focusContenteditable"
> >
* <IconPencil
class="cursor-pointer flex-none opacity-0 group-hover/contenteditable-container:opacity-100 group-hover/contenteditable:opacity-100 align-middle pl-1"
:style="iconInline ? {} : { right: -(1.1 * iconWidth) + 'px' }"
:title="t('edit')"
:class="{ invisible: !editable, 'absolute top-1/2 -translate-y-1/2': !iconInline || floatIcon, 'inline align-bottom': iconInline, 'left-0': floatIcon }"
:width="iconWidth + 4"
:stroke-width="iconStrokeWidth"
@click="[focusContenteditable(), selectOnEditClick && selectContent()]"
/>
</span> </span>
<IconPencil
class="cursor-pointer flex-none opacity-0 group-hover/contenteditable-container:opacity-100 group-hover/contenteditable:opacity-100 align-middle peer-focus:hidden"
:style="iconInline ? {} : { right: -(1.1 * iconWidth) + 'px' }"
:title="t('edit')"
:class="{ invisible: !editable, 'ml-1': !withRequired, 'absolute': !iconInline, 'inline align-bottom': iconInline }"
:width="iconWidth"
:stroke-width="iconStrokeWidth"
@click="[focusContenteditable(), selectOnEditClick && selectContent()]"
/>
</div> </div>
</template> </template>
@@ -62,7 +59,12 @@ export default {
required: false, required: false,
default: 30 default: 30
}, },
withRequired: { hideIcon: {
type: Boolean,
required: false,
default: true
},
floatIcon: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
+20 -5
View File
@@ -12,8 +12,8 @@
:for="inputId" :for="inputId"
:class="{ 'opacity-50': isLoading, 'hover:bg-base-200/50': withHoverClass && !isDragEntering, 'bg-base-200/50 border-base-content/30': isDragEntering }" :class="{ 'opacity-50': isLoading, 'hover:bg-base-200/50': withHoverClass && !isDragEntering, 'bg-base-200/50 border-base-content/30': isDragEntering }"
> >
<div class="absolute top-0 right-0 left-0 bottom-0 flex items-center justify-center pointer-events-none"> <div class="absolute top-0 right-0 left-0 bottom-0 flex items-center justify-center">
<div class="flex flex-col items-center"> <div class="flex flex-col items-center pointer-events-none">
<IconInnerShadowTop <IconInnerShadowTop
v-if="isLoading" v-if="isLoading"
class="animate-spin" class="animate-spin"
@@ -40,6 +40,15 @@
> >
<span class="font-medium">{{ t('click_to_upload') }}</span> {{ t('or_drag_and_drop_files') }} <span class="font-medium">{{ t('click_to_upload') }}</span> {{ t('or_drag_and_drop_files') }}
</div> </div>
<button
v-if="withGoogleDrive"
class="flex items-center text-sm mt-2 pointer-events-auto"
@click.stop.prevent="$emit('click-google-drive')"
>
<span>{{ t('or_add_from') }}</span>
<IconBrandGoogleDrive class="w-4 h-4 inline-block ml-1" />
<span class="ml-1 font-medium hover:underline">Google Drive</span>
</button>
</div> </div>
</div> </div>
<form <form
@@ -62,7 +71,7 @@
<script> <script>
import Upload from './upload' import Upload from './upload'
import { IconCloudUpload, IconFilePlus, IconFileSymlink, IconFiles, IconInnerShadowTop } from '@tabler/icons-vue' import { IconCloudUpload, IconFilePlus, IconFileSymlink, IconFiles, IconInnerShadowTop, IconBrandGoogleDrive } from '@tabler/icons-vue'
export default { export default {
name: 'FileDropzone', name: 'FileDropzone',
@@ -71,7 +80,8 @@ export default {
IconCloudUpload, IconCloudUpload,
IconInnerShadowTop, IconInnerShadowTop,
IconFileSymlink, IconFileSymlink,
IconFiles IconFiles,
IconBrandGoogleDrive
}, },
inject: ['baseFetch', 't'], inject: ['baseFetch', 't'],
props: { props: {
@@ -99,6 +109,11 @@ export default {
required: false, required: false,
default: true default: true
}, },
withGoogleDrive: {
type: Boolean,
required: false,
default: false
},
title: { title: {
type: String, type: String,
required: false, required: false,
@@ -110,7 +125,7 @@ export default {
default: 'image/*, application/pdf, application/zip' default: 'image/*, application/pdf, application/zip'
} }
}, },
emits: ['success', 'error', 'loading'], emits: ['success', 'error', 'loading', 'click-google-drive'],
data () { data () {
return { return {
isLoading: false, isLoading: false,
+84 -8
View File
@@ -154,15 +154,22 @@
v-if="field.options && withOptions && (isExpandOptions || field.options.length < 5)" v-if="field.options && withOptions && (isExpandOptions || field.options.length < 5)"
ref="options" ref="options"
class="border-t border-base-300 mx-2 pt-2 space-y-1.5" class="border-t border-base-300 mx-2 pt-2 space-y-1.5"
draggable="true" @dragover="onOptionDragover"
@dragstart.prevent.stop @drop="reorderOptions"
> >
<div <div
v-for="(option, index) in field.options" v-for="(option, index) in field.options"
:key="option.uuid" :key="option.uuid"
class="flex space-x-1.5 items-center" class="flex space-x-1.5 items-center"
:data-option-uuid="option.uuid"
> >
<span class="text-sm w-3.5"> <span
class="text-sm w-3.5 cursor-grab select-none"
:draggable="editable && !defaultField"
@dragstart.stop="onOptionDragstart($event, option)"
@dragend.stop="optionDragRef = null"
@dragover.prevent.stop="onOptionDragover"
>
{{ index + 1 }}. {{ index + 1 }}.
</span> </span>
<div <div
@@ -176,6 +183,7 @@
dir="auto" dir="auto"
required required
:placeholder="`${t('option')} ${index + 1}`" :placeholder="`${t('option')} ${index + 1}`"
@keydown.enter="option.value ? addOptionAt(index + 1) : null"
@blur="save" @blur="save"
> >
<button <button
@@ -198,6 +206,7 @@
:readonly="!editable || defaultField" :readonly="!editable || defaultField"
required required
dir="auto" dir="auto"
@keydown.enter="option.value ? addOptionAt(index + 1) : null"
@focus="maybeFocusOnOptionArea(option)" @focus="maybeFocusOnOptionArea(option)"
@blur="save" @blur="save"
> >
@@ -217,7 +226,7 @@
<button <button
v-else-if="field.options && editable && !defaultField" v-else-if="field.options && editable && !defaultField"
class="field-add-option text-center text-sm w-full pb-1" class="field-add-option text-center text-sm w-full pb-1"
@click="addOption" @click="addOptionAt(field.options.length)"
> >
+ {{ t('add_option') }} + {{ t('add_option') }}
</button> </button>
@@ -363,7 +372,8 @@ export default {
isShowFontModal: false, isShowFontModal: false,
isShowConditionsModal: false, isShowConditionsModal: false,
isShowDescriptionModal: false, isShowDescriptionModal: false,
renderDropdown: false renderDropdown: false,
optionDragRef: null
} }
}, },
computed: { computed: {
@@ -450,15 +460,17 @@ export default {
closeDropdown () { closeDropdown () {
this.$el.getRootNode().activeElement.blur() this.$el.getRootNode().activeElement.blur()
}, },
addOption () { addOptionAt (index) {
this.isExpandOptions = true this.isExpandOptions = true
this.field.options.push({ value: '', uuid: v4() }) const insertAt = index ?? this.field.options.length
this.field.options.splice(insertAt, 0, { value: '', uuid: v4() })
this.$nextTick(() => { this.$nextTick(() => {
const inputs = this.$refs.options.querySelectorAll('input') const inputs = this.$refs.options.querySelectorAll('input')
inputs[inputs.length - 1]?.focus() inputs[insertAt]?.focus()
}) })
this.save() this.save()
@@ -515,6 +527,70 @@ export default {
this.isNameFocus = false this.isNameFocus = false
this.save() this.save()
},
onOptionDragstart (event, option) {
this.optionDragRef = option
const root = this.$el.getRootNode()
const hiddenEl = document.createElement('div')
hiddenEl.style.width = '1px'
hiddenEl.style.height = '1px'
hiddenEl.style.opacity = '0'
hiddenEl.style.position = 'fixed'
root.querySelector('#docuseal_modal_container')?.appendChild(hiddenEl)
event.dataTransfer?.setDragImage(hiddenEl, 0, 0)
setTimeout(() => { hiddenEl.remove() }, 1000)
event.dataTransfer.effectAllowed = 'move'
},
onOptionDragover (e) {
if (!this.optionDragRef) return
e.preventDefault()
e.stopPropagation()
const targetRow = e.target.closest('[data-option-uuid]')
if (!targetRow) return
const dragRow = this.$refs.options?.querySelector(`[data-option-uuid="${this.optionDragRef.uuid}"]`)
if (!dragRow) return
if (targetRow === dragRow) return
const rows = Array.from(this.$refs.options.querySelectorAll('[data-option-uuid]'))
const currentIndex = rows.indexOf(dragRow)
const targetIndex = rows.indexOf(targetRow)
if (currentIndex < targetIndex) {
targetRow.after(dragRow)
} else {
targetRow.before(dragRow)
}
},
reorderOptions (e) {
if (!this.optionDragRef) return
e.preventDefault()
e.stopPropagation()
const rows = Array.from(this.$refs.options.querySelectorAll('[data-option-uuid]'))
const newOrder = rows
.map((el) => this.field.options.find((opt) => opt.uuid === el.dataset.optionUuid))
.filter(Boolean)
if (newOrder.length === this.field.options.length) {
this.field.options.splice(0, this.field.options.length, ...newOrder)
this.save()
}
this.optionDragRef = null
} }
} }
} }
@@ -52,7 +52,7 @@
> >
<span class="py-1 flex items-center"> <span class="py-1 flex items-center">
<span <span
class="rounded-full w-3 h-3 ml-1 mr-3" class="rounded-full w-3 h-3 ml-1 mr-3 flex-shrink-0"
:class="colors[index % colors.length]" :class="colors[index % colors.length]"
/> />
<span> <span>
@@ -100,7 +100,7 @@
class="cursor-pointer text-base-100 flex h-full items-center justify-center" class="cursor-pointer text-base-100 flex h-full items-center justify-center"
> >
<button <button
class="mx-1 w-3 h-3 rounded-full" class="mx-1 w-3 h-3 rounded-full flex-shrink-0"
:class="colors[submitters.indexOf(selectedSubmitter) % colors.length]" :class="colors[submitters.indexOf(selectedSubmitter) % colors.length]"
/> />
</label> </label>
@@ -108,11 +108,11 @@
v-else v-else
ref="label" ref="label"
tabindex="0" tabindex="0"
class="group cursor-pointer group/contenteditable-container rounded-md p-2 border border-base-300 hover:border-content w-full flex justify-between" class="group cursor-pointer group/contenteditable-container rounded-md p-2 border border-base-300 hover:border-content w-full flex justify-between items-center"
> >
<div class="flex items-center space-x-2"> <div class="flex items-center space-x-2">
<span <span
class="w-3 h-3 rounded-full" class="w-3 h-3 rounded-full flex-shrink-0"
:class="colors[submitters.indexOf(selectedSubmitter) % colors.length]" :class="colors[submitters.indexOf(selectedSubmitter) % colors.length]"
/> />
<Contenteditable <Contenteditable
@@ -125,7 +125,7 @@
@update:model-value="$emit('name-change', selectedSubmitter)" @update:model-value="$emit('name-change', selectedSubmitter)"
/> />
</div> </div>
<span class="flex items-center transition-all duration-75 group-hover:border border-base-content/20 border-dashed w-6 h-6 flex justify-center items-center rounded"> <span class="flex items-center transition-all duration-75 group-hover:border border-base-content/20 border-dashed w-6 h-6 justify-center rounded flex-shrink-0">
<component <component
:is="editable ? 'IconPlus' : 'IconChevronDown'" :is="editable ? 'IconPlus' : 'IconChevronDown'"
width="18" width="18"
@@ -153,7 +153,7 @@
> >
<span class="py-1 flex items-center"> <span class="py-1 flex items-center">
<span <span
class="rounded-full w-3 h-3 ml-1 mr-3" class="rounded-full w-3 h-3 ml-1 mr-3 flex-shrink-0"
:class="colors[index % colors.length]" :class="colors[index % colors.length]"
/> />
<span> <span>
@@ -164,7 +164,7 @@
v-if="!compact && submitters.length > 1 && editable" v-if="!compact && submitters.length > 1 && editable"
class="flex" class="flex"
> >
<div class="flex-col pr-1 hidden group-hover:flex -mt-1 h-0"> <div class="flex-col pr-1 flex invisible group-hover:visible -mt-1 h-0">
<button <button
:title="t('up')" :title="t('up')"
class="relative w-2" class="relative w-2"
@@ -184,7 +184,7 @@
</div> </div>
<button <button
v-if="!compact && submitters.length > 1 && editable" v-if="!compact && submitters.length > 1 && editable"
class="hidden group-hover:block px-2" class="invisible group-hover:visible px-2"
@click.prevent.stop="remove(submitter)" @click.prevent.stop="remove(submitter)"
> >
<IconTrashX :width="18" /> <IconTrashX :width="18" />
@@ -30,7 +30,7 @@
v-for="(icon, type) in fieldIconsSorted" v-for="(icon, type) in fieldIconsSorted"
:key="type" :key="type"
> >
<li v-if="fieldTypes.includes(type) || ((withPhone || type != 'phone') && (withPayment || type != 'payment') && (withVerification || type != 'verification'))"> <li v-if="fieldTypes.includes(type) || ((withPhone || type != 'phone') && (withPayment || type != 'payment') && (withVerification || type != 'verification') && (withKba || type != 'kba'))">
<a <a
href="#" href="#"
class="text-sm py-1 px-2" class="text-sm py-1 px-2"
@@ -51,11 +51,11 @@
</template> </template>
<script> <script>
import { IconTextSize, IconWritingSign, IconCalendarEvent, IconPhoto, IconCheckbox, IconPaperclip, IconSelect, IconCircleDot, IconChecks, IconColumns3, IconPhoneCheck, IconLetterCaseUpper, IconCreditCard, IconRubberStamp, IconSquareNumber1, IconHeading, IconId, IconCalendarCheck, IconStrikethrough } from '@tabler/icons-vue' import { IconTextSize, IconWritingSign, IconCalendarEvent, IconPhoto, IconCheckbox, IconPaperclip, IconSelect, IconCircleDot, IconChecks, IconColumns3, IconPhoneCheck, IconLetterCaseUpper, IconCreditCard, IconRubberStamp, IconSquareNumber1, IconHeading, IconId, IconCalendarCheck, IconStrikethrough, IconUserScan } from '@tabler/icons-vue'
export default { export default {
name: 'FiledTypeDropdown', name: 'FiledTypeDropdown',
inject: ['withPhone', 'withPayment', 'withVerification', 't', 'fieldTypes'], inject: ['withPhone', 'withPayment', 'withVerification', 'withKba', 't', 'fieldTypes'],
props: { props: {
modelValue: { modelValue: {
type: String, type: String,
@@ -114,7 +114,8 @@ export default {
stamp: this.t('stamp'), stamp: this.t('stamp'),
payment: this.t('payment'), payment: this.t('payment'),
phone: this.t('phone'), phone: this.t('phone'),
verification: this.t('verify_id') verification: this.t('verify_id'),
kba: this.t('kba')
} }
}, },
fieldLabels () { fieldLabels () {
@@ -134,7 +135,8 @@ export default {
stamp: this.t('stamp_field'), stamp: this.t('stamp_field'),
payment: this.t('payment_field'), payment: this.t('payment_field'),
phone: this.t('phone_field'), phone: this.t('phone_field'),
verification: this.t('verify_id') verification: this.t('verify_id'),
kba: this.t('kba')
} }
}, },
fieldIcons () { fieldIcons () {
@@ -157,7 +159,8 @@ export default {
stamp: IconRubberStamp, stamp: IconRubberStamp,
payment: IconCreditCard, payment: IconCreditCard,
phone: IconPhoneCheck, phone: IconPhoneCheck,
verification: IconId verification: IconId,
kba: IconUserScan
} }
}, },
skipTypes () { skipTypes () {
+140 -9
View File
@@ -17,7 +17,7 @@
ref="fields" ref="fields"
class="fields mb-1 mt-2" class="fields mb-1 mt-2"
@dragover.prevent="onFieldDragover" @dragover.prevent="onFieldDragover"
@drop="reorderFields" @drop="fieldsDragFieldRef.value ? reorderFields() : null"
> >
<Field <Field
v-for="field in submitterFields" v-for="field in submitterFields"
@@ -114,7 +114,7 @@
:key="type" :key="type"
> >
<button <button
v-if="fieldTypes.includes(type) || ((withPhone || type != 'phone') && (withPayment || type != 'payment') && (withVerification || type != 'verification'))" v-if="fieldTypes.includes(type) || ((withPhone || type != 'phone') && (withPayment || type != 'payment') && (withVerification || type != 'verification') && (withKba || type != 'kba'))"
:id="`${type}_type_field_button`" :id="`${type}_type_field_button`"
draggable="true" draggable="true"
class="field-type-button group flex items-center justify-center border border-dashed w-full rounded relative fields-grid-item" class="field-type-button group flex items-center justify-center border border-dashed w-full rounded relative fields-grid-item"
@@ -122,7 +122,7 @@
:class="drawFieldType === type ? 'border-base-content/40' : 'border-base-300 hover:border-base-content/20'" :class="drawFieldType === type ? 'border-base-content/40' : 'border-base-300 hover:border-base-content/20'"
@dragstart="onDragstart($event, { type: type })" @dragstart="onDragstart($event, { type: type })"
@dragend="$emit('drag-end')" @dragend="$emit('drag-end')"
@click="['file', 'payment', 'verification'].includes(type) ? $emit('add-field', type) : $emit('set-draw-type', type)" @click="['file', 'payment', 'verification', 'kba'].includes(type) ? $emit('add-field', type) : $emit('set-draw-type', type)"
> >
<div <div
class="flex items-console transition-all cursor-grab h-full absolute left-0" class="flex items-console transition-all cursor-grab h-full absolute left-0"
@@ -208,6 +208,43 @@
</li> </li>
</ul> </ul>
</div> </div>
<div
v-if="withFieldsDetection && editable && fields.length < 2"
class="my-2"
>
<button
class="btn w-full"
:class="{ 'bg-base-300': fieldPagesLoaded !== null }"
@click="fieldPagesLoaded !== null ? null : detectFields()"
>
<template v-if="fieldPagesLoaded !== null">
<IconInnerShadowTop
width="22"
class="animate-spin"
/>
<span
v-if="analyzingProgress"
class="hidden md:inline"
>
{{ Math.round(analyzingProgress * 100) }}% {{ t('analyzing_') }}
</span>
<span
v-else
class="hidden md:inline"
>
{{ fieldPagesLoaded }} / {{ numberOfPages }} {{ t('processing_') }}
</span>
</template>
<template v-else>
<IconSparkles width="22" />
<span
class="hidden md:inline"
>
{{ t('autodetect_fields') }}
</span>
</template>
</button>
</div>
<div <div
v-show="fields.length < 4 && editable && withHelp && showTourStartForm" v-show="fields.length < 4 && editable && withHelp && showTourStartForm"
class="rounded py-2 px-4 w-full border border-dashed border-base-300" class="rounded py-2 px-4 w-full border border-dashed border-base-300"
@@ -231,7 +268,7 @@
import Field from './field' import Field from './field'
import FieldType from './field_type' import FieldType from './field_type'
import FieldSubmitter from './field_submitter' import FieldSubmitter from './field_submitter'
import { IconLock, IconCirclePlus } from '@tabler/icons-vue' import { IconLock, IconCirclePlus, IconInnerShadowTop, IconSparkles } from '@tabler/icons-vue'
import IconDrag from './icon_drag' import IconDrag from './icon_drag'
export default { export default {
@@ -240,11 +277,13 @@ export default {
Field, Field,
FieldType, FieldType,
IconCirclePlus, IconCirclePlus,
IconSparkles,
IconInnerShadowTop,
FieldSubmitter, FieldSubmitter,
IconDrag, IconDrag,
IconLock IconLock
}, },
inject: ['save', 'backgroundColor', 'withPhone', 'withVerification', 'withPayment', 't', 'fieldsDragFieldRef'], inject: ['save', 'backgroundColor', 'withPhone', 'withVerification', 'withKba', 'withPayment', 't', 'fieldsDragFieldRef', 'baseFetch'],
props: { props: {
fields: { fields: {
type: Array, type: Array,
@@ -255,6 +294,11 @@ export default {
required: false, required: false,
default: null default: null
}, },
withFieldsDetection: {
type: Boolean,
required: false,
default: false
},
withSignatureId: { withSignatureId: {
type: Boolean, type: Boolean,
required: false, required: false,
@@ -328,15 +372,22 @@ export default {
default: false default: false
} }
}, },
emits: ['add-field', 'set-draw', 'set-draw-type', 'set-drag', 'drag-end', 'scroll-to-area', 'change-submitter', 'set-drag-placeholder'], emits: ['add-field', 'set-draw', 'set-draw-type', 'set-drag', 'drag-end', 'scroll-to-area', 'change-submitter', 'set-drag-placeholder', 'select-submitter'],
data () { data () {
return { return {
fieldPagesLoaded: null,
analyzingProgress: 0,
defaultFieldsSearch: '' defaultFieldsSearch: ''
} }
}, },
computed: { computed: {
fieldNames: FieldType.computed.fieldNames, fieldNames: FieldType.computed.fieldNames,
fieldIcons: FieldType.computed.fieldIcons, fieldIcons: FieldType.computed.fieldIcons,
numberOfPages () {
return this.template.documents.reduce((acc, doc) => {
return acc + doc.metadata?.pdf?.number_of_pages || doc.preview_images.length
}, 0)
},
isShowFieldSearch () { isShowFieldSearch () {
if (this.withFieldsSearch === false) { if (this.withFieldsSearch === false) {
return false return false
@@ -389,6 +440,84 @@ export default {
this.$emit('set-drag', field) this.$emit('set-drag', field)
}, },
detectFields () {
const fields = []
this.fieldPagesLoaded = 0
this.baseFetch(`/templates/${this.template.id}/detect_fields`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}).then(async (response) => {
const reader = response.body.getReader()
const decoder = new TextDecoder('utf-8')
let buffer = ''
while (true) {
const { value, done } = await reader.read()
buffer += decoder.decode(value, { stream: true })
const lines = buffer.split('\n\n')
buffer = lines.pop()
for (const line of lines) {
if (line.startsWith('data: ')) {
const jsonStr = line.replace(/^data: /, '')
const data = JSON.parse(jsonStr)
if (data.error) {
if ((data.fields || fields).length) {
this.template.fields = data.fields || fields
this.save()
} else {
alert(data.error)
}
break
} else if (data.analyzing) {
this.analyzingProgress = data.progress
} else if (data.completed) {
this.fieldPagesLoaded = null
if (data.submitters) {
this.template.submitters = data.submitters
this.$emit('select-submitter', this.template.submitters[0])
}
this.template.fields = data.fields || fields
this.save()
break
} else if (data.fields) {
data.fields.forEach((f) => {
if (!f.submitter_uuid) {
f.submitter_uuid = this.template.submitters[0].uuid
}
})
this.fieldPagesLoaded += 1
fields.push(...data.fields)
}
}
}
if (done) break
}
}).catch(error => {
console.error('Error in streaming message: ', error)
}).finally(() => {
this.fieldPagesLoaded = null
this.analyzingProgress = null
this.isFieldsLoading = false
})
},
setDragPlaceholder (event) { setDragPlaceholder (event) {
this.$emit('set-drag-placeholder', { this.$emit('set-drag-placeholder', {
offsetX: event.offsetX, offsetX: event.offsetX,
@@ -450,7 +579,7 @@ export default {
removeSubmitter (submitter) { removeSubmitter (submitter) {
[...this.fields].forEach((field) => { [...this.fields].forEach((field) => {
if (field.submitter_uuid === submitter.uuid) { if (field.submitter_uuid === submitter.uuid) {
this.removeField(field) this.removeField(field, false)
} }
}) })
@@ -462,7 +591,7 @@ export default {
this.save() this.save()
}, },
removeField (field) { removeField (field, save = true) {
this.fields.splice(this.fields.indexOf(field), 1) this.fields.splice(this.fields.indexOf(field), 1)
this.fields.forEach((f) => { this.fields.forEach((f) => {
@@ -481,7 +610,9 @@ export default {
}) })
}) })
this.save() if (save) {
this.save()
}
} }
} }
} }
@@ -0,0 +1,105 @@
<template>
<div
class="dropdown"
:class="{ 'dropdown-open': isLoading }"
>
<label tabindex="0">
<IconBrandGoogleDrive
width="19"
class="inline-block mr-1 cursor-pointer"
/>
</label>
<ul
tabindex="0"
:style="{ backgroundColor }"
class="dropdown-content z-[1] shadow menu rounded-box"
>
<li>
<a
:href="`https://drive.google.com/file/d/${googleDriveFileId}/view?usp=sharing`"
data-turbo="false"
target="_blank"
class="flex items-center"
>
<IconExternalLink class="w-4 h-4 flex-shrink-0" />
<span>{{ t('view') }}</span>
</a>
</li>
<li>
<button
:form="`sync_form_${inputId}`"
type="submit"
:disabled="isLoading"
>
<IconRefresh
class="w-4 h-4 flex-shrink-0"
:class="{ 'animate-spin': isLoading }"
/>
<span>{{ message }}</span>
</button>
</li>
</ul>
<form
:id="`sync_form_${inputId}`"
ref="form"
class="hidden"
@submit.prevent="upload({ path: uploadUrl })"
>
<input
:id="inputId"
ref="input"
:value="googleDriveFileId"
name="google_drive_file_ids[]"
>
</form>
</div>
</template>
<script>
import Upload from './upload'
import { IconRefresh, IconBrandGoogleDrive, IconExternalLink } from '@tabler/icons-vue'
export default {
name: 'GoogleDriveDocumentSettings',
components: {
IconRefresh,
IconBrandGoogleDrive,
IconExternalLink
},
inject: ['baseFetch', 't', 'backgroundColor'],
props: {
templateId: {
type: [Number, String],
required: true
},
googleDriveFileId: {
type: String,
required: true
}
},
emits: ['success'],
data () {
return {
isLoading: false
}
},
computed: {
inputId () {
return 'el' + Math.random().toString(32).split('.')[1]
},
uploadUrl () {
return `/templates/${this.templateId}/google_drive_documents`
},
message () {
if (this.isLoading) {
return this.t('syncing')
} else {
return this.t('sync')
}
}
},
methods: {
upload: Upload.methods.upload
}
}
</script>
+397 -153
View File
@@ -1,4 +1,10 @@
const en = { const en = {
kba: 'KBA',
analyzing_: 'Analyzing...',
download: 'Download',
downloading_: 'Downloading...',
view: 'View',
autodetect_fields: 'Autodetect fields',
payment_link: 'Payment link', payment_link: 'Payment link',
strikeout: 'Strikeout', strikeout: 'Strikeout',
draw_strikethrough_the_document: 'Draw strikethrough the document', draw_strikethrough_the_document: 'Draw strikethrough the document',
@@ -176,10 +182,19 @@ const en = {
and: 'and', and: 'and',
or: 'or', or: 'or',
start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Start a quick tour to learn how to create an send your first document', start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Start a quick tour to learn how to create an send your first document',
start_tour: 'Start Tour' start_tour: 'Start Tour',
or_add_from: 'Or add from',
sync: 'Sync',
syncing: 'Syncing...'
} }
const es = { const es = {
kba: 'KBA',
autodetect_fields: 'Autodetectar campos',
analyzing_: 'Analizando...',
download: 'Descargar',
downloading_: 'Descargando...',
view: 'Vista',
payment_link: 'Enlace de pago', payment_link: 'Enlace de pago',
strikeout: 'Tachar', strikeout: 'Tachar',
draw_strikethrough_the_document: 'Dibujar una línea de tachado en el documento', draw_strikethrough_the_document: 'Dibujar una línea de tachado en el documento',
@@ -357,10 +372,19 @@ const es = {
and: 'y', and: 'y',
or: 'o', or: 'o',
start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Inicia una guía rápida para aprender a crear y enviar tu primer documento.', start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Inicia una guía rápida para aprender a crear y enviar tu primer documento.',
start_tour: 'Iniciar guía' start_tour: 'Iniciar guía',
or_add_from: 'O agregar desde',
sync: 'Sincronizar',
syncing: 'Sincronizando...'
} }
const it = { const it = {
kba: 'KBA',
autodetect_fields: 'Rileva campi',
analyzing_: 'Analisi...',
download: 'Scarica',
downloading_: 'Download in corso...',
view: 'Vista',
payment_link: 'Link di pagamento', payment_link: 'Link di pagamento',
strikeout: 'Barrato', strikeout: 'Barrato',
draw_strikethrough_the_document: 'Disegna una linea barrata sul documento', draw_strikethrough_the_document: 'Disegna una linea barrata sul documento',
@@ -538,10 +562,19 @@ const it = {
and: 'e', and: 'e',
or: 'o', or: 'o',
start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Inizia un tour rapido per imparare a creare e inviare il tuo primo documento.', start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Inizia un tour rapido per imparare a creare e inviare il tuo primo documento.',
start_tour: 'Inizia il tour' start_tour: 'Inizia il tour',
or_add_from: 'O aggiungi da',
sync: 'Sincronizza',
syncing: 'Sincronizzazione...'
} }
const pt = { const pt = {
kba: 'KBA',
autodetect_fields: 'Detectar campos',
analyzing_: 'Analisando...',
download: 'Baixar',
downloading_: 'Baixando...',
view: 'Visualizar',
payment_link: 'Link de pagamento', payment_link: 'Link de pagamento',
strikeout: 'Tachado', strikeout: 'Tachado',
draw_strikethrough_the_document: 'Desenhe uma linha de tachado no documento', draw_strikethrough_the_document: 'Desenhe uma linha de tachado no documento',
@@ -719,94 +752,109 @@ const pt = {
and: 'e', and: 'e',
or: 'ou', or: 'ou',
start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Comece um tour rápido para aprender a criar e enviar seu primeiro documento.', start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Comece um tour rápido para aprender a criar e enviar seu primeiro documento.',
start_tour: 'Iniciar tour' start_tour: 'Iniciar tour',
or_add_from: 'Ou adicionar de',
sync: 'Sincronizar',
syncing: 'Sincronizando...'
} }
const fr = { const fr = {
kba: 'KBA',
autodetect_fields: 'Détecter les champs',
analyzing_: 'Analyse...',
download: 'Télécharger',
downloading_: 'Téléchargement...',
view: 'Voir',
payment_link: 'Lien de paiement', payment_link: 'Lien de paiement',
strikeout: 'Barrer', strikeout: 'Rature',
draw_strikethrough_the_document: 'Tracer une ligne de suppression sur le document', draw_strikethrough_the_document: 'Tracer une rature sur le document',
quantity: 'Quantité', quantity: 'Quantité',
prefillable: 'Pré-remplissable', prefillable: 'Préremplissable',
signature_id: 'ID de signature', signature_id: 'Identifiant de signature',
error_message: 'Message d\'erreur', error_message: "Message d'erreur",
length: 'Longueur', length: 'Longueur',
min: 'Min', min: 'Min',
max: 'Max', max: 'Max',
date_signed: 'Date actuelle',
font: 'Police', font: 'Police',
party: 'Partie', party: 'Partie',
date_signed: 'Date de signature',
method: 'Méthode', method: 'Méthode',
reorder_fields: 'Réorganiser les champs', reorder_fields: 'Réorganiser les champs',
verify_id: "Vérifier l'ID", verify_id: "Vérifier l'ID",
obtain_qualified_electronic_signature_with_the_trusted_provider_click_to_learn_more: 'Obtenez une signature électronique qualifiée (QeS) avec le fournisseur de confiance. Cliquez pour en savoir plus.', obtain_qualified_electronic_signature_with_the_trusted_provider_click_to_learn_more: 'Obtenez une signature électronique qualifiée (QeS) auprès du fournisseur de confiance. Cliquez pour en savoir plus.',
editable: 'Modifiable',
recurrent: 'Récurrent', recurrent: 'Récurrent',
one_off: 'Ponctuel', one_off: 'Ponctuel',
editable: 'Éditable',
search_field: 'Champ de recherche', search_field: 'Champ de recherche',
field_not_found: 'Champ non trouvé', field_not_found: 'Champ introuvable',
clear: 'Effacer', clear: 'Effacer',
type_value: 'Tapez la valeur',
add_all_required_fields_to_continue: 'Ajoutez tous les champs obligatoires pour continuer',
uploaded_pdf_contains_form_fields_keep_or_remove_them: 'Le PDF téléchargé contient des champs. Les conserver ou les supprimer?',
keep: 'Conserver',
align: 'Aligner', align: 'Aligner',
add_all_required_fields_to_continue: 'Ajoutez tous les champs obligatoires pour continuer',
uploaded_pdf_contains_form_fields_keep_or_remove_them: 'Le PDF téléversé contient des champs de formulaire. Les conserver ou les supprimer ?',
keep: 'Conserver',
left: 'Gauche', left: 'Gauche',
heading: 'En-tête', heading: 'Titre',
validation: 'Validation', validation: 'Validation',
add_blank_page: 'Ajouter une page blanche', add_blank_page: 'Ajouter une page blanche',
right: 'Droite', right: 'Droite',
add_condition: 'Ajouter une condition',
center: 'Centre', center: 'Centre',
with_logo: 'Avec logo',
description: 'Description', description: 'Description',
display_title: "Titre d'affichage", display_title: 'Afficher le titre',
unchecked: 'Non coché', with_logo: 'Avec logo',
unchecked: 'Décoché',
price: 'Prix', price: 'Prix',
type_value: 'Saisir une valeur',
equal: 'Égal', equal: 'Égal',
not_equal: 'Non égal', not_equal: 'Différent',
contains: 'Contient', contains: 'Contient',
signing_date: 'Date de signature',
does_not_contain: 'Ne contient pas', does_not_contain: 'Ne contient pas',
not_empty: 'Non vide', not_empty: 'Non vide',
empty: 'Vide', empty: 'Vide',
select_field_: 'Sélectionner un champ...', select_field_: 'Sélectionner un champ...',
select_value_: 'Sélectionner une valeur...', select_value_: 'Sélectionner une valeur...',
remove_condition: 'Supprimer la condition', remove_condition: 'Supprimer la condition',
condition: 'Condition', add_condition: 'Ajouter une condition',
formula: 'Formule', are_you_sure_: 'Êtes-vous sûr ?',
edit: 'Éditer', sign_yourself: 'Signer vous-même',
set_signing_date: 'Définir la date de signature',
signing_date: 'Date de signature',
send: 'Envoyer',
remove: 'Supprimer',
edit: 'Modifier',
settings: 'Paramètres', settings: 'Paramètres',
up: 'Haut', up: 'Haut',
down: 'Bas', down: 'Bas',
set_signing_date: 'Définir la date de signature',
are_you_sure_: 'Êtes-vous sûr?',
sign_yourself: 'Signez-vous',
checked: 'Coché', checked: 'Coché',
send: 'Envoyer',
remove: 'Supprimer',
save: 'Enregistrer', save: 'Enregistrer',
cancel: 'Annuler', cancel: 'Annuler',
draw_field_on_the_document: 'Dessiner un champ sur le document', any: "N'importe lequel",
click_to_upload: 'Cliquez pour télécharger', drawn: 'Dessiné',
drawn_or_typed: 'Dessiné ou tapé',
drawn_or_upload: 'Dessiné ou téléversé',
upload: 'Téléverser',
formula: 'Formule',
typed: 'Tapé',
draw_field_on_the_document: 'Dessinez un champ sur le document',
click_to_upload: 'Cliquez pour téléverser',
or_drag_and_drop_files: 'ou faites glisser-déposer des fichiers', or_drag_and_drop_files: 'ou faites glisser-déposer des fichiers',
uploading: 'Téléchargement en cours', uploading: 'Téléversement en cours',
processing_: 'Traitement en cours...', processing_: 'Traitement...',
add_pdf_documents_or_images: 'Ajoutez des documents PDF ou des images', add_pdf_documents_or_images: 'Ajouter des documents PDF ou des images',
add_documents_or_images: 'Ajoutez des documents ou des images', add_documents_or_images: 'Ajouter des documents ou des images',
add_a_new_document: 'Adicionar um novo documento', add_a_new_document: 'Ajouter un nouveau document',
replace_existing_document: 'Remplacer le document existant', replace_existing_document: 'Remplacer le document existant',
clone_and_replace_documents: 'Cloner et remplacer les documents', clone_and_replace_documents: 'Cloner et remplacer des documents',
required: 'Requis', required: 'Obligatoire',
default_value: 'Valeur par défaut', default_value: 'Valeur par défaut',
format: 'Format', format: 'Format',
read_only: 'Lecture seule', read_only: 'Lecture seule',
page: 'Page', page: 'Page',
draw_new_area: 'Dessiner une nouvelle zone', draw_new_area: 'Dessiner une zone',
copy_to_all_pages: 'Copier sur toutes les pages', copy_to_all_pages: 'Copier sur toutes les pages',
add_option: 'Ajouter une option', add_option: 'Ajouter une option',
option: 'Option', option: 'Option',
options: 'Options', options: 'Options',
condition: 'Condition',
first_party: 'Première partie', first_party: 'Première partie',
second_party: 'Deuxième partie', second_party: 'Deuxième partie',
third_party: 'Troisième partie', third_party: 'Troisième partie',
@@ -817,27 +865,27 @@ const fr = {
eighth_party: 'Huitième partie', eighth_party: 'Huitième partie',
ninth_party: 'Neuvième partie', ninth_party: 'Neuvième partie',
tenth_party: 'Dixième partie', tenth_party: 'Dixième partie',
eleventh_party: 'Onzième Parti', eleventh_party: 'Onzième partie',
twelfth_party: 'Douzième Parti', twelfth_party: 'Douzième partie',
thirteenth_party: 'Treizième Parti', thirteenth_party: 'Treizième partie',
fourteenth_party: 'Quatorzième Parti', fourteenth_party: 'Quatorzième partie',
fifteenth_party: 'Quinzième Parti', fifteenth_party: 'Quinzième partie',
sixteenth_party: 'Seizième Parti', sixteenth_party: 'Seizième partie',
seventeenth_party: 'Dix-septième Parti', seventeenth_party: 'Dix-septième partie',
eighteenth_party: 'Dix-huitième Parti', eighteenth_party: 'Dix-huitième partie',
nineteenth_party: 'Dix-Neuvième Fête', nineteenth_party: 'Dix-neuvième partie',
twentieth_party: 'Vingtième Fête', twentieth_party: 'Vingtième partie',
draw: 'Dessiner', draw: 'Dessiner',
add: 'Ajouter', add: 'Ajouter',
or_add_field_without_drawing: 'Ou ajoutez un champ sans dessiner', or_add_field_without_drawing: 'Ou ajouter un champ sans le dessiner',
text: 'Texte', text: 'Texte',
number: 'Nombre',
signature: 'Signature', signature: 'Signature',
initials: 'Initiales', initials: 'Initiales',
date: 'Date', date: 'Date',
number: 'Numéro',
image: 'Image', image: 'Image',
file: 'Fichier', file: 'Fichier',
select: 'Choisir', select: 'Sélection',
checkbox: 'Coche', checkbox: 'Coche',
multiple: 'Multiple', multiple: 'Multiple',
radio: 'Radio', radio: 'Radio',
@@ -845,40 +893,34 @@ const fr = {
stamp: 'Tampon', stamp: 'Tampon',
payment: 'Paiement', payment: 'Paiement',
phone: 'Téléphone', phone: 'Téléphone',
text_field: 'Champ de Texte', text_field: 'Champ de texte',
signature_field: 'Champ de Signature', signature_field: 'Champ de signature',
initials_field: "Champ d'Initiales", initials_field: "Champ d'initiales",
date_field: 'Champ de Date', date_field: 'Champ de date',
number_field: 'Champ de Numéro', number_field: 'Champ de numéro',
image_field: "Champ d'Image", image_field: "Champ d'image",
file_field: 'Champ de Fichier', file_field: 'Champ de fichier',
select_field: 'Champ de Choix', select_field: 'Champ de choix',
checkbox_field: 'Champ de Coche', checkbox_field: 'Champ de coche',
multiple_field: 'Champ de Choix Multiple', multiple_field: 'Champ de choix multiple',
radio_field: 'Champ de Groupe Radio', radio_field: 'Champ de groupe radio',
cells_field: 'Champ de Cellules', cells_field: 'Champ de cellules',
stamp_field: 'Champ de Tampon', stamp_field: 'Champ de tampon',
payment_field: 'Champ de Paiement', payment_field: 'Champ de paiement',
phone_field: 'Champ de Téléphone', phone_field: 'Champ de téléphone',
draw_a_text_field_on_the_page_with_a_mouse: 'Dessinez un champ texte sur la page avec une souris', draw_a_text_field_on_the_page_with_a_mouse: 'Dessinez un champ de texte sur la page avec la souris',
drag_and_drop_any_other_field_type_on_the_page: 'Glissez et déposez tout autre type de champ sur la page', drag_and_drop_any_other_field_type_on_the_page: 'Glissez-déposez tout autre type de champ sur la page',
click_on_the_field_type_above_to_start_drawing_it: 'Cliquez sur le type de champ ci-dessus pour commencer à le dessiner', click_on_the_field_type_above_to_start_drawing_it: 'Cliquez sur le type de champ ci-dessus pour commencer à le dessiner',
please_draw_fields_to_prepare_the_document: 'Veuillez dessiner les champs pour préparer le document.', please_draw_fields_to_prepare_the_document: 'Veuillez dessiner des champs pour préparer le document.',
only_pdf_and_images_are_supported: 'Seuls les PDF et les images sont pris en charge.', only_pdf_and_images_are_supported: 'Seuls les PDF et les images sont pris en charge.',
unlock_sms_verified_phone_number_field_with_paid_plan_use_text_field_for_phone_numbers_without_verification: 'Débloquez le champ de numéro de téléphone vérifié par SMS avec un plan payant. Utilisez un champ texte pour les numéros de téléphone sans vérification.', unlock_sms_verified_phone_number_field_with_paid_plan_use_text_field_for_phone_numbers_without_verification: 'Débloquez le champ de numéro de téléphone vérifié par SMS avec un forfait payant. Utilisez un champ texte pour les numéros sans vérification.',
available_only_in_pro: 'Disponible uniquement en Pro', available_only_in_pro: 'Disponible uniquement dans la version Pro',
failed_to_download_files: 'Échec du téléchargement des fichiers', failed_to_download_files: 'Impossible de télécharger les fichiers',
please_add_fields_for_the_submitter_name_or_remove_the_submitter_name_if_not_needed: 'Veuillez ajouter des champs pour {submitter_name} ou retirer {submitter_name} si ce n\'est pas nécessaire.', please_add_fields_for_the_submitter_name_or_remove_the_submitter_name_if_not_needed: "Veuillez ajouter des champs pour {submitter_name}. Ou supprimez {submitter_name} si ce n'est pas nécessaire.",
draw_field: 'Dessiner le champ {field}', draw_field: 'Dessiner le champ {field}',
replace: 'Remplacer', replace: 'Remplacer',
uploading_: 'Téléchargement en cours...', uploading_: 'Téléversement...',
add_document: 'Télécharger', add_document: 'Téléverser',
any: 'Tout',
drawn: 'Dessiné',
drawn_or_typed: 'Dessiné ou Tapé',
drawn_or_upload: 'Dessiné ou Téléchargé',
upload: 'Téléverser',
typed: 'Tapé',
none: 'Aucun', none: 'Aucun',
ssn: 'SSN', ssn: 'SSN',
ein: 'EIN', ein: 'EIN',
@@ -889,90 +931,104 @@ const fr = {
numbers_only: 'Chiffres uniquement', numbers_only: 'Chiffres uniquement',
letters_only: 'Lettres uniquement', letters_only: 'Lettres uniquement',
regexp_validation: 'Validation par expression régulière', regexp_validation: 'Validation par expression régulière',
enter_pdf_password: 'Entrez le mot de passe PDF', enter_pdf_password: 'Saisir le mot de passe du PDF',
wrong_password: 'Mot de passe incorrect', wrong_password: 'Mot de passe incorrect',
currency: 'Devise', currency: 'Devise',
save_and_preview: 'Enregistrer et prévisualiser', save_and_preview: 'Enregistrer et prévisualiser',
preferences: 'Préférences', preferences: 'Préférences',
available_in_pro: 'Disponible en version Pro', available_in_pro: 'Disponible dans la version Pro',
some_fields_are_missing_in_the_formula: 'Certains champs manquent dans la formule.', some_fields_are_missing_in_the_formula: 'Certains champs manquent dans la formule.',
learn_more: 'En savoir plus', learn_more: 'En savoir plus',
and: 'et', and: 'et',
or: 'ou', or: 'ou',
start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Lancez une visite rapide pour apprendre à créer et envoyer votre premier document.', start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Commencez une visite rapide pour apprendre à créer et à envoyer votre premier document',
start_tour: 'Démarrer' start_tour: 'Démarrer',
or_add_from: 'Ou ajouter depuis',
sync: 'Synchroniser',
syncing: 'Synchronisation...'
} }
const de = { const de = {
kba: 'KBA',
autodetect_fields: 'Felder erkennen',
analyzing_: 'Analysiere...',
download: 'Download',
downloading_: 'Download...',
view: 'Anzeigen',
payment_link: 'Zahlungslink', payment_link: 'Zahlungslink',
strikeout: 'Streichung', strikeout: 'Durchstreichen',
draw_strikethrough_the_document: 'Ziehe eine Streichung auf das Dokument', draw_strikethrough_the_document: 'Durchstreichung im Dokument zeichnen',
quantity: 'Menge', quantity: 'Menge',
prefillable: 'Vorausfüllbar', prefillable: 'Vorausfüllbar',
signature_id: 'Signatur-ID', signature_id: 'Signatur-ID',
error_message: 'Fehlermeldung', error_message: 'Fehlermeldung',
length: 'Länge', length: 'Länge',
min: 'Min', min: 'Min.',
max: 'Max', max: 'Max.',
date_now: 'Akt. Datum',
font: 'Schriftart', font: 'Schriftart',
party: 'Partei', party: 'Partei',
method: 'Verfahren', date_signed: 'Unterzeichnungsdatum',
method: 'Methode',
reorder_fields: 'Felder neu anordnen', reorder_fields: 'Felder neu anordnen',
verify_id: 'ID überprüfen', verify_id: 'ID überprüfen',
obtain_qualified_electronic_signature_with_the_trusted_provider_click_to_learn_more: 'Erhalten Sie eine qualifizierte elektronische Signatur (QeS) beim vertrauenswürdigen Anbieter. Klicken Sie hier, um mehr zu erfahren.', obtain_qualified_electronic_signature_with_the_trusted_provider_click_to_learn_more: 'Qualifizierte elektronische Signatur (QES) beim vertrauenswürdigen Anbieter einholen. Klicken Sie, um mehr zu erfahren.',
wiederkehrend: 'Wiederkehrend',
einmalig: 'Einmalig',
editable: 'Bearbeitbar', editable: 'Bearbeitbar',
recurrent: 'Wiederkehrend',
one_off: 'Einmalig',
search_field: 'Suchfeld', search_field: 'Suchfeld',
field_not_found: 'Feld nicht gefunden', field_not_found: 'Feld nicht gefunden',
clear: 'Löschen', clear: 'Leeren',
type_value: 'Wert eingeben',
add_all_required_fields_to_continue: 'Fügen Sie alle erforderlichen Felder hinzu, um fortzufahren',
uploaded_pdf_contains_form_fields_keep_or_remove_them: 'Das hochgeladene PDF enthält Formularfelder. Behalten oder entfernen?',
keep: 'Behalten',
align: 'Ausrichten', align: 'Ausrichten',
add_all_required_fields_to_continue: 'Fügen Sie alle erforderlichen Felder hinzu, um fortzufahren',
uploaded_pdf_contains_form_fields_keep_or_remove_them: 'Das hochgeladene PDF enthält Formularfelder. Beibehalten oder entfernen?',
keep: 'Beibehalten',
left: 'Links', left: 'Links',
heading: 'Überschrift', heading: 'Überschrift',
validation: 'Validierung', validation: 'Validierung',
add_blank_page: 'Leere Seite hinzufügen', add_blank_page: 'Leere Seite hinzufügen',
right: 'Rechts', right: 'Rechts',
add_condition: 'Bedingung hinzufügen',
center: 'Zentriert', center: 'Zentriert',
with_logo: 'Mit Logo',
description: 'Beschreibung', description: 'Beschreibung',
display_title: 'Anzeigetitel', display_title: 'Anzeigetitel',
unchecked: 'Nicht überprüft', with_logo: 'Mit Logo',
unchecked: 'Nicht markiert',
price: 'Preis', price: 'Preis',
type_value: 'Wert eingeben',
equal: 'Gleich', equal: 'Gleich',
not_equal: 'Ungleich', not_equal: 'Ungleich',
contains: 'Enthält', contains: 'Enthält',
does_not_contain: 'Enthält nicht', does_not_contain: 'Enthält nicht',
not_empty: 'Nicht leer', not_empty: 'Nicht leer',
empty: 'Leer', empty: 'Leer',
signing_date: 'Signaturdatum',
select_field_: 'Feld auswählen...', select_field_: 'Feld auswählen...',
select_value_: 'Wert auswählen...', select_value_: 'Wert auswählen...',
remove_condition: 'Bedingung entfernen', remove_condition: 'Bedingung entfernen',
condition: 'Bedingung', add_condition: 'Bedingung hinzufügen',
formula: 'Formel', are_you_sure_: 'Sind Sie sicher?',
sign_yourself: 'Selbst unterschreiben',
set_signing_date: 'Unterzeichnungsdatum festlegen',
signing_date: 'Unterzeichnungsdatum',
send: 'Senden',
remove: 'Entfernen',
edit: 'Bearbeiten', edit: 'Bearbeiten',
settings: 'Einstellungen', settings: 'Einstellungen',
up: 'Nach oben', up: 'Nach oben',
down: 'Nach unten', down: 'Nach unten',
set_signing_date: 'Unterschriftdatum festlegen', checked: 'Markiert',
are_you_sure_: 'Bist du sicher?',
sign_yourself: 'Unterschreiben Sie selbst',
checked: 'Ausgewählt',
send: 'Senden',
remove: 'Entfernen',
save: 'Speichern', save: 'Speichern',
cancel: 'Abbrechen', cancel: 'Abbrechen',
draw_field_on_the_document: 'Ein Feld auf dem Dokument zeichnen', any: 'Beliebig',
click_to_upload: 'Klicken Sie zum Hochladen', drawn: 'Gezeichnet',
or_drag_and_drop_files: 'oder Dateien hierher ziehen', drawn_or_typed: 'Gezeichnet oder getippt',
uploading: 'Hochladen', drawn_or_upload: 'Gezeichnet oder hochgeladen',
processing_: 'Verarbeitung...', upload: 'Hochladen',
formula: 'Formel',
typed: 'Getippt',
draw_field_on_the_document: 'Ein Feld im Dokument zeichnen',
click_to_upload: 'Zum Hochladen klicken',
or_drag_and_drop_files: 'oder Dateien per Drag & Drop ablegen',
uploading: 'Hochladen...',
processing_: 'Verarbeiten...',
add_pdf_documents_or_images: 'PDF-Dokumente oder Bilder hinzufügen', add_pdf_documents_or_images: 'PDF-Dokumente oder Bilder hinzufügen',
add_documents_or_images: 'Dokumente oder Bilder hinzufügen', add_documents_or_images: 'Dokumente oder Bilder hinzufügen',
add_a_new_document: 'Neues Dokument hinzufügen', add_a_new_document: 'Neues Dokument hinzufügen',
@@ -983,11 +1039,12 @@ const de = {
format: 'Format', format: 'Format',
read_only: 'Nur lesen', read_only: 'Nur lesen',
page: 'Seite', page: 'Seite',
draw_new_area: 'Neuen Bereich zeichnen', draw_new_area: 'Bereich zeichnen',
copy_to_all_pages: 'Auf alle Seiten kopieren', copy_to_all_pages: 'Auf alle Seiten kopieren',
add_option: 'Option hinzufügen', add_option: 'Option hinzufügen',
option: 'Option', option: 'Option',
options: 'Options', options: 'Optionen',
condition: 'Bedingung',
first_party: 'Erste Partei', first_party: 'Erste Partei',
second_party: 'Zweite Partei', second_party: 'Zweite Partei',
third_party: 'Dritte Partei', third_party: 'Dritte Partei',
@@ -1006,21 +1063,21 @@ const de = {
sixteenth_party: 'Sechzehnte Partei', sixteenth_party: 'Sechzehnte Partei',
seventeenth_party: 'Siebzehnte Partei', seventeenth_party: 'Siebzehnte Partei',
eighteenth_party: 'Achtzehnte Partei', eighteenth_party: 'Achtzehnte Partei',
nineteenth_party: 'Neunzehnte Party', nineteenth_party: 'Neunzehnte Partei',
twentieth_party: 'Zwanzigste Party', twentieth_party: 'Zwanzigste Partei',
draw: 'Zeichnen', draw: 'Zeichnen',
add: 'Hinzufügen', add: 'Hinzufügen',
or_add_field_without_drawing: 'Oder Feld ohne Zeichnung hinzufügen', or_add_field_without_drawing: 'Oder Feld ohne Zeichnen hinzufügen',
text: 'Text', text: 'Text',
number: 'Zahl',
signature: 'Unterschrift', signature: 'Unterschrift',
initials: 'Initialen', initials: 'Initialen',
date: 'Datum', date: 'Datum',
number: 'Nummer',
image: 'Bild', image: 'Bild',
file: 'Datei', file: 'Datei',
select: 'Auswählen', select: 'Auswahl',
checkbox: 'Checkbox', checkbox: 'Checkbox',
multiple: 'Mehrere', multiple: 'Mehrfach',
radio: 'Radio', radio: 'Radio',
cells: 'Zellen', cells: 'Zellen',
stamp: 'Stempel', stamp: 'Stempel',
@@ -1034,32 +1091,26 @@ const de = {
image_field: 'Bildfeld', image_field: 'Bildfeld',
file_field: 'Dateifeld', file_field: 'Dateifeld',
select_field: 'Auswahlfeld', select_field: 'Auswahlfeld',
checkbox_field: 'Checkbox-Feld', checkbox_field: 'Checkboxfeld',
multiple_field: 'Mehrfach-Auswahlfeld', multiple_field: 'Mehrfachauswahlfeld',
radio_field: 'Radio-Gruppenfeld', radio_field: 'Radiogruppe',
cells_field: 'Zellenfeld', cells_field: 'Zellenfeld',
stamp_field: 'Stempelfeld', stamp_field: 'Stempelfeld',
payment_field: 'Zahlungsfeld', payment_field: 'Zahlungsfeld',
phone_field: 'Telefonfeld', phone_field: 'Telefonfeld',
draw_a_text_field_on_the_page_with_a_mouse: 'Textfeld auf der Seite mit der Maus zeichnen', draw_a_text_field_on_the_page_with_a_mouse: 'Ein Textfeld mit der Maus auf der Seite zeichnen',
drag_and_drop_any_other_field_type_on_the_page: 'Ziehe und lasse einen anderen Feldtyp auf die Seite fallen', drag_and_drop_any_other_field_type_on_the_page: 'Jeden anderen Feldtyp auf die Seite ziehen und ablegen',
click_on_the_field_type_above_to_start_drawing_it: 'Klicke auf den Feldtyp oben, um mit dem Zeichnen zu beginnen', click_on_the_field_type_above_to_start_drawing_it: 'Klicken Sie oben auf den Feldtyp, um mit dem Zeichnen zu beginnen',
please_draw_fields_to_prepare_the_document: 'Bitte zeichne Felder, um das Dokument vorzubereiten.', please_draw_fields_to_prepare_the_document: 'Bitte zeichnen Sie Felder, um das Dokument vorzubereiten.',
only_pdf_and_images_are_supported: 'Nur PDFs und Bilder werden unterstützt.', only_pdf_and_images_are_supported: 'Nur PDF und Bilder werden unterstützt.',
unlock_sms_verified_phone_number_field_with_paid_plan_use_text_field_for_phone_numbers_without_verification: 'Schalte das SMS-verifizierte Telefonnummernfeld mit einem kostenpflichtigen Plan frei. Verwende das Textfeld für Telefonnummern ohne Verifizierung.', unlock_sms_verified_phone_number_field_with_paid_plan_use_text_field_for_phone_numbers_without_verification: 'SMS-verifiziertes Telefonnummernfeld mit kostenpflichtigem Plan freischalten. Verwenden Sie für Telefonnummern ohne Verifizierung das Textfeld.',
available_only_in_pro: 'Nur in Pro verfügbar', available_only_in_pro: 'Nur in Pro verfügbar',
failed_to_download_files: 'Fehler beim Herunterladen der Dateien', failed_to_download_files: 'Dateien konnten nicht heruntergeladen werden',
please_add_fields_for_the_submitter_name_or_remove_the_submitter_name_if_not_needed: 'Bitte füge Felder für {submitter_name} hinzu oder entferne {submitter_name}, falls nicht erforderlich.', please_add_fields_for_the_submitter_name_or_remove_the_submitter_name_if_not_needed: 'Bitte fügen Sie Felder für {submitter_name} hinzu oder entfernen Sie {submitter_name}, falls nicht benötigt.',
draw_field: 'Feld {field} zeichnen', draw_field: '{field}-Feld zeichnen',
replace: 'Ersetzen', replace: 'Ersetzen',
uploading_: 'Hochladen...', uploading_: 'Hochladen...',
add_document: 'Hochladen', add_document: 'Hochladen',
any: 'Jede',
drawn: 'Gezeichnet',
drawn_or_typed: 'Gezeichnet oder getippt',
drawn_or_upload: 'Gezeichnet oder hochgeladen',
upload: 'Upload',
typed: 'Getippt',
none: 'Keine', none: 'Keine',
ssn: 'SSN', ssn: 'SSN',
ein: 'EIN', ein: 'EIN',
@@ -1069,19 +1120,212 @@ const de = {
custom: 'Benutzerdefiniert', custom: 'Benutzerdefiniert',
numbers_only: 'Nur Zahlen', numbers_only: 'Nur Zahlen',
letters_only: 'Nur Buchstaben', letters_only: 'Nur Buchstaben',
regexp_validation: 'Regulärer Ausdruck Überprüfung', regexp_validation: 'RegExp-Validierung',
enter_pdf_password: 'Geben Sie das PDF-Passwort ein', enter_pdf_password: 'PDF-Passwort eingeben',
wrong_password: 'Falsches Passwort', wrong_password: 'Falsches Passwort',
currency: 'Währung', currency: 'Währung',
save_and_preview: 'Speichern und Vorschau', save_and_preview: 'Speichern und Vorschau',
preferences: 'Einstellungen', preferences: 'Voreinstellungen',
available_in_pro: 'In Pro verfügbar', available_in_pro: 'In Pro verfügbar',
some_fields_are_missing_in_the_formula: 'Einige Felder fehlen in der Formel.', some_fields_are_missing_in_the_formula: 'Einige Felder fehlen in der Formel.',
learn_more: 'Erfahren Sie mehr', learn_more: 'Mehr erfahren',
and: 'und', and: 'und',
or: 'oder', or: 'oder',
start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Starte eine kurze Tour, um zu lernen, wie du dein erstes Dokument erstellst und versendest.', start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Starten Sie eine Kurztour, um zu lernen, wie Sie Ihr erstes Dokument erstellen und versenden.',
start_tour: 'Starten' start_tour: 'Tour starten',
or_add_from: 'Oder hinzufügen aus',
sync: 'Synchronisieren',
syncing: 'Synchronisiere...'
} }
export { en, es, it, pt, fr, de } const nl = {
kba: 'KBA',
autodetect_fields: 'Velden detecteren',
analyzing_: 'Analyseren...',
download: 'Downloaden',
downloading_: 'Downloaden...',
view: 'Bekijken',
payment_link: 'Betaallink',
strikeout: 'Doorhalen',
draw_strikethrough_the_document: 'Teken doorhaling in het document',
quantity: 'Aantal',
prefillable: 'Voorinvulbaar',
signature_id: 'Handtekening-ID',
error_message: 'Foutmelding',
length: 'Lengte',
min: 'Min',
max: 'Max',
font: 'Lettertype',
party: 'Partij',
date_signed: 'Datum ondertekend',
method: 'Methode',
reorder_fields: 'Velden herschikken',
verify_id: 'ID verifiëren',
obtain_qualified_electronic_signature_with_the_trusted_provider_click_to_learn_more: 'Verkrijg een gekwalificeerde elektronische handtekening (QeS) via de vertrouwde provider. Klik voor meer informatie.',
editable: 'Bewerkbaar',
recurrent: 'Terugkerend',
one_off: 'Eenmalig',
search_field: 'Zoekveld',
field_not_found: 'Veld niet gevonden',
clear: 'Wissen',
align: 'Uitlijnen',
add_all_required_fields_to_continue: 'Voeg alle vereiste velden toe om door te gaan',
uploaded_pdf_contains_form_fields_keep_or_remove_them: 'Geüploade PDF bevat formuliervelden. Behouden of verwijderen?',
keep: 'Behouden',
left: 'Links',
heading: 'Koptekst',
validation: 'Validatie',
add_blank_page: 'Lege pagina toevoegen',
right: 'Rechts',
center: 'Centreren',
description: 'Beschrijving',
display_title: 'Titel weergeven',
with_logo: 'Met logo',
unchecked: 'Niet aangevinkt',
price: 'Prijs',
type_value: 'Typ waarde',
equal: 'Gelijk aan',
not_equal: 'Niet gelijk aan',
contains: 'Bevat',
does_not_contain: 'Bevat niet',
not_empty: 'Niet leeg',
empty: 'Leeg',
select_field_: 'Veld selecteren...',
select_value_: 'Waarde selecteren...',
remove_condition: 'Voorwaarde verwijderen',
add_condition: 'Voorwaarde toevoegen',
are_you_sure_: 'Weet u het zeker?',
sign_yourself: 'Zelf ondertekenen',
set_signing_date: 'Ondertekeningsdatum instellen',
signing_date: 'Ondertekeningsdatum',
send: 'Verzenden',
remove: 'Verwijderen',
edit: 'Bewerken',
settings: 'Instellingen',
up: 'Omhoog',
down: 'Omlaag',
checked: 'Aangevinkt',
save: 'Opslaan',
cancel: 'Annuleren',
any: 'Elke',
drawn: 'Getekend',
drawn_or_typed: 'Getekend of getypt',
drawn_or_upload: 'Getekend of uploaden',
upload: 'Uploaden',
formula: 'Formule',
typed: 'Getypt',
draw_field_on_the_document: 'Teken een veld op het document',
click_to_upload: 'Klik om te uploaden',
or_drag_and_drop_files: 'of sleep bestanden hierheen',
uploading: 'Uploaden',
processing_: 'Bezig met verwerken...',
add_pdf_documents_or_images: 'PDF-documenten of afbeeldingen toevoegen',
add_documents_or_images: 'Documenten of afbeeldingen toevoegen',
add_a_new_document: 'Nieuw document toevoegen',
replace_existing_document: 'Bestaand document vervangen',
clone_and_replace_documents: 'Documenten klonen en vervangen',
required: 'Vereist',
default_value: 'Standaardwaarde',
format: 'Formaat',
read_only: 'Alleen-lezen',
page: 'Pagina',
draw_new_area: 'Nieuw gebied tekenen',
copy_to_all_pages: 'Kopieer naar alle pag.',
add_option: 'Optie toevoegen',
option: 'Optie',
options: 'Opties',
condition: 'Voorwaarde',
first_party: 'Eerste partij',
second_party: 'Tweede partij',
third_party: 'Derde partij',
fourth_party: 'Vierde partij',
fifth_party: 'Vijfde partij',
sixth_party: 'Zesde partij',
seventh_party: 'Zevende partij',
eighth_party: 'Achtste partij',
ninth_party: 'Negende partij',
tenth_party: 'Tiende partij',
eleventh_party: 'Elfde partij',
twelfth_party: 'Twaalfde partij',
thirteenth_party: 'Dertiende partij',
fourteenth_party: 'Veertiende partij',
fifteenth_party: 'Vijftiende partij',
sixteenth_party: 'Zestiende partij',
seventeenth_party: 'Zeventiende partij',
eighteenth_party: 'Achttiende partij',
nineteenth_party: 'Negentiende partij',
twentieth_party: 'Twintigste partij',
draw: 'Tekenen',
add: 'Toevoegen',
or_add_field_without_drawing: 'Of voeg een veld toe zonder te tekenen',
text: 'Tekst',
number: 'Getal',
signature: 'Signatuur',
initials: 'Initialen',
date: 'Datum',
image: 'Afbeelding',
file: 'Bestand',
select: 'Selecteren',
checkbox: 'Checkbox',
multiple: 'Meerdere',
radio: 'Radio',
cells: 'Cellen',
stamp: 'Stempel',
payment: 'Betaling',
phone: 'Telefoon',
text_field: 'Tekstveld',
signature_field: 'Signatuurveld',
initials_field: 'Initialenveld',
date_field: 'Datumveld',
number_field: 'Getalveld',
image_field: 'Afbeeldingsveld',
file_field: 'Bestandsveld',
select_field: 'Selectieveld',
checkbox_field: 'Aankruisvakje',
multiple_field: 'Meerkeuzeveld',
radio_field: 'Radiogroepveld',
cells_field: 'Cellenveld',
stamp_field: 'Stempelveld',
payment_field: 'Betalingsveld',
phone_field: 'Telefoonveld',
draw_a_text_field_on_the_page_with_a_mouse: 'Teken met de muis een tekstveld op de pagina',
drag_and_drop_any_other_field_type_on_the_page: 'Sleep elk ander veldtype naar de pagina',
click_on_the_field_type_above_to_start_drawing_it: 'Klik op het bovenstaande veldtype om te beginnen met tekenen',
please_draw_fields_to_prepare_the_document: 'Teken velden om het document voor te bereiden.',
only_pdf_and_images_are_supported: 'Alleen PDF en afbeeldingen worden ondersteund.',
unlock_sms_verified_phone_number_field_with_paid_plan_use_text_field_for_phone_numbers_without_verification: 'Ontgrendel het SMS-geverifieerde veld voor telefoonnummer met een betaald abonnement. Gebruik het tekstveld voor telefoonnummers zonder verificatie.',
available_only_in_pro: 'Alleen beschikbaar in Pro',
failed_to_download_files: 'Bestanden downloaden mislukt',
please_add_fields_for_the_submitter_name_or_remove_the_submitter_name_if_not_needed: 'Voeg velden toe voor de {submitter_name}. Of verwijder de {submitter_name} als deze niet nodig is.',
draw_field: 'Teken het veld {field}',
replace: 'Vervangen',
uploading_: 'Bezig met uploaden...',
add_document: 'Doc. toevoegen',
none: 'Geen',
ssn: 'SSN',
ein: 'EIN',
email: 'E-mail',
url: 'URL',
zip: 'Postcode',
custom: 'Aangepast',
numbers_only: 'Alleen cijfers',
letters_only: 'Alleen letters',
regexp_validation: 'Regex validatie',
enter_pdf_password: 'Voer PDF-wachtwoord in',
wrong_password: 'Onjuist wachtwoord',
currency: 'Valuta',
save_and_preview: 'Opslaan & bekijken',
preferences: 'Voorkeuren',
available_in_pro: 'Beschikbaar in Pro',
some_fields_are_missing_in_the_formula: 'Sommige velden ontbreken in de formule.',
learn_more: 'Meer informatie',
and: 'en',
or: 'of',
start_a_quick_tour_to_learn_how_to_create_an_send_your_first_document: 'Start een korte rondleiding om te leren hoe u uw eerste document maakt en verzendt',
start_tour: 'Rondleiding starten',
or_add_from: 'Of toevoegen van',
sync: 'Synchroniseren',
syncing: 'Synchroniseren...'
}
export { en, es, it, pt, fr, de, nl }
@@ -1,5 +1,5 @@
<template> <template>
<div class="absolute text-center w-full bottom-0 pr-3 mb-4"> <div class="absolute w-full bottom-0 pr-3 mb-4">
<span class="w-full bg-base-200 px-4 py-2 rounded-md inline-flex space-x-2 mx-auto items-center justify-between mb-2 z-20 draw-field-container-mobile"> <span class="w-full bg-base-200 px-4 py-2 rounded-md inline-flex space-x-2 mx-auto items-center justify-between mb-2 z-20 draw-field-container-mobile">
<div class="flex items-center space-x-2"> <div class="flex items-center space-x-2">
<component <component
@@ -77,7 +77,7 @@ export default {
removeSubmitter (submitter) { removeSubmitter (submitter) {
[...this.fields].forEach((field) => { [...this.fields].forEach((field) => {
if (field.submitter_uuid === submitter.uuid) { if (field.submitter_uuid === submitter.uuid) {
this.removeField(field) this.removeField(field, false)
} }
}) })
@@ -89,10 +89,12 @@ export default {
this.save() this.save()
}, },
removeField (field) { removeField (field, save = true) {
this.fields.splice(this.fields.indexOf(field), 1) this.fields.splice(this.fields.indexOf(field), 1)
this.save() if (save) {
this.save()
}
} }
} }
} }
@@ -49,12 +49,17 @@
</li> </li>
</template> </template>
</template> </template>
<template v-else> <div
v-if="fieldTypes.length && submitterDefaultFields.length"
class="bg-base-300"
style="height: 1px; margin-top: 1px; margin-bottom: 1px"
/>
<template v-if="fieldTypes.length || !submitterDefaultFields.length">
<template <template
v-for="(icon, type) in fieldIconsSorted" v-for="(icon, type) in fieldIconsSorted"
:key="type" :key="type"
> >
<li v-if="fieldTypes.includes(type) || ((withPhone || type != 'phone') && (withPayment || type != 'payment') && (withVerification || type != 'verification'))"> <li v-if="fieldTypes.includes(type) || ((withPhone || type != 'phone') && (withPayment || type != 'payment') && (withVerification || type != 'verification') && (withKba || type != 'kba'))">
<a <a
href="#" href="#"
class="text-sm py-1 px-2" class="text-sm py-1 px-2"
@@ -84,7 +89,7 @@ export default {
IconPlus, IconPlus,
IconX IconX
}, },
inject: ['withPhone', 'withPayment', 'withVerification', 'backgroundColor', 't'], inject: ['withPhone', 'withPayment', 'withVerification', 'withKba', 'backgroundColor', 't'],
props: { props: {
modelValue: { modelValue: {
type: String, type: String,
+18 -8
View File
@@ -9,7 +9,7 @@
loading="lazy" loading="lazy"
> >
<div <div
class="group flex justify-end cursor-pointer top-0 bottom-0 left-0 right-0 absolute p-1 hover:bg-black/10 transition-colors" class="group flex justify-end cursor-pointer top-0 bottom-0 left-0 right-0 absolute p-1 hover:bg-black/10 transition-colors rounded"
@click="$emit('scroll-to', item)" @click="$emit('scroll-to', item)"
> >
<div <div
@@ -23,7 +23,7 @@
> >
<div> <div>
<button <button
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors p-0 document-control-button" class="btn border-gray-300 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors p-0 document-control-button"
@click.stop="isShowConditionsModal = true" @click.stop="isShowConditionsModal = true"
> >
<IconRouteAltLeft <IconRouteAltLeft
@@ -48,7 +48,7 @@
> >
<div> <div>
<button <button
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors document-control-button" class="btn border-gray-300 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors document-control-button"
style="width: 24px; height: 24px" style="width: 24px; height: 24px"
@click.stop="$emit('remove', item)" @click.stop="$emit('remove', item)"
> >
@@ -63,7 +63,7 @@
class="tooltip tooltip-left before:text-xs" class="tooltip tooltip-left before:text-xs"
> >
<button <button
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors p-0 document-control-button" class="btn border-gray-300 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors p-0 document-control-button"
@click.stop="$emit('reorder', item)" @click.stop="$emit('reorder', item)"
> >
<IconSortDescending2 <IconSortDescending2
@@ -75,14 +75,14 @@
</span> </span>
<template v-if="withArrows"> <template v-if="withArrows">
<button <button
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors document-control-button" class="btn border-gray-300 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors document-control-button"
style="width: 24px; height: 24px" style="width: 24px; height: 24px"
@click.stop="$emit('up', item)" @click.stop="$emit('up', item)"
> >
&uarr; &uarr;
</button> </button>
<button <button
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors document-control-button" class="btn border-gray-300 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors document-control-button"
style="width: 24px; height: 24px" style="width: 24px; height: 24px"
@click.stop="$emit('down', item)" @click.stop="$emit('down', item)"
> >
@@ -94,12 +94,20 @@
</div> </div>
</div> </div>
</div> </div>
<div class="flex pb-2 pt-1.5 document-preview-name"> <div class="flex items-center gap-1 pb-2 pt-1.5 document-preview-name">
<GoogleDriveDocumentSettings
v-if="item.google_drive_file_id"
:template-id="template.id"
:google-drive-file-id="item.google_drive_file_id"
@success="$emit('replace', { replaceSchemaItem: item, ...$event })"
/>
<Contenteditable <Contenteditable
:model-value="item.name" :model-value="item.name"
:icon-width="16" :icon-width="16"
:icon-inline="true"
:float-icon="!item.google_drive_file_id"
:hide-icon="!item.google_drive_file_id"
:editable="editable" :editable="editable"
style="max-width: 95%"
class="mx-auto" class="mx-auto"
@update:model-value="onUpdateName" @update:model-value="onUpdateName"
/> />
@@ -123,6 +131,7 @@ import Upload from './upload'
import { IconRouteAltLeft, IconSortDescending2 } from '@tabler/icons-vue' import { IconRouteAltLeft, IconSortDescending2 } from '@tabler/icons-vue'
import ConditionsModal from './conditions_modal' import ConditionsModal from './conditions_modal'
import ReplaceButton from './replace' import ReplaceButton from './replace'
import GoogleDriveDocumentSettings from './google_drive_document_settings'
import Field from './field' import Field from './field'
import FieldType from './field_type' import FieldType from './field_type'
@@ -133,6 +142,7 @@ export default {
IconRouteAltLeft, IconRouteAltLeft,
ConditionsModal, ConditionsModal,
ReplaceButton, ReplaceButton,
GoogleDriveDocumentSettings,
IconSortDescending2 IconSortDescending2
}, },
inject: ['t'], inject: ['t'],
+232 -22
View File
@@ -3,29 +3,155 @@
<label <label
id="add_document_button" id="add_document_button"
:for="inputId" :for="inputId"
class="btn btn-outline w-full add-document-button" class="btn btn-outline w-full add-document-button px-0"
:class="{ 'btn-disabled': isLoading }" :class="{ 'btn-disabled': isLoading }"
> >
<IconInnerShadowTop <div
v-if="isLoading" class="flex items-center justify-between w-full h-full"
width="20" >
class="animate-spin" <span
/> class="flex items-center space-x-2 w-full justify-center"
<IconUpload :class="{ 'pl-3': withGoogleDrive }"
v-else >
width="20" <IconInnerShadowTop
/> v-if="isLoading"
<span v-if="isLoading"> width="20"
{{ t('uploading_') }} class="animate-spin"
</span> />
<span v-else> <IconUpload
{{ t('add_document') }} v-else
</span> width="20"
/>
<span v-if="isLoading">
{{ t('uploading_') }}
</span>
<span
v-else
class="mr-1 whitespace-nowrap truncate"
>
{{ t('add_document') }}
</span>
</span>
<span
v-if="withGoogleDrive"
class="dropdown dropdown-end dropdown-top inline h-full"
style="width: 33px"
>
<label
tabindex="0"
class="flex items-center h-full cursor-pointer"
>
<IconChevronDown class="w-5 h-5 flex-shrink-0" />
</label>
<ul
tabindex="0"
:style="{ backgroundColor }"
class="dropdown-content p-2 mt-2 shadow menu text-base mb-1 rounded-box text-right !text-base-content"
>
<li>
<button
type="button"
@click="openGoogleDriveModal"
>
<IconBrandGoogleDrive class="w-5 h-5 flex-shrink-0" />
<span class="whitespace-nowrap text-sm normal-case font-medium">Google Drive</span>
</button>
</li>
</ul>
</span>
</div>
</label> </label>
<Teleport
v-if="showGoogleDriveModal"
:to="modalContainerEl"
>
<div
class="modal modal-open items-start !animate-none overflow-y-auto"
>
<div
class="absolute top-0 bottom-0 right-0 left-0"
@click.prevent="showGoogleDriveModal = false"
/>
<div class="modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl">
<div class="flex justify-between items-center border-b pb-2 mb-2 font-medium">
<span class="modal-title">
Google Drive
</span>
<a
href="#"
class="text-xl modal-close-button"
@click.prevent="showGoogleDriveModal = false"
>&times;</a>
</div>
<div>
<form
v-if="showGoogleDriveOauthButton"
method="post"
:action="googleDriveOauthPath"
@submit="isConnectGoogleDriveClicked = true"
>
<input
type="hidden"
name="authenticity_token"
:value="authenticityToken"
autocomplete="off"
>
<button
id="gdrive_oauth_button"
class="btn bg-white btn-outline w-full text-base font-medium mt-4"
data-turbo="false"
type="submit"
:disabled="isConnectGoogleDriveClicked"
>
<span v-if="isConnectGoogleDriveClicked">
<span class="flex items-center justify-center space-x-2">
<IconInnerShadowTop class="animate-spin" />
<span class="">Submitting...</span>
</span>
</span>
<span
v-else
>
<span class="flex items-center justify-center space-x-2">
<IconBrandGoogleDrive />
<span>Connect Google Drive</span>
</span>
</span>
</button>
</form>
<div
v-else
class="relative"
>
<iframe
class="border border-base-300 rounded-lg"
style="width: 100%; height: 440px; background: white;"
src="/template_google_drive"
/>
<div v-if="isLoadingGoogleDrive">
<div
class="bg-white absolute top-0 bottom-0 left-0 right-0 opacity-80 rounded-lg"
style="margin: 1px"
/>
<div class="absolute top-0 bottom-0 left-0 right-0 flex items-center justify-center">
<IconInnerShadowTop class="animate-spin" />
</div>
</div>
</div>
</div>
</div>
</div>
</Teleport>
<form <form
ref="form" ref="form"
class="hidden" class="hidden"
> >
<input
v-for="file in googleDriveFiles"
:key="file.id"
name="google_drive_file_ids[]"
:value="file.id"
>
<input <input
:id="inputId" :id="inputId"
ref="input" ref="input"
@@ -40,20 +166,32 @@
</template> </template>
<script> <script>
import { IconUpload, IconInnerShadowTop } from '@tabler/icons-vue' import { IconUpload, IconInnerShadowTop, IconChevronDown, IconBrandGoogleDrive } from '@tabler/icons-vue'
export default { export default {
name: 'DocumentsUpload', name: 'DocumentsUpload',
components: { components: {
IconUpload, IconUpload,
IconInnerShadowTop IconInnerShadowTop,
IconChevronDown,
IconBrandGoogleDrive
}, },
inject: ['baseFetch', 't'], inject: ['baseFetch', 't', 'backgroundColor'],
props: { props: {
templateId: { templateId: {
type: [Number, String], type: [Number, String],
required: true required: true
}, },
authenticityToken: {
type: String,
required: false,
default: ''
},
withGoogleDrive: {
type: Boolean,
required: false,
default: false
},
acceptFileTypes: { acceptFileTypes: {
type: String, type: String,
required: false, required: false,
@@ -63,22 +201,88 @@ export default {
emits: ['success', 'error'], emits: ['success', 'error'],
data () { data () {
return { return {
isLoading: false isLoading: false,
isConnectGoogleDriveClicked: false,
isLoadingGoogleDrive: false,
googleDriveFiles: [],
showGoogleDriveModal: false,
showGoogleDriveOauthButton: false
} }
}, },
computed: { computed: {
inputId () { inputId () {
return 'el' + Math.random().toString(32).split('.')[1] return 'el' + Math.random().toString(32).split('.')[1]
}, },
queryParams () {
return new URLSearchParams(window.location.search)
},
uploadUrl () { uploadUrl () {
return `/templates/${this.templateId}/documents` return `/templates/${this.templateId}/documents`
},
googleDriveOauthPath () {
const params = {
access_type: 'offline',
include_granted_scopes: 'true',
prompt: 'consent',
scope: [
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/drive.file'
].join(' '),
state: new URLSearchParams({
redir: `/templates/${this.templateId}/edit?google_drive_open=1`
}).toString()
}
const query = new URLSearchParams(params).toString()
return `/auth/google_oauth2?${query}`
},
modalContainerEl () {
return this.$el.getRootNode().querySelector('#docuseal_modal_container')
} }
}, },
mounted () {
window.addEventListener('message', this.messageHandler)
if (this.queryParams.get('google_drive_open') === '1') {
this.openGoogleDriveModal()
window.history.replaceState({}, document.title, window.location.pathname)
}
},
beforeUnmount () {
window.removeEventListener('message', this.messageHandler)
},
methods: { methods: {
async upload () { openGoogleDriveModal () {
this.showGoogleDriveModal = true
this.isLoadingGoogleDrive = true
},
messageHandler (event) {
if (event.data.type === 'google-drive-files-picked') {
this.googleDriveFiles = event.data.files || []
this.$nextTick(() => {
this.isLoadingGoogleDrive = true
this.upload({ path: `/templates/${this.templateId}/google_drive_documents` }).then((resp) => {
if (resp.ok) {
this.showGoogleDriveModal = false
}
}).finally(() => {
this.isLoadingGoogleDrive = false
})
})
} else if (event.data.type === 'google-drive-picker-loaded') {
this.isLoadingGoogleDrive = false
} else if (event.data.type === 'google-drive-picker-request-oauth') {
this.showGoogleDriveOauthButton = true
}
},
async upload ({ path } = {}) {
this.isLoading = true this.isLoading = true
this.baseFetch(this.uploadUrl, { return this.baseFetch(path || this.uploadUrl, {
method: 'POST', method: 'POST',
headers: { Accept: 'application/json' }, headers: { Accept: 'application/json' },
body: new FormData(this.$refs.form) body: new FormData(this.$refs.form)
@@ -111,6 +315,10 @@ export default {
this.isLoading = false this.isLoading = false
} }
}) })
} else if (data.status === 'google_drive_file_missing') {
alert(data.error)
this.$emit('error', data.error)
this.isLoading = false
} else { } else {
this.$emit('error', data.error) this.$emit('error', data.error)
this.isLoading = false this.isLoading = false
@@ -122,6 +330,8 @@ export default {
this.isLoading = false this.isLoading = false
}) })
} }
return resp
}).catch(() => { }).catch(() => {
this.isLoading = false this.isLoading = false
}) })
+1 -1
View File
@@ -11,7 +11,7 @@ class GeneratePreviewImagesJob
max_page = [attachment.metadata['pdf']['number_of_pages'].to_i - 1, max_page = [attachment.metadata['pdf']['number_of_pages'].to_i - 1,
Templates::ProcessDocument::MAX_NUMBER_OF_PAGES_PROCESSED].min Templates::ProcessDocument::MAX_NUMBER_OF_PAGES_PROCESSED].min
Templates::ProcessDocument.generate_document_preview_images(attachment, attachment.download, (1..max_page), Templates::ProcessDocument.generate_document_preview_images(attachment, attachment.download, 1..max_page,
concurrency: 1) concurrency: 1)
end end
end end
+3 -1
View File
@@ -4,7 +4,9 @@ class ProcessSubmissionExpiredJob
include Sidekiq::Job include Sidekiq::Job
def perform(params = {}) def perform(params = {})
submission = Submission.find(params['submission_id']) submission = Submission.find_by(id: params['submission_id'])
return unless submission
return if submission.archived_at? return if submission.archived_at?
return if submission.template&.archived_at? return if submission.template&.archived_at?
+26 -10
View File
@@ -39,18 +39,26 @@ class ProcessSubmitterCompletionJob
submission = submitter.submission submission = submitter.submission
complete_verification_events, sms_events = complete_verification_events, sms_events =
submitter.submission_events.where(event_type: %i[send_sms send_2fa_sms complete_verification]) submitter.submission_events.where(event_type: %i[send_sms send_2fa_sms complete_verification complete_kba])
.partition { |e| e.event_type == 'complete_verification' } .partition { |e| e.event_type == 'complete_verification' || e.event_type == 'complete_kba' }
complete_verification_event = complete_verification_events.first complete_verification_event = complete_verification_events.first
verification_method =
if complete_verification_event&.event_type == 'complete_kba'
'kba'
elsif complete_verification_event
complete_verification_event.data['method']
end
completed_submitter.assign_attributes( completed_submitter.assign_attributes(
submission_id: submitter.submission_id, submission_id: submitter.submission_id,
account_id: submission.account_id, account_id: submission.account_id,
is_first: !CompletedSubmitter.exists?(submission: submitter.submission_id, is_first: true),
template_id: submission.template_id, template_id: submission.template_id,
source: submission.source, source: submission.source,
sms_count: sms_events.sum { |e| e.data['segments'] || 1 }, sms_count: sms_events.sum { |e| e.data['segments'] || 1 },
verification_method: complete_verification_event&.data&.dig('method'), verification_method:,
completed_at: submitter.completed_at completed_at: submitter.completed_at
) )
@@ -93,18 +101,26 @@ class ProcessSubmitterCompletionJob
def enqueue_completed_emails(submitter) def enqueue_completed_emails(submitter)
submission = submitter.submission submission = submitter.submission
template = submitter.template
user = submission.created_by_user || submitter.template.author user = submission.created_by_user || template.author
if submitter.account.users.exists?(id: user.id) && submission.preferences['send_email'] != false && if submitter.account.users.exists?(id: user.id) && submission.preferences['send_email'] != false &&
submitter.template&.preferences&.dig('completed_notification_email_enabled') != false (!template || template.preferences['completed_notification_email_enabled'] != false)
if submission.submitters.map(&:email).exclude?(user.email) && user_submitter = submission.submitters.find { |s| s.email == user.email }
user.user_configs.find_by(key: UserConfig::RECEIVE_COMPLETED_EMAIL)&.value != false &&
user.role != 'integration' is_sent_to_user =
SubmitterMailer.completed_email(submitter, user).deliver_later! if user.role != 'integration' &&
end (!user_submitter || user_submitter.preferences['send_email'] == false) &&
user.user_configs.find_by(key: UserConfig::RECEIVE_COMPLETED_EMAIL)&.value != false
SubmitterMailer.completed_email(submitter, user).deliver_later!
true
end
build_bcc_addresses(submission).each do |to| build_bcc_addresses(submission).each do |to|
next if is_sent_to_user && to == user.email
SubmitterMailer.completed_email(submitter, user, to:).deliver_later! SubmitterMailer.completed_email(submitter, user, to:).deliver_later!
end end
end end
@@ -0,0 +1,11 @@
# frozen_string_literal: true
class SendConfirmationInstructionsJob
include Sidekiq::Job
def perform(params = {})
user = User.find(params['user_id'])
user.send_confirmation_instructions
end
end
@@ -8,8 +8,13 @@ class SendFormCompletedWebhookRequestJob
MAX_ATTEMPTS = 12 MAX_ATTEMPTS = 12
def perform(params = {}) def perform(params = {})
submitter = Submitter.find(params['submitter_id']) submitter = Submitter.find_by(id: params['submitter_id'])
webhook_url = WebhookUrl.find(params['webhook_url_id'])
return unless submitter
webhook_url = WebhookUrl.find_by(id: params['webhook_url_id'])
return unless webhook_url
attempt = params['attempt'].to_i attempt = params['attempt'].to_i
@@ -8,8 +8,13 @@ class SendFormDeclinedWebhookRequestJob
MAX_ATTEMPTS = 10 MAX_ATTEMPTS = 10
def perform(params = {}) def perform(params = {})
submitter = Submitter.find(params['submitter_id']) submitter = Submitter.find_by(id: params['submitter_id'])
webhook_url = WebhookUrl.find(params['webhook_url_id'])
return unless submitter
webhook_url = WebhookUrl.find_by(id: params['webhook_url_id'])
return unless webhook_url
attempt = params['attempt'].to_i attempt = params['attempt'].to_i
@@ -8,8 +8,13 @@ class SendFormStartedWebhookRequestJob
MAX_ATTEMPTS = 10 MAX_ATTEMPTS = 10
def perform(params = {}) def perform(params = {})
submitter = Submitter.find(params['submitter_id']) submitter = Submitter.find_by(id: params['submitter_id'])
webhook_url = WebhookUrl.find(params['webhook_url_id'])
return unless submitter
webhook_url = WebhookUrl.find_by(id: params['webhook_url_id'])
return unless webhook_url
attempt = params['attempt'].to_i attempt = params['attempt'].to_i
@@ -8,8 +8,13 @@ class SendFormViewedWebhookRequestJob
MAX_ATTEMPTS = 10 MAX_ATTEMPTS = 10
def perform(params = {}) def perform(params = {})
submitter = Submitter.find(params['submitter_id']) submitter = Submitter.find_by(id: params['submitter_id'])
webhook_url = WebhookUrl.find(params['webhook_url_id'])
return unless submitter
webhook_url = WebhookUrl.find_by(id: params['webhook_url_id'])
return unless webhook_url
attempt = params['attempt'].to_i attempt = params['attempt'].to_i
@@ -8,8 +8,13 @@ class SendSubmissionArchivedWebhookRequestJob
MAX_ATTEMPTS = 10 MAX_ATTEMPTS = 10
def perform(params = {}) def perform(params = {})
submission = Submission.find(params['submission_id']) submission = Submission.find_by(id: params['submission_id'])
webhook_url = WebhookUrl.find(params['webhook_url_id'])
return unless submission
webhook_url = WebhookUrl.find_by(id: params['webhook_url_id'])
return unless webhook_url
attempt = params['attempt'].to_i attempt = params['attempt'].to_i
@@ -8,8 +8,13 @@ class SendSubmissionCompletedWebhookRequestJob
MAX_ATTEMPTS = 10 MAX_ATTEMPTS = 10
def perform(params = {}) def perform(params = {})
submission = Submission.find(params['submission_id']) submission = Submission.find_by(id: params['submission_id'])
webhook_url = WebhookUrl.find(params['webhook_url_id'])
return unless submission
webhook_url = WebhookUrl.find_by(id: params['webhook_url_id'])
return unless webhook_url
attempt = params['attempt'].to_i attempt = params['attempt'].to_i
@@ -8,8 +8,13 @@ class SendSubmissionCreatedWebhookRequestJob
MAX_ATTEMPTS = 10 MAX_ATTEMPTS = 10
def perform(params = {}) def perform(params = {})
submission = Submission.find(params['submission_id']) submission = Submission.find_by(id: params['submission_id'])
webhook_url = WebhookUrl.find(params['webhook_url_id'])
return unless submission
webhook_url = WebhookUrl.find_by(id: params['webhook_url_id'])
return unless webhook_url
attempt = params['attempt'].to_i attempt = params['attempt'].to_i
@@ -8,8 +8,13 @@ class SendSubmissionExpiredWebhookRequestJob
MAX_ATTEMPTS = 10 MAX_ATTEMPTS = 10
def perform(params = {}) def perform(params = {})
submission = Submission.find(params['submission_id']) submission = Submission.find_by(id: params['submission_id'])
webhook_url = WebhookUrl.find(params['webhook_url_id'])
return unless submission
webhook_url = WebhookUrl.find_by(id: params['webhook_url_id'])
return unless webhook_url
attempt = params['attempt'].to_i attempt = params['attempt'].to_i
@@ -7,6 +7,8 @@ class SendSubmitterInvitationEmailJob
submitter = Submitter.find(params['submitter_id']) submitter = Submitter.find(params['submitter_id'])
return if submitter.completed_at? return if submitter.completed_at?
return if submitter.submission.archived_at?
return if submitter.template&.archived_at?
return if submitter.submission.source == 'invite' && !Accounts.can_send_emails?(submitter.account, on_events: true) return if submitter.submission.source == 'invite' && !Accounts.can_send_emails?(submitter.account, on_events: true)
unless Accounts.can_send_invitation_emails?(submitter.account) unless Accounts.can_send_invitation_emails?(submitter.account)
@@ -0,0 +1,17 @@
# frozen_string_literal: true
class SendSubmitterVerificationEmailJob
include Sidekiq::Job
def perform(params = {})
submitter = Submitter.find(params['submitter_id'])
locale = params['locale'].presence || submitter.account.locale
SubmitterMailer.otp_verification_email(submitter, locale:).deliver_now!
SubmissionEvent.create!(submitter_id: params['submitter_id'],
event_type: 'send_2fa_email',
data: { email: submitter.email })
end
end
@@ -8,8 +8,13 @@ class SendTemplateCreatedWebhookRequestJob
MAX_ATTEMPTS = 10 MAX_ATTEMPTS = 10
def perform(params = {}) def perform(params = {})
template = Template.find(params['template_id']) template = Template.find_by(id: params['template_id'])
webhook_url = WebhookUrl.find(params['webhook_url_id'])
return unless template
webhook_url = WebhookUrl.find_by(id: params['webhook_url_id'])
return unless webhook_url
attempt = params['attempt'].to_i attempt = params['attempt'].to_i
@@ -8,8 +8,13 @@ class SendTemplateUpdatedWebhookRequestJob
MAX_ATTEMPTS = 10 MAX_ATTEMPTS = 10
def perform(params = {}) def perform(params = {})
template = Template.find(params['template_id']) template = Template.find_by(id: params['template_id'])
webhook_url = WebhookUrl.find(params['webhook_url_id'])
return unless template
webhook_url = WebhookUrl.find_by(id: params['webhook_url_id'])
return unless webhook_url
attempt = params['attempt'].to_i attempt = params['attempt'].to_i
+21 -4
View File
@@ -7,11 +7,28 @@ class SendTestWebhookRequestJob
USER_AGENT = 'DocuSeal.com Webhook' USER_AGENT = 'DocuSeal.com Webhook'
def perform(params = {}) HttpsError = Class.new(StandardError)
submitter = Submitter.find(params['submitter_id']) LocalhostError = Class.new(StandardError)
webhook_url = WebhookUrl.find(params['webhook_url_id'])
return unless webhook_url && submitter def perform(params = {})
submitter = Submitter.find_by(id: params['submitter_id'])
return unless submitter
webhook_url = WebhookUrl.find_by(id: params['webhook_url_id'])
return unless webhook_url
if Docuseal.multitenant?
uri = begin
URI(webhook_url.url)
rescue URI::Error
Addressable::URI.parse(webhook_url.url).normalize
end
raise HttpsError, 'Only HTTPS is allowed.' if uri.scheme != 'https'
raise LocalhostError, "Can't send to localhost." if uri.host.in?(SendWebhookRequest::LOCALHOSTS)
end
Faraday.post(webhook_url.url, Faraday.post(webhook_url.url,
{ {
+11
View File
@@ -144,6 +144,17 @@ class SubmitterMailer < ApplicationMailer
end end
end end
def otp_verification_email(submitter, locale: nil)
@submitter = submitter
@otp_code = EmailVerificationCodes.generate([submitter.email.downcase.strip, submitter.slug].join(':'))
assign_message_metadata('otp_verification_email', submitter)
I18n.with_locale(locale || submitter.account.locale) do
mail(to: submitter.email, subject: I18n.t('email_verification'))
end
end
private private
def build_submitter_reply_to(submitter, email_config: nil, documents_copy_email: nil) def build_submitter_reply_to(submitter, email_config: nil, documents_copy_email: nil)
+4
View File
@@ -60,6 +60,10 @@ class Account < ApplicationRecord
linked_account_account&.testing? linked_account_account&.testing?
end end
def tz_info
@tz_info ||= TZInfo::Timezone.get(ActiveSupport::TimeZone::MAPPING[timezone] || timezone)
end
def default_template_folder def default_template_folder
super || build_default_template_folder(name: TemplateFolder::DEFAULT_NAME, super || build_default_template_folder(name: TemplateFolder::DEFAULT_NAME,
author_id: users.minimum(:id)).tap(&:save!) author_id: users.minimum(:id)).tap(&:save!)
+9
View File
@@ -22,6 +22,7 @@
# #
class AccountConfig < ApplicationRecord class AccountConfig < ApplicationRecord
SUBMITTER_INVITATION_EMAIL_KEY = 'submitter_invitation_email' SUBMITTER_INVITATION_EMAIL_KEY = 'submitter_invitation_email'
SUBMITTER_INVITATION_REMINDER_EMAIL_KEY = 'submitter_invitation_reminder_email'
SUBMITTER_COMPLETED_EMAIL_KEY = 'submitter_completed_email' SUBMITTER_COMPLETED_EMAIL_KEY = 'submitter_completed_email'
SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY = 'submitter_documents_copy_email' SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY = 'submitter_documents_copy_email'
BCC_EMAILS = 'bcc_emails' BCC_EMAILS = 'bcc_emails'
@@ -44,10 +45,12 @@ class AccountConfig < ApplicationRecord
WITH_SIGNATURE_ID = 'with_signature_id' WITH_SIGNATURE_ID = 'with_signature_id'
WITH_FILE_LINKS_KEY = 'with_file_links' WITH_FILE_LINKS_KEY = 'with_file_links'
WITH_SIGNATURE_ID_REASON_KEY = 'with_signature_id_reason' WITH_SIGNATURE_ID_REASON_KEY = 'with_signature_id_reason'
RECIPIENT_FORM_FIELDS_KEY = 'recipient_form_fields'
WITH_AUDIT_VALUES_KEY = 'with_audit_values' WITH_AUDIT_VALUES_KEY = 'with_audit_values'
WITH_SUBMITTER_TIMEZONE_KEY = 'with_submitter_timezone' WITH_SUBMITTER_TIMEZONE_KEY = 'with_submitter_timezone'
REQUIRE_SIGNING_REASON_KEY = 'require_signing_reason' REQUIRE_SIGNING_REASON_KEY = 'require_signing_reason'
REUSE_SIGNATURE_KEY = 'reuse_signature' REUSE_SIGNATURE_KEY = 'reuse_signature'
WITH_FIELD_LABELS_KEY = 'with_field_labels'
COMBINE_PDF_RESULT_KEY = 'combine_pdf_result_key' COMBINE_PDF_RESULT_KEY = 'combine_pdf_result_key'
DOCUMENT_FILENAME_FORMAT_KEY = 'document_filename_format' DOCUMENT_FILENAME_FORMAT_KEY = 'document_filename_format'
POLICY_LINKS_KEY = 'policy_links' POLICY_LINKS_KEY = 'policy_links'
@@ -59,6 +62,12 @@ class AccountConfig < ApplicationRecord
'body' => I18n.t(:submitter_invitation_email_sign_body) 'body' => I18n.t(:submitter_invitation_email_sign_body)
} }
}, },
SUBMITTER_INVITATION_REMINDER_EMAIL_KEY => lambda {
{
'subject' => I18n.t(:you_are_invited_to_sign_a_document),
'body' => I18n.t(:submitter_invitation_email_sign_body)
}
},
SUBMITTER_COMPLETED_EMAIL_KEY => lambda { SUBMITTER_COMPLETED_EMAIL_KEY => lambda {
{ {
'subject' => I18n.t(:template_name_has_been_completed_by_submitters), 'subject' => I18n.t(:template_name_has_been_completed_by_submitters),
+5 -2
View File
@@ -6,6 +6,7 @@
# #
# id :bigint not null, primary key # id :bigint not null, primary key
# completed_at :datetime not null # completed_at :datetime not null
# is_first :boolean
# sms_count :integer not null # sms_count :integer not null
# source :string not null # source :string not null
# verification_method :string # verification_method :string
@@ -18,8 +19,10 @@
# #
# Indexes # Indexes
# #
# index_completed_submitters_on_account_id (account_id) # index_completed_submitters_account_id_completed_at_is_first (account_id,completed_at) WHERE (is_first = true)
# index_completed_submitters_on_submitter_id (submitter_id) UNIQUE # index_completed_submitters_on_account_id_and_completed_at (account_id,completed_at)
# index_completed_submitters_on_submission_id (submission_id) UNIQUE WHERE (is_first = true)
# index_completed_submitters_on_submitter_id (submitter_id) UNIQUE
# #
class CompletedSubmitter < ApplicationRecord class CompletedSubmitter < ApplicationRecord
belongs_to :submitter belongs_to :submitter
+2
View File
@@ -63,6 +63,8 @@ class Submission < ApplicationRecord
has_one_attached :audit_trail has_one_attached :audit_trail
has_one_attached :combined_document has_one_attached :combined_document
has_one_attached :merged_document
has_one_attached :preview_merged_document
has_many_attached :preview_documents has_many_attached :preview_documents
has_many_attached :documents has_many_attached :documents
+16 -3
View File
@@ -10,17 +10,21 @@
# event_type :string not null # event_type :string 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
# submission_id :bigint not null # submission_id :bigint not null
# submitter_id :bigint # submitter_id :bigint
# #
# Indexes # Indexes
# #
# index_submission_events_on_created_at (created_at) # index_submission_events_on_account_id (account_id)
# index_submission_events_on_submission_id (submission_id) # index_submission_events_on_created_at (created_at)
# index_submission_events_on_submitter_id (submitter_id) # index_submission_events_on_submission_id (submission_id)
# index_submission_events_on_submitter_id (submitter_id)
# index_submissions_events_on_sms_event_types (account_id,created_at) WHERE ((event_type)::text = ANY ((ARRAY['send_sms'::character varying, 'send_2fa_sms'::character varying])::text[]))
# #
# Foreign Keys # Foreign Keys
# #
# fk_rails_... (account_id => accounts.id)
# fk_rails_... (submission_id => submissions.id) # fk_rails_... (submission_id => submissions.id)
# fk_rails_... (submitter_id => submitters.id) # fk_rails_... (submitter_id => submitters.id)
# #
@@ -35,6 +39,7 @@ class SubmissionEvent < ApplicationRecord
serialize :data, coder: JSON serialize :data, coder: JSON
before_validation :set_submission_id, on: :create before_validation :set_submission_id, on: :create
before_validation :set_account_id, on: :create
enum :event_type, { enum :event_type, {
send_email: 'send_email', send_email: 'send_email',
@@ -43,6 +48,7 @@ class SubmissionEvent < ApplicationRecord
send_reminder_email: 'send_reminder_email', send_reminder_email: 'send_reminder_email',
send_sms: 'send_sms', send_sms: 'send_sms',
send_2fa_sms: 'send_2fa_sms', send_2fa_sms: 'send_2fa_sms',
send_2fa_email: 'send_2fa_email',
open_email: 'open_email', open_email: 'open_email',
click_email: 'click_email', click_email: 'click_email',
click_sms: 'click_sms', click_sms: 'click_sms',
@@ -51,6 +57,9 @@ class SubmissionEvent < ApplicationRecord
start_form: 'start_form', start_form: 'start_form',
start_verification: 'start_verification', start_verification: 'start_verification',
complete_verification: 'complete_verification', complete_verification: 'complete_verification',
start_kba: 'start_kba',
complete_kba: 'complete_kba',
fail_kba: 'fail_kba',
view_form: 'view_form', view_form: 'view_form',
invite_party: 'invite_party', invite_party: 'invite_party',
complete_form: 'complete_form', complete_form: 'complete_form',
@@ -63,4 +72,8 @@ class SubmissionEvent < ApplicationRecord
def set_submission_id def set_submission_id
self.submission_id = submitter&.submission_id self.submission_id = submitter&.submission_id
end end
def set_account_id
self.account_id = submitter&.account_id
end
end end
+6 -2
View File
@@ -6,6 +6,9 @@
# #
# id :bigint not null, primary key # id :bigint not null, primary key
# archived_at :datetime # archived_at :datetime
# confirmation_sent_at :datetime
# confirmation_token :string
# confirmed_at :datetime
# consumed_timestep :integer # consumed_timestep :integer
# current_sign_in_at :datetime # current_sign_in_at :datetime
# current_sign_in_ip :string # current_sign_in_ip :string
@@ -24,8 +27,9 @@
# reset_password_token :string # reset_password_token :string
# role :string not null # role :string not null
# sign_in_count :integer default(0), not null # sign_in_count :integer default(0), not null
# unconfirmed_email :string
# unlock_token :string # unlock_token :string
# uuid :text not null # uuid :string 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 # account_id :bigint not null
@@ -50,7 +54,7 @@ class User < ApplicationRecord
EMAIL_REGEXP = /[^@;,<>\s]+@[^@;,<>\s]+/ EMAIL_REGEXP = /[^@;,<>\s]+@[^@;,<>\s]+/
FULL_EMAIL_REGEXP = FULL_EMAIL_REGEXP =
/\A[a-z0-9][\.']?(?:(?:[a-z0-9_-]+[\.\+'])*[a-z0-9_-]+)*@(?:[a-z0-9]+[\.-])*[a-z0-9]+\.[a-z]{2,}\z/i /\A[a-z0-9][.']?(?:(?:[a-z0-9_-]+[.+'])*[a-z0-9_-]+)*@(?:[a-z0-9]+[.-])*[a-z0-9]+\.[a-z]{2,}\z/i
has_one_attached :signature has_one_attached :signature
has_one_attached :initials has_one_attached :initials
+1 -1
View File
@@ -235,7 +235,7 @@
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>
<% if can?(:manage, :personalization_advanced) %> <% if !Docuseal.multitenant? || can?(:manage, :personalization_advanced) %>
<% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::WITH_FILE_LINKS_KEY) %> <% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::WITH_FILE_LINKS_KEY) %>
<% 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| %>
@@ -1,5 +1,10 @@
<p>Hello <%= @resource.email %>!</p> <p><%= @resource.first_name.present? ? t('hello_name', name: @resource.first_name) : t('hi_there') %>,</p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p> <p><%= t('you_requested_to_reset_your_password_use_the_link_below_to_continue') %>:</p>
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p> <p><%= link_to t('change_my_password'), edit_password_url(@resource, reset_password_token: @token) %></p>
<p>If you didn't request this, please ignore this email.</p> <p><%= t('your_password_wont_change_until_you_open_the_link_above_and_set_a_new_one') %></p>
<p>Your password won't change until you access the link above and create a new one.</p> <p><%= t('if_you_didnt_request_this_you_can_ignore_this_email') %></p>
<p>
<%= t('thanks') %>,<br>
<%= Docuseal.product_name %>
</p>
<% content_for(:remove_attribution, true) %>
+1 -1
View File
@@ -15,7 +15,7 @@
<%= hidden_field_tag :redir, params[:redir] %> <%= hidden_field_tag :redir, params[:redir] %>
<% end %> <% end %>
<submit-form data-on="change"> <submit-form data-on="change">
<%= select_tag :lang, options_for_select((I18n.available_locales - %i[en pt-PT de-DE fr-FR it-IT es-ES]).map { |code| [t("language_#{code}"), code] }, I18n.locale), class: 'select select-sm border-base-content/30 text-base' %> <%= select_tag :lang, options_for_select((I18n.available_locales - %i[en pt-PT de-DE fr-FR it-IT es-ES nl-NL]).map { |code| [t("language_#{code}"), code] }, I18n.locale), class: 'select select-sm border-base-content/30 text-base' %>
</submit-form> </submit-form>
<% end %> <% end %>
</div> </div>
+1
View File
@@ -0,0 +1 @@
<svg class="<%= local_assigns[:class] %>" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-brand-google-drive"><path stroke="none" d="M0 0h24v24H0z" fill="none" /><path d="M12 10l-6 10l-3 -5l6 -10z" /><path d="M9 15h12l-3 5h-12" /><path d="M15 15l-6 -10h6l6 10z" /></svg>

After

Width:  |  Height:  |  Size: 458 B

+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M4 5m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"></path>
<path d="M16 3l0 4"></path>
<path d="M8 3l0 4"></path>
<path d="M4 11l16 0"></path>
<path d="M8 15h2v2h-2z"></path>
</svg>

After

Width:  |  Height:  |  Size: 450 B

+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M9 11l3 3l8 -8"></path>
<path d="M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9"></path>
</svg>

After

Width:  |  Height:  |  Size: 346 B

+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M7 12l5 5l10 -10"></path>
<path d="M2 12l5 5m5 -5l5 -5"></path>
</svg>

After

Width:  |  Height:  |  Size: 303 B

+3
View File
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 3m0 1a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1zm6 -1v18m6 -18v18"></path>
</svg>

After

Width:  |  Height:  |  Size: 343 B

+6
View File
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 5m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z"></path>
<path d="M3 10l18 0"></path>
<path d="M7 15l.01 0"></path>
<path d="M11 15l2 0"></path>
</svg>

After

Width:  |  Height:  |  Size: 419 B

+8
View File
@@ -0,0 +1,8 @@
<svg class="<%= local_assigns[:class] %>" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10z" />
<path d="M7 20h10" /><path d="M9 16v4" />
<path d="M15 16v4" /></svg>
<path d="M9 16v4" />
<path d="M15 16v4" />
</svg>

After

Width:  |  Height:  |  Size: 497 B

+6
View File
@@ -0,0 +1,6 @@
<svg class="<%= local_assigns[:class] %>" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14z" />
<path d="M11 4h2" />
<path d="M12 17v.01" />
</svg>

After

Width:  |  Height:  |  Size: 423 B

+5
View File
@@ -0,0 +1,5 @@
<svg class="<%= local_assigns[:class] %>" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M5 4a1 1 0 0 1 1 -1h12a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-12a1 1 0 0 1 -1 -1v-16z" />
<path d="M11 17a1 1 0 1 0 2 0a1 1 0 0 0 -2 0" />
</svg>

After

Width:  |  Height:  |  Size: 427 B

+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z"></path>
<path d="M9 10m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path>
<path d="M15 8l2 0"></path>
<path d="M15 12l2 0"></path>
<path d="M7 16l10 0"></path>
</svg>

After

Width:  |  Height:  |  Size: 478 B

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 19v-10.5a3.5 3.5 0 0 1 7 0v10.5"></path>
<path d="M3 13h7"></path>
<path d="M14 19v-10.5a3.5 3.5 0 0 1 7 0v10.5"></path>
<path d="M14 13h7"></path>
</svg>

After

Width:  |  Height:  |  Size: 394 B

+6
View File
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M15 8h.01"></path>
<path d="M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z"></path>
<path d="M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5"></path>
<path d="M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3"></path>
</svg>

After

Width:  |  Height:  |  Size: 481 B

+4
View File
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 17.85h-18c0 -4.05 1.421 -4.05 3.79 -4.05c5.21 0 1.21 -4.59 1.21 -6.8a4 4 0 1 1 8 0c0 2.21 -4 6.8 1.21 6.8c2.369 0 3.79 0 3.79 4.05z"></path>
<path d="M5 21h14"></path>
</svg>

After

Width:  |  Height:  |  Size: 411 B

Loaded 100 of 211 files, more files were not shown because too many files have changed in this diff. Show more