register current user as a global context

This commit is contained in:
Mads Rasmussen
2023-11-13 16:31:38 +01:00
parent fe9b7631e8
commit c5b2890785
3 changed files with 7 additions and 12 deletions

View File

@@ -1,3 +1,4 @@
import { UmbCurrentUserContext } from './current-user.context.js';
import { manifests as modalManifests } from './modals/manifests.js';
import { manifests as userProfileAppsManifests } from './user-profile-apps/manifests.js';
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
@@ -9,6 +10,12 @@ export const headerApps: Array<ManifestTypes> = [
name: 'Current User Store',
loader: () => import('./current-user-history.store.js'),
},
{
type: 'globalContext',
alias: 'Umb.GlobalContext.CurrentUser',
name: 'Current User',
api: UmbCurrentUserContext,
},
{
type: 'headerApp',
alias: 'Umb.HeaderApp.CurrentUser',

View File

@@ -1,6 +0,0 @@
import { UmbCurrentUserContext } from './current-user/index.js';
import type { UmbEntryPointOnInit } from '@umbraco-cms/backoffice/extension-api';
export const onInit: UmbEntryPointOnInit = (host, extensionRegistry) => {
new UmbCurrentUserContext(host);
};

View File

@@ -17,10 +17,4 @@ export const manifests = [
...currentUserManifests,
...userPermissionManifests,
...modalManifests,
{
name: 'User Management Entry Point',
alias: 'Umb.EntryPoint.UserManagement',
type: 'entryPoint',
loader: () => import('./entry-point.js'),
},
];