From 9e8d101d6392bc2e15866693525eb37d5611f7e4 Mon Sep 17 00:00:00 2001 From: jubnl Date: Wed, 15 Apr 2026 20:23:31 +0200 Subject: [PATCH] fix(ntfy): improve admin ntfy UX and add clear token button - Add missing admin.ntfy.hint translation key in all 15 languages - Add admin ntfy server hint clarifying it is the default for users - Expose admin_ntfy_server via PreferencesMatrix so user settings placeholder reflects the admin-configured default - Add clear token button to admin ntfy panel (same pattern as user settings) - Extract common.clear from settings.ntfyUrl.clearToken across all 15 languages --- .../components/Settings/NotificationsTab.tsx | 5 +-- client/src/i18n/translations/ar.ts | 5 ++- client/src/i18n/translations/br.ts | 5 ++- client/src/i18n/translations/cs.ts | 5 ++- client/src/i18n/translations/de.ts | 5 ++- client/src/i18n/translations/en.ts | 5 ++- client/src/i18n/translations/es.ts | 5 ++- client/src/i18n/translations/fr.ts | 5 ++- client/src/i18n/translations/hu.ts | 5 ++- client/src/i18n/translations/id.ts | 5 ++- client/src/i18n/translations/it.ts | 5 ++- client/src/i18n/translations/nl.ts | 5 ++- client/src/i18n/translations/pl.ts | 5 ++- client/src/i18n/translations/ru.ts | 5 ++- client/src/i18n/translations/zh.ts | 5 ++- client/src/i18n/translations/zhTw.ts | 5 ++- client/src/pages/AdminPage.tsx | 31 ++++++++++++++----- .../notificationPreferencesService.ts | 2 ++ 18 files changed, 89 insertions(+), 24 deletions(-) diff --git a/client/src/components/Settings/NotificationsTab.tsx b/client/src/components/Settings/NotificationsTab.tsx index 4978926b..2b936892 100644 --- a/client/src/components/Settings/NotificationsTab.tsx +++ b/client/src/components/Settings/NotificationsTab.tsx @@ -11,6 +11,7 @@ interface PreferencesMatrix { available_channels: { email: boolean; webhook: boolean; inapp: boolean; ntfy: boolean } event_types: string[] implemented_combos: Record + defaults?: { ntfyServer: string | null } } const CHANNEL_LABEL_KEYS: Record = { @@ -233,7 +234,7 @@ export default function NotificationsTab(): React.ReactElement { type="text" value={ntfyServer} onChange={e => setNtfyServer(e.target.value)} - placeholder={t('settings.ntfyUrl.serverPlaceholder')} + placeholder={matrix.defaults?.ntfyServer || t('settings.ntfyUrl.serverPlaceholder')} style={{ width: '100%', boxSizing: 'border-box', fontSize: 13, padding: '6px 10px', border: '1px solid var(--border-primary)', borderRadius: 6, background: 'var(--bg-primary)', color: 'var(--text-primary)', marginBottom: 6 }} />