Fix custom fields on signup form
This commit is contained in:
parent
07b068a342
commit
2eb6b0dd9b
|
@ -2,7 +2,7 @@
|
||||||
import type { RouteLocationRaw } from 'vue-router'
|
import type { RouteLocationRaw } from 'vue-router'
|
||||||
import type { BackendError, Form } from '~/types'
|
import type { BackendError, Form } from '~/types'
|
||||||
|
|
||||||
import { computed, reactive, ref } from 'vue'
|
import { computed, reactive, ref, watchEffect } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||||
buttonClasses: 'success',
|
buttonClasses: 'success',
|
||||||
customization: null,
|
customization: null,
|
||||||
fetchDescriptionHtml: false,
|
fetchDescriptionHtml: false,
|
||||||
signupApprovalEnabled: false
|
signupApprovalEnabled: undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
const { $pgettext } = useGettext()
|
const { $pgettext } = useGettext()
|
||||||
|
@ -42,6 +42,7 @@ const labels = computed(() => ({
|
||||||
|
|
||||||
const signupRequiresApproval = computed(() => props.signupApprovalEnabled ?? store.state.instance.settings.moderation.signup_approval_enabled.value)
|
const signupRequiresApproval = computed(() => props.signupApprovalEnabled ?? store.state.instance.settings.moderation.signup_approval_enabled.value)
|
||||||
const formCustomization = computed(() => props.customization ?? store.state.instance.settings.moderation.signup_form_customization.value)
|
const formCustomization = computed(() => props.customization ?? store.state.instance.settings.moderation.signup_form_customization.value)
|
||||||
|
watchEffect(() => console.log(store.state.instance.settings.moderation.signup_approval_enabled.value))
|
||||||
|
|
||||||
const payload = reactive({
|
const payload = reactive({
|
||||||
username: '',
|
username: '',
|
||||||
|
@ -128,7 +129,7 @@ fetchInstanceSettings()
|
||||||
Registrations on this pod are open, but reviewed by moderators before approval.
|
Registrations on this pod are open, but reviewed by moderators before approval.
|
||||||
</translate>
|
</translate>
|
||||||
</p>
|
</p>
|
||||||
<template v-if="formCustomization && formCustomization.help_text">
|
<template v-if="formCustomization?.help_text">
|
||||||
<rendered-description
|
<rendered-description
|
||||||
:content="formCustomization.help_text"
|
:content="formCustomization.help_text"
|
||||||
:fetch-html="fetchDescriptionHtml"
|
:fetch-html="fetchDescriptionHtml"
|
||||||
|
@ -201,9 +202,9 @@ fetchInstanceSettings()
|
||||||
:placeholder="labels.placeholder"
|
:placeholder="labels.placeholder"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="signupRequiresApproval && formCustomization && formCustomization.fields && formCustomization.fields.length > 0">
|
<template v-if="signupRequiresApproval && (formCustomization?.fields.length ?? 0) > 0">
|
||||||
<div
|
<div
|
||||||
v-for="(field, idx) in formCustomization.fields"
|
v-for="(field, idx) in formCustomization?.fields"
|
||||||
:key="idx"
|
:key="idx"
|
||||||
:class="[{required: field.required}, 'field']"
|
:class="[{required: field.required}, 'field']"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue