diff --git a/app/controllers/submissions_controller.rb b/app/controllers/submissions_controller.rb
index 327a251d..3902a166 100644
--- a/app/controllers/submissions_controller.rb
+++ b/app/controllers/submissions_controller.rb
@@ -32,7 +32,8 @@ class SubmissionsController < ApplicationController
end
end
- redirect_to template_submissions_path(@template), notice: "#{submissions.size} recepients added"
+ redirect_to template_submissions_path(@template),
+ notice: "#{submissions.size} #{'recipient'.pluralize(submissions.size)} added"
end
def destroy
diff --git a/app/javascript/application.scss b/app/javascript/application.scss
index c0c8fd69..0c21e19d 100644
--- a/app/javascript/application.scss
+++ b/app/javascript/application.scss
@@ -52,7 +52,7 @@ button[disabled] .enabled {
}
.base-textarea {
- @apply textarea textarea-bordered bg-white;
+ @apply textarea textarea-bordered bg-white rounded-3xl;
}
.base-button {
diff --git a/app/javascript/template_builder/area.vue b/app/javascript/template_builder/area.vue
index e36d31af..9bf5c2dc 100644
--- a/app/javascript/template_builder/area.vue
+++ b/app/javascript/template_builder/area.vue
@@ -24,6 +24,7 @@
:compact="true"
:menu-classes="'dropdown-content bg-white menu menu-xs p-2 shadow rounded-box w-52 rounded-t-none -left-[1px]'"
:submitters="template.submitters"
+ @update:model-value="save"
@click="selectedAreaRef.value = area"
/>
this.selectedAreaRef)
}
},
@@ -239,6 +249,8 @@ export default {
if (!field.areas.length) {
this.template.fields.splice(this.template.fields.indexOf(field), 1)
}
+
+ this.save()
},
onDraw (area) {
if (this.drawField) {
@@ -281,6 +293,8 @@ export default {
}
this.selectedAreaRef.value = area
+
+ this.save()
},
onDropfield (area) {
const field = {
@@ -343,6 +357,8 @@ export default {
this.selectedAreaRef.value = fieldArea
this.template.fields.push(field)
+
+ this.save()
},
updateFromUpload ({ schema, documents }) {
this.template.schema.push(...schema)
@@ -387,7 +403,7 @@ export default {
this.isSaving = true
this.save().then(() => {
- // window.Turbo.visit('/')
+ window.Turbo.visit(`/templates/${this.template.id}/submissions`)
}).finally(() => {
this.isSaving = false
})
@@ -404,7 +420,14 @@ export default {
return fetch(`/api/templates/${this.template.id}`, {
method: 'PUT',
- body: JSON.stringify({ template: this.template }),
+ body: JSON.stringify({
+ template: {
+ name: this.template.name,
+ schema: this.template.schema,
+ submitters: this.template.submitters,
+ fields: this.template.fields
+ }
+ }),
headers: { 'Content-Type': 'application/json' }
}).then((resp) => {
console.log(resp)
diff --git a/app/javascript/template_builder/field.vue b/app/javascript/template_builder/field.vue
index 84bfbb8c..bce35369 100644
--- a/app/javascript/template_builder/field.vue
+++ b/app/javascript/template_builder/field.vue
@@ -14,7 +14,7 @@
@@ -168,7 +169,7 @@
@@ -191,7 +192,7 @@ export default {
IconTrashX,
FieldType
},
- inject: ['template'],
+ inject: ['template', 'save'],
props: {
field: {
type: Object,
@@ -250,9 +251,13 @@ export default {
}
this.isNameFocus = false
+
+ this.save()
},
removeArea (area) {
this.field.areas.splice(this.field.areas.indexOf(area), 1)
+
+ this.save()
}
}
}
diff --git a/app/javascript/template_builder/field_submitter.vue b/app/javascript/template_builder/field_submitter.vue
index 591ea973..ac6e24e1 100644
--- a/app/javascript/template_builder/field_submitter.vue
+++ b/app/javascript/template_builder/field_submitter.vue
@@ -26,6 +26,7 @@
class="cursor-text"
:icon-inline="true"
:icon-width="18"
+ @update:model-value="$emit('name-change', selectedSubmitter)"
/>
@@ -116,7 +117,7 @@ export default {
default: 'dropdown-content menu p-2 shadow bg-base-100 rounded-box w-full z-10'
}
},
- emits: ['update:model-value', 'remove'],
+ emits: ['update:model-value', 'remove', 'new-submitter', 'name-change'],
computed: {
colors () {
return [
@@ -158,6 +159,7 @@ export default {
this.submitters.push(newSubmitter)
this.$emit('update:model-value', newSubmitter.uuid)
+ this.$emit('new-submitter', newSubmitter)
},
closeDropdown () {
document.activeElement.blur()
diff --git a/app/javascript/template_builder/fields.vue b/app/javascript/template_builder/fields.vue
index 679e6a58..dc9541dc 100644
--- a/app/javascript/template_builder/fields.vue
+++ b/app/javascript/template_builder/fields.vue
@@ -4,7 +4,9 @@
:model-value="selectedSubmitter.uuid"
class="w-full bg-base-100"
:submitters="submitters"
+ @new-submitter="save"
@remove="removeSubmitter"
+ @name-change="save"
@update:model-value="$emit('change-submitter', submitters.find((s) => s.uuid === $event))"
/>
@@ -79,6 +81,7 @@ export default {
Field,
FieldSubmitter
},
+ inject: ['save'],
props: {
fields: {
type: Array,
@@ -116,6 +119,8 @@ export default {
if (this.selectedSubmitter === submitter) {
this.$emit('change-submitter', this.submitters[0])
}
+
+ this.save()
},
move (field, direction) {
const currentIndex = this.submitterFields.indexOf(field)
@@ -134,9 +139,13 @@ export default {
} else {
this.fields.splice(fieldsIndex + direction, 0, field)
}
+
+ this.save()
},
removeField (field) {
this.fields.splice(this.fields.indexOf(field), 1)
+
+ this.save()
},
addField (type, area = null) {
const field = {
@@ -152,6 +161,8 @@ export default {
}
this.fields.push(field)
+
+ this.save()
}
}
}
diff --git a/app/mailers/submitter_mailer.rb b/app/mailers/submitter_mailer.rb
index ea2499e9..d9c9f813 100644
--- a/app/mailers/submitter_mailer.rb
+++ b/app/mailers/submitter_mailer.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class SubmitterMailer < ApplicationMailer
- DEFAULT_MESSAGE = "You've been invited to submit documents."
+ DEFAULT_MESSAGE = "You've been invited to submit the following documents:"
def invitation_email(submitter, message: DEFAULT_MESSAGE)
@submitter = submitter
diff --git a/app/views/esign_settings/_result.html.erb b/app/views/esign_settings/_result.html.erb
index 461b1a47..58ee214e 100644
--- a/app/views/esign_settings/_result.html.erb
+++ b/app/views/esign_settings/_result.html.erb
@@ -32,12 +32,12 @@
<% if signature.signature_handler.signer_certificate.public_key.to_der == trusted_certs.first.public_key.to_der %>
<%= svg_icon('circle_check', class: 'w-6 h-6 text-green-500') %>
- Signed with DocuSeal Certificate
+ Signed with DocuSeal certificate
<% else %>
<%= svg_icon('x_circle', class: 'w-6 h-6 text-red-500') %>
- Signed with External Certificate
+ Signed with external certificate
<% end %>
diff --git a/app/views/layouts/plain.html.erb b/app/views/layouts/plain.html.erb
index dce433c8..38775b79 100644
--- a/app/views/layouts/plain.html.erb
+++ b/app/views/layouts/plain.html.erb
@@ -1,3 +1,4 @@
+
@@ -12,5 +13,6 @@
<% if flash.present? %><%= render 'shared/flash' %><% end %>
<%= yield %>
+
diff --git a/app/views/submissions/index.html.erb b/app/views/submissions/index.html.erb
index c637323f..cc009d06 100644
--- a/app/views/submissions/index.html.erb
+++ b/app/views/submissions/index.html.erb
@@ -32,10 +32,10 @@
-
Recepients
+ Recipients
<%= link_to new_template_submission_path(@template), class: 'btn btn-primary btn-sm gap-2', data: { turbo_frame: 'modal' } do %>
<%= svg_icon('plus', class: 'w-6 h-6') %>
- Add Recepients
+ Add Recipients
<% end %>
diff --git a/app/views/submissions/new.html.erb b/app/views/submissions/new.html.erb
index dec921f8..158ad1ea 100644
--- a/app/views/submissions/new.html.erb
+++ b/app/views/submissions/new.html.erb
@@ -1,4 +1,4 @@
-<%= render 'shared/turbo_modal', title: 'New Recepients' do %>
+<%= render 'shared/turbo_modal', title: 'New Recipients' do %>
<%= form_for '', url: template_submissions_path(@template), html: { class: 'space-y-4' }, data: { turbo_frame: :_top } do |f| %>
<% if @template.submitters.size == 1 %>