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