From 905e0b22ed538cbb4de7b9ee578235f59db58a01 Mon Sep 17 00:00:00 2001
From: Joseph Benguira
Date: Thu, 21 Sep 2023 02:03:05 +0300
Subject: [PATCH 001/127] Added Elestio as a deployment option
Hello, I'm Joseph Benguira, Founder of Elest.io
I'm suggesting to add Elestio as a deployment option near the other one-click options in your list.
FYI I'm also trying to contact you through Linkedin to check if you are interested in a revenue sharing partnership (we will share with you part of profits generated on Elestio)
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 2eab1042..0c16c8d3 100644
--- a/README.md
+++ b/README.md
@@ -52,8 +52,8 @@ DocuSeal is an open source platform that provides secure and efficient digital d
| [
](https://heroku.com/deploy?template=https://github.com/docusealco/docuseal-heroku) | [
](https://railway.app/template/IGoDnc?referralCode=ruU7JR)|
|**DigitalOcean**|**Render**|
| [
](https://cloud.digitalocean.com/apps/new?repo=https://github.com/docusealco/docuseal-digitalocean/tree/master&refcode=421d50f53990) | [
](https://render.com/deploy?repo=https://github.com/docusealco/docuseal-render)
-|**Koyeb**| |
-| [
](https://app.koyeb.com/deploy?name=docuseal&type=docker&image=docker.io/docuseal/docuseal&env[PORT]=8000&env[DATABASE_URL]=CHANGE_ME&env[SECRET_KEY_BASE]=CHANGE_ME&ports=8000;http;/) | |
+|**Koyeb**|**Elestio**|
+| [
](https://app.koyeb.com/deploy?name=docuseal&type=docker&image=docker.io/docuseal/docuseal&env[PORT]=8000&env[DATABASE_URL]=CHANGE_ME&env[SECRET_KEY_BASE]=CHANGE_ME&ports=8000;http;/) | [
](https://dash.elest.io/deploy?soft=DocuSeal&id=339) |
#### Docker
From dc02964d9b81b2555da00d49fff5a23bb275696a Mon Sep 17 00:00:00 2001
From: Alex Turchyn
Date: Tue, 19 Sep 2023 19:33:34 +0300
Subject: [PATCH 002/127] ensure template account is set
---
app/controllers/templates_uploads_controller.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/controllers/templates_uploads_controller.rb b/app/controllers/templates_uploads_controller.rb
index fd57f577..1a111dee 100644
--- a/app/controllers/templates_uploads_controller.rb
+++ b/app/controllers/templates_uploads_controller.rb
@@ -4,6 +4,7 @@ class TemplatesUploadsController < ApplicationController
load_and_authorize_resource :template, parent: false
def create
+ @template.account = current_account
@template.author = current_user
@template.name = File.basename(params[:files].first.original_filename, '.*')
From ee350324e5def607f3818e20a8b78960afe2e52e Mon Sep 17 00:00:00 2001
From: Alex Turchyn
Date: Wed, 20 Sep 2023 00:13:14 +0300
Subject: [PATCH 003/127] add initials field
---
app/javascript/application.scss | 17 ++
app/javascript/submission_form/area.vue | 16 +-
app/javascript/submission_form/form.vue | 20 +-
app/javascript/submission_form/i18n.js | 63 +++++
.../submission_form/initials_step.vue | 245 ++++++++++++++++++
.../submission_form/signature_step.vue | 28 +-
app/javascript/template_builder/builder.vue | 11 +-
app/javascript/template_builder/field.vue | 33 ++-
.../template_builder/field_type.vue | 8 +-
app/javascript/template_builder/fields.vue | 2 +-
app/views/submissions/_value.html.erb | 2 +-
app/views/submissions/show.html.erb | 4 +-
lib/submissions/generate_audit_trail.rb | 4 +-
.../generate_result_attachments.rb | 2 +-
14 files changed, 426 insertions(+), 29 deletions(-)
create mode 100644 app/javascript/submission_form/initials_step.vue
diff --git a/app/javascript/application.scss b/app/javascript/application.scss
index 4cb86b4f..e731dfc5 100644
--- a/app/javascript/application.scss
+++ b/app/javascript/application.scss
@@ -74,3 +74,20 @@ button[disabled] .enabled {
.base-select {
@apply select base-input w-full font-normal;
}
+
+.tooltip-bottom-end:before {
+ transform: translateX(-95%);
+ top: var(--tooltip-offset);
+ left: 100%;
+ right: auto;
+ bottom: auto;
+}
+
+.tooltip-bottom-end:after {
+ transform: translateX(-25%);
+ border-color: transparent transparent var(--tooltip-color) transparent;
+ top: var(--tooltip-tail-offset);
+ left: 50%;
+ right: auto;
+ bottom: auto;
+}
diff --git a/app/javascript/submission_form/area.vue b/app/javascript/submission_form/area.vue
index 7f057bab..96eef249 100644
--- a/app/javascript/submission_form/area.vue
+++ b/app/javascript/submission_form/area.vue
@@ -47,6 +47,11 @@
class="object-contain mx-auto"
:src="signature.url"
>
+
diff --git a/app/javascript/submission_form/signature_step.vue b/app/javascript/submission_form/signature_step.vue
index ff2269c5..9806a417 100644
--- a/app/javascript/submission_form/signature_step.vue
+++ b/app/javascript/submission_form/signature_step.vue
@@ -3,7 +3,7 @@
+ >{{ field.name || t('signature') }}
- Redraw
+ {{ t('redraw') }}
diff --git a/app/views/shared/_navbar.html.erb b/app/views/shared/_navbar.html.erb
index 889c9bbc..74db7f2d 100644
--- a/app/views/shared/_navbar.html.erb
+++ b/app/views/shared/_navbar.html.erb
@@ -8,7 +8,12 @@
<% if signed_in? %>
<% if Docuseal.demo? %>
- <%= render 'shared/github_button' %>
+
+ Sign Up
+
+
+ <%= render 'shared/github_button' %>
+
<% else %>
<% if can?(:manage, EncryptedConfig) && !can?(:manage, :tenants) %>
diff --git a/lib/accounts.rb b/lib/accounts.rb
index 504fb005..1a73c459 100644
--- a/lib/accounts.rb
+++ b/lib/accounts.rb
@@ -8,6 +8,7 @@ module Accounts
new_user = account.users.first.dup
+ new_user.uuid = SecureRandom.uuid
new_user.account = new_account
new_user.encrypted_password = SecureRandom.hex
new_user.email = "#{SecureRandom.hex}@docuseal.co"
@@ -18,12 +19,14 @@ module Accounts
new_template.account = new_account
new_template.slug = SecureRandom.base58(14)
+ new_template.deleted_at = nil
new_template.save!
Templates::CloneAttachments.call(template: new_template, original_template: template)
end
new_user.save!(validate: false)
+ new_account.templates.update_all(folder_id: new_account.default_template_folder.id)
new_account
end
From c621166b45c393c4a492189bd71de1f9b5b2f65d Mon Sep 17 00:00:00 2001
From: DocuSeal
Date: Sat, 14 Oct 2023 22:31:32 +0300
Subject: [PATCH 061/127] use full name form company name if missing
---
app/controllers/registrations_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index bca21d22..ca07f304 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -43,7 +43,7 @@ class RegistrationsController < Devise::RegistrationsController
self.resource = account.users.new(user_params)
- account.name ||= "#{resource.full_name}'s Company" if params[:action] == 'create'
+ account.name ||= resource.full_name if params[:action] == 'create'
end
def user_params
From 60b32fec9464b685e9196b5d2ea0d5641fb6b69b Mon Sep 17 00:00:00 2001
From: DocuSeal
Date: Sun, 15 Oct 2023 00:58:03 +0300
Subject: [PATCH 062/127] adjust sign up header buttons
---
app/views/shared/_navbar.html.erb | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/app/views/shared/_navbar.html.erb b/app/views/shared/_navbar.html.erb
index 74db7f2d..589ad6ac 100644
--- a/app/views/shared/_navbar.html.erb
+++ b/app/views/shared/_navbar.html.erb
@@ -63,18 +63,19 @@
<% else %>
-
- <%= link_to new_user_session_path, class: 'font-medium text-lg' do %>
-
- <%= svg_icon('login', class: 'w-6 h-6') %>
- Sign in
-
+
+ <% if request.path != new_user_session_path %>
+ <%= link_to new_user_session_path, class: 'font-medium text-lg' do %>
+
+ <%= svg_icon('login', class: 'w-6 h-6') %>
+ Sign in
+
+ <% end %>
<% end %>
- <% if Docuseal.multitenant? %>
- <%= link_to registration_path, class: 'font-medium text-lg hidden md:inline' do %>
+ <% if Docuseal.multitenant? && !request.path.in?([registration_path, new_registration_path])%>
+ <%= link_to registration_path, class: 'btn btn-neutral btn-sm btn-outline' do %>
- <%= svg_icon('user_plus', class: 'w-6 h-6') %>
- Try for Free
+ Create free Account
<% end %>
<% end %>
From 6dc21e66e1cd0d4eed732e3a92044c5535eee88f Mon Sep 17 00:00:00 2001
From: DocuSeal
Date: Sun, 15 Oct 2023 21:41:47 +0300
Subject: [PATCH 063/127] return to required fields
---
app/javascript/submission_form/form.vue | 45 ++++++++++++++++++++-----
app/javascript/submission_form/i18n.js | 9 +++++
2 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/app/javascript/submission_form/form.vue b/app/javascript/submission_form/form.vue
index f231e3d4..d84a9ea5 100644
--- a/app/javascript/submission_form/form.vue
+++ b/app/javascript/submission_form/form.vue
@@ -297,6 +297,7 @@
+
+ {{ t('please_fill_all_required_fields') }}
+
@@ -457,9 +464,11 @@ export default {
return {
isCompleted: false,
isFormVisible: true,
+ showFillAllRequiredFields: false,
currentStep: 0,
isSubmitting: false,
submittedValues: {},
+ isSecondWalkthrough: false,
recalculateButtonDisabledKey: ''
}
},
@@ -514,10 +523,20 @@ export default {
this.submittedValues = JSON.parse(JSON.stringify(this.values))
if (this.goToLast) {
- this.currentStep = Math.min(
- this.stepFields.indexOf([...this.stepFields].reverse().find((fields) => fields.some((f) => !!this.values[f.uuid]))) + 1,
- this.stepFields.length - 1
- )
+ const requiredEmptyStepIndex = this.stepFields.indexOf(this.stepFields.find((fields) => fields.some((f) => f.required && !this.values[f.uuid])))
+ const lastFilledStepIndex = this.stepFields.indexOf([...this.stepFields].reverse().find((fields) => fields.some((f) => !!this.values[f.uuid]))) + 1
+
+ const indexesList = [this.stepFields.length - 1]
+
+ if (requiredEmptyStepIndex !== -1) {
+ indexesList.push(requiredEmptyStepIndex)
+ }
+
+ if (lastFilledStepIndex !== -1) {
+ indexesList.push(lastFilledStepIndex)
+ }
+
+ this.currentStep = Math.min(...indexesList)
}
if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
@@ -608,6 +627,7 @@ export default {
},
goToStep (step, scrollToArea = false, clickUpload = false) {
this.currentStep = this.stepFields.indexOf(step)
+ this.showFillAllRequiredFields = false
this.$nextTick(() => {
this.recalculateButtonDisabledKey = Math.random()
@@ -642,12 +662,13 @@ export default {
stepPromise().then(async () => {
const emptyRequiredField = this.stepFields.find((fields, index) => {
- return index < this.currentStep && fields[0].required && (fields[0].type === 'phone' || !this.allowToSkip) && !this.submittedValues[fields[0].uuid]
+ return index < this.currentStep && fields[0].required && (fields[0].type === 'phone' || !this.allowToSkip || !this.isSecondWalkthrough) && !this.submittedValues[fields[0].uuid]
})
const formData = new FormData(this.$refs.form)
+ const isLastStep = this.currentStep === this.stepFields.length - 1
- if (this.currentStep === this.stepFields.length - 1 && !emptyRequiredField) {
+ if (isLastStep && !emptyRequiredField) {
formData.append('completed', 'true')
}
@@ -662,10 +683,18 @@ export default {
this.submittedValues[this.currentField.uuid] = this.values[this.currentField.uuid]
- const nextStep = emptyRequiredField || this.stepFields[this.currentStep + 1]
+ if (isLastStep) {
+ this.isSecondWalkthrough = true
+ }
+
+ const nextStep = (isLastStep && emptyRequiredField) || this.stepFields[this.currentStep + 1]
if (nextStep) {
this.goToStep(nextStep, true)
+
+ if (emptyRequiredField === nextStep) {
+ this.showFillAllRequiredFields = true
+ }
} else {
this.isCompleted = true
}
diff --git a/app/javascript/submission_form/i18n.js b/app/javascript/submission_form/i18n.js
index 5b57ed7b..3db20ffd 100644
--- a/app/javascript/submission_form/i18n.js
+++ b/app/javascript/submission_form/i18n.js
@@ -29,6 +29,7 @@ const en = {
sending: 'Sending...',
resend_code: 'Re-send code',
verification_code_has_been_resent: 'Verification code has been re-sent via SMS',
+ please_fill_all_required_fields: 'Please fill all required fields',
email_has_been_sent: 'Email has been sent'
}
@@ -63,6 +64,7 @@ const es = {
sending: 'Enviando...',
resend_code: 'Reenviar código',
verification_code_has_been_resent: 'El código de verificación ha sido reenviado por SMS',
+ please_fill_all_required_fields: 'Por favor, complete todos los campos obligatorios',
email_has_been_sent: 'El correo electrónico ha sido enviado'
}
@@ -97,6 +99,7 @@ const it = {
sending: 'Invio in corso...',
resend_code: 'Rinvia codice',
verification_code_has_been_resent: 'Il codice di verifica è stato rinviato tramite SMS',
+ please_fill_all_required_fields: 'Si prega di compilare tutti i campi obbligatori',
email_has_been_sent: "L'email è stata inviata"
}
@@ -131,6 +134,7 @@ const de = {
sending: 'Senden...',
resend_code: 'Code erneut senden',
verification_code_has_been_resent: 'Die Verifizierungscode wurde erneut per SMS gesendet',
+ please_fill_all_required_fields: 'Bitte füllen Sie alle erforderlichen Felder aus',
email_has_been_sent: 'Die E-Mail wurde gesendet'
}
@@ -165,6 +169,7 @@ const fr = {
sending: 'Envoi en cours...',
resend_code: 'Renvoyer le code',
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',
email_has_been_sent: "L'email a été envoyé"
}
@@ -199,6 +204,7 @@ const pl = {
sending: 'Wysyłanie...',
resend_code: 'Ponownie wyślij kod',
verification_code_has_been_resent: 'Kod weryfikacyjny został ponownie wysłany',
+ please_fill_all_required_fields: 'Proszę wypełnić wszystkie wymagane pola',
email_has_been_sent: 'E-mail został wysłany'
}
@@ -233,6 +239,7 @@ const uk = {
sending: 'Надсилаю...',
resend_code: 'Повторно відправити код',
verification_code_has_been_resent: 'Код підтвердження був повторно надісланий',
+ please_fill_all_required_fields: "Будь ласка, заповніть всі обов'язкові поля",
email_has_been_sent: 'Електронний лист був відправлений'
}
@@ -267,6 +274,7 @@ const cs = {
sending: 'Odesílání...',
resend_code: 'Znovu odeslat kód',
verification_code_has_been_resent: 'Ověřovací kód byl znovu odeslán',
+ please_fill_all_required_fields: 'Prosím vyplňte všechny povinné položky',
email_has_been_sent: 'E-mail byl odeslán'
}
@@ -301,6 +309,7 @@ const pt = {
sending: 'Enviando...',
resend_code: 'Reenviar código',
verification_code_has_been_resent: 'O código de verificação foi reenviado via SMS',
+ please_fill_all_required_fields: 'Por favor, preencha todos os campos obrigatórios',
email_has_been_sent: 'Email enviado'
}
From 698031cfc0aa673077ce8a186dbf9582d9849951 Mon Sep 17 00:00:00 2001
From: DocuSeal
Date: Sun, 15 Oct 2023 22:59:32 +0300
Subject: [PATCH 064/127] add current date button
---
app/javascript/submission_form/form.vue | 36 ++++++++++++++++---------
app/javascript/submission_form/i18n.js | 18 +++++++++++++
2 files changed, 42 insertions(+), 12 deletions(-)
diff --git a/app/javascript/submission_form/form.vue b/app/javascript/submission_form/form.vue
index d84a9ea5..0671bb2d 100644
--- a/app/javascript/submission_form/form.vue
+++ b/app/javascript/submission_form/form.vue
@@ -86,17 +86,21 @@
-
-
+
+
+
+
Date: Mon, 16 Oct 2023 00:41:14 +0300
Subject: [PATCH 065/127] add ability to toggle textarea
---
app/javascript/form.scss | 4 +
app/javascript/submission_form/area.vue | 7 +-
app/javascript/submission_form/form.vue | 32 ++---
app/javascript/submission_form/i18n.js | 9 ++
app/javascript/submission_form/text_step.vue | 111 ++++++++++++++++++
app/views/shared/_search_input.html.erb | 8 +-
app/views/submissions/_value.html.erb | 4 +-
.../generate_result_attachments.rb | 4 +-
8 files changed, 142 insertions(+), 37 deletions(-)
create mode 100644 app/javascript/submission_form/text_step.vue
diff --git a/app/javascript/form.scss b/app/javascript/form.scss
index a9bac997..c6686829 100644
--- a/app/javascript/form.scss
+++ b/app/javascript/form.scss
@@ -47,6 +47,10 @@ select:required:invalid {
@apply border-base-content/20;
}
+.base-textarea {
+ @apply textarea textarea-bordered bg-white rounded-3xl;
+}
+
.btn {
@apply no-animation;
}
diff --git a/app/javascript/submission_form/area.vue b/app/javascript/submission_form/area.vue
index 96eef249..f0a56a43 100644
--- a/app/javascript/submission_form/area.vue
+++ b/app/javascript/submission_form/area.vue
@@ -110,9 +110,10 @@
{{ formattedDate }}
-
- {{ modelValue }}
-
+ {{ modelValue }}
diff --git a/app/javascript/submission_form/form.vue b/app/javascript/submission_form/form.vue
index 0671bb2d..b6255055 100644
--- a/app/javascript/submission_form/form.vue
+++ b/app/javascript/submission_form/form.vue
@@ -58,32 +58,12 @@
>
-
-
-
-
-
@@ -363,6 +343,7 @@ import InitialsStep from './initials_step'
import AttachmentStep from './attachment_step'
import MultiSelectStep from './multi_select_step'
import PhoneStep from './phone_step'
+import TextStep from './text_step'
import FormCompleted from './completed'
import { IconInnerShadowTop, IconArrowsDiagonal, IconArrowsDiagonalMinimize2, IconCalendarCheck } from '@tabler/icons-vue'
import { t } from './i18n'
@@ -378,6 +359,7 @@ export default {
MultiSelectStep,
IconInnerShadowTop,
IconArrowsDiagonal,
+ TextStep,
PhoneStep,
IconCalendarCheck,
IconArrowsDiagonalMinimize2,
diff --git a/app/javascript/submission_form/i18n.js b/app/javascript/submission_form/i18n.js
index fec800ab..05e7339d 100644
--- a/app/javascript/submission_form/i18n.js
+++ b/app/javascript/submission_form/i18n.js
@@ -31,6 +31,7 @@ const en = {
verification_code_has_been_resent: 'Verification code has been re-sent via SMS',
please_fill_all_required_fields: 'Please fill all required fields',
set_today: 'Set Today',
+ toggle_multiline_text: 'Toggle Multiline Text',
date: 'Date',
email_has_been_sent: 'Email has been sent'
}
@@ -69,6 +70,7 @@ const es = {
please_fill_all_required_fields: 'Por favor, complete todos los campos obligatorios',
set_today: 'Establecer Hoy',
date: 'Fecha',
+ toggle_multiline_text: 'Alternar Texto Multilínea',
email_has_been_sent: 'El correo electrónico ha sido enviado'
}
@@ -106,6 +108,7 @@ const it = {
please_fill_all_required_fields: 'Si prega di compilare tutti i campi obbligatori',
set_today: 'Imposta Oggi',
date: 'Data',
+ toggle_multiline_text: 'Attiva Testo Multilinea',
email_has_been_sent: "L'email è stata inviata"
}
@@ -143,6 +146,7 @@ const de = {
please_fill_all_required_fields: 'Bitte füllen Sie alle erforderlichen Felder aus',
set_today: 'Heute einstellen',
date: 'Datum',
+ toggle_multiline_text: 'Mehrzeiligen Text umschalten',
email_has_been_sent: 'Die E-Mail wurde gesendet'
}
@@ -180,6 +184,7 @@ const fr = {
please_fill_all_required_fields: 'Veuillez remplir tous les champs obligatoires',
set_today: "Définir Aujourd'hui",
date: 'Date',
+ toggle_multiline_text: 'Basculer le Texte Multiligne',
email_has_been_sent: "L'email a été envoyé"
}
@@ -217,6 +222,7 @@ const pl = {
please_fill_all_required_fields: 'Proszę wypełnić wszystkie wymagane pola',
set_today: 'Ustaw Dziś',
date: 'Data',
+ toggle_multiline_text: 'Przełącz Tekst Wielolinijkowy',
email_has_been_sent: 'E-mail został wysłany'
}
@@ -254,6 +260,7 @@ const uk = {
please_fill_all_required_fields: "Будь ласка, заповніть всі обов'язкові поля",
set_today: 'Задати Сьогодні',
date: 'Дата',
+ toggle_multiline_text: 'Перемкнути Багаторядковий Текст',
email_has_been_sent: 'Електронний лист був відправлений'
}
@@ -291,6 +298,7 @@ const cs = {
please_fill_all_required_fields: 'Prosím vyplňte všechny povinné položky',
set_today: 'Nastavit Dnes',
date: 'Datum',
+ toggle_multiline_text: 'Přepnout Víceřádkový Text',
email_has_been_sent: 'E-mail byl odeslán'
}
@@ -328,6 +336,7 @@ const pt = {
please_fill_all_required_fields: 'Por favor, preencha todos os campos obrigatórios',
set_today: 'Definir Hoje',
date: 'Data',
+ toggle_multiline_text: 'Alternar Texto Multilinha',
email_has_been_sent: 'Email enviado'
}
diff --git a/app/javascript/submission_form/text_step.vue b/app/javascript/submission_form/text_step.vue
new file mode 100644
index 00000000..19c54a69
--- /dev/null
+++ b/app/javascript/submission_form/text_step.vue
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
diff --git a/app/views/shared/_search_input.html.erb b/app/views/shared/_search_input.html.erb
index 1cb8bbc8..b9ae8ce0 100644
--- a/app/views/shared/_search_input.html.erb
+++ b/app/views/shared/_search_input.html.erb
@@ -1,11 +1,11 @@
<% else %>
-
- <%= Array.wrap(value).join(', ') %>
-
+
<%= Array.wrap(value).join(', ') %>
<% end %>
diff --git a/lib/submissions/generate_result_attachments.rb b/lib/submissions/generate_result_attachments.rb
index cbf2b2f1..0f5a6de0 100644
--- a/lib/submissions/generate_result_attachments.rb
+++ b/lib/submissions/generate_result_attachments.rb
@@ -23,7 +23,6 @@ module Submissions
# rubocop:disable Metrics
def call(submitter)
- layouter = HexaPDF::Layout::TextLayouter.new(valign: :center)
cell_layouter = HexaPDF::Layout::TextLayouter.new(valign: :center, align: :center)
template = submitter.submission.template
@@ -38,7 +37,6 @@ module Submissions
field.fetch('areas', []).each do |area|
pdf = pdfs_index[area['attachment_uuid']]
- pdf.fonts.add(FONT_NAME)
page = pdf.pages[area['page']]
page.rotate(0, flatten: true) if page[:Rotate] != 0
@@ -50,6 +48,8 @@ module Submissions
height = page.box.height
font_size = ((page.box.width / A4_SIZE[0].to_f) * FONT_SIZE).to_i
+ layouter = HexaPDF::Layout::TextLayouter.new(valign: :center, font: pdf.fonts.add(FONT_NAME), font_size:)
+
value = submitter.values[field['uuid']]
next if Array.wrap(value).compact_blank.blank?
From d5b8640a0e8ab9bf265cb31c25313f804d9fc901 Mon Sep 17 00:00:00 2001
From: DocuSeal
Date: Mon, 16 Oct 2023 00:51:08 +0300
Subject: [PATCH 066/127] force redraw form steps
---
app/javascript/submission_form/form.vue | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/app/javascript/submission_form/form.vue b/app/javascript/submission_form/form.vue
index b6255055..d941dd59 100644
--- a/app/javascript/submission_form/form.vue
+++ b/app/javascript/submission_form/form.vue
@@ -166,6 +166,7 @@
@@ -227,6 +228,7 @@
Date: Mon, 16 Oct 2023 01:28:04 +0300
Subject: [PATCH 067/127] fix set today date timezone
---
app/javascript/submission_form/form.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/javascript/submission_form/form.vue b/app/javascript/submission_form/form.vue
index d941dd59..bfab5e91 100644
--- a/app/javascript/submission_form/form.vue
+++ b/app/javascript/submission_form/form.vue
@@ -639,7 +639,7 @@ export default {
setCurrentDate () {
const inputEl = document.getElementById(this.currentField.uuid)
- inputEl.valueAsDate = new Date()
+ inputEl.valueAsDate = new Date(new Date().getTime() - new Date().getTimezoneOffset() * 60000)
inputEl.dispatchEvent(new Event('input', { bubbles: true }))
},
From b6f7a7dd15c19d23caa6b8aabfda83207e970161 Mon Sep 17 00:00:00 2001
From: DocuSeal
Date: Mon, 16 Oct 2023 01:36:26 +0300
Subject: [PATCH 068/127] fix initials step
---
.../submission_form/initials_step.vue | 22 +++++++++++--------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/app/javascript/submission_form/initials_step.vue b/app/javascript/submission_form/initials_step.vue
index a0d9e124..36fb6ffd 100644
--- a/app/javascript/submission_form/initials_step.vue
+++ b/app/javascript/submission_form/initials_step.vue
@@ -9,33 +9,37 @@
class="tooltip"
:data-tip="t('draw_initials')"
>
-
+
-
-
-
+
Date: Mon, 16 Oct 2023 02:04:52 +0300
Subject: [PATCH 069/127] preserve textarea in the form
---
app/javascript/submission_form/text_step.vue | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/app/javascript/submission_form/text_step.vue b/app/javascript/submission_form/text_step.vue
index 19c54a69..fac99884 100644
--- a/app/javascript/submission_form/text_step.vue
+++ b/app/javascript/submission_form/text_step.vue
@@ -89,6 +89,15 @@ export default {
}
}
},
+ mounted () {
+ this.isTextArea = this.modelValue?.includes('\n')
+
+ if (this.isTextArea) {
+ this.$nextTick(() => {
+ this.resizeTextarea()
+ })
+ }
+ },
methods: {
resizeTextarea () {
const textarea = this.$refs.textarea
From 10cd3aa72a02edfde4c72d59514b0e9395f2e594 Mon Sep 17 00:00:00 2001
From: DocuSeal
Date: Mon, 16 Oct 2023 20:19:28 +0300
Subject: [PATCH 070/127] smtp ssl verify mode none
---
lib/action_mailer_configs_interceptor.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/action_mailer_configs_interceptor.rb b/lib/action_mailer_configs_interceptor.rb
index 4f948302..9902ca3c 100644
--- a/lib/action_mailer_configs_interceptor.rb
+++ b/lib/action_mailer_configs_interceptor.rb
@@ -40,6 +40,7 @@ module ActionMailerConfigsInterceptor
address: value['host'],
port: value['port'],
domain: value['domain'],
+ openssl_verify_mode: OpenSSL::SSL::VERIFY_NONE,
authentication: value.fetch('authentication', 'plain'),
enable_starttls_auto: true,
ssl: value['security'] == 'ssl',
From 9ddbcae153b1cb5306d2e2ee5576bc8e50be9ec6 Mon Sep 17 00:00:00 2001
From: DocuSeal
Date: Mon, 16 Oct 2023 20:19:39 +0300
Subject: [PATCH 071/127] fix plans link
---
app/views/shared/_navbar.html.erb | 2 +-
app/views/shared/_settings_nav.html.erb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/shared/_navbar.html.erb b/app/views/shared/_navbar.html.erb
index 589ad6ac..a1a63b8a 100644
--- a/app/views/shared/_navbar.html.erb
+++ b/app/views/shared/_navbar.html.erb
@@ -72,7 +72,7 @@
<% end %>
<% end %>
- <% if Docuseal.multitenant? && !request.path.in?([registration_path, new_registration_path])%>
+ <% if Docuseal.multitenant? && !request.path.in?([registration_path, new_registration_path]) %>
<%= link_to registration_path, class: 'btn btn-neutral btn-sm btn-outline' do %>
Create free Account
diff --git a/app/views/shared/_settings_nav.html.erb b/app/views/shared/_settings_nav.html.erb
index 51435a9d..e4dc2697 100644
--- a/app/views/shared/_settings_nav.html.erb
+++ b/app/views/shared/_settings_nav.html.erb
@@ -43,7 +43,7 @@
<% end %>
<% if !Docuseal.demo? && can?(:manage, EncryptedConfig) %>
- <%= link_to Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/plans") : console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/on_premise"), class: 'text-base hover:bg-base-300', data: { prefetch: false } do %>
+ <%= link_to Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/plans") : "#{Docuseal::CONSOLE_URL}/on_premise", class: 'text-base hover:bg-base-300', data: { prefetch: false } do %>
Plans
<% end %>
From aee55165c56a689c34a7990c82004c0b062ec680 Mon Sep 17 00:00:00 2001
From: DocuSeal
Date: Mon, 16 Oct 2023 21:14:20 +0300
Subject: [PATCH 072/127] use start page
---
app/javascript/submission_form/completed.vue | 2 +-
app/views/send_submission_email/success.html.erb | 2 +-
app/views/shared/_attribution.html.erb | 2 +-
app/views/shared/_email_attribution.html.erb | 2 +-
app/views/shared/_powered_by.html.erb | 2 +-
app/views/start_form/completed.html.erb | 2 +-
app/views/start_form/show.html.erb | 2 +-
app/views/submit_form/archived.html.erb | 2 +-
app/views/submit_form/completed.html.erb | 2 +-
app/views/submit_form/show.html.erb | 2 +-
10 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/app/javascript/submission_form/completed.vue b/app/javascript/submission_form/completed.vue
index e7a3e1e4..491d6da2 100644
--- a/app/javascript/submission_form/completed.vue
+++ b/app/javascript/submission_form/completed.vue
@@ -78,7 +78,7 @@
>
{{ t('signed_with') }}
DocuSeal - {{ t('open_source_documents_software') }}
diff --git a/app/views/send_submission_email/success.html.erb b/app/views/send_submission_email/success.html.erb
index ac5c10b1..7fc8318a 100644
--- a/app/views/send_submission_email/success.html.erb
+++ b/app/views/send_submission_email/success.html.erb
@@ -10,4 +10,4 @@
-<%= render 'shared/attribution' %>
+<%= render 'shared/attribution', link_path: '/start' %>
diff --git a/app/views/shared/_attribution.html.erb b/app/views/shared/_attribution.html.erb
index 4679b14f..bc464bba 100644
--- a/app/views/shared/_attribution.html.erb
+++ b/app/views/shared/_attribution.html.erb
@@ -1 +1 @@
-<%= render 'shared/powered_by', with_counter: local_assigns[:with_counter] %>
+<%= render 'shared/powered_by', with_counter: local_assigns[:with_counter], link_path: local_assigns[:link_path] %>
diff --git a/app/views/shared/_email_attribution.html.erb b/app/views/shared/_email_attribution.html.erb
index 6a253d1f..1d71d8a5 100644
--- a/app/views/shared/_email_attribution.html.erb
+++ b/app/views/shared/_email_attribution.html.erb
@@ -2,5 +2,5 @@
---
- Sent using <%= Docuseal.product_name %> free document signing.
+ Sent using <%= Docuseal.product_name %> free document signing.
diff --git a/app/views/shared/_powered_by.html.erb b/app/views/shared/_powered_by.html.erb
index b9f1c77c..3e4bc78e 100644
--- a/app/views/shared/_powered_by.html.erb
+++ b/app/views/shared/_powered_by.html.erb
@@ -9,5 +9,5 @@
<% else %>
Powered by
<% end %>
- <%= Docuseal.product_name %> - open source documents software
+ <%= Docuseal.product_name %> - open source documents software
diff --git a/app/views/start_form/completed.html.erb b/app/views/start_form/completed.html.erb
index ce49da40..3ebc7daa 100644
--- a/app/views/start_form/completed.html.erb
+++ b/app/views/start_form/completed.html.erb
@@ -26,4 +26,4 @@
<% end %>
-<%= render 'shared/attribution' %>
+<%= render 'shared/attribution', link_path: '/start' %>
diff --git a/app/views/start_form/show.html.erb b/app/views/start_form/show.html.erb
index 3e6c8b17..dd69cd35 100644
--- a/app/views/start_form/show.html.erb
+++ b/app/views/start_form/show.html.erb
@@ -36,4 +36,4 @@
<% end %>
-<%= render 'shared/attribution' %>
+<%= render 'shared/attribution', link_path: '/start' %>
diff --git a/app/views/submit_form/archived.html.erb b/app/views/submit_form/archived.html.erb
index 56411a4d..a4e6e821 100644
--- a/app/views/submit_form/archived.html.erb
+++ b/app/views/submit_form/archived.html.erb
@@ -18,4 +18,4 @@
-<%= render 'shared/attribution' %>
+<%= render 'shared/attribution', link_path: '/start' %>
diff --git a/app/views/submit_form/completed.html.erb b/app/views/submit_form/completed.html.erb
index 20667a7b..c85cdae3 100644
--- a/app/views/submit_form/completed.html.erb
+++ b/app/views/submit_form/completed.html.erb
@@ -34,4 +34,4 @@
-<%= render 'shared/attribution' %>
+<%= render 'shared/attribution', link_path: '/start' %>
diff --git a/app/views/submit_form/show.html.erb b/app/views/submit_form/show.html.erb
index ab659e2d..88316310 100644
--- a/app/views/submit_form/show.html.erb
+++ b/app/views/submit_form/show.html.erb
@@ -27,7 +27,7 @@
<% end %>
<% end %>
- <%= render 'shared/attribution' %>
+ <%= render 'shared/attribution', link_path: '/start' %>
From 9e87a0373feb617f485e952a16a87899ef5473fc Mon Sep 17 00:00:00 2001
From: DocuSeal
Date: Wed, 18 Oct 2023 02:14:44 +0300
Subject: [PATCH 073/127] add application key to submitters
---
app/controllers/api/submissions_controller.rb | 2 +-
app/controllers/api/submitters_controller.rb | 21 +++++++++++++
app/models/submitter.rb | 31 ++++++++++---------
config/routes.rb | 2 +-
...213639_add_application_id_to_submitters.rb | 7 +++++
db/schema.rb | 3 +-
lib/submissions/create_from_submitters.rb | 1 +
lib/submitters/serialize_for_api.rb | 2 +-
8 files changed, 50 insertions(+), 19 deletions(-)
create mode 100644 db/migrate/20231017213639_add_application_id_to_submitters.rb
diff --git a/app/controllers/api/submissions_controller.rb b/app/controllers/api/submissions_controller.rb
index 9d9cfef8..3f69d705 100644
--- a/app/controllers/api/submissions_controller.rb
+++ b/app/controllers/api/submissions_controller.rb
@@ -106,7 +106,7 @@ module Api
def submissions_params
params.permit(submission: [{
- submitters: [[:uuid, :name, :email, :role, :completed, :phone,
+ submitters: [[:uuid, :name, :email, :role, :completed, :phone, :application_key,
{ values: {}, readonly_fields: [],
fields: [%i[name default_value readonly validation_pattern invalid_message]] }]]
}])
diff --git a/app/controllers/api/submitters_controller.rb b/app/controllers/api/submitters_controller.rb
index 03a21fdd..a0abb9c8 100644
--- a/app/controllers/api/submitters_controller.rb
+++ b/app/controllers/api/submitters_controller.rb
@@ -4,6 +4,27 @@ module Api
class SubmittersController < ApiBaseController
load_and_authorize_resource :submitter
+ def index
+ submitters = Submitters.search(@submitters, params[:q])
+
+ submitters = submitters.where(application_key: params[:application_key]) if params[:application_key].present?
+ submitters = submitters.where(submission_id: params[:submission_id]) if params[:submission_id].present?
+
+ submitters = paginate(
+ submitters.preload(:template, :submission, :submission_events,
+ documents_attachments: :blob, attachments_attachments: :blob)
+ )
+
+ render json: {
+ data: submitters.map { |s| Submitters::SerializeForApi.call(s, with_template: true, with_events: true) },
+ pagination: {
+ count: submitters.size,
+ next: submitters.last&.id,
+ prev: submitters.first&.id
+ }
+ }
+ end
+
def show
Submissions::EnsureResultGenerated.call(@submitter) if @submitter.completed_at?
diff --git a/app/models/submitter.rb b/app/models/submitter.rb
index b5e55d0b..c6ba2f71 100644
--- a/app/models/submitter.rb
+++ b/app/models/submitter.rb
@@ -4,21 +4,22 @@
#
# Table name: submitters
#
-# id :bigint not null, primary key
-# completed_at :datetime
-# email :string
-# ip :string
-# name :string
-# opened_at :datetime
-# phone :string
-# sent_at :datetime
-# slug :string not null
-# ua :string
-# uuid :string not null
-# values :text not null
-# created_at :datetime not null
-# updated_at :datetime not null
-# submission_id :bigint not null
+# id :bigint not null, primary key
+# application_key :string
+# completed_at :datetime
+# email :string
+# ip :string
+# name :string
+# opened_at :datetime
+# phone :string
+# sent_at :datetime
+# slug :string not null
+# ua :string
+# uuid :string not null
+# values :text not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# submission_id :bigint not null
#
# Indexes
#
diff --git a/config/routes.rb b/config/routes.rb
index 96dd15f8..66ea84f3 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -35,7 +35,7 @@ Rails.application.routes.draw do
resources :template_folders_autocomplete, only: %i[index]
resources :submitter_email_clicks, only: %i[create]
resources :submitter_form_views, only: %i[create]
- resources :submitters, only: %i[show]
+ resources :submitters, only: %i[index show]
resources :submissions, only: %i[index show create destroy] do
collection do
resources :emails, only: %i[create], controller: 'submissions', as: :submissions_emails
diff --git a/db/migrate/20231017213639_add_application_id_to_submitters.rb b/db/migrate/20231017213639_add_application_id_to_submitters.rb
new file mode 100644
index 00000000..245c97ee
--- /dev/null
+++ b/db/migrate/20231017213639_add_application_id_to_submitters.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddApplicationIdToSubmitters < ActiveRecord::Migration[7.0]
+ def change
+ add_column :submitters, :application_key, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 88c04854..2b5ac2ee 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.0].define(version: 2023_10_07_052818) do
+ActiveRecord::Schema[7.0].define(version: 2023_10_17_213639) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -133,6 +133,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_07_052818) do
t.datetime "updated_at", null: false
t.string "name"
t.string "phone"
+ t.string "application_key"
t.index ["email"], name: "index_submitters_on_email"
t.index ["slug"], name: "index_submitters_on_slug", unique: true
t.index ["submission_id"], name: "index_submitters_on_submission_id"
diff --git a/lib/submissions/create_from_submitters.rb b/lib/submissions/create_from_submitters.rb
index 6f1770f3..1edbd631 100644
--- a/lib/submissions/create_from_submitters.rb
+++ b/lib/submissions/create_from_submitters.rb
@@ -92,6 +92,7 @@ module Submissions
email:,
phone: attrs[:phone].to_s.gsub(/[^0-9+]/, ''),
name: attrs[:name],
+ application_key: attrs[:application_key],
completed_at: attrs[:completed] ? Time.current : nil,
sent_at: mark_as_sent && email.present? && is_order_sent ? Time.current : nil,
values: attrs[:values] || {},
diff --git a/lib/submitters/serialize_for_api.rb b/lib/submitters/serialize_for_api.rb
index d8566854..8c486f43 100644
--- a/lib/submitters/serialize_for_api.rb
+++ b/lib/submitters/serialize_for_api.rb
@@ -18,7 +18,7 @@ module Submitters
serialize_params = {
include: {},
- only: %i[id slug uuid name email phone completed_at
+ only: %i[id slug uuid name email phone completed_at application_key
opened_at sent_at created_at updated_at]
}
From b6d350ebbd5286f7d06633a88f1bc3a866eec7bb Mon Sep 17 00:00:00 2001
From: Alex Turchyn
Date: Wed, 18 Oct 2023 22:56:28 +0300
Subject: [PATCH 074/127] fix no error messages when sign in with wrong
credentials
---
app/controllers/registrations_controller.rb | 6 +++---
app/controllers/sessions_controller.rb | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index ca07f304..d0b4a403 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -31,10 +31,10 @@ class RegistrationsController < Devise::RegistrationsController
redirect_to after_sign_up_path_for(current_user), allow_other_host: true
end
- def require_no_authentication
- super
+ def set_flash_message(key, kind, options = {})
+ return if key == :alert && kind == 'already_authenticated'
- flash.clear
+ super
end
def build_resource(_hash = {})
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 4cfa542e..96379fd9 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -32,9 +32,9 @@ class SessionsController < Devise::SessionsController
devise_parameter_sanitizer.permit(:sign_in, keys: [:otp_attempt])
end
- def require_no_authentication
- super
+ def set_flash_message(key, kind, options = {})
+ return if key == :alert && kind == 'already_authenticated'
- flash.clear
+ super
end
end
From 9da7463657395de4636fbba157a3845706a77f35 Mon Sep 17 00:00:00 2001
From: DocuSeal
Date: Thu, 19 Oct 2023 20:19:52 +0300
Subject: [PATCH 075/127] add submission status filters
---
app/controllers/templates_controller.rb | 5 ++++
app/models/submission.rb | 2 ++
app/views/icons/_clock.html.erb | 5 ++++
app/views/icons/_list.html.erb | 9 ++++++
app/views/shared/_search_input.html.erb | 7 +++--
app/views/templates/show.html.erb | 38 +++++++++++++++++++++++--
6 files changed, 61 insertions(+), 5 deletions(-)
create mode 100644 app/views/icons/_clock.html.erb
create mode 100644 app/views/icons/_list.html.erb
diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb
index 69d0781a..e1be3c3b 100644
--- a/app/controllers/templates_controller.rb
+++ b/app/controllers/templates_controller.rb
@@ -10,6 +10,11 @@ class TemplatesController < ApplicationController
submissions = submissions.active if @template.deleted_at.blank?
submissions = Submissions.search(submissions, params[:q])
+ @base_submissions = submissions
+
+ submissions = submissions.pending if params[:status] == 'pending'
+ submissions = submissions.completed if params[:status] == 'completed'
+
@pagy, @submissions = pagy(submissions.preload(:submitters).order(id: :desc))
rescue ActiveRecord::RecordNotFound
redirect_to root_path
diff --git a/app/models/submission.rb b/app/models/submission.rb
index d27ce2ed..9be3d7a4 100644
--- a/app/models/submission.rb
+++ b/app/models/submission.rb
@@ -48,6 +48,8 @@ class Submission < ApplicationRecord
through: :template, source: :documents_attachments
scope :active, -> { where(deleted_at: nil) }
+ scope :pending, -> { joins(:submitters).where(submitters: { completed_at: nil }).distinct }
+ scope :completed, -> { left_joins(:submitters).where.not(submitters: { completed_at: nil }).distinct }
enum :source, {
invite: 'invite',
diff --git a/app/views/icons/_clock.html.erb b/app/views/icons/_clock.html.erb
new file mode 100644
index 00000000..80a14f26
--- /dev/null
+++ b/app/views/icons/_clock.html.erb
@@ -0,0 +1,5 @@
+
diff --git a/app/views/icons/_list.html.erb b/app/views/icons/_list.html.erb
new file mode 100644
index 00000000..555545ec
--- /dev/null
+++ b/app/views/icons/_list.html.erb
@@ -0,0 +1,9 @@
+
diff --git a/app/views/shared/_search_input.html.erb b/app/views/shared/_search_input.html.erb
index b9ae8ce0..fa50725a 100644
--- a/app/views/shared/_search_input.html.erb
+++ b/app/views/shared/_search_input.html.erb
@@ -1,7 +1,10 @@
-