chore!: consolidates admin routes and views configs (#3458)

BREAKING CHANGE: If your config has a `admin.components.routes` array, you will need to key them into the `admin.components.views` object. The configuration options should remain unchanged.
This commit is contained in:
Jacob Fletcher
2023-10-08 16:08:13 -04:00
committed by GitHub
parent 18da607f5b
commit 3668f053b3
17 changed files with 321 additions and 186 deletions

View File

@@ -1,7 +1,7 @@
import joi from 'joi'
import { adminViewSchema } from './shared/adminViewSchema'
import { livePreviewSchema } from './shared/componentSchema'
import { routeSchema } from './shared/routeSchema'
const component = joi.alternatives().try(joi.object().unknown(), joi.func())
@@ -53,11 +53,13 @@ export default joi.object({
Button: component,
}),
providers: joi.array().items(component),
routes: routeSchema,
views: joi.object({
Account: component,
Dashboard: component,
}),
views: joi.alternatives().try(
joi.object({
Account: joi.alternatives().try(component, adminViewSchema),
Dashboard: joi.alternatives().try(component, adminViewSchema),
}),
joi.object().pattern(joi.string(), component),
),
}),
css: joi.string(),
dateFormat: joi.string(),