v1.3.1: 어나운스 바·가입 금지 닉네임·설정 UI 개선
공개 상단 어나운스 바와 관리자 맞춤 설정을 추가하고, 스팸 필터에서 가입 금지 닉네임을 관리·검증한다. POST 설정 읽기 모드 비활성 토글과 설정 내비 아이콘 틀을 반영한다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,6 +9,10 @@ import { getDefaultNavigationItems } from '../utils/navigation-items'
|
||||
import { buildPublicPrimaryTree, orderNavigationItemsForInsert } from '../utils/navigation-tree'
|
||||
import { getDefaultSiteSettings } from '../utils/site-settings'
|
||||
import { toAdminPostFormTitle } from '../../lib/admin-post-title.js'
|
||||
import {
|
||||
normalizeSignupBlockedUsernames,
|
||||
parseSignupBlockedUsernamesFromDb
|
||||
} from '../../lib/signup-blocked-usernames.js'
|
||||
import { getPostgresClient } from './postgres-client'
|
||||
|
||||
/**
|
||||
@@ -97,6 +101,11 @@ const mapSiteSettingsRow = (row) => ({
|
||||
homeCoverImageUrl: row.home_cover_image_url || '',
|
||||
homeCoverTitle: row.home_cover_title || '',
|
||||
homeCoverText: row.home_cover_text || '',
|
||||
announcementEnabled: Boolean(row.announcement_enabled),
|
||||
announcementText: row.announcement_text || '',
|
||||
announcementUrl: row.announcement_url || '',
|
||||
announcementBackgroundColor: row.announcement_background_color || '#15171a',
|
||||
signupBlockedUsernames: parseSignupBlockedUsernamesFromDb(row.signup_blocked_usernames),
|
||||
updatedAt: row.updated_at.toISOString()
|
||||
})
|
||||
|
||||
@@ -816,6 +825,11 @@ export const updateSiteSettings = async (input) => {
|
||||
home_cover_image_url,
|
||||
home_cover_title,
|
||||
home_cover_text,
|
||||
announcement_enabled,
|
||||
announcement_text,
|
||||
announcement_url,
|
||||
announcement_background_color,
|
||||
signup_blocked_usernames,
|
||||
updated_at
|
||||
)
|
||||
VALUES (
|
||||
@@ -831,6 +845,11 @@ export const updateSiteSettings = async (input) => {
|
||||
${input.homeCoverImageUrl || ''},
|
||||
${input.homeCoverTitle || ''},
|
||||
${input.homeCoverText || ''},
|
||||
${input.announcementEnabled ? true : false},
|
||||
${input.announcementText || ''},
|
||||
${input.announcementUrl || ''},
|
||||
${input.announcementBackgroundColor || '#15171a'},
|
||||
${JSON.stringify(normalizeSignupBlockedUsernames(input.signupBlockedUsernames))},
|
||||
now()
|
||||
)
|
||||
ON CONFLICT (id) DO UPDATE
|
||||
@@ -846,6 +865,11 @@ export const updateSiteSettings = async (input) => {
|
||||
home_cover_image_url = EXCLUDED.home_cover_image_url,
|
||||
home_cover_title = EXCLUDED.home_cover_title,
|
||||
home_cover_text = EXCLUDED.home_cover_text,
|
||||
announcement_enabled = EXCLUDED.announcement_enabled,
|
||||
announcement_text = EXCLUDED.announcement_text,
|
||||
announcement_url = EXCLUDED.announcement_url,
|
||||
announcement_background_color = EXCLUDED.announcement_background_color,
|
||||
signup_blocked_usernames = EXCLUDED.signup_blocked_usernames,
|
||||
updated_at = now()
|
||||
RETURNING *
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user