From f1d442faa7f13ab567e2e21b36989751269c9ac1 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 9 Sep 2024 21:43:54 +0200 Subject: [PATCH 01/25] register user sidebar menu --- src/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 +++++++++++++++++++ src/packages/user/section/menu/constants.ts | 1 + src/packages/user/section/menu/index.ts | 1 + src/packages/user/section/menu/manifests.ts | 9 ++++++ .../user/section/sidebar-app/index.ts | 1 + .../user/section/sidebar-app/manifests.ts | 23 ++++++++++++++ .../user/user-group/section-view/manifests.ts | 2 +- src/packages/user/user-section/manifests.ts | 21 ------------- .../user/user/section-view/manifests.ts | 2 +- 13 files changed, 72 insertions(+), 27 deletions(-) rename src/packages/user/{user-section => section}/constants.ts (100%) rename src/packages/user/{user-section => section}/index.ts (100%) create mode 100644 src/packages/user/section/manifests.ts create mode 100644 src/packages/user/section/menu/constants.ts create mode 100644 src/packages/user/section/menu/index.ts create mode 100644 src/packages/user/section/menu/manifests.ts create mode 100644 src/packages/user/section/sidebar-app/index.ts create mode 100644 src/packages/user/section/sidebar-app/manifests.ts delete mode 100644 src/packages/user/user-section/manifests.ts diff --git a/src/packages/settings/advanced/manifests.ts b/src/packages/settings/advanced/manifests.ts index 5a452d9e3d..3931a9edb9 100644 --- a/src/packages/settings/advanced/manifests.ts +++ b/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/packages/user/manifests.ts b/src/packages/user/manifests.ts index 96353d28f7..d649d8f06f 100644 --- a/src/packages/user/manifests.ts +++ b/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/packages/user/user-section/constants.ts b/src/packages/user/section/constants.ts similarity index 100% rename from src/packages/user/user-section/constants.ts rename to src/packages/user/section/constants.ts diff --git a/src/packages/user/user-section/index.ts b/src/packages/user/section/index.ts similarity index 100% rename from src/packages/user/user-section/index.ts rename to src/packages/user/section/index.ts diff --git a/src/packages/user/section/manifests.ts b/src/packages/user/section/manifests.ts new file mode 100644 index 0000000000..bb49da5322 --- /dev/null +++ b/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/packages/user/section/menu/constants.ts b/src/packages/user/section/menu/constants.ts new file mode 100644 index 0000000000..7bf050d53c --- /dev/null +++ b/src/packages/user/section/menu/constants.ts @@ -0,0 +1 @@ +export const UMB_USER_MANAGEMENT_MENU_ALIAS = 'Umb.Menu.UserManagement'; diff --git a/src/packages/user/section/menu/index.ts b/src/packages/user/section/menu/index.ts new file mode 100644 index 0000000000..4f07201dcf --- /dev/null +++ b/src/packages/user/section/menu/index.ts @@ -0,0 +1 @@ +export * from './constants.js'; diff --git a/src/packages/user/section/menu/manifests.ts b/src/packages/user/section/menu/manifests.ts new file mode 100644 index 0000000000..f5852aa534 --- /dev/null +++ b/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/packages/user/section/sidebar-app/index.ts b/src/packages/user/section/sidebar-app/index.ts new file mode 100644 index 0000000000..4f07201dcf --- /dev/null +++ b/src/packages/user/section/sidebar-app/index.ts @@ -0,0 +1 @@ +export * from './constants.js'; diff --git a/src/packages/user/section/sidebar-app/manifests.ts b/src/packages/user/section/sidebar-app/manifests.ts new file mode 100644 index 0000000000..f21d698bc2 --- /dev/null +++ b/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/packages/user/user-group/section-view/manifests.ts b/src/packages/user/user-group/section-view/manifests.ts index 3780224244..f4549d458f 100644 --- a/src/packages/user/user-group/section-view/manifests.ts +++ b/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/packages/user/user-section/manifests.ts b/src/packages/user/user-section/manifests.ts deleted file mode 100644 index 74bb597e28..0000000000 --- a/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/packages/user/user/section-view/manifests.ts b/src/packages/user/user/section-view/manifests.ts index a9dbcd430b..8af99c6b24 100644 --- a/src/packages/user/user/section-view/manifests.ts +++ b/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 = [ From 1e3f82f75f8d660e17c230e65d8ae53cc76ebc79 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 9 Sep 2024 21:56:10 +0200 Subject: [PATCH 02/25] register root workspace --- src/packages/user/user/manifests.ts | 7 +- src/packages/user/user/menu-item/manifests.ts | 18 +++++ .../user/user/section-view/manifests.ts | 27 +++----- .../user-root-workspace-view.element.ts | 21 ++++++ .../users-section-view.element.ts | 67 ------------------- 5 files changed, 52 insertions(+), 88 deletions(-) create mode 100644 src/packages/user/user/menu-item/manifests.ts create mode 100644 src/packages/user/user/section-view/user-root-workspace-view.element.ts delete mode 100644 src/packages/user/user/section-view/users-section-view.element.ts diff --git a/src/packages/user/user/manifests.ts b/src/packages/user/user/manifests.ts index a5eb9bfeea..88fe76cfcd 100644 --- a/src/packages/user/user/manifests.ts +++ b/src/packages/user/user/manifests.ts @@ -8,9 +8,11 @@ import { manifests as repositoryManifests } from './repository/manifests.js'; import { manifests as sectionViewManifests } from './section-view/manifests.js'; import { manifests as propertyEditorManifests } from './property-editor/manifests.js'; import { manifests as workspaceManifests } from './workspace/manifests.js'; -import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; +import { manifests as menuItemManifests } from './menu-item/manifests.js'; -export const manifests: Array = [ +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ ...collectionManifests, ...conditionsManifests, ...entityActionsManifests, @@ -21,4 +23,5 @@ export const manifests: Array = [ ...sectionViewManifests, ...propertyEditorManifests, ...workspaceManifests, + ...menuItemManifests, ]; diff --git a/src/packages/user/user/menu-item/manifests.ts b/src/packages/user/user/menu-item/manifests.ts new file mode 100644 index 0000000000..2239c2fe0f --- /dev/null +++ b/src/packages/user/user/menu-item/manifests.ts @@ -0,0 +1,18 @@ +import { UMB_USER_MANAGEMENT_MENU_ALIAS } from '../../section/menu/constants.js'; +import { UMB_USER_ROOT_ENTITY_TYPE } from '../entity.js'; +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + { + type: 'menuItem', + alias: 'Umb.MenuItem.Users', + name: 'Users Menu Item', + weight: 100, + meta: { + label: '#treeHeaders_users', + icon: 'icon-user', + entityType: UMB_USER_ROOT_ENTITY_TYPE, + menus: [UMB_USER_MANAGEMENT_MENU_ALIAS], + }, + }, +]; diff --git a/src/packages/user/user/section-view/manifests.ts b/src/packages/user/user/section-view/manifests.ts index 8af99c6b24..aef4c6370e 100644 --- a/src/packages/user/user/section-view/manifests.ts +++ b/src/packages/user/user/section-view/manifests.ts @@ -1,25 +1,14 @@ -import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../../section/index.js'; -import type { ManifestSectionView, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; +import { UMB_USER_ROOT_ENTITY_TYPE } from '../entity.js'; +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; -const sectionsViews: Array = [ +export const manifests: Array = [ { - type: 'sectionView', - alias: 'Umb.SectionView.Users', - name: 'Users Section View', - js: () => import('./users-section-view.element.js'), - weight: 200, + type: 'workspace', + alias: 'Umb.Workspace.UserRoot', + name: 'User Root Workspace View', + element: () => import('./user-root-workspace-view.element.js'), meta: { - label: '#general_users', - pathname: 'users', - icon: 'icon-user', + entityType: UMB_USER_ROOT_ENTITY_TYPE, }, - conditions: [ - { - alias: 'Umb.Condition.SectionAlias', - match: UMB_USER_MANAGEMENT_SECTION_ALIAS, - }, - ], }, ]; - -export const manifests: Array = [...sectionsViews]; diff --git a/src/packages/user/user/section-view/user-root-workspace-view.element.ts b/src/packages/user/user/section-view/user-root-workspace-view.element.ts new file mode 100644 index 0000000000..6e286dada3 --- /dev/null +++ b/src/packages/user/user/section-view/user-root-workspace-view.element.ts @@ -0,0 +1,21 @@ +import { UMB_USER_COLLECTION_ALIAS } from '../collection/index.js'; +import { html, customElement } from '@umbraco-cms/backoffice/external/lit'; +import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; + +const elementName = 'umb-user-root-workspace'; +@customElement(elementName) +export class UmbUserRootWorkspaceElement extends UmbLitElement { + override render() { + return html` + ; + `; + } +} + +export { UmbUserRootWorkspaceElement as element }; + +declare global { + interface HTMLElementTagNameMap { + [elementName]: UmbUserRootWorkspaceElement; + } +} diff --git a/src/packages/user/user/section-view/users-section-view.element.ts b/src/packages/user/user/section-view/users-section-view.element.ts deleted file mode 100644 index 22f9d5069d..0000000000 --- a/src/packages/user/user/section-view/users-section-view.element.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { UMB_USER_COLLECTION_ALIAS } from '../collection/index.js'; -import { UMB_USER_ENTITY_TYPE, UMB_USER_ROOT_ENTITY_TYPE } from '../entity.js'; -import { css, html, customElement } from '@umbraco-cms/backoffice/external/lit'; -import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; -import type { UmbRoute } from '@umbraco-cms/backoffice/router'; -import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import { UmbCollectionElement } from '@umbraco-cms/backoffice/collection'; -import { UmbWorkspaceElement } from '@umbraco-cms/backoffice/workspace'; -import { UmbEntityContext } from '@umbraco-cms/backoffice/entity'; - -@customElement('umb-section-view-users') -export class UmbSectionViewUsersElement extends UmbLitElement { - #routes: UmbRoute[] = [ - { - path: 'collection', - component: () => { - const element = new UmbCollectionElement(); - const entityContext = new UmbEntityContext(element); - entityContext.setEntityType(UMB_USER_ROOT_ENTITY_TYPE); - entityContext.setUnique(null); - element.setAttribute('alias', UMB_USER_COLLECTION_ALIAS); - return element; - }, - }, - { - path: 'user', - component: () => { - const element = new UmbWorkspaceElement(); - element.setAttribute('entity-type', UMB_USER_ENTITY_TYPE); - return element; - }, - }, - { - path: '', - redirectTo: 'collection', - }, - { - path: `**`, - component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, - }, - ]; - - override render() { - return html` `; - } - - static override styles = [ - UmbTextStyles, - css` - :host { - height: 100%; - } - - #router-slot { - height: calc(100% - var(--umb-header-layout-height)); - } - `, - ]; -} - -export default UmbSectionViewUsersElement; - -declare global { - interface HTMLElementTagNameMap { - 'umb-section-view-users': UmbSectionViewUsersElement; - } -} From 28aa71bb07cfb87c911cda6e9ed1311e680b57af Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 10 Sep 2024 08:53:01 +0200 Subject: [PATCH 03/25] register user group menu item --- src/packages/user/user-group/entity.ts | 2 + src/packages/user/user-group/manifests.ts | 19 +++--- .../user/user-group/menu-item/manifests.ts | 18 ++++++ .../user/user-group/section-view/manifests.ts | 27 +++----- .../user-group-root-workspace.element.ts | 21 +++++++ .../user-group-section-view.element.ts | 63 ------------------- src/packages/user/user/menu-item/manifests.ts | 2 +- .../user/user/section-view/manifests.ts | 2 +- ...ment.ts => user-root-workspace.element.ts} | 0 9 files changed, 62 insertions(+), 92 deletions(-) create mode 100644 src/packages/user/user-group/menu-item/manifests.ts create mode 100644 src/packages/user/user-group/section-view/user-group-root-workspace.element.ts delete mode 100644 src/packages/user/user-group/section-view/user-group-section-view.element.ts rename src/packages/user/user/section-view/{user-root-workspace-view.element.ts => user-root-workspace.element.ts} (100%) diff --git a/src/packages/user/user-group/entity.ts b/src/packages/user/user-group/entity.ts index 40fc592fed..3978bfa6a5 100644 --- a/src/packages/user/user-group/entity.ts +++ b/src/packages/user/user-group/entity.ts @@ -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; diff --git a/src/packages/user/user-group/manifests.ts b/src/packages/user/user-group/manifests.ts index 4a03fbb339..1ac88d4e75 100644 --- a/src/packages/user/user-group/manifests.ts +++ b/src/packages/user/user-group/manifests.ts @@ -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 { 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 './section-view/manifests.js'; +import { manifests as workspaceManifests } from './workspace/manifests.js'; + import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; export const manifests: Array = [ ...collectionManifests, - ...repositoryManifests, - ...workspaceManifests, - ...modalManifests, - ...sectionViewManifests, ...entityActionManifests, ...entityBulkActionManifests, + ...menuItemManifests, + ...modalManifests, + ...repositoryManifests, + ...sectionViewManifests, + ...workspaceManifests, ]; diff --git a/src/packages/user/user-group/menu-item/manifests.ts b/src/packages/user/user-group/menu-item/manifests.ts new file mode 100644 index 0000000000..1c770acdae --- /dev/null +++ b/src/packages/user/user-group/menu-item/manifests.ts @@ -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 = [ + { + 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], + }, + }, +]; diff --git a/src/packages/user/user-group/section-view/manifests.ts b/src/packages/user/user-group/section-view/manifests.ts index f4549d458f..ade0536011 100644 --- a/src/packages/user/user-group/section-view/manifests.ts +++ b/src/packages/user/user-group/section-view/manifests.ts @@ -1,25 +1,14 @@ -import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../../section/index.js'; -import type { ManifestSectionView, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; +import { UMB_USER_GROUP_ROOT_ENTITY_TYPE } from '../entity.js'; +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; -const sectionsViews: Array = [ +export const manifests: Array = [ { - type: 'sectionView', - alias: 'Umb.SectionView.UserGroup', - name: 'User Group Section View', - js: () => import('./user-group-section-view.element.js'), - weight: 100, + type: 'workspace', + alias: 'Umb.Workspace.UserGroupRoot', + name: 'User Group Root Workspace View', + element: () => import('./user-group-root-workspace.element.js'), meta: { - label: '#user_usergroups', - pathname: 'user-groups', - icon: 'icon-users', + entityType: UMB_USER_GROUP_ROOT_ENTITY_TYPE, }, - conditions: [ - { - alias: 'Umb.Condition.SectionAlias', - match: UMB_USER_MANAGEMENT_SECTION_ALIAS, - }, - ], }, ]; - -export const manifests: Array = [...sectionsViews]; diff --git a/src/packages/user/user-group/section-view/user-group-root-workspace.element.ts b/src/packages/user/user-group/section-view/user-group-root-workspace.element.ts new file mode 100644 index 0000000000..f02687d62d --- /dev/null +++ b/src/packages/user/user-group/section-view/user-group-root-workspace.element.ts @@ -0,0 +1,21 @@ +import { UMB_USER_GROUP_COLLECTION_ALIAS } from '../collection/index.js'; +import { html, customElement } from '@umbraco-cms/backoffice/external/lit'; +import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; + +const elementName = 'umb-user-group-root-workspace'; +@customElement(elementName) +export class UmbUserGroupRootWorkspaceElement extends UmbLitElement { + override render() { + return html` + ; + `; + } +} + +export { UmbUserGroupRootWorkspaceElement as element }; + +declare global { + interface HTMLElementTagNameMap { + [elementName]: UmbUserGroupRootWorkspaceElement; + } +} diff --git a/src/packages/user/user-group/section-view/user-group-section-view.element.ts b/src/packages/user/user-group/section-view/user-group-section-view.element.ts deleted file mode 100644 index 4611f0962d..0000000000 --- a/src/packages/user/user-group/section-view/user-group-section-view.element.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { UMB_USER_GROUP_COLLECTION_ALIAS } from '../collection/index.js'; -import { UMB_USER_GROUP_ENTITY_TYPE } from '../entity.js'; -import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; -import { css, html, customElement } from '@umbraco-cms/backoffice/external/lit'; -import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import type { UmbRoute } from '@umbraco-cms/backoffice/router'; -import { UmbCollectionElement } from '@umbraco-cms/backoffice/collection'; -import { UmbWorkspaceElement } from '@umbraco-cms/backoffice/workspace'; - -@customElement('umb-user-group-section-view') -export class UmbUserGroupSectionViewElement extends UmbLitElement { - #routes: UmbRoute[] = [ - { - path: 'collection', - component: () => { - const element = new UmbCollectionElement(); - element.setAttribute('alias', UMB_USER_GROUP_COLLECTION_ALIAS); - return element; - }, - }, - { - path: 'user-group', - component: () => { - const element = new UmbWorkspaceElement(); - element.setAttribute('entity-type', UMB_USER_GROUP_ENTITY_TYPE); - return element; - }, - }, - { - path: '', - redirectTo: 'collection', - }, - { - path: `**`, - component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, - }, - ]; - - override render() { - return html``; - } - - static override styles = [ - UmbTextStyles, - css` - :host { - height: 100%; - } - - #router-slot { - height: calc(100% - var(--umb-header-layout-height)); - } - `, - ]; -} - -export default UmbUserGroupSectionViewElement; - -declare global { - interface HTMLElementTagNameMap { - 'umb-user-group-section-view': UmbUserGroupSectionViewElement; - } -} diff --git a/src/packages/user/user/menu-item/manifests.ts b/src/packages/user/user/menu-item/manifests.ts index 2239c2fe0f..c1980c58ef 100644 --- a/src/packages/user/user/menu-item/manifests.ts +++ b/src/packages/user/user/menu-item/manifests.ts @@ -7,7 +7,7 @@ export const manifests: Array = [ type: 'menuItem', alias: 'Umb.MenuItem.Users', name: 'Users Menu Item', - weight: 100, + weight: 200, meta: { label: '#treeHeaders_users', icon: 'icon-user', diff --git a/src/packages/user/user/section-view/manifests.ts b/src/packages/user/user/section-view/manifests.ts index aef4c6370e..96eea28eda 100644 --- a/src/packages/user/user/section-view/manifests.ts +++ b/src/packages/user/user/section-view/manifests.ts @@ -6,7 +6,7 @@ export const manifests: Array = [ type: 'workspace', alias: 'Umb.Workspace.UserRoot', name: 'User Root Workspace View', - element: () => import('./user-root-workspace-view.element.js'), + element: () => import('./user-root-workspace.element.js'), meta: { entityType: UMB_USER_ROOT_ENTITY_TYPE, }, diff --git a/src/packages/user/user/section-view/user-root-workspace-view.element.ts b/src/packages/user/user/section-view/user-root-workspace.element.ts similarity index 100% rename from src/packages/user/user/section-view/user-root-workspace-view.element.ts rename to src/packages/user/user/section-view/user-root-workspace.element.ts From de89c91069ded8a25d0e8da894e09f3ae4e7ee93 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 10 Sep 2024 12:55:06 +0200 Subject: [PATCH 04/25] update import path --- src/packages/user/user-group/paths.ts | 2 +- src/packages/user/user/paths.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/user/user-group/paths.ts b/src/packages/user/user-group/paths.ts index 6fc1f8cc7e..bcd681d6dc 100644 --- a/src/packages/user/user-group/paths.ts +++ b/src/packages/user/user-group/paths.ts @@ -1,4 +1,4 @@ -import { UMB_USER_SECTION_PATHNAME } from '../user-section/paths.js'; +import { UMB_USER_SECTION_PATHNAME } from '../section/paths.js'; import { UMB_USER_GROUP_ENTITY_TYPE } from './entity.js'; import { UMB_WORKSPACE_PATH_PATTERN } from '@umbraco-cms/backoffice/workspace'; diff --git a/src/packages/user/user/paths.ts b/src/packages/user/user/paths.ts index e9040e7270..eb80086f08 100644 --- a/src/packages/user/user/paths.ts +++ b/src/packages/user/user/paths.ts @@ -1,4 +1,4 @@ -import { UMB_USER_SECTION_PATHNAME } from '../user-section/paths.js'; +import { UMB_USER_SECTION_PATHNAME } from '../section/paths.js'; import { UMB_USER_ENTITY_TYPE } from './entity.js'; import { UMB_WORKSPACE_PATH_PATTERN } from '@umbraco-cms/backoffice/workspace'; From 81999941ced506b05402882c53a2174eb3bced6d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 10 Sep 2024 18:53:49 +0200 Subject: [PATCH 05/25] pass entity type from manifest --- .../menu/components/menu-item/menu-item-default.element.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packages/core/menu/components/menu-item/menu-item-default.element.ts b/src/packages/core/menu/components/menu-item/menu-item-default.element.ts index 75fbc48075..916598bc99 100644 --- a/src/packages/core/menu/components/menu-item/menu-item-default.element.ts +++ b/src/packages/core/menu/components/menu-item/menu-item-default.element.ts @@ -45,7 +45,8 @@ export class UmbMenuItemDefaultElement extends UmbLitElement implements UmbMenuI + .label=${this.localize.string(this.manifest.meta.label ?? this.manifest.name)} + .entityType=${this.manifest.meta.entityType}> `; } From dba4c74b036f5d8726ba7d5eb04bee8ee5477ed7 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 10 Sep 2024 21:13:01 +0200 Subject: [PATCH 06/25] add path helper to root --- src/packages/user/user/paths.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/packages/user/user/paths.ts b/src/packages/user/user/paths.ts index eb80086f08..210af851fd 100644 --- a/src/packages/user/user/paths.ts +++ b/src/packages/user/user/paths.ts @@ -1,8 +1,13 @@ import { UMB_USER_SECTION_PATHNAME } from '../section/paths.js'; -import { UMB_USER_ENTITY_TYPE } from './entity.js'; +import { UMB_USER_ENTITY_TYPE, UMB_USER_ROOT_ENTITY_TYPE } from './entity.js'; import { UMB_WORKSPACE_PATH_PATTERN } from '@umbraco-cms/backoffice/workspace'; export const UMB_USER_WORKSPACE_PATH = UMB_WORKSPACE_PATH_PATTERN.generateAbsolute({ sectionName: UMB_USER_SECTION_PATHNAME, entityType: UMB_USER_ENTITY_TYPE, }); + +export const UMB_USER_ROOT_WORKSPACE_PATH = UMB_WORKSPACE_PATH_PATTERN.generateAbsolute({ + sectionName: UMB_USER_SECTION_PATHNAME, + entityType: UMB_USER_ROOT_ENTITY_TYPE, +}); From 6d911aa199ee5f43918b3e1991b608b8dd0fe552 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 10 Sep 2024 21:13:12 +0200 Subject: [PATCH 07/25] back button to root --- .../user/user/workspace/user-workspace-editor.element.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/packages/user/user/workspace/user-workspace-editor.element.ts b/src/packages/user/user/workspace/user-workspace-editor.element.ts index c4e11d2175..3a1d79c7ef 100644 --- a/src/packages/user/user/workspace/user-workspace-editor.element.ts +++ b/src/packages/user/user/workspace/user-workspace-editor.element.ts @@ -13,6 +13,8 @@ import './components/user-workspace-access/user-workspace-access.element.js'; import './components/user-workspace-info/user-workspace-info.element.js'; import './components/user-workspace-avatar/user-workspace-avatar.element.js'; import './components/user-workspace-client-credentials/user-workspace-client-credentials.element.js'; +import { UMB_USER_WORKSPACE_ALIAS } from './constants.js'; +import { UMB_USER_ROOT_WORKSPACE_PATH } from '../paths.js'; @customElement('umb-user-workspace-editor') export class UmbUserWorkspaceEditorElement extends UmbLitElement { @@ -50,7 +52,10 @@ export class UmbUserWorkspaceEditorElement extends UmbLitElement { if (!this._user) return html`User not found`; return html` - + ${this.#renderHeader()}
${this.#renderLeftColumn()}
From 9a1d76c5ac5793dcf8dc8b9e9eb09836c805ca6e Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 10 Sep 2024 21:39:06 +0200 Subject: [PATCH 08/25] wip create + invite entity actions --- .../create/create-user-entity-action.ts | 21 ++++ .../user/entity-actions/create/manifests.ts | 22 ++++ .../user/entity-actions/create/modal/index.ts | 8 ++ .../entity-actions/create/modal/manifests.ts | 10 ++ .../user-create-options-modal.element.ts | 108 ++++++++++++++++++ .../invite/invite-user-entity-action.ts | 11 ++ .../user/entity-actions/invite/manifests.ts | 19 +++ .../user/user/entity-actions/manifests.ts | 12 +- 8 files changed, 209 insertions(+), 2 deletions(-) create mode 100644 src/packages/user/user/entity-actions/create/create-user-entity-action.ts create mode 100644 src/packages/user/user/entity-actions/create/manifests.ts create mode 100644 src/packages/user/user/entity-actions/create/modal/index.ts create mode 100644 src/packages/user/user/entity-actions/create/modal/manifests.ts create mode 100644 src/packages/user/user/entity-actions/create/modal/user-create-options-modal.element.ts create mode 100644 src/packages/user/user/entity-actions/invite/invite-user-entity-action.ts create mode 100644 src/packages/user/user/entity-actions/invite/manifests.ts diff --git a/src/packages/user/user/entity-actions/create/create-user-entity-action.ts b/src/packages/user/user/entity-actions/create/create-user-entity-action.ts new file mode 100644 index 0000000000..a6da26da4f --- /dev/null +++ b/src/packages/user/user/entity-actions/create/create-user-entity-action.ts @@ -0,0 +1,21 @@ +import { UMB_USER_CREATE_OPTIONS_MODAL } from './modal/index.js'; +import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action'; +import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; + +export class UmbCreateUserEntityAction extends UmbEntityActionBase { + override async execute() { + const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT); + const modalContext = modalManager.open(this, UMB_USER_CREATE_OPTIONS_MODAL, { + data: { + parent: { + unique: this.args.unique, + entityType: this.args.entityType, + }, + }, + }); + + await modalContext.onSubmit(); + } +} + +export { UmbCreateUserEntityAction as api }; diff --git a/src/packages/user/user/entity-actions/create/manifests.ts b/src/packages/user/user/entity-actions/create/manifests.ts new file mode 100644 index 0000000000..7915152337 --- /dev/null +++ b/src/packages/user/user/entity-actions/create/manifests.ts @@ -0,0 +1,22 @@ +import { UMB_USER_ROOT_ENTITY_TYPE } from '../../entity.js'; + +import { manifests as modalManifests } from './modal/manifests.js'; + +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + { + type: 'entityAction', + kind: 'default', + alias: 'Umb.EntityAction.User.Create', + name: 'Create User Entity Action', + weight: 1200, + api: () => import('./create-user-entity-action.js'), + forEntityTypes: [UMB_USER_ROOT_ENTITY_TYPE], + meta: { + icon: 'icon-add', + label: '#actions_create', + }, + }, + ...modalManifests, +]; diff --git a/src/packages/user/user/entity-actions/create/modal/index.ts b/src/packages/user/user/entity-actions/create/modal/index.ts new file mode 100644 index 0000000000..778a1fe38d --- /dev/null +++ b/src/packages/user/user/entity-actions/create/modal/index.ts @@ -0,0 +1,8 @@ +import { UmbModalToken } from '@umbraco-cms/backoffice/modal'; + +export const UMB_USER_CREATE_OPTIONS_MODAL = new UmbModalToken('Umb.Modal.User.CreateOptions', { + modal: { + type: 'sidebar', + size: 'small', + }, +}); diff --git a/src/packages/user/user/entity-actions/create/modal/manifests.ts b/src/packages/user/user/entity-actions/create/modal/manifests.ts new file mode 100644 index 0000000000..2c736c75fd --- /dev/null +++ b/src/packages/user/user/entity-actions/create/modal/manifests.ts @@ -0,0 +1,10 @@ +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + { + type: 'modal', + alias: 'Umb.Modal.User.CreateOptions', + name: 'User Create Options Modal', + element: () => import('./user-create-options-modal.element.js'), + }, +]; diff --git a/src/packages/user/user/entity-actions/create/modal/user-create-options-modal.element.ts b/src/packages/user/user/entity-actions/create/modal/user-create-options-modal.element.ts new file mode 100644 index 0000000000..29932ea273 --- /dev/null +++ b/src/packages/user/user/entity-actions/create/modal/user-create-options-modal.element.ts @@ -0,0 +1,108 @@ +import { UMB_CREATE_USER_MODAL } from '../../../modals/create/create-user-modal.token.js'; +import { UmbUserKind, type UmbUserKindType } from '../../../utils/index.js'; +import { html, customElement, map } from '@umbraco-cms/backoffice/external/lit'; +import { UMB_MODAL_MANAGER_CONTEXT, UmbModalBaseElement } from '@umbraco-cms/backoffice/modal'; +import type { UmbEntityModel } from '@umbraco-cms/backoffice/entity'; +import { UMB_ENTITY_CONTEXT } from '@umbraco-cms/backoffice/entity'; +import { UMB_ACTION_EVENT_CONTEXT } from '@umbraco-cms/backoffice/action'; +import { UmbRequestReloadChildrenOfEntityEvent } from '@umbraco-cms/backoffice/entity-action'; + +interface UmbUserCreateOptionModel { + label: string; + description: string; + icon: string; + kind: UmbUserKindType; +} + +const elementName = 'umb-user-create-options-modal'; +@customElement(elementName) +export class UmbUserCreateOptionsModalElement extends UmbModalBaseElement { + #options: Array = [ + { + label: this.localize.term('user_userKindDefault'), + description: 'Donec augue nunc, ullamcorper non turpis ut, maximus facilisis lorem. Nunc id sagittis magna.', + icon: 'icon-user', + kind: UmbUserKind.DEFAULT, + }, + { + label: this.localize.term('user_userKindApi'), + description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', + icon: 'icon-unplug', + kind: UmbUserKind.API, + }, + ]; + + async #onClick(event: Event, kind: UmbUserKindType) { + event.stopPropagation(); + const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT); + const entityContext = await this.getContext(UMB_ENTITY_CONTEXT); + + const unique = entityContext.getUnique(); + const entityType = entityContext.getEntityType(); + + if (unique === undefined) throw new Error('Missing unique'); + if (!entityType) throw new Error('Missing entityType'); + + const modalContext = modalManager.open(this, UMB_CREATE_USER_MODAL, { + data: { + user: { + kind, + }, + }, + }); + + modalContext + ?.onSubmit() + .then(() => { + this.#requestReloadChildrenOfEntity({ entityType, unique }); + }) + .catch(async () => { + // modal is closed after creation instead of navigating to the new user. + // We therefore need to reload the children of the entity + this.#requestReloadChildrenOfEntity({ entityType, unique }); + }); + } + + async #requestReloadChildrenOfEntity({ entityType, unique }: UmbEntityModel) { + const eventContext = await this.getContext(UMB_ACTION_EVENT_CONTEXT); + const event = new UmbRequestReloadChildrenOfEntityEvent({ + entityType, + unique, + }); + + eventContext.dispatchEvent(event); + } + + override render() { + return html` + + + + ${map( + this.#options, + (item) => html` + this.#onClick(event, item.kind)}> + `, + )} + + + + + `; + } +} + +export { UmbUserCreateOptionsModalElement as element }; + +declare global { + interface HTMLElementTagNameMap { + [elementName]: UmbUserCreateOptionsModalElement; + } +} diff --git a/src/packages/user/user/entity-actions/invite/invite-user-entity-action.ts b/src/packages/user/user/entity-actions/invite/invite-user-entity-action.ts new file mode 100644 index 0000000000..4ac61a28d5 --- /dev/null +++ b/src/packages/user/user/entity-actions/invite/invite-user-entity-action.ts @@ -0,0 +1,11 @@ +import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action'; +import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; + +export class UmbCreateUserEntityAction extends UmbEntityActionBase { + override async execute() { + const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT); + debugger; + } +} + +export { UmbCreateUserEntityAction as api }; diff --git a/src/packages/user/user/entity-actions/invite/manifests.ts b/src/packages/user/user/entity-actions/invite/manifests.ts new file mode 100644 index 0000000000..0fc1e67e74 --- /dev/null +++ b/src/packages/user/user/entity-actions/invite/manifests.ts @@ -0,0 +1,19 @@ +import { UMB_USER_ROOT_ENTITY_TYPE } from '../../entity.js'; + +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + { + type: 'entityAction', + kind: 'default', + alias: 'Umb.EntityAction.User.Invite', + name: 'Invite User Entity Action', + weight: 1000, + api: () => import('./invite-user-entity-action.js'), + forEntityTypes: [UMB_USER_ROOT_ENTITY_TYPE], + meta: { + icon: 'icon-paper-plane', + label: '#user_invite', + }, + }, +]; diff --git a/src/packages/user/user/entity-actions/manifests.ts b/src/packages/user/user/entity-actions/manifests.ts index b67955449e..493f108ff1 100644 --- a/src/packages/user/user/entity-actions/manifests.ts +++ b/src/packages/user/user/entity-actions/manifests.ts @@ -1,6 +1,10 @@ import { UMB_USER_DETAIL_REPOSITORY_ALIAS, UMB_USER_ITEM_REPOSITORY_ALIAS } from '../repository/index.js'; import { UMB_USER_ENTITY_TYPE } from '../entity.js'; -import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; + +import { manifests as createManifests } from './create/manifests.js'; +import { manifests as inviteManifests } from './invite/manifests.js'; + +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; const entityActions: Array = [ { @@ -93,4 +97,8 @@ const entityActions: Array = [ }, ]; -export const manifests: Array = [...entityActions]; +export const manifests: Array = [ + ...entityActions, + ...createManifests, + ...inviteManifests, +]; From be728f0aec5a807d920752bd2f817e213dca523e Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 10 Sep 2024 22:01:12 +0200 Subject: [PATCH 09/25] update back path --- src/packages/user/user-group/paths.ts | 7 ++++++- src/packages/user/user-group/workspace/constants.ts | 1 + .../workspace/user-group-workspace-editor.element.ts | 6 ++++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 src/packages/user/user-group/workspace/constants.ts diff --git a/src/packages/user/user-group/paths.ts b/src/packages/user/user-group/paths.ts index bcd681d6dc..51aa649211 100644 --- a/src/packages/user/user-group/paths.ts +++ b/src/packages/user/user-group/paths.ts @@ -1,8 +1,13 @@ import { UMB_USER_SECTION_PATHNAME } from '../section/paths.js'; -import { UMB_USER_GROUP_ENTITY_TYPE } from './entity.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, +}); diff --git a/src/packages/user/user-group/workspace/constants.ts b/src/packages/user/user-group/workspace/constants.ts new file mode 100644 index 0000000000..6972100cb8 --- /dev/null +++ b/src/packages/user/user-group/workspace/constants.ts @@ -0,0 +1 @@ +export const UMB_USER_GROUP_WORKSPACE_ALIAS = 'Umb.Workspace.UserGroup'; diff --git a/src/packages/user/user-group/workspace/user-group-workspace-editor.element.ts b/src/packages/user/user-group/workspace/user-group-workspace-editor.element.ts index 9374872d2a..a4d129dd04 100644 --- a/src/packages/user/user-group/workspace/user-group-workspace-editor.element.ts +++ b/src/packages/user/user-group/workspace/user-group-workspace-editor.element.ts @@ -1,5 +1,7 @@ import type { UmbUserGroupDetailModel } from '../index.js'; +import { UMB_USER_GROUP_ROOT_WORKSPACE_PATH } from '../paths.js'; import { UMB_USER_GROUP_WORKSPACE_CONTEXT } from './user-group-workspace.context-token.js'; +import { UMB_USER_GROUP_WORKSPACE_ALIAS } from './constants.js'; import type { UUIBooleanInputEvent } from '@umbraco-cms/backoffice/external/uui'; import { css, html, nothing, customElement, state, ifDefined } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement, umbFocus } from '@umbraco-cms/backoffice/lit-element'; @@ -170,9 +172,9 @@ export class UmbUserGroupWorkspaceEditorElement extends UmbLitElement { return html` + back-path=${UMB_USER_GROUP_ROOT_WORKSPACE_PATH}> ${this.#renderHeader()} ${this.#renderMain()} `; From dc2c07f32414deae1d69c1efb959195b55c9c5ef Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 11 Sep 2024 15:37:27 +0200 Subject: [PATCH 10/25] add to folder --- .../user/section/sidebar-app/index.ts | 2 +- src/packages/user/user-group/manifests.ts | 4 +- ...orkspace-action-user-group-save.element.ts | 2 +- .../user-allow-action-base.condition.ts | 2 +- src/packages/user/user/workspace/manifests.ts | 44 ++----------------- .../user-workspace-action-save.element.ts | 0 .../user-workspace-access.element.ts | 2 +- .../user-workspace-assign-access.element.ts | 2 +- .../user-workspace-avatar.element.ts | 2 +- ...er-workspace-client-credentials.element.ts | 8 ++-- .../user-workspace-info.element.ts | 8 ++-- ...user-workspace-profile-settings.element.ts | 4 +- .../user/workspace/{ => user}/constants.ts | 0 .../user/user/workspace/user/manifests.ts | 42 ++++++++++++++++++ .../user-workspace-editor.element.ts | 6 +-- .../user-workspace.context-token.ts | 2 +- .../{ => user}/user-workspace.context.ts | 10 ++--- .../{ => user}/user-workspace.test.ts | 0 18 files changed, 72 insertions(+), 68 deletions(-) rename src/packages/user/user/workspace/{ => user}/actions/user-workspace-action-save.element.ts (100%) rename src/packages/user/user/workspace/{ => user}/components/user-workspace-access/user-workspace-access.element.ts (97%) rename src/packages/user/user/workspace/{ => user}/components/user-workspace-assign-access/user-workspace-assign-access.element.ts (99%) rename src/packages/user/user/workspace/{ => user}/components/user-workspace-avatar/user-workspace-avatar.element.ts (97%) rename src/packages/user/user/workspace/{ => user}/components/user-workspace-client-credentials/user-workspace-client-credentials.element.ts (93%) rename src/packages/user/user/workspace/{ => user}/components/user-workspace-info/user-workspace-info.element.ts (95%) rename src/packages/user/user/workspace/{ => user}/components/user-workspace-profile-settings/user-workspace-profile-settings.element.ts (97%) rename src/packages/user/user/workspace/{ => user}/constants.ts (100%) create mode 100644 src/packages/user/user/workspace/user/manifests.ts rename src/packages/user/user/workspace/{ => user}/user-workspace-editor.element.ts (97%) rename src/packages/user/user/workspace/{ => user}/user-workspace.context-token.ts (89%) rename src/packages/user/user/workspace/{ => user}/user-workspace.context.ts (94%) rename src/packages/user/user/workspace/{ => user}/user-workspace.test.ts (100%) diff --git a/src/packages/user/section/sidebar-app/index.ts b/src/packages/user/section/sidebar-app/index.ts index 4f07201dcf..42f853e5be 100644 --- a/src/packages/user/section/sidebar-app/index.ts +++ b/src/packages/user/section/sidebar-app/index.ts @@ -1 +1 @@ -export * from './constants.js'; +export * from '../constants.js'; diff --git a/src/packages/user/user-group/manifests.ts b/src/packages/user/user-group/manifests.ts index 1ac88d4e75..a68693f9c3 100644 --- a/src/packages/user/user-group/manifests.ts +++ b/src/packages/user/user-group/manifests.ts @@ -7,9 +7,9 @@ import { manifests as repositoryManifests } from './repository/manifests.js'; import { manifests as sectionViewManifests } from './section-view/manifests.js'; import { manifests as workspaceManifests } from './workspace/manifests.js'; -import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; -export const manifests: Array = [ +export const manifests: Array = [ ...collectionManifests, ...entityActionManifests, ...entityBulkActionManifests, diff --git a/src/packages/user/user-group/workspace/actions/workspace-action-user-group-save.element.ts b/src/packages/user/user-group/workspace/actions/workspace-action-user-group-save.element.ts index 1c86ca5b08..530c72b616 100644 --- a/src/packages/user/user-group/workspace/actions/workspace-action-user-group-save.element.ts +++ b/src/packages/user/user-group/workspace/actions/workspace-action-user-group-save.element.ts @@ -1,4 +1,4 @@ -import { UMB_USER_WORKSPACE_CONTEXT } from '../../../user/workspace/user-workspace.context-token.js'; +import { UMB_USER_WORKSPACE_CONTEXT } from '../../../user/workspace/user/user-workspace.context-token.js'; import { html, customElement, state } from '@umbraco-cms/backoffice/external/lit'; import type { UUIButtonState } from '@umbraco-cms/backoffice/external/uui'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; diff --git a/src/packages/user/user/conditions/user-allow-action-base.condition.ts b/src/packages/user/user/conditions/user-allow-action-base.condition.ts index bdae21f4af..7dffc20550 100644 --- a/src/packages/user/user/conditions/user-allow-action-base.condition.ts +++ b/src/packages/user/user/conditions/user-allow-action-base.condition.ts @@ -1,5 +1,5 @@ import type { UmbUserStateEnum } from '../types.js'; -import { UMB_USER_WORKSPACE_CONTEXT } from '../workspace/user-workspace.context-token.js'; +import { UMB_USER_WORKSPACE_CONTEXT } from '../workspace/user/user-workspace.context-token.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { isCurrentUser } from '@umbraco-cms/backoffice/current-user'; import type { diff --git a/src/packages/user/user/workspace/manifests.ts b/src/packages/user/user/workspace/manifests.ts index d2c5c90ec4..a8bafd21d8 100644 --- a/src/packages/user/user/workspace/manifests.ts +++ b/src/packages/user/user/workspace/manifests.ts @@ -1,42 +1,4 @@ -import { UMB_USER_ENTITY_TYPE } from '../entity.js'; -import { UMB_USER_WORKSPACE_ALIAS } from './constants.js'; -import { UmbSubmitWorkspaceAction } from '@umbraco-cms/backoffice/workspace'; -import type { - ManifestWorkspaces, - ManifestWorkspaceActions, - ManifestTypes, -} from '@umbraco-cms/backoffice/extension-registry'; +import { manifests as userManifests } from './user/manifests.js'; +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -const workspace: ManifestWorkspaces = { - type: 'workspace', - kind: 'routable', - alias: UMB_USER_WORKSPACE_ALIAS, - name: 'User Workspace', - api: () => import('./user-workspace.context.js'), - meta: { - entityType: UMB_USER_ENTITY_TYPE, - }, -}; - -const workspaceActions: Array = [ - { - type: 'workspaceAction', - kind: 'default', - alias: 'Umb.WorkspaceAction.User.Save', - name: 'Save User Workspace Action', - api: UmbSubmitWorkspaceAction, - meta: { - label: '#buttons_save', - look: 'primary', - color: 'positive', - }, - conditions: [ - { - alias: 'Umb.Condition.WorkspaceAlias', - match: workspace.alias, - }, - ], - }, -]; - -export const manifests: Array = [workspace, ...workspaceActions]; +export const manifests: Array = [...userManifests]; diff --git a/src/packages/user/user/workspace/actions/user-workspace-action-save.element.ts b/src/packages/user/user/workspace/user/actions/user-workspace-action-save.element.ts similarity index 100% rename from src/packages/user/user/workspace/actions/user-workspace-action-save.element.ts rename to src/packages/user/user/workspace/user/actions/user-workspace-action-save.element.ts diff --git a/src/packages/user/user/workspace/components/user-workspace-access/user-workspace-access.element.ts b/src/packages/user/user/workspace/user/components/user-workspace-access/user-workspace-access.element.ts similarity index 97% rename from src/packages/user/user/workspace/components/user-workspace-access/user-workspace-access.element.ts rename to src/packages/user/user/workspace/user/components/user-workspace-access/user-workspace-access.element.ts index 7177e91909..86197319e5 100644 --- a/src/packages/user/user/workspace/components/user-workspace-access/user-workspace-access.element.ts +++ b/src/packages/user/user/workspace/user/components/user-workspace-access/user-workspace-access.element.ts @@ -1,5 +1,5 @@ import { UMB_USER_WORKSPACE_CONTEXT } from '../../user-workspace.context-token.js'; -import type { UmbUserStartNodesModel } from '../../../types.js'; +import type { UmbUserStartNodesModel } from '../../../../types.js'; import { html, customElement, state, css } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; diff --git a/src/packages/user/user/workspace/components/user-workspace-assign-access/user-workspace-assign-access.element.ts b/src/packages/user/user/workspace/user/components/user-workspace-assign-access/user-workspace-assign-access.element.ts similarity index 99% rename from src/packages/user/user/workspace/components/user-workspace-assign-access/user-workspace-assign-access.element.ts rename to src/packages/user/user/workspace/user/components/user-workspace-assign-access/user-workspace-assign-access.element.ts index 6a7a881039..d32bb6e0fd 100644 --- a/src/packages/user/user/workspace/components/user-workspace-assign-access/user-workspace-assign-access.element.ts +++ b/src/packages/user/user/workspace/user/components/user-workspace-assign-access/user-workspace-assign-access.element.ts @@ -1,5 +1,5 @@ import { UMB_USER_WORKSPACE_CONTEXT } from '../../user-workspace.context-token.js'; -import type { UmbUserDetailModel } from '../../../types.js'; +import type { UmbUserDetailModel } from '../../../../types.js'; import { html, customElement, state, nothing, css } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; diff --git a/src/packages/user/user/workspace/components/user-workspace-avatar/user-workspace-avatar.element.ts b/src/packages/user/user/workspace/user/components/user-workspace-avatar/user-workspace-avatar.element.ts similarity index 97% rename from src/packages/user/user/workspace/components/user-workspace-avatar/user-workspace-avatar.element.ts rename to src/packages/user/user/workspace/user/components/user-workspace-avatar/user-workspace-avatar.element.ts index b3c7317d12..9400230d7a 100644 --- a/src/packages/user/user/workspace/components/user-workspace-avatar/user-workspace-avatar.element.ts +++ b/src/packages/user/user/workspace/user/components/user-workspace-avatar/user-workspace-avatar.element.ts @@ -1,4 +1,4 @@ -import type { UmbUserDetailModel } from '../../../types.js'; +import type { UmbUserDetailModel } from '../../../../types.js'; import { UMB_USER_WORKSPACE_CONTEXT } from '../../user-workspace.context-token.js'; import { css, html, customElement, query, nothing, state } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; diff --git a/src/packages/user/user/workspace/components/user-workspace-client-credentials/user-workspace-client-credentials.element.ts b/src/packages/user/user/workspace/user/components/user-workspace-client-credentials/user-workspace-client-credentials.element.ts similarity index 93% rename from src/packages/user/user/workspace/components/user-workspace-client-credentials/user-workspace-client-credentials.element.ts rename to src/packages/user/user/workspace/user/components/user-workspace-client-credentials/user-workspace-client-credentials.element.ts index 512d97f2d6..7d77417056 100644 --- a/src/packages/user/user/workspace/components/user-workspace-client-credentials/user-workspace-client-credentials.element.ts +++ b/src/packages/user/user/workspace/user/components/user-workspace-client-credentials/user-workspace-client-credentials.element.ts @@ -2,10 +2,10 @@ import { UMB_USER_WORKSPACE_CONTEXT } from '../../user-workspace.context-token.j import type { UmbDeleteUserClientCredentialRequestArgs, UmbUserClientCredentialModel, -} from '../../../client-credential/index.js'; -import { UmbUserClientCredentialRepository } from '../../../client-credential/index.js'; -import { UMB_CREATE_USER_CLIENT_CREDENTIAL_MODAL } from '../../../client-credential/create/modal/create-user-client-credential-modal.token.js'; -import { UmbUserKind } from '../../../utils/index.js'; +} from '../../../../client-credential/index.js'; +import { UmbUserClientCredentialRepository } from '../../../../client-credential/index.js'; +import { UMB_CREATE_USER_CLIENT_CREDENTIAL_MODAL } from '../../../../client-credential/create/modal/create-user-client-credential-modal.token.js'; +import { UmbUserKind } from '../../../../utils/index.js'; import { html, customElement, state, css, nothing } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; diff --git a/src/packages/user/user/workspace/components/user-workspace-info/user-workspace-info.element.ts b/src/packages/user/user/workspace/user/components/user-workspace-info/user-workspace-info.element.ts similarity index 95% rename from src/packages/user/user/workspace/components/user-workspace-info/user-workspace-info.element.ts rename to src/packages/user/user/workspace/user/components/user-workspace-info/user-workspace-info.element.ts index 898bea5823..8f5d2437b0 100644 --- a/src/packages/user/user/workspace/components/user-workspace-info/user-workspace-info.element.ts +++ b/src/packages/user/user/workspace/user/components/user-workspace-info/user-workspace-info.element.ts @@ -1,8 +1,8 @@ -import type { UmbUserDisplayStatus } from '../../../utils.js'; -import { TimeFormatOptions, getDisplayStateFromUserStatus } from '../../../utils.js'; +import type { UmbUserDisplayStatus } from '../../../../utils.js'; +import { TimeFormatOptions, getDisplayStateFromUserStatus } from '../../../../utils.js'; import { UMB_USER_WORKSPACE_CONTEXT } from '../../user-workspace.context-token.js'; -import type { UmbUserDetailModel } from '../../../types.js'; -import { UmbUserKind } from '../../../utils/index.js'; +import type { UmbUserDetailModel } from '../../../../types.js'; +import { UmbUserKind } from '../../../../utils/index.js'; import { html, customElement, state, css, repeat, ifDefined, nothing } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; diff --git a/src/packages/user/user/workspace/components/user-workspace-profile-settings/user-workspace-profile-settings.element.ts b/src/packages/user/user/workspace/user/components/user-workspace-profile-settings/user-workspace-profile-settings.element.ts similarity index 97% rename from src/packages/user/user/workspace/components/user-workspace-profile-settings/user-workspace-profile-settings.element.ts rename to src/packages/user/user/workspace/user/components/user-workspace-profile-settings/user-workspace-profile-settings.element.ts index fd4e67c615..0d313eb130 100644 --- a/src/packages/user/user/workspace/components/user-workspace-profile-settings/user-workspace-profile-settings.element.ts +++ b/src/packages/user/user/workspace/user/components/user-workspace-profile-settings/user-workspace-profile-settings.element.ts @@ -1,11 +1,11 @@ import { UMB_USER_WORKSPACE_CONTEXT } from '../../user-workspace.context-token.js'; -import type { UmbUserDetailModel } from '../../../types.js'; +import type { UmbUserDetailModel } from '../../../../types.js'; +import { UmbUserKind } from '../../../../utils/index.js'; import { html, customElement, state, ifDefined, css, nothing } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import type { UmbChangeEvent } from '@umbraco-cms/backoffice/event'; import type { UmbUiCultureInputElement } from '@umbraco-cms/backoffice/localization'; -import { UmbUserKind } from '../../../utils/index.js'; @customElement('umb-user-workspace-profile-settings') export class UmbUserWorkspaceProfileSettingsElement extends UmbLitElement { diff --git a/src/packages/user/user/workspace/constants.ts b/src/packages/user/user/workspace/user/constants.ts similarity index 100% rename from src/packages/user/user/workspace/constants.ts rename to src/packages/user/user/workspace/user/constants.ts diff --git a/src/packages/user/user/workspace/user/manifests.ts b/src/packages/user/user/workspace/user/manifests.ts new file mode 100644 index 0000000000..3f4203dd88 --- /dev/null +++ b/src/packages/user/user/workspace/user/manifests.ts @@ -0,0 +1,42 @@ +import { UMB_USER_ENTITY_TYPE } from '../../entity.js'; +import { UMB_USER_WORKSPACE_ALIAS } from './constants.js'; +import { UmbSubmitWorkspaceAction } from '@umbraco-cms/backoffice/workspace'; +import type { + ManifestWorkspaces, + ManifestWorkspaceActions, + ManifestTypes, +} from '@umbraco-cms/backoffice/extension-registry'; + +const workspace: ManifestWorkspaces = { + type: 'workspace', + kind: 'routable', + alias: UMB_USER_WORKSPACE_ALIAS, + name: 'User Workspace', + api: () => import('./user-workspace.context.js'), + meta: { + entityType: UMB_USER_ENTITY_TYPE, + }, +}; + +const workspaceActions: Array = [ + { + type: 'workspaceAction', + kind: 'default', + alias: 'Umb.WorkspaceAction.User.Save', + name: 'Save User Workspace Action', + api: UmbSubmitWorkspaceAction, + meta: { + label: '#buttons_save', + look: 'primary', + color: 'positive', + }, + conditions: [ + { + alias: 'Umb.Condition.WorkspaceAlias', + match: workspace.alias, + }, + ], + }, +]; + +export const manifests: Array = [workspace, ...workspaceActions]; diff --git a/src/packages/user/user/workspace/user-workspace-editor.element.ts b/src/packages/user/user/workspace/user/user-workspace-editor.element.ts similarity index 97% rename from src/packages/user/user/workspace/user-workspace-editor.element.ts rename to src/packages/user/user/workspace/user/user-workspace-editor.element.ts index 3a1d79c7ef..b65ebebf63 100644 --- a/src/packages/user/user/workspace/user-workspace-editor.element.ts +++ b/src/packages/user/user/workspace/user/user-workspace-editor.element.ts @@ -1,6 +1,8 @@ -import type { UmbUserDetailModel } from '../index.js'; +import type { UmbUserDetailModel } from '../../index.js'; +import { UMB_USER_ROOT_WORKSPACE_PATH } from '../../paths.js'; import type { UmbUserWorkspaceContext } from './user-workspace.context.js'; import { UMB_USER_WORKSPACE_CONTEXT } from './user-workspace.context-token.js'; +import { UMB_USER_WORKSPACE_ALIAS } from './constants.js'; import type { UUIInputElement } from '@umbraco-cms/backoffice/external/uui'; import { UUIInputEvent } from '@umbraco-cms/backoffice/external/uui'; import { css, html, nothing, customElement, state } from '@umbraco-cms/backoffice/external/lit'; @@ -13,8 +15,6 @@ import './components/user-workspace-access/user-workspace-access.element.js'; import './components/user-workspace-info/user-workspace-info.element.js'; import './components/user-workspace-avatar/user-workspace-avatar.element.js'; import './components/user-workspace-client-credentials/user-workspace-client-credentials.element.js'; -import { UMB_USER_WORKSPACE_ALIAS } from './constants.js'; -import { UMB_USER_ROOT_WORKSPACE_PATH } from '../paths.js'; @customElement('umb-user-workspace-editor') export class UmbUserWorkspaceEditorElement extends UmbLitElement { diff --git a/src/packages/user/user/workspace/user-workspace.context-token.ts b/src/packages/user/user/workspace/user/user-workspace.context-token.ts similarity index 89% rename from src/packages/user/user/workspace/user-workspace.context-token.ts rename to src/packages/user/user/workspace/user/user-workspace.context-token.ts index ac99021cc5..bac31a226c 100644 --- a/src/packages/user/user/workspace/user-workspace.context-token.ts +++ b/src/packages/user/user/workspace/user/user-workspace.context-token.ts @@ -1,4 +1,4 @@ -import { UMB_USER_ENTITY_TYPE } from '../entity.js'; +import { UMB_USER_ENTITY_TYPE } from '../../entity.js'; import type { UmbUserWorkspaceContext } from './user-workspace.context.js'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbSubmittableWorkspaceContext } from '@umbraco-cms/backoffice/workspace'; diff --git a/src/packages/user/user/workspace/user-workspace.context.ts b/src/packages/user/user/workspace/user/user-workspace.context.ts similarity index 94% rename from src/packages/user/user/workspace/user-workspace.context.ts rename to src/packages/user/user/workspace/user/user-workspace.context.ts index 69587e191d..18963318ec 100644 --- a/src/packages/user/user/workspace/user-workspace.context.ts +++ b/src/packages/user/user/workspace/user/user-workspace.context.ts @@ -1,8 +1,8 @@ -import type { UmbUserDetailModel, UmbUserStartNodesModel, UmbUserStateEnum } from '../types.js'; -import { UMB_USER_ENTITY_TYPE } from '../entity.js'; -import { UmbUserDetailRepository } from '../repository/index.js'; -import { UmbUserAvatarRepository } from '../repository/avatar/index.js'; -import { UmbUserConfigRepository } from '../repository/config/index.js'; +import type { UmbUserDetailModel, UmbUserStartNodesModel, UmbUserStateEnum } from '../../types.js'; +import { UMB_USER_ENTITY_TYPE } from '../../entity.js'; +import { UmbUserDetailRepository } from '../../repository/index.js'; +import { UmbUserAvatarRepository } from '../../repository/avatar/index.js'; +import { UmbUserConfigRepository } from '../../repository/config/index.js'; import { UMB_USER_WORKSPACE_ALIAS } from './constants.js'; import { UmbUserWorkspaceEditorElement } from './user-workspace-editor.element.js'; import type { UmbSubmittableWorkspaceContext } from '@umbraco-cms/backoffice/workspace'; diff --git a/src/packages/user/user/workspace/user-workspace.test.ts b/src/packages/user/user/workspace/user/user-workspace.test.ts similarity index 100% rename from src/packages/user/user/workspace/user-workspace.test.ts rename to src/packages/user/user/workspace/user/user-workspace.test.ts From b2de7e57d6bd66234e45588ca04d84060a14ea8a Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 11 Sep 2024 15:38:05 +0200 Subject: [PATCH 11/25] rename folder --- src/packages/user/user/{section-view => user-root}/manifests.ts | 0 .../{section-view => user-root}/user-root-workspace.element.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/packages/user/user/{section-view => user-root}/manifests.ts (100%) rename src/packages/user/user/{section-view => user-root}/user-root-workspace.element.ts (100%) diff --git a/src/packages/user/user/section-view/manifests.ts b/src/packages/user/user/user-root/manifests.ts similarity index 100% rename from src/packages/user/user/section-view/manifests.ts rename to src/packages/user/user/user-root/manifests.ts diff --git a/src/packages/user/user/section-view/user-root-workspace.element.ts b/src/packages/user/user/user-root/user-root-workspace.element.ts similarity index 100% rename from src/packages/user/user/section-view/user-root-workspace.element.ts rename to src/packages/user/user/user-root/user-root-workspace.element.ts From 8244ab8d7df61e57d9c63b004d8c1a156b9cd4aa Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 11 Sep 2024 15:38:59 +0200 Subject: [PATCH 12/25] move into workspace folder --- src/packages/user/user/manifests.ts | 2 -- src/packages/user/user/workspace/manifests.ts | 3 ++- src/packages/user/user/{ => workspace}/user-root/manifests.ts | 2 +- .../{ => workspace}/user-root/user-root-workspace.element.ts | 0 4 files changed, 3 insertions(+), 4 deletions(-) rename src/packages/user/user/{ => workspace}/user-root/manifests.ts (86%) rename src/packages/user/user/{ => workspace}/user-root/user-root-workspace.element.ts (100%) diff --git a/src/packages/user/user/manifests.ts b/src/packages/user/user/manifests.ts index 383ff1ad80..b73a4378c2 100644 --- a/src/packages/user/user/manifests.ts +++ b/src/packages/user/user/manifests.ts @@ -7,7 +7,6 @@ import { manifests as inviteManifests } from './invite/manifests.js'; import { manifests as modalManifests } from './modals/manifests.js'; import { manifests as propertyEditorManifests } from './property-editor/manifests.js'; import { manifests as repositoryManifests } from './repository/manifests.js'; -import { manifests as sectionViewManifests } from './section-view/manifests.js'; import { manifests as workspaceManifests } from './workspace/manifests.js'; import { manifests as menuItemManifests } from './menu-item/manifests.js'; @@ -23,7 +22,6 @@ export const manifests: Array = [ ...modalManifests, ...propertyEditorManifests, ...repositoryManifests, - ...sectionViewManifests, ...workspaceManifests, ...menuItemManifests, ]; diff --git a/src/packages/user/user/workspace/manifests.ts b/src/packages/user/user/workspace/manifests.ts index a8bafd21d8..09e4d463e9 100644 --- a/src/packages/user/user/workspace/manifests.ts +++ b/src/packages/user/user/workspace/manifests.ts @@ -1,4 +1,5 @@ import { manifests as userManifests } from './user/manifests.js'; +import { manifests as userRootManifests } from './user-root/manifests.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const manifests: Array = [...userManifests]; +export const manifests: Array = [...userManifests, ...userRootManifests]; diff --git a/src/packages/user/user/user-root/manifests.ts b/src/packages/user/user/workspace/user-root/manifests.ts similarity index 86% rename from src/packages/user/user/user-root/manifests.ts rename to src/packages/user/user/workspace/user-root/manifests.ts index 96eea28eda..9cb07892d3 100644 --- a/src/packages/user/user/user-root/manifests.ts +++ b/src/packages/user/user/workspace/user-root/manifests.ts @@ -1,4 +1,4 @@ -import { UMB_USER_ROOT_ENTITY_TYPE } from '../entity.js'; +import { UMB_USER_ROOT_ENTITY_TYPE } from '../../entity.js'; import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; export const manifests: Array = [ diff --git a/src/packages/user/user/user-root/user-root-workspace.element.ts b/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts similarity index 100% rename from src/packages/user/user/user-root/user-root-workspace.element.ts rename to src/packages/user/user/workspace/user-root/user-root-workspace.element.ts From 24a9ae18aeb3b3bb4d910c340adefbf2d29bca8e Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 11 Sep 2024 15:40:31 +0200 Subject: [PATCH 13/25] add missing type --- src/packages/user/user/workspace/manifests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/user/user/workspace/manifests.ts b/src/packages/user/user/workspace/manifests.ts index 09e4d463e9..2208cee94d 100644 --- a/src/packages/user/user/workspace/manifests.ts +++ b/src/packages/user/user/workspace/manifests.ts @@ -1,5 +1,5 @@ import { manifests as userManifests } from './user/manifests.js'; import { manifests as userRootManifests } from './user-root/manifests.js'; -import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; -export const manifests: Array = [...userManifests, ...userRootManifests]; +export const manifests: Array = [...userManifests, ...userRootManifests]; From 5a94f4d6c4cd90e4c9795772c1de2b2831eb71b0 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 11 Sep 2024 15:40:37 +0200 Subject: [PATCH 14/25] fix path --- .../user/workspace/user-root/user-root-workspace.element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts b/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts index 6e286dada3..65ec9cd88c 100644 --- a/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts +++ b/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts @@ -1,4 +1,4 @@ -import { UMB_USER_COLLECTION_ALIAS } from '../collection/index.js'; +import { UMB_USER_COLLECTION_ALIAS } from '../../collection/index.js'; import { html, customElement } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; From 7913258bedfcafe91fb68d85ecec1d96890b276e Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 11 Sep 2024 15:43:55 +0200 Subject: [PATCH 15/25] delete unused code --- ...orkspace-action-user-group-save.element.ts | 52 ------------------- 1 file changed, 52 deletions(-) delete mode 100644 src/packages/user/user-group/workspace/actions/workspace-action-user-group-save.element.ts diff --git a/src/packages/user/user-group/workspace/actions/workspace-action-user-group-save.element.ts b/src/packages/user/user-group/workspace/actions/workspace-action-user-group-save.element.ts deleted file mode 100644 index 530c72b616..0000000000 --- a/src/packages/user/user-group/workspace/actions/workspace-action-user-group-save.element.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { UMB_USER_WORKSPACE_CONTEXT } from '../../../user/workspace/user/user-workspace.context-token.js'; -import { html, customElement, state } from '@umbraco-cms/backoffice/external/lit'; -import type { UUIButtonState } from '@umbraco-cms/backoffice/external/uui'; -import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -// TODO: Revisit this component, it can be made via a kind with api instead. [NL] -// TODO: This seems like legacy code [NL] -@customElement('umb-workspace-action-user-group-save') -export class UmbWorkspaceActionUserGroupSaveElement extends UmbLitElement { - @state() - private _saveButtonState?: UUIButtonState; - - private _workspaceContext?: typeof UMB_USER_WORKSPACE_CONTEXT.TYPE; - - constructor() { - super(); - - this.consumeContext(UMB_USER_WORKSPACE_CONTEXT, (instance) => { - this._workspaceContext = instance; - }); - } - - private async _handleSave() { - if (!this._workspaceContext) return; - - this._saveButtonState = 'waiting'; - await this._workspaceContext - .requestSubmit() - .then(() => { - this._saveButtonState = 'success'; - }) - .catch(() => { - this._saveButtonState = 'failed'; - }); - } - - override render() { - return html``; - } -} - -export default UmbWorkspaceActionUserGroupSaveElement; - -declare global { - interface HTMLElementTagNameMap { - 'umb-workspace-action-user-group-save': UmbWorkspaceActionUserGroupSaveElement; - } -} From 7ab574eadf78991323ca32d46a486ca3d3c32020 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 11 Sep 2024 16:04:02 +0200 Subject: [PATCH 16/25] set up entity context --- .../workspace/user-root/user-root-workspace.element.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts b/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts index 65ec9cd88c..2411336b55 100644 --- a/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts +++ b/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts @@ -1,10 +1,20 @@ import { UMB_USER_COLLECTION_ALIAS } from '../../collection/index.js'; +import { UMB_USER_ROOT_ENTITY_TYPE } from '../../entity.js'; +import { UmbEntityContext } from '@umbraco-cms/backoffice/entity'; import { html, customElement } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; const elementName = 'umb-user-root-workspace'; @customElement(elementName) export class UmbUserRootWorkspaceElement extends UmbLitElement { + constructor() { + super(); + // TODO: this.should happen automatically + const entityContext = new UmbEntityContext(this); + entityContext.setEntityType(UMB_USER_ROOT_ENTITY_TYPE); + entityContext.setUnique(null); + } + override render() { return html` ; From 820305fea88dfaa0223521ef3c7dcb16b6e17a6d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 11 Sep 2024 16:09:03 +0200 Subject: [PATCH 17/25] add invite entity action + clean up --- .../user/user/entity-actions/manifests.ts | 7 +---- .../invite/invite-user-entity-action.ts | 4 ++- .../entity-action}/invite/manifests.ts | 2 +- .../user/invite/entity-action/manifests.ts | 28 ++++--------------- .../entity-action/resend-invite/manifests.ts | 19 +++++++++++++ src/packages/user/user/invite/manifests.ts | 4 +-- 6 files changed, 31 insertions(+), 33 deletions(-) rename src/packages/user/user/{entity-actions => invite/entity-action}/invite/invite-user-entity-action.ts (70%) rename src/packages/user/user/{entity-actions => invite/entity-action}/invite/manifests.ts (88%) diff --git a/src/packages/user/user/entity-actions/manifests.ts b/src/packages/user/user/entity-actions/manifests.ts index 493f108ff1..f59da30aeb 100644 --- a/src/packages/user/user/entity-actions/manifests.ts +++ b/src/packages/user/user/entity-actions/manifests.ts @@ -2,7 +2,6 @@ import { UMB_USER_DETAIL_REPOSITORY_ALIAS, UMB_USER_ITEM_REPOSITORY_ALIAS } from import { UMB_USER_ENTITY_TYPE } from '../entity.js'; import { manifests as createManifests } from './create/manifests.js'; -import { manifests as inviteManifests } from './invite/manifests.js'; import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; @@ -97,8 +96,4 @@ const entityActions: Array = [ }, ]; -export const manifests: Array = [ - ...entityActions, - ...createManifests, - ...inviteManifests, -]; +export const manifests: Array = [...entityActions, ...createManifests]; diff --git a/src/packages/user/user/entity-actions/invite/invite-user-entity-action.ts b/src/packages/user/user/invite/entity-action/invite/invite-user-entity-action.ts similarity index 70% rename from src/packages/user/user/entity-actions/invite/invite-user-entity-action.ts rename to src/packages/user/user/invite/entity-action/invite/invite-user-entity-action.ts index 4ac61a28d5..7d7f86ec79 100644 --- a/src/packages/user/user/entity-actions/invite/invite-user-entity-action.ts +++ b/src/packages/user/user/invite/entity-action/invite/invite-user-entity-action.ts @@ -1,10 +1,12 @@ +import { UMB_INVITE_USER_MODAL } from '../../index.js'; import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; export class UmbCreateUserEntityAction extends UmbEntityActionBase { override async execute() { const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT); - debugger; + const modalContext = modalManager.open(this, UMB_INVITE_USER_MODAL); + await modalContext?.onSubmit(); } } diff --git a/src/packages/user/user/entity-actions/invite/manifests.ts b/src/packages/user/user/invite/entity-action/invite/manifests.ts similarity index 88% rename from src/packages/user/user/entity-actions/invite/manifests.ts rename to src/packages/user/user/invite/entity-action/invite/manifests.ts index 0fc1e67e74..64ca8e8772 100644 --- a/src/packages/user/user/entity-actions/invite/manifests.ts +++ b/src/packages/user/user/invite/entity-action/invite/manifests.ts @@ -1,4 +1,4 @@ -import { UMB_USER_ROOT_ENTITY_TYPE } from '../../entity.js'; +import { UMB_USER_ROOT_ENTITY_TYPE } from '../../../entity.js'; import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; diff --git a/src/packages/user/user/invite/entity-action/manifests.ts b/src/packages/user/user/invite/entity-action/manifests.ts index af09b5ff79..0958868a9f 100644 --- a/src/packages/user/user/invite/entity-action/manifests.ts +++ b/src/packages/user/user/invite/entity-action/manifests.ts @@ -1,27 +1,9 @@ -import { UMB_USER_ENTITY_TYPE } from '../../entity.js'; +import { manifests as inviteManifests } from './invite/manifests.js'; import { manifests as resendInviteManifests } from './resend-invite/manifests.js'; -import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -const entityActions: Array = [ - { - type: 'entityAction', - kind: 'default', - alias: 'Umb.EntityAction.User.ResendInvite', - name: 'Resend Invite User Entity Action', - weight: 500, - api: () => import('./resend-invite/resend-invite.action.js'), - forEntityTypes: [UMB_USER_ENTITY_TYPE], - meta: { - icon: 'icon-message', - label: '#actions_resendInvite', - }, - conditions: [ - { - alias: 'Umb.Condition.User.AllowResendInviteAction', - }, - ], - }, +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + ...inviteManifests, ...resendInviteManifests, ]; - -export const manifests: Array = [...entityActions]; diff --git a/src/packages/user/user/invite/entity-action/resend-invite/manifests.ts b/src/packages/user/user/invite/entity-action/resend-invite/manifests.ts index 87dac3af79..1525273137 100644 --- a/src/packages/user/user/invite/entity-action/resend-invite/manifests.ts +++ b/src/packages/user/user/invite/entity-action/resend-invite/manifests.ts @@ -1,6 +1,25 @@ +import { UMB_USER_ENTITY_TYPE } from '../../../entity.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; export const manifests: Array = [ + { + type: 'entityAction', + kind: 'default', + alias: 'Umb.EntityAction.User.ResendInvite', + name: 'Resend Invite User Entity Action', + weight: 500, + api: () => import('./resend-invite.action.js'), + forEntityTypes: [UMB_USER_ENTITY_TYPE], + meta: { + icon: 'icon-message', + label: '#actions_resendInvite', + }, + conditions: [ + { + alias: 'Umb.Condition.User.AllowResendInviteAction', + }, + ], + }, { type: 'condition', name: 'User Allow Resend Invite Action Condition', diff --git a/src/packages/user/user/invite/manifests.ts b/src/packages/user/user/invite/manifests.ts index 63b76f1ec9..3d56168a11 100644 --- a/src/packages/user/user/invite/manifests.ts +++ b/src/packages/user/user/invite/manifests.ts @@ -2,9 +2,9 @@ import { manifests as collectionActionManifests } from './collection-action/mani import { manifests as modalManifests } from './modal/manifests.js'; import { manifests as repositoryManifests } from './repository/manifests.js'; import { manifests as entityActionManifests } from './entity-action/manifests.js'; -import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; +import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; -export const manifests: Array = [ +export const manifests: Array = [ ...collectionActionManifests, ...modalManifests, ...repositoryManifests, From 3c3ca6034303e35e104b603af896f05436c4364f Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 11 Sep 2024 16:23:51 +0200 Subject: [PATCH 18/25] update user group create path --- src/packages/user/user-group/collection/action/manifests.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packages/user/user-group/collection/action/manifests.ts b/src/packages/user/user-group/collection/action/manifests.ts index 1168e303e3..3f67cc84e1 100644 --- a/src/packages/user/user-group/collection/action/manifests.ts +++ b/src/packages/user/user-group/collection/action/manifests.ts @@ -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'; @@ -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: [ { From 40fba5ba032ca91a4f07ec6b0a7c5d233a8d7958 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 12 Sep 2024 21:58:23 +0200 Subject: [PATCH 19/25] revert merge mistake --- src/packages/settings/advanced/manifests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/packages/settings/advanced/manifests.ts b/src/packages/settings/advanced/manifests.ts index 3931a9edb9..5a452d9e3d 100644 --- a/src/packages/settings/advanced/manifests.ts +++ b/src/packages/settings/advanced/manifests.ts @@ -10,11 +10,11 @@ export const manifests = [ { type: 'sectionSidebarApp', kind: 'menu', - alias: 'Umb.SectionSidebarApp.Menu.Users', - name: 'Users Section Sidebar Menu', + alias: 'Umb.SectionSidebarMenu.AdvancedSettings', + name: 'Advanced Settings Sidebar Menu', weight: 100, meta: { - label: 'Users', + label: '#treeHeaders_advancedGroup', menu: UMB_ADVANCED_SETTINGS_MENU_ALIAS, }, conditions: [ From 68584832e6017353c73feb7fc3713f8940878394 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 12 Sep 2024 22:48:41 +0200 Subject: [PATCH 20/25] move into folder --- .../user/user-group/workspace/manifests.ts | 44 ++----------------- ...oup-entity-user-permission-list.element.ts | 0 ...-group-granular-permission-list.element.ts | 0 .../workspace/{ => user-group}/constants.ts | 0 .../workspace/user-group/manifests.ts | 42 ++++++++++++++++++ .../user-group-workspace-editor.element.ts | 4 +- .../user-group-workspace.context-token.ts | 2 +- .../user-group-workspace.context.ts | 4 +- 8 files changed, 50 insertions(+), 46 deletions(-) rename src/packages/user/user-group/workspace/{ => user-group}/components/user-group-entity-user-permission-list.element.ts (100%) rename src/packages/user/user-group/workspace/{ => user-group}/components/user-group-granular-permission-list.element.ts (100%) rename src/packages/user/user-group/workspace/{ => user-group}/constants.ts (100%) create mode 100644 src/packages/user/user-group/workspace/user-group/manifests.ts rename src/packages/user/user-group/workspace/{ => user-group}/user-group-workspace-editor.element.ts (98%) rename src/packages/user/user-group/workspace/{ => user-group}/user-group-workspace.context-token.ts (89%) rename src/packages/user/user-group/workspace/{ => user-group}/user-group-workspace.context.ts (97%) diff --git a/src/packages/user/user-group/workspace/manifests.ts b/src/packages/user/user-group/workspace/manifests.ts index 4a593776bc..806ce0f556 100644 --- a/src/packages/user/user-group/workspace/manifests.ts +++ b/src/packages/user/user-group/workspace/manifests.ts @@ -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 = []; -const workspaceActions: Array = [ - { - 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 = [workspace, ...workspaceViews, ...workspaceActions]; +export const manifests: Array = [...userGroupManifests]; diff --git a/src/packages/user/user-group/workspace/components/user-group-entity-user-permission-list.element.ts b/src/packages/user/user-group/workspace/user-group/components/user-group-entity-user-permission-list.element.ts similarity index 100% rename from src/packages/user/user-group/workspace/components/user-group-entity-user-permission-list.element.ts rename to src/packages/user/user-group/workspace/user-group/components/user-group-entity-user-permission-list.element.ts diff --git a/src/packages/user/user-group/workspace/components/user-group-granular-permission-list.element.ts b/src/packages/user/user-group/workspace/user-group/components/user-group-granular-permission-list.element.ts similarity index 100% rename from src/packages/user/user-group/workspace/components/user-group-granular-permission-list.element.ts rename to src/packages/user/user-group/workspace/user-group/components/user-group-granular-permission-list.element.ts diff --git a/src/packages/user/user-group/workspace/constants.ts b/src/packages/user/user-group/workspace/user-group/constants.ts similarity index 100% rename from src/packages/user/user-group/workspace/constants.ts rename to src/packages/user/user-group/workspace/user-group/constants.ts diff --git a/src/packages/user/user-group/workspace/user-group/manifests.ts b/src/packages/user/user-group/workspace/user-group/manifests.ts new file mode 100644 index 0000000000..4a593776bc --- /dev/null +++ b/src/packages/user/user-group/workspace/user-group/manifests.ts @@ -0,0 +1,42 @@ +import type { + ManifestWorkspaces, + ManifestWorkspaceActions, + ManifestWorkspaceView, + ManifestTypes, +} from '@umbraco-cms/backoffice/extension-registry'; +import { UmbSubmitWorkspaceAction } from '@umbraco-cms/backoffice/workspace'; + +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 = []; +const workspaceActions: Array = [ + { + 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 = [workspace, ...workspaceViews, ...workspaceActions]; diff --git a/src/packages/user/user-group/workspace/user-group-workspace-editor.element.ts b/src/packages/user/user-group/workspace/user-group/user-group-workspace-editor.element.ts similarity index 98% rename from src/packages/user/user-group/workspace/user-group-workspace-editor.element.ts rename to src/packages/user/user-group/workspace/user-group/user-group-workspace-editor.element.ts index a4d129dd04..01835e7c2a 100644 --- a/src/packages/user/user-group/workspace/user-group-workspace-editor.element.ts +++ b/src/packages/user/user-group/workspace/user-group/user-group-workspace-editor.element.ts @@ -1,5 +1,5 @@ -import type { UmbUserGroupDetailModel } from '../index.js'; -import { UMB_USER_GROUP_ROOT_WORKSPACE_PATH } from '../paths.js'; +import type { UmbUserGroupDetailModel } from '../../index.js'; +import { UMB_USER_GROUP_ROOT_WORKSPACE_PATH } from '../../paths.js'; import { UMB_USER_GROUP_WORKSPACE_CONTEXT } from './user-group-workspace.context-token.js'; import { UMB_USER_GROUP_WORKSPACE_ALIAS } from './constants.js'; import type { UUIBooleanInputEvent } from '@umbraco-cms/backoffice/external/uui'; diff --git a/src/packages/user/user-group/workspace/user-group-workspace.context-token.ts b/src/packages/user/user-group/workspace/user-group/user-group-workspace.context-token.ts similarity index 89% rename from src/packages/user/user-group/workspace/user-group-workspace.context-token.ts rename to src/packages/user/user-group/workspace/user-group/user-group-workspace.context-token.ts index a09ae6a716..3a11176569 100644 --- a/src/packages/user/user-group/workspace/user-group-workspace.context-token.ts +++ b/src/packages/user/user-group/workspace/user-group/user-group-workspace.context-token.ts @@ -1,4 +1,4 @@ -import { UMB_USER_GROUP_ENTITY_TYPE } from '../index.js'; +import { UMB_USER_GROUP_ENTITY_TYPE } from '../../index.js'; import type { UmbUserGroupWorkspaceContext } from './user-group-workspace.context.js'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbSubmittableWorkspaceContext } from '@umbraco-cms/backoffice/workspace'; diff --git a/src/packages/user/user-group/workspace/user-group-workspace.context.ts b/src/packages/user/user-group/workspace/user-group/user-group-workspace.context.ts similarity index 97% rename from src/packages/user/user-group/workspace/user-group-workspace.context.ts rename to src/packages/user/user-group/workspace/user-group/user-group-workspace.context.ts index c360e2057f..6f81961747 100644 --- a/src/packages/user/user-group/workspace/user-group-workspace.context.ts +++ b/src/packages/user/user-group/workspace/user-group/user-group-workspace.context.ts @@ -1,5 +1,5 @@ -import { UmbUserGroupDetailRepository } from '../repository/detail/index.js'; -import type { UmbUserGroupDetailModel } from '../types.js'; +import { UmbUserGroupDetailRepository } from '../../repository/detail/index.js'; +import type { UmbUserGroupDetailModel } from '../../types.js'; import { UmbUserGroupWorkspaceEditorElement } from './user-group-workspace-editor.element.js'; import type { UmbUserPermissionModel } from '@umbraco-cms/backoffice/user-permission'; import type { UmbRoutableWorkspaceContext, UmbSubmittableWorkspaceContext } from '@umbraco-cms/backoffice/workspace'; From 0460d328965b9cce250e1aef4b01016b8b6b3b42 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 12 Sep 2024 22:49:09 +0200 Subject: [PATCH 21/25] rename folder --- .../user-group/{section-view => user-group-root}/manifests.ts | 0 .../user-group-root-workspace.element.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/packages/user/user-group/{section-view => user-group-root}/manifests.ts (100%) rename src/packages/user/user-group/{section-view => user-group-root}/user-group-root-workspace.element.ts (100%) diff --git a/src/packages/user/user-group/section-view/manifests.ts b/src/packages/user/user-group/user-group-root/manifests.ts similarity index 100% rename from src/packages/user/user-group/section-view/manifests.ts rename to src/packages/user/user-group/user-group-root/manifests.ts diff --git a/src/packages/user/user-group/section-view/user-group-root-workspace.element.ts b/src/packages/user/user-group/user-group-root/user-group-root-workspace.element.ts similarity index 100% rename from src/packages/user/user-group/section-view/user-group-root-workspace.element.ts rename to src/packages/user/user-group/user-group-root/user-group-root-workspace.element.ts From a9e19254290ec0e2eaaf37e72b5e316d046a456d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 12 Sep 2024 22:49:35 +0200 Subject: [PATCH 22/25] move folder into workspace --- src/packages/user/user-group/manifests.ts | 2 +- .../user-group/{ => workspace}/user-group-root/manifests.ts | 2 +- .../user-group-root/user-group-root-workspace.element.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/packages/user/user-group/{ => workspace}/user-group-root/manifests.ts (86%) rename src/packages/user/user-group/{ => workspace}/user-group-root/user-group-root-workspace.element.ts (89%) diff --git a/src/packages/user/user-group/manifests.ts b/src/packages/user/user-group/manifests.ts index a68693f9c3..7db75cbebf 100644 --- a/src/packages/user/user-group/manifests.ts +++ b/src/packages/user/user-group/manifests.ts @@ -4,7 +4,7 @@ import { manifests as entityBulkActionManifests } from './entity-bulk-actions/ma 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 './section-view/manifests.js'; +import { manifests as sectionViewManifests } from './workspace/user-group-root/manifests.js'; import { manifests as workspaceManifests } from './workspace/manifests.js'; import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; diff --git a/src/packages/user/user-group/user-group-root/manifests.ts b/src/packages/user/user-group/workspace/user-group-root/manifests.ts similarity index 86% rename from src/packages/user/user-group/user-group-root/manifests.ts rename to src/packages/user/user-group/workspace/user-group-root/manifests.ts index ade0536011..ac7b088e93 100644 --- a/src/packages/user/user-group/user-group-root/manifests.ts +++ b/src/packages/user/user-group/workspace/user-group-root/manifests.ts @@ -1,4 +1,4 @@ -import { UMB_USER_GROUP_ROOT_ENTITY_TYPE } from '../entity.js'; +import { UMB_USER_GROUP_ROOT_ENTITY_TYPE } from '../../entity.js'; import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; export const manifests: Array = [ diff --git a/src/packages/user/user-group/user-group-root/user-group-root-workspace.element.ts b/src/packages/user/user-group/workspace/user-group-root/user-group-root-workspace.element.ts similarity index 89% rename from src/packages/user/user-group/user-group-root/user-group-root-workspace.element.ts rename to src/packages/user/user-group/workspace/user-group-root/user-group-root-workspace.element.ts index f02687d62d..0a77413d07 100644 --- a/src/packages/user/user-group/user-group-root/user-group-root-workspace.element.ts +++ b/src/packages/user/user-group/workspace/user-group-root/user-group-root-workspace.element.ts @@ -1,4 +1,4 @@ -import { UMB_USER_GROUP_COLLECTION_ALIAS } from '../collection/index.js'; +import { UMB_USER_GROUP_COLLECTION_ALIAS } from '../../collection/index.js'; import { html, customElement } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; From 2a15cddd0613ea1efdc16962c3050e5d6cf60f0d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 12 Sep 2024 22:50:58 +0200 Subject: [PATCH 23/25] localize headline --- .../user-group-root/user-group-root-workspace.element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/user/user-group/workspace/user-group-root/user-group-root-workspace.element.ts b/src/packages/user/user-group/workspace/user-group-root/user-group-root-workspace.element.ts index 0a77413d07..0900cee472 100644 --- a/src/packages/user/user-group/workspace/user-group-root/user-group-root-workspace.element.ts +++ b/src/packages/user/user-group/workspace/user-group-root/user-group-root-workspace.element.ts @@ -6,7 +6,7 @@ const elementName = 'umb-user-group-root-workspace'; @customElement(elementName) export class UmbUserGroupRootWorkspaceElement extends UmbLitElement { override render() { - return html` + return html` ; `; } From 496b25f828527455674a7c00e6fae10f176fd862 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 12 Sep 2024 22:56:11 +0200 Subject: [PATCH 24/25] localize header --- .../user/workspace/user-root/user-root-workspace.element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts b/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts index 2411336b55..335f7b9590 100644 --- a/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts +++ b/src/packages/user/user/workspace/user-root/user-root-workspace.element.ts @@ -16,7 +16,7 @@ export class UmbUserRootWorkspaceElement extends UmbLitElement { } override render() { - return html` + return html` ; `; } From 4925949f0f0035808a8831c420704473550aa0c7 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 12 Sep 2024 23:12:53 +0200 Subject: [PATCH 25/25] remove lorem ipsum --- .../create/modal/user-create-options-modal.element.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/packages/user/user/entity-actions/create/modal/user-create-options-modal.element.ts b/src/packages/user/user/entity-actions/create/modal/user-create-options-modal.element.ts index 29932ea273..74e8646990 100644 --- a/src/packages/user/user/entity-actions/create/modal/user-create-options-modal.element.ts +++ b/src/packages/user/user/entity-actions/create/modal/user-create-options-modal.element.ts @@ -9,7 +9,7 @@ import { UmbRequestReloadChildrenOfEntityEvent } from '@umbraco-cms/backoffice/e interface UmbUserCreateOptionModel { label: string; - description: string; + description?: string; icon: string; kind: UmbUserKindType; } @@ -20,13 +20,11 @@ export class UmbUserCreateOptionsModalElement extends UmbModalBaseElement { #options: Array = [ { label: this.localize.term('user_userKindDefault'), - description: 'Donec augue nunc, ullamcorper non turpis ut, maximus facilisis lorem. Nunc id sagittis magna.', icon: 'icon-user', kind: UmbUserKind.DEFAULT, }, { label: this.localize.term('user_userKindApi'), - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', icon: 'icon-unplug', kind: UmbUserKind.API, },