adjust submit button
This commit is contained in:
committed by
Oleksandr Turchyn
parent
d267978437
commit
e6c20f5ff6
@@ -204,7 +204,7 @@
|
||||
<span
|
||||
@click="scrollIntoField(currentField)"
|
||||
>
|
||||
{{ t('complete_hightlighted_checkboxes_and_click') }} <span class="font-semibold">{{ stepFields.length === currentStep + 1 ? t('submit') : t('next') }}</span>.
|
||||
{{ t('complete_hightlighted_checkboxes_and_click') }} <span class="font-semibold">{{ submitButtonText }}</span>.
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
@@ -268,7 +268,7 @@
|
||||
>
|
||||
<template v-if="isAnonymousChecboxes || !showFieldNames">
|
||||
<span class="text-xl">
|
||||
{{ t('complete_hightlighted_checkboxes_and_click') }} <span class="font-semibold">{{ stepFields.length === currentStep + 1 ? t('submit') : t('next') }}</span>.
|
||||
{{ t('complete_hightlighted_checkboxes_and_click') }} <span class="font-semibold">{{ submitButtonText }}</span>.
|
||||
</span>
|
||||
<input
|
||||
v-for="field in currentStepFields"
|
||||
@@ -343,7 +343,7 @@
|
||||
:remember-signature="rememberSignature"
|
||||
:attachments-index="attachmentsIndex"
|
||||
:require-signing-reason="requireSigningReason"
|
||||
:button-text="buttonText"
|
||||
:button-text="submitButtonText"
|
||||
:dry-run="dryRun"
|
||||
:with-disclosure="withDisclosure"
|
||||
:with-qr-button="withQrButton"
|
||||
@@ -424,7 +424,7 @@
|
||||
class="mr-1 animate-spin"
|
||||
/>
|
||||
<span>
|
||||
{{ buttonText }}
|
||||
{{ submitButtonText }}
|
||||
</span><span
|
||||
v-if="isSubmitting"
|
||||
class="w-6 flex justify-start mr-1"
|
||||
@@ -777,9 +777,15 @@ export default {
|
||||
isMobile () {
|
||||
return /android|iphone|ipad/i.test(navigator.userAgent)
|
||||
},
|
||||
buttonText () {
|
||||
if (this.alwaysMinimize || this.stepFields.length === this.currentStep + 1) {
|
||||
submitButtonText () {
|
||||
if (this.alwaysMinimize) {
|
||||
return this.t('submit')
|
||||
} else if (this.stepFields.length === this.currentStep + 1) {
|
||||
if (this.currentField.type === 'signature') {
|
||||
return this.t('sign_and_complete')
|
||||
} else {
|
||||
return this.t('complete')
|
||||
}
|
||||
} else {
|
||||
return this.t('next')
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
const en = {
|
||||
complete: 'Complete',
|
||||
sign_and_complete: 'Sign and Complete',
|
||||
text: 'Text',
|
||||
by_clicking_you_agree_to_the: 'By clicking "{button}", you agree to the',
|
||||
electronic_signature_disclosure: 'Electronic Signature Disclosure',
|
||||
@@ -90,6 +92,8 @@ const en = {
|
||||
}
|
||||
|
||||
const es = {
|
||||
complete: 'Completar',
|
||||
sign_and_complete: 'Firmar y Completar',
|
||||
invite: 'Invitar',
|
||||
email: 'Correo electrónico',
|
||||
approved: 'Aprobado',
|
||||
@@ -180,6 +184,8 @@ const es = {
|
||||
}
|
||||
|
||||
const it = {
|
||||
complete: 'Completa',
|
||||
sign_and_complete: 'Firma e Completa',
|
||||
invite: 'Invita',
|
||||
email: 'Email',
|
||||
approved: 'Approvato',
|
||||
@@ -270,6 +276,8 @@ const it = {
|
||||
}
|
||||
|
||||
const de = {
|
||||
complete: 'Abschließen',
|
||||
sign_and_complete: 'Signieren und Abschließen',
|
||||
invite: 'Einladen',
|
||||
email: 'E-Mail',
|
||||
approved: 'Genehmigt',
|
||||
@@ -360,6 +368,8 @@ const de = {
|
||||
}
|
||||
|
||||
const fr = {
|
||||
complete: 'Terminer',
|
||||
sign_and_complete: 'Signer et Terminer',
|
||||
invite: 'Inviter',
|
||||
email: 'Courriel',
|
||||
approved: 'Approuvé',
|
||||
@@ -450,6 +460,8 @@ const fr = {
|
||||
}
|
||||
|
||||
const pl = {
|
||||
complete: 'Zakończ',
|
||||
sign_and_complete: 'Podpisz i zakończ',
|
||||
invite: 'Zaproś',
|
||||
email: 'E-mail',
|
||||
approved: 'Zaakceptowany',
|
||||
@@ -540,6 +552,8 @@ const pl = {
|
||||
}
|
||||
|
||||
const uk = {
|
||||
complete: 'Завершити',
|
||||
sign_and_complete: 'Підписати і завершити',
|
||||
invite: 'Запросити',
|
||||
email: 'Електронна пошта',
|
||||
approved: 'Затверджено',
|
||||
@@ -630,6 +644,8 @@ const uk = {
|
||||
}
|
||||
|
||||
const cs = {
|
||||
complete: 'Dokončit',
|
||||
sign_and_complete: 'Podepsat a dokončit',
|
||||
invite: 'Pozvat',
|
||||
email: 'E-mail',
|
||||
approved: 'Schváleno',
|
||||
@@ -720,6 +736,8 @@ const cs = {
|
||||
}
|
||||
|
||||
const pt = {
|
||||
complete: 'Completar',
|
||||
sign_and_complete: 'Assinar e Completar',
|
||||
invite: 'Convidar',
|
||||
email: 'E-mail',
|
||||
approved: 'Aprovado',
|
||||
@@ -810,6 +828,8 @@ const pt = {
|
||||
}
|
||||
|
||||
const he = {
|
||||
complete: 'השלם',
|
||||
sign_and_complete: 'חתום והשלם',
|
||||
invite: 'הזמן',
|
||||
email: 'דוא"ל',
|
||||
approved: 'מאושר',
|
||||
@@ -901,6 +921,8 @@ const he = {
|
||||
}
|
||||
|
||||
const nl = {
|
||||
complete: 'Voltooien',
|
||||
sign_and_complete: 'Ondertekenen en voltooien',
|
||||
invite: 'Uitnodigen',
|
||||
email: 'E-mail',
|
||||
approved: 'Goedgekeurd',
|
||||
@@ -992,6 +1014,8 @@ const nl = {
|
||||
}
|
||||
|
||||
const ar = {
|
||||
complete: 'اكتمال',
|
||||
sign_and_complete: 'التوقيع والاكتمال',
|
||||
invite: 'دعوة',
|
||||
email: 'البريد الإلكتروني',
|
||||
approved: 'موافق عليه',
|
||||
@@ -1082,6 +1106,8 @@ const ar = {
|
||||
}
|
||||
|
||||
const ko = {
|
||||
complete: '완료',
|
||||
sign_and_complete: '서명하고 완료하기',
|
||||
invite: '초대하기',
|
||||
email: '이메일',
|
||||
approved: '승인됨',
|
||||
|
||||
@@ -32,7 +32,7 @@ RSpec.describe 'Submit Form' do
|
||||
fill_in 'signature_text_input', with: 'Adam'
|
||||
|
||||
expect do
|
||||
click_on 'submit'
|
||||
click_on 'Sign and Complete'
|
||||
end.not_to(change(Submitter, :count))
|
||||
|
||||
submitter = Submitter.find_by(email: 'john.dou@example.com')
|
||||
@@ -61,7 +61,7 @@ RSpec.describe 'Submit Form' do
|
||||
click_on 'next'
|
||||
click_on 'type_text_button'
|
||||
fill_in 'signature_text_input', with: 'Sally'
|
||||
click_on 'submit'
|
||||
click_on 'Sign and Complete'
|
||||
|
||||
submitter.reload
|
||||
|
||||
@@ -80,7 +80,7 @@ RSpec.describe 'Submit Form' do
|
||||
fill_in 'signature_text_input', with: 'Adam'
|
||||
|
||||
expect do
|
||||
click_on 'submit'
|
||||
click_on 'Sign and Complete'
|
||||
end.to change(enqueued_jobs, :size).by(1)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user