fix branding favicon and subtitle texts

This commit is contained in:
miloschwartz
2025-12-06 16:16:25 -05:00
parent 6329c3d140
commit 1714140ee7
9 changed files with 23 additions and 40 deletions

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -83,9 +83,6 @@ export class PrivateConfig {
? this.rawPrivateConfig.branding?.logo?.navbar?.height.toString() ? this.rawPrivateConfig.branding?.logo?.navbar?.height.toString()
: undefined; : undefined;
process.env.BRANDING_FAVICON_PATH =
this.rawPrivateConfig.branding?.favicon_path;
process.env.BRANDING_APP_NAME = process.env.BRANDING_APP_NAME =
this.rawPrivateConfig.branding?.app_name || "Pangolin"; this.rawPrivateConfig.branding?.app_name || "Pangolin";
@@ -95,13 +92,9 @@ export class PrivateConfig {
); );
} }
process.env.LOGIN_PAGE_TITLE_TEXT =
this.rawPrivateConfig.branding?.login_page?.title_text || "";
process.env.LOGIN_PAGE_SUBTITLE_TEXT = process.env.LOGIN_PAGE_SUBTITLE_TEXT =
this.rawPrivateConfig.branding?.login_page?.subtitle_text || ""; this.rawPrivateConfig.branding?.login_page?.subtitle_text || "";
process.env.SIGNUP_PAGE_TITLE_TEXT =
this.rawPrivateConfig.branding?.signup_page?.title_text || "";
process.env.SIGNUP_PAGE_SUBTITLE_TEXT = process.env.SIGNUP_PAGE_SUBTITLE_TEXT =
this.rawPrivateConfig.branding?.signup_page?.subtitle_text || ""; this.rawPrivateConfig.branding?.signup_page?.subtitle_text || "";

View File

