From d932e874ae2264163684719edc79fae395bdd80d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 20:47:39 +0200 Subject: [PATCH 01/19] update workspaces --- src/Umbraco.Web.UI.Client/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/package.json b/src/Umbraco.Web.UI.Client/package.json index ae71c8cc76..9e3cece03d 100644 --- a/src/Umbraco.Web.UI.Client/package.json +++ b/src/Umbraco.Web.UI.Client/package.json @@ -141,7 +141,8 @@ "./src/packages/tags", "./src/packages/templating", "./src/packages/property-editors", - "./src/packages/media" + "./src/packages/media", + "./src/packages/user" ], "scripts": { "backoffice:test:e2e": "npx playwright test", From 48b8152fc001b353dc3505696acefeae3f828dea Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 20:47:47 +0200 Subject: [PATCH 02/19] add vite.config --- .../src/packages/user/vite.config.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/vite.config.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/vite.config.ts b/src/Umbraco.Web.UI.Client/src/packages/user/vite.config.ts new file mode 100644 index 0000000000..f498904a85 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/vite.config.ts @@ -0,0 +1,22 @@ +import { defineConfig } from 'vite'; +import { rmSync } from 'fs'; +import { getDefaultConfig } from '../../vite-config-base'; + +const dist = '../../../dist-cms/packages/user'; + +// delete the unbundled dist folder +rmSync(dist, { recursive: true, force: true }); + +export default defineConfig({ + ...getDefaultConfig({ + dist, + entry: { + 'user-group/index': 'user-group/index.ts', + 'user-permission/index': 'user-permission/index.ts', + 'user/index': 'user/index.ts', + 'current-user/index': 'current-user/index.ts', + manifests: 'manifests.ts', + 'umbraco-package': 'umbraco-package.ts', + }, + }), +}); From f7f54990aee91851b66940ffb39c4e5d35eba2c4 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 20:48:15 +0200 Subject: [PATCH 03/19] Create package.json --- src/Umbraco.Web.UI.Client/src/packages/user/package.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/package.json diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/package.json b/src/Umbraco.Web.UI.Client/src/packages/user/package.json new file mode 100644 index 0000000000..f97c701835 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/package.json @@ -0,0 +1,8 @@ +{ + "name": "@umbraco-backoffice/user", + "private": true, + "type": "module", + "scripts": { + "build": "vite build" + } +} \ No newline at end of file From af3b1a4236e2e89442ab75febd0d3f00c7d9ddab Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 20:53:39 +0200 Subject: [PATCH 04/19] Update package-lock.json --- src/Umbraco.Web.UI.Client/package-lock.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/package-lock.json b/src/Umbraco.Web.UI.Client/package-lock.json index fcfaf1e486..6873f22c44 100644 --- a/src/Umbraco.Web.UI.Client/package-lock.json +++ b/src/Umbraco.Web.UI.Client/package-lock.json @@ -23,7 +23,8 @@ "./src/packages/tags", "./src/packages/templating", "./src/packages/property-editors", - "./src/packages/media" + "./src/packages/media", + "./src/packages/user" ], "dependencies": { "@types/diff": "^5.2.1", @@ -7686,6 +7687,10 @@ "resolved": "src/packages/umbraco-news", "link": true }, + "node_modules/@umbraco-backoffice/user": { + "resolved": "src/packages/user", + "link": true + }, "node_modules/@umbraco-backoffice/webhook": { "resolved": "src/packages/webhook", "link": true @@ -22305,6 +22310,7 @@ "src/packages/umbraco-news": { "name": "@umbraco-backoffice/umbraco-news" }, + "src/packages/user": {}, "src/packages/webhook": { "name": "@umbraco-backoffice/webhook" } From dd6b467d7421a3a303416cd540def08fc6ff2c02 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 20:58:23 +0200 Subject: [PATCH 05/19] split tokens from implementation --- .../user/current-user/current-user.context.token.ts | 4 ++++ .../src/packages/user/current-user/current-user.context.ts | 4 +--- .../history/current-user-history.store.token.ts | 6 ++++++ .../user/current-user/history/current-user-history.store.ts | 6 +----- .../src/packages/user/current-user/index.ts | 1 + .../modals/current-user/current-user-modal.element.ts | 2 +- .../profile/change-password-current-user.action.ts | 2 +- .../user/current-user/profile/edit-current-user.action.ts | 2 +- .../src/packages/user/current-user/repository/constants.ts | 1 + .../user/current-user/repository/current-user.repository.ts | 2 +- .../current-user/repository/current-user.store.token.ts | 4 ++++ .../user/current-user/repository/current-user.store.ts | 4 +--- .../src/packages/user/current-user/repository/index.ts | 5 +++-- .../src/packages/user/current-user/repository/manifests.ts | 3 +-- .../user/current-user/utils/is-current-user.function.ts | 2 +- .../modals/change-password/change-password-modal.element.ts | 4 ++-- 16 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.token.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history.store.token.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.store.token.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.token.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.token.ts new file mode 100644 index 0000000000..128c066997 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.token.ts @@ -0,0 +1,4 @@ +import type UmbCurrentUserContext from './current-user.context.js'; +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; + +export const UMB_CURRENT_USER_CONTEXT = new UmbContextToken('UmbCurrentUserContext'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.ts index 893d416c49..2719a144e2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/current-user.context.ts @@ -1,6 +1,6 @@ import type { UmbCurrentUserModel } from './types.js'; import { UmbCurrentUserRepository } from './repository/index.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import { UMB_CURRENT_USER_CONTEXT } from './current-user.context.token.js'; import { UmbContextBase } from '@umbraco-cms/backoffice/class-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { firstValueFrom } from '@umbraco-cms/backoffice/external/rxjs'; @@ -116,5 +116,3 @@ export class UmbCurrentUserContext extends UmbContextBase } export default UmbCurrentUserContext; - -export const UMB_CURRENT_USER_CONTEXT = new UmbContextToken('UmbCurrentUserContext'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history.store.token.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history.store.token.ts new file mode 100644 index 0000000000..ea0b1cd01c --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history.store.token.ts @@ -0,0 +1,6 @@ +import type UmbCurrentUserHistoryStore from './current-user-history.store.js'; +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; + +export const UMB_CURRENT_USER_HISTORY_STORE_CONTEXT = new UmbContextToken( + 'UmbCurrentUserHistoryStore', +); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history.store.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history.store.ts index e24ac6f72b..1c07a06fc0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history.store.ts @@ -1,4 +1,4 @@ -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import { UMB_CURRENT_USER_HISTORY_STORE_CONTEXT } from './current-user-history.store.token.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbId } from '@umbraco-cms/backoffice/id'; import { UmbArrayState } from '@umbraco-cms/backoffice/observable-api'; @@ -61,9 +61,5 @@ export class UmbCurrentUserHistoryStore extends UmbStoreBase( - 'UmbCurrentUserHistoryStore', -); - // Default export for the globalContext manifest: export default UmbCurrentUserHistoryStore; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/index.ts index def7620871..5a4c7ecb02 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/index.ts @@ -3,4 +3,5 @@ export * from './components/index.js'; export * from './history/current-user-history.store.js'; export * from './utils/index.js'; export * from './current-user.context.js'; +export * from './current-user.context.token.js'; export type * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/modals/current-user/current-user-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/modals/current-user/current-user-modal.element.ts index 66ca80cdb4..cb87e79ad0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/modals/current-user/current-user-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/modals/current-user/current-user-modal.element.ts @@ -1,4 +1,4 @@ -import { UMB_CURRENT_USER_CONTEXT } from '../../current-user.context.js'; +import { UMB_CURRENT_USER_CONTEXT } from '../../current-user.context.token.js'; import type { UmbCurrentUserModel } from '../../types.js'; import { UMB_AUTH_CONTEXT } from '@umbraco-cms/backoffice/auth'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/change-password-current-user.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/change-password-current-user.action.ts index 1b24d3e922..e249edc529 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/change-password-current-user.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/change-password-current-user.action.ts @@ -1,4 +1,4 @@ -import { UMB_CURRENT_USER_CONTEXT } from '../current-user.context.js'; +import { UMB_CURRENT_USER_CONTEXT } from '../current-user.context.token.js'; import { UmbActionBase } from '@umbraco-cms/backoffice/action'; import type { UmbCurrentUserAction, UmbCurrentUserActionArgs } from '@umbraco-cms/backoffice/extension-registry'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/edit-current-user.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/edit-current-user.action.ts index ad02bc5285..554d0a2ee7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/edit-current-user.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/edit-current-user.action.ts @@ -1,4 +1,4 @@ -import { UMB_CURRENT_USER_CONTEXT } from '../current-user.context.js'; +import { UMB_CURRENT_USER_CONTEXT } from '../current-user.context.token.js'; import { UmbActionBase } from '@umbraco-cms/backoffice/action'; import type { UmbCurrentUserAction, UmbCurrentUserActionArgs } from '@umbraco-cms/backoffice/extension-registry'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/constants.ts new file mode 100644 index 0000000000..7f5cd4ba6d --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/constants.ts @@ -0,0 +1 @@ +export const UMB_CURRENT_USER_REPOSITORY_ALIAS = 'Umb.Repository.CurrentUser'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.repository.ts index ca0db09ecb..937e6973eb 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.repository.ts @@ -1,5 +1,5 @@ import { UmbCurrentUserServerDataSource } from './current-user.server.data-source.js'; -import { UMB_CURRENT_USER_STORE_CONTEXT } from './current-user.store.js'; +import { UMB_CURRENT_USER_STORE_CONTEXT } from './current-user.store.token.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbRepositoryBase } from '@umbraco-cms/backoffice/repository'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.store.token.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.store.token.ts new file mode 100644 index 0000000000..5c7f67a149 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.store.token.ts @@ -0,0 +1,4 @@ +import type UmbCurrentUserStore from './current-user.store.js'; +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; + +export const UMB_CURRENT_USER_STORE_CONTEXT = new UmbContextToken('UmbCurrentUserStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.store.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.store.ts index e21ccd2e36..973247ff4d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/current-user.store.ts @@ -3,10 +3,10 @@ import type { UmbCurrentUserMfaProviderModel, UmbCurrentUserModel, } from '../types.js'; +import { UMB_CURRENT_USER_STORE_CONTEXT } from './current-user.store.token.js'; import type { UmbUserDetailModel } from '@umbraco-cms/backoffice/user'; import { UMB_USER_DETAIL_STORE_CONTEXT } from '@umbraco-cms/backoffice/user'; import { UmbContextBase } from '@umbraco-cms/backoffice/class-api'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbArrayState, UmbObjectState } from '@umbraco-cms/backoffice/observable-api'; @@ -106,5 +106,3 @@ export class UmbCurrentUserStore extends UmbContextBase { } export default UmbCurrentUserStore; - -export const UMB_CURRENT_USER_STORE_CONTEXT = new UmbContextToken('UmbCurrentUserStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/index.ts index b00cb02a9e..d3e468a0b0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/index.ts @@ -1,3 +1,4 @@ +export { UMB_CURRENT_USER_REPOSITORY_ALIAS } from './constants.js'; +export { UMB_CURRENT_USER_STORE_CONTEXT } from './current-user.store.token.js'; export { UmbCurrentUserRepository } from './current-user.repository.js'; -export { UMB_CURRENT_USER_REPOSITORY_ALIAS } from './manifests.js'; -export { UmbCurrentUserStore, UMB_CURRENT_USER_STORE_CONTEXT } from './current-user.store.js'; +export { UmbCurrentUserStore } from './current-user.store.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/manifests.ts index 743a336e9c..c255a1ef6c 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/repository/manifests.ts @@ -1,7 +1,6 @@ +import { UMB_CURRENT_USER_REPOSITORY_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestStore, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_CURRENT_USER_REPOSITORY_ALIAS = 'Umb.Repository.CurrentUser'; - const repository: ManifestRepository = { type: 'repository', alias: UMB_CURRENT_USER_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/utils/is-current-user.function.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/utils/is-current-user.function.ts index 5fb077125e..bb0bda7e13 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/utils/is-current-user.function.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/utils/is-current-user.function.ts @@ -1,4 +1,4 @@ -import { UMB_CURRENT_USER_CONTEXT } from '../current-user.context.js'; +import { UMB_CURRENT_USER_CONTEXT } from '../current-user.context.token.js'; import { UmbContextConsumerController } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/modals/change-password/change-password-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/user/modals/change-password/change-password-modal.element.ts index 618a7aff02..09a0819e60 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/modals/change-password/change-password-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/modals/change-password/change-password-modal.element.ts @@ -1,5 +1,5 @@ -import { UmbUserItemRepository } from '../../user/repository/item/user-item.repository.js'; -import { UMB_CURRENT_USER_CONTEXT } from '../../current-user/current-user.context.js'; +import { UMB_CURRENT_USER_CONTEXT } from '@umbraco-cms/backoffice/current-user'; +import { UmbUserItemRepository } from '@umbraco-cms/backoffice/user'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import type { CSSResultGroup } from '@umbraco-cms/backoffice/external/lit'; import { css, html, nothing, customElement, state } from '@umbraco-cms/backoffice/external/lit'; From e0c977e122b9c4615fc70f2e93bcef928600de4d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 21:07:22 +0200 Subject: [PATCH 06/19] split tokens/consts from implementation --- .../src/packages/user/user/collection/constants.ts | 1 + .../src/packages/user/user/collection/index.ts | 1 + .../src/packages/user/user/collection/manifests.ts | 2 +- .../packages/user/user/collection/repository/constants.ts | 1 + .../packages/user/user/collection/repository/manifests.ts | 3 +-- .../src/packages/user/user/collection/views/constants.ts | 2 ++ .../src/packages/user/user/collection/views/index.ts | 3 +-- .../src/packages/user/user/collection/views/manifests.ts | 5 +---- .../src/packages/user/user/entity-bulk-actions/manifests.ts | 2 +- .../src/packages/user/user/invite/repository/constants.ts | 1 + .../src/packages/user/user/invite/repository/index.ts | 2 +- .../src/packages/user/user/invite/repository/manifests.ts | 2 +- .../src/packages/user/user/repository/avatar/constants.ts | 1 + .../src/packages/user/user/repository/avatar/index.ts | 2 +- .../src/packages/user/user/repository/avatar/manifests.ts | 3 +-- .../user/user/repository/change-password/constants.ts | 1 + .../packages/user/user/repository/change-password/index.ts | 2 +- .../user/user/repository/change-password/manifests.ts | 3 +-- .../src/packages/user/user/repository/detail/constants.ts | 2 ++ .../src/packages/user/user/repository/detail/index.ts | 2 +- .../src/packages/user/user/repository/detail/manifests.ts | 5 +---- .../user/user/section-view/users-section-view.element.ts | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/collection/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/constants.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/constants.ts new file mode 100644 index 0000000000..dda3fbabe7 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/constants.ts @@ -0,0 +1 @@ +export const UMB_USER_COLLECTION_ALIAS = 'Umb.Collection.User'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/index.ts index 3d76f338dd..4991633288 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/index.ts @@ -1 +1,2 @@ export * from './repository/index.js'; +export * from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/manifests.ts index ed2494e45b..72741e772e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/manifests.ts @@ -2,9 +2,9 @@ import { UMB_USER_COLLECTION_REPOSITORY_ALIAS } from './repository/index.js'; import { manifests as collectionRepositoryManifests } from './repository/manifests.js'; import { manifests as collectionViewManifests } from './views/manifests.js'; import { manifests as collectionActionManifests } from './action/manifests.js'; +import { UMB_USER_COLLECTION_ALIAS } from './constants.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_USER_COLLECTION_ALIAS = 'Umb.Collection.User'; const collectionManifest: ManifestTypes = { type: 'collection', alias: UMB_USER_COLLECTION_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/constants.ts new file mode 100644 index 0000000000..d0760765e1 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/constants.ts @@ -0,0 +1 @@ +export const UMB_USER_COLLECTION_REPOSITORY_ALIAS = 'Umb.Repository.UserCollection'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/manifests.ts index 772ef263ed..15afe81d2b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/manifests.ts @@ -1,7 +1,6 @@ +import { UMB_USER_COLLECTION_REPOSITORY_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_USER_COLLECTION_REPOSITORY_ALIAS = 'Umb.Repository.UserCollection'; - const repository: ManifestRepository = { type: 'repository', alias: UMB_USER_COLLECTION_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/constants.ts new file mode 100644 index 0000000000..f0437f0645 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/constants.ts @@ -0,0 +1,2 @@ +export const UMB_COLLECTION_VIEW_USER_TABLE = 'Umb.CollectionView.User.Table'; +export const UMB_COLLECTION_VIEW_USER_GRID = 'Umb.CollectionView.User.Grid'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/index.ts index d0c7f1bb4a..4f07201dcf 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/index.ts @@ -1,2 +1 @@ -export { UMB_COLLECTION_VIEW_USER_TABLE } from './manifests.js'; -export { UMB_COLLECTION_VIEW_USER_GRID } from './manifests.js'; +export * from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/manifests.ts index 1837436687..dcc1bd579b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/views/manifests.ts @@ -1,8 +1,7 @@ +import { UMB_COLLECTION_VIEW_USER_GRID, UMB_COLLECTION_VIEW_USER_TABLE } from './constants.js'; import { UMB_COLLECTION_ALIAS_CONDITION } from '@umbraco-cms/backoffice/collection'; import type { ManifestCollectionView, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_COLLECTION_VIEW_USER_TABLE = 'Umb.CollectionView.User.Table'; - const tableCollectionView: ManifestCollectionView = { type: 'collectionView', alias: UMB_COLLECTION_VIEW_USER_TABLE, @@ -21,8 +20,6 @@ const tableCollectionView: ManifestCollectionView = { ], }; -export const UMB_COLLECTION_VIEW_USER_GRID = 'Umb.CollectionView.User.Grid'; - const gridCollectionView: ManifestCollectionView = { type: 'collectionView', alias: UMB_COLLECTION_VIEW_USER_GRID, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/manifests.ts index 3b9e43a859..72b43c8818 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/manifests.ts @@ -1,4 +1,4 @@ -import { UMB_USER_COLLECTION_ALIAS } from '../collection/manifests.js'; +import { UMB_USER_COLLECTION_ALIAS } from '../collection/index.js'; import { UMB_USER_ENTITY_TYPE } from '../entity.js'; import { UmbEnableUserEntityBulkAction } from './enable/enable.action.js'; import { UmbSetGroupUserEntityBulkAction } from './set-group/set-group.action.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/constants.ts new file mode 100644 index 0000000000..6846237bee --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/constants.ts @@ -0,0 +1 @@ +export const UMB_INVITE_USER_REPOSITORY_ALIAS = 'Umb.Repository.User.Invite'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/index.ts index 9d8b0a75fe..f49723b7e3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/index.ts @@ -1,2 +1,2 @@ export { UmbInviteUserRepository } from './invite-user.repository.js'; -export { UMB_INVITE_USER_REPOSITORY_ALIAS } from './manifests.js'; +export { UMB_INVITE_USER_REPOSITORY_ALIAS } from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/manifests.ts index 9bf092cbca..387f146850 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/repository/manifests.ts @@ -1,6 +1,6 @@ +import { UMB_INVITE_USER_REPOSITORY_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_INVITE_USER_REPOSITORY_ALIAS = 'Umb.Repository.User.Invite'; const inviteRepository: ManifestRepository = { type: 'repository', alias: UMB_INVITE_USER_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/constants.ts new file mode 100644 index 0000000000..79d661d45d --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/constants.ts @@ -0,0 +1 @@ +export const UMB_USER_AVATAR_REPOSITORY_ALIAS = 'Umb.Repository.User.Avatar'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/index.ts index a7af3a805e..c823650a05 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/index.ts @@ -1,2 +1,2 @@ export { UmbUserAvatarRepository } from './user-avatar.repository.js'; -export { UMB_USER_AVATAR_REPOSITORY_ALIAS } from './manifests.js'; +export { UMB_USER_AVATAR_REPOSITORY_ALIAS } from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/manifests.ts index ae4aa735fd..87961d59ff 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/avatar/manifests.ts @@ -1,7 +1,6 @@ +import { UMB_USER_AVATAR_REPOSITORY_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_USER_AVATAR_REPOSITORY_ALIAS = 'Umb.Repository.User.Avatar'; - const avatarRepository: ManifestRepository = { type: 'repository', alias: UMB_USER_AVATAR_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/constants.ts new file mode 100644 index 0000000000..20d2c55398 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/constants.ts @@ -0,0 +1 @@ +export const UMB_CHANGE_USER_PASSWORD_REPOSITORY_ALIAS = 'Umb.Repository.User.ChangePassword'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/index.ts index 2088a93329..22eb448ee8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/index.ts @@ -1,2 +1,2 @@ export { UmbChangeUserPasswordRepository } from './change-user-password.repository.js'; -export { UMB_CHANGE_USER_PASSWORD_REPOSITORY_ALIAS } from './manifests.js'; +export { UMB_CHANGE_USER_PASSWORD_REPOSITORY_ALIAS } from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/manifests.ts index 43bd6665aa..2283923820 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/change-password/manifests.ts @@ -1,7 +1,6 @@ +import { UMB_CHANGE_USER_PASSWORD_REPOSITORY_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_CHANGE_USER_PASSWORD_REPOSITORY_ALIAS = 'Umb.Repository.User.ChangePassword'; - const changePasswordRepository: ManifestRepository = { type: 'repository', alias: UMB_CHANGE_USER_PASSWORD_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/constants.ts new file mode 100644 index 0000000000..a0b65e1d4e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/constants.ts @@ -0,0 +1,2 @@ +export const UMB_USER_DETAIL_REPOSITORY_ALIAS = 'Umb.Repository.User.Detail'; +export const UMB_USER_DETAIL_STORE_ALIAS = 'Umb.Store.User.Detail'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/index.ts index a01f34ea23..8df7e84ab6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/index.ts @@ -1,5 +1,5 @@ export { UmbUserDetailRepository } from './user-detail.repository.js'; -export { UMB_USER_DETAIL_REPOSITORY_ALIAS } from './manifests.js'; export { UMB_USER_DETAIL_STORE_CONTEXT } from './user-detail.store.js'; +export * from './constants.js'; export type { UmbUserDetailStore } from './user-detail.store.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/manifests.ts index 1f7b40d743..f110fb5c3d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/manifests.ts @@ -1,7 +1,6 @@ +import { UMB_USER_DETAIL_REPOSITORY_ALIAS, UMB_USER_DETAIL_STORE_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestStore, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_USER_DETAIL_REPOSITORY_ALIAS = 'Umb.Repository.User.Detail'; - const repository: ManifestRepository = { type: 'repository', alias: UMB_USER_DETAIL_REPOSITORY_ALIAS, @@ -9,8 +8,6 @@ const repository: ManifestRepository = { api: () => import('./user-detail.repository.js'), }; -export const UMB_USER_DETAIL_STORE_ALIAS = 'Umb.Store.User.Detail'; - const store: ManifestStore = { type: 'store', alias: UMB_USER_DETAIL_STORE_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/users-section-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/users-section-view.element.ts index 002fbf4d92..22f9d5069d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/users-section-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/users-section-view.element.ts @@ -1,4 +1,4 @@ -import { UMB_USER_COLLECTION_ALIAS } from '../collection/manifests.js'; +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'; From 215d69a59cd1b8fb078f4a02ce7f5c6402fea6d3 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 21:08:07 +0200 Subject: [PATCH 07/19] fix imports --- .../history/current-user-history-user-profile-app.element.ts | 2 +- .../src/packages/user/user/collection/repository/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history-user-profile-app.element.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history-user-profile-app.element.ts index 7f87f38104..f09ad28b8a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history-user-profile-app.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/history/current-user-history-user-profile-app.element.ts @@ -1,5 +1,5 @@ import type { UmbCurrentUserHistoryItem, UmbCurrentUserHistoryStore } from './current-user-history.store.js'; -import { UMB_CURRENT_USER_HISTORY_STORE_CONTEXT } from './current-user-history.store.js'; +import { UMB_CURRENT_USER_HISTORY_STORE_CONTEXT } from './current-user-history.store.token.js'; import { html, customElement, state, map, ifDefined, 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/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/index.ts index 8573b08457..23b6472e8e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/collection/repository/index.ts @@ -1,2 +1,2 @@ -export { UMB_USER_COLLECTION_REPOSITORY_ALIAS } from './manifests.js'; +export { UMB_USER_COLLECTION_REPOSITORY_ALIAS } from './constants.js'; export { UmbUserCollectionRepository } from './user-collection.repository.js'; From f2604b8977c5a88016b0a308080d0149c20242dc Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 21:14:33 +0200 Subject: [PATCH 08/19] split consts --- .../src/packages/user/user/repository/detail/index.ts | 2 +- .../user/user/repository/detail/user-detail.repository.ts | 2 +- .../user/user/repository/detail/user-detail.store.token.ts | 4 ++++ .../packages/user/user/repository/detail/user-detail.store.ts | 4 +--- .../src/packages/user/user/repository/disable/constants.ts | 1 + .../src/packages/user/user/repository/disable/index.ts | 2 +- .../src/packages/user/user/repository/disable/manifests.ts | 2 +- .../src/packages/user/user/repository/enable/constants.ts | 1 + .../src/packages/user/user/repository/enable/index.ts | 2 +- .../src/packages/user/user/repository/enable/manifests.ts | 2 +- .../src/packages/user/user/repository/item/constants.ts | 2 ++ .../src/packages/user/user/repository/item/index.ts | 4 ++-- .../src/packages/user/user/repository/item/manifests.ts | 4 +--- .../user/user/repository/item/user-item.repository.ts | 2 +- .../user/user/repository/item/user-item.store.token.ts | 4 ++++ .../src/packages/user/user/repository/item/user-item.store.ts | 4 +--- .../src/packages/user/user/repository/user-repository-base.ts | 4 ++-- 17 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.store.token.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.store.token.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/index.ts index 8df7e84ab6..2e069db245 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/index.ts @@ -1,5 +1,5 @@ export { UmbUserDetailRepository } from './user-detail.repository.js'; -export { UMB_USER_DETAIL_STORE_CONTEXT } from './user-detail.store.js'; +export { UMB_USER_DETAIL_STORE_CONTEXT } from './user-detail.store.token.js'; export * from './constants.js'; export type { UmbUserDetailStore } from './user-detail.store.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.repository.ts index 2275e361c4..ebec5762af 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.repository.ts @@ -1,7 +1,7 @@ import type { UmbUserDetailModel } from '../../types.js'; import type { UmbUserDetailDataSource } from './types.js'; import { UmbUserServerDataSource } from './user-detail.server.data-source.js'; -import { UMB_USER_DETAIL_STORE_CONTEXT } from './user-detail.store.js'; +import { UMB_USER_DETAIL_STORE_CONTEXT } from './user-detail.store.token.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbDetailRepositoryBase } from '@umbraco-cms/backoffice/repository'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.store.token.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.store.token.ts new file mode 100644 index 0000000000..bbd416de3d --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.store.token.ts @@ -0,0 +1,4 @@ +import type UmbUserDetailStore from './user-detail.store.js'; +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; + +export const UMB_USER_DETAIL_STORE_CONTEXT = new UmbContextToken('UmbUserDetailStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.store.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.store.ts index 99006c4a95..f642066bb5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/detail/user-detail.store.ts @@ -1,5 +1,5 @@ import type { UmbUserDetailModel } from '../../types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import { UMB_USER_DETAIL_STORE_CONTEXT } from './user-detail.store.token.js'; import { UmbDetailStoreBase } from '@umbraco-cms/backoffice/store'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; @@ -21,5 +21,3 @@ export class UmbUserDetailStore extends UmbDetailStoreBase { } export default UmbUserDetailStore; - -export const UMB_USER_DETAIL_STORE_CONTEXT = new UmbContextToken('UmbUserDetailStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/constants.ts new file mode 100644 index 0000000000..cd6dd84b7b --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/constants.ts @@ -0,0 +1 @@ +export const UMB_DISABLE_USER_REPOSITORY_ALIAS = 'Umb.Repository.User.Disable'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/index.ts index 6f74b4aada..a2cc4da472 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/index.ts @@ -1,2 +1,2 @@ export { UmbDisableUserRepository } from './disable-user.repository.js'; -export { UMB_DISABLE_USER_REPOSITORY_ALIAS } from './manifests.js'; +export { UMB_DISABLE_USER_REPOSITORY_ALIAS } from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/manifests.ts index 885fd52c36..a5db2cab19 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/disable/manifests.ts @@ -1,6 +1,6 @@ +import { UMB_DISABLE_USER_REPOSITORY_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_DISABLE_USER_REPOSITORY_ALIAS = 'Umb.Repository.User.Disable'; const disableRepository: ManifestRepository = { type: 'repository', alias: UMB_DISABLE_USER_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/constants.ts new file mode 100644 index 0000000000..c09d413b5c --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/constants.ts @@ -0,0 +1 @@ +export const UMB_ENABLE_USER_REPOSITORY_ALIAS = 'Umb.Repository.User.Enable'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/index.ts index 6ec39f65d9..4470f07792 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/index.ts @@ -1,2 +1,2 @@ export { UmbEnableUserRepository } from './enable-user.repository.js'; -export { UMB_ENABLE_USER_REPOSITORY_ALIAS } from './manifests.js'; +export { UMB_ENABLE_USER_REPOSITORY_ALIAS } from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/manifests.ts index bc0f704f3e..d33d994a13 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/enable/manifests.ts @@ -1,6 +1,6 @@ +import { UMB_ENABLE_USER_REPOSITORY_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_ENABLE_USER_REPOSITORY_ALIAS = 'Umb.Repository.User.Enable'; const enableRepository: ManifestRepository = { type: 'repository', alias: UMB_ENABLE_USER_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/constants.ts new file mode 100644 index 0000000000..634eb32b48 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/constants.ts @@ -0,0 +1,2 @@ +export const UMB_USER_ITEM_REPOSITORY_ALIAS = 'Umb.Repository.User.Item'; +export const UMB_USER_ITEM_STORE_ALIAS = 'Umb.ItemStore.User'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/index.ts index 4df6b365f7..081cc63387 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/index.ts @@ -1,5 +1,5 @@ export { UmbUserItemRepository } from './user-item.repository.js'; -export { UMB_USER_ITEM_STORE_CONTEXT } from './user-item.store.js'; -export { UMB_USER_ITEM_REPOSITORY_ALIAS, UMB_USER_ITEM_STORE_ALIAS } from './manifests.js'; +export { UMB_USER_ITEM_STORE_CONTEXT } from './user-item.store.token.js'; +export * from './constants.js'; export type { UmbUserItemModel } from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/manifests.ts index 3e3d05026a..68b5a3e41b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/manifests.ts @@ -1,8 +1,6 @@ +import { UMB_USER_ITEM_REPOSITORY_ALIAS, UMB_USER_ITEM_STORE_ALIAS } from './constants.js'; import type { ManifestItemStore, ManifestRepository, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_USER_ITEM_REPOSITORY_ALIAS = 'Umb.Repository.User.Item'; -export const UMB_USER_ITEM_STORE_ALIAS = 'Umb.ItemStore.User'; - const itemRepository: ManifestRepository = { type: 'repository', alias: UMB_USER_ITEM_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.repository.ts index 653660f641..34b4805741 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.repository.ts @@ -1,5 +1,5 @@ import { UmbUserItemServerDataSource } from './user-item.server.data-source.js'; -import { UMB_USER_ITEM_STORE_CONTEXT } from './user-item.store.js'; +import { UMB_USER_ITEM_STORE_CONTEXT } from './user-item.store.token.js'; import type { UmbUserItemModel } from './types.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemRepositoryBase } from '@umbraco-cms/backoffice/repository'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.store.token.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.store.token.ts new file mode 100644 index 0000000000..24daac759e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.store.token.ts @@ -0,0 +1,4 @@ +import type UmbUserItemStore from './user-item.store.js'; +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; + +export const UMB_USER_ITEM_STORE_CONTEXT = new UmbContextToken('UmbUserItemStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.store.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.store.ts index 1723b356b0..4d61eda455 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/item/user-item.store.ts @@ -1,5 +1,5 @@ import type { UmbUserItemModel } from './types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import { UMB_USER_ITEM_STORE_CONTEXT } from './user-item.store.token.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemStoreBase } from '@umbraco-cms/backoffice/store'; @@ -23,5 +23,3 @@ export class UmbUserItemStore extends UmbItemStoreBase { } export default UmbUserItemStore; - -export const UMB_USER_ITEM_STORE_CONTEXT = new UmbContextToken('UmbUserItemStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/user-repository-base.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/user-repository-base.ts index b54da7d8fa..3a0e90fd41 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/user-repository-base.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/user-repository-base.ts @@ -1,7 +1,7 @@ import type { UmbUserDetailStore } from './detail/user-detail.store.js'; -import { UMB_USER_DETAIL_STORE_CONTEXT } from './detail/user-detail.store.js'; +import { UMB_USER_DETAIL_STORE_CONTEXT } from './detail/user-detail.store.token.js'; import type { UmbUserItemStore } from './item/user-item.store.js'; -import { UMB_USER_ITEM_STORE_CONTEXT } from './item/user-item.store.js'; +import { UMB_USER_ITEM_STORE_CONTEXT } from './item/user-item.store.token.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import type { UmbNotificationContext } from '@umbraco-cms/backoffice/notification'; import { UMB_NOTIFICATION_CONTEXT } from '@umbraco-cms/backoffice/notification'; From 58a955ba2f1fe5c88727ced8c41ccb31ae6c4603 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 21:18:23 +0200 Subject: [PATCH 09/19] split consts --- .../src/packages/user/user-group/collection/constants.ts | 1 + .../src/packages/user/user-group/collection/index.ts | 2 +- .../src/packages/user/user-group/collection/manifests.ts | 2 +- .../user/user/repository/new-password/constants.ts | 1 + .../packages/user/user/repository/new-password/index.ts | 2 +- .../user/user/repository/new-password/manifests.ts | 3 +-- .../src/packages/user/user/repository/unlock/constants.ts | 1 + .../src/packages/user/user/repository/unlock/index.ts | 2 +- .../src/packages/user/user/repository/unlock/manifests.ts | 3 +-- .../src/packages/user/user/workspace/constants.ts | 1 + .../src/packages/user/user/workspace/manifests.ts | 7 ++----- .../packages/user/user/workspace/user-workspace.context.ts | 2 +- 12 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/constants.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/constants.ts new file mode 100644 index 0000000000..6f62fec463 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/constants.ts @@ -0,0 +1 @@ +export const UMB_USER_GROUP_COLLECTION_ALIAS = 'Umb.Collection.UserGroup'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/index.ts index 3d9a00e23f..5e5906d375 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/index.ts @@ -1,2 +1,2 @@ export * from './repository/index.js'; -export { UMB_USER_GROUP_COLLECTION_ALIAS } from './manifests.js'; +export { UMB_USER_GROUP_COLLECTION_ALIAS } from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts index 22e5af0529..4b7b4fa7bc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts @@ -4,9 +4,9 @@ import { } from './repository/manifests.js'; import { manifests as collectionViewManifests } from './views/manifests.js'; import { manifests as collectionActionManifests } from './action/manifests.js'; +import { UMB_USER_GROUP_COLLECTION_ALIAS } from './constants.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_USER_GROUP_COLLECTION_ALIAS = 'Umb.Collection.UserGroup'; const collection: ManifestTypes = { type: 'collection', alias: UMB_USER_GROUP_COLLECTION_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/constants.ts new file mode 100644 index 0000000000..0f9b79f131 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/constants.ts @@ -0,0 +1 @@ +export const UMB_NEW_USER_PASSWORD_REPOSITORY_ALIAS = 'Umb.Repository.User.NewPassword'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/index.ts index 587c0a2286..fe80fd4883 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/index.ts @@ -1,2 +1,2 @@ export { UmbNewUserPasswordRepository } from './new-user-password.repository.js'; -export { UMB_NEW_USER_PASSWORD_REPOSITORY_ALIAS } from './manifests.js'; +export { UMB_NEW_USER_PASSWORD_REPOSITORY_ALIAS } from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/manifests.ts index 8f5a1c94ae..49e526ae71 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/new-password/manifests.ts @@ -1,7 +1,6 @@ +import { UMB_NEW_USER_PASSWORD_REPOSITORY_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_NEW_USER_PASSWORD_REPOSITORY_ALIAS = 'Umb.Repository.User.NewPassword'; - const newPasswordRepository: ManifestRepository = { type: 'repository', alias: UMB_NEW_USER_PASSWORD_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/constants.ts new file mode 100644 index 0000000000..aea1c7add0 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/constants.ts @@ -0,0 +1 @@ +export const UMB_UNLOCK_USER_REPOSITORY_ALIAS = 'Umb.Repository.User.Unlock'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/index.ts index 5cde89cdb1..205835f739 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/index.ts @@ -1,2 +1,2 @@ export { UmbUnlockUserRepository } from './unlock-user.repository.js'; -export { UMB_UNLOCK_USER_REPOSITORY_ALIAS } from './manifests.js'; +export { UMB_UNLOCK_USER_REPOSITORY_ALIAS } from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/manifests.ts index df50e64fd8..56cbf5bd57 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/unlock/manifests.ts @@ -1,7 +1,6 @@ +import { UMB_UNLOCK_USER_REPOSITORY_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_UNLOCK_USER_REPOSITORY_ALIAS = 'Umb.Repository.User.Unlock'; - const unlockRepository: ManifestRepository = { type: 'repository', alias: UMB_UNLOCK_USER_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/constants.ts new file mode 100644 index 0000000000..8988a6f2c0 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/constants.ts @@ -0,0 +1 @@ +export const UMB_USER_WORKSPACE_ALIAS = 'Umb.Workspace.User'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/manifests.ts index 6f92fb8546..d2c5c90ec4 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/manifests.ts @@ -1,14 +1,12 @@ 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, - ManifestWorkspaceView, ManifestTypes, } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_USER_WORKSPACE_ALIAS = 'Umb.Workspace.User'; - const workspace: ManifestWorkspaces = { type: 'workspace', kind: 'routable', @@ -20,7 +18,6 @@ const workspace: ManifestWorkspaces = { }, }; -const workspaceViews: Array = []; const workspaceActions: Array = [ { type: 'workspaceAction', @@ -42,4 +39,4 @@ const workspaceActions: Array = [ }, ]; -export const manifests: Array = [workspace, ...workspaceViews, ...workspaceActions]; +export const manifests: Array = [workspace, ...workspaceActions]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/user-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/user-workspace.context.ts index 5529398983..d5e1be971f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/user-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/workspace/user-workspace.context.ts @@ -2,7 +2,7 @@ import type { UmbUserDetailModel, UmbUserStartNodesModel, UmbUserStateEnum } fro import { UMB_USER_ENTITY_TYPE } from '../entity.js'; import { UmbUserDetailRepository } from '../repository/index.js'; import { UmbUserAvatarRepository } from '../repository/avatar/index.js'; -import { UMB_USER_WORKSPACE_ALIAS } from './manifests.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'; import { UmbSubmittableWorkspaceContextBase, UmbWorkspaceRouteManager } from '@umbraco-cms/backoffice/workspace'; From 067bf3309433a3a7e866229f788b81a4d996eaa7 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 21:24:21 +0200 Subject: [PATCH 10/19] split consts --- .../src/packages/user/user-group/collection/manifests.ts | 6 ++---- .../user/user-group/collection/repository/constants.ts | 1 + .../user/user-group/collection/repository/manifests.ts | 3 +-- .../packages/user/user-group/repository/detail/constants.ts | 2 ++ .../src/packages/user/user-group/repository/detail/index.ts | 4 ++-- .../packages/user/user-group/repository/detail/manifests.ts | 5 +---- .../repository/detail/user-group-detail.repository.ts | 2 +- .../repository/detail/user-group-detail.store.token.ts | 6 ++++++ .../user-group/repository/detail/user-group-detail.store.ts | 6 +----- .../packages/user/user-group/repository/item/constants.ts | 2 ++ .../src/packages/user/user-group/repository/item/index.ts | 2 +- .../packages/user/user-group/repository/item/manifests.ts | 4 +--- .../repository/item/user-group-item.repository.ts | 2 +- .../repository/item/user-group-item.store.token.ts | 4 ++++ .../user-group/repository/item/user-group-item.store.ts | 4 +--- 15 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/repository/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.store.token.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/constants.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.store.token.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts index 4b7b4fa7bc..04295c9ab8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts @@ -1,10 +1,8 @@ -import { - UMB_USER_GROUP_COLLECTION_REPOSITORY_ALIAS, - manifests as repositoryManifests, -} from './repository/manifests.js'; +import { manifests as repositoryManifests } from './repository/manifests.js'; import { manifests as collectionViewManifests } from './views/manifests.js'; import { manifests as collectionActionManifests } from './action/manifests.js'; import { UMB_USER_GROUP_COLLECTION_ALIAS } from './constants.js'; +import { UMB_USER_GROUP_COLLECTION_REPOSITORY_ALIAS } from './repository/constants.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; const collection: ManifestTypes = { diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/repository/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/repository/constants.ts new file mode 100644 index 0000000000..30082c161d --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/repository/constants.ts @@ -0,0 +1 @@ +export const UMB_USER_GROUP_COLLECTION_REPOSITORY_ALIAS = 'Umb.Repository.UserGroupCollection'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/repository/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/repository/manifests.ts index 9589556dc1..0d0f82235a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/repository/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/repository/manifests.ts @@ -1,7 +1,6 @@ +import { UMB_USER_GROUP_COLLECTION_REPOSITORY_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_USER_GROUP_COLLECTION_REPOSITORY_ALIAS = 'Umb.Repository.UserGroupCollection'; - const repository: ManifestRepository = { type: 'repository', alias: UMB_USER_GROUP_COLLECTION_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/constants.ts new file mode 100644 index 0000000000..b270cc0ed2 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/constants.ts @@ -0,0 +1,2 @@ +export const UMB_USER_GROUP_DETAIL_REPOSITORY_ALIAS = 'Umb.Repository.UserGroup.Detail'; +export const UMB_USER_GROUP_DETAIL_STORE_ALIAS = 'Umb.Store.UserGroup.Detail'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/index.ts index 13e053faaa..38151b28d2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/index.ts @@ -1,5 +1,5 @@ export { UmbUserGroupDetailRepository } from './user-group-detail.repository.js'; -export { UMB_USER_GROUP_DETAIL_REPOSITORY_ALIAS } from './manifests.js'; -export { UMB_USER_GROUP_DETAIL_STORE_CONTEXT } from './user-group-detail.store.js'; +export { UMB_USER_GROUP_DETAIL_REPOSITORY_ALIAS } from './constants.js'; +export { UMB_USER_GROUP_DETAIL_STORE_CONTEXT } from './user-group-detail.store.token.js'; export type { UmbUserGroupDetailStore } from './user-group-detail.store.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/manifests.ts index 201f2474f4..207ae9436b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/manifests.ts @@ -1,7 +1,6 @@ +import { UMB_USER_GROUP_DETAIL_REPOSITORY_ALIAS, UMB_USER_GROUP_DETAIL_STORE_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestStore, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_USER_GROUP_DETAIL_REPOSITORY_ALIAS = 'Umb.Repository.UserGroup.Detail'; - const repository: ManifestRepository = { type: 'repository', alias: UMB_USER_GROUP_DETAIL_REPOSITORY_ALIAS, @@ -9,8 +8,6 @@ const repository: ManifestRepository = { api: () => import('./user-group-detail.repository.js'), }; -export const UMB_USER_GROUP_DETAIL_STORE_ALIAS = 'Umb.Store.UserGroup.Detail'; - const store: ManifestStore = { type: 'store', alias: UMB_USER_GROUP_DETAIL_STORE_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.repository.ts index 61cc67e6e8..d8d58dd13f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.repository.ts @@ -1,6 +1,6 @@ import type { UmbUserGroupDetailModel } from '../../types.js'; import { UmbUserGroupServerDataSource } from './user-group-detail.server.data-source.js'; -import { UMB_USER_GROUP_DETAIL_STORE_CONTEXT } from './user-group-detail.store.js'; +import { UMB_USER_GROUP_DETAIL_STORE_CONTEXT } from './user-group-detail.store.token.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbDetailRepositoryBase } from '@umbraco-cms/backoffice/repository'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.store.token.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.store.token.ts new file mode 100644 index 0000000000..d8fb26b660 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.store.token.ts @@ -0,0 +1,6 @@ +import type UmbUserGroupDetailStore from './user-group-detail.store.js'; +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; + +export const UMB_USER_GROUP_DETAIL_STORE_CONTEXT = new UmbContextToken( + 'UmbUserGroupDetailStore', +); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.store.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.store.ts index bd47f9a6e9..5918b03db8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/detail/user-group-detail.store.ts @@ -1,5 +1,5 @@ import type { UmbUserGroupDetailModel } from '../../types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import { UMB_USER_GROUP_DETAIL_STORE_CONTEXT } from './user-group-detail.store.token.js'; import { UmbDetailStoreBase } from '@umbraco-cms/backoffice/store'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; @@ -21,7 +21,3 @@ export class UmbUserGroupDetailStore extends UmbDetailStoreBase( - 'UmbUserGroupDetailStore', -); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/constants.ts new file mode 100644 index 0000000000..b95dbf97fd --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/constants.ts @@ -0,0 +1,2 @@ +export const UMB_USER_GROUP_ITEM_REPOSITORY_ALIAS = 'Umb.Repository.UserGroupItem'; +export const UMB_USER_GROUP_STORE_ALIAS = 'Umb.Store.UserGroupItem'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/index.ts index 69b396c4ec..ac14fba536 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/index.ts @@ -1,3 +1,3 @@ export { UmbUserGroupItemRepository } from './user-group-item.repository.js'; -export { UMB_USER_GROUP_ITEM_REPOSITORY_ALIAS } from './manifests.js'; +export { UMB_USER_GROUP_ITEM_REPOSITORY_ALIAS } from './constants.js'; export type { UmbUserGroupItemModel } from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/manifests.ts index 85b9866a8d..57c949c4e2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/manifests.ts @@ -1,8 +1,6 @@ +import { UMB_USER_GROUP_ITEM_REPOSITORY_ALIAS, UMB_USER_GROUP_STORE_ALIAS } from './constants.js'; import type { ManifestRepository, ManifestItemStore, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_USER_GROUP_ITEM_REPOSITORY_ALIAS = 'Umb.Repository.UserGroupItem'; -export const UMB_USER_GROUP_STORE_ALIAS = 'Umb.Store.UserGroupItem'; - const itemRepository: ManifestRepository = { type: 'repository', alias: UMB_USER_GROUP_ITEM_REPOSITORY_ALIAS, diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.repository.ts index 0fe0583ae8..0b40ba3294 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.repository.ts @@ -1,5 +1,5 @@ import { UmbUserGroupItemServerDataSource } from './user-group-item.server.data-source.js'; -import { UMB_USER_GROUP_ITEM_STORE_CONTEXT } from './user-group-item.store.js'; +import { UMB_USER_GROUP_ITEM_STORE_CONTEXT } from './user-group-item.store.token.js'; import type { UmbUserGroupItemModel } from './types.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemRepositoryBase } from '@umbraco-cms/backoffice/repository'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.store.token.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.store.token.ts new file mode 100644 index 0000000000..352873e91e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.store.token.ts @@ -0,0 +1,4 @@ +import type UmbUserGroupItemStore from './user-group-item.store.js'; +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; + +export const UMB_USER_GROUP_ITEM_STORE_CONTEXT = new UmbContextToken('UmbUserGroupItemStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.store.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.store.ts index fbf4c257e5..4b1426acf6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/repository/item/user-group-item.store.ts @@ -1,5 +1,5 @@ import type { UmbUserGroupItemModel } from './types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import { UMB_USER_GROUP_ITEM_STORE_CONTEXT } from './user-group-item.store.token.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemStoreBase } from '@umbraco-cms/backoffice/store'; @@ -22,5 +22,3 @@ export class UmbUserGroupItemStore extends UmbItemStoreBase('UmbUserGroupItemStore'); From 0e7586a6b5774f24fa1fb2a0b5d628004e071c53 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 21:25:22 +0200 Subject: [PATCH 11/19] split consts --- .../src/packages/user/user-section/constants.ts | 1 + .../src/packages/user/user-section/manifests.ts | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user-section/constants.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-section/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-section/constants.ts new file mode 100644 index 0000000000..4d677fca76 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-section/constants.ts @@ -0,0 +1 @@ +export const UMB_USER_MANAGEMENT_SECTION_ALIAS = 'Umb.Section.Users'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-section/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-section/manifests.ts index c177498856..74bb597e28 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-section/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-section/manifests.ts @@ -1,7 +1,6 @@ +import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from './constants.js'; import type { ManifestSection, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_USER_MANAGEMENT_SECTION_ALIAS = 'Umb.Section.Users'; - const section: ManifestSection = { type: 'section', alias: UMB_USER_MANAGEMENT_SECTION_ALIAS, From ef9e53a82153d271ae4a896330fa12728e56b232 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 21:27:24 +0200 Subject: [PATCH 12/19] fix imports --- .../src/packages/user/user-group/section-view/manifests.ts | 2 +- .../src/packages/user/user-section/index.ts | 1 + .../src/packages/user/user/section-view/manifests.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user-section/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/manifests.ts index 5a9a755619..3780224244 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/manifests.ts @@ -1,4 +1,4 @@ -import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../../user-section/manifests.js'; +import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../../user-section/index.js'; import type { ManifestSectionView, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; const sectionsViews: Array = [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-section/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-section/index.ts new file mode 100644 index 0000000000..4f07201dcf --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-section/index.ts @@ -0,0 +1 @@ +export * from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/manifests.ts index 776999b2cd..a9dbcd430b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/manifests.ts @@ -1,4 +1,4 @@ -import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../../user-section/manifests.js'; +import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../../user-section/index.js'; import type { ManifestSectionView, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; const sectionsViews: Array = [ From b753379d05bdb5c93a0ce3da5f140cefa3460250 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 4 Jul 2024 23:13:28 +0200 Subject: [PATCH 13/19] lazy load apis --- .../configure-external-login-providers-action.ts | 2 ++ .../packages/user/current-user/external-login/manifests.ts | 3 +-- .../mfa-login/configure-mfa-providers-action.ts | 2 ++ .../src/packages/user/current-user/mfa-login/manifests.ts | 3 +-- .../profile/change-password-current-user.action.ts | 2 ++ .../user/current-user/profile/edit-current-user.action.ts | 2 ++ .../src/packages/user/current-user/profile/manifests.ts | 6 ++---- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/external-login/configure-external-login-providers-action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/external-login/configure-external-login-providers-action.ts index a3706c2988..bea240e191 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/external-login/configure-external-login-providers-action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/external-login/configure-external-login-providers-action.ts @@ -16,3 +16,5 @@ export class UmbConfigureExternalLoginProvidersApi await modalManagerContext.open(this, UMB_CURRENT_USER_EXTERNAL_LOGIN_MODAL).onSubmit(); } } + +export { UmbConfigureExternalLoginProvidersApi as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/external-login/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/external-login/manifests.ts index bef139a91b..1f104ac700 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/external-login/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/external-login/manifests.ts @@ -1,4 +1,3 @@ -import { UmbConfigureExternalLoginProvidersApi } from './configure-external-login-providers-action.js'; import type { ManifestCurrentUserActionDefaultKind, ManifestModal } from '@umbraco-cms/backoffice/extension-registry'; export const modals: Array = [ @@ -17,7 +16,7 @@ export const userProfileApps: Array = [ alias: 'Umb.CurrentUser.App.ExternalLoginProviders', name: 'External Login Providers Current User App', weight: 700, - api: UmbConfigureExternalLoginProvidersApi, + api: () => import('./configure-external-login-providers-action.js'), meta: { label: '#defaultdialogs_externalLoginProviders', icon: 'icon-lock', diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/mfa-login/configure-mfa-providers-action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/mfa-login/configure-mfa-providers-action.ts index bc644ec9bd..d30d327861 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/mfa-login/configure-mfa-providers-action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/mfa-login/configure-mfa-providers-action.ts @@ -16,3 +16,5 @@ export class UmbConfigureMfaProvidersApi await modalManagerContext.open(this, UMB_CURRENT_USER_MFA_MODAL).onSubmit(); } } + +export { UmbConfigureMfaProvidersApi as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/mfa-login/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/mfa-login/manifests.ts index 9e50cc71c1..4ee342f239 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/mfa-login/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/mfa-login/manifests.ts @@ -1,4 +1,3 @@ -import { UmbConfigureMfaProvidersApi } from './configure-mfa-providers-action.js'; import type { ManifestCurrentUserActionDefaultKind, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; export const userProfileApps: Array = [ @@ -8,7 +7,7 @@ export const userProfileApps: Array = [ alias: 'Umb.CurrentUser.App.MfaLoginProviders', name: 'MFA Login Providers Current User App', weight: 800, - api: UmbConfigureMfaProvidersApi, + api: () => import('./configure-mfa-providers-action.js'), meta: { label: '#user_configureTwoFactor', icon: 'icon-rectangle-ellipsis', diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/change-password-current-user.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/change-password-current-user.action.ts index e249edc529..e7607510f4 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/change-password-current-user.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/change-password-current-user.action.ts @@ -41,3 +41,5 @@ export class UmbChangePasswordCurrentUserAction }); } } + +export { UmbChangePasswordCurrentUserAction as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/edit-current-user.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/edit-current-user.action.ts index 554d0a2ee7..cdc03d8e09 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/edit-current-user.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/edit-current-user.action.ts @@ -36,3 +36,5 @@ export class UmbEditCurrentUserAction return; } } + +export { UmbEditCurrentUserAction as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/manifests.ts index 748421f410..2cb745f149 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/current-user/profile/manifests.ts @@ -1,5 +1,3 @@ -import { UmbChangePasswordCurrentUserAction } from './change-password-current-user.action.js'; -import { UmbEditCurrentUserAction } from './edit-current-user.action.js'; import type { ManifestCurrentUserActionDefaultKind, ManifestTypes, @@ -27,7 +25,7 @@ const currentUserActions: Array = [ alias: 'Umb.CurrentUser.Button.Edit', name: 'Current User Edit Button', weight: 1000, - api: UmbEditCurrentUserAction, + api: () => import('./edit-current-user.action.js'), meta: { label: '#general_edit', icon: 'edit', @@ -45,7 +43,7 @@ const currentUserActions: Array = [ alias: 'Umb.CurrentUser.Button.ChangePassword', name: 'Current User Change Password Button', weight: 900, - api: UmbChangePasswordCurrentUserAction, + api: () => import('./change-password-current-user.action.js'), meta: { label: '#general_changePassword', icon: 'lock', From fdd8039dc590c176369a2b045f9bd034b2be13d0 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 5 Jul 2024 09:18:48 +0200 Subject: [PATCH 14/19] lazy load apis --- .../entity-bulk-actions/manifests.ts | 4 +--- .../user/conditions/allow-delete/manifests.ts | 10 ++++++++ .../user-allow-delete-action.condition.ts | 7 ------ .../conditions/allow-disable/manifests.ts | 10 ++++++++ .../user-allow-disable-action.condition.ts | 8 ------- .../user/conditions/allow-enable/manifests.ts | 10 ++++++++ .../user-allow-enable-action.condition.ts | 16 +++++++++++++ .../allow-external-login/manifests.ts | 10 ++++++++ ...r-allow-external-login-action.condition.ts | 8 +------ .../user/conditions/allow-mfa/manifests.ts | 8 +++++++ .../user-allow-mfa-action.condition.ts | 8 +------ .../user-allow-unlock-action.condition.ts | 0 .../user/user/conditions/manifests.ts | 24 +++++++++---------- .../user-allow-enable-action.condition.ts | 22 ----------------- .../change-user-password.action.ts | 2 ++ .../disable/disable-user.action.ts | 2 ++ .../enable/enable-user.action.ts | 2 ++ .../user/user/entity-actions/manifests.ts | 15 ++++-------- .../entity-actions/mfa/mfa-user.action.ts | 2 ++ .../unlock/unlock-user.action.ts | 2 ++ .../delete/delete.action.ts | 2 ++ .../disable/disable.action.ts | 2 ++ .../enable/enable.action.ts | 2 ++ .../user/entity-bulk-actions/manifests.ts | 10 +++----- .../set-group/set-group.action.ts | 2 ++ .../unlock/unlock.action.ts | 2 ++ .../invite/collection-action/manifests.ts | 3 +-- .../user/invite/entity-action/manifests.ts | 7 +++--- .../entity-action/resend-invite/manifests.ts | 10 ++++++++ .../resend-invite.action.condition.ts | 8 +------ .../resend-invite/resend-invite.action.ts | 2 ++ 31 files changed, 124 insertions(+), 96 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/manifests.ts rename src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/{ => allow-delete}/user-allow-delete-action.condition.ts (69%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/manifests.ts rename src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/{ => allow-disable}/user-allow-disable-action.condition.ts (62%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-enable/manifests.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-enable/user-allow-enable-action.condition.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-external-login/manifests.ts rename src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/{ => allow-external-login}/user-allow-external-login-action.condition.ts (69%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-mfa/manifests.ts rename src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/{ => allow-mfa}/user-allow-mfa-action.condition.ts (69%) rename src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/{ => allow-unlock}/user-allow-unlock-action.condition.ts (100%) delete mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-enable-action.condition.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/manifests.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/manifests.ts index 78f0e3edfb..cea41642f5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/manifests.ts @@ -1,7 +1,5 @@ import { UMB_USER_GROUP_COLLECTION_ALIAS } from '../collection/index.js'; import { UMB_USER_GROUP_ENTITY_TYPE } from '../entity.js'; -import { UMB_USER_GROUP_DETAIL_REPOSITORY_ALIAS } from '../repository/index.js'; -import { UmbDeleteUserGroupEntityBulkAction } from './delete/delete.action.js'; import { UMB_COLLECTION_ALIAS_CONDITION } from '@umbraco-cms/backoffice/collection'; import type { ManifestEntityBulkAction, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; @@ -11,7 +9,7 @@ const entityActions: Array = [ alias: 'Umb.EntityBulkAction.UserGroup.Delete', name: 'Delete User Group Entity Bulk Action', weight: 400, - api: UmbDeleteUserGroupEntityBulkAction, + api: () => import('./delete/delete.action.js'), forEntityTypes: [UMB_USER_GROUP_ENTITY_TYPE], meta: { label: 'Delete', diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/manifests.ts new file mode 100644 index 0000000000..cbd8597b07 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/manifests.ts @@ -0,0 +1,10 @@ +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + { + type: 'condition', + name: 'User Allow Delete Action Condition', + alias: 'Umb.Condition.User.AllowDeleteAction', + api: () => import('./user-allow-delete-action.condition.js'), + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-delete-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/user-allow-delete-action.condition.ts similarity index 69% rename from src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-delete-action.condition.ts rename to src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/user-allow-delete-action.condition.ts index 74cecc9700..5b32f404d2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-delete-action.condition.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/user-allow-delete-action.condition.ts @@ -11,10 +11,3 @@ export class UmbUserAllowDeleteActionCondition extends UmbUserActionConditionBas } } } - -export const manifest: ManifestCondition = { - type: 'condition', - name: 'User Allow Delete Action Condition', - alias: 'Umb.Condition.User.AllowDeleteAction', - api: UmbUserAllowDeleteActionCondition, -}; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/manifests.ts new file mode 100644 index 0000000000..2c251b99bf --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/manifests.ts @@ -0,0 +1,10 @@ +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + { + type: 'condition', + name: 'User Allow Disable Action Condition', + alias: 'Umb.Condition.User.AllowDisableAction', + api: () => import('./user-allow-disable-action.condition.js'), + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-disable-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/user-allow-disable-action.condition.ts similarity index 62% rename from src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-disable-action.condition.ts rename to src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/user-allow-disable-action.condition.ts index d7e518fa24..701c1bd3a7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-disable-action.condition.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/user-allow-disable-action.condition.ts @@ -1,6 +1,5 @@ import { UmbUserStateEnum } from '../types.js'; import { UmbUserActionConditionBase } from './user-allow-action-base.condition.js'; -import type { ManifestCondition } from '@umbraco-cms/backoffice/extension-api'; export class UmbUserAllowDisableActionCondition extends UmbUserActionConditionBase { async _onUserDataChange() { @@ -13,10 +12,3 @@ export class UmbUserAllowDisableActionCondition extends UmbUserActionConditionBa this.permitted = this.userState !== UmbUserStateEnum.DISABLED; } } - -export const manifest: ManifestCondition = { - type: 'condition', - name: 'User Allow Disable Action Condition', - alias: 'Umb.Condition.User.AllowDisableAction', - api: UmbUserAllowDisableActionCondition, -}; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-enable/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-enable/manifests.ts new file mode 100644 index 0000000000..d1f35faf5b --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-enable/manifests.ts @@ -0,0 +1,10 @@ +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + { + type: 'condition', + name: 'User Allow Enable Action Condition', + alias: 'Umb.Condition.User.AllowEnableAction', + api: () => import('./user-allow-enable-action.condition.js'), + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-enable/user-allow-enable-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-enable/user-allow-enable-action.condition.ts new file mode 100644 index 0000000000..e44449d287 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-enable/user-allow-enable-action.condition.ts @@ -0,0 +1,16 @@ +import { UmbUserStateEnum } from '../../types.js'; +import { UmbUserActionConditionBase } from '../user-allow-action-base.condition.js'; + +export class UmbUserAllowEnableActionCondition extends UmbUserActionConditionBase { + async _onUserDataChange() { + // don't allow the current user to enable themselves + if (!this.userUnique || (await this.isCurrentUser())) { + this.permitted = false; + return; + } + + this.permitted = this.userState === UmbUserStateEnum.DISABLED; + } +} + +export { UmbUserAllowEnableActionCondition as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-external-login/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-external-login/manifests.ts new file mode 100644 index 0000000000..988f5a8b77 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-external-login/manifests.ts @@ -0,0 +1,10 @@ +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + { + type: 'condition', + name: 'User Allow ExternalLogin Action Condition', + alias: 'Umb.Condition.User.AllowExternalLoginAction', + api: () => import('./user-allow-external-login-action.condition.js'), + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-external-login-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-external-login/user-allow-external-login-action.condition.ts similarity index 69% rename from src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-external-login-action.condition.ts rename to src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-external-login/user-allow-external-login-action.condition.ts index 05af0c57d0..79e83683c9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-external-login-action.condition.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-external-login/user-allow-external-login-action.condition.ts @@ -1,5 +1,4 @@ import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; -import type { ManifestCondition } from '@umbraco-cms/backoffice/extension-api'; import { UmbConditionBase, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; export class UmbUserAllowExternalLoginActionCondition extends UmbConditionBase { @@ -16,9 +15,4 @@ export class UmbUserAllowExternalLoginActionCondition extends UmbConditionBase = [ + { + type: 'condition', + name: 'User Allow Mfa Action Condition', + alias: 'Umb.Condition.User.AllowMfaAction', + api: () => import('./user-allow-mfa-action.condition.js'), + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-mfa-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-mfa/user-allow-mfa-action.condition.ts similarity index 69% rename from src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-mfa-action.condition.ts rename to src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-mfa/user-allow-mfa-action.condition.ts index af54e401b8..88bd9f4274 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-mfa-action.condition.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-mfa/user-allow-mfa-action.condition.ts @@ -1,5 +1,4 @@ import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; -import type { ManifestCondition } from '@umbraco-cms/backoffice/extension-api'; import { UmbConditionBase, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; export class UmbUserAllowMfaActionCondition extends UmbConditionBase { @@ -16,9 +15,4 @@ export class UmbUserAllowMfaActionCondition extends UmbConditionBase { } } -export const manifest: ManifestCondition = { - type: 'condition', - name: 'User Allow Mfa Action Condition', - alias: 'Umb.Condition.User.AllowMfaAction', - api: UmbUserAllowMfaActionCondition, -}; +export { UmbUserAllowMfaActionCondition as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-unlock-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-unlock/user-allow-unlock-action.condition.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-unlock-action.condition.ts rename to src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-unlock/user-allow-unlock-action.condition.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/manifests.ts index 04150acb7c..23b03f4ec4 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/manifests.ts @@ -1,16 +1,16 @@ -import { manifest as userAllowDisableActionManifest } from './user-allow-disable-action.condition.js'; -import { manifest as userAllowEnableActionManifest } from './user-allow-enable-action.condition.js'; -import { manifest as userAllowUnlockActionManifest } from './user-allow-unlock-action.condition.js'; -import { manifest as userAllowExternalLoginActionManifest } from './user-allow-external-login-action.condition.js'; -import { manifest as userAllowMfaActionManifest } from './user-allow-mfa-action.condition.js'; -import { manifest as userAllowDeleteActionManifest } from './user-allow-delete-action.condition.js'; +import { manifests as userAllowDeleteActionManifests } from './allow-delete/manifests.js'; +import { manifests as userAllowDisableActionManifests } from './allow-disable/manifests.js'; +import { manifests as userAllowEnableActionManifests } from './allow-enable/manifests.js'; +import { manifests as userAllowExternalLoginActionManifests } from './allow-external-login/manifests.js'; +import { manifests as userAllowMfaActionManifests } from './allow-mfa/manifests.js'; +import { manifests as userAllowUnlockActionManifests } from './allow-unlock/manifests.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; export const manifests: Array = [ - userAllowDisableActionManifest, - userAllowEnableActionManifest, - userAllowUnlockActionManifest, - userAllowExternalLoginActionManifest, - userAllowMfaActionManifest, - userAllowDeleteActionManifest, + ...userAllowDisableActionManifests, + ...userAllowEnableActionManifests, + ...userAllowUnlockActionManifests, + ...userAllowExternalLoginActionManifests, + ...userAllowMfaActionManifests, + ...userAllowDeleteActionManifests, ]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-enable-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-enable-action.condition.ts deleted file mode 100644 index 534cd40d19..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/user-allow-enable-action.condition.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { UmbUserStateEnum } from '../types.js'; -import { UmbUserActionConditionBase } from './user-allow-action-base.condition.js'; -import type { ManifestCondition } from '@umbraco-cms/backoffice/extension-api'; - -export class UmbUserAllowEnableActionCondition extends UmbUserActionConditionBase { - async _onUserDataChange() { - // don't allow the current user to enable themselves - if (!this.userUnique || (await this.isCurrentUser())) { - this.permitted = false; - return; - } - - this.permitted = this.userState === UmbUserStateEnum.DISABLED; - } -} - -export const manifest: ManifestCondition = { - type: 'condition', - name: 'User Allow Enable Action Condition', - alias: 'Umb.Condition.User.AllowEnableAction', - api: UmbUserAllowEnableActionCondition, -}; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/change-password/change-user-password.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/change-password/change-user-password.action.ts index 4f99a93714..a052d53082 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/change-password/change-user-password.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/change-password/change-user-password.action.ts @@ -27,3 +27,5 @@ export class UmbChangeUserPasswordEntityAction extends UmbEntityActionBase { await disableUserRepository.disable([this.args.unique]); } } + +export { UmbDisableUserEntityAction as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/enable/enable-user.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/enable/enable-user.action.ts index b99554cf1e..1d2af3c2c6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/enable/enable-user.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/enable/enable-user.action.ts @@ -32,3 +32,5 @@ export class UmbEnableUserEntityAction extends UmbEntityActionBase { await enableRepository.enable([this.args.unique]); } } + +export { UmbEnableUserEntityAction as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/manifests.ts index 38ec8248f4..8e26c3c2f1 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/manifests.ts @@ -1,10 +1,5 @@ import { UMB_USER_DETAIL_REPOSITORY_ALIAS, UMB_USER_ITEM_REPOSITORY_ALIAS } from '../repository/index.js'; import { UMB_USER_ENTITY_TYPE } from '../entity.js'; -import { UmbDisableUserEntityAction } from './disable/disable-user.action.js'; -import { UmbEnableUserEntityAction } from './enable/enable-user.action.js'; -import { UmbChangeUserPasswordEntityAction } from './change-password/change-user-password.action.js'; -import { UmbUnlockUserEntityAction } from './unlock/unlock-user.action.js'; -import { UmbMfaUserEntityAction } from './mfa/mfa-user.action.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; const entityActions: Array = [ @@ -30,7 +25,7 @@ const entityActions: Array = [ alias: 'Umb.EntityAction.User.Enable', name: 'Enable User Entity Action', weight: 800, - api: UmbEnableUserEntityAction, + api: () => import('./enable/enable-user.action.js'), forEntityTypes: [UMB_USER_ENTITY_TYPE], meta: { icon: 'icon-check', @@ -48,7 +43,7 @@ const entityActions: Array = [ alias: 'Umb.EntityAction.User.Disable', name: 'Disable User Entity Action', weight: 700, - api: UmbDisableUserEntityAction, + api: () => import('./disable/disable-user.action.js'), forEntityTypes: [UMB_USER_ENTITY_TYPE], meta: { icon: 'icon-block', @@ -66,7 +61,7 @@ const entityActions: Array = [ alias: 'Umb.EntityAction.User.ChangePassword', name: 'Change User Password Entity Action', weight: 600, - api: UmbChangeUserPasswordEntityAction, + api: () => import('./change-password/change-user-password.action.js'), forEntityTypes: [UMB_USER_ENTITY_TYPE], meta: { icon: 'icon-key', @@ -79,7 +74,7 @@ const entityActions: Array = [ alias: 'Umb.EntityAction.User.Unlock', name: 'Unlock User Entity Action', weight: 600, - api: UmbUnlockUserEntityAction, + api: () => import('./unlock/unlock-user.action.js'), forEntityTypes: [UMB_USER_ENTITY_TYPE], meta: { icon: 'icon-unlocked', @@ -97,7 +92,7 @@ const entityActions: Array = [ alias: 'Umb.EntityAction.User.ConfigureMfa', name: 'Configure MFA Entity Action', weight: 500, - api: UmbMfaUserEntityAction, + api: () => import('./mfa/mfa-user.action.js'), forEntityTypes: [UMB_USER_ENTITY_TYPE], meta: { icon: 'icon-settings', diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/mfa/mfa-user.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/mfa/mfa-user.action.ts index e541e71bfb..a6bdc5f5f0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/mfa/mfa-user.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/mfa/mfa-user.action.ts @@ -40,3 +40,5 @@ export class UmbMfaUserEntityAction extends UmbEntityActionBase { .catch(() => undefined); } } + +export { UmbMfaUserEntityAction as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/unlock/unlock-user.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/unlock/unlock-user.action.ts index 4fa6d43d05..1839f903e2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/unlock/unlock-user.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-actions/unlock/unlock-user.action.ts @@ -32,3 +32,5 @@ export class UmbUnlockUserEntityAction extends UmbEntityActionBase { await unlockUserRepository?.unlock([this.args.unique]); } } + +export { UmbUnlockUserEntityAction as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/delete/delete.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/delete/delete.action.ts index be843af87a..9d5bd56f57 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/delete/delete.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/delete/delete.action.ts @@ -24,3 +24,5 @@ export class UmbUserDeleteEntityBulkAction extends UmbEntityBulkActionBase = [ alias: 'Umb.EntityBulkAction.User.Enable', name: 'Enable User Entity Bulk Action', weight: 300, - api: UmbEnableUserEntityBulkAction, + api: () => import('./enable/enable.action.js'), forEntityTypes: [UMB_USER_ENTITY_TYPE], meta: { label: 'Enable', @@ -49,7 +45,7 @@ const entityActions: Array = [ alias: 'Umb.EntityBulkAction.User.Unlock', name: 'Unlock User Entity Bulk Action', weight: 200, - api: UmbUnlockUserEntityBulkAction, + api: () => import('./unlock/unlock.action.js'), forEntityTypes: [UMB_USER_ENTITY_TYPE], meta: { label: 'Unlock', @@ -66,7 +62,7 @@ const entityActions: Array = [ alias: 'Umb.EntityBulkAction.User.Disable', name: 'Disable User Entity Bulk Action', weight: 100, - api: UmbDisableUserEntityBulkAction, + api: () => import('./disable/disable.action.js'), forEntityTypes: [UMB_USER_ENTITY_TYPE], meta: { label: 'Disable', diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/set-group/set-group.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/set-group/set-group.action.ts index d50c8f6f8d..85d238994e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/set-group/set-group.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/entity-bulk-actions/set-group/set-group.action.ts @@ -6,3 +6,5 @@ export class UmbSetGroupUserEntityBulkAction extends UmbEntityBulkActionBase import('./invite-user.collection-action.js'), weight: 100, meta: { label: '#user_invite', diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/manifests.ts index e892368a6b..0782e1be54 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/manifests.ts @@ -1,6 +1,5 @@ import { UMB_USER_ENTITY_TYPE } from '../../entity.js'; -import { UmbResendInviteToUserEntityAction } from './resend-invite/resend-invite.action.js'; -import { manifest as conditionManifest } from './resend-invite/resend-invite.action.condition.js'; +import { manifests as resendInviteManifests } from './resend-invite/manifests.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; const entityActions: Array = [ @@ -10,7 +9,7 @@ const entityActions: Array = [ alias: 'Umb.EntityAction.User.ResendInvite', name: 'Resend Invite User Entity Action', weight: 500, - api: UmbResendInviteToUserEntityAction, + api: () => import('./resend-invite/resend-invite.action.js'), forEntityTypes: [UMB_USER_ENTITY_TYPE], meta: { icon: 'icon-message', @@ -22,7 +21,7 @@ const entityActions: Array = [ }, ], }, - conditionManifest, + resendInviteManifests, ]; export const manifests: Array = [...entityActions]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/manifests.ts new file mode 100644 index 0000000000..87dac3af79 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/manifests.ts @@ -0,0 +1,10 @@ +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + { + type: 'condition', + name: 'User Allow Resend Invite Action Condition', + alias: 'Umb.Condition.User.AllowResendInviteAction', + api: () => import('./resend-invite.action.condition.js'), + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/resend-invite.action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/resend-invite.action.condition.ts index 61c21e57de..017e980c6a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/resend-invite.action.condition.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/resend-invite.action.condition.ts @@ -1,6 +1,5 @@ import { UmbUserActionConditionBase } from '../../../conditions/user-allow-action-base.condition.js'; import { UserStateModel } from '@umbraco-cms/backoffice/external/backend-api'; -import type { ManifestCondition } from '@umbraco-cms/backoffice/extension-api'; export class UmbUserAllowResendInviteActionCondition extends UmbUserActionConditionBase { async _onUserDataChange() { @@ -13,9 +12,4 @@ export class UmbUserAllowResendInviteActionCondition extends UmbUserActionCondit } } -export const manifest: ManifestCondition = { - type: 'condition', - name: 'User Allow Resend Invite Action Condition', - alias: 'Umb.Condition.User.AllowResendInviteAction', - api: UmbUserAllowResendInviteActionCondition, -}; +export { UmbUserAllowResendInviteActionCondition as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/resend-invite.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/resend-invite.action.ts index 2f58609172..53fc3ae5fa 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/resend-invite.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/resend-invite/resend-invite.action.ts @@ -25,3 +25,5 @@ export class UmbResendInviteToUserEntityAction extends UmbEntityActionBase Date: Fri, 5 Jul 2024 09:31:55 +0200 Subject: [PATCH 15/19] lazy load apis --- src/Umbraco.Web.UI.Client/package-lock.json | 4 +++- .../user-allow-delete-action.condition.ts | 3 +-- .../user-allow-disable-action.condition.ts | 4 ++-- .../user/user/conditions/allow-unlock/manifests.ts | 10 ++++++++++ .../user-allow-unlock-action.condition.ts | 12 +++--------- 5 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-unlock/manifests.ts diff --git a/src/Umbraco.Web.UI.Client/package-lock.json b/src/Umbraco.Web.UI.Client/package-lock.json index 6873f22c44..0eb3414ca9 100644 --- a/src/Umbraco.Web.UI.Client/package-lock.json +++ b/src/Umbraco.Web.UI.Client/package-lock.json @@ -22310,7 +22310,9 @@ "src/packages/umbraco-news": { "name": "@umbraco-backoffice/umbraco-news" }, - "src/packages/user": {}, + "src/packages/user": { + "name": "@umbraco-backoffice/user" + }, "src/packages/webhook": { "name": "@umbraco-backoffice/webhook" } diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/user-allow-delete-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/user-allow-delete-action.condition.ts index 5b32f404d2..8ed8582d90 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/user-allow-delete-action.condition.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/user-allow-delete-action.condition.ts @@ -1,5 +1,4 @@ -import { UmbUserActionConditionBase } from './user-allow-action-base.condition.js'; -import type { ManifestCondition } from '@umbraco-cms/backoffice/extension-api'; +import { UmbUserActionConditionBase } from '../user-allow-action-base.condition.js'; export class UmbUserAllowDeleteActionCondition extends UmbUserActionConditionBase { async _onUserDataChange() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/user-allow-disable-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/user-allow-disable-action.condition.ts index 701c1bd3a7..9c45b723a9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/user-allow-disable-action.condition.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/user-allow-disable-action.condition.ts @@ -1,5 +1,5 @@ -import { UmbUserStateEnum } from '../types.js'; -import { UmbUserActionConditionBase } from './user-allow-action-base.condition.js'; +import { UmbUserStateEnum } from '../../types.js'; +import { UmbUserActionConditionBase } from '../user-allow-action-base.condition.js'; export class UmbUserAllowDisableActionCondition extends UmbUserActionConditionBase { async _onUserDataChange() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-unlock/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-unlock/manifests.ts new file mode 100644 index 0000000000..8bc2f87d2f --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-unlock/manifests.ts @@ -0,0 +1,10 @@ +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; + +export const manifests: Array = [ + { + type: 'condition', + name: 'User Allow Unlock Action Condition', + alias: 'Umb.Condition.User.AllowUnlockAction', + api: () => import('./user-allow-unlock-action.condition.js'), + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-unlock/user-allow-unlock-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-unlock/user-allow-unlock-action.condition.ts index a3dfd0eba0..517bd0c12d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-unlock/user-allow-unlock-action.condition.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-unlock/user-allow-unlock-action.condition.ts @@ -1,6 +1,5 @@ -import { UmbUserStateEnum } from '../types.js'; -import { UmbUserActionConditionBase } from './user-allow-action-base.condition.js'; -import type { ManifestCondition } from '@umbraco-cms/backoffice/extension-api'; +import { UmbUserStateEnum } from '../../types.js'; +import { UmbUserActionConditionBase } from '../user-allow-action-base.condition.js'; export class UmbUserAllowUnlockActionCondition extends UmbUserActionConditionBase { async _onUserDataChange() { @@ -14,9 +13,4 @@ export class UmbUserAllowUnlockActionCondition extends UmbUserActionConditionBas } } -export const manifest: ManifestCondition = { - type: 'condition', - name: 'User Allow Unlock Action Condition', - alias: 'Umb.Condition.User.AllowUnlockAction', - api: UmbUserAllowUnlockActionCondition, -}; +export { UmbUserAllowUnlockActionCondition as api }; From 428966420dc0a345b11abb844a0944a2b300154e Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 5 Jul 2024 09:34:05 +0200 Subject: [PATCH 16/19] lazy load apis --- .../allow-delete/user-allow-delete-action.condition.ts | 2 ++ .../allow-disable/user-allow-disable-action.condition.ts | 2 ++ .../src/packages/user/user/conditions/allow-mfa/manifests.ts | 2 ++ .../invite/collection-action/invite-user.collection-action.ts | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/user-allow-delete-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/user-allow-delete-action.condition.ts index 8ed8582d90..3bde4033af 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/user-allow-delete-action.condition.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-delete/user-allow-delete-action.condition.ts @@ -10,3 +10,5 @@ export class UmbUserAllowDeleteActionCondition extends UmbUserActionConditionBas } } } + +export { UmbUserAllowDeleteActionCondition as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/user-allow-disable-action.condition.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/user-allow-disable-action.condition.ts index 9c45b723a9..208accbab7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/user-allow-disable-action.condition.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-disable/user-allow-disable-action.condition.ts @@ -12,3 +12,5 @@ export class UmbUserAllowDisableActionCondition extends UmbUserActionConditionBa this.permitted = this.userState !== UmbUserStateEnum.DISABLED; } } + +export { UmbUserAllowDisableActionCondition as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-mfa/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-mfa/manifests.ts index 96fb27c7be..5907e011bb 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-mfa/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/conditions/allow-mfa/manifests.ts @@ -1,3 +1,5 @@ +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; + export const manifests: Array = [ { type: 'condition', diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/collection-action/invite-user.collection-action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/collection-action/invite-user.collection-action.ts index 9169bb4a08..9c7810bb02 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/collection-action/invite-user.collection-action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/collection-action/invite-user.collection-action.ts @@ -9,3 +9,5 @@ export class UmbInviteUserCollectionAction extends UmbCollectionActionBase { await modalContext?.onSubmit(); } } + +export { UmbInviteUserCollectionAction as api }; From f1059694187bcc66c4a2344e52ba87799463181c Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 5 Jul 2024 09:35:01 +0200 Subject: [PATCH 17/19] fix exports --- .../user/user-group/entity-bulk-actions/delete/delete.action.ts | 2 ++ .../src/packages/user/user/invite/entity-action/manifests.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/delete/delete.action.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/delete/delete.action.ts index 0c07a4ea6d..2f2ab02225 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/delete/delete.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/delete/delete.action.ts @@ -25,3 +25,5 @@ export class UmbDeleteUserGroupEntityBulkAction extends UmbEntityBulkActionBase< } } } + +export { UmbDeleteUserGroupEntityBulkAction as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/manifests.ts index 0782e1be54..af09b5ff79 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/invite/entity-action/manifests.ts @@ -21,7 +21,7 @@ const entityActions: Array = [ }, ], }, - resendInviteManifests, + ...resendInviteManifests, ]; export const manifests: Array = [...entityActions]; From a59e40bac7019a635f7686c9e92971e95ca5b682 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Fri, 5 Jul 2024 10:09:19 +0200 Subject: [PATCH 18/19] chore: run eslint fix --- .../core/section/section-sidebar/section-sidebar.element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/section/section-sidebar/section-sidebar.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/section/section-sidebar/section-sidebar.element.ts index 15914aedd1..94adf049df 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/section/section-sidebar/section-sidebar.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/section/section-sidebar/section-sidebar.element.ts @@ -1,7 +1,7 @@ +import { UmbSectionSidebarContext } from './section-sidebar.context.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 { UmbSectionSidebarContext } from './section-sidebar.context.js'; @customElement('umb-section-sidebar') export class UmbSectionSidebarElement extends UmbLitElement { From 32e218c0fb896c56ccda13e44b0eff2e2f0b8fa9 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Fri, 5 Jul 2024 10:09:47 +0200 Subject: [PATCH 19/19] chore: run format:fix --- .../src/external/router-slot/router-slot.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/external/router-slot/router-slot.ts b/src/Umbraco.Web.UI.Client/src/external/router-slot/router-slot.ts index 1a2bec962f..14e6f7a1b5 100644 --- a/src/Umbraco.Web.UI.Client/src/external/router-slot/router-slot.ts +++ b/src/Umbraco.Web.UI.Client/src/external/router-slot/router-slot.ts @@ -48,7 +48,7 @@ export class RouterSlot extends HTMLElement implements IRouter /** * Method to cancel navigation if changed. */ - private _cancelNavigation ?:() => void; + private _cancelNavigation?: () => void; /** * Listeners on the router. @@ -208,7 +208,7 @@ export class RouterSlot extends HTMLElement implements IRouter if (this.isConnected) { const newMatch = this.getRouteMatch(); // Check if this match matches the current match (aka. If the path has changed), if so we should navigate. [NL] - if(newMatch) { + if (newMatch) { navigate = shouldNavigate(this.match, newMatch); } } @@ -318,7 +318,6 @@ export class RouterSlot extends HTMLElement implements IRouter * Returns true if a navigation was made to a new page. */ protected async renderPath(path: string | PathFragment): Promise { - // Notice: Since this is never called from any other place than one higher in this file(when writing this...), we could just retrieve the path and find a match by using this.getRouteMatch() [NL] // Find the corresponding route. const match = matchRoutes(this._routes, path); @@ -336,7 +335,6 @@ export class RouterSlot extends HTMLElement implements IRouter // Only change route if its a new route. const navigate = shouldNavigate(this.match, match); if (navigate) { - // If another navigation is still begin resolved in this very moment, then we need to cancel that so it does not end up overriding this new navigation.[NL] this._cancelNavigation?.(); // Listen for another push state event. If another push state event happens @@ -412,7 +410,7 @@ export class RouterSlot extends HTMLElement implements IRouter // We have some routes that share the same component instance, those should not be removed and re-appended [NL] const isTheSameComponent = this.firstChild === page; - if(!isTheSameComponent) { + if (!isTheSameComponent) { // Remove the old page by clearing the slot this.clearChildren(); } @@ -421,7 +419,7 @@ export class RouterSlot extends HTMLElement implements IRouter // We do this to ensure that we can find the match in the connectedCallback of the page. this._routeMatch = match; - if(!isTheSameComponent) { + if (!isTheSameComponent) { if (page) { // Append the new page this.appendChild(page);