adjust form builder

This commit is contained in:
Alex Turchyn
2023-11-21 23:08:59 +02:00
committed by Pete Matsyburka
parent e07b50c22d
commit b85c9cfdb7
6 changed files with 26 additions and 22 deletions
@@ -74,7 +74,7 @@
:stroke-width="1.6"
/>
<span class="py-1">
Add Submitter
Add {{ names[submitters.length] }}
</span>
</a>
</li>
@@ -100,7 +100,7 @@
<label
v-else
tabindex="0"
class="cursor-pointer group/contenteditable-container rounded-md p-2 border border-base-300 w-full flex justify-between"
class="group cursor-pointer group/contenteditable-container rounded-md p-2 border border-base-300 hover:border-content w-full flex justify-between"
>
<div class="flex items-center space-x-2">
<span
@@ -117,7 +117,7 @@
@update:model-value="$emit('name-change', selectedSubmitter)"
/>
</div>
<span class="flex items-center">
<span class="flex items-center transition-all duration-75 group-hover:border border-base-content/20 border-dashed w-6 h-6 flex justify-center items-center rounded">
<IconPlus
width="18"
height="18"
@@ -169,7 +169,7 @@
:stroke-width="1.6"
/>
<span class="py-1">
Add Submitter
Add {{ names[submitters.length] }}
</span>
</a>
</li>
@@ -239,16 +239,16 @@ export default {
},
names () {
return [
'First Submitter',
'Second Submitter',
'Third Submitter',
'Fourth Submitter',
'Fifth Submitter',
'Sixth Submitter',
'Seventh Submitter',
'Eighth Submitter',
'Ninth Submitter',
'Tenth Submitter'
'First Party',
'Second Party',
'Third Party',
'Fourth Party',
'Fifth Party',
'Sixth Party',
'Seventh Party',
'Eighth Party',
'Ninth Party',
'Tenth Party'
]
},
selectedSubmitter () {
+7 -3
View File
@@ -72,14 +72,14 @@
<button
v-if="withPhone || type != 'phone'"
draggable="true"
class="flex items-center justify-center border border-dashed border-base-300 w-full rounded relative"
class="group flex items-center justify-center border border-dashed border-base-300 hover:border-base-content/20 w-full rounded relative"
:style="{ backgroundColor: backgroundColor }"
@dragstart="onDragstart({ type: type })"
@dragend="$emit('drag-end')"
@click="addField(type)"
>
<div class="w-0 absolute left-0">
<IconDrag class="cursor-grab" />
<div class="flex items-console group-hover:bg-base-200/50 transition-all cursor-grab h-full absolute left-0">
<IconDrag class=" my-auto" />
</div>
<div class="flex items-center flex-col px-2 py-2">
<component :is="icon" />
@@ -257,6 +257,10 @@ export default {
this.fields.push(field)
if (['signature', 'initials', 'cells'].includes(type)) {
this.$emit('set-draw', { field })
}
this.save()
}
}
+1 -1
View File
@@ -33,7 +33,7 @@
# fk_rails_... (folder_id => template_folders.id)
#
class Template < ApplicationRecord
DEFAULT_SUBMITTER_NAME = 'First Submitter'
DEFAULT_SUBMITTER_NAME = 'First Party'
belongs_to :author, class_name: 'User'
belongs_to :account
+1 -1
View File
@@ -34,7 +34,7 @@
"submitters": [
{
"name": "John Doe",
"role": "<%= current_account.templates.last ? current_account.templates.last.submitters.first['name'] : 'First Submitter' %>",
"role": "<%= current_account.templates.last ? current_account.templates.last.submitters.first['name'] : 'First Party' %>",
"email": "<%= current_user.email.sub('@', '+test@') %>",
"values": {
"Form Text Field Name": "Default Value"
@@ -2,8 +2,8 @@
<div class="form-control">
<%= f.label :preserve_order, for: uuid = SecureRandom.uuid, class: 'flex items-center cursor-pointer' do %>
<%= f.check_box :preserve_order, id: uuid, class: 'base-checkbox', checked: template.submissions.last&.submitters_order.in?(['preserved', nil]) %>
<span class="label">Preserve submitters order</span>
<span class="tooltip" data-tip="When checked, notifications will be sent to the second submitter once the form is completed by the previous submitter. Uncheck this option to send notifications to all submitters simultaneously right away.">
<span class="label">Preserve order</span>
<span class="tooltip" data-tip="When checked, notifications will be sent to the second party once the form is completed by the previous party. Uncheck this option to send notifications to all parties simultaneously right away.">
<%= svg_icon('info_circle', class: 'w-4 h-4') %>
</span>
<% end %>
+1 -1
View File
@@ -24,7 +24,7 @@ FactoryBot.define do
template.schema = [{ attachment_uuid: attachment.uuid, name: 'sample-document' }]
template.submitters = [
{
'name' => 'First Submitter',
'name' => 'First Party',
'uuid' => '513848eb-1096-4abc-a743-68596b5aaa4c'
}
]