Ba515 fix 500 error on url prefil (#483)

* fix password reset bug

* fix form theme builder

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Favour Olayinka 2024-07-10 11:31:33 +01:00 committed by GitHub
parent b11f41d8b6
commit 11f99df98f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 6 deletions

View File

@ -130,6 +130,7 @@ import OpenFormField from './OpenFormField.vue'
import {pendingSubmission} from "~/composables/forms/pendingSubmission.js"
import FormLogicPropertyResolver from "~/lib/forms/FormLogicPropertyResolver.js"
import {computed} from "vue"
import CachedDefaultTheme from "~/lib/forms/themes/CachedDefaultTheme.js"
export default {
name: 'OpenForm',
@ -140,8 +141,13 @@ export default {
required: true
},
theme: {
type: Object,
required: true
type: Object, default: () => {
const theme = inject("theme", null)
if (theme) {
return theme.value
}
return CachedDefaultTheme.getInstance()
}
},
loading: {
type: Boolean,

View File

@ -107,9 +107,9 @@
</template>
<script>
import ThemeBuilder from "~/lib/forms/themes/ThemeBuilder"
import FormUrlPrefill from "../../../open/forms/components/FormUrlPrefill.vue"
import OpenForm from "../../../open/forms/OpenForm.vue"
import { themes } from "~/lib/forms/themes/form-themes.js"
export default {
name: "UrlFormPrefill",
@ -121,11 +121,17 @@ export default {
data: () => ({
prefillFormData: null,
theme: themes.default,
showUrlFormPrefillModal: false,
}),
computed: {},
computed: {
theme () {
return new ThemeBuilder(this.form.theme, {
size: this.form.size,
borderRadius: this.form.border_radius
}).getAllComponents()
},
},
methods: {
generateUrl(formData) {