fix!: proper casing for default root views (#9248)
Custom `account` and `dashboard` views now defined as lowercase in the
config. This is to maintain consistency with all other custom views
throughout the config. The underlying reason for this change is that
previously, you could define React Components directly on these
properties. Now, these are strictly _view configuration objects_, and
the property names have been adjusted in order to semantically reflect
that. These two views in particular, however, were never updated
accordingly.
## Breaking Changes
```diff
import { buildConfig } from 'payload'
const config = buildConfig({
// ...
admin: {
components: {
// ...
views: {
// ...
- Account: ...
- Dashboard: ...
+ account: ...
+ dashboard: ...
},
},
},
})
```
This commit is contained in:
@@ -138,7 +138,7 @@ export const Account: React.FC<AdminViewProps> = async ({
|
|||||||
/>
|
/>
|
||||||
<HydrateAuthProvider permissions={permissions} />
|
<HydrateAuthProvider permissions={permissions} />
|
||||||
<RenderServerComponent
|
<RenderServerComponent
|
||||||
Component={config.admin?.components?.views?.Account?.Component}
|
Component={config.admin?.components?.views?.account?.Component}
|
||||||
Fallback={EditView}
|
Fallback={EditView}
|
||||||
importMap={payload.importMap}
|
importMap={payload.importMap}
|
||||||
serverProps={{
|
serverProps={{
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export const Dashboard: React.FC<AdminViewProps> = async ({
|
|||||||
Link,
|
Link,
|
||||||
locale,
|
locale,
|
||||||
}}
|
}}
|
||||||
Component={config.admin?.components?.views?.Dashboard?.Component}
|
Component={config.admin?.components?.views?.dashboard?.Component}
|
||||||
Fallback={DefaultDashboard}
|
Fallback={DefaultDashboard}
|
||||||
importMap={payload.importMap}
|
importMap={payload.importMap}
|
||||||
serverProps={{
|
serverProps={{
|
||||||
|
|||||||
@@ -764,9 +764,9 @@ export type Config = {
|
|||||||
/** Add custom admin views */
|
/** Add custom admin views */
|
||||||
[key: string]: AdminViewConfig
|
[key: string]: AdminViewConfig
|
||||||
/** Replace the account screen */
|
/** Replace the account screen */
|
||||||
Account?: AdminViewConfig
|
account?: AdminViewConfig
|
||||||
/** Replace the admin homepage */
|
/** Replace the admin homepage */
|
||||||
Dashboard?: AdminViewConfig
|
dashboard?: AdminViewConfig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** Extension point to add your custom data. Available in server and client. */
|
/** Extension point to add your custom data. Available in server and client. */
|
||||||
|
|||||||
Reference in New Issue
Block a user