@@ -115,7 +115,6 @@ export const privateConfigSchema = z.object({
.optional() .optional()
}) })
.optional(), .optional(),
favicon_path: z.string().optional(),
footer: z footer: z
.array( .array(
z.object({ z.object({
@@ -127,14 +126,12 @@ export const privateConfigSchema = z.object({
hide_auth_layout_footer: z.boolean().optional().default(false), hide_auth_layout_footer: z.boolean().optional().default(false),
login_page: z login_page: z
.object({ .object({
subtitle_text: z.string().optional(), subtitle_text: z.string().optional()
title_text: z.string().optional()
}) })
.optional(), .optional(),
signup_page: z signup_page: z
.object({ .object({
subtitle_text: z.string().optional(), subtitle_text: z.string().optional()
title_text: z.string().optional()
}) })
.optional(), .optional(),
resource_auth_page: z resource_auth_page: z

View File

@@ -31,7 +31,7 @@ export async function ensureSetupToken() {
// If admin exists, no need for setup token // If admin exists, no need for setup token
if (existingAdmin) { if (existingAdmin) {
logger.warn("Server admin exists. Setup token generation skipped."); logger.debug("Server admin exists. Setup token generation skipped.");
return; return;
} }
@@ -70,4 +70,4 @@ export async function ensureSetupToken() {
console.error("Failed to ensure setup token:", error); console.error("Failed to ensure setup token:", error);
throw error; throw error;
} }
} }

View File

@@ -25,19 +25,7 @@ import { TailwindIndicator } from "@app/components/TailwindIndicator";
export const metadata: Metadata = { export const metadata: Metadata = {
title: `Dashboard - ${process.env.BRANDING_APP_NAME || "Pangolin"}`, title: `Dashboard - ${process.env.BRANDING_APP_NAME || "Pangolin"}`,
description: "", description: ""
...(process.env.BRANDING_FAVICON_PATH
? {
icons: {
icon: [
{
url: process.env.BRANDING_FAVICON_PATH as string
}
]
}
}
: {})
}; };
export const dynamic = "force-dynamic"; export const dynamic = "force-dynamic";

View File

@@ -35,6 +35,9 @@ export default function DashboardLoginForm({
const { isUnlocked } = useLicenseStatusContext(); const { isUnlocked } = useLicenseStatusContext();
function getSubtitle() { function getSubtitle() {
if (isUnlocked() && env.branding?.loginPage?.subtitleText) {
return env.branding.loginPage.subtitleText;
}
return t("loginStart"); return t("loginStart");
} }

View File

@@ -15,11 +15,7 @@ import {
FormLabel, FormLabel,
FormMessage FormMessage
} from "@/components/ui/form"; } from "@/components/ui/form";
import { import { Card, CardContent, CardHeader } from "@/components/ui/card";
Card,
CardContent,
CardHeader,
} from "@/components/ui/card";
import { Alert, AlertDescription } from "@/components/ui/alert"; import { Alert, AlertDescription } from "@/components/ui/alert";
import { Progress } from "@/components/ui/progress"; import { Progress } from "@/components/ui/progress";
import { SignUpResponse } from "@server/routers/auth"; import { SignUpResponse } from "@server/routers/auth";
@@ -147,7 +143,8 @@ export default function SignupForm({
inviteId, inviteId,
inviteToken, inviteToken,
termsAcceptedTimestamp: termsAgreedAt, termsAcceptedTimestamp: termsAgreedAt,
marketingEmailConsent: build === "saas" ? marketingEmailConsent : undefined marketingEmailConsent:
build === "saas" ? marketingEmailConsent : undefined
}) })
.catch((e) => { .catch((e) => {
console.error(e); console.error(e);
@@ -179,6 +176,9 @@ export default function SignupForm({
} }
function getSubtitle() { function getSubtitle() {
if (isUnlocked() && env.branding?.signupPage?.subtitleText) {
return env.branding.signupPage.subtitleText;
}
return t("authCreateAccount"); return t("authCreateAccount");
} }
@@ -501,7 +501,9 @@ export default function SignupForm({
<FormControl> <FormControl>
<Checkbox <Checkbox
checked={field.value} checked={field.value}
onCheckedChange={(checked) => { onCheckedChange={(
checked
) => {
field.onChange(checked); field.onChange(checked);
handleTermsChange( handleTermsChange(
checked as boolean checked as boolean
@@ -551,12 +553,16 @@ export default function SignupForm({
<FormControl> <FormControl>
<Checkbox <Checkbox
checked={field.value} checked={field.value}
onCheckedChange={field.onChange} onCheckedChange={
field.onChange
}
/> />
</FormControl> </FormControl>
<div className="leading-none"> <div className="leading-none">
<FormLabel className="text-sm font-normal"> <FormLabel className="text-sm font-normal">
{t("signUpMarketing.keepMeInTheLoop")} {t(
"signUpMarketing.keepMeInTheLoop"
)}
</FormLabel> </FormLabel>
<FormMessage /> <FormMessage />
</div> </div>

View File

@@ -89,11 +89,9 @@ export function pullEnv(): Env {
} }
}, },
loginPage: { loginPage: {
titleText: process.env.LOGIN_PAGE_TITLE_TEXT as string,
subtitleText: process.env.LOGIN_PAGE_SUBTITLE_TEXT as string subtitleText: process.env.LOGIN_PAGE_SUBTITLE_TEXT as string
}, },
signupPage: { signupPage: {
titleText: process.env.SIGNUP_PAGE_TITLE_TEXT as string,
subtitleText: process.env.SIGNUP_PAGE_SUBTITLE_TEXT as string subtitleText: process.env.SIGNUP_PAGE_SUBTITLE_TEXT as string
}, },
resourceAuthPage: { resourceAuthPage: {

View File

@@ -50,11 +50,9 @@ export type Env = {
}; };
}; };
loginPage: { loginPage: {
titleText?: string;
subtitleText?: string; subtitleText?: string;
}; };
signupPage: { signupPage: {
titleText?: string;
subtitleText?: string; subtitleText?: string;
}; };
resourceAuthPage: { resourceAuthPage: {