diff --git a/app/controllers/api/templates_controller.rb b/app/controllers/api/templates_controller.rb index 80af5acf9..e922102a8 100644 --- a/app/controllers/api/templates_controller.rb +++ b/app/controllers/api/templates_controller.rb @@ -87,7 +87,7 @@ def destroy def filter_templates(templates, params) templates = Templates.search(templates, params[:q]) - templates = params[:archived] ? templates.archived : templates.active + templates = params[:archived].in?(['true', true]) ? templates.archived : templates.active templates = templates.where(external_id: params[:application_key]) if params[:application_key].present? templates = templates.where(external_id: params[:external_id]) if params[:external_id].present? templates = templates.joins(:folder).where(folder: { name: params[:folder] }) if params[:folder].present? @@ -105,7 +105,7 @@ def template_params :required, :readonly, :default_value, :title, :description, { preferences: {}, - conditions: [%i[field_uuid value action]], + conditions: [%i[field_uuid value action operation]], options: [%i[value uuid]], validation: %i[message pattern], areas: [%i[x y w h cell_w attachment_uuid option_uuid page]] }]] diff --git a/app/controllers/personalization_settings_controller.rb b/app/controllers/personalization_settings_controller.rb index 21e1253c5..76d3f886f 100644 --- a/app/controllers/personalization_settings_controller.rb +++ b/app/controllers/personalization_settings_controller.rb @@ -6,7 +6,8 @@ class PersonalizationSettingsController < ApplicationController AccountConfig::SUBMITTER_INVITATION_EMAIL_KEY, AccountConfig::SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY, AccountConfig::SUBMITTER_COMPLETED_EMAIL_KEY, - AccountConfig::FORM_COMPLETED_MESSAGE_KEY + AccountConfig::FORM_COMPLETED_MESSAGE_KEY, + *(Docuseal.multitenant? ? [] : [AccountConfig::POLICY_LINKS_KEY]) ].freeze InvalidKey = Class.new(StandardError) diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 04d63e1cc..306476b29 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -115,7 +115,7 @@ def template_params :required, :readonly, :default_value, :title, :description, { preferences: {}, - conditions: [%i[field_uuid value action]], + conditions: [%i[field_uuid value action operation]], options: [%i[value uuid]], validation: %i[message pattern], areas: [%i[x y w h cell_w attachment_uuid option_uuid page]] }]] } diff --git a/app/controllers/templates_preferences_controller.rb b/app/controllers/templates_preferences_controller.rb index 76af325b2..24aedbd4b 100644 --- a/app/controllers/templates_preferences_controller.rb +++ b/app/controllers/templates_preferences_controller.rb @@ -22,6 +22,7 @@ def template_params preferences: %i[bcc_completed request_email_subject request_email_body documents_copy_email_subject documents_copy_email_body documents_copy_email_enabled documents_copy_email_attach_audit + documents_copy_email_attach_documents completed_notification_email_attach_documents completed_redirect_url submitters_order diff --git a/app/controllers/templates_uploads_controller.rb b/app/controllers/templates_uploads_controller.rb index 75b4e620a..4cd0072fa 100644 --- a/app/controllers/templates_uploads_controller.rb +++ b/app/controllers/templates_uploads_controller.rb @@ -55,11 +55,12 @@ def create_file_params_from_url tempfile.write(DownloadUtils.call(params[:url]).body) tempfile.rewind + filename = URI.decode_www_form_component(params[:filename]) if params[:filename].present? + filename ||= File.basename(URI.decode_www_form_component(params[:url])) + file = ActionDispatch::Http::UploadedFile.new( tempfile:, - filename: File.basename( - URI.decode_www_form_component(params[:filename].presence || params[:url]), '.*' - ), + filename:, type: Marcel::MimeType.for(tempfile) ) diff --git a/app/javascript/application.js b/app/javascript/application.js index 15f31a722..2239d6389 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -113,6 +113,7 @@ safeRegisterElement('template-builder', class extends HTMLElement { backgroundColor: '#faf7f5', locale: this.dataset.locale, withPhone: this.dataset.withPhone === 'true', + withVerification: ['true', 'false'].includes(this.dataset.withVerification) ? this.dataset.withVerification === 'true' : null, withLogo: this.dataset.withLogo !== 'false', editable: this.dataset.editable !== 'false', authenticityToken: document.querySelector('meta[name="csrf-token"]')?.content, diff --git a/app/javascript/application.scss b/app/javascript/application.scss index 1a6b527da..61d3f645d 100644 --- a/app/javascript/application.scss +++ b/app/javascript/application.scss @@ -97,6 +97,23 @@ button[disabled] .enabled { bottom: auto; } +.tooltip-bottom-start:before { + transform: translateX(-31%); + top: var(--tooltip-offset); + left: 100%; + right: auto; + bottom: auto; +} + +.tooltip-bottom-start:after { + transform: translateX(-25%); + border-color: transparent transparent var(--tooltip-color) transparent; + top: var(--tooltip-tail-offset); + left: 50%; + right: auto; + bottom: auto; +} + .autocomplete { background: white; z-index: 1000; diff --git a/app/javascript/submission_form/area.vue b/app/javascript/submission_form/area.vue index 750228fa8..2c3fc5d45 100644 --- a/app/javascript/submission_form/area.vue +++ b/app/javascript/submission_form/area.vue @@ -209,7 +209,7 @@ diff --git a/app/javascript/template_builder/builder.vue b/app/javascript/template_builder/builder.vue index 04c6dcaf9..d8a9c3dc2 100644 --- a/app/javascript/template_builder/builder.vue +++ b/app/javascript/template_builder/builder.vue @@ -455,6 +455,7 @@ export default { fieldTypes: this.fieldTypes, backgroundColor: this.backgroundColor, withPhone: this.withPhone, + withVerification: this.withVerification, withPayment: this.withPayment, isPaymentConnected: this.isPaymentConnected, withFormula: this.withFormula, @@ -635,6 +636,11 @@ export default { required: false, default: false }, + withVerification: { + type: Boolean, + required: false, + default: null + }, withPayment: { type: Boolean, required: false, @@ -1075,7 +1081,7 @@ export default { } else if (type === 'image') { area.w = pageMask.clientWidth / 5 / pageMask.clientWidth area.h = (pageMask.clientWidth / 5 / pageMask.clientWidth) * (pageMask.clientWidth / pageMask.clientHeight) - } else if (type === 'signature' || type === 'stamp') { + } else if (type === 'signature' || type === 'stamp' || type === 'verification') { area.w = pageMask.clientWidth / 5 / pageMask.clientWidth area.h = (pageMask.clientWidth / 5 / pageMask.clientWidth) * (pageMask.clientWidth / pageMask.clientHeight) / 2 } else if (type === 'initials') { @@ -1239,7 +1245,7 @@ export default { w: area.maskW / 5 / area.maskW, h: (area.maskW / 5 / area.maskW) * (area.maskW / area.maskH) } - } else if (field.type === 'signature' || field.type === 'stamp') { + } else if (field.type === 'signature' || field.type === 'stamp' || field.type === 'verification') { baseArea = { w: area.maskW / 5 / area.maskW, h: (area.maskW / 5 / area.maskW) * (area.maskW / area.maskH) / 2 diff --git a/app/javascript/template_builder/conditions_modal.vue b/app/javascript/template_builder/conditions_modal.vue index 61ae8939e..3fbe13133 100644 --- a/app/javascript/template_builder/conditions_modal.vue +++ b/app/javascript/template_builder/conditions_modal.vue @@ -29,15 +29,26 @@ >{{ t('available_in_pro') }}
-
+
+
+ +
{{ t('condition') }} {{ cindex + 1 }} diff --git a/app/javascript/template_builder/field_type.vue b/app/javascript/template_builder/field_type.vue index 3034f5686..8f17d2564 100644 --- a/app/javascript/template_builder/field_type.vue +++ b/app/javascript/template_builder/field_type.vue @@ -30,7 +30,7 @@ v-for="(icon, type) in fieldIconsSorted" :key="type" > -
  • +