Skip to content

POC: Real time updates #19372

New issue

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

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

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 112 additions & 7 deletions src/Umbraco.Web.UI.Client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { UmbEntityActionBase } from '../../entity-action-base.js';
import { UmbRequestReloadStructureForEntityEvent } from '../../request-reload-structure-for-entity.event.js';
import type { MetaEntityActionDeleteKind } from './types.js';
import { createExtensionApiByAlias } from '@umbraco-cms/backoffice/extension-registry';
import { umbConfirmModal } from '@umbraco-cms/backoffice/modal';
import type { UmbDetailRepository, UmbItemRepository } from '@umbraco-cms/backoffice/repository';
import { UMB_ACTION_EVENT_CONTEXT } from '@umbraco-cms/backoffice/action';
import { UmbLocalizationController } from '@umbraco-cms/backoffice/localization-api';
import { UmbRequestReloadStructureForEntityEvent } from '@umbraco-cms/backoffice/entity-action';

export class UmbDeleteEntityAction<
MetaKind extends MetaEntityActionDeleteKind = MetaEntityActionDeleteKind,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { UmbEntityActionBase } from '../../entity-action-base.js';
import { UmbRequestReloadStructureForEntityEvent } from '../../request-reload-structure-for-entity.event.js';
import type { UmbDuplicateRepository } from './duplicate-repository.interface.js';
import { createExtensionApiByAlias } from '@umbraco-cms/backoffice/extension-registry';
import { UMB_ACTION_EVENT_CONTEXT } from '@umbraco-cms/backoffice/action';
import { UmbRequestReloadStructureForEntityEvent } from '@umbraco-cms/backoffice/entity-action';

export class UmbDuplicateEntityAction extends UmbEntityActionBase<any> {
override async execute() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { UmbEntityActionEventArgs } from './entity-action.event.js';
import { UmbEntityActionEvent } from './entity-action.event.js';

export class UmbEntityCreatedEvent extends UmbEntityActionEvent {
static readonly TYPE = 'entity-created';

constructor(args: UmbEntityActionEventArgs) {
super(UmbEntityCreatedEvent.TYPE, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { UmbEntityActionEventArgs } from './entity-action.event.js';
import { UmbEntityActionEvent } from './entity-action.event.js';

interface UmbGenericEntityActionEventArgs extends UmbEntityActionEventArgs {
type: string;
}

export class UmbEntityEvent extends UmbEntityActionEvent {
constructor(args: UmbGenericEntityActionEventArgs) {
super(args.type, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export * from './entity-action.event.js';
export * from './entity-created.event.js';
export * from './entity-deleted.event.js';
export * from './entity-updated.event.js';
export * from './entity.event.js';

export * from './request-reload-structure-for-entity.event.js';
export * from './request-reload-children-of-entity.event.js';
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ export * from './common/index.js';
export * from './constants.js';
export * from './entity-action-base.js';
export * from './entity-action-list.element.js';
export * from './entity-action.event.js';
export * from './has-children/index.js';
export * from './entity-updated.event.js';
export * from './entity-deleted.event.js';
export * from './event/index.js';

export type * from './types.js';

export { UmbRequestReloadStructureForEntityEvent } from './request-reload-structure-for-entity.event.js';
export { UmbRequestReloadChildrenOfEntityEvent } from './request-reload-children-of-entity.event.js';
export { UMB_ENTITY_ACTION_DEFAULT_KIND_MANIFEST } from './default/default.action.kind.js';
3 changes: 3 additions & 0 deletions src/Umbraco.Web.UI.Client/src/packages/core/entry-point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { UMB_AUTH_CONTEXT } from './auth/auth.context.token.js';
import { UmbBackofficeNotificationContainerElement, UmbBackofficeModalContainerElement } from './components/index.js';
import { UmbActionEventContext } from './action/action-event.context.js';
import { manifests as coreManifests } from './manifests.js';
import { UmbServerEventManager } from './server/index.js';
import { UmbNotificationContext } from '@umbraco-cms/backoffice/notification';
import { UmbModalManagerContext } from '@umbraco-cms/backoffice/modal';
import { UmbExtensionsApiInitializer, type UmbEntryPointOnInit } from '@umbraco-cms/backoffice/extension-api';
Expand All @@ -20,6 +21,8 @@ export const onInit: UmbEntryPointOnInit = (host, extensionRegistry) => {
new UmbExtensionsApiInitializer(host, extensionRegistry, 'treeStore', [host]);
new UmbExtensionsApiInitializer(host, extensionRegistry, 'itemStore', [host]);

new UmbServerEventManager(host);

extensionRegistry.registerMany(coreManifests);

const notificationContainerElement = new UmbBackofficeNotificationContainerElement();
Expand Down
1 change: 1 addition & 0 deletions src/Umbraco.Web.UI.Client/src/packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"generate:server-api": "openapi-ts --file openapi-ts.config.js"
},
"dependencies": {
"@microsoft/signalr": "^8.0.7",
"@types/diff": "^7.0.2",
"diff": "^7.0.0",
"uuid": "^11.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { UMB_SERVER_EVENT_CONTEXT } from './server-event.context.token.js';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './server-event.manager.js';
Loading
Loading