From 63f042047751a09997becb904bf5be23de27914f Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 9 Sep 2024 21:43:54 +0200 Subject: [PATCH] register user sidebar menu --- .../packages/settings/advanced/manifests.ts | 6 ++-- .../src/packages/user/manifests.ts | 2 +- .../{user-section => section}/constants.ts | 0 .../user/{user-section => section}/index.ts | 0 .../src/packages/user/section/manifests.ts | 31 +++++++++++++++++++ .../packages/user/section/menu/constants.ts | 1 + .../src/packages/user/section/menu/index.ts | 1 + .../packages/user/section/menu/manifests.ts | 9 ++++++ .../user/{user-section => section}/paths.ts | 0 .../user/section/sidebar-app/index.ts | 1 + .../user/section/sidebar-app/manifests.ts | 23 ++++++++++++++ .../user/user-group/section-view/manifests.ts | 2 +- .../packages/user/user-section/manifests.ts | 21 ------------- .../user/user/section-view/manifests.ts | 2 +- 14 files changed, 72 insertions(+), 27 deletions(-) rename src/Umbraco.Web.UI.Client/src/packages/user/{user-section => section}/constants.ts (100%) rename src/Umbraco.Web.UI.Client/src/packages/user/{user-section => section}/index.ts (100%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/section/manifests.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/section/menu/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/section/menu/index.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/section/menu/manifests.ts rename src/Umbraco.Web.UI.Client/src/packages/user/{user-section => section}/paths.ts (100%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/section/sidebar-app/index.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/section/sidebar-app/manifests.ts delete mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user-section/manifests.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/settings/advanced/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/settings/advanced/manifests.ts index 5a452d9e3d..3931a9edb9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/settings/advanced/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/settings/advanced/manifests.ts @@ -10,11 +10,11 @@ export const manifests = [ { type: 'sectionSidebarApp', kind: 'menu', - alias: 'Umb.SectionSidebarMenu.AdvancedSettings', - name: 'Advanced Settings Sidebar Menu', + alias: 'Umb.SectionSidebarApp.Menu.Users', + name: 'Users Section Sidebar Menu', weight: 100, meta: { - label: '#treeHeaders_advancedGroup', + label: 'Users', menu: UMB_ADVANCED_SETTINGS_MENU_ALIAS, }, conditions: [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/manifests.ts index 96353d28f7..d649d8f06f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/manifests.ts @@ -1,6 +1,6 @@ import { manifests as userGroupManifests } from './user-group/manifests.js'; import { manifests as userManifests } from './user/manifests.js'; -import { manifests as userSectionManifests } from './user-section/manifests.js'; +import { manifests as userSectionManifests } from './section/manifests.js'; import { manifests as currentUserManifests } from './current-user/manifests.js'; import { manifests as userPermissionManifests } from './user-permission/manifests.js'; import { manifests as changePasswordManifests } from './change-password/manifests.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-section/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/section/constants.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/user/user-section/constants.ts rename to src/Umbraco.Web.UI.Client/src/packages/user/section/constants.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-section/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/section/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/user/user-section/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/user/section/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/section/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/section/manifests.ts new file mode 100644 index 0000000000..bb49da5322 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/section/manifests.ts @@ -0,0 +1,31 @@ +import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from './constants.js'; +import { manifests as sectionSidebarAppManifests } from './sidebar-app/manifests.js'; +import { manifests as menuManifests } from './menu/manifests.js'; +import type { + ManifestSection, + ManifestTypes, + UmbBackofficeManifestKind, +} from '@umbraco-cms/backoffice/extension-registry'; + +const section: ManifestSection = { + type: 'section', + alias: UMB_USER_MANAGEMENT_SECTION_ALIAS, + name: 'User Management Section', + weight: 600, + meta: { + label: '#sections_users', + pathname: 'user-management', + }, + conditions: [ + { + alias: 'Umb.Condition.SectionUserPermission', + match: UMB_USER_MANAGEMENT_SECTION_ALIAS, + }, + ], +}; + +export const manifests: Array = [ + section, + ...sectionSidebarAppManifests, + ...menuManifests, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/section/menu/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/section/menu/constants.ts new file mode 100644 index 0000000000..7bf050d53c --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/section/menu/constants.ts @@ -0,0 +1 @@ +export const UMB_USER_MANAGEMENT_MENU_ALIAS = 'Umb.Menu.UserManagement'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/section/menu/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/section/menu/index.ts new file mode 100644 index 0000000000..4f07201dcf --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/section/menu/index.ts @@ -0,0 +1 @@ +export * from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/section/menu/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/section/menu/manifests.ts new file mode 100644 index 0000000000..f5852aa534 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/section/menu/manifests.ts @@ -0,0 +1,9 @@ +import { UMB_USER_MANAGEMENT_MENU_ALIAS } from './constants.js'; + +export const manifests = [ + { + type: 'menu', + alias: UMB_USER_MANAGEMENT_MENU_ALIAS, + name: 'User Management Menu', + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-section/paths.ts b/src/Umbraco.Web.UI.Client/src/packages/user/section/paths.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/user/user-section/paths.ts rename to src/Umbraco.Web.UI.Client/src/packages/user/section/paths.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/section/sidebar-app/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/section/sidebar-app/index.ts new file mode 100644 index 0000000000..4f07201dcf --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/section/sidebar-app/index.ts @@ -0,0 +1 @@ +export * from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/section/sidebar-app/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/section/sidebar-app/manifests.ts new file mode 100644 index 0000000000..f21d698bc2 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/section/sidebar-app/manifests.ts @@ -0,0 +1,23 @@ +import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../constants.js'; +import { UMB_USER_MANAGEMENT_MENU_ALIAS } from '../menu/index.js'; +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + { + type: 'sectionSidebarApp', + kind: 'menu', + alias: 'Umb.SectionSidebarApp.Menu.UserManagement', + name: 'User Management Menu Sidebar App', + weight: 100, + meta: { + label: '#treeHeaders_users', + menu: UMB_USER_MANAGEMENT_MENU_ALIAS, + }, + conditions: [ + { + alias: 'Umb.Condition.SectionAlias', + match: UMB_USER_MANAGEMENT_SECTION_ALIAS, + }, + ], + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/manifests.ts index 3780224244..f4549d458f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/manifests.ts @@ -1,4 +1,4 @@ -import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../../user-section/index.js'; +import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../../section/index.js'; import type { ManifestSectionView, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; const sectionsViews: Array = [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-section/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-section/manifests.ts deleted file mode 100644 index 74bb597e28..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-section/manifests.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from './constants.js'; -import type { ManifestSection, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; - -const section: ManifestSection = { - type: 'section', - alias: UMB_USER_MANAGEMENT_SECTION_ALIAS, - name: 'User Management Section', - weight: 600, - meta: { - label: '#sections_users', - pathname: 'user-management', - }, - conditions: [ - { - alias: 'Umb.Condition.SectionUserPermission', - match: UMB_USER_MANAGEMENT_SECTION_ALIAS, - }, - ], -}; - -export const manifests: Array = [section]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/manifests.ts index a9dbcd430b..8af99c6b24 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/manifests.ts @@ -1,4 +1,4 @@ -import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../../user-section/index.js'; +import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../../section/index.js'; import type { ManifestSectionView, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; const sectionsViews: Array = [