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

View File

@@ -52,13 +52,13 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@payloadcms/db-mongodb": "3.37.0",
"@payloadcms/db-postgres": "3.37.0",
"@payloadcms/db-sqlite": "3.37.0",
"@payloadcms/db-mongodb": "3.56.0",
"@payloadcms/db-postgres": "3.56.0",
"@payloadcms/db-sqlite": "3.56.0",
"@payloadcms/eslint-config": "3.9.0",
"@payloadcms/next": "3.37.0",
"@payloadcms/richtext-lexical": "3.37.0",
"@payloadcms/ui": "3.37.0",
"@payloadcms/next": "3.56.0",
"@payloadcms/richtext-lexical": "3.56.0",
"@payloadcms/ui": "3.56.0",
"@playwright/test": "^1.52.0",
"@swc-node/register": "1.10.9",
"@swc/cli": "0.6.0",
@@ -74,7 +74,7 @@
"mongodb-memory-server": "10.1.4",
"next": "15.4.4",
"open": "^10.1.0",
"payload": "3.37.0",
"payload": "3.56.0",
"prettier": "^3.4.2",
"qs-esm": "7.0.2",
"react": "19.1.0",
@@ -87,7 +87,7 @@
"vitest": "^3.1.2"
},
"peerDependencies": {
"payload": "^3.37.0"
"payload": "^3.56.0"
},
"engines": {
"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,
useTheme
} from '@payloadcms/ui'
import { DefaultTemplate } from '@payloadcms/next/templates'
import type { Locale } from 'payload'
interface FeatureFlag {
id: string
@@ -24,6 +26,14 @@ interface FeatureFlag {
}
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
}
@@ -615,8 +625,21 @@ const FeatureFlagsViewComponent = (props: FeatureFlagsViewProps = {}) => {
</div>
)
// Return the content directly - Payload handles the admin layout for custom views
return <FeatureFlagsContent />
// Use DefaultTemplate with proper props structure
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)