fix(ui): admin.dependencies components not added to client config (#7928)
This commit is contained in:
17
test/admin/components/AfterDashboardClient/index.tsx
Normal file
17
test/admin/components/AfterDashboardClient/index.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
'use client'
|
||||
import type { PayloadClientReactComponent, SanitizedConfig } from 'payload'
|
||||
|
||||
import { RenderComponent, useConfig } from '@payloadcms/ui'
|
||||
import React from 'react'
|
||||
|
||||
export const AfterDashboardClient: PayloadClientReactComponent<
|
||||
SanitizedConfig['admin']['components']['afterDashboard'][0]
|
||||
> = () => {
|
||||
const { config } = useConfig()
|
||||
return (
|
||||
<div>
|
||||
<p>Admin Dependency test component:</p>
|
||||
<RenderComponent mappedComponent={config.admin.dependencies?.myTestComponent} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
6
test/admin/components/TestComponent.tsx
Normal file
6
test/admin/components/TestComponent.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
'use client'
|
||||
import React from 'react'
|
||||
|
||||
export const TestComponent: React.FC = () => {
|
||||
return <div>Test Component</div>
|
||||
}
|
||||
@@ -41,7 +41,10 @@ export default buildConfigWithDefaults({
|
||||
},
|
||||
components: {
|
||||
actions: ['/components/AdminButton/index.js#AdminButton'],
|
||||
afterDashboard: ['/components/AfterDashboard/index.js#AfterDashboard'],
|
||||
afterDashboard: [
|
||||
'/components/AfterDashboard/index.js#AfterDashboard',
|
||||
'/components/AfterDashboardClient/index.js#AfterDashboardClient',
|
||||
],
|
||||
afterNavLinks: ['/components/AfterNavLinks/index.js#AfterNavLinks'],
|
||||
beforeLogin: ['/components/BeforeLogin/index.js#BeforeLogin'],
|
||||
logout: {
|
||||
@@ -104,6 +107,15 @@ export default buildConfigWithDefaults({
|
||||
titleSuffix: '- Custom Title Suffix',
|
||||
},
|
||||
routes: customAdminRoutes,
|
||||
dependencies: {
|
||||
myTestComponent: {
|
||||
path: '/components/TestComponent.js#TestComponent',
|
||||
type: 'component',
|
||||
clientProps: {
|
||||
test: 'hello',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
collections: [
|
||||
UploadCollection,
|
||||
|
||||
Reference in New Issue
Block a user