Skip to content

Commit

Permalink
Merge pull request #2281 from umbraco/v15/feature/user-sidebar-menu
Browse files Browse the repository at this point in the history
Feature: User sidebar menu
  • Loading branch information
nielslyngsoe authored Sep 13, 2024
2 parents bb583bd + 4925949 commit 4a75f92
Show file tree
Hide file tree
Showing 63 changed files with 576 additions and 409 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export class UmbMenuItemDefaultElement extends UmbLitElement implements UmbMenuI
<umb-menu-item-layout
.href=${this._href}
.iconName=${this.manifest.meta.icon ?? ''}
.label=${this.localize.string(this.manifest.meta.label ?? this.manifest.name)}>
.label=${this.localize.string(this.manifest.meta.label ?? this.manifest.name)}
.entityType=${this.manifest.meta.entityType}>
</umb-menu-item-layout>
`;
}
Expand Down
2 changes: 1 addition & 1 deletion src/packages/user/manifests.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions src/packages/user/section/manifests.ts
Original file line number Diff line number Diff line change
@@ -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<ManifestTypes | UmbBackofficeManifestKind> = [
section,
...sectionSidebarAppManifests,
...menuManifests,
];
1 change: 1 addition & 0 deletions src/packages/user/section/menu/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const UMB_USER_MANAGEMENT_MENU_ALIAS = 'Umb.Menu.UserManagement';
1 change: 1 addition & 0 deletions src/packages/user/section/menu/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './constants.js';
9 changes: 9 additions & 0 deletions src/packages/user/section/menu/manifests.ts
Original file line number Diff line number Diff line change
@@ -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',
},
];
File renamed without changes.
1 change: 1 addition & 0 deletions src/packages/user/section/sidebar-app/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../constants.js';
23 changes: 23 additions & 0 deletions src/packages/user/section/sidebar-app/manifests.ts
Original file line number Diff line number Diff line change
@@ -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<ManifestTypes | UmbBackofficeManifestKind> = [
{
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,
},
],
},
];
3 changes: 2 additions & 1 deletion src/packages/user/user-group/collection/action/manifests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { UMB_USER_GROUP_WORKSPACE_PATH } from '../../paths.js';
import { UMB_COLLECTION_ALIAS_CONDITION } from '@umbraco-cms/backoffice/collection';
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';

Expand All @@ -9,7 +10,7 @@ export const createManifest: ManifestTypes = {
weight: 200,
meta: {
label: '#general_create',
href: 'section/user-management/view/user-groups/user-group/create',
href: `${UMB_USER_GROUP_WORKSPACE_PATH}/create`,
},
conditions: [
{
Expand Down
2 changes: 2 additions & 0 deletions src/packages/user/user-group/entity.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const UMB_USER_GROUP_ENTITY_TYPE = 'user-group';
export const UMB_USER_GROUP_ROOT_ENTITY_TYPE = 'user-group-root';

export type UmbUserGroupEntityType = typeof UMB_USER_GROUP_ENTITY_TYPE;
export type UmbUserGroupRootEntityType = typeof UMB_USER_GROUP_ROOT_ENTITY_TYPE;
23 changes: 13 additions & 10 deletions src/packages/user/user-group/manifests.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { manifests as collectionManifests } from './collection/manifests.js';
import { manifests as repositoryManifests } from './repository/manifests.js';
import { manifests as workspaceManifests } from './workspace/manifests.js';
import { manifests as modalManifests } from './modals/manifests.js';
import { manifests as sectionViewManifests } from './section-view/manifests.js';
import { manifests as entityActionManifests } from './entity-actions/manifests.js';
import { manifests as entityBulkActionManifests } from './entity-bulk-actions/manifests.js';
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
import { manifests as menuItemManifests } from './menu-item/manifests.js';
import { manifests as modalManifests } from './modals/manifests.js';
import { manifests as repositoryManifests } from './repository/manifests.js';
import { manifests as sectionViewManifests } from './workspace/user-group-root/manifests.js';
import { manifests as workspaceManifests } from './workspace/manifests.js';

export const manifests: Array<ManifestTypes> = [
import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry';

export const manifests: Array<ManifestTypes | UmbBackofficeManifestKind> = [
...collectionManifests,
...repositoryManifests,
...workspaceManifests,
...modalManifests,
...sectionViewManifests,
...entityActionManifests,
...entityBulkActionManifests,
...menuItemManifests,
...modalManifests,
...repositoryManifests,
...sectionViewManifests,
...workspaceManifests,
];
18 changes: 18 additions & 0 deletions src/packages/user/user-group/menu-item/manifests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { UMB_USER_MANAGEMENT_MENU_ALIAS } from '../../section/menu/constants.js';
import { UMB_USER_GROUP_ROOT_ENTITY_TYPE } from '../entity.js';
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';

export const manifests: Array<ManifestTypes> = [
{
type: 'menuItem',
alias: 'Umb.MenuItem.UserGroups',
name: 'User Groups Menu Item',
weight: 100,
meta: {
label: '#user_usergroups',
icon: 'icon-users',
entityType: UMB_USER_GROUP_ROOT_ENTITY_TYPE,
menus: [UMB_USER_MANAGEMENT_MENU_ALIAS],
},
},
];
9 changes: 7 additions & 2 deletions src/packages/user/user-group/paths.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { UMB_USER_SECTION_PATHNAME } from '../user-section/paths.js';
import { UMB_USER_GROUP_ENTITY_TYPE } from './entity.js';
import { UMB_USER_SECTION_PATHNAME } from '../section/paths.js';
import { UMB_USER_GROUP_ENTITY_TYPE, UMB_USER_GROUP_ROOT_ENTITY_TYPE } from './entity.js';
import { UMB_WORKSPACE_PATH_PATTERN } from '@umbraco-cms/backoffice/workspace';

export const UMB_USER_GROUP_WORKSPACE_PATH = UMB_WORKSPACE_PATH_PATTERN.generateAbsolute({
sectionName: UMB_USER_SECTION_PATHNAME,
entityType: UMB_USER_GROUP_ENTITY_TYPE,
});

export const UMB_USER_GROUP_ROOT_WORKSPACE_PATH = UMB_WORKSPACE_PATH_PATTERN.generateAbsolute({
sectionName: UMB_USER_SECTION_PATHNAME,
entityType: UMB_USER_GROUP_ROOT_ENTITY_TYPE,
});
25 changes: 0 additions & 25 deletions src/packages/user/user-group/section-view/manifests.ts

This file was deleted.

This file was deleted.

This file was deleted.

44 changes: 3 additions & 41 deletions src/packages/user/user-group/workspace/manifests.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,4 @@
import type {
ManifestWorkspaces,
ManifestWorkspaceActions,
ManifestWorkspaceView,
ManifestTypes,
} from '@umbraco-cms/backoffice/extension-registry';
import { UmbSubmitWorkspaceAction } from '@umbraco-cms/backoffice/workspace';
import { manifests as userGroupManifests } from './user-group/manifests.js';
import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry';

const workspace: ManifestWorkspaces = {
type: 'workspace',
kind: 'routable',
alias: 'Umb.Workspace.UserGroup',
name: 'User Group Workspace',
api: () => import('./user-group-workspace.context.js'),
meta: {
entityType: 'user-group',
},
};

const workspaceViews: Array<ManifestWorkspaceView> = [];
const workspaceActions: Array<ManifestWorkspaceActions> = [
{
type: 'workspaceAction',
kind: 'default',
alias: 'Umb.WorkspaceAction.UserGroup.Save',
name: 'Save User Group Workspace Action',
api: UmbSubmitWorkspaceAction,
meta: {
label: '#buttons_save',
look: 'primary',
color: 'positive',
},
conditions: [
{
alias: 'Umb.Condition.WorkspaceAlias',
match: workspace.alias,
},
],
},
];

export const manifests: Array<ManifestTypes> = [workspace, ...workspaceViews, ...workspaceActions];
export const manifests: Array<ManifestTypes | UmbBackofficeManifestKind> = [...userGroupManifests];
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { UMB_USER_GROUP_ROOT_ENTITY_TYPE } from '../../entity.js';
import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry';

export const manifests: Array<ManifestTypes | UmbBackofficeManifestKind> = [
{
type: 'workspace',
alias: 'Umb.Workspace.UserGroupRoot',
name: 'User Group Root Workspace View',
element: () => import('./user-group-root-workspace.element.js'),
meta: {
entityType: UMB_USER_GROUP_ROOT_ENTITY_TYPE,
},
},
];
Loading

0 comments on commit 4a75f92

Please sign in to comment.