Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Users section sidebar menu #2281

Merged
merged 29 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f1d442f
register user sidebar menu
madsrasmussen Sep 9, 2024
1e3f82f
register root workspace
madsrasmussen Sep 9, 2024
28aa71b
register user group menu item
madsrasmussen Sep 10, 2024
e44bc6c
Merge branch 'v15/dev' into v15/feature/user-sidebar-menu
madsrasmussen Sep 10, 2024
de89c91
update import path
madsrasmussen Sep 10, 2024
8199994
pass entity type from manifest
madsrasmussen Sep 10, 2024
dba4c74
add path helper to root
madsrasmussen Sep 10, 2024
6d911aa
back button to root
madsrasmussen Sep 10, 2024
9a1d76c
wip create + invite entity actions
madsrasmussen Sep 10, 2024
759025d
Merge branch 'v15/dev' into v15/feature/user-sidebar-menu
madsrasmussen Sep 10, 2024
be728f0
update back path
madsrasmussen Sep 10, 2024
52a4e14
Merge branch 'main' into v15/feature/user-sidebar-menu
madsrasmussen Sep 11, 2024
dc2c07f
add to folder
madsrasmussen Sep 11, 2024
b2de7e5
rename folder
madsrasmussen Sep 11, 2024
8244ab8
move into workspace folder
madsrasmussen Sep 11, 2024
24a9ae1
add missing type
madsrasmussen Sep 11, 2024
5a94f4d
fix path
madsrasmussen Sep 11, 2024
7913258
delete unused code
madsrasmussen Sep 11, 2024
7ab574e
set up entity context
madsrasmussen Sep 11, 2024
820305f
add invite entity action + clean up
madsrasmussen Sep 11, 2024
3c3ca60
update user group create path
madsrasmussen Sep 11, 2024
ec84a1c
Merge branch 'v15/dev' into v15/feature/user-sidebar-menu
madsrasmussen Sep 12, 2024
40fba5b
revert merge mistake
madsrasmussen Sep 12, 2024
6858483
move into folder
madsrasmussen Sep 12, 2024
0460d32
rename folder
madsrasmussen Sep 12, 2024
a9e1925
move folder into workspace
madsrasmussen Sep 12, 2024
2a15cdd
localize headline
madsrasmussen Sep 12, 2024
496b25f
localize header
madsrasmussen Sep 12, 2024
4925949
remove lorem ipsum
madsrasmussen Sep 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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',
},
];
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
Loading