Add birthdate handling in member registration and management. Update UI to conditionally require birthdate for new members, and enhance API to enforce birthdate validation. Improve tests to cover new birthdate requirements.
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 57s
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 57s
This commit is contained in:
@@ -472,12 +472,12 @@
|
||||
<input
|
||||
v-model="formData.geburtsdatum"
|
||||
type="date"
|
||||
required
|
||||
:required="isBirthdateRequired"
|
||||
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
||||
:disabled="isSaving"
|
||||
>
|
||||
<p class="text-xs text-gray-500 mt-1">
|
||||
Wird zur eindeutigen Identifizierung benötigt
|
||||
Fuer neue Mitglieder erforderlich. Altdaten ohne Geburtsdatum koennen weiter bearbeitet werden.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -937,6 +937,10 @@ const canViewContactData = computed(() => {
|
||||
return authStore.hasRole('vorstand')
|
||||
})
|
||||
|
||||
const isBirthdateRequired = computed(() => {
|
||||
return !editingMember.value || Boolean(editingMember.value?.geburtsdatum)
|
||||
})
|
||||
|
||||
const loadMembers = async () => {
|
||||
isLoading.value = true
|
||||
try {
|
||||
|
||||
@@ -306,7 +306,8 @@ const formData = ref({
|
||||
const visibility = ref({
|
||||
showEmail: true,
|
||||
showPhone: true,
|
||||
showAddress: false
|
||||
showAddress: false,
|
||||
showBirthday: true
|
||||
})
|
||||
|
||||
const passwordData = ref({
|
||||
|
||||
@@ -106,6 +106,31 @@
|
||||
>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label
|
||||
for="geburtsdatum"
|
||||
class="block text-sm font-medium text-gray-700 mb-2"
|
||||
>
|
||||
Geburtsdatum
|
||||
</label>
|
||||
<input
|
||||
id="geburtsdatum"
|
||||
v-model="formData.geburtsdatum"
|
||||
type="date"
|
||||
required
|
||||
class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-600 focus:border-transparent transition-all"
|
||||
>
|
||||
</div>
|
||||
|
||||
<label class="flex items-center gap-2 text-sm text-gray-700">
|
||||
<input
|
||||
v-model="formData.hideBirthday"
|
||||
type="checkbox"
|
||||
class="h-4 w-4 text-primary-600 focus:ring-primary-600 border-gray-300 rounded"
|
||||
>
|
||||
Geburtsdatum in der Mitgliederliste nicht anzeigen
|
||||
</label>
|
||||
|
||||
<!-- Password -->
|
||||
<div>
|
||||
<label
|
||||
@@ -340,6 +365,8 @@ const formData = ref({
|
||||
lastName: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
geburtsdatum: '',
|
||||
hideBirthday: false,
|
||||
password: '',
|
||||
confirmPassword: ''
|
||||
})
|
||||
@@ -424,6 +451,10 @@ const handleRegister = async () => {
|
||||
name: `${formData.value.firstName} ${formData.value.lastName}`.trim(),
|
||||
email: formData.value.email,
|
||||
phone: formData.value.phone,
|
||||
geburtsdatum: formData.value.geburtsdatum,
|
||||
visibility: {
|
||||
showBirthday: !formData.value.hideBirthday
|
||||
},
|
||||
password: formData.value.password
|
||||
}
|
||||
})
|
||||
@@ -437,6 +468,8 @@ const handleRegister = async () => {
|
||||
lastName: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
geburtsdatum: '',
|
||||
hideBirthday: false,
|
||||
password: '',
|
||||
confirmPassword: ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user