From bdae0c6b087d9a5d08b78568237bf3cb6bea7d3f Mon Sep 17 00:00:00 2001 From: joshua Date: Sat, 22 Aug 2026 21:09:35 +0200 Subject: [PATCH] Fix org name not showing in tab title, homepage, and backend pages The browser tab title, homepage "Welcome to..." heading, and the backend status/API docs pages all had the "Cross Code" default hardcoded instead of reading the configured org_name setting. Co-Authored-By: Claude Sonnet 5 --- CHANGELOG.md | 5 +++++ backend/src/index.js | 15 +++++++++------ frontend/src/app/layout.tsx | 5 +++-- frontend/src/app/page.tsx | 19 +++++++++++++++++-- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6242bef..5154c58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project follows [Semantic Versioning](https://semver.org/). ## [Unreleased] +### 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 diff --git a/backend/src/index.js b/backend/src/index.js index 5490669..9810b88 100644 --- a/backend/src/index.js +++ b/backend/src/index.js @@ -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) => { ? `testing` : `development`; - const html = pageShell('Cross Code Events API — Status', '#2563eb', ` -

Cross Code Events API

+ const orgName = getSettingSync('org_name', process.env.ORG_NAME || 'Cross Code'); + const html = pageShell(`${orgName} Events API — Status`, '#2563eb', ` +

${orgName} Events API

v${API_VERSION} — ${now}

@@ -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 = ` - Cross Code Events — API Docs + ${orgName} Events — API Docs