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()
: undefined;
process.env.BRANDING_FAVICON_PATH =
this.rawPrivateConfig.branding?.favicon_path;
process.env.BRANDING_APP_NAME =
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 =
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 =
this.rawPrivateConfig.branding?.signup_page?.subtitle_text || "";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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