@goplusvn/core 0.1.72 → 0.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/branding/__tests__/identity.test.ts +101 -0
- package/src/branding/__tests__/logo-route.test.ts +143 -0
- package/src/branding/identity.ts +74 -0
- package/src/branding/index.ts +36 -0
- package/src/branding/logo-route.ts +249 -0
- package/src/branding/pwa.tsx +146 -0
- package/src/branding/types.ts +45 -0
- package/src/styles/base.css +16 -0
- package/src/ui/errors/error-view.tsx +80 -87
- package/src/ui/errors/index.ts +6 -1
- package/src/ui/errors/not-found-view.tsx +89 -16
- package/src/ui/errors/status-page.tsx +132 -0
- package/src/ui/layout/logo.tsx +5 -0
- package/src/ui/pages/not-found.tsx +11 -27
- package/templates/starter-app/next.config.mjs +8 -0
- package/templates/starter-app/package.json +1 -0
- package/templates/starter-app/public/images/illustrations/characters/character-01.svg +33 -0
- package/templates/starter-app/public/images/illustrations/characters/character-02.svg +30 -0
- package/templates/starter-app/public/images/illustrations/characters/character-03.svg +30 -0
- package/templates/starter-app/public/images/illustrations/characters/character-04.svg +27 -0
- package/templates/starter-app/public/images/logos/goeat_logo.png +0 -0
- package/templates/starter-app/src/app/[lang]/(main)/admin/system/company/company-profile-form.tsx +21 -5
- package/templates/starter-app/src/app/[lang]/layout.tsx +26 -1
- package/templates/starter-app/src/app/api/branding/logo/route.ts +25 -0
- package/templates/starter-app/src/app/layout.tsx +42 -1
- package/templates/starter-app/src/app/manifest.ts +23 -19
- package/templates/starter-app/src/configs/tenant.ts +6 -1
- package/templates/starter-app/src/providers/index.tsx +12 -2
- package/templates/starter-app/src/proxy.ts +3 -1
|
@@ -7,12 +7,13 @@ import { ErrorDialogProvider } from "@goerp/core/ui/feedback"
|
|
|
7
7
|
import { SidebarProvider } from "@goerp/core/ui/primitives"
|
|
8
8
|
import { Toaster } from "sonner"
|
|
9
9
|
|
|
10
|
+
import type { TenantConfig } from "@goerp/core/providers"
|
|
10
11
|
import type { LocaleType } from "@goerp/core/types"
|
|
11
12
|
import type { ReactNode } from "react"
|
|
12
13
|
|
|
13
14
|
import { navigations } from "@/data/navigations"
|
|
14
15
|
|
|
15
|
-
import { tenant } from "@/configs/tenant"
|
|
16
|
+
import { tenant as staticTenant } from "@/configs/tenant"
|
|
16
17
|
import { authBridgeClient } from "@/lib/auth-client"
|
|
17
18
|
|
|
18
19
|
import { ModeProvider } from "./mode-provider"
|
|
@@ -21,14 +22,23 @@ import { ThemeProvider } from "./theme-provider"
|
|
|
21
22
|
export function Providers({
|
|
22
23
|
children,
|
|
23
24
|
locale,
|
|
25
|
+
tenant = staticTenant,
|
|
24
26
|
}: {
|
|
25
27
|
children: ReactNode
|
|
26
28
|
locale: LocaleType
|
|
29
|
+
/**
|
|
30
|
+
* Bản tenant đã áp hồ sơ công ty từ DB — layout server dựng bằng
|
|
31
|
+
* `resolveBranding` + `tenantWithBranding` của `@goerp/core/branding`.
|
|
32
|
+
* Thứ tự thương hiệu: HỒ SƠ CÔNG TY (admin upload) → tenant config tĩnh →
|
|
33
|
+
* logo GoEat mặc định trong `public/`. Bỏ trống ⇒ dùng cấu hình tĩnh.
|
|
34
|
+
*/
|
|
35
|
+
tenant?: TenantConfig
|
|
27
36
|
}) {
|
|
28
37
|
return (
|
|
29
38
|
<SettingsProvider locale={locale}>
|
|
30
39
|
{/* TenantProvider cấp branding (logo / tên / màu chủ đạo) cho Logo và cả
|
|
31
|
-
vỏ app.
|
|
40
|
+
vỏ app. Logo/tên đến từ "Hồ sơ công ty"; màu chủ đạo và tagline vẫn ở
|
|
41
|
+
src/configs/tenant.ts. */}
|
|
32
42
|
<TenantProvider tenant={tenant}>
|
|
33
43
|
<ModeProvider>
|
|
34
44
|
<ThemeProvider>
|
|
@@ -24,7 +24,9 @@ export const proxy = createAuthProxy({
|
|
|
24
24
|
// và cả đường NGOÀI /api (máy móc không có cookie kiểu /pub, /iclock của
|
|
25
25
|
// máy chấm công). Mỗi entry phải ghi rõ nó tự bảo vệ bằng gì; guardrail
|
|
26
26
|
// `auth/route-outside-api-declared` sẽ bắt route ngoài /api chưa khai ở đây.
|
|
27
|
-
|
|
27
|
+
// /api/branding: logo công ty phục vụ favicon + trang đăng nhập — hai bề mặt
|
|
28
|
+
// render TRƯỚC khi có phiên. Route chỉ lộ đúng cột logo, không đọc gì khác.
|
|
29
|
+
publicPrefixes: ["/api/better-auth", "/api/public", "/api/branding"],
|
|
28
30
|
publicPages: [...i18n.locales.map((l) => `/${l}/sign-in`), "/sign-in"],
|
|
29
31
|
signInPath: `/${i18n.defaultLocale}/sign-in`,
|
|
30
32
|
homePath: `/${i18n.defaultLocale}`,
|