From b647d2827a4351b693bce6e790b686000b7c9d40 Mon Sep 17 00:00:00 2001 From: "bert.hausmans" Date: Thu, 16 Apr 2026 19:15:03 +0200 Subject: [PATCH] fix: compact options layout, consistent ImageUploadField across app - Replace card-based multi-line options with compact single-line rows (grip + label + description + delete all on one row) - Standardize event registration appearance page on ImageUploadField (was VFileInput + manual preview, now consistent with email branding) - Fix EmailBrandingTab logoUrl ref to properly handle null from ImageUploadField, ensuring existing image preview works on page load Co-Authored-By: Claude Opus 4.6 (1M context) --- .../event/RegistrationFieldFormDialog.vue | 71 +++++----- .../organisation/EmailBrandingTab.vue | 4 +- .../RegistrationFieldTemplatesTab.vue | 71 +++++----- .../src/pages/events/[id]/settings/index.vue | 122 +++++------------- 4 files changed, 96 insertions(+), 172 deletions(-) diff --git a/apps/app/src/components/event/RegistrationFieldFormDialog.vue b/apps/app/src/components/event/RegistrationFieldFormDialog.vue index da62d8ea..23f1b563 100644 --- a/apps/app/src/components/event/RegistrationFieldFormDialog.vue +++ b/apps/app/src/components/event/RegistrationFieldFormDialog.vue @@ -323,46 +323,39 @@ defineExpose({ setErrors })
- -
- -
- - -
- -
-
+
+ + + + +
>() const snackbar = ref(false) const serverErrors = ref>({}) -const logoUrl = ref('') +const logoUrl = ref(null) const primaryColor = ref('#6366F1') const secondaryColor = ref('#4F46E5') const footerText = ref('') @@ -31,7 +31,7 @@ const showSecondaryPicker = ref(false) watch(settings, s => { if (s) { - logoUrl.value = s.logo_url ?? '' + logoUrl.value = s.logo_url ?? null primaryColor.value = s.primary_color ?? '#6366F1' secondaryColor.value = s.secondary_color ?? '#4F46E5' footerText.value = s.footer_text ?? '' diff --git a/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue b/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue index d6b0d0f3..602e9896 100644 --- a/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue +++ b/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue @@ -562,46 +562,39 @@ function activate(template: RegistrationFieldTemplate) {
- -
- -
- - -
- -
-
+
+ + + + +
import { VForm } from 'vuetify/components/VForm' import EventTabsNav from '@/components/events/EventTabsNav.vue' -import { useUpdateEvent, useUploadEventImage } from '@/composables/api/useEvents' +import ImageUploadField from '@/components/common/ImageUploadField.vue' +import { useUpdateEvent } from '@/composables/api/useEvents' import { useAuthStore } from '@/stores/useAuthStore' import type { EventItem, UpdateEventPayload } from '@/types/event' @@ -24,16 +25,29 @@ const settingsTab = computed(() => { }) const { mutate: updateEvent, isPending: isUpdating } = useUpdateEvent(orgId, eventId) -const { mutate: uploadImage, isPending: isUploading } = useUploadEventImage(orgId, eventId) +const bannerUrl = ref(null) +const logoUrl = ref(null) const welcomeText = ref('') const showSuccess = ref(false) const refVForm = ref() function initForm(event: EventItem) { + bannerUrl.value = event.registration_banner_url ?? null + logoUrl.value = event.registration_logo_url ?? null welcomeText.value = event.registration_welcome_text ?? '' } +function onBannerChange(url: string | null) { + bannerUrl.value = url + updateEvent({ registration_banner_url: url } as UpdateEventPayload) +} + +function onLogoChange(url: string | null) { + logoUrl.value = url + updateEvent({ registration_logo_url: url } as UpdateEventPayload) +} + function onSaveWelcomeText() { updateEvent( { registration_welcome_text: welcomeText.value || null }, @@ -44,19 +58,6 @@ function onSaveWelcomeText() { }, ) } - -function onFileSelected(files: File[], type: 'banner' | 'logo') { - const file = files[0] - if (!file) return - - uploadImage({ file, type }) -} - -function onClearImage(event: EventItem, type: 'banner' | 'logo') { - const field = type === 'banner' ? 'registration_banner_url' : 'registration_logo_url' - - updateEvent({ [field]: null } as UpdateEventPayload) -}