From d8a0b96b26d724bdde6341e2e46f76cf7d512897 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 23 Sep 2024 11:46:03 +0200 Subject: [PATCH 1/3] move token --- src/packages/core/modal/token/index.ts | 1 - ...input-document-granular-user-permission.element.ts | 3 ++- src/packages/user/user-permission/index.ts | 1 + src/packages/user/user-permission/modals/index.ts | 1 + src/packages/user/user-permission/modals/manifests.ts | 11 +++-------- .../entity-user-permission-settings-modal.element.ts | 6 +++--- .../entity-user-permission-settings-modal.token.ts | 2 +- .../user/user-permission/modals/settings/index.ts | 1 + .../user/user-permission/modals/settings/manifests.ts | 8 ++++++++ 9 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 src/packages/user/user-permission/modals/index.ts rename src/packages/{core/modal/token => user/user-permission/modals/settings}/entity-user-permission-settings-modal.token.ts (85%) create mode 100644 src/packages/user/user-permission/modals/settings/index.ts create mode 100644 src/packages/user/user-permission/modals/settings/manifests.ts diff --git a/src/packages/core/modal/token/index.ts b/src/packages/core/modal/token/index.ts index 142ec335f9..c4ebe84a3d 100644 --- a/src/packages/core/modal/token/index.ts +++ b/src/packages/core/modal/token/index.ts @@ -1,7 +1,6 @@ export * from './change-password-modal.token.js'; export * from './confirm-modal.token.js'; export * from './embedded-media-modal.token.js'; -export * from './entity-user-permission-settings-modal.token.js'; export * from './item-picker-modal.token.js'; export * from './modal-token.js'; export * from './property-editor-ui-picker-modal.token.js'; diff --git a/src/packages/documents/documents/user-permissions/input-document-granular-user-permission/input-document-granular-user-permission.element.ts b/src/packages/documents/documents/user-permissions/input-document-granular-user-permission/input-document-granular-user-permission.element.ts index dc605b47f8..e7d27e5f1b 100644 --- a/src/packages/documents/documents/user-permissions/input-document-granular-user-permission/input-document-granular-user-permission.element.ts +++ b/src/packages/documents/documents/user-permissions/input-document-granular-user-permission/input-document-granular-user-permission.element.ts @@ -4,12 +4,13 @@ import { UMB_DOCUMENT_PICKER_MODAL } from '../../modals/index.js'; import { css, customElement, html, repeat, state } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import type { UmbModalManagerContext } from '@umbraco-cms/backoffice/modal'; -import { UMB_ENTITY_USER_PERMISSION_MODAL, UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; +import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; import type { UmbDeselectedEvent } from '@umbraco-cms/backoffice/event'; import { UmbChangeEvent, UmbSelectedEvent } from '@umbraco-cms/backoffice/event'; import type { ManifestEntityUserPermission } from '@umbraco-cms/backoffice/extension-registry'; import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; import { UUIFormControlMixin } from '@umbraco-cms/backoffice/external/uui'; +import { UMB_ENTITY_USER_PERMISSION_MODAL } from '@umbraco-cms/backoffice/user-permission'; @customElement('umb-input-document-granular-user-permission') export class UmbInputDocumentGranularUserPermissionElement extends UUIFormControlMixin(UmbLitElement, '') { diff --git a/src/packages/user/user-permission/index.ts b/src/packages/user/user-permission/index.ts index 85f5141999..d6f28c19b5 100644 --- a/src/packages/user/user-permission/index.ts +++ b/src/packages/user/user-permission/index.ts @@ -1,3 +1,4 @@ export * from './components/index.js'; +export * from './modals/index.js'; export type { UmbUserPermissionModel } from './types.js'; diff --git a/src/packages/user/user-permission/modals/index.ts b/src/packages/user/user-permission/modals/index.ts new file mode 100644 index 0000000000..f5425503d0 --- /dev/null +++ b/src/packages/user/user-permission/modals/index.ts @@ -0,0 +1 @@ +export * from './settings/index.js'; diff --git a/src/packages/user/user-permission/modals/manifests.ts b/src/packages/user/user-permission/modals/manifests.ts index d73911fde1..fada1af2d4 100644 --- a/src/packages/user/user-permission/modals/manifests.ts +++ b/src/packages/user/user-permission/modals/manifests.ts @@ -1,8 +1,3 @@ -export const manifests: Array = [ - { - type: 'modal', - alias: 'Umb.Modal.EntityUserPermissionSettings', - name: 'Entity User Permission Settings Modal', - js: () => import('./settings/entity-user-permission-settings-modal.element.js'), - }, -]; +import { manifests as settingsManifests } from './settings/manifests.js'; + +export const manifests: Array = [...settingsManifests]; diff --git a/src/packages/user/user-permission/modals/settings/entity-user-permission-settings-modal.element.ts b/src/packages/user/user-permission/modals/settings/entity-user-permission-settings-modal.element.ts index 6b088bc5c1..b09adc176a 100644 --- a/src/packages/user/user-permission/modals/settings/entity-user-permission-settings-modal.element.ts +++ b/src/packages/user/user-permission/modals/settings/entity-user-permission-settings-modal.element.ts @@ -1,9 +1,9 @@ -import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; -import { html, customElement, css, nothing, state } from '@umbraco-cms/backoffice/external/lit'; import type { UmbEntityUserPermissionSettingsModalData, UmbEntityUserPermissionSettingsModalValue, -} from '@umbraco-cms/backoffice/modal'; +} from './entity-user-permission-settings-modal.token.js'; +import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; +import { html, customElement, css, nothing, state } from '@umbraco-cms/backoffice/external/lit'; import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal'; import type { UmbSelectionChangeEvent } from '@umbraco-cms/backoffice/event'; diff --git a/src/packages/core/modal/token/entity-user-permission-settings-modal.token.ts b/src/packages/user/user-permission/modals/settings/entity-user-permission-settings-modal.token.ts similarity index 85% rename from src/packages/core/modal/token/entity-user-permission-settings-modal.token.ts rename to src/packages/user/user-permission/modals/settings/entity-user-permission-settings-modal.token.ts index 50bc5515ad..8d9a7c0243 100644 --- a/src/packages/core/modal/token/entity-user-permission-settings-modal.token.ts +++ b/src/packages/user/user-permission/modals/settings/entity-user-permission-settings-modal.token.ts @@ -1,4 +1,4 @@ -import { UmbModalToken } from './modal-token.js'; +import { UmbModalToken } from '../../../../core/modal/token/modal-token.js'; export interface UmbEntityUserPermissionSettingsModalData { unique: string; diff --git a/src/packages/user/user-permission/modals/settings/index.ts b/src/packages/user/user-permission/modals/settings/index.ts new file mode 100644 index 0000000000..97f4988c62 --- /dev/null +++ b/src/packages/user/user-permission/modals/settings/index.ts @@ -0,0 +1 @@ +export * from './entity-user-permission-settings-modal.token.js'; diff --git a/src/packages/user/user-permission/modals/settings/manifests.ts b/src/packages/user/user-permission/modals/settings/manifests.ts new file mode 100644 index 0000000000..f3052f637f --- /dev/null +++ b/src/packages/user/user-permission/modals/settings/manifests.ts @@ -0,0 +1,8 @@ +export const manifests: Array = [ + { + type: 'modal', + alias: 'Umb.Modal.EntityUserPermissionSettings', + name: 'Entity User Permission Settings Modal', + js: () => import('./entity-user-permission-settings-modal.element.js'), + }, +]; From aeb04304400cafc1e585035154e4a7e358c9720f Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 23 Sep 2024 12:41:51 +0200 Subject: [PATCH 2/3] fix import --- .../settings/entity-user-permission-settings-modal.token.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/user/user-permission/modals/settings/entity-user-permission-settings-modal.token.ts b/src/packages/user/user-permission/modals/settings/entity-user-permission-settings-modal.token.ts index 8d9a7c0243..a63dc036d2 100644 --- a/src/packages/user/user-permission/modals/settings/entity-user-permission-settings-modal.token.ts +++ b/src/packages/user/user-permission/modals/settings/entity-user-permission-settings-modal.token.ts @@ -1,4 +1,4 @@ -import { UmbModalToken } from '../../../../core/modal/token/modal-token.js'; +import { UmbModalToken } from '@umbraco-cms/backoffice/modal'; export interface UmbEntityUserPermissionSettingsModalData { unique: string; From 0b00de1916aa5d8c90b4241b707fe031b04a8ad2 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 23 Sep 2024 12:51:56 +0200 Subject: [PATCH 3/3] clean up common tokens --- src/packages/core/manifests.ts | 2 +- .../common/confirm/confirm-modal.controller.ts | 4 ++-- .../confirm}/confirm-modal.token.ts | 2 +- src/packages/core/modal/common/confirm/index.ts | 2 ++ .../core/modal/common/confirm/manifests.ts | 8 ++++++++ src/packages/core/modal/common/index.ts | 2 ++ .../core/modal/common/item-picker/index.ts | 1 + .../item-picker}/item-picker-modal.token.ts | 2 +- .../core/modal/common/item-picker/manifests.ts | 8 ++++++++ src/packages/core/modal/common/manifests.ts | 17 +++++------------ src/packages/core/modal/index.ts | 2 +- src/packages/core/modal/manifests.ts | 3 +++ src/packages/core/modal/token/index.ts | 2 -- 13 files changed, 35 insertions(+), 20 deletions(-) rename src/packages/core/modal/{token => common/confirm}/confirm-modal.token.ts (89%) create mode 100644 src/packages/core/modal/common/confirm/index.ts create mode 100644 src/packages/core/modal/common/confirm/manifests.ts create mode 100644 src/packages/core/modal/common/item-picker/index.ts rename src/packages/core/modal/{token => common/item-picker}/item-picker-modal.token.ts (88%) create mode 100644 src/packages/core/modal/common/item-picker/manifests.ts create mode 100644 src/packages/core/modal/manifests.ts diff --git a/src/packages/core/manifests.ts b/src/packages/core/manifests.ts index 62441b6e3a..a5d086a242 100644 --- a/src/packages/core/manifests.ts +++ b/src/packages/core/manifests.ts @@ -10,7 +10,7 @@ import { manifests as extensionManifests } from './extension-registry/manifests. import { manifests as iconRegistryManifests } from './icon-registry/manifests.js'; import { manifests as localizationManifests } from './localization/manifests.js'; import { manifests as menuManifests } from './menu/manifests.js'; -import { manifests as modalManifests } from './modal/common/manifests.js'; +import { manifests as modalManifests } from './modal/manifests.js'; import { manifests as pickerManifests } from './picker/manifests.js'; import { manifests as propertyActionManifests } from './property-action/manifests.js'; import { manifests as propertyManifests } from './property/manifests.js'; diff --git a/src/packages/core/modal/common/confirm/confirm-modal.controller.ts b/src/packages/core/modal/common/confirm/confirm-modal.controller.ts index 917d35ed9a..8deb91202b 100644 --- a/src/packages/core/modal/common/confirm/confirm-modal.controller.ts +++ b/src/packages/core/modal/common/confirm/confirm-modal.controller.ts @@ -1,5 +1,5 @@ -import { UMB_CONFIRM_MODAL, type UmbConfirmModalData } from '../../token/confirm-modal.token.js'; -import { UMB_MODAL_MANAGER_CONTEXT } from '../../context/modal-manager.context.js'; +import { UMB_MODAL_MANAGER_CONTEXT } from '../../context/index.js'; +import { UMB_CONFIRM_MODAL, type UmbConfirmModalData } from './confirm-modal.token.js'; import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; diff --git a/src/packages/core/modal/token/confirm-modal.token.ts b/src/packages/core/modal/common/confirm/confirm-modal.token.ts similarity index 89% rename from src/packages/core/modal/token/confirm-modal.token.ts rename to src/packages/core/modal/common/confirm/confirm-modal.token.ts index 45bd9f9709..d840de6147 100644 --- a/src/packages/core/modal/token/confirm-modal.token.ts +++ b/src/packages/core/modal/common/confirm/confirm-modal.token.ts @@ -1,4 +1,4 @@ -import { UmbModalToken } from './modal-token.js'; +import { UmbModalToken } from '../../token/index.js'; import type { TemplateResult } from '@umbraco-cms/backoffice/external/lit'; export interface UmbConfirmModalData { diff --git a/src/packages/core/modal/common/confirm/index.ts b/src/packages/core/modal/common/confirm/index.ts new file mode 100644 index 0000000000..7a5555ffb4 --- /dev/null +++ b/src/packages/core/modal/common/confirm/index.ts @@ -0,0 +1,2 @@ +export * from './confirm-modal.token.js'; +export * from './confirm-modal.controller.js'; diff --git a/src/packages/core/modal/common/confirm/manifests.ts b/src/packages/core/modal/common/confirm/manifests.ts new file mode 100644 index 0000000000..9428106e1b --- /dev/null +++ b/src/packages/core/modal/common/confirm/manifests.ts @@ -0,0 +1,8 @@ +export const manifests: Array = [ + { + type: 'modal', + alias: 'Umb.Modal.Confirm', + name: 'Confirm Modal', + element: () => import('./confirm-modal.element.js'), + }, +]; diff --git a/src/packages/core/modal/common/index.ts b/src/packages/core/modal/common/index.ts index 5a1c0033a6..ae13aa6d70 100644 --- a/src/packages/core/modal/common/index.ts +++ b/src/packages/core/modal/common/index.ts @@ -1 +1,3 @@ export * from './embedded-media/index.js'; +export * from './confirm/index.js'; +export * from './item-picker/index.js'; diff --git a/src/packages/core/modal/common/item-picker/index.ts b/src/packages/core/modal/common/item-picker/index.ts new file mode 100644 index 0000000000..1639c7e5db --- /dev/null +++ b/src/packages/core/modal/common/item-picker/index.ts @@ -0,0 +1 @@ +export * from './item-picker-modal.token.js'; diff --git a/src/packages/core/modal/token/item-picker-modal.token.ts b/src/packages/core/modal/common/item-picker/item-picker-modal.token.ts similarity index 88% rename from src/packages/core/modal/token/item-picker-modal.token.ts rename to src/packages/core/modal/common/item-picker/item-picker-modal.token.ts index 365c2f8088..d98658118a 100644 --- a/src/packages/core/modal/token/item-picker-modal.token.ts +++ b/src/packages/core/modal/common/item-picker/item-picker-modal.token.ts @@ -1,4 +1,4 @@ -import { UmbModalToken } from './modal-token.js'; +import { UmbModalToken } from '../../token/index.js'; export type UmbItemPickerModalData = { headline: string; diff --git a/src/packages/core/modal/common/item-picker/manifests.ts b/src/packages/core/modal/common/item-picker/manifests.ts new file mode 100644 index 0000000000..302ae9fa01 --- /dev/null +++ b/src/packages/core/modal/common/item-picker/manifests.ts @@ -0,0 +1,8 @@ +export const manifests: Array = [ + { + type: 'modal', + alias: 'Umb.Modal.ItemPicker', + name: 'Item Picker Modal', + element: () => import('./item-picker-modal.element.js'), + }, +]; diff --git a/src/packages/core/modal/common/manifests.ts b/src/packages/core/modal/common/manifests.ts index 606d9bed3d..dc3b1235ed 100644 --- a/src/packages/core/modal/common/manifests.ts +++ b/src/packages/core/modal/common/manifests.ts @@ -1,20 +1,13 @@ +import { manifests as confirmManifests } from './confirm/manifests.js'; +import { manifests as itemPickerManifests } from './item-picker/manifests.js'; + export const manifests: Array = [ - { - type: 'modal', - alias: 'Umb.Modal.Confirm', - name: 'Confirm Modal', - element: () => import('./confirm/confirm-modal.element.js'), - }, { type: 'modal', alias: 'Umb.Modal.EmbeddedMedia', name: 'Embedded Media Modal', element: () => import('./embedded-media/embedded-media-modal.element.js'), }, - { - type: 'modal', - alias: 'Umb.Modal.ItemPicker', - name: 'Item Picker Modal', - element: () => import('./item-picker/item-picker-modal.element.js'), - }, + ...confirmManifests, + ...itemPickerManifests, ]; diff --git a/src/packages/core/modal/index.ts b/src/packages/core/modal/index.ts index 59329387f8..522242858c 100644 --- a/src/packages/core/modal/index.ts +++ b/src/packages/core/modal/index.ts @@ -5,4 +5,4 @@ export * from './token/index.js'; export * from './types.js'; export * from './component/modal-base.element.js'; export * from './component/modal.element.js'; -export * from './common/confirm/confirm-modal.controller.js'; +export * from './common/index.js'; diff --git a/src/packages/core/modal/manifests.ts b/src/packages/core/modal/manifests.ts new file mode 100644 index 0000000000..edd06202ae --- /dev/null +++ b/src/packages/core/modal/manifests.ts @@ -0,0 +1,3 @@ +import { manifests as commonManifests } from './common/manifests.js'; + +export const manifests: Array = [...commonManifests]; diff --git a/src/packages/core/modal/token/index.ts b/src/packages/core/modal/token/index.ts index c4ebe84a3d..0a0e3bf541 100644 --- a/src/packages/core/modal/token/index.ts +++ b/src/packages/core/modal/token/index.ts @@ -1,6 +1,4 @@ export * from './change-password-modal.token.js'; -export * from './confirm-modal.token.js'; export * from './embedded-media-modal.token.js'; -export * from './item-picker-modal.token.js'; export * from './modal-token.js'; export * from './property-editor-ui-picker-modal.token.js';