Merge branch 'new-ui' of https://github.com/JhumanJ/OpnForm into new-ui

This commit is contained in:
JhumanJ
2022-11-16 11:20:53 +01:00
6 changed files with 41 additions and 3 deletions

View File

@@ -191,6 +191,9 @@ export default {
workspace_id: this.form.workspace_id,
form_id: this.form.id
})
window.localStorage.removeItem(this.form.form_pending_submission_Key)
if (response.data.redirect && response.data.redirect_url) {
window.location.href = response.data.redirect_url
}

View File

@@ -217,7 +217,15 @@ export default {
handler () {
this.formVersionId++
}
}
},
dataForm: {
deep: true,
handler () {
if(this.isPublicFormPage && this.form && this.dataFormValue){
window.localStorage.setItem(this.form.form_pending_submission_Key, JSON.stringify(this.dataFormValue))
}
}
},
},
mounted () {
@@ -266,6 +274,14 @@ export default {
}
},
initForm () {
if (this.isPublicFormPage) {
const pendingData = window.localStorage.getItem(this.form.form_pending_submission_Key)
if(pendingData !== null && pendingData){
this.dataForm = new Form(JSON.parse(pendingData))
return
}
}
const formData = clonedeep(this.dataForm ? this.dataForm.data() : {})
let urlPrefill = null
if (this.isPublicFormPage && this.form.is_pro) {