mirror of
https://github.com/docusealco/docuseal
synced 2026-11-16 08:12:32 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0dac1abe84 | ||
|
|
d45ff6b2af | ||
|
|
3b4fdd1615 | ||
|
|
cd5cb9c082 | ||
|
|
e5b9ee9502 | ||
|
|
1cd3212736 | ||
|
|
82a6910181 | ||
|
|
353a0bc39c | ||
|
|
dd790be5cb | ||
|
|
1b50efe511 | ||
|
|
c364746f62 | ||
|
|
a44a2dcdaf | ||
|
|
0490ff4835 | ||
|
|
06c44e8b2f | ||
|
|
4fb3e5bd47 | ||
|
|
4702a68ad1 | ||
|
|
704bb2219e | ||
|
|
a24e2532d5 | ||
|
|
0aaaac8066 | ||
|
|
de08736b16 | ||
|
|
a33dc9d657 | ||
|
|
e947c9269b | ||
|
|
c45ad2f4e9 |
No files matched your search
@@ -104,7 +104,7 @@ jobs:
|
||||
bundle install --jobs 4 --retry 4
|
||||
yarn install
|
||||
sudo apt-get update
|
||||
sudo apt-get install libvips liblept5
|
||||
sudo apt-get install libvips libleptonica6
|
||||
- name: Run Brakeman
|
||||
run: bundle exec brakeman -q --exit-on-warn
|
||||
|
||||
|
||||
+2
-2
@@ -75,7 +75,7 @@ GEM
|
||||
securerandom (>= 0.3)
|
||||
tzinfo (~> 2.0, >= 2.0.5)
|
||||
uri (>= 0.13.1)
|
||||
addressable (2.9.0)
|
||||
addressable (2.9.2)
|
||||
public_suffix (>= 2.0.2, < 8.0)
|
||||
annotaterb (4.22.0)
|
||||
activerecord (>= 6.0.0)
|
||||
@@ -309,7 +309,7 @@ GEM
|
||||
minitest (6.0.6)
|
||||
drb (~> 2.0)
|
||||
prism (~> 1.5)
|
||||
msgpack (1.8.4)
|
||||
msgpack (1.8.7)
|
||||
multi_json (1.21.2)
|
||||
net-http (0.9.1)
|
||||
uri (>= 0.11.1)
|
||||
|
||||
@@ -49,9 +49,11 @@ class AccountsController < ApplicationController
|
||||
def destroy
|
||||
authorize!(:manage, current_account)
|
||||
|
||||
removed_email = true_user.email.sub('@', '+removed@')
|
||||
removed_email = true_user.email.sub('@', "+removed#{Time.current.to_i}@") if User.exists?(email: removed_email)
|
||||
|
||||
true_user.skip_reconfirmation!
|
||||
true_user.update!(locked_at: Time.current, archived_at: Time.current,
|
||||
email: true_user.email.sub('@', '+removed@'))
|
||||
true_user.update!(locked_at: Time.current, archived_at: Time.current, email: removed_email)
|
||||
true_user.account.update!(archived_at: Time.current)
|
||||
|
||||
# rubocop:disable-next Layout/LineLength
|
||||
|
||||
@@ -42,21 +42,21 @@ module Api
|
||||
|
||||
authorization_check!(attachment, @record, exp)
|
||||
|
||||
no_store
|
||||
|
||||
if request.headers['Range'].present?
|
||||
send_blob_byte_range_data blob, request.headers['Range']
|
||||
else
|
||||
http_cache_forever public: true do
|
||||
response.headers['Accept-Ranges'] = 'bytes'
|
||||
response.headers['Accept-Ranges'] = 'bytes'
|
||||
|
||||
if request.head?
|
||||
response.headers['Content-Type'] = blob.content_type_for_serving
|
||||
head :ok
|
||||
else
|
||||
send_blob_stream blob, disposition: params[:disposition]
|
||||
end
|
||||
|
||||
response.headers['Content-Length'] = blob.byte_size.to_s
|
||||
if request.head?
|
||||
response.headers['Content-Type'] = blob.content_type_for_serving
|
||||
head :ok
|
||||
else
|
||||
send_blob_stream blob, disposition: params[:disposition]
|
||||
end
|
||||
|
||||
response.headers['Content-Length'] = blob.byte_size.to_s
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -158,7 +158,9 @@ module Api
|
||||
|
||||
if attrs[:completed]
|
||||
submitter.values = Submitters::SubmitValues.merge_default_values(submitter)
|
||||
submitter.values = Submitters::SubmitValues.maybe_remove_condition_values(submitter)
|
||||
submitter.values = Submitters::SubmitValues.maybe_remove_condition_values(
|
||||
submitter, formula_values: Submitters::SubmitValues.build_formula_values(submitter)
|
||||
)
|
||||
|
||||
formula_values = Submitters::SubmitValues.build_formula_values(submitter)
|
||||
|
||||
|
||||
@@ -78,6 +78,12 @@ module Mcp
|
||||
|
||||
return render_tool_error('Template has no fields') if @template.fields.blank?
|
||||
|
||||
if @template.variables_schema.present?
|
||||
Rollbar.warning("MCP send variables template: #{@template.id}") if defined?(Rollbar)
|
||||
|
||||
return render_tool_error('Templates with variables are not supported')
|
||||
end
|
||||
|
||||
submitters = (mcp_params['submitters'] || []).map do |s|
|
||||
attrs = s.slice('email', 'name', 'role', 'phone').compact_blank
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class SubmitFormController < ApplicationController
|
||||
end
|
||||
|
||||
def update
|
||||
unless Submitters::AuthorizedForForm.call(@submitter, current_user, request)
|
||||
unless Submitters::AuthorizedForForm.call(@submitter, current_user, request, with_order: with_order(@submitter))
|
||||
return render json: { error: I18n.t('verification_required_refresh_the_page_and_pass_2fa') },
|
||||
status: :unprocessable_content
|
||||
end
|
||||
@@ -154,6 +154,11 @@ class SubmitFormController < ApplicationController
|
||||
.preload(:blob).index_by(&:uuid)
|
||||
end
|
||||
|
||||
def with_order(submitter)
|
||||
params[:completed] == 'true' && submitter.present? &&
|
||||
submitter.submission.template&.preferences&.dig('submitters_order') == 'preserved'
|
||||
end
|
||||
|
||||
def lang
|
||||
params[:lang].presence
|
||||
end
|
||||
|
||||
@@ -16,7 +16,8 @@ class SubmitFormDeclineController < ApplicationController
|
||||
@submitter.viewer? ||
|
||||
!Submitters::AuthorizedForForm.call(@submitter,
|
||||
current_user,
|
||||
request)
|
||||
request,
|
||||
with_order: true)
|
||||
|
||||
ApplicationRecord.transaction do
|
||||
@submitter.update!(declined_at: Time.current, values: @submitter.preferences['default_values'] || {})
|
||||
|
||||
@@ -49,7 +49,7 @@ class SubmitFormInviteController < ApplicationController
|
||||
!submitter.submission.expired? &&
|
||||
!submitter.submission.template&.archived_at? &&
|
||||
!submitter.viewer? &&
|
||||
Submitters::AuthorizedForForm.call(submitter, current_user, request)
|
||||
Submitters::AuthorizedForForm.call(submitter, current_user, request, with_order: true)
|
||||
end
|
||||
|
||||
def filter_invite_submitters(submitter, key = 'invite_by_uuid')
|
||||
|
||||
@@ -660,7 +660,7 @@
|
||||
:native-platform="nativePlatform"
|
||||
/>
|
||||
<nav
|
||||
v-if="stepFields.length < 80"
|
||||
v-if="stepFields.length > 2 && stepFields.length < 80"
|
||||
:aria-label="t('form_progress')"
|
||||
:aria-hidden="isCompleted"
|
||||
class="flex justify-center mt-3 sm:mt-4 mb-0 sm:mb-1 select-none"
|
||||
@@ -684,7 +684,7 @@
|
||||
</nav>
|
||||
<div
|
||||
v-else
|
||||
class="mt-5"
|
||||
class="mt-3"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1093,7 +1093,8 @@ export default {
|
||||
submittedValues: {},
|
||||
isFormStarted: false,
|
||||
recalculateButtonDisabledKey: '',
|
||||
isAccessibilityMode: false
|
||||
isAccessibilityMode: false,
|
||||
isMathLoaded: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -1197,6 +1198,24 @@ export default {
|
||||
return acc
|
||||
}, {})
|
||||
},
|
||||
formulaFieldsUuidIndex () {
|
||||
return this.fields.reduce((acc, f) => {
|
||||
if (f.preferences?.formula && f.type !== 'payment') {
|
||||
acc[f.uuid] = f
|
||||
}
|
||||
|
||||
return acc
|
||||
}, {})
|
||||
},
|
||||
readonlyValues () {
|
||||
return this.fields.reduce((acc, f) => {
|
||||
if (f.readonly) {
|
||||
acc[f.uuid] = isEmpty(this.values[f.uuid]) ? f.default_value : this.values[f.uuid]
|
||||
}
|
||||
|
||||
return acc
|
||||
}, {})
|
||||
},
|
||||
previousInitialsValue () {
|
||||
if (this.reuseSignature !== false) {
|
||||
const initialsField = this.fields.findLast
|
||||
@@ -1449,6 +1468,16 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
normalizeFormula: FormulaFieldAreas.methods.normalizeFormula,
|
||||
calculateFormula: FormulaFieldAreas.methods.calculateFormula,
|
||||
dateFormulaValue: FormulaFieldAreas.methods.dateFormulaValue,
|
||||
evalTextFormula: FormulaFieldAreas.methods.evalTextFormula,
|
||||
loadCalculator () {
|
||||
this.calculatorPromise ||= import('./calculator').then(({ Calculator }) => {
|
||||
this.math = new Calculator()
|
||||
this.isMathLoaded = true
|
||||
})
|
||||
},
|
||||
t (key) {
|
||||
return this.i18n[key] || i18n[this.language?.toLowerCase()]?.[key] || i18n[this.browserLanguage]?.[key] || i18n.en[key] || key
|
||||
},
|
||||
@@ -1497,17 +1526,25 @@ export default {
|
||||
}
|
||||
|
||||
const defaultValue = !field || isEmpty(field.default_value) ? null : field.default_value
|
||||
const isFormulaField = !!field?.preferences?.formula && field.type !== 'payment'
|
||||
|
||||
if (isFormulaField && !this.isMathLoaded) {
|
||||
this.loadCalculator()
|
||||
}
|
||||
|
||||
const formulaValue = isFormulaField && this.isMathLoaded
|
||||
? (field.type === 'text' ? this.evalTextFormula(field) : this.calculateFormula(field))
|
||||
: null
|
||||
const fieldValue = formulaValue ?? this.values[condition.field_uuid] ?? defaultValue
|
||||
|
||||
if (['empty', 'unchecked'].includes(condition.action)) {
|
||||
return isEmpty(this.values[condition.field_uuid] ?? defaultValue)
|
||||
return isEmpty(fieldValue)
|
||||
} else if (['not_empty', 'checked'].includes(condition.action)) {
|
||||
return !isEmpty(this.values[condition.field_uuid] ?? defaultValue)
|
||||
return !isEmpty(fieldValue)
|
||||
} else if (field?.type === 'number' && ['equal', 'not_equal', 'greater_than', 'less_than'].includes(condition.action)) {
|
||||
const value = this.values[condition.field_uuid] ?? defaultValue
|
||||
if (isEmpty(fieldValue) || isEmpty(condition.value)) return false
|
||||
|
||||
if (isEmpty(value) || isEmpty(condition.value)) return false
|
||||
|
||||
const actual = parseFloat(value)
|
||||
const actual = parseFloat(fieldValue)
|
||||
const expected = parseFloat(condition.value)
|
||||
|
||||
if (Number.isNaN(actual) || Number.isNaN(expected)) return false
|
||||
@@ -1523,21 +1560,21 @@ export default {
|
||||
const option = field.options.find((o) => o.uuid === condition.value)
|
||||
|
||||
if (option) {
|
||||
const values = [this.values[condition.field_uuid] ?? defaultValue].flat()
|
||||
const values = [fieldValue].flat()
|
||||
|
||||
return values.includes(this.optionValue(option, field.options.indexOf(option)))
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
return [this.values[condition.field_uuid] ?? defaultValue].flat().includes(condition.value)
|
||||
return [fieldValue].flat().includes(condition.value)
|
||||
}
|
||||
} else if (['not_equal', 'does_not_contain'].includes(condition.action) && field) {
|
||||
if (field.options) {
|
||||
const option = field.options.find((o) => o.uuid === condition.value)
|
||||
|
||||
if (option) {
|
||||
const values = [this.values[condition.field_uuid] ?? defaultValue].flat()
|
||||
const values = [fieldValue].flat()
|
||||
|
||||
return !values.includes(this.optionValue(option, field.options.indexOf(option)))
|
||||
} else {
|
||||
|
||||
@@ -557,7 +557,7 @@ export default {
|
||||
}, {})
|
||||
|
||||
try {
|
||||
const resp = await fetch(this.baseUrl + `/s/${this.submitterSlug}/kba/${this.field.uuid}`, {
|
||||
const resp = await fetch(this.baseUrl + `/s/${this.submitterSlug}/kba/${encodeURIComponent(this.field.uuid)}`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({
|
||||
token: this.token,
|
||||
|
||||
@@ -253,7 +253,7 @@ export default {
|
||||
},
|
||||
async submit () {
|
||||
if (this.sessionId) {
|
||||
return fetch(this.baseUrl + this.paymentEndpoint + '/' + this.sessionId, {
|
||||
return fetch(this.baseUrl + this.paymentEndpoint + '/' + encodeURIComponent(this.sessionId), {
|
||||
method: 'PUT',
|
||||
...this.fetchOptions,
|
||||
headers: { 'Content-Type': 'application/json', ...this.fetchOptions.headers }
|
||||
|
||||
@@ -162,7 +162,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
start () {
|
||||
return fetch(this.baseUrl + `/s/${this.submitterSlug}/identity_verification/${this.field.uuid}`, {
|
||||
return fetch(this.baseUrl + `/s/${this.submitterSlug}/identity_verification/${encodeURIComponent(this.field.uuid)}`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({
|
||||
redirect_url: document.location.href
|
||||
|
||||
@@ -700,11 +700,12 @@ export default {
|
||||
this.save()
|
||||
},
|
||||
onDefaultValueEnter (e) {
|
||||
if (this.field.type !== 'heading') {
|
||||
e.preventDefault()
|
||||
if (this.field.type === 'heading') return
|
||||
if (e.shiftKey && this.field.type === 'text') return
|
||||
|
||||
this.$refs.defaultValue.blur()
|
||||
}
|
||||
e.preventDefault()
|
||||
|
||||
this.$refs.defaultValue.blur()
|
||||
},
|
||||
resize (e) {
|
||||
if (e.target.id === 'mask') {
|
||||
|
||||
@@ -178,7 +178,7 @@ const SAFE_URL_REGEXP = /^(?:https?:\/\/|data:image\/|blob:|mailto:|tel:|\{|#)/i
|
||||
function isSafeAttr (name, value) {
|
||||
const lowerName = name.toLowerCase()
|
||||
|
||||
if (lowerName.startsWith('on') || DROP_ATTRS.includes(lowerName)) return false
|
||||
if (lowerName.startsWith('on') || lowerName.startsWith('data-turbo') || DROP_ATTRS.includes(lowerName)) return false
|
||||
if ((lowerName === 'href' || lowerName === 'src') && !SAFE_URL_REGEXP.test(value.trim())) return false
|
||||
|
||||
return true
|
||||
|
||||
@@ -432,8 +432,25 @@ function buildOperators (tags) {
|
||||
return operators
|
||||
}
|
||||
|
||||
const UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype']
|
||||
|
||||
function hasBlankKey (keyString) {
|
||||
return !keyString || keyString.split('.').some((key) => !key.trim())
|
||||
return !keyString || keyString.split('.').some((key) => !key.trim() || UNSAFE_KEYS.includes(key.trim()))
|
||||
}
|
||||
|
||||
function digProperties (properties, keys) {
|
||||
return keys.reduce((current, key) => {
|
||||
if (!current[key]) current[key] = { type: 'object', properties: {} }
|
||||
|
||||
const item = current[key].type === 'array' ? current[key].items : current[key]
|
||||
|
||||
if (!item.properties) {
|
||||
item.type = 'object'
|
||||
item.properties = {}
|
||||
}
|
||||
|
||||
return item.properties
|
||||
}, properties)
|
||||
}
|
||||
|
||||
function assignNestedSchema (propertiesHash, parentProperties, keyString, value) {
|
||||
@@ -442,23 +459,7 @@ function assignNestedSchema (propertiesHash, parentProperties, keyString, value)
|
||||
const keys = keyString.split('.')
|
||||
const lastKey = keys.pop()
|
||||
|
||||
let currentLevel = null
|
||||
|
||||
if (keys.length > 0 && parentProperties[keys[0]]) {
|
||||
currentLevel = keys.reduce((current, key) => {
|
||||
if (!current[key]) current[key] = { type: 'object', properties: {} }
|
||||
|
||||
return current[key].properties
|
||||
}, parentProperties)
|
||||
}
|
||||
|
||||
if (!currentLevel) {
|
||||
currentLevel = keys.reduce((current, key) => {
|
||||
if (!current[key]) current[key] = { type: 'object', properties: {} }
|
||||
|
||||
return current[key].properties
|
||||
}, propertiesHash)
|
||||
}
|
||||
const currentLevel = digProperties(keys.length > 0 && parentProperties[keys[0]] ? parentProperties : propertiesHash, keys)
|
||||
|
||||
currentLevel[lastKey] = value
|
||||
}
|
||||
@@ -469,23 +470,7 @@ function assignNestedSchemaWithPriority (propertiesHash, parentProperties, keySt
|
||||
const keys = keyString.split('.')
|
||||
const lastKey = keys.pop()
|
||||
|
||||
let currentLevel = null
|
||||
|
||||
if (keys.length > 0 && parentProperties[keys[0]]) {
|
||||
currentLevel = keys.reduce((current, key) => {
|
||||
if (!current[key]) current[key] = { type: 'object', properties: {} }
|
||||
|
||||
return current[key].properties
|
||||
}, parentProperties)
|
||||
}
|
||||
|
||||
if (!currentLevel) {
|
||||
currentLevel = keys.reduce((current, key) => {
|
||||
if (!current[key]) current[key] = { type: 'object', properties: {} }
|
||||
|
||||
return current[key].properties
|
||||
}, propertiesHash)
|
||||
}
|
||||
const currentLevel = digProperties(keys.length > 0 && parentProperties[keys[0]] ? parentProperties : propertiesHash, keys)
|
||||
|
||||
const existing = currentLevel[lastKey]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<a target="_blank" href="<%= Docuseal::GITHUB_URL %>" rel="noopener noreferrer nofollow" class="relative flex items-center rounded-full px-2 py-0.5 text-xs leading-4 mt-1 text-base-content border border-base-300 tooltip tooltip-bottom tooltip-no-touch" data-tip="Give a star on GitHub">
|
||||
<span class="flex items-center justify-between space-x-0.5 font-medium">
|
||||
<%= svg_icon('start', class: 'h-3 w-3') %>
|
||||
<span>18k</span>
|
||||
<span>19k</span>
|
||||
</span>
|
||||
</a>
|
||||
@@ -14,7 +14,7 @@
|
||||
<% end %>
|
||||
<%= render 'templates/dashboard_folder_dropzone', style: 'height: 114px' %>
|
||||
<div class="flex items-center flex-grow min-w-0 max-md:group-has-[search-input:focus-within]/header:hidden <%= 'max-md:hidden' if params[:q].present? %>">
|
||||
<% if has_archived || @pagy.count.nil? || @pagy.count > 0 || @template_folders.present? %>
|
||||
<% if current_account.created_at < 1.day.ago || has_archived || @pagy.count.nil? || @pagy.count > 0 || @template_folders.present? %>
|
||||
<div class="mr-2">
|
||||
<%= render 'dashboard/toggle_view', selected: 'templates' %>
|
||||
</div>
|
||||
|
||||
@@ -835,6 +835,9 @@ en: &en
|
||||
manage_subscription: Manage Subscription
|
||||
docuseal_version_security_release_is_available: "DocuSeal v%{version} security release is available."
|
||||
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Click here</a> to view the instructions and update your app.'
|
||||
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
|
||||
one: 'Your Pro subscription includes <b>%{count}</b> user seat, but there are <b>%{users}</b> active users in your account.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Upgrade</a> your plan to cover <b>%{users}</b> users or remove inactive users via <a href="%{settings_url}" class="link font-bold">Settings</a>.'
|
||||
other: 'Your Pro subscription includes <b>%{count}</b> user seats, but there are <b>%{users}</b> active users in your account.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Upgrade</a> your plan to cover <b>%{users}</b> users or remove inactive users via <a href="%{settings_url}" class="link font-bold">Settings</a>.'
|
||||
submission_created_by_email_html: '<b>Submission created</b> by %{email}'
|
||||
submission_created_by_email_via_source_html: '<b>Submission created</b> by %{email} via %{source}'
|
||||
submission_created_via_source_html: '<b>Submission created</b> via %{source}'
|
||||
@@ -1997,6 +2000,9 @@ es: &es
|
||||
manage_subscription: Gestionar Suscripción
|
||||
docuseal_version_security_release_is_available: "La versión de seguridad DocuSeal v%{version} está disponible."
|
||||
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Haz clic aquí</a> para ver las instrucciones y actualizar tu aplicación.'
|
||||
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
|
||||
one: 'Tu suscripción Pro incluye <b>%{count}</b> plaza de usuario, pero hay <b>%{users}</b> usuarios activos en tu cuenta.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Amplía</a> tu plan para cubrir <b>%{users}</b> usuarios o elimina los usuarios inactivos en la <a href="%{settings_url}" class="link font-bold">Configuración</a>.'
|
||||
other: 'Tu suscripción Pro incluye <b>%{count}</b> plazas de usuario, pero hay <b>%{users}</b> usuarios activos en tu cuenta.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Amplía</a> tu plan para cubrir <b>%{users}</b> usuarios o elimina los usuarios inactivos en la <a href="%{settings_url}" class="link font-bold">Configuración</a>.'
|
||||
submission_created_by_email_html: '<b>Envío creado</b> por %{email}'
|
||||
submission_created_by_email_via_source_html: '<b>Envío creado</b> por %{email} a través de %{source}'
|
||||
submission_created_via_source_html: '<b>Envío creado</b> a través de %{source}'
|
||||
@@ -3165,6 +3171,9 @@ it: &it
|
||||
manage_subscription: Gestisci Abbonamento
|
||||
docuseal_version_security_release_is_available: "È disponibile il rilascio di sicurezza DocuSeal v%{version}."
|
||||
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Fai clic qui</a> per vedere le istruzioni e aggiornare la tua app.'
|
||||
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
|
||||
one: 'Il tuo abbonamento Pro include <b>%{count}</b> posto utente, ma nel tuo account ci sono <b>%{users}</b> utenti attivi.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Aggiorna</a> il tuo piano per coprire <b>%{users}</b> utenti oppure rimuovi gli utenti inattivi dalle <a href="%{settings_url}" class="link font-bold">Impostazioni</a>.'
|
||||
other: 'Il tuo abbonamento Pro include <b>%{count}</b> posti utente, ma nel tuo account ci sono <b>%{users}</b> utenti attivi.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Aggiorna</a> il tuo piano per coprire <b>%{users}</b> utenti oppure rimuovi gli utenti inattivi dalle <a href="%{settings_url}" class="link font-bold">Impostazioni</a>.'
|
||||
submission_created_by_email_html: '<b>Invio creato</b> da %{email}'
|
||||
submission_created_by_email_via_source_html: '<b>Invio creato</b> da %{email} tramite %{source}'
|
||||
submission_created_via_source_html: '<b>Invio creato</b> tramite %{source}'
|
||||
@@ -4319,6 +4328,9 @@ fr: &fr
|
||||
manage_subscription: Gérer l’abonnement
|
||||
docuseal_version_security_release_is_available: "La mise à jour de sécurité DocuSeal v%{version} est disponible."
|
||||
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Cliquez ici</a> pour voir les instructions et mettre à jour votre application.'
|
||||
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
|
||||
one: 'Votre abonnement Pro inclut <b>%{count}</b> place d’utilisateur, mais votre compte compte <b>%{users}</b> utilisateurs actifs.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Mettez à niveau</a> votre offre pour couvrir <b>%{users}</b> utilisateurs ou supprimez les utilisateurs inactifs dans les <a href="%{settings_url}" class="link font-bold">Paramètres</a>.'
|
||||
other: 'Votre abonnement Pro inclut <b>%{count}</b> places d’utilisateur, mais votre compte compte <b>%{users}</b> utilisateurs actifs.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Mettez à niveau</a> votre offre pour couvrir <b>%{users}</b> utilisateurs ou supprimez les utilisateurs inactifs dans les <a href="%{settings_url}" class="link font-bold">Paramètres</a>.'
|
||||
submission_created_by_email_html: "<b>Soumission créée</b> par %{email}"
|
||||
submission_created_by_email_via_source_html: "<b>Soumission créée</b> par %{email} via %{source}"
|
||||
submission_created_via_source_html: "<b>Soumission créée</b> via %{source}"
|
||||
@@ -5483,6 +5495,9 @@ pt: &pt
|
||||
manage_subscription: Gerenciar Assinatura
|
||||
docuseal_version_security_release_is_available: "A versão de segurança DocuSeal v%{version} está disponível."
|
||||
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Clique aqui</a> para ver as instruções e atualizar seu aplicativo.'
|
||||
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
|
||||
one: 'Sua assinatura Pro inclui <b>%{count}</b> lugar de usuário, mas há <b>%{users}</b> usuários ativos na sua conta.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Atualize</a> seu plano para cobrir <b>%{users}</b> usuários ou remova os usuários inativos nas <a href="%{settings_url}" class="link font-bold">Configurações</a>.'
|
||||
other: 'Sua assinatura Pro inclui <b>%{count}</b> lugares de usuário, mas há <b>%{users}</b> usuários ativos na sua conta.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Atualize</a> seu plano para cobrir <b>%{users}</b> usuários ou remova os usuários inativos nas <a href="%{settings_url}" class="link font-bold">Configurações</a>.'
|
||||
submission_created_by_email_html: '<b>Envio criado</b> por %{email}'
|
||||
submission_created_by_email_via_source_html: '<b>Envio criado</b> por %{email} via %{source}'
|
||||
submission_created_via_source_html: '<b>Envio criado</b> via %{source}'
|
||||
@@ -6650,6 +6665,9 @@ de: &de
|
||||
manage_subscription: Abonnement verwalten
|
||||
docuseal_version_security_release_is_available: "Das Sicherheitsupdate DocuSeal v%{version} ist verfügbar."
|
||||
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Klicken Sie hier</a>, um die Anleitung anzuzeigen und Ihre App zu aktualisieren.'
|
||||
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
|
||||
one: 'Ihr Pro-Abonnement umfasst <b>%{count}</b> Benutzerplatz, aber in Ihrem Konto gibt es <b>%{users}</b> aktive Benutzer.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Erweitern</a> Sie Ihren Plan auf <b>%{users}</b> Benutzer oder entfernen Sie inaktive Benutzer in den <a href="%{settings_url}" class="link font-bold">Einstellungen</a>.'
|
||||
other: 'Ihr Pro-Abonnement umfasst <b>%{count}</b> Benutzerplätze, aber in Ihrem Konto gibt es <b>%{users}</b> aktive Benutzer.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Erweitern</a> Sie Ihren Plan auf <b>%{users}</b> Benutzer oder entfernen Sie inaktive Benutzer in den <a href="%{settings_url}" class="link font-bold">Einstellungen</a>.'
|
||||
submission_created_by_email_html: '<b>Einreichung erstellt</b> von %{email}'
|
||||
submission_created_by_email_via_source_html: '<b>Einreichung erstellt</b> von %{email} über %{source}'
|
||||
submission_created_via_source_html: '<b>Einreichung erstellt</b> über %{source}'
|
||||
@@ -8345,6 +8363,9 @@ nl: &nl
|
||||
manage_subscription: Abonnement beheren
|
||||
docuseal_version_security_release_is_available: "Beveiligingsupdate DocuSeal v%{version} is beschikbaar."
|
||||
click_here_to_view_the_instructions_and_update_your_app_html: '<a href="%{url}" class="link" target="_blank" rel="noopener noreferrer nofollow">Klik hier</a> om de instructies te bekijken en uw app bij te werken.'
|
||||
your_pro_subscription_includes_count_user_seats_but_there_are_users_active_users_in_your_account_html:
|
||||
one: 'Uw Pro-abonnement omvat <b>%{count}</b> gebruikersplaats, maar er zijn <b>%{users}</b> actieve gebruikers in uw account.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Upgrade</a> uw abonnement naar <b>%{users}</b> gebruikers of verwijder inactieve gebruikers via de <a href="%{settings_url}" class="link font-bold">Instellingen</a>.'
|
||||
other: 'Uw Pro-abonnement omvat <b>%{count}</b> gebruikersplaatsen, maar er zijn <b>%{users}</b> actieve gebruikers in uw account.<br><a href="%{upgrade_url}" class="link font-bold" target="_blank" rel="noopener noreferrer nofollow">Upgrade</a> uw abonnement naar <b>%{users}</b> gebruikers of verwijder inactieve gebruikers via de <a href="%{settings_url}" class="link font-bold">Instellingen</a>.'
|
||||
submission_created_by_email_html: "<b>Inzending aangemaakt</b> door %{email}"
|
||||
submission_created_by_email_via_source_html: "<b>Inzending aangemaakt</b> door %{email} via %{source}"
|
||||
submission_created_via_source_html: "<b>Inzending aangemaakt</b> via %{source}"
|
||||
|
||||
@@ -18,6 +18,7 @@ module ReplaceEmailVariables
|
||||
SUBMISSION_LINK = /\{+submission\.link\}+/i
|
||||
SUBMISSION_ID = /\{+submission\.id\}+/i
|
||||
SUBMISSION_EXPIRE_AT = /\{+submission\.expire_at\}+/i
|
||||
SUBMISSION_VARIABLE = /\{+submission\.(?<variable_name>[^}]+)\}+/i
|
||||
SUBMITTERS = /\{+(?:submission\.)?submitters\}+/i
|
||||
SUBMITTERS_N_EMAIL = /\{+submitters\[(?<index>\d+)\]\.email\}+/i
|
||||
SUBMITTERS_N_NAME = /\{+submitters\[(?<index>\d+)\]\.name\}+/i
|
||||
@@ -65,6 +66,10 @@ module ReplaceEmailVariables
|
||||
end
|
||||
end
|
||||
|
||||
text = replace(text, SUBMISSION_VARIABLE, html_escape:) do |match|
|
||||
build_submission_variable(submitter.submission, match[:variable_name].to_s.strip)
|
||||
end
|
||||
|
||||
text = replace(text, SUBMITTERS_N_NAME, html_escape:) do |match|
|
||||
build_submitters_n_field(submitter.submission, match[:index].to_i - 1, :name)
|
||||
end
|
||||
@@ -103,6 +108,12 @@ module ReplaceEmailVariables
|
||||
)
|
||||
end
|
||||
|
||||
def build_submission_variable(submission, variable_name)
|
||||
variable_name.split('.').reduce(submission.variables) do |value, key|
|
||||
value[key] if value.is_a?(Hash)
|
||||
end
|
||||
end
|
||||
|
||||
def build_submitters_n_field(submission, index, field_name, value_name = nil)
|
||||
uuid = (submission.template_submitters || submission.template.submitters).dig(index, 'uuid')
|
||||
|
||||
|
||||
@@ -459,7 +459,9 @@ module Submissions
|
||||
|
||||
def assign_completed_attributes(submitter, with_verification: true)
|
||||
submitter.values = Submitters::SubmitValues.merge_default_values(submitter, with_verification:)
|
||||
submitter.values = Submitters::SubmitValues.maybe_remove_condition_values(submitter)
|
||||
submitter.values = Submitters::SubmitValues.maybe_remove_condition_values(
|
||||
submitter, formula_values: Submitters::SubmitValues.build_formula_values(submitter)
|
||||
)
|
||||
|
||||
formula_values = Submitters::SubmitValues.build_formula_values(submitter)
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ module Submissions
|
||||
document.metadata['sha256'] || document.checksum,
|
||||
"\n",
|
||||
{ text: "#{I18n.t('generated_at')}: ", font: [FONT_NAME, { variant: :bold }] },
|
||||
"#{I18n.l(document.created_at.in_time_zone(timezone), format: :long, locale: account.locale)} " \
|
||||
"#{I18n.l(document.created_at.in_time_zone(timezone), format: :long)} " \
|
||||
"#{TimeUtils.timezone_abbr(timezone, document.created_at)}"
|
||||
], line_spacing: 1.3
|
||||
)
|
||||
@@ -440,7 +440,7 @@ module Submissions
|
||||
composer.formatted_text_box([{ text: value.to_s.titleize }], padding: [0, 0, 10, 0])
|
||||
else
|
||||
if field['type'] == 'date'
|
||||
value = TimeUtils.format_date_string(value, field.dig('preferences', 'format'), account.locale,
|
||||
value = TimeUtils.format_date_string(value, field.dig('preferences', 'format'), I18n.locale,
|
||||
timezone:)
|
||||
end
|
||||
|
||||
@@ -533,7 +533,7 @@ module Submissions
|
||||
time_format = with_timestamp_seconds ? :detailed : :long
|
||||
|
||||
[
|
||||
"#{I18n.l(event.event_timestamp.in_time_zone(timezone), format: time_format, locale: account.locale)} " \
|
||||
"#{I18n.l(event.event_timestamp.in_time_zone(timezone), format: time_format)} " \
|
||||
"#{TimeUtils.timezone_abbr(timezone, event.event_timestamp)}",
|
||||
composer.document.layout.formatted_text_box(text_box)
|
||||
]
|
||||
|
||||
@@ -75,13 +75,14 @@ module Submitters
|
||||
submitter.completed_at = Time.current
|
||||
submitter.ip = request.remote_ip
|
||||
submitter.ua = request.user_agent
|
||||
submitter.timezone = request.params[:timezone]
|
||||
submitter.timezone = request.params[:timezone] if ActiveSupport::TimeZone[request.params[:timezone].to_s]
|
||||
|
||||
submitter.values = merge_default_values(submitter)
|
||||
|
||||
required_field_uuids_acc = Set.new
|
||||
|
||||
submitter.values = maybe_remove_condition_values(submitter, required_field_uuids_acc:)
|
||||
submitter.values = maybe_remove_condition_values(submitter, formula_values: build_formula_values(submitter),
|
||||
required_field_uuids_acc:)
|
||||
|
||||
formula_values = build_formula_values(submitter)
|
||||
|
||||
@@ -204,10 +205,10 @@ module Submitters
|
||||
default_values.compact_blank.merge(submitter.values)
|
||||
end
|
||||
|
||||
def build_formula_values(submitter)
|
||||
submission_values = nil
|
||||
def build_formula_values(submitter, submission_values: nil)
|
||||
submission = submitter.submission
|
||||
|
||||
computed_values = submitter.submission.template_fields.each_with_object({}) do |field, acc|
|
||||
computed_values = (submission.template_fields || submission.template.fields).each_with_object({}) do |field, acc|
|
||||
next if field['submitter_uuid'] != submitter.uuid
|
||||
next if field['type'] == 'payment'
|
||||
|
||||
@@ -297,17 +298,17 @@ module Submitters
|
||||
field:)
|
||||
end
|
||||
|
||||
def maybe_remove_condition_values(submitter, required_field_uuids_acc: nil)
|
||||
def maybe_remove_condition_values(submitter, formula_values: {}, required_field_uuids_acc: nil)
|
||||
submission = submitter.submission
|
||||
|
||||
submitters_values = nil
|
||||
submitters_values = formula_values.merge(merge_submitters_values(submitter)) if formula_values.present?
|
||||
has_other_submitters = submission.template_submitters.size > 1
|
||||
|
||||
has_document_conditions = submission_has_document_conditions?(submission)
|
||||
|
||||
attachments_index =
|
||||
if has_document_conditions
|
||||
submitters_values = merge_submitters_values(submitter)
|
||||
submitters_values ||= merge_submitters_values(submitter)
|
||||
|
||||
Submissions.filtered_conditions_schema(submission, values: submitters_values)
|
||||
.index_by { |i| i['attachment_uuid'] }
|
||||
|
||||
@@ -100,13 +100,15 @@ module Templates
|
||||
Zip::File.open(file.tempfile).each do |entry|
|
||||
next if entry.directory?
|
||||
|
||||
total_size += entry.size
|
||||
tempfile = Tempfile.new(entry.name)
|
||||
tempfile.binmode
|
||||
|
||||
total_size += entry.get_input_stream do |in_stream|
|
||||
IO.copy_stream(in_stream, tempfile, MAX_ZIP_SIZE - total_size + 1)
|
||||
end
|
||||
|
||||
raise InvalidFileType, 'zip_too_large' if total_size > MAX_ZIP_SIZE
|
||||
|
||||
tempfile = Tempfile.new(entry.name)
|
||||
tempfile.binmode
|
||||
entry.get_input_stream { |in_stream| IO.copy_stream(in_stream, tempfile) }
|
||||
tempfile.rewind
|
||||
|
||||
type = Marcel::MimeType.for(tempfile, name: entry.name)
|
||||
|
||||
Reference in new issue
Block a user