Merge from docusealco/wip
This commit is contained in:
+7
-7
@@ -338,18 +338,18 @@ GEM
|
|||||||
net-smtp (0.5.0)
|
net-smtp (0.5.0)
|
||||||
net-protocol
|
net-protocol
|
||||||
nio4r (2.7.4)
|
nio4r (2.7.4)
|
||||||
nokogiri (1.18.3)
|
nokogiri (1.18.5)
|
||||||
mini_portile2 (~> 2.8.2)
|
mini_portile2 (~> 2.8.2)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.3-aarch64-linux-gnu)
|
nokogiri (1.18.5-aarch64-linux-gnu)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.3-aarch64-linux-musl)
|
nokogiri (1.18.5-aarch64-linux-musl)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.3-arm64-darwin)
|
nokogiri (1.18.5-arm64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.3-x86_64-linux-gnu)
|
nokogiri (1.18.5-x86_64-linux-gnu)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.3-x86_64-linux-musl)
|
nokogiri (1.18.5-x86_64-linux-musl)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
oj (3.16.8)
|
oj (3.16.8)
|
||||||
bigdecimal (>= 3.0)
|
bigdecimal (>= 3.0)
|
||||||
@@ -387,7 +387,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.1.10)
|
rack (3.1.12)
|
||||||
rack-proxy (0.7.7)
|
rack-proxy (0.7.7)
|
||||||
rack
|
rack
|
||||||
rack-session (2.0.0)
|
rack-session (2.0.0)
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ module Api
|
|||||||
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,
|
||||||
{ metadata: {}, values: {}, 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, :validation_pattern, :invalid_message,
|
:readonly, :validation_pattern, :invalid_message,
|
||||||
{ default_value: [], value: [], preferences: {} }] }]]
|
{ default_value: [], value: [], preferences: {} }] }]]
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class StartFormController < ApplicationController
|
|||||||
redirect_to start_form_completed_path(@template.slug, email: submitter_params[:email])
|
redirect_to start_form_completed_path(@template.slug, email: submitter_params[:email])
|
||||||
else
|
else
|
||||||
if filter_undefined_submitters(@template).size > 1 && @submitter.new_record?
|
if filter_undefined_submitters(@template).size > 1 && @submitter.new_record?
|
||||||
@error_message = I18n.t('not_found')
|
@error_message = multiple_submitters_error_message
|
||||||
|
|
||||||
return render :show
|
return render :show
|
||||||
end
|
end
|
||||||
@@ -117,4 +117,12 @@ class StartFormController < ApplicationController
|
|||||||
|
|
||||||
@template = Template.find_by!(slug:)
|
@template = Template.find_by!(slug:)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def multiple_submitters_error_message
|
||||||
|
if current_user&.account_id == @template.account_id
|
||||||
|
helpers.t('this_submission_has_multiple_signers_which_prevents_the_use_of_a_sharing_link_html')
|
||||||
|
else
|
||||||
|
I18n.t('not_found')
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ class TemplatesDebugController < ApplicationController
|
|||||||
def show
|
def show
|
||||||
attachment = @template.documents.first
|
attachment = @template.documents.first
|
||||||
|
|
||||||
pdf = HexaPDF::Document.new(io: StringIO.new(attachment.download))
|
data = attachment.download
|
||||||
|
pdf = HexaPDF::Document.new(io: StringIO.new(data))
|
||||||
|
|
||||||
fields = Templates::FindAcroFields.call(pdf, attachment)
|
fields = Templates::FindAcroFields.call(pdf, attachment, data)
|
||||||
|
|
||||||
attachment.metadata['pdf'] ||= {}
|
attachment.metadata['pdf'] ||= {}
|
||||||
attachment.metadata['pdf']['fields'] = fields
|
attachment.metadata['pdf']['fields'] = fields
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="field-area flex absolute lg:text-base -outline-offset-1"
|
class="flex absolute lg:text-base -outline-offset-1 field-area"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
:style="computedStyle"
|
:style="computedStyle"
|
||||||
:class="{ 'text-[1.6vw] lg:text-base': !textOverflowChars, 'text-[1.0vw] lg:text-xs': textOverflowChars, 'cursor-default': !submittable, 'border border-red-100 bg-red-100 cursor-pointer': submittable, 'border border-red-100': !isActive && submittable, 'bg-opacity-80': !isActive && !isValueSet && submittable, 'field-area-active outline-red-500 outline-dashed outline-2 z-10': isActive && submittable, 'bg-opacity-40': (isActive || isValueSet) && submittable }"
|
:class="{ 'text-[1.6vw] lg:text-base': !textOverflowChars, 'text-[1.0vw] lg:text-xs': textOverflowChars, 'cursor-default': !submittable, 'border border-red-100 bg-red-100 cursor-pointer': submittable, 'border border-red-100': !isActive && submittable, 'bg-opacity-80': !isActive && !isValueSet && submittable, 'outline-red-500 outline-dashed outline-2 z-10 field-area-active': isActive && submittable, 'bg-opacity-40': (isActive || isValueSet) && submittable }"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="(!withFieldPlaceholder || !field.name || field.type === 'cells') && !isActive && !isValueSet && field.type !== 'checkbox' && submittable && !area.option_uuid"
|
v-if="(!withFieldPlaceholder || !field.name || field.type === 'cells') && !isActive && !isValueSet && field.type !== 'checkbox' && submittable && !area.option_uuid"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
v-if="val"
|
v-if="val"
|
||||||
class="flex items-center space-x-1.5 w-full"
|
class="flex items-center space-x-1.5 w-full attachment-file-name"
|
||||||
:href="attachmentsIndex[val].url"
|
:href="attachmentsIndex[val].url"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
@@ -26,7 +26,10 @@
|
|||||||
{{ attachmentsIndex[val].filename }}
|
{{ attachmentsIndex[val].filename }}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<button @click.prevent="removeAttachment(val)">
|
<button
|
||||||
|
class="remove-attachment-button"
|
||||||
|
@click.prevent="removeAttachment(val)"
|
||||||
|
>
|
||||||
<IconTrashX
|
<IconTrashX
|
||||||
:width="18"
|
:width="18"
|
||||||
:heigh="19"
|
:heigh="19"
|
||||||
@@ -44,7 +47,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="field.description && !modelValue.length"
|
v-if="field.description && !modelValue.length"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="field.description" />
|
<MarkdownContent :string="field.description" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
id="form_completed"
|
id="form_completed"
|
||||||
class="mx-auto max-w-md flex flex-col"
|
class="mx-auto max-w-md flex flex-col completed-form"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
>
|
>
|
||||||
<div class="font-medium text-2xl flex items-center space-x-1.5 mx-auto">
|
<div class="font-medium text-2xl flex items-center space-x-1.5 mx-auto">
|
||||||
@@ -10,13 +10,13 @@
|
|||||||
:width="30"
|
:width="30"
|
||||||
:height="30"
|
:height="30"
|
||||||
/>
|
/>
|
||||||
<span>
|
<span class="completed-form-message-title">
|
||||||
{{ completedMessage.title || (hasSignatureFields ? (hasMultipleDocuments ? t('documents_have_been_signed') : t('document_has_been_signed')) : t('form_has_been_completed')) }}
|
{{ completedMessage.title || (hasSignatureFields ? (hasMultipleDocuments ? t('documents_have_been_signed') : t('document_has_been_signed')) : t('form_has_been_completed')) }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="completedMessage.body"
|
v-if="completedMessage.body"
|
||||||
class="mt-2"
|
class="mt-2 completed-form-message-body"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
:string="completedMessage.body"
|
:string="completedMessage.body"
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
v-if="completedButton.url"
|
v-if="completedButton.url"
|
||||||
:href="sanitizeHref(completedButton.url)"
|
:href="sanitizeHref(completedButton.url)"
|
||||||
rel="noopener noreferrer nofollow"
|
rel="noopener noreferrer nofollow"
|
||||||
class="white-button flex items-center w-full"
|
class="white-button flex items-center w-full completed-form-completed-button"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
{{ completedButton.title || 'Back to Website' }}
|
{{ completedButton.title || 'Back to Website' }}
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<button
|
<button
|
||||||
v-if="canSendEmail && !isDemo && withSendCopyButton"
|
v-if="canSendEmail && !isDemo && withSendCopyButton"
|
||||||
class="white-button !h-auto flex items-center space-x-1 w-full"
|
class="white-button !h-auto flex items-center space-x-1 w-full completed-form-send-copy-button"
|
||||||
:disabled="isSendingCopy"
|
:disabled="isSendingCopy"
|
||||||
@click.prevent="sendCopyToEmail"
|
@click.prevent="sendCopyToEmail"
|
||||||
>
|
>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="!isWebView && withDownloadButton"
|
v-if="!isWebView && withDownloadButton"
|
||||||
class="base-button flex items-center space-x-1 w-full"
|
class="base-button flex items-center space-x-1 w-full completed-form-download-button"
|
||||||
:disabled="isDownloading"
|
:disabled="isDownloading"
|
||||||
@click.prevent="download"
|
@click.prevent="download"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<label
|
<label
|
||||||
v-if="showFieldNames"
|
v-if="showFieldNames"
|
||||||
:for="field.uuid"
|
:for="field.uuid"
|
||||||
class="label text-xl sm:text-2xl py-0"
|
class="label text-xl sm:text-2xl py-0 field-name-label"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
v-if="field.title"
|
v-if="field.title"
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</label>
|
</label>
|
||||||
<button
|
<button
|
||||||
class="btn btn-outline btn-sm !normal-case font-normal"
|
class="btn btn-outline btn-sm !normal-case font-normal set-current-date-button"
|
||||||
@click.prevent="[setCurrentDate(), $emit('focus')]"
|
@click.prevent="[setCurrentDate(), $emit('focus')]"
|
||||||
>
|
>
|
||||||
<IconCalendarCheck :width="16" />
|
<IconCalendarCheck :width="16" />
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="field.description"
|
v-if="field.description"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="field.description" />
|
<MarkdownContent :string="field.description" />
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
:for="inputId"
|
:for="inputId"
|
||||||
class="w-full relative bg-base-300 hover:bg-base-200 rounded-md border border-base-content border-dashed"
|
class="w-full relative bg-base-300 hover:bg-base-200 rounded-md border border-base-content border-dashed file-dropzone"
|
||||||
:class="{ 'opacity-50': isLoading }"
|
:class="{ 'opacity-50': isLoading }"
|
||||||
>
|
>
|
||||||
<div class="absolute top-0 right-0 left-0 bottom-0 flex items-center justify-center">
|
<div class="absolute top-0 right-0 left-0 bottom-0 flex items-center justify-center">
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
<button
|
<button
|
||||||
v-if="!isFormVisible"
|
v-if="!isFormVisible"
|
||||||
id="expand_form_button"
|
id="expand_form_button"
|
||||||
class="btn btn-neutral flex text-white absolute bottom-0 w-full mb-3"
|
class="btn btn-neutral flex text-white absolute bottom-0 w-full mb-3 expand-form-button"
|
||||||
style="width: 96%; margin-left: 2%"
|
style="width: 96%; margin-left: 2%"
|
||||||
@click.prevent="[isFormVisible = true, scrollIntoField(currentField)]"
|
@click.prevent="[isFormVisible = true, scrollIntoField(currentField)]"
|
||||||
>
|
>
|
||||||
@@ -93,14 +93,14 @@
|
|||||||
<div
|
<div
|
||||||
v-show="isFormVisible"
|
v-show="isFormVisible"
|
||||||
id="form_container"
|
id="form_container"
|
||||||
class="shadow-md bg-base-100 absolute bottom-0 w-full border-base-200 border p-4 rounded"
|
class="shadow-md bg-base-100 absolute bottom-0 w-full border-base-200 border p-4 rounded form-container"
|
||||||
:class="{ 'md:bottom-4': isBreakpointMd }"
|
:class="{ 'md:bottom-4': isBreakpointMd }"
|
||||||
:style="{ backgroundColor: backgroundColor }"
|
:style="{ backgroundColor: backgroundColor }"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
v-if="!isCompleted"
|
v-if="!isCompleted"
|
||||||
id="minimize_form_button"
|
id="minimize_form_button"
|
||||||
class="absolute right-0 top-0"
|
class="absolute right-0 top-0 minimize-form-button"
|
||||||
:class="currentField?.description?.length > 100 ? 'mr-1 mt-1 md:mr-2 md:mt-2': 'mr-2 mt-2 hidden md:block'"
|
:class="currentField?.description?.length > 100 ? 'mr-1 mt-1 md:mr-2 md:mt-2': 'mr-2 mt-2 hidden md:block'"
|
||||||
:title="t('minimize')"
|
:title="t('minimize')"
|
||||||
@click.prevent="minimizeForm"
|
@click.prevent="minimizeForm"
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
ref="form"
|
ref="form"
|
||||||
:action="submitPath"
|
:action="submitPath"
|
||||||
method="post"
|
method="post"
|
||||||
class="mx-auto"
|
class="mx-auto steps-form"
|
||||||
:style="{ maxWidth: isBreakpointMd ? '582px' : '' }"
|
:style="{ maxWidth: isBreakpointMd ? '582px' : '' }"
|
||||||
@submit.prevent="submitStep"
|
@submit.prevent="submitStep"
|
||||||
>
|
>
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
v-if="showFieldNames && (currentField.name || currentField.title)"
|
v-if="showFieldNames && (currentField.name || currentField.title)"
|
||||||
:for="currentField.uuid"
|
:for="currentField.uuid"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5"
|
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5 field-name-label"
|
||||||
:class="{ 'mb-2': !currentField.description }"
|
:class="{ 'mb-2': !currentField.description }"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="currentField.description"
|
v-if="currentField.description"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="currentField.description" />
|
<MarkdownContent :string="currentField.description" />
|
||||||
</div>
|
</div>
|
||||||
@@ -226,7 +226,7 @@
|
|||||||
v-if="showFieldNames && (currentField.name || currentField.title)"
|
v-if="showFieldNames && (currentField.name || currentField.title)"
|
||||||
:for="currentField.uuid"
|
:for="currentField.uuid"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5"
|
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5 field-name-label"
|
||||||
:class="{ 'mb-2': !currentField.description }"
|
:class="{ 'mb-2': !currentField.description }"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
@@ -245,7 +245,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="currentField.description"
|
v-if="currentField.description"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="currentField.description" />
|
<MarkdownContent :string="currentField.description" />
|
||||||
</div>
|
</div>
|
||||||
@@ -270,7 +270,7 @@
|
|||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
:for="option.uuid"
|
:for="option.uuid"
|
||||||
class="flex items-center space-x-3"
|
class="flex items-center space-x-3 radio-label"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
:id="option.uuid"
|
:id="option.uuid"
|
||||||
@@ -304,7 +304,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="currentField.description"
|
v-if="currentField.description"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="currentField.description" />
|
<MarkdownContent :string="currentField.description" />
|
||||||
</div>
|
</div>
|
||||||
@@ -338,7 +338,7 @@
|
|||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
:for="field.uuid"
|
:for="field.uuid"
|
||||||
class="flex items-center space-x-3"
|
class="flex items-center space-x-3 checkbox-label"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
type="hidden"
|
type="hidden"
|
||||||
@@ -481,7 +481,7 @@
|
|||||||
id="submit_form_button"
|
id="submit_form_button"
|
||||||
ref="submitButton"
|
ref="submitButton"
|
||||||
type="submit"
|
type="submit"
|
||||||
class="base-button w-full flex justify-center"
|
class="base-button w-full flex justify-center submit-form-button"
|
||||||
:disabled="isButtonDisabled"
|
:disabled="isButtonDisabled"
|
||||||
>
|
>
|
||||||
<span class="flex">
|
<span class="flex">
|
||||||
@@ -533,13 +533,13 @@
|
|||||||
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"
|
||||||
>
|
>
|
||||||
<div class="flex items-center flex-wrap">
|
<div class="flex items-center flex-wrap steps-progress">
|
||||||
<a
|
<a
|
||||||
v-for="(step, index) in stepFields"
|
v-for="(step, index) in stepFields"
|
||||||
:key="step[0].uuid"
|
:key="step[0].uuid"
|
||||||
href="#"
|
href="#"
|
||||||
class="inline border border-base-300 h-3 w-3 rounded-full mx-1 mt-1"
|
class="inline border border-base-300 h-3 w-3 rounded-full mx-1 mt-1"
|
||||||
:class="{ 'bg-base-300': index === currentStep, 'bg-base-content': (index < currentStep && stepFields[index].every((f) => !f.required || ![null, undefined, ''].includes(values[f.uuid]))) || isCompleted, 'bg-white': index > currentStep }"
|
:class="{ 'bg-base-300 steps-progress-current': index === currentStep, 'bg-base-content': (index < currentStep && stepFields[index].every((f) => !f.required || ![null, undefined, ''].includes(values[f.uuid]))) || isCompleted, 'bg-white': index > currentStep }"
|
||||||
@click.prevent="isCompleted ? '' : [saveStep(), goToStep(index, true)]"
|
@click.prevent="isCompleted ? '' : [saveStep(), goToStep(index, true)]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -1191,22 +1191,24 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const defaultValue = !field || isEmpty(field.default_value) ? null : field.default_value
|
||||||
|
|
||||||
if (['empty', 'unchecked'].includes(condition.action)) {
|
if (['empty', 'unchecked'].includes(condition.action)) {
|
||||||
return isEmpty(this.values[condition.field_uuid])
|
return isEmpty(this.values[condition.field_uuid] ?? defaultValue)
|
||||||
} else if (['not_empty', 'checked'].includes(condition.action)) {
|
} else if (['not_empty', 'checked'].includes(condition.action)) {
|
||||||
return !isEmpty(this.values[condition.field_uuid])
|
return !isEmpty(this.values[condition.field_uuid] ?? defaultValue)
|
||||||
} else if (['equal', 'contains'].includes(condition.action) && field) {
|
} else if (['equal', 'contains'].includes(condition.action) && field) {
|
||||||
if (field.options) {
|
if (field.options) {
|
||||||
const option = field.options.find((o) => o.uuid === condition.value)
|
const option = field.options.find((o) => o.uuid === condition.value)
|
||||||
const values = [this.values[condition.field_uuid]].flat()
|
const values = [this.values[condition.field_uuid] ?? defaultValue].flat()
|
||||||
|
|
||||||
return values.includes(this.optionValue(option, field.options.indexOf(option)))
|
return values.includes(this.optionValue(option, field.options.indexOf(option)))
|
||||||
} else {
|
} else {
|
||||||
return [this.values[condition.field_uuid]].flat().includes(condition.value)
|
return [this.values[condition.field_uuid] ?? defaultValue].flat().includes(condition.value)
|
||||||
}
|
}
|
||||||
} else if (['not_equal', 'does_not_contain'].includes(condition.action) && field) {
|
} else if (['not_equal', 'does_not_contain'].includes(condition.action) && field) {
|
||||||
const option = field.options.find((o) => o.uuid === condition.value)
|
const option = field.options.find((o) => o.uuid === condition.value)
|
||||||
const values = [this.values[condition.field_uuid]].flat()
|
const values = [this.values[condition.field_uuid] ?? defaultValue].flat()
|
||||||
|
|
||||||
return !values.includes(this.optionValue(option, field.options.indexOf(option)))
|
return !values.includes(this.optionValue(option, field.options.indexOf(option)))
|
||||||
} else {
|
} else {
|
||||||
@@ -1299,7 +1301,9 @@ export default {
|
|||||||
|
|
||||||
if (!this.isCompleted) {
|
if (!this.isCompleted) {
|
||||||
if (scrollToArea) {
|
if (scrollToArea) {
|
||||||
this.scrollIntoField(this.currentField)
|
this.$nextTick(() => {
|
||||||
|
setTimeout(() => this.scrollIntoField(this.currentField), 1)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.enableScrollIntoField = false
|
this.enableScrollIntoField = false
|
||||||
@@ -1316,7 +1320,7 @@ export default {
|
|||||||
const currentFieldUuids = this.currentStepFields.map((f) => f.uuid)
|
const currentFieldUuids = this.currentStepFields.map((f) => f.uuid)
|
||||||
const currentFieldType = this.currentField.type
|
const currentFieldType = this.currentField.type
|
||||||
|
|
||||||
if (!formData && !this.$refs.form.checkValidity()) {
|
if (!formData && !this.$refs.form.checkValidity() && currentFieldUuids.every((fieldUuid) => isEmpty(this.submittedValues[fieldUuid]) || !isEmpty(this.values[fieldUuid]))) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<label
|
<label
|
||||||
v-if="showFieldNames"
|
v-if="showFieldNames"
|
||||||
:for="field.uuid"
|
:for="field.uuid"
|
||||||
class="label text-xl sm:text-2xl py-0"
|
class="label text-xl sm:text-2xl py-0 field-name-label"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
v-if="field.title"
|
v-if="field.title"
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</label>
|
</label>
|
||||||
<button
|
<button
|
||||||
class="btn btn-outline btn-sm"
|
class="btn btn-outline btn-sm reupload-button"
|
||||||
@click.prevent="remove"
|
@click.prevent="remove"
|
||||||
>
|
>
|
||||||
<IconReload :width="16" />
|
<IconReload :width="16" />
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<img
|
<img
|
||||||
:src="attachmentsIndex[modelValue].url"
|
:src="attachmentsIndex[modelValue].url"
|
||||||
class="h-52 border border-base-300 rounded mx-auto"
|
class="h-52 border border-base-300 rounded mx-auto uploaded-image-preview"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="field.description"
|
v-if="field.description"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="field.description" />
|
<MarkdownContent :string="field.description" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
v-if="showFieldNames"
|
v-if="showFieldNames"
|
||||||
class="label text-xl sm:text-2xl py-0"
|
class="label text-xl sm:text-2xl py-0 field-name-label"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
v-if="field.title"
|
v-if="field.title"
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<a
|
<a
|
||||||
id="type_text_button"
|
id="type_text_button"
|
||||||
href="#"
|
href="#"
|
||||||
class="btn btn-outline font-medium btn-sm"
|
class="btn btn-outline font-medium btn-sm type-text-button"
|
||||||
@click.prevent="toggleTextInput"
|
@click.prevent="toggleTextInput"
|
||||||
>
|
>
|
||||||
<IconTextSize :width="16" />
|
<IconTextSize :width="16" />
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<a
|
<a
|
||||||
id="type_text_button"
|
id="type_text_button"
|
||||||
href="#"
|
href="#"
|
||||||
class="btn btn-outline font-medium btn-sm"
|
class="btn btn-outline font-medium btn-sm type-text-button"
|
||||||
@click.prevent="toggleTextInput"
|
@click.prevent="toggleTextInput"
|
||||||
>
|
>
|
||||||
<IconSignature :width="16" />
|
<IconSignature :width="16" />
|
||||||
@@ -55,9 +55,7 @@
|
|||||||
class="tooltip"
|
class="tooltip"
|
||||||
:data-tip="t('click_to_upload')"
|
:data-tip="t('click_to_upload')"
|
||||||
>
|
>
|
||||||
<label
|
<label class="btn btn-outline btn-sm font-medium inline-flex flex-nowrap upload-image-button">
|
||||||
class="btn btn-outline btn-sm font-medium inline-flex flex-nowrap"
|
|
||||||
>
|
|
||||||
<IconUpload :width="16" />
|
<IconUpload :width="16" />
|
||||||
<input
|
<input
|
||||||
:key="uploadImageInputKey"
|
:key="uploadImageInputKey"
|
||||||
@@ -74,7 +72,7 @@
|
|||||||
<a
|
<a
|
||||||
v-if="modelValue || computedPreviousValue"
|
v-if="modelValue || computedPreviousValue"
|
||||||
href="#"
|
href="#"
|
||||||
class="btn font-medium btn-outline btn-sm"
|
class="btn font-medium btn-outline btn-sm clear-canvas-button"
|
||||||
@click.prevent="remove"
|
@click.prevent="remove"
|
||||||
>
|
>
|
||||||
<IconReload :width="16" />
|
<IconReload :width="16" />
|
||||||
@@ -83,7 +81,7 @@
|
|||||||
<a
|
<a
|
||||||
v-else
|
v-else
|
||||||
href="#"
|
href="#"
|
||||||
class="btn font-medium btn-outline btn-sm"
|
class="btn font-medium btn-outline btn-sm clear-canvas-button"
|
||||||
@click.prevent="clear"
|
@click.prevent="clear"
|
||||||
>
|
>
|
||||||
<IconReload :width="16" />
|
<IconReload :width="16" />
|
||||||
@@ -105,7 +103,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="field.description"
|
v-if="field.description"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="field.description" />
|
<MarkdownContent :string="field.description" />
|
||||||
</div>
|
</div>
|
||||||
@@ -123,7 +121,7 @@
|
|||||||
<canvas
|
<canvas
|
||||||
v-show="!modelValue && !computedPreviousValue"
|
v-show="!modelValue && !computedPreviousValue"
|
||||||
ref="canvas"
|
ref="canvas"
|
||||||
class="bg-white border border-base-300 rounded-2xl w-full"
|
class="bg-white border border-base-300 rounded-2xl w-full draw-canvas"
|
||||||
/>
|
/>
|
||||||
<input
|
<input
|
||||||
v-if="!isDrawInitials && !modelValue && !computedPreviousValue"
|
v-if="!isDrawInitials && !modelValue && !computedPreviousValue"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
v-if="showFieldNames && (field.name || field.title)"
|
v-if="showFieldNames && (field.name || field.title)"
|
||||||
:for="field.uuid"
|
:for="field.uuid"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5"
|
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5 field-name-label"
|
||||||
:class="{ 'mb-2': !field.description }"
|
:class="{ 'mb-2': !field.description }"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="field.description"
|
v-if="field.description"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="field.description" />
|
<MarkdownContent :string="field.description" />
|
||||||
</div>
|
</div>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
:for="option.uuid"
|
:for="option.uuid"
|
||||||
class="flex items-center space-x-3"
|
class="flex items-center space-x-3 checkbox-label"
|
||||||
@click="scrollIntoField(field)"
|
@click="scrollIntoField(field)"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
v-if="showFieldNames && (field.name || field.title)"
|
v-if="showFieldNames && (field.name || field.title)"
|
||||||
:for="field.uuid"
|
:for="field.uuid"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5"
|
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5 field-name-label"
|
||||||
:class="{ 'mb-2': !field.description }"
|
:class="{ 'mb-2': !field.description }"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="field.description"
|
v-if="field.description"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="field.description" />
|
<MarkdownContent :string="field.description" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<label
|
<label
|
||||||
v-if="!modelValue && !sessionId"
|
v-if="!modelValue && !sessionId"
|
||||||
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5"
|
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5 field-name-label"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
v-if="field.title"
|
v-if="field.title"
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<button
|
<button
|
||||||
v-if="sessionId"
|
v-if="sessionId"
|
||||||
disabled
|
disabled
|
||||||
class="base-button w-full"
|
class="base-button w-full modal-save-button"
|
||||||
>
|
>
|
||||||
<IconLoader
|
<IconLoader
|
||||||
width="22"
|
width="22"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<label
|
<label
|
||||||
v-if="showFieldNames"
|
v-if="showFieldNames"
|
||||||
:for="isCodeSent ? 'one_time_code' : field.uuid"
|
:for="isCodeSent ? 'one_time_code' : field.uuid"
|
||||||
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5"
|
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5 field-name-label"
|
||||||
:class="{ 'mb-2': !field.description }"
|
:class="{ 'mb-2': !field.description }"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="field.description"
|
v-if="field.description"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="field.description" />
|
<MarkdownContent :string="field.description" />
|
||||||
</div>
|
</div>
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<a
|
<a
|
||||||
v-if="!defaultValue"
|
v-if="!defaultValue"
|
||||||
href="#"
|
href="#"
|
||||||
class="link"
|
class="link change-phone-number-link"
|
||||||
@click.prevent="isCodeSent = false"
|
@click.prevent="isCodeSent = false"
|
||||||
>
|
>
|
||||||
{{ t('change_phone_number') }}
|
{{ t('change_phone_number') }}
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
<a
|
<a
|
||||||
v-else
|
v-else
|
||||||
href="#"
|
href="#"
|
||||||
class="link"
|
class="link resend-code-link"
|
||||||
@click.prevent="resendCode"
|
@click.prevent="resendCode"
|
||||||
>
|
>
|
||||||
{{ isResendLoading ? t('sending') : t('resend_code') }}
|
{{ isResendLoading ? t('sending') : t('resend_code') }}
|
||||||
@@ -68,13 +68,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-show="!isCodeSent"
|
v-show="!isCodeSent"
|
||||||
class="flex w-full rounded-full outline-neutral-content outline-2 outline-offset-2 focus-within:outline"
|
class="flex w-full rounded-full outline-neutral-content outline-2 outline-offset-2 focus-within:outline phone-number-input-container"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
id="country_code"
|
id="country_code"
|
||||||
class="relative inline-block"
|
class="relative inline-block"
|
||||||
>
|
>
|
||||||
<div class="btn bg-base-200 border border-neutral-300 text-2xl whitespace-nowrap font-normal rounded-l-full">
|
<div class="btn bg-base-200 border border-neutral-300 text-2xl whitespace-nowrap font-normal rounded-l-full country-code-select-label">
|
||||||
{{ selectedCountry.flag }} +{{ selectedCountry.dial }}
|
{{ selectedCountry.flag }} +{{ selectedCountry.dial }}
|
||||||
</div>
|
</div>
|
||||||
<select
|
<select
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
v-if="showFieldNames"
|
v-if="showFieldNames"
|
||||||
class="label text-xl sm:text-2xl py-0"
|
class="label text-xl sm:text-2xl py-0 field-name-label"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
v-if="field.title"
|
v-if="field.title"
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
<a
|
<a
|
||||||
id="type_text_button"
|
id="type_text_button"
|
||||||
href="#"
|
href="#"
|
||||||
class="btn btn-outline btn-sm font-medium"
|
class="btn btn-outline btn-sm font-medium type-text-button"
|
||||||
@click.prevent="[toggleTextInput(), hideQr()]"
|
@click.prevent="[toggleTextInput(), hideQr()]"
|
||||||
>
|
>
|
||||||
<IconSignature :width="16" />
|
<IconSignature :width="16" />
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<a
|
<a
|
||||||
id="type_text_button"
|
id="type_text_button"
|
||||||
href="#"
|
href="#"
|
||||||
class="btn btn-outline btn-sm font-medium inline-flex flex-nowrap"
|
class="btn btn-outline btn-sm font-medium inline-flex flex-nowrap type-text-button"
|
||||||
@click.prevent="[toggleTextInput(), hideQr()]"
|
@click.prevent="[toggleTextInput(), hideQr()]"
|
||||||
>
|
>
|
||||||
<IconTextSize :width="16" />
|
<IconTextSize :width="16" />
|
||||||
@@ -61,9 +61,7 @@
|
|||||||
:class="{ 'hidden sm:inline': modelValue || computedPreviousValue }"
|
:class="{ 'hidden sm:inline': modelValue || computedPreviousValue }"
|
||||||
:data-tip="t('take_photo')"
|
:data-tip="t('take_photo')"
|
||||||
>
|
>
|
||||||
<label
|
<label class="btn btn-outline btn-sm font-medium inline-flex flex-nowrap upload-image-button">
|
||||||
class="btn btn-outline btn-sm font-medium inline-flex flex-nowrap"
|
|
||||||
>
|
|
||||||
<IconCamera :width="16" />
|
<IconCamera :width="16" />
|
||||||
<input
|
<input
|
||||||
:key="uploadImageInputKey"
|
:key="uploadImageInputKey"
|
||||||
@@ -80,7 +78,7 @@
|
|||||||
<a
|
<a
|
||||||
v-if="modelValue || computedPreviousValue"
|
v-if="modelValue || computedPreviousValue"
|
||||||
href="#"
|
href="#"
|
||||||
class="btn btn-outline btn-sm font-medium"
|
class="btn btn-outline btn-sm font-medium reupload-button"
|
||||||
@click.prevent="remove"
|
@click.prevent="remove"
|
||||||
>
|
>
|
||||||
<IconReload :width="16" />
|
<IconReload :width="16" />
|
||||||
@@ -119,7 +117,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="field.description"
|
v-if="field.description"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="field.description" />
|
<MarkdownContent :string="field.description" />
|
||||||
</div>
|
</div>
|
||||||
@@ -167,7 +165,7 @@
|
|||||||
v-show="!modelValue && !computedPreviousValue"
|
v-show="!modelValue && !computedPreviousValue"
|
||||||
ref="canvas"
|
ref="canvas"
|
||||||
style="padding: 1px; 0"
|
style="padding: 1px; 0"
|
||||||
class="bg-white border border-base-300 rounded-2xl w-full"
|
class="bg-white border border-base-300 rounded-2xl w-full draw-canvas"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-if="isShowQr"
|
v-if="isShowQr"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
v-if="showFieldNames && (field.name || field.title)"
|
v-if="showFieldNames && (field.name || field.title)"
|
||||||
:for="field.uuid"
|
:for="field.uuid"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5"
|
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5 field-name-label"
|
||||||
:class="{ 'mb-2': !field.description }"
|
:class="{ 'mb-2': !field.description }"
|
||||||
>
|
>
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="field.description"
|
v-if="field.description"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-3 px-1"
|
class="mb-3 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="field.description" />
|
<MarkdownContent :string="field.description" />
|
||||||
</div>
|
</div>
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
class="btn btn-ghost btn-circle btn-sm"
|
class="btn btn-ghost btn-circle btn-sm toggle-multiline-text-button"
|
||||||
@click.prevent="toggleTextArea"
|
@click.prevent="toggleTextArea"
|
||||||
>
|
>
|
||||||
<IconAlignBoxLeftTop />
|
<IconAlignBoxLeftTop />
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<label
|
<label class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5 field-name-label">
|
||||||
class="label text-xl sm:text-2xl py-0 mb-2 sm:mb-3.5"
|
|
||||||
>
|
|
||||||
<MarkdownContent
|
<MarkdownContent
|
||||||
v-if="field.title"
|
v-if="field.title"
|
||||||
:string="field.title"
|
:string="field.title"
|
||||||
@@ -11,13 +9,13 @@
|
|||||||
<div
|
<div
|
||||||
v-if="field.description"
|
v-if="field.description"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
class="mb-4 px-1"
|
class="mb-4 px-1 field-description-text"
|
||||||
>
|
>
|
||||||
<MarkdownContent :string="field.description" />
|
<MarkdownContent :string="field.description" />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="emptyValueRequiredStep && emptyValueRequiredStep[0] !== field"
|
v-if="emptyValueRequiredStep && emptyValueRequiredStep[0] !== field"
|
||||||
class="px-1"
|
class="px-1 field-description-text"
|
||||||
>
|
>
|
||||||
{{ t('complete_all_required_fields_to_proceed_with_identity_verification') }}
|
{{ t('complete_all_required_fields_to_proceed_with_identity_verification') }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="absolute overflow-visible group"
|
class="absolute overflow-visible group field-area-container"
|
||||||
:style="positionStyle"
|
:style="positionStyle"
|
||||||
:class="{ 'z-[1]': isMoved || isDragged }"
|
:class="{ 'z-[1]': isMoved || isDragged }"
|
||||||
@pointerdown.stop
|
@pointerdown.stop
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="field?.type && (isSelected || isNameFocus)"
|
v-if="field?.type && (isSelected || isNameFocus)"
|
||||||
class="absolute bg-white rounded-t border overflow-visible whitespace-nowrap flex z-10"
|
class="absolute bg-white rounded-t border overflow-visible whitespace-nowrap flex z-10 field-area-controls"
|
||||||
style="top: -25px; height: 25px"
|
style="top: -25px; height: 25px"
|
||||||
@mousedown.stop
|
@mousedown.stop
|
||||||
@pointerdown.stop
|
@pointerdown.stop
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
<FieldSubmitter
|
<FieldSubmitter
|
||||||
v-if="field.type != 'heading'"
|
v-if="field.type != 'heading'"
|
||||||
v-model="field.submitter_uuid"
|
v-model="field.submitter_uuid"
|
||||||
class="border-r"
|
class="border-r roles-dropdown"
|
||||||
:compact="true"
|
:compact="true"
|
||||||
:editable="editable && (!defaultField || defaultField.role !== submitter?.name)"
|
:editable="editable && (!defaultField || defaultField.role !== submitter?.name)"
|
||||||
:allow-add-new="!defaultSubmitters.length"
|
:allow-add-new="!defaultSubmitters.length"
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
>{{ t('editable') }}</label>
|
>{{ t('editable') }}</label>
|
||||||
<span
|
<span
|
||||||
v-if="field.type !== 'payment' && !isValueInput"
|
v-if="field.type !== 'payment' && !isValueInput"
|
||||||
class="dropdown dropdown-end"
|
class="dropdown dropdown-end field-area-settings-dropdown"
|
||||||
@mouseenter="renderDropdown = true"
|
@mouseenter="renderDropdown = true"
|
||||||
@touchstart="renderDropdown = true"
|
@touchstart="renderDropdown = true"
|
||||||
>
|
>
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
ref="touchValueTarget"
|
ref="touchValueTarget"
|
||||||
class="flex items-center h-full w-full"
|
class="flex items-center h-full w-full field-area"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
:class="[isValueInput ? 'bg-opacity-50' : 'bg-opacity-80', field.type === 'heading' ? 'bg-gray-50' : bgColors[submitterIndex % bgColors.length], isDefaultValuePresent || isValueInput || (withFieldPlaceholder && field.areas) ? fontClasses : 'justify-center']"
|
:class="[isValueInput ? 'bg-opacity-50' : 'bg-opacity-80', field.type === 'heading' ? 'bg-gray-50' : bgColors[submitterIndex % bgColors.length], isDefaultValuePresent || isValueInput || (withFieldPlaceholder && field.areas) ? fontClasses : 'justify-center']"
|
||||||
@click="focusValueInput"
|
@click="focusValueInput"
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="$slots.buttons || withTitle"
|
v-if="$slots.buttons || withTitle"
|
||||||
id="title_container"
|
id="title_container"
|
||||||
class="flex justify-between py-1.5 items-center pr-4 top-0 z-10"
|
class="flex justify-between py-1.5 items-center pr-4 top-0 z-10 title-container"
|
||||||
:class="{ sticky: withStickySubmitters || isBreakpointLg }"
|
:class="{ sticky: withStickySubmitters || isBreakpointLg }"
|
||||||
:style="{ backgroundColor }"
|
:style="{ backgroundColor }"
|
||||||
>
|
>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
v-if="withTitle"
|
v-if="withTitle"
|
||||||
:model-value="template.name"
|
:model-value="template.name"
|
||||||
:editable="editable"
|
:editable="editable"
|
||||||
class="text-xl md:text-3xl font-semibold focus:text-clip"
|
class="text-xl md:text-3xl font-semibold focus:text-clip template-name"
|
||||||
:icon-stroke-width="2.3"
|
:icon-stroke-width="2.3"
|
||||||
@update:model-value="updateName"
|
@update:model-value="updateName"
|
||||||
/>
|
/>
|
||||||
@@ -163,7 +163,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
id="main_container"
|
id="main_container"
|
||||||
class="flex"
|
class="flex main-container"
|
||||||
:class="$slots.buttons || withTitle ? (isMobile ? 'max-h-[calc(100%_-_60px)]' : 'md:max-h-[calc(100%_-_60px)]') : (isMobile ? 'max-h-[100%]' : 'md:max-h-[100%]')"
|
:class="$slots.buttons || withTitle ? (isMobile ? 'max-h-[calc(100%_-_60px)]' : 'md:max-h-[calc(100%_-_60px)]') : (isMobile ? 'max-h-[100%]' : 'md:max-h-[100%]')"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -205,7 +205,7 @@
|
|||||||
<button
|
<button
|
||||||
v-if="sortedDocuments.length && editable && withAddPageButton"
|
v-if="sortedDocuments.length && editable && withAddPageButton"
|
||||||
id="add_blank_page_button"
|
id="add_blank_page_button"
|
||||||
class="btn btn-outline w-full"
|
class="btn btn-outline w-full add-blank-page-button"
|
||||||
@click.prevent="addBlankPage"
|
@click.prevent="addBlankPage"
|
||||||
>
|
>
|
||||||
<IconInnerShadowTop
|
<IconInnerShadowTop
|
||||||
@@ -239,7 +239,7 @@
|
|||||||
<button
|
<button
|
||||||
v-if="withAddPageButton"
|
v-if="withAddPageButton"
|
||||||
id="add_blank_page_button"
|
id="add_blank_page_button"
|
||||||
class="btn btn-outline w-full mt-4"
|
class="btn btn-outline w-full mt-4 add-blank-page-button"
|
||||||
@click.prevent="addBlankPage"
|
@click.prevent="addBlankPage"
|
||||||
>
|
>
|
||||||
<IconInnerShadowTop
|
<IconInnerShadowTop
|
||||||
@@ -266,7 +266,7 @@
|
|||||||
:is-drag="!!dragField"
|
:is-drag="!!dragField"
|
||||||
:input-mode="inputMode"
|
:input-mode="inputMode"
|
||||||
:default-fields="[...defaultRequiredFields, ...defaultFields]"
|
:default-fields="[...defaultRequiredFields, ...defaultFields]"
|
||||||
:allow-draw="!onlyDefinedFields"
|
:allow-draw="!onlyDefinedFields || drawField"
|
||||||
:data-document-uuid="document.uuid"
|
:data-document-uuid="document.uuid"
|
||||||
:default-submitters="defaultSubmitters"
|
:default-submitters="defaultSubmitters"
|
||||||
:with-field-placeholder="withFieldPlaceholder"
|
:with-field-placeholder="withFieldPlaceholder"
|
||||||
@@ -307,7 +307,7 @@
|
|||||||
<button
|
<button
|
||||||
v-if="withAddPageButton"
|
v-if="withAddPageButton"
|
||||||
id="add_blank_page_button"
|
id="add_blank_page_button"
|
||||||
class="btn btn-outline w-full mt-4"
|
class="btn btn-outline w-full mt-4 add-blank-page-button"
|
||||||
@click.prevent="addBlankPage"
|
@click.prevent="addBlankPage"
|
||||||
>
|
>
|
||||||
<IconInnerShadowTop
|
<IconInnerShadowTop
|
||||||
@@ -327,7 +327,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="withFieldsList && !isMobile"
|
v-if="withFieldsList && !isMobile"
|
||||||
id="fields_list_container"
|
id="fields_list_container"
|
||||||
class="relative w-80 flex-none mt-1 pr-4 pl-0.5 hidden md:block"
|
class="relative w-80 flex-none mt-1 pr-4 pl-0.5 hidden md:block fields-list-container"
|
||||||
:class="drawField ? 'overflow-hidden' : 'overflow-y-auto overflow-x-hidden'"
|
:class="drawField ? 'overflow-hidden' : 'overflow-y-auto overflow-x-hidden'"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -335,13 +335,13 @@
|
|||||||
class="sticky inset-0 h-full z-20"
|
class="sticky inset-0 h-full z-20"
|
||||||
:style="{ backgroundColor }"
|
:style="{ backgroundColor }"
|
||||||
>
|
>
|
||||||
<div class="bg-base-200 rounded-lg p-5 text-center space-y-4">
|
<div class="bg-base-200 rounded-lg p-5 text-center space-y-4 draw-field-container">
|
||||||
<p>
|
<p>
|
||||||
{{ t('draw_field_on_the_document') }}
|
{{ t('draw_field_on_the_document') }}
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="base-button"
|
class="base-button cancel-draw-button"
|
||||||
@click="clearDrawField"
|
@click="clearDrawField"
|
||||||
>
|
>
|
||||||
{{ t('cancel') }}
|
{{ t('cancel') }}
|
||||||
@@ -408,7 +408,10 @@
|
|||||||
@select="startFieldDraw($event)"
|
@select="startFieldDraw($event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div id="docuseal_modal_container" />
|
<div
|
||||||
|
id="docuseal_modal_container"
|
||||||
|
class="modal-container"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
/>
|
/>
|
||||||
<div class="modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl">
|
<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">
|
<div class="flex justify-between items-center border-b pb-2 mb-2 font-medium">
|
||||||
<span>
|
<span class="modal-title">
|
||||||
{{ t('condition') }} - {{ item.name || buildDefaultName(item, template.fields) }}
|
{{ t('condition') }} - {{ item.name || buildDefaultName(item, template.fields) }}
|
||||||
</span>
|
</span>
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
class="text-xl"
|
class="text-xl modal-close-button"
|
||||||
@click.prevent="$emit('close')"
|
@click.prevent="$emit('close')"
|
||||||
>×</a>
|
>×</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,9 +50,9 @@
|
|||||||
v-if="conditions.length > 1"
|
v-if="conditions.length > 1"
|
||||||
class="flex justify-between mx-1"
|
class="flex justify-between mx-1"
|
||||||
>
|
>
|
||||||
<span class="text-sm">
|
<label class="text-sm">
|
||||||
{{ t('condition') }} {{ cindex + 1 }}
|
{{ t('condition') }} {{ cindex + 1 }}
|
||||||
</span>
|
</label>
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
class="link text-sm"
|
class="link text-sm"
|
||||||
@@ -131,9 +131,7 @@
|
|||||||
class="inline float-right link text-right mb-3 px-2"
|
class="inline float-right link text-right mb-3 px-2"
|
||||||
@click.prevent="conditions.push({})"
|
@click.prevent="conditions.push({})"
|
||||||
> + {{ t('add_condition') }}</a>
|
> + {{ t('add_condition') }}</a>
|
||||||
<button
|
<button class="base-button w-full mt-2 modal-save-button">
|
||||||
class="base-button w-full mt-2"
|
|
||||||
>
|
|
||||||
{{ t('save') }}
|
{{ t('save') }}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<Contenteditable
|
<Contenteditable
|
||||||
class="w-full block mr-6"
|
class="w-full block mr-6 document-preview-name"
|
||||||
:model-value="item.name"
|
:model-value="item.name"
|
||||||
:icon-width="16"
|
:icon-width="16"
|
||||||
@update:model-value="onUpdateName"
|
@update:model-value="onUpdateName"
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
v-if="withArrows"
|
v-if="withArrows"
|
||||||
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"
|
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"
|
||||||
style="width: 24px; height: 24px"
|
style="width: 24px; height: 24px"
|
||||||
@click.stop="$emit('up', item)"
|
@click.stop="$emit('up', item)"
|
||||||
>
|
>
|
||||||
@@ -23,14 +23,14 @@
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="withArrows"
|
v-if="withArrows"
|
||||||
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"
|
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"
|
||||||
style="width: 24px; height: 24px"
|
style="width: 24px; height: 24px"
|
||||||
@click.stop="$emit('down', item)"
|
@click.stop="$emit('down', item)"
|
||||||
>
|
>
|
||||||
↓
|
↓
|
||||||
</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"
|
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"
|
||||||
style="width: 24px; height: 24px"
|
style="width: 24px; height: 24px"
|
||||||
@click.stop="$emit('remove', item)"
|
@click.stop="$emit('remove', item)"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
/>
|
/>
|
||||||
<div class="modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl">
|
<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">
|
<div class="flex justify-between items-center border-b pb-2 mb-2 font-medium">
|
||||||
<span>
|
<span class="modal-title">
|
||||||
{{ field.name || buildDefaultName(field, template.fields) }}
|
{{ field.name || buildDefaultName(field, template.fields) }}
|
||||||
</span>
|
</span>
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
class="text-xl"
|
class="text-xl modal-close-button"
|
||||||
@click.prevent="$emit('close')"
|
@click.prevent="$emit('close')"
|
||||||
>×</a>
|
>×</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -55,9 +55,7 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button class="base-button w-full mt-4 modal-save-button">
|
||||||
class="base-button w-full mt-4"
|
|
||||||
>
|
|
||||||
{{ t('save') }}
|
{{ t('save') }}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
class="list-field group mb-2"
|
class="list-field group mb-2"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="border border-base-300 rounded rounded-tr-none relative group"
|
class="border border-base-300 rounded rounded-tr-none relative group fields-list-item"
|
||||||
:style="{ backgroundColor: backgroundColor }"
|
:style="{ backgroundColor: backgroundColor }"
|
||||||
>
|
>
|
||||||
<div class="flex items-center justify-between relative group/contenteditable-container">
|
<div class="flex items-center justify-between relative group/contenteditable-container">
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
v-else-if="field.type !== 'heading'"
|
v-else-if="field.type !== 'heading'"
|
||||||
class="dropdown dropdown-end"
|
class="dropdown dropdown-end field-settings-dropdown"
|
||||||
@mouseenter="renderDropdown = true"
|
@mouseenter="renderDropdown = true"
|
||||||
@touchstart="renderDropdown = true"
|
@touchstart="renderDropdown = true"
|
||||||
>
|
>
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
class="relative text-transparent group-hover:text-base-content pr-1"
|
class="relative text-transparent group-hover:text-base-content pr-1 field-remove-button"
|
||||||
:title="t('remove')"
|
:title="t('remove')"
|
||||||
@click="$emit('remove', field)"
|
@click="$emit('remove', field)"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="['number', 'cells'].includes(field.type)"
|
v-if="['cells'].includes(field.type)"
|
||||||
class="py-1.5 px-1 relative"
|
class="py-1.5 px-1 relative"
|
||||||
@click.stop
|
@click.stop
|
||||||
>
|
>
|
||||||
@@ -330,7 +330,7 @@
|
|||||||
v-if="field.type != 'stamp'"
|
v-if="field.type != 'stamp'"
|
||||||
class="pb-0.5 mt-0.5"
|
class="pb-0.5 mt-0.5"
|
||||||
>
|
>
|
||||||
<li v-if="field.type == 'text'">
|
<li v-if="['text', 'number', 'date'].includes(field.type)">
|
||||||
<label
|
<label
|
||||||
class="label-text cursor-pointer text-center w-full flex items-center"
|
class="label-text cursor-pointer text-center w-full flex items-center"
|
||||||
@click="$emit('click-font')"
|
@click="$emit('click-font')"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
@touchstart="renderDropdown = true"
|
@touchstart="renderDropdown = true"
|
||||||
>
|
>
|
||||||
<div class="flex space-x-2 items-end">
|
<div class="flex space-x-2 items-end">
|
||||||
<div class="group/contenteditable-container bg-base-100 rounded-md p-2 border border-base-300 w-full flex justify-between items-end">
|
<div class="group/contenteditable-container bg-base-100 rounded-md p-2 border border-base-300 w-full flex justify-between items-end roles-dropdown-label-mobile">
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<span
|
<span
|
||||||
class="w-3 h-3 flex-shrink-0 rounded-full"
|
class="w-3 h-3 flex-shrink-0 rounded-full"
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown dropdown-top dropdown-end">
|
<div class="dropdown dropdown-top dropdown-end roles-dropdown-mobile">
|
||||||
<label
|
<label
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
class="bg-base-100 cursor-pointer rounded-md p-2 border border-base-300 w-full flex justify-center"
|
class="bg-base-100 cursor-pointer rounded-md p-2 border border-base-300 w-full flex justify-center"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<span
|
<span
|
||||||
class="dropdown"
|
class="dropdown field-types-dropdown"
|
||||||
@mouseenter="renderDropdown = true"
|
@mouseenter="renderDropdown = true"
|
||||||
@touchstart="renderDropdown = true"
|
@touchstart="renderDropdown = true"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div :class="withStickySubmitters ? 'sticky top-0 z-[1]' : ''">
|
<div :class="withStickySubmitters ? 'sticky top-0 z-[1]' : ''">
|
||||||
<FieldSubmitter
|
<FieldSubmitter
|
||||||
:model-value="selectedSubmitter.uuid"
|
:model-value="selectedSubmitter.uuid"
|
||||||
class="roles-dropdown w-full rounded-lg"
|
class="roles-dropdown w-full rounded-lg roles-dropdown"
|
||||||
:style="withStickySubmitters ? { backgroundColor } : {}"
|
:style="withStickySubmitters ? { backgroundColor } : {}"
|
||||||
:submitters="submitters"
|
:submitters="submitters"
|
||||||
:menu-style="{ overflow: 'auto', display: 'flex', flexDirection: 'row', maxHeight: 'calc(100vh - 120px)', backgroundColor: ['', null, 'transparent'].includes(backgroundColor) ? 'white' : backgroundColor }"
|
:menu-style="{ overflow: 'auto', display: 'flex', flexDirection: 'row', maxHeight: 'calc(100vh - 120px)', backgroundColor: ['', null, 'transparent'].includes(backgroundColor) ? 'white' : backgroundColor }"
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<div
|
<div
|
||||||
:style="{ backgroundColor }"
|
:style="{ backgroundColor }"
|
||||||
draggable="true"
|
draggable="true"
|
||||||
class="default-field border border-base-300 rounded rounded-tr-none relative group mb-2"
|
class="border border-base-300 rounded rounded-tr-none relative group mb-2 default-field fields-list-item"
|
||||||
@dragstart="onDragstart({ type: 'text', ...field })"
|
@dragstart="onDragstart({ type: 'text', ...field })"
|
||||||
@dragend="$emit('drag-end')"
|
@dragend="$emit('drag-end')"
|
||||||
>
|
>
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="editable && !onlyDefinedFields"
|
v-if="editable && !onlyDefinedFields"
|
||||||
class="grid grid-cols-3 gap-1 pb-2"
|
class="grid grid-cols-3 gap-1 pb-2 fields-grid"
|
||||||
>
|
>
|
||||||
<template
|
<template
|
||||||
v-for="(icon, type) in fieldIconsSorted"
|
v-for="(icon, type) in fieldIconsSorted"
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
<button
|
<button
|
||||||
v-if="(fieldTypes.length === 0 || fieldTypes.includes(type)) && (withPhone || type != 'phone') && (withPayment || type != 'payment') && (withVerification || type != 'verification')"
|
v-if="(fieldTypes.length === 0 || fieldTypes.includes(type)) && (withPhone || type != 'phone') && (withPayment || type != 'payment') && (withVerification || type != 'verification')"
|
||||||
draggable="true"
|
draggable="true"
|
||||||
class="field-type-button group flex items-center justify-center border border-dashed w-full rounded relative"
|
class="field-type-button group flex items-center justify-center border border-dashed w-full rounded relative fields-grid-item"
|
||||||
:style="{ backgroundColor }"
|
:style="{ backgroundColor }"
|
||||||
: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({ type: type })"
|
@dragstart="onDragstart({ type: type })"
|
||||||
@@ -142,7 +142,7 @@
|
|||||||
<a
|
<a
|
||||||
href="https://www.docuseal.com/pricing"
|
href="https://www.docuseal.com/pricing"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="opacity-50 flex items-center justify-center border border-dashed border-base-300 w-full rounded relative"
|
class="opacity-50 flex items-center justify-center border border-dashed border-base-300 w-full rounded relative fields-grid-item"
|
||||||
:style="{ backgroundColor }"
|
:style="{ backgroundColor }"
|
||||||
>
|
>
|
||||||
<div class="w-0 absolute left-0">
|
<div class="w-0 absolute left-0">
|
||||||
@@ -168,7 +168,7 @@
|
|||||||
<a
|
<a
|
||||||
href="https://www.docuseal.com/contact"
|
href="https://www.docuseal.com/contact"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="opacity-50 flex items-center justify-center border border-dashed border-base-300 w-full rounded relative"
|
class="opacity-50 flex items-center justify-center border border-dashed border-base-300 w-full rounded relative fields-grid-item"
|
||||||
:style="{ backgroundColor }"
|
:style="{ backgroundColor }"
|
||||||
>
|
>
|
||||||
<div class="w-0 absolute left-0">
|
<div class="w-0 absolute left-0">
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
/>
|
/>
|
||||||
<div class="modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl">
|
<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">
|
<div class="flex justify-between items-center border-b pb-2 mb-2 font-medium">
|
||||||
<span>
|
<span class="modal-title">
|
||||||
{{ t('font') }} - {{ field.name || buildDefaultName(field, template.fields) }}
|
{{ t('font') }} - {{ field.name || buildDefaultName(field, template.fields) }}
|
||||||
</span>
|
</span>
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
class="text-xl"
|
class="text-xl modal-close-button"
|
||||||
@click.prevent="$emit('close')"
|
@click.prevent="$emit('close')"
|
||||||
>×</a>
|
>×</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -21,10 +21,10 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="flex items-center space-x-1.5">
|
<div class="flex items-center space-x-1.5">
|
||||||
<span>
|
<span>
|
||||||
<div class="dropdown">
|
<div class="dropdown modal-field-font-dropdown">
|
||||||
<label
|
<label
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
class="base-input flex items-center justify-between items-center"
|
class="base-input flex items-center justify-between"
|
||||||
style="height: 32px; padding-right: 0; width: 120px"
|
style="height: 32px; padding-right: 0; width: 120px"
|
||||||
:class="fonts.find((f) => f.value === preferences.font)?.class"
|
:class="fonts.find((f) => f.value === preferences.font)?.class"
|
||||||
>
|
>
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<span
|
<span
|
||||||
class="border-l pl-1.5 absolute bg-white absolute bottom-0 pointer-events-none text-sm h-5"
|
class="border-l pl-1.5 absolute bg-white bottom-0 pointer-events-none text-sm h-5"
|
||||||
style="right: 13px; top: 7px"
|
style="right: 13px; top: 7px"
|
||||||
>
|
>
|
||||||
pt
|
pt
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<div
|
<div
|
||||||
class="flex items-center border border-base-content/20 rounded-xl bg-white px-4 h-16"
|
class="flex items-center border border-base-content/20 rounded-xl bg-white px-4 h-16 modal-field-font-preview"
|
||||||
:style="{
|
:style="{
|
||||||
color: preferences.color || 'black',
|
color: preferences.color || 'black',
|
||||||
fontSize: (preferences.font_size || 12) + 'pt',
|
fontSize: (preferences.font_size || 12) + 'pt',
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<button
|
<button
|
||||||
class="base-button w-full"
|
class="base-button w-full modal-save-button"
|
||||||
@click.prevent="saveAndClose"
|
@click.prevent="saveAndClose"
|
||||||
>
|
>
|
||||||
{{ t('save') }}
|
{{ t('save') }}
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
/>
|
/>
|
||||||
<div class="modal-box pt-4 pb-6 px-6 mt-20 max-h-none w-full max-w-xl">
|
<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">
|
<div class="flex justify-between items-center border-b pb-2 mb-2 font-medium">
|
||||||
<span>
|
<span class="modal-title">
|
||||||
{{ t('formula') }} - {{ field.name || buildDefaultName(field, template.fields) }}
|
{{ t('formula') }} - {{ field.name || buildDefaultName(field, template.fields) }}
|
||||||
</span>
|
</span>
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
class="text-xl"
|
class="text-xl modal-close-button"
|
||||||
@click.prevent="$emit('close')"
|
@click.prevent="$emit('close')"
|
||||||
>×</a>
|
>×</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="base-button w-full"
|
class="base-button w-full modal-save-button"
|
||||||
@click.prevent="validateSaveAndClose"
|
@click.prevent="validateSaveAndClose"
|
||||||
>
|
>
|
||||||
{{ t('save') }}
|
{{ t('save') }}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="absolute text-center w-full bottom-0 pr-3 mb-4">
|
<div class="absolute text-center 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">
|
<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
|
||||||
:is="fieldIcons[drawField.type]"
|
:is="fieldIcons[drawField.type]"
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<span
|
<span class="dropdown dropdown-top dropdown-end absolute bottom-4 right-4 z-10 fields-dropdown-mobile">
|
||||||
class="dropdown dropdown-top dropdown-end absolute bottom-4 right-4 z-10"
|
|
||||||
>
|
|
||||||
<label
|
<label
|
||||||
class="btn btn-neutral text-white btn-circle btn-lg group"
|
class="btn btn-neutral text-white btn-circle btn-lg group"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<span
|
<span
|
||||||
class="dropdown dropdown-end"
|
class="dropdown dropdown-end field-settings-dropdown"
|
||||||
:class="{ 'dropdown-open': ((!field.preferences?.price && !field.preferences?.formula) || !isConnected) && !isLoading }"
|
:class="{ 'dropdown-open': ((!field.preferences?.price && !field.preferences?.formula) || !isConnected) && !isLoading }"
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
|
|||||||
@@ -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"
|
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"
|
||||||
@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"
|
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"
|
||||||
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"
|
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"
|
||||||
@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"
|
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"
|
||||||
style="width: 24px; height: 24px"
|
style="width: 24px; height: 24px"
|
||||||
@click.stop="$emit('up', item)"
|
@click.stop="$emit('up', item)"
|
||||||
>
|
>
|
||||||
↑
|
↑
|
||||||
</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"
|
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"
|
||||||
style="width: 24px; height: 24px"
|
style="width: 24px; height: 24px"
|
||||||
@click.stop="$emit('down', item)"
|
@click.stop="$emit('down', item)"
|
||||||
>
|
>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex pb-2 pt-1.5">
|
<div class="flex pb-2 pt-1.5 document-preview-name">
|
||||||
<Contenteditable
|
<Contenteditable
|
||||||
:model-value="item.name"
|
:model-value="item.name"
|
||||||
:icon-width="16"
|
:icon-width="16"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<label
|
<label
|
||||||
:for="inputId"
|
:for="inputId"
|
||||||
class="btn btn-neutral btn-xs text-white transition-none"
|
class="btn btn-neutral btn-xs text-white transition-none replace-document-button"
|
||||||
:class="{ 'opacity-100': isLoading || isProcessing }"
|
:class="{ 'opacity-100': isLoading || isProcessing }"
|
||||||
>
|
>
|
||||||
{{ message }}
|
{{ message }}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<label
|
<label
|
||||||
id="add_document_button"
|
id="add_document_button"
|
||||||
:for="inputId"
|
:for="inputId"
|
||||||
class="btn btn-outline w-full"
|
class="btn btn-outline w-full add-document-button"
|
||||||
:class="{ 'btn-disabled': isLoading || isProcessing }"
|
:class="{ 'btn-disabled': isLoading || isProcessing }"
|
||||||
>
|
>
|
||||||
<IconInnerShadowTop
|
<IconInnerShadowTop
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class ProcessSubmissionExpiredJob
|
||||||
|
include Sidekiq::Job
|
||||||
|
|
||||||
|
def perform(params = {})
|
||||||
|
submission = Submission.find(params['submission_id'])
|
||||||
|
|
||||||
|
return if submission.archived_at?
|
||||||
|
return if submission.template.archived_at?
|
||||||
|
return if submission.submitters.where.not(declined_at: nil).exists?
|
||||||
|
return unless submission.submitters.exists?(completed_at: nil)
|
||||||
|
|
||||||
|
WebhookUrls.for_account_id(submission.account_id, %w[submission.expired]).each do |webhook|
|
||||||
|
SendSubmissionExpiredWebhookRequestJob.perform_async('submission_id' => submission.id,
|
||||||
|
'webhook_url_id' => webhook.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -5,7 +5,7 @@ class SendFormCompletedWebhookRequestJob
|
|||||||
|
|
||||||
sidekiq_options queue: :webhooks
|
sidekiq_options queue: :webhooks
|
||||||
|
|
||||||
MAX_ATTEMPTS = 20
|
MAX_ATTEMPTS = 12
|
||||||
|
|
||||||
def perform(params = {})
|
def perform(params = {})
|
||||||
submitter = Submitter.find(params['submitter_id'])
|
submitter = Submitter.find(params['submitter_id'])
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class SendSubmissionExpiredWebhookRequestJob
|
||||||
|
include Sidekiq::Job
|
||||||
|
|
||||||
|
sidekiq_options queue: :webhooks
|
||||||
|
|
||||||
|
MAX_ATTEMPTS = 10
|
||||||
|
|
||||||
|
def perform(params = {})
|
||||||
|
submission = Submission.find(params['submission_id'])
|
||||||
|
webhook_url = WebhookUrl.find(params['webhook_url_id'])
|
||||||
|
|
||||||
|
attempt = params['attempt'].to_i
|
||||||
|
|
||||||
|
return if webhook_url.url.blank? || webhook_url.events.exclude?('submission.expired')
|
||||||
|
|
||||||
|
resp = SendWebhookRequest.call(webhook_url, event_type: 'submission.expired',
|
||||||
|
data: Submissions::SerializeForApi.call(submission))
|
||||||
|
|
||||||
|
if (resp.nil? || resp.status.to_i >= 400) && attempt <= MAX_ATTEMPTS &&
|
||||||
|
(!Docuseal.multitenant? || submission.account.account_configs.exists?(key: :plan))
|
||||||
|
SendSubmissionExpiredWebhookRequestJob.perform_in((2**attempt).minutes, {
|
||||||
|
'submission_id' => submission.id,
|
||||||
|
'webhook_url_id' => webhook_url.id,
|
||||||
|
'attempt' => attempt + 1,
|
||||||
|
'last_status' => resp&.status.to_i
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -28,10 +28,12 @@ class WebhookUrl < ApplicationRecord
|
|||||||
form.started
|
form.started
|
||||||
form.completed
|
form.completed
|
||||||
form.declined
|
form.declined
|
||||||
|
submission.created
|
||||||
|
submission.completed
|
||||||
|
submission.expired
|
||||||
|
submission.archived
|
||||||
template.created
|
template.created
|
||||||
template.updated
|
template.updated
|
||||||
submission.created
|
|
||||||
submission.archived
|
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
belongs_to :account
|
belongs_to :account
|
||||||
|
|||||||
@@ -30,7 +30,9 @@
|
|||||||
<div dir="auto" class="form-control !mt-0">
|
<div dir="auto" class="form-control !mt-0">
|
||||||
<%= f.label :email, t('email'), class: 'label' %>
|
<%= f.label :email, t('email'), class: 'label' %>
|
||||||
<%= f.email_field :email, value: current_user&.email || params[:email] || @submitter.email, required: true, class: 'base-input', placeholder: t('provide_your_email_to_start') %>
|
<%= f.email_field :email, value: current_user&.email || params[:email] || @submitter.email, required: true, class: 'base-input', placeholder: t('provide_your_email_to_start') %>
|
||||||
<%= @error_message %>
|
<% if @error_message %>
|
||||||
|
<span class="label-text-alt text-red-400 mt-1"><%= @error_message %></span>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<toggle-submit dir="auto" class="form-control">
|
<toggle-submit dir="auto" class="form-control">
|
||||||
<%= f.button button_title(title: t('start'), disabled_with: t('starting')), class: 'base-button' %>
|
<%= f.button button_title(title: t('start'), disabled_with: t('starting')), class: 'base-button' %>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Rails.application.configure do
|
|||||||
end
|
end
|
||||||
|
|
||||||
config.active_storage.resolve_model_to_route = :rails_storage_proxy if ENV['ACTIVE_STORAGE_PUBLIC'] != 'true'
|
config.active_storage.resolve_model_to_route = :rails_storage_proxy if ENV['ACTIVE_STORAGE_PUBLIC'] != 'true'
|
||||||
config.active_storage.service_urls_expire_in = 4.hours
|
config.active_storage.service_urls_expire_in = ENV.fetch('PRESIGNED_URLS_EXPIRE_MINUTES', '240').to_i.minutes
|
||||||
|
|
||||||
# Mount Action Cable outside main process or domain.
|
# Mount Action Cable outside main process or domain.
|
||||||
# config.action_cable.mount_path = nil
|
# config.action_cable.mount_path = nil
|
||||||
|
|||||||
@@ -700,6 +700,7 @@ en: &en
|
|||||||
submission_created_via_source_html: '<b>Submission created</b> via %{source}'
|
submission_created_via_source_html: '<b>Submission created</b> via %{source}'
|
||||||
pro_user_seats_used: Pro user seats used
|
pro_user_seats_used: Pro user seats used
|
||||||
manage_plan: Manage plan
|
manage_plan: Manage plan
|
||||||
|
this_submission_has_multiple_signers_which_prevents_the_use_of_a_sharing_link_html: This submission has multiple signers, which prevents the use of a sharing link as it's unclear which signer is responsible for specific fields. To resolve this, follow this <a href="https://www.docuseal.com/resources/pre-filling-recipients" class="link font-bold" rel="noopener noreferrer nofollow" target="_blank">guide</a> to define the default signer details.
|
||||||
submission_sources:
|
submission_sources:
|
||||||
api: API
|
api: API
|
||||||
bulk: Bulk Send
|
bulk: Bulk Send
|
||||||
@@ -1426,6 +1427,7 @@ es: &es
|
|||||||
submission_created_via_source_html: '<b>Envío creado</b> a través de %{source}'
|
submission_created_via_source_html: '<b>Envío creado</b> a través de %{source}'
|
||||||
pro_user_seats_used: Plazas de usuario Pro en uso
|
pro_user_seats_used: Plazas de usuario Pro en uso
|
||||||
manage_plan: Gestionar plan
|
manage_plan: Gestionar plan
|
||||||
|
this_submission_has_multiple_signers_which_prevents_the_use_of_a_sharing_link_html: 'Este envío tiene múltiples firmantes, lo que impide el uso de un enlace para compartir, ya que no está claro qué firmante es responsable de los campos específicos. Para resolver esto, sigue esta <a href="https://www.docuseal.com/resources/pre-filling-recipients" class="link font-bold" rel="noopener noreferrer nofollow" target="_blank">guía</a> para definir los detalles predeterminados del firmante.'
|
||||||
submission_sources:
|
submission_sources:
|
||||||
api: API
|
api: API
|
||||||
bulk: Envío masivo
|
bulk: Envío masivo
|
||||||
@@ -2151,6 +2153,7 @@ it: &it
|
|||||||
submission_created_via_source_html: '<b>Invio creato</b> tramite %{source}'
|
submission_created_via_source_html: '<b>Invio creato</b> tramite %{source}'
|
||||||
pro_user_seats_used: Posti utente Pro in uso
|
pro_user_seats_used: Posti utente Pro in uso
|
||||||
manage_plan: Gestisci piano
|
manage_plan: Gestisci piano
|
||||||
|
this_submission_has_multiple_signers_which_prevents_the_use_of_a_sharing_link_html: "Questa sottomissione ha più firmatari, il che impedisce l'uso di un link di condivisione poiché non è chiaro quale firmatario sia responsabile di specifici campi. Per risolvere questo problema, segui questa <a href=\"https://www.docuseal.com/resources/pre-filling-recipients\" class=\"link font-bold\" rel=\"noopener noreferrer nofollow\" target=\"_blank\">guida</a> per definire i dettagli predefiniti del firmatario."
|
||||||
submission_sources:
|
submission_sources:
|
||||||
api: API
|
api: API
|
||||||
bulk: Invio massivo
|
bulk: Invio massivo
|
||||||
@@ -2878,6 +2881,7 @@ fr: &fr
|
|||||||
submission_created_via_source_html: '<b>Soumission créée</b> via %{source}'
|
submission_created_via_source_html: '<b>Soumission créée</b> via %{source}'
|
||||||
pro_user_seats_used: Places utilisateur Pro en cours d'utilisation
|
pro_user_seats_used: Places utilisateur Pro en cours d'utilisation
|
||||||
manage_plan: Gérer le plan
|
manage_plan: Gérer le plan
|
||||||
|
this_submission_has_multiple_signers_which_prevents_the_use_of_a_sharing_link_html: 'Cette soumission comporte plusieurs signataires, ce qui empêche l’utilisation d’un lien de partage, car il n’est pas clair quel signataire est responsable de quels champs. Pour résoudre ce problème, suivez ce <a href="https://www.docuseal.com/resources/pre-filling-recipients" class="link font-bold" rel="noopener noreferrer nofollow" target="_blank">guide</a> pour définir les détails du signataire par défaut.'
|
||||||
submission_sources:
|
submission_sources:
|
||||||
api: API
|
api: API
|
||||||
bulk: Envoi en masse
|
bulk: Envoi en masse
|
||||||
@@ -3604,6 +3608,7 @@ pt: &pt
|
|||||||
submission_created_via_source_html: '<b>Envio criado</b> via %{source}'
|
submission_created_via_source_html: '<b>Envio criado</b> via %{source}'
|
||||||
pro_user_seats_used: Lugares de usuário Pro em uso
|
pro_user_seats_used: Lugares de usuário Pro em uso
|
||||||
manage_plan: Gerenciar plano
|
manage_plan: Gerenciar plano
|
||||||
|
this_submission_has_multiple_signers_which_prevents_the_use_of_a_sharing_link_html: 'Este envio tem vários signatários, o que impede o uso de um link de compartilhamento, pois não está claro qual signatário é responsável por quais campos. Para resolver isso, siga este <a href="https://www.docuseal.com/resources/pre-filling-recipients" class="link font-bold" rel="noopener noreferrer nofollow" target="_blank">guia</a> para definir os detalhes padrão do signatário.'
|
||||||
submission_sources:
|
submission_sources:
|
||||||
api: API
|
api: API
|
||||||
bulk: Envio em massa
|
bulk: Envio em massa
|
||||||
@@ -4330,6 +4335,7 @@ de: &de
|
|||||||
submission_created_via_source_html: '<b>Übermittlung erstellt</b> über %{source}'
|
submission_created_via_source_html: '<b>Übermittlung erstellt</b> über %{source}'
|
||||||
pro_user_seats_used: Verwendete Pro-Benutzerplätze
|
pro_user_seats_used: Verwendete Pro-Benutzerplätze
|
||||||
manage_plan: Plan verwalten
|
manage_plan: Plan verwalten
|
||||||
|
this_submission_has_multiple_signers_which_prevents_the_use_of_a_sharing_link_html: 'Diese Übermittlung hat mehrere Unterzeichner, was die Nutzung eines Freigabelinks verhindert, da unklar ist, welcher Unterzeichner für welche Felder verantwortlich ist. Um dies zu lösen, folgen Sie dieser <a href="https://www.docuseal.com/resources/pre-filling-recipients" class="link font-bold" rel="noopener noreferrer nofollow" target="_blank">Anleitung</a>, um die Standarddetails des Unterzeichners festzulegen.'
|
||||||
submission_sources:
|
submission_sources:
|
||||||
api: API
|
api: API
|
||||||
bulk: Massenversand
|
bulk: Massenversand
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ module Submissions
|
|||||||
|
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
# rubocop:disable Metrics/BlockLength
|
# rubocop:disable Metrics
|
||||||
def call(template:, user:, submissions_attrs:, source:, submitters_order:, params: {})
|
def call(template:, user:, submissions_attrs:, source:, submitters_order:, params: {})
|
||||||
preferences = Submitters.normalize_preferences(user.account, user, params)
|
preferences = Submitters.normalize_preferences(user.account, user, params)
|
||||||
|
|
||||||
Array.wrap(submissions_attrs).filter_map do |attrs|
|
submissions = Array.wrap(submissions_attrs).filter_map do |attrs|
|
||||||
submission_preferences = Submitters.normalize_preferences(user.account, user, attrs)
|
submission_preferences = Submitters.normalize_preferences(user.account, user, attrs)
|
||||||
submission_preferences = preferences.merge(submission_preferences)
|
submission_preferences = preferences.merge(submission_preferences)
|
||||||
|
|
||||||
@@ -23,15 +23,33 @@ module Submissions
|
|||||||
expire_at: attrs[:expire_at],
|
expire_at: attrs[:expire_at],
|
||||||
template_submitters: [], submitters_order:)
|
template_submitters: [], submitters_order:)
|
||||||
|
|
||||||
maybe_set_template_fields(submission, attrs[:submitters])
|
template_submitters = template.submitters.deep_dup
|
||||||
|
|
||||||
attrs[:submitters].each_with_index do |submitter_attrs, index|
|
attrs[:submitters].each_with_index do |submitter_attrs, index|
|
||||||
uuid = find_submitter_uuid(template, submitter_attrs, index)
|
if submitter_attrs[:roles].present? && submitter_attrs[:roles].size > 1
|
||||||
|
template_submitter, template_submitters, submission.template_fields =
|
||||||
|
merge_submitters_and_fields(submitter_attrs, template_submitters,
|
||||||
|
submission.template_fields || submission.template.fields)
|
||||||
|
|
||||||
next if uuid.blank?
|
submission.template_schema = submission.template.schema if submission.template_schema.blank?
|
||||||
next if submitter_attrs.slice('email', 'phone', 'name').compact_blank.blank?
|
|
||||||
|
uuid = template_submitter['uuid']
|
||||||
|
else
|
||||||
|
if submitter_attrs[:roles].present? && submitter_attrs[:roles].size == 1
|
||||||
|
submitter_attrs[:role] = submitter_attrs[:roles].first
|
||||||
|
end
|
||||||
|
|
||||||
|
uuid = find_submitter_uuid(template_submitters, submitter_attrs, index)
|
||||||
|
|
||||||
|
next if uuid.blank?
|
||||||
|
next if submitter_attrs.slice('email', 'phone', 'name').compact_blank.blank?
|
||||||
|
|
||||||
|
submission.template_fields = submission.template.fields if submitter_attrs[:completed].present? &&
|
||||||
|
submission.template_fields.blank?
|
||||||
|
|
||||||
|
template_submitter = template_submitters.find { |e| e['uuid'] == uuid }
|
||||||
|
end
|
||||||
|
|
||||||
template_submitter = template.submitters.find { |e| e['uuid'] == uuid }
|
|
||||||
submission.template_submitters << template_submitter.except('optional_invite_by_uuid', 'invite_by_uuid')
|
submission.template_submitters << template_submitter.except('optional_invite_by_uuid', 'invite_by_uuid')
|
||||||
|
|
||||||
is_order_sent = submitters_order == 'random' || index.zero?
|
is_order_sent = submitters_order == 'random' || index.zero?
|
||||||
@@ -41,6 +59,8 @@ module Submissions
|
|||||||
preferences: preferences.merge(submission_preferences))
|
preferences: preferences.merge(submission_preferences))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
maybe_set_template_fields(submission, attrs[:submitters])
|
||||||
|
|
||||||
if submission.submitters.size > template.submitters.size
|
if submission.submitters.size > template.submitters.size
|
||||||
raise BaseError, 'Defined more signing parties than in template'
|
raise BaseError, 'Defined more signing parties than in template'
|
||||||
end
|
end
|
||||||
@@ -51,8 +71,20 @@ module Submissions
|
|||||||
|
|
||||||
submission.tap(&:save!)
|
submission.tap(&:save!)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
maybe_enqueue_expire_at(submissions)
|
||||||
|
|
||||||
|
submissions
|
||||||
|
end
|
||||||
|
# rubocop:enable Metrics
|
||||||
|
|
||||||
|
def maybe_enqueue_expire_at(submissions)
|
||||||
|
submissions.each do |submission|
|
||||||
|
next unless submission.expire_at?
|
||||||
|
|
||||||
|
ProcessSubmissionExpiredJob.perform_at(submission.expire_at, 'submission_id' => submission.id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
# rubocop:enable Metrics/BlockLength
|
|
||||||
|
|
||||||
def maybe_add_invite_submitters(submission, template)
|
def maybe_add_invite_submitters(submission, template)
|
||||||
template.submitters.each_with_index do |item, index|
|
template.submitters.each_with_index do |item, index|
|
||||||
@@ -82,8 +114,10 @@ module Submissions
|
|||||||
def maybe_set_template_fields(submission, submitters_attrs, default_submitter_uuid: nil)
|
def maybe_set_template_fields(submission, submitters_attrs, default_submitter_uuid: nil)
|
||||||
template_fields = (submission.template_fields || submission.template.fields).deep_dup
|
template_fields = (submission.template_fields || submission.template.fields).deep_dup
|
||||||
|
|
||||||
|
submitters = submission.template_submitters || submission.template.submitters
|
||||||
|
|
||||||
submitters_attrs.each_with_index do |submitter_attrs, index|
|
submitters_attrs.each_with_index do |submitter_attrs, index|
|
||||||
submitter_uuid = default_submitter_uuid || find_submitter_uuid(submission.template, submitter_attrs, index)
|
submitter_uuid = default_submitter_uuid || find_submitter_uuid(submitters, submitter_attrs, index)
|
||||||
|
|
||||||
process_readonly_fields_param(submitter_attrs[:readonly_fields], template_fields, submitter_uuid)
|
process_readonly_fields_param(submitter_attrs[:readonly_fields], template_fields, submitter_uuid)
|
||||||
process_field_values_param(submitter_attrs[:values], template_fields, submitter_uuid)
|
process_field_values_param(submitter_attrs[:values], template_fields, submitter_uuid)
|
||||||
@@ -100,6 +134,65 @@ module Submissions
|
|||||||
submission
|
submission
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def merge_submitters_and_fields(submitter_attrs, template_submitters, template_fields)
|
||||||
|
selected_submitters = submitter_attrs[:roles].map do |role|
|
||||||
|
template_submitters.find { |e| e['name'].to_s.casecmp(role).zero? } ||
|
||||||
|
raise(BaseError, "#{role} role doesn't exist")
|
||||||
|
end
|
||||||
|
|
||||||
|
merge_role_uuids = selected_submitters.pluck('uuid')
|
||||||
|
old_role_uuids = template_submitters.pluck('uuid')
|
||||||
|
name = submitter_attrs[:role].presence || selected_submitters.pluck('name').join(' / ')
|
||||||
|
|
||||||
|
merged_submitter, template_submitters =
|
||||||
|
build_merged_submitter(template_submitters, role_uuids: merge_role_uuids, name:)
|
||||||
|
|
||||||
|
field_names_index = {}
|
||||||
|
|
||||||
|
sorted_fields = template_fields.sort_by { |e| old_role_uuids.index(e['submitter_uuid']) }
|
||||||
|
|
||||||
|
sorted_fields.each do |field|
|
||||||
|
next unless merge_role_uuids.include?(field['submitter_uuid'])
|
||||||
|
|
||||||
|
if (existing_field = field_names_index[field['name']])
|
||||||
|
existing_field['areas'] ||= []
|
||||||
|
existing_field['areas'].push(*field['areas'])
|
||||||
|
template_fields.delete(field)
|
||||||
|
else
|
||||||
|
field['submitter_uuid'] = merged_submitter['uuid']
|
||||||
|
field_names_index[field['name']] = field if field['name'].present?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
[merged_submitter, template_submitters, template_fields]
|
||||||
|
end
|
||||||
|
|
||||||
|
def build_merged_submitter(submitters, role_uuids:, name:)
|
||||||
|
new_uuid = Digest::UUID.uuid_v5(Digest::UUID::OID_NAMESPACE, role_uuids.sort.join(':'))
|
||||||
|
|
||||||
|
merged_submitter = nil
|
||||||
|
|
||||||
|
submitters =
|
||||||
|
submitters.filter_map do |submitter|
|
||||||
|
submitter['optional_invite_by_uuid'] = new_uuid if role_uuids.include?(submitter['optional_invite_by_uuid'])
|
||||||
|
submitter['invite_by_uuid'] = new_uuid if role_uuids.include?(submitter['invite_by_uuid'])
|
||||||
|
submitter['linked_to_uuid'] = new_uuid if role_uuids.include?(submitter['linked_to_uuid'])
|
||||||
|
|
||||||
|
if role_uuids.include?(submitter['uuid'])
|
||||||
|
next if merged_submitter
|
||||||
|
|
||||||
|
merged_submitter = submitter.deep_dup
|
||||||
|
merged_submitter['uuid'] = new_uuid
|
||||||
|
merged_submitter['name'] = name
|
||||||
|
merged_submitter.delete('linked_to_uuid')
|
||||||
|
end
|
||||||
|
|
||||||
|
submitter
|
||||||
|
end
|
||||||
|
|
||||||
|
[merged_submitter, submitters]
|
||||||
|
end
|
||||||
|
|
||||||
def process_readonly_fields_param(readonly_fields, template_fields, submitter_uuid)
|
def process_readonly_fields_param(readonly_fields, template_fields, submitter_uuid)
|
||||||
return if readonly_fields.blank?
|
return if readonly_fields.blank?
|
||||||
|
|
||||||
@@ -178,11 +271,11 @@ module Submissions
|
|||||||
field
|
field
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_submitter_uuid(template, attrs, index)
|
def find_submitter_uuid(submitters, attrs, index)
|
||||||
uuid = attrs[:uuid].presence
|
uuid = attrs[:uuid].presence
|
||||||
uuid ||= template.submitters.find { |e| e['name'].to_s.casecmp(attrs[:role].to_s).zero? }&.dig('uuid')
|
uuid ||= submitters.find { |e| e['name'].to_s.casecmp(attrs[:role].to_s).zero? }&.dig('uuid')
|
||||||
|
|
||||||
uuid || template.submitters[index]&.dig('uuid')
|
uuid || submitters[index]&.dig('uuid')
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_submitter(submission:, attrs:, uuid:, is_order_sent:, user:, preferences:, params:)
|
def build_submitter(submission:, attrs:, uuid:, is_order_sent:, user:, preferences:, params:)
|
||||||
|
|||||||
@@ -23,15 +23,9 @@ module Submissions
|
|||||||
**Submissions::GenerateResultAttachments.build_signing_params(submitter, pkcs, tsa_url)
|
**Submissions::GenerateResultAttachments.build_signing_params(submitter, pkcs, tsa_url)
|
||||||
}
|
}
|
||||||
|
|
||||||
begin
|
sign_pdf(io, pdf, sign_params)
|
||||||
pdf.sign(io, **sign_params)
|
|
||||||
rescue HexaPDF::MalformedPDFError => e
|
|
||||||
Rollbar.error(e) if defined?(Rollbar)
|
|
||||||
|
|
||||||
pdf.sign(io, write_options: { incremental: false }, **sign_params)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
pdf.write(io, incremental: true, validate: false)
|
pdf.write(io, incremental: true, validate: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
Submissions::GenerateResultAttachments.maybe_enable_ltv(io, sign_params)
|
Submissions::GenerateResultAttachments.maybe_enable_ltv(io, sign_params)
|
||||||
@@ -45,6 +39,20 @@ module Submissions
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def sign_pdf(io, pdf, sign_params)
|
||||||
|
pdf.sign(io, **sign_params)
|
||||||
|
rescue HexaPDF::MalformedPDFError => e
|
||||||
|
Rollbar.error(e) if defined?(Rollbar)
|
||||||
|
|
||||||
|
pdf.sign(io, write_options: { incremental: false }, **sign_params)
|
||||||
|
rescue HexaPDF::Error => e
|
||||||
|
Rollbar.error(e) if defined?(Rollbar)
|
||||||
|
|
||||||
|
pdf.validate(auto_correct: true)
|
||||||
|
|
||||||
|
pdf.sign(io, write_options: { validate: false }, **sign_params)
|
||||||
|
end
|
||||||
|
|
||||||
def build_combined_pdf(submitter)
|
def build_combined_pdf(submitter)
|
||||||
pdfs_index = Submissions::GenerateResultAttachments.generate_pdfs(submitter)
|
pdfs_index = Submissions::GenerateResultAttachments.generate_pdfs(submitter)
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ module Submissions
|
|||||||
end
|
end
|
||||||
|
|
||||||
def normalize_submitter_params!(submitter_params, template, index = nil, for_submitter: nil)
|
def normalize_submitter_params!(submitter_params, template, index = nil, for_submitter: nil)
|
||||||
default_values = submitter_params[:values] || {}
|
with_values = submitter_params[:values].present?
|
||||||
|
|
||||||
|
default_values = with_values ? submitter_params[:values] : {}
|
||||||
|
|
||||||
submitter_params[:fields]&.each do |f|
|
submitter_params[:fields]&.each do |f|
|
||||||
default_values[f[:name].presence || f[:uuid]] = f[:default_value] if f.key?(:default_value)
|
default_values[f[:name].presence || f[:uuid]] = f[:default_value] if f.key?(:default_value)
|
||||||
@@ -33,8 +35,9 @@ module Submissions
|
|||||||
default_values,
|
default_values,
|
||||||
submitter_name: submitter_params[:role] ||
|
submitter_name: submitter_params[:role] ||
|
||||||
template.submitters.dig(index, 'name'),
|
template.submitters.dig(index, 'name'),
|
||||||
|
role_names: submitter_params[:roles],
|
||||||
for_submitter:,
|
for_submitter:,
|
||||||
throw_errors: true)
|
throw_errors: !with_values)
|
||||||
|
|
||||||
submitter_params[:values] = values
|
submitter_params[:values] = values
|
||||||
|
|
||||||
|
|||||||
@@ -17,38 +17,47 @@ module Submitters
|
|||||||
|
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
def call(template, values, submitter_name: nil, for_submitter: nil, throw_errors: false)
|
def call(template, values, submitter_name: nil, role_names: nil, for_submitter: nil, throw_errors: false)
|
||||||
fields = fetch_fields(template, submitter_name:, for_submitter:)
|
fields =
|
||||||
|
if role_names.present?
|
||||||
|
fetch_roles_fields(template, roles: role_names)
|
||||||
|
else
|
||||||
|
fetch_fields(template, submitter_name:, for_submitter:)
|
||||||
|
end
|
||||||
|
|
||||||
fields_uuid_index = fields.index_by { |e| e['uuid'] }
|
fields_uuid_index = fields.index_by { |e| e['uuid'] }
|
||||||
fields_name_index = build_fields_index(fields)
|
fields_name_index = build_fields_index(fields)
|
||||||
|
|
||||||
attachments = []
|
attachments = []
|
||||||
|
|
||||||
normalized_values = values.to_h.filter_map do |key, value|
|
normalized_values = values.to_h.each_with_object({}) do |(key, value), acc|
|
||||||
if fields_uuid_index[key].blank?
|
|
||||||
original_key = key
|
|
||||||
|
|
||||||
key = fields_name_index[key]&.dig('uuid') || fields_name_index[key.to_s.downcase]&.dig('uuid')
|
|
||||||
|
|
||||||
raise(UnknownFieldName, "Unknown field: #{original_key}") if key.blank? && throw_errors
|
|
||||||
end
|
|
||||||
|
|
||||||
next if key.blank?
|
next if key.blank?
|
||||||
|
|
||||||
field = fields_uuid_index[key]
|
uuid_field = fields_uuid_index[key]
|
||||||
|
|
||||||
if field['type'].in?(%w[initials signature image file stamp]) && value.present?
|
value_fields = [uuid_field] if uuid_field
|
||||||
new_value, new_attachments =
|
|
||||||
normalize_attachment_value(value, field, template.account, attachments, for_submitter)
|
|
||||||
|
|
||||||
attachments.push(*new_attachments)
|
if value_fields.blank?
|
||||||
|
value_fields = fields_name_index[key].presence || fields_name_index[key.to_s.downcase]
|
||||||
|
|
||||||
value = new_value
|
raise(UnknownFieldName, "Unknown field: #{key}") if value_fields.blank? && throw_errors
|
||||||
end
|
end
|
||||||
|
|
||||||
[key, normalize_value(field, value)]
|
next if value_fields.blank?
|
||||||
end.to_h
|
|
||||||
|
value_fields.each do |field|
|
||||||
|
if field['type'].in?(%w[initials signature image file stamp]) && value.present?
|
||||||
|
new_value, new_attachments =
|
||||||
|
normalize_attachment_value(value, field, template.account, attachments, for_submitter)
|
||||||
|
|
||||||
|
attachments.push(*new_attachments)
|
||||||
|
|
||||||
|
value = new_value
|
||||||
|
end
|
||||||
|
|
||||||
|
acc[field['uuid']] = normalize_value(field, value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
[normalized_values, attachments]
|
[normalized_values, attachments]
|
||||||
end
|
end
|
||||||
@@ -103,10 +112,24 @@ module Submitters
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def fetch_roles_fields(template, roles:)
|
||||||
|
submitters = roles.map do |submitter_name|
|
||||||
|
template.submitters.find { |e| e['name'] == submitter_name } ||
|
||||||
|
raise(UnknownSubmitterName,
|
||||||
|
"Unknown submitter role: #{submitter_name}. Template defines #{template.submitters.pluck('name')}")
|
||||||
|
end
|
||||||
|
|
||||||
|
role_uuids = submitters.pluck('uuid')
|
||||||
|
|
||||||
|
template.fields.select do |e|
|
||||||
|
role_uuids.include?(e['submitter_uuid'])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def build_fields_index(fields)
|
def build_fields_index(fields)
|
||||||
fields.index_by { |e| e['name'] }
|
fields.group_by { |e| e['name'] }
|
||||||
.merge(fields.index_by { |e| e['name'].to_s.parameterize.underscore })
|
.merge(fields.group_by { |e| e['name'].to_s.parameterize.underscore })
|
||||||
.merge(fields.index_by { |e| e['name'].to_s.downcase })
|
.merge(fields.group_by { |e| e['name'].to_s.downcase })
|
||||||
end
|
end
|
||||||
|
|
||||||
def normalize_attachment_value(value, field, account, attachments, for_submitter = nil)
|
def normalize_attachment_value(value, field, account, attachments, for_submitter = nil)
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ module Templates
|
|||||||
Escolher
|
Escolher
|
||||||
)\b/ix
|
)\b/ix
|
||||||
|
|
||||||
|
DATE_FORMAT_REGEXP = %r{[myd]{2,4}[-\\/\s.][myd]{2,4}[-\\/\s.][myd]{2,4}}i
|
||||||
|
|
||||||
FIELD_ALIGNMENT = {
|
FIELD_ALIGNMENT = {
|
||||||
0 => 'left',
|
0 => 'left',
|
||||||
1 => 'center',
|
1 => 'center',
|
||||||
@@ -30,8 +32,8 @@ module Templates
|
|||||||
module_function
|
module_function
|
||||||
|
|
||||||
# rubocop:disable Metrics
|
# rubocop:disable Metrics
|
||||||
def call(pdf, attachment)
|
def call(pdf, attachment, data)
|
||||||
return [] unless pdf.acro_form
|
return [] if pdf.acro_form.blank? && data.exclude?('/Form')
|
||||||
|
|
||||||
fields, annots_index = build_fields_with_pages(pdf)
|
fields, annots_index = build_fields_with_pages(pdf)
|
||||||
|
|
||||||
@@ -147,7 +149,7 @@ module Templates
|
|||||||
options: build_options(field[:Opt], 'radio'),
|
options: build_options(field[:Opt], 'radio'),
|
||||||
default_value: selected_option
|
default_value: selected_option
|
||||||
}
|
}
|
||||||
elsif field.field_type == :Btn && field.concrete_field_type == :check_box &&
|
elsif field.field_type == :Btn && %i[check_box radio_button].include?(field.concrete_field_type) &&
|
||||||
field[:Kids].present? && field[:Kids].size > 1 && field.allowed_values.size > 1
|
field[:Kids].present? && field[:Kids].size > 1 && field.allowed_values.size > 1
|
||||||
selected_option = (field.allowed_values || []).find { |v| v == field.field_value }
|
selected_option = (field.allowed_values || []).find { |v| v == field.field_value }
|
||||||
|
|
||||||
@@ -187,15 +189,29 @@ module Templates
|
|||||||
default_value: field.field_value
|
default_value: field.field_value
|
||||||
}
|
}
|
||||||
elsif field.field_type == :Tx
|
elsif field.field_type == :Tx
|
||||||
{
|
if field[:AA] && ((field[:AA][:F] && field[:AA][:F][:JS].include?('AFDate_')) ||
|
||||||
**attrs,
|
(field[:AA][:K] && field[:AA][:F][:JS].include?('AFDate_')))
|
||||||
type: 'text',
|
if (format = field[:AA][:F][:JS][DATE_FORMAT_REGEXP])
|
||||||
default_value: field.field_value
|
attrs[:preferences] ||= {}
|
||||||
}
|
attrs[:preferences][:format] = format.upcase
|
||||||
|
end
|
||||||
|
|
||||||
|
{
|
||||||
|
**attrs,
|
||||||
|
type: 'date',
|
||||||
|
default_value: field.field_value
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
**attrs,
|
||||||
|
type: 'text',
|
||||||
|
default_value: field.field_value
|
||||||
|
}
|
||||||
|
end
|
||||||
elsif field.field_type == :Sig
|
elsif field.field_type == :Sig
|
||||||
{
|
{
|
||||||
**attrs,
|
**attrs,
|
||||||
type: 'signature'
|
type: field.try(:field_name).to_s.downcase.include?('initials') ? 'initials' : 'signature'
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{}
|
{}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ module Templates
|
|||||||
if extract_fields && data.size < MAX_FLATTEN_FILE_SIZE
|
if extract_fields && data.size < MAX_FLATTEN_FILE_SIZE
|
||||||
pdf = HexaPDF::Document.new(io: StringIO.new(data))
|
pdf = HexaPDF::Document.new(io: StringIO.new(data))
|
||||||
|
|
||||||
fields = Templates::FindAcroFields.call(pdf, attachment)
|
fields = Templates::FindAcroFields.call(pdf, attachment, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
generate_pdf_preview_images(attachment, data, pdf, max_pages:)
|
generate_pdf_preview_images(attachment, data, pdf, max_pages:)
|
||||||
@@ -85,6 +85,8 @@ module Templates
|
|||||||
end
|
end
|
||||||
|
|
||||||
Concurrent::Promise.zip(*promises).value!.each do |blob|
|
Concurrent::Promise.zip(*promises).value!.each do |blob|
|
||||||
|
next unless blob
|
||||||
|
|
||||||
ApplicationRecord.no_touching do
|
ApplicationRecord.no_touching do
|
||||||
ActiveStorage::Attachment.create!(
|
ActiveStorage::Attachment.create!(
|
||||||
blob:,
|
blob:,
|
||||||
@@ -114,6 +116,10 @@ module Templates
|
|||||||
blob.upload(io)
|
blob.upload(io)
|
||||||
|
|
||||||
blob
|
blob
|
||||||
|
rescue Vips::Error => e
|
||||||
|
Rollbar.warning(e) if defined?(Rollbar)
|
||||||
|
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def maybe_flatten_form(data, pdf)
|
def maybe_flatten_form(data, pdf)
|
||||||
|
|||||||
@@ -796,6 +796,40 @@ RSpec.describe 'Signing Form', type: :system do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when the template requires multiple submitters' do
|
||||||
|
let(:template) { create(:template, submitter_count: 2, account:, author:, only_field_types: %w[text]) }
|
||||||
|
|
||||||
|
context 'when default signer details are not defined' do
|
||||||
|
it 'shows an explanation error message if a logged-in user associated with the template account opens the link' do
|
||||||
|
sign_in author
|
||||||
|
visit start_form_path(slug: template.slug)
|
||||||
|
fill_in 'Email', with: author.email
|
||||||
|
click_button 'Start'
|
||||||
|
|
||||||
|
expect(page).to have_content('This submission has multiple signers, which prevents the use of a sharing link ' \
|
||||||
|
"as it's unclear which signer is responsible for specific fields. " \
|
||||||
|
'To resolve this, follow this guide to define the default signer details.')
|
||||||
|
expect(page).to have_link('guide', href: 'https://www.docuseal.com/resources/pre-filling-recipients')
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'shows a "Not found" error message if a logged-out user associated with the template account opens the link' do
|
||||||
|
visit start_form_path(slug: template.slug)
|
||||||
|
fill_in 'Email', with: author.email
|
||||||
|
click_button 'Start'
|
||||||
|
|
||||||
|
expect(page).to have_content('Not found')
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'shows a "Not found" error message if an unrelated user opens the link' do
|
||||||
|
visit start_form_path(slug: template.slug)
|
||||||
|
fill_in 'Email', with: 'john.doe@example.com'
|
||||||
|
click_button 'Start'
|
||||||
|
|
||||||
|
expect(page).to have_content('Not found')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it 'sends completed email' do
|
it 'sends completed email' do
|
||||||
template = create(:template, account:, author:, only_field_types: %w[text signature])
|
template = create(:template, account:, author:, only_field_types: %w[text signature])
|
||||||
submission = create(:submission, template:)
|
submission = create(:submission, template:)
|
||||||
|
|||||||
Reference in New Issue
Block a user