Merge branch 'feature/entity-action-kind' of https://github.com/umbraco/Umbraco.CMS.Backoffice into feature/entity-action-kind

This commit is contained in:
Niels Lyngsø
2024-03-03 21:11:10 +01:00
5 changed files with 16 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ import type { UmbControllerAlias } from './controller-alias.type.js';
import { UmbControllerHostMixin } from './controller-host.mixin.js';
import type { UmbControllerHostElement } from './controller-host-element.interface.js';
import type { UmbController } from './controller.interface.js';
import type { UmbControllerHost } from './controller-host.interface.js';
import type { HTMLElementConstructor } from '@umbraco-cms/backoffice/extension-api';
export declare class UmbControllerHostImplementationElement extends HTMLElement implements UmbControllerHostElement {

View File

@@ -1,7 +1,7 @@
import { expect, fixture, html } from '@open-wc/testing';
import { UmbControllerHostProviderElement } from './controller-host-provider.element.js';
import type { UmbControllerHostElement } from './controller-host-element.mixin.js';
import { UmbControllerHostElementMixin } from './controller-host-element.mixin.js';
import type { UmbControllerHostElement } from './controller-host-element.interface.js';
import { customElement } from '@umbraco-cms/backoffice/external/lit';
import { UmbContextConsumerController, UmbContextProviderController } from '@umbraco-cms/backoffice/context-api';

View File

@@ -1,7 +1,7 @@
import { UMB_DICTIONARY_ROOT_ENTITY_TYPE, UMB_DICTIONARY_ENTITY_TYPE } from '../../entity.js';
import type { ManifestEntityAction } from '@umbraco-cms/backoffice/extension-registry';
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
export const manifests: Array<ManifestEntityAction> = [
export const manifests: Array<ManifestTypes> = [
{
type: 'entityAction',
alias: 'Umb.EntityAction.Dictionary.Tree.ReloadChildrenOf',

View File

@@ -3,9 +3,9 @@ import {
UMB_PARTIAL_VIEW_ENTITY_TYPE,
UMB_PARTIAL_VIEW_FOLDER_ENTITY_TYPE,
} from '../../entity.js';
import type { ManifestEntityAction } from '@umbraco-cms/backoffice/extension-registry';
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
export const manifests: Array<ManifestEntityAction> = [
export const manifests: Array<ManifestTypes> = [
{
type: 'entityAction',
alias: 'Umb.EntityAction.PartialView.Tree.ReloadChildrenOf',

View File

@@ -1,21 +1,27 @@
import { UMB_SCRIPT_CREATE_OPTIONS_MODAL } from './options-modal/index.js';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action';
import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action';
import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
export class UmbScriptCreateOptionsEntityAction extends UmbEntityActionBase<never> {
async execute() {
if (!this.repository) throw new Error('Repository is not available');
constructor(host: UmbControllerHost, args: UmbEntityActionArgs<never>) {
super(host, args);
}
async execute() {
const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
const modalContext = modalManager.open(this, UMB_SCRIPT_CREATE_OPTIONS_MODAL, {
data: {
parent: {
entityType: this.entityType,
unique: this.unique,
entityType: this.args.entityType,
unique: this.args.unique,
},
},
});
await modalContext.onSubmit();
}
destroy(): void {}
}