diff --git a/src/core/CMS.ts b/src/core/CMS.ts index 87722ac81..d55f89564 100644 --- a/src/core/CMS.ts +++ b/src/core/CMS.ts @@ -1,7 +1,6 @@ import {Store} from 'alinea/backend/Store' -import {CloudAuthView} from 'alinea/cloud/view/CloudAuth' import {Resolver} from 'alinea/core' -import {Config, DashboardConfig, createConfig} from './Config.js' +import {Config, createConfig} from './Config.js' import {Graph, GraphRealm, GraphRealmApi} from './Graph.js' import {Root} from './Root.js' import {Workspace} from './Workspace.js' @@ -15,7 +14,6 @@ export interface CMSApi extends GraphRealmApi { } export abstract class CMS extends GraphRealm implements CMSApi { - dashboard: DashboardConfig graph: Graph config: Config @@ -26,10 +24,6 @@ export abstract class CMS extends GraphRealm implements CMSApi { return cnx.resolve(params) }) this.config = normalizedConfig - this.dashboard = { - auth: CloudAuthView, - ...(config.dashboard as DashboardConfig) - } this.graph = new Graph(normalizedConfig, async params => { const {resolve} = await this.resolver() return resolve(params) diff --git a/src/core/Config.ts b/src/core/Config.ts index 1d4439a7c..879198bbf 100644 --- a/src/core/Config.ts +++ b/src/core/Config.ts @@ -1,3 +1,4 @@ +import {CloudAuthView} from 'alinea/cloud/view/CloudAuth' import {MediaSchema} from 'alinea/core/media/MediaSchema' import {ComponentType} from 'react' import {Auth} from './Auth.js' @@ -67,6 +68,10 @@ export function createConfig( const handlerUrl = definition.handlerUrl ?? definition.dashboard?.handlerUrl*/ return { ...definition, - schema: {...MediaSchema, ...definition.schema} + schema: {...MediaSchema, ...definition.schema}, + dashboard: { + auth: CloudAuthView, + ...definition.dashboard + } } }