Task #352: Make logo upload always visible for admin users
Previously, the logo upload field in Font Settings was hidden behind two conditions: canEditGlobal AND scope === "global". Admin users had to first switch the scope dropdown to "Global" before the logo upload appeared, making it very hard to discover. Changes: - Frontend (executive-meetings.tsx): Removed `scope === "global"` condition from logo upload rendering — now shows whenever `canEditGlobal` is true (admin/executive_office_manager). - Frontend: Save function now always sends `logoObjectPath` when `canEditGlobal` is true, regardless of selected scope. - Backend (executive-meetings.ts): When an admin saves with user scope and includes logoObjectPath, the logo is written to the global row (upsert) in the same transaction. This preserves the global-only semantics while allowing admins to update the logo from any scope. - When no global row exists, new row uses safe defaults (system font, 14px, regular, start, #000000) instead of copying the user's prefs. - Removed the 400 rejection for logoObjectPath on user-scope saves. - Authorization preserved: only EM_ADMIN_ROLES can trigger logo writes. Tested: - API: PATCH with scope=user + logoObjectPath correctly updates global row - E2E: Logo upload field visible for admin in user scope (confirmed) - Code review: APPROVED (addressed comment about safe defaults) - Pre-existing test failures unchanged (PDF font assertion, notification tests)
This commit is contained in:
@@ -2965,11 +2965,11 @@ const upsertFontSettingsHandler = async (
|
||||
.values({
|
||||
scope: "global",
|
||||
userId: null,
|
||||
fontFamily: data.fontFamily,
|
||||
fontSize: data.fontSize,
|
||||
fontWeight: data.fontWeight,
|
||||
alignment: data.alignment,
|
||||
fontColor: data.fontColor,
|
||||
fontFamily: "system",
|
||||
fontSize: 14,
|
||||
fontWeight: "regular",
|
||||
alignment: "start",
|
||||
fontColor: "#000000",
|
||||
logoObjectPath: data.logoObjectPath ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user