update names
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
import { UmbDocumentRepository } from '../../repository/document.repository';
|
||||
import { UmbEntityActionBase } from '../../../../shared/entity-actions';
|
||||
import type { UmbCreateDocumentModalResultData } from './create-document-modal-layout.element';
|
||||
import { UmbEntityActionBase } from '@umbraco-cms/entity-action';
|
||||
import { UmbControllerHostInterface } from '@umbraco-cms/controller';
|
||||
import { UmbModalService, UMB_MODAL_SERVICE_CONTEXT_TOKEN } from '@umbraco-cms/modal';
|
||||
import { UmbModalContext, UMB_MODAL_CONTEXT_TOKEN } from '@umbraco-cms/modal';
|
||||
import { UmbContextConsumerController } from '@umbraco-cms/context-api';
|
||||
|
||||
// TODO: temp import
|
||||
import './create-document-modal-layout.element.ts';
|
||||
|
||||
export class UmbCreateDocumentEntityAction extends UmbEntityActionBase<UmbDocumentRepository> {
|
||||
#modalService?: UmbModalService;
|
||||
#modalContext?: UmbModalContext;
|
||||
|
||||
constructor(host: UmbControllerHostInterface, repositoryAlias: string, unique: string) {
|
||||
super(host, repositoryAlias, unique);
|
||||
|
||||
new UmbContextConsumerController(this.host, UMB_MODAL_SERVICE_CONTEXT_TOKEN, (instance) => {
|
||||
this.#modalService = instance;
|
||||
new UmbContextConsumerController(this.host, UMB_MODAL_CONTEXT_TOKEN, (instance) => {
|
||||
this.#modalContext = instance;
|
||||
});
|
||||
}
|
||||
|
||||
async execute() {
|
||||
// TODO: what to do if modal service is not available?
|
||||
if (!this.#modalService) return;
|
||||
if (!this.#modalContext) return;
|
||||
|
||||
const modalHandler = this.#modalService?.open('umb-create-document-modal-layout', {
|
||||
const modalHandler = this.#modalContext?.open('umb-create-document-modal-layout', {
|
||||
type: 'sidebar',
|
||||
data: { unique: this.unique },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user