Handle completion without an editable step

pull/718/head
tomek 3 weeks ago
parent 56a48ae0cd
commit 6554f181bd

@ -141,11 +141,23 @@
<form
v-if="!isCompleted && !isInvite"
id="complete_form"
ref="completeForm"
class="hidden"
:action="submitPath"
method="post"
@submit.prevent="submitStep"
/>
>
<input
type="hidden"
name="authenticity_token"
:value="authenticityToken"
>
<input
value="put"
name="_method"
type="hidden"
>
</form>
<button
v-if="!isFormVisible && currentField"
id="expand_form_button"
@ -1615,7 +1627,7 @@ export default {
}
const currentFieldUuids = this.currentStepFields.map((f) => f.uuid)
const currentFieldType = this.currentField.type
const currentFieldType = this.currentField?.type
if (!formData && !this.$refs.form.checkValidity() && currentFieldUuids.every((fieldUuid) => isEmpty(this.submittedValues[fieldUuid]) || !isEmpty(this.values[fieldUuid]))) {
return
@ -1683,7 +1695,7 @@ export default {
})
})
const formData = new FormData(this.$refs.form)
const formData = new FormData(this.$refs.form || this.$refs.completeForm)
const isLastStep = (this.onlyRequiredFields ? !this.findNextStep(submitStepIndex) : (submitStepIndex === this.stepFields.length - 1)) || forceComplete
if (isLastStep && !emptyRequiredField && !this.inviteSubmitters.length && !this.optionalInviteSubmitters.length) {

Loading…
Cancel
Save