Update Payload dependencies to 3.56.0 and implement DefaultTemplate layout

- Updated all @payloadcms/* dependencies from 3.37.0 to 3.56.0
- Implemented DefaultTemplate from @payloadcms/next/templates with proper props structure
- Fixed TypeScript compilation by adding proper Locale type import
- Feature flags admin interface now wrapped in PayloadCMS default admin layout with navigation sidebar
- Verified build process works with updated dependencies

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-03 16:38:31 +02:00
parent a267824239
commit bca558fad3
4 changed files with 406 additions and 655 deletions

View File

@@ -88,7 +88,7 @@ export interface Config {
'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>; 'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;
}; };
db: { db: {
defaultIDType: string; defaultIDType: number;
}; };
globals: {}; globals: {};
globalsSelect: {}; globalsSelect: {};
@@ -124,7 +124,7 @@ export interface UserAuthOperations {
* via the `definition` "posts". * via the `definition` "posts".
*/ */
export interface Post { export interface Post {
id: string; id: number;
title: string; title: string;
content?: { content?: {
root: { root: {
@@ -151,7 +151,7 @@ export interface Post {
* via the `definition` "pages". * via the `definition` "pages".
*/ */
export interface Page { export interface Page {
id: string; id: number;
title: string; title: string;
slug: string; slug: string;
content?: { content?: {
@@ -178,7 +178,7 @@ export interface Page {
* via the `definition` "users". * via the `definition` "users".
*/ */
export interface User { export interface User {
id: string; id: number;
name?: string | null; name?: string | null;
role?: ('admin' | 'editor' | 'user') | null; role?: ('admin' | 'editor' | 'user') | null;
updatedAt: string; updatedAt: string;
@@ -190,6 +190,13 @@ export interface User {
hash?: string | null; hash?: string | null;
loginAttempts?: number | null; loginAttempts?: number | null;
lockUntil?: string | null; lockUntil?: string | null;
sessions?:
| {
id: string;
createdAt?: string | null;
expiresAt: string;
}[]
| null;
password?: string | null; password?: string | null;
} }
/** /**
@@ -197,7 +204,7 @@ export interface User {
* via the `definition` "media". * via the `definition` "media".
*/ */
export interface Media { export interface Media {
id: string; id: number;
alt?: string | null; alt?: string | null;
updatedAt: string; updatedAt: string;
createdAt: string; createdAt: string;
@@ -218,7 +225,7 @@ export interface Media {
* via the `definition` "feature-flags". * via the `definition` "feature-flags".
*/ */
export interface FeatureFlag { export interface FeatureFlag {
id: string; id: number;
/** /**
* Unique identifier for the feature flag * Unique identifier for the feature flag
*/ */
@@ -291,7 +298,7 @@ export interface FeatureFlag {
/** /**
* Team member responsible for this feature flag * Team member responsible for this feature flag
*/ */
owner?: (string | null) | User; owner?: (number | null) | User;
/** /**
* Optional expiration date for temporary flags * Optional expiration date for temporary flags
*/ */
@@ -308,32 +315,32 @@ export interface FeatureFlag {
* via the `definition` "payload-locked-documents". * via the `definition` "payload-locked-documents".
*/ */
export interface PayloadLockedDocument { export interface PayloadLockedDocument {
id: string; id: number;
document?: document?:
| ({ | ({
relationTo: 'posts'; relationTo: 'posts';
value: string | Post; value: number | Post;
} | null) } | null)
| ({ | ({
relationTo: 'pages'; relationTo: 'pages';
value: string | Page; value: number | Page;
} | null) } | null)
| ({ | ({
relationTo: 'users'; relationTo: 'users';
value: string | User; value: number | User;
} | null) } | null)
| ({ | ({
relationTo: 'media'; relationTo: 'media';
value: string | Media; value: number | Media;
} | null) } | null)
| ({ | ({
relationTo: 'feature-flags'; relationTo: 'feature-flags';
value: string | FeatureFlag; value: number | FeatureFlag;
} | null); } | null);
globalSlug?: string | null; globalSlug?: string | null;
user: { user: {
relationTo: 'users'; relationTo: 'users';
value: string | User; value: number | User;
}; };
updatedAt: string; updatedAt: string;
createdAt: string; createdAt: string;
@@ -343,10 +350,10 @@ export interface PayloadLockedDocument {
* via the `definition` "payload-preferences". * via the `definition` "payload-preferences".
*/ */
export interface PayloadPreference { export interface PayloadPreference {
id: string; id: number;
user: { user: {
relationTo: 'users'; relationTo: 'users';
value: string | User; value: number | User;
}; };
key?: string | null; key?: string | null;
value?: value?:
@@ -366,7 +373,7 @@ export interface PayloadPreference {
* via the `definition` "payload-migrations". * via the `definition` "payload-migrations".
*/ */
export interface PayloadMigration { export interface PayloadMigration {
id: string; id: number;
name?: string | null; name?: string | null;
batch?: number | null; batch?: number | null;
updatedAt: string; updatedAt: string;
@@ -412,6 +419,13 @@ export interface UsersSelect<T extends boolean = true> {
hash?: T; hash?: T;
loginAttempts?: T; loginAttempts?: T;
lockUntil?: T; lockUntil?: T;
sessions?:
| T
| {
id?: T;
createdAt?: T;
expiresAt?: T;
};
} }
/** /**
* This interface was referenced by `Config`'s JSON-Schema * This interface was referenced by `Config`'s JSON-Schema

View File

@@ -52,13 +52,13 @@
}, },
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3.2.0", "@eslint/eslintrc": "^3.2.0",
"@payloadcms/db-mongodb": "3.37.0", "@payloadcms/db-mongodb": "3.56.0",
"@payloadcms/db-postgres": "3.37.0", "@payloadcms/db-postgres": "3.56.0",
"@payloadcms/db-sqlite": "3.37.0", "@payloadcms/db-sqlite": "3.56.0",
"@payloadcms/eslint-config": "3.9.0", "@payloadcms/eslint-config": "3.9.0",
"@payloadcms/next": "3.37.0", "@payloadcms/next": "3.56.0",
"@payloadcms/richtext-lexical": "3.37.0", "@payloadcms/richtext-lexical": "3.56.0",
"@payloadcms/ui": "3.37.0", "@payloadcms/ui": "3.56.0",
"@playwright/test": "^1.52.0", "@playwright/test": "^1.52.0",
"@swc-node/register": "1.10.9", "@swc-node/register": "1.10.9",
"@swc/cli": "0.6.0", "@swc/cli": "0.6.0",
@@ -74,7 +74,7 @@
"mongodb-memory-server": "10.1.4", "mongodb-memory-server": "10.1.4",
"next": "15.4.4", "next": "15.4.4",
"open": "^10.1.0", "open": "^10.1.0",
"payload": "3.37.0", "payload": "3.56.0",
"prettier": "^3.4.2", "prettier": "^3.4.2",
"qs-esm": "7.0.2", "qs-esm": "7.0.2",
"react": "19.1.0", "react": "19.1.0",
@@ -87,7 +87,7 @@
"vitest": "^3.1.2" "vitest": "^3.1.2"
}, },
"peerDependencies": { "peerDependencies": {
"payload": "^3.37.0" "payload": "^3.56.0"
}, },
"engines": { "engines": {
"node": "^18.20.2 || >=20.9.0", "node": "^18.20.2 || >=20.9.0",

970
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,8 @@ import {
useConfig, useConfig,
useTheme useTheme
} from '@payloadcms/ui' } from '@payloadcms/ui'
import { DefaultTemplate } from '@payloadcms/next/templates'
import type { Locale } from 'payload'
interface FeatureFlag { interface FeatureFlag {
id: string id: string
@@ -24,6 +26,14 @@ interface FeatureFlag {
} }
interface FeatureFlagsViewProps { interface FeatureFlagsViewProps {
i18n?: any
locale?: Locale
params?: Record<string, any>
payload?: any
permissions?: any
searchParams?: Record<string, any>
user?: any
visibleEntities?: any
[key: string]: any [key: string]: any
} }
@@ -615,8 +625,21 @@ const FeatureFlagsViewComponent = (props: FeatureFlagsViewProps = {}) => {
</div> </div>
) )
// Return the content directly - Payload handles the admin layout for custom views // Use DefaultTemplate with proper props structure
return <FeatureFlagsContent /> return (
<DefaultTemplate
i18n={props.i18n}
locale={props.locale}
params={props.params}
payload={props.payload}
permissions={props.permissions}
searchParams={props.searchParams}
user={props.user}
visibleEntities={props.visibleEntities}
>
<FeatureFlagsContent />
</DefaultTemplate>
)
} }
export const FeatureFlagsView = memo(FeatureFlagsViewComponent) export const FeatureFlagsView = memo(FeatureFlagsViewComponent)