From ee56b6762f5b2eb9ea42f4abe4dde4356e2e54e6 Mon Sep 17 00:00:00 2001 From: Luca <102960244+Luca-Timo@users.noreply.github.com> Date: Mon, 4 May 2026 11:45:31 +0200 Subject: [PATCH 1/4] feat(events): prefill admin email + admin picker on event creation --- frontend/src/i18n/locales/de.json | 2 + frontend/src/i18n/locales/en.json | 2 + frontend/src/pages/admin/CreateEventPage.tsx | 62 ++++++++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/frontend/src/i18n/locales/de.json b/frontend/src/i18n/locales/de.json index 53a8641a..e87e9eef 100644 --- a/frontend/src/i18n/locales/de.json +++ b/frontend/src/i18n/locales/de.json @@ -1017,6 +1017,8 @@ "welcomeMessagePlaceholder": "Willkommen zu unserem besonderen Tag! Laden Sie diese Erinnerungen gerne herunter und teilen Sie sie...", "hostEmailPlaceholder": "kunde@beispiel.de", "adminEmailPlaceholder": "admin@beispiel.de", + "adminEmailPickFromAdmins": "Aus Admins wählen:", + "adminEmailCustom": "Eigene E-Mail", "securityAndAccess": "Sicherheit & Zugriff", "accessAndSecurity": "Zugriff & Sicherheit", "enterPassword": "Passwort eingeben", diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index 59da8cfb..8dc871e6 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -356,6 +356,8 @@ "welcomeMessagePlaceholder": "Welcome to our special day! Feel free to download and share these memories...", "hostEmailPlaceholder": "customer@example.com", "adminEmailPlaceholder": "admin@example.com", + "adminEmailPickFromAdmins": "Pick from admins:", + "adminEmailCustom": "Custom email", "securityAndAccess": "Security & Access", "accessAndSecurity": "Access & Security", "enterPassword": "Enter password", diff --git a/frontend/src/pages/admin/CreateEventPage.tsx b/frontend/src/pages/admin/CreateEventPage.tsx index bde500f9..d0d36ebc 100644 --- a/frontend/src/pages/admin/CreateEventPage.tsx +++ b/frontend/src/pages/admin/CreateEventPage.tsx @@ -25,6 +25,8 @@ import { settingsService } from '../../services/settings.service'; import { usePublicSettings } from '../../hooks/usePublicSettings'; import { cssTemplatesService } from '../../services/cssTemplates.service'; import { eventTypesService } from '../../services/eventTypes.service'; +import { userManagementService } from '../../services/userManagement.service'; +import { useAdminAuth } from '../../contexts/AdminAuthContext'; import { useTranslation } from 'react-i18next'; import { ThemeConfig, GALLERY_THEME_PRESETS } from '../../types/theme.types'; import { Code } from 'lucide-react'; @@ -172,6 +174,41 @@ export const CreateEventPage: React.FC = () => { const { data: publicSettings } = usePublicSettings(); + // Current logged-in admin (used to prefill the admin email field) + const { user: currentAdmin } = useAdminAuth(); + + // Optional: list of admin users — used to populate the email picker when + // there are multiple admins. Falls back to an empty list silently if the + // current user lacks `users.view` permission, so basic admins still get + // the auto-prefill from `currentAdmin` without errors surfacing. + const { data: adminUsers } = useQuery({ + queryKey: ['admin-users-list'], + queryFn: async () => { + try { + return await userManagementService.getUsers(); + } catch { + return []; + } + }, + staleTime: 5 * 60 * 1000, + retry: false + }); + + const activeAdmins = useMemo( + () => (adminUsers || []).filter(u => u.isActive !== false && !!u.email), + [adminUsers] + ); + + // Auto-prefill admin email with the current user's email exactly once, + // and only if the field is still empty (don't clobber typed input). + const didPrefillAdminEmailRef = useRef(false); + useEffect(() => { + if (didPrefillAdminEmailRef.current) return; + if (!currentAdmin?.email) return; + didPrefillAdminEmailRef.current = true; + setFormData(prev => (prev.admin_email ? prev : { ...prev, admin_email: currentAdmin.email })); + }, [currentAdmin?.email]); + // Get field requirements (default to true if not set) const requireCustomerName = publicSettings?.event_require_customer_name !== false; const requireCustomerEmail = publicSettings?.event_require_customer_email !== false; @@ -673,6 +710,31 @@ export const CreateEventPage: React.FC = () => { error={errors.admin_email} leftIcon={} /> + {activeAdmins.length > 1 && ( +
+ + +
+ )}
From 40d23e24cba548e8d41a5cb3a1a5aac2774b43c9 Mon Sep 17 00:00:00 2001 From: Luca <102960244+Luca-Timo@users.noreply.github.com> Date: Mon, 4 May 2026 11:45:41 +0200 Subject: [PATCH 2/4] i18n(events): translate admin email picker strings (nl/pt/ru) --- frontend/src/i18n/locales/nl.json | 2 ++ frontend/src/i18n/locales/pt.json | 2 ++ frontend/src/i18n/locales/ru.json | 2 ++ 3 files changed, 6 insertions(+) diff --git a/frontend/src/i18n/locales/nl.json b/frontend/src/i18n/locales/nl.json index fbbaa4f6..6c5c97bd 100644 --- a/frontend/src/i18n/locales/nl.json +++ b/frontend/src/i18n/locales/nl.json @@ -350,6 +350,8 @@ "welcomeMessagePlaceholder": "Welkom bij onze bijzondere dag! Voel u vrij om deze herinneringen te downloaden en te delen...", "hostEmailPlaceholder": "klant@voorbeeld.nl", "adminEmailPlaceholder": "admin@voorbeeld.nl", + "adminEmailPickFromAdmins": "Kies uit beheerders:", + "adminEmailCustom": "Aangepast e-mailadres", "securityAndAccess": "Beveiliging & Toegang", "accessAndSecurity": "Toegang & Beveiliging", "enterPassword": "Voer wachtwoord in", diff --git a/frontend/src/i18n/locales/pt.json b/frontend/src/i18n/locales/pt.json index 1e5c8b73..2f91101d 100644 --- a/frontend/src/i18n/locales/pt.json +++ b/frontend/src/i18n/locales/pt.json @@ -350,6 +350,8 @@ "welcomeMessagePlaceholder": "Bem-vindo(a) ao nosso dia especial! Sinta-se à vontade para baixar e compartilhar essas memórias...", "hostEmailPlaceholder": "cliente@exemplo.com", "adminEmailPlaceholder": "admin@exemplo.com", + "adminEmailPickFromAdmins": "Escolher entre administradores:", + "adminEmailCustom": "E-mail personalizado", "securityAndAccess": "Segurança e Acesso", "accessAndSecurity": "Acesso e Segurança", "enterPassword": "Digite a senha", diff --git a/frontend/src/i18n/locales/ru.json b/frontend/src/i18n/locales/ru.json index e895c762..1ade3951 100644 --- a/frontend/src/i18n/locales/ru.json +++ b/frontend/src/i18n/locales/ru.json @@ -350,6 +350,8 @@ "welcomeMessagePlaceholder": "Добро пожаловать на наш особый день! Скачивайте и делитесь этими воспоминаниями...", "hostEmailPlaceholder": "client@example.com", "adminEmailPlaceholder": "admin@example.com", + "adminEmailPickFromAdmins": "Выбрать из админов:", + "adminEmailCustom": "Произвольный e-mail", "securityAndAccess": "Безопасность и доступ", "accessAndSecurity": "Доступ и безопасность", "enterPassword": "Введите пароль", From 98c6f6cf062236baa62670e843d987447beddd30 Mon Sep 17 00:00:00 2001 From: Paul Nothaft Date: Mon, 4 May 2026 12:24:21 +0200 Subject: [PATCH 3/4] chore(events): type FolderTreeNode entries with ExternalEntry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to PR #378 — drops the (e: any) / (d: any) casts in the external-folder-tree picker. ExternalEntry is already exported from externalMedia.service.ts; the call site just wasn't using it. - Import the type alongside the service. - Annotate the dirs filter callback so `e.type` is the union 'dir' | 'file' instead of any. - Drop the (d: any) annotation from the map — TypeScript infers ExternalEntry from the typed `dirs` array. No behaviour change, no test impact. `npx tsc --noEmit` clean, `npx eslint` clean. --- frontend/src/pages/admin/EventDetailsPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/admin/EventDetailsPage.tsx b/frontend/src/pages/admin/EventDetailsPage.tsx index f06ff64c..b6886e5f 100644 --- a/frontend/src/pages/admin/EventDetailsPage.tsx +++ b/frontend/src/pages/admin/EventDetailsPage.tsx @@ -66,7 +66,7 @@ import { api } from '../../config/api'; import { buildResourceUrl, buildShareLinkUrl } from '../../utils/url'; import { isGalleryPublic, normalizeRequirePassword } from '../../utils/accessControl'; import { archiveService } from '../../services/archive.service'; -import { externalMediaService } from '../../services/externalMedia.service'; +import { externalMediaService, type ExternalEntry } from '../../services/externalMedia.service'; import { photosService, AdminPhoto, type PhotoFilters as PhotoFilterParams, type FeedbackFilters } from '../../services/photos.service'; import { feedbackService, FeedbackSettings as FeedbackSettingsType } from '../../services/feedback.service'; import { cssTemplatesService, type EnabledTemplate } from '../../services/cssTemplates.service'; @@ -92,7 +92,7 @@ const FolderTreeNode: React.FC<{ staleTime: 30_000 }); - const dirs = (data?.entries || []).filter((e: any) => e.type === 'dir'); + const dirs: ExternalEntry[] = (data?.entries || []).filter((e: ExternalEntry) => e.type === 'dir'); const showEmpty = isExpanded && !isLoading && !isError && dirs.length === 0; const indentStyle = { paddingLeft: depth * 16 + 4 }; const childIndentStyle = { paddingLeft: (depth + 1) * 16 + 4 }; @@ -158,7 +158,7 @@ const FolderTreeNode: React.FC<{ {t('events.externalFolderEmpty', 'No subfolders')}
)} - {dirs.map((d: any) => { + {dirs.map((d) => { const childPath = path ? `${path}/${d.name}` : d.name; return ( Date: Mon, 4 May 2026 11:33:17 +0000 Subject: [PATCH 4/4] chore(beta): release 3.36.0-beta.0 --- .release-please-manifest-beta.json | 2 +- CHANGELOG.md | 7 +++++++ backend/package.json | 2 +- frontend/package.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest-beta.json b/.release-please-manifest-beta.json index ff00dcac..17a99203 100644 --- a/.release-please-manifest-beta.json +++ b/.release-please-manifest-beta.json @@ -1,3 +1,3 @@ { - ".": "3.35.0-beta.0" + ".": "3.36.0-beta.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 67950a22..bcc87597 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to PicPeak will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.36.0-beta.0](https://github.com/the-luap/picpeak/compare/v3.35.0-beta.0...v3.36.0-beta.0) (2026-05-04) + + +### Features + +* **events:** prefill admin email + admin picker on event creation ([3fe8e61](https://github.com/the-luap/picpeak/commit/3fe8e61bd1175e35dcb61604447e5d9c2e902ec5)) + ## [3.35.0-beta.0](https://github.com/the-luap/picpeak/compare/v3.34.2-beta.0...v3.35.0-beta.0) (2026-05-04) diff --git a/backend/package.json b/backend/package.json index bce0acab..72d61772 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "picpeak-backend", - "version": "3.35.0-beta.0", + "version": "3.36.0-beta.0", "description": "Backend for PicPeak event photo sharing platform", "main": "server.js", "scripts": { diff --git a/frontend/package.json b/frontend/package.json index 956800e6..27c609dd 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "picpeak-frontend", "private": true, - "version": "3.35.0-beta.0", + "version": "3.36.0-beta.0", "type": "module", "scripts": { "dev": "vite",