Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7eed7a01df | ||
|
|
a7be2baab2 | ||
|
|
5a9137e252 | ||
|
|
4e63a78e8e | ||
|
|
2a067a3687 | ||
|
|
bdae0c6b08 |
@@ -7,6 +7,19 @@ and this project follows [Semantic Versioning](https://semver.org/).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.9.2] - 2026-08-22
|
||||
|
||||
### Fixed
|
||||
|
||||
- Contact-only events (no registration possible) were still getting the daily summary email — it now skips them since there's nothing to summarize.
|
||||
|
||||
## [1.9.1] - 2026-08-22
|
||||
|
||||
### Fixed
|
||||
|
||||
- The browser tab title and homepage "Welcome to..." heading always showed the app's built-in default name instead of the organisation name configured in Site Settings → Organisation.
|
||||
- The backend's status page (`/`) and API docs page (`/docs`) always showed "Cross Code Events" instead of the configured organisation name.
|
||||
|
||||
## [1.9.0] - 2026-08-21
|
||||
|
||||
### Added
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "event-management-backend",
|
||||
"version": "1.9.0",
|
||||
"version": "1.9.2",
|
||||
"description": "Event Management System Backend",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -141,7 +141,8 @@ app.use('/api', costRoutes);
|
||||
app.use('/api/cashups', cashupRoutes);
|
||||
|
||||
// Pre-warm the settings cache so synchronous helpers have DB values from startup
|
||||
require('./utils/settingsCache').warmCache().catch(() => {});
|
||||
const { getSettingSync, warmCache } = require('./utils/settingsCache');
|
||||
warmCache().catch(() => {});
|
||||
app.use('/uploads', express.static('public/uploads'));
|
||||
|
||||
// ── Shared page helpers ────────────────────────────────────────────────────────
|
||||
@@ -244,8 +245,9 @@ app.get('/', async (req, res) => {
|
||||
? `<span class="badge badge-warn">testing</span>`
|
||||
: `<span class="badge badge-warn">development</span>`;
|
||||
|
||||
const html = pageShell('Cross Code Events API — Status', '#2563eb', `
|
||||
<h1>Cross Code Events API</h1>
|
||||
const orgName = getSettingSync('org_name', process.env.ORG_NAME || 'Cross Code');
|
||||
const html = pageShell(`${orgName} Events API — Status`, '#2563eb', `
|
||||
<h1>${orgName} Events API</h1>
|
||||
<p class="subtitle">v${API_VERSION} — ${now}</p>
|
||||
|
||||
<div class="stat-grid">
|
||||
@@ -1030,13 +1032,14 @@ app.get('/docs', async (req, res) => {
|
||||
}
|
||||
|
||||
const notificationsHtml = NOTIFICATIONS.map(renderNotificationCategory).join('');
|
||||
const orgName = getSettingSync('org_name', process.env.ORG_NAME || 'Cross Code');
|
||||
|
||||
const html = `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Cross Code Events — API Docs</title>
|
||||
<title>${orgName} Events — API Docs</title>
|
||||
<style>
|
||||
*{box-sizing:border-box;margin:0;padding:0}
|
||||
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f3f4f6;color:#1f2937;min-height:100vh;padding:24px 16px}
|
||||
@@ -1060,7 +1063,7 @@ app.get('/docs', async (req, res) => {
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<div style="display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-bottom:6px">
|
||||
<h1 style="font-size:1.4rem;font-weight:700;color:#111827">Cross Code Events — API Reference</h1>
|
||||
<h1 style="font-size:1.4rem;font-weight:700;color:#111827">${orgName} Events — API Reference</h1>
|
||||
<a href="/" style="font-size:.82rem;color:#6b7280">← Status page</a>
|
||||
</div>
|
||||
<p style="font-size:.82rem;color:#6b7280;margin-bottom:20px">
|
||||
@@ -1087,7 +1090,7 @@ app.get('/docs', async (req, res) => {
|
||||
${notificationsHtml}
|
||||
|
||||
<p style="font-size:.72rem;color:#9ca3af;margin-top:28px;text-align:center">
|
||||
Cross Code Events API v${API_VERSION} — ${new Date().toISOString()}
|
||||
${orgName} Events API v${API_VERSION} — ${new Date().toISOString()}
|
||||
</p>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
@@ -1370,14 +1370,14 @@ async function sendDailyEventSummaries(now = new Date()) {
|
||||
const today = new Date(now);
|
||||
const notifyInclude = { createdBy: { select: { id: true, name: true, email: true } }, notifyRecipients: { select: { id: true, name: true, email: true } } };
|
||||
let events = await prisma.event.findMany({
|
||||
where: { isActive: true, startDate: { gte: today } },
|
||||
where: { isActive: true, startDate: { gte: today }, requiresRegistration: true },
|
||||
include: notifyInclude,
|
||||
orderBy: { startDate: 'asc' },
|
||||
});
|
||||
|
||||
try {
|
||||
events = await prisma.event.findMany({
|
||||
where: { isActive: true, startDate: { gte: today }, goLiveAt: { lte: today } },
|
||||
where: { isActive: true, startDate: { gte: today }, goLiveAt: { lte: today }, requiresRegistration: true },
|
||||
include: notifyInclude,
|
||||
orderBy: { startDate: 'asc' },
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hope-events-frontend",
|
||||
"version": "1.9.0",
|
||||
"version": "1.9.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
|
||||
@@ -44,10 +44,11 @@ async function getServerSettings(): Promise<SiteSettings> {
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const settings = await getServerSettings();
|
||||
const faviconUrl = settings.favicon_url ? resolveToApiOrigin(settings.favicon_url) : null;
|
||||
const displayName = settings.org_name || appName;
|
||||
|
||||
return {
|
||||
title: appName,
|
||||
description: `Manage and register for events with ${appName}`,
|
||||
title: displayName,
|
||||
description: `Manage and register for events with ${displayName}`,
|
||||
icons: {
|
||||
icon: faviconUrl || "/favicon.ico",
|
||||
},
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Navbar } from "@/components/layout/Navbar";
|
||||
import { Footer } from "@/components/layout/Footer";
|
||||
import { JoinUsButton } from "@/components/home/JoinUsButton";
|
||||
import { appName } from "@/lib/siteConfig";
|
||||
import { API_BASE } from "@/lib/api";
|
||||
import { Calendar, ArrowRight, CalendarCheck, Users, Heart, ShieldCheck } from "lucide-react";
|
||||
|
||||
type Event = {
|
||||
@@ -26,8 +27,22 @@ const FEATURES = [
|
||||
{ icon: Heart, title: "Make an Impact", description: "Be part of what God is doing and make a difference together." },
|
||||
];
|
||||
|
||||
async function getOrgName(): Promise<string> {
|
||||
try {
|
||||
const res = await fetch(`${API_BASE}/api/settings`, { next: { revalidate: 60 } });
|
||||
if (!res.ok) return appName;
|
||||
const settings = await res.json();
|
||||
return settings?.org_name || appName;
|
||||
} catch {
|
||||
return appName;
|
||||
}
|
||||
}
|
||||
|
||||
export default async function HomePage() {
|
||||
const events = await apiFetch<Event[]>("/api/events", { nextOptions: { next: { revalidate: 60 } } });
|
||||
const [events, displayName] = await Promise.all([
|
||||
apiFetch<Event[]>("/api/events", { nextOptions: { next: { revalidate: 60 } } }),
|
||||
getOrgName(),
|
||||
]);
|
||||
const now = Date.now();
|
||||
const upcoming = (events || []).filter(e => {
|
||||
const t = new Date(e.startDate).getTime();
|
||||
@@ -52,7 +67,7 @@ export default async function HomePage() {
|
||||
{sorted.length} upcoming event{sorted.length === 1 ? "" : "s"}
|
||||
</div>
|
||||
)}
|
||||
<h1 className="text-4xl sm:text-5xl font-bold mb-4 text-gray-900">Welcome to {appName}</h1>
|
||||
<h1 className="text-4xl sm:text-5xl font-bold mb-4 text-gray-900">Welcome to {displayName}</h1>
|
||||
<p className="text-gray-600 text-lg mb-8">Experience unforgettable moments. Powered by purpose.</p>
|
||||
<div className="flex flex-wrap items-center justify-center gap-3">
|
||||
<a href="/events" className="inline-flex items-center gap-2 px-6 py-2.5 bg-brand-600 text-white rounded-xl hover:bg-brand-700 shadow-sm font-medium transition-colors">
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hope-events",
|
||||
"version": "1.9.0",
|
||||
"version": "1.9.2",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"dev:backend": "cd backend && npm run dev",
|
||||
|
||||
Reference in New Issue
Block a user