feat: draft mode, admin branding, and workflow improvements
Draft Mode: - Events are created as drafts by default — no email sent until published - Add "Publish & Notify Client" button with confirmation dialog - Draft banner with yellow styling on event details page - Draft filter tab in events list - Gallery middleware blocks public access to draft events - Migration 076 adds is_draft column to events table Admin Draft Preview: - Admins can preview draft galleries via JWT preview token (?preview=) - "View Gallery" link on drafts auto-appends preview token Admin & Login Page Branding: - Admin header uses configured company logo/name from branding settings - Login page shows configured logo instead of hardcoded PicPeak - Respects logo_display_mode (logo_only, text_only, logo_and_text) OG Tag Branding: - DynamicFavicon component updates OG meta tags and page title from branding settings Editable Client Email: - Customer email is now editable after event creation in edit mode Branding Inheritance: - New events inherit hero logo settings (visibility, size, position) from global branding configuration Share Link Full Domain URL: - New getFrontendBaseUrl() utility with DB fallback to general_site_url - Used in email processor and share link service
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
const { db } = require('../database/db');
|
||||
|
||||
const getFrontendBaseUrl = async () => {
|
||||
let base = (process.env.FRONTEND_URL || '').trim().replace(/\/$/, '');
|
||||
if (base) return base;
|
||||
|
||||
try {
|
||||
const setting = await db('app_settings')
|
||||
.where('setting_key', 'general_site_url')
|
||||
.select('setting_value')
|
||||
.first();
|
||||
|
||||
if (setting && setting.setting_value) {
|
||||
let val = setting.setting_value;
|
||||
if (typeof val === 'string') {
|
||||
try { val = JSON.parse(val); } catch (_) {}
|
||||
}
|
||||
if (typeof val === 'string' && val.trim()) {
|
||||
base = val.trim().replace(/\/$/, '');
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
|
||||
return base;
|
||||
};
|
||||
|
||||
module.exports = { getFrontendBaseUrl };
|
||||
Reference in New Issue
Block a user