diff --git a/src/Umbraco.Web.UI.Client/src/apps/backoffice/backoffice.element.ts b/src/Umbraco.Web.UI.Client/src/apps/backoffice/backoffice.element.ts index 14f41066b3..923ebbc225 100644 --- a/src/Umbraco.Web.UI.Client/src/apps/backoffice/backoffice.element.ts +++ b/src/Umbraco.Web.UI.Client/src/apps/backoffice/backoffice.element.ts @@ -36,7 +36,7 @@ const CORE_PACKAGES = [ import('../../packages/tiny-mce/umbraco-package.js'), import('../../packages/umbraco-news/umbraco-package.js'), import('../../packages/user/umbraco-package.js'), - import('../../packages/webhooks/umbraco-package.js'), + import('../../packages/webhook/umbraco-package.js'), ]; @customElement('umb-backoffice') diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/action/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/action/manifests.ts similarity index 94% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/action/manifests.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/action/manifests.ts index e6861fae97..bfaabbb79a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/action/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/action/manifests.ts @@ -14,7 +14,7 @@ export const createManifest: ManifestCollectionAction = { conditions: [ { alias: UMB_COLLECTION_ALIAS_CONDITION, - match: 'Umb.Collection.Webhooks', + match: 'Umb.Collection.Webhook', }, ], }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/index.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/manifests.ts similarity index 99% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/manifests.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/manifests.ts index a1a884c82c..913d773738 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/manifests.ts @@ -6,7 +6,7 @@ import { manifests as collectionViewManifests } from './views/manifests.js'; import { manifests as collectionActionManifests } from './action/manifests.js'; import type { ManifestCollection } from '@umbraco-cms/backoffice/extension-registry'; -export const UMB_WEBHOOK_COLLECTION_ALIAS = 'Umb.Collection.Webhooks'; +export const UMB_WEBHOOK_COLLECTION_ALIAS = 'Umb.Collection.Webhook'; const collectionManifest: ManifestCollection = { type: 'collection', diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/repository/index.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/repository/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/repository/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/repository/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/repository/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/repository/manifests.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/repository/manifests.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/repository/manifests.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/repository/types.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/repository/types.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/repository/types.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/repository/types.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/repository/webhook-collection.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/repository/webhook-collection.repository.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/repository/webhook-collection.repository.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/repository/webhook-collection.repository.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/repository/webhook-collection.server.data-source.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/repository/webhook-collection.server.data-source.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/repository/webhook-collection.server.data-source.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/repository/webhook-collection.server.data-source.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/types.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/types.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/types.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/types.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/index.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/manifests.ts similarity index 94% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/manifests.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/manifests.ts index 75a8dda29d..2eed3f5374 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/manifests.ts @@ -16,7 +16,7 @@ const tableCollectionView: ManifestCollectionView = { conditions: [ { alias: UMB_COLLECTION_ALIAS_CONDITION, - match: 'Umb.Collection.Webhooks', + match: 'Umb.Collection.Webhook', }, ], }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/table/column-layouts/boolean/webhook-table-boolean-column-layout.element.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/table/column-layouts/boolean/webhook-table-boolean-column-layout.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/table/column-layouts/boolean/webhook-table-boolean-column-layout.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/table/column-layouts/boolean/webhook-table-boolean-column-layout.element.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/table/column-layouts/entity-actions/webhook-table-entity-actions-column-layout.element.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/table/column-layouts/entity-actions/webhook-table-entity-actions-column-layout.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/table/column-layouts/entity-actions/webhook-table-entity-actions-column-layout.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/table/column-layouts/entity-actions/webhook-table-entity-actions-column-layout.element.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/table/column-layouts/name/webhook-table-name-column-layout.element.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/table/column-layouts/name/webhook-table-name-column-layout.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/table/column-layouts/name/webhook-table-name-column-layout.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/table/column-layouts/name/webhook-table-name-column-layout.element.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/table/webhook-table-collection-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/table/webhook-table-collection-view.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/collection/views/table/webhook-table-collection-view.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/collection/views/table/webhook-table-collection-view.element.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhook/entity.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/entity.ts new file mode 100644 index 0000000000..f78d477122 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/entity.ts @@ -0,0 +1,4 @@ +export const UMB_WEBHOOK_ENTITY_TYPE = 'webhook'; +export const UMB_WEBHOOK_WORKSPACE = 'Umb.Workspace.Webhook'; + +export type UmbWebhookEntityType = typeof UMB_WEBHOOK_ENTITY_TYPE; diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/index.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/index.ts similarity index 78% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/index.ts index fa830d4b75..85eed50a10 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/webhooks/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/index.ts @@ -1,6 +1,5 @@ import './components/index.js'; -export * from './repository/index.js'; export * from './collection/index.js'; export * from './workspace/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhook/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/manifests.ts new file mode 100644 index 0000000000..f5ebb840c6 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/manifests.ts @@ -0,0 +1,5 @@ +import { manifests as treeManifests } from './menu-item/manifests.js'; +import { manifests as workspaceManifests } from './workspace/manifests.js'; +import { manifests as collectionManifests } from './collection/manifests.js'; + +export const manifests = [...treeManifests, ...workspaceManifests, ...collectionManifests]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/menu-item/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/menu-item/manifests.ts similarity index 65% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/menu-item/manifests.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/menu-item/manifests.ts index e4d502e06a..fd32d80af7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/webhooks/menu-item/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/menu-item/manifests.ts @@ -1,14 +1,15 @@ import type { ManifestMenuItem } from '@umbraco-cms/backoffice/extension-registry'; +import { UMB_WEBHOOK_ENTITY_TYPE } from '../entity'; const menuItem: ManifestMenuItem = { type: 'menuItem', - alias: 'Umb.MenuItem.Webhooks', - name: 'Webhooks Menu Item', + alias: 'Umb.MenuItem.Webhook', + name: 'Webhook Menu Item', weight: 100, meta: { label: 'Webhooks', icon: 'icon-webhook', - entityType: 'webhooks', + entityType: UMB_WEBHOOK_ENTITY_TYPE, menus: ['Umb.Menu.Settings'], }, }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/types.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/types.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/types.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/types.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhook/umbraco-package.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/umbraco-package.ts new file mode 100644 index 0000000000..a5c24dd8b6 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/umbraco-package.ts @@ -0,0 +1,9 @@ +export const name = 'Umbraco.Core.Webhook'; +export const extensions = [ + { + name: 'Webhook Bundle', + alias: 'Umb.Bundle.Webhook', + type: 'bundle', + js: () => import('./manifests.js'), + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/index.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/index.ts new file mode 100644 index 0000000000..897634ac15 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/index.ts @@ -0,0 +1 @@ +export * from './webhook.context.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/manifests.ts new file mode 100644 index 0000000000..64e980a76e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/manifests.ts @@ -0,0 +1,3 @@ +import { manifests as webhookManifests } from './webhook/manifests.js'; + +export const manifests = [...webhookManifests]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/views/overview/webhook-overview-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/views/overview/webhook-overview-view.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/views/overview/webhook-overview-view.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/views/overview/webhook-overview-view.element.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/webhooks.context.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/webhook.context.ts similarity index 57% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/webhooks.context.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/webhook.context.ts index 9d6f760934..8172f2a6f7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/webhooks.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/webhook.context.ts @@ -1,14 +1,12 @@ -import { UMB_WEBHOOK_ENTITY_TYPE } from '../entity.js'; -import { UmbWebhookRepository } from '../repository/webhooks.repository.js'; +import { UMB_WEBHOOK_ENTITY_TYPE, UMB_WEBHOOK_WORKSPACE } from '../entity.js'; import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api'; import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbWorkspaceContextInterface } from '@umbraco-cms/backoffice/workspace'; import { UMB_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace'; -export class UmbWebhooksWorkspaceContext extends UmbControllerBase implements UmbWorkspaceContextInterface { - public readonly workspaceAlias = 'Umb.Workspace.Webhooks'; - #repository; +export class UmbWebhookWorkspaceContext extends UmbControllerBase implements UmbWorkspaceContextInterface { + public readonly workspaceAlias = UMB_WEBHOOK_WORKSPACE; getEntityType() { return UMB_WEBHOOK_ENTITY_TYPE; @@ -22,11 +20,8 @@ export class UmbWebhooksWorkspaceContext extends UmbControllerBase implements Um super(host); this.provideContext(UMB_WORKSPACE_CONTEXT, this); // TODO: Revisit usage of workspace for this case... currently no other workspace context provides them self with their own token. - this.provideContext(UMB_APP_WEBHOOKS_CONTEXT, this); - this.#repository = new UmbWebhookRepository(host); + this.provideContext(UMB_APP_WEBHOOK_CONTEXT, this); } } -export const UMB_APP_WEBHOOKS_CONTEXT = new UmbContextToken( - UmbWebhooksWorkspaceContext.name, -); +export const UMB_APP_WEBHOOK_CONTEXT = new UmbContextToken(UmbWebhookWorkspaceContext.name); diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/webhooks/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/webhook/manifests.ts similarity index 74% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/webhooks/manifests.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/webhook/manifests.ts index 53bd82f2a8..164e767189 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/webhooks/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/webhook/manifests.ts @@ -1,22 +1,21 @@ +import { UMB_WEBHOOK_ENTITY_TYPE, UMB_WEBHOOK_WORKSPACE } from '../../entity.js'; import type { ManifestWorkspace, ManifestWorkspaceView } from '@umbraco-cms/backoffice/extension-registry'; -const workspaceAlias = 'Umb.Workspace.Webhooks'; - const workspace: ManifestWorkspace = { type: 'workspace', - alias: workspaceAlias, + alias: UMB_WEBHOOK_WORKSPACE, name: 'Webhook Root Workspace', js: () => import('./webhook-workspace.element.js'), meta: { - entityType: 'webhooks', + entityType: UMB_WEBHOOK_ENTITY_TYPE, }, }; const workspaceViews: Array = [ { type: 'workspaceView', - alias: 'Umb.WorkspaceView.Webhooks.Overview', - name: 'Webhooks Root Workspace Overview View', + alias: 'Umb.WorkspaceView.Webhook.Overview', + name: 'Webhook Root Workspace Overview View', js: () => import('../views/overview/webhook-overview-view.element.js'), weight: 300, meta: { @@ -33,8 +32,8 @@ const workspaceViews: Array = [ }, { type: 'workspaceView', - alias: 'Umb.WorkspaceView.Webhooks.Search', - name: 'Webhooks Root Workspace Logs View', + alias: 'Umb.WorkspaceView.Webhook.Search', + name: 'Webhook Root Workspace Logs View', js: () => import('../views/overview/webhook-overview-view.element.js'), weight: 200, meta: { diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/webhooks/webhook-workspace.element.ts b/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/webhook/webhook-workspace.element.ts similarity index 65% rename from src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/webhooks/webhook-workspace.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/webhook/webhook-workspace.element.ts index bb2fcd10d4..53679499cd 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/webhooks/webhook-workspace.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/webhook/workspace/webhook/webhook-workspace.element.ts @@ -1,10 +1,14 @@ -import { UmbWebhooksWorkspaceContext } from '../webhooks.context.js'; +import { UmbWebhookWorkspaceContext } from '../webhook.context.js'; import { html, customElement } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; @customElement('umb-webhook-workspace') export class UmbWebhookWorkspaceElement extends UmbLitElement { - #webhooksWorkspaceContext = new UmbWebhooksWorkspaceContext(this); + /** + * The context for the webhook workspace. + * This is used to provide the workspace with the necessary data and services even though it does not have any references. + */ + #webhookWorkspaceContext = new UmbWebhookWorkspaceContext(this); render() { return html` context -> repository -> (store) -> data source -// All methods should be async and return a promise. Some methods might return an observable as part of the promise response. -export class UmbWebhookRepository { - #host: UmbControllerHostElement; - #notificationService?: UmbNotificationContext; - #init; - - constructor(host: UmbControllerHostElement) { - this.#host = host; - - this.#init = new UmbContextConsumerController(this.#host, UMB_NOTIFICATION_CONTEXT, (instance) => { - this.#notificationService = instance; - }).asPromise(); - } - - async requestWebhooks({ skip, take } = { skip: 0, take: 1000 }) { - await this.#init; - } -} diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/umbraco-package.ts b/src/Umbraco.Web.UI.Client/src/packages/webhooks/umbraco-package.ts deleted file mode 100644 index 035cc47070..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/webhooks/umbraco-package.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const name = 'Umbraco.Core.Webhooks'; -export const extensions = [ - { - name: 'Webhooks Bundle', - alias: 'Umb.Bundle.Webhooks', - type: 'bundle', - js: () => import('./manifests.js'), - }, -]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/index.ts b/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/index.ts deleted file mode 100644 index cf96ef5bba..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './webhooks.context.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/manifests.ts deleted file mode 100644 index 9b0d6f690f..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/webhooks/workspace/manifests.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { manifests as webhookManifests } from './webhooks/manifests.js'; - -export const manifests = [...webhookManifests];