diff --git a/src/Umbraco.Web.UI.Client/src/packages/language/collection/action/create-language-collection-action.element.ts b/src/Umbraco.Web.UI.Client/src/packages/language/collection/action/create-language-collection-action.element.ts deleted file mode 100644 index 94ccb509bd..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/language/collection/action/create-language-collection-action.element.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { UMB_LANGUAGE_ENTITY_TYPE, UMB_LANGUAGE_ROOT_ENTITY_TYPE } from '../../entity.js'; -import { UMB_CREATE_LANGUAGE_WORKSPACE_PATH_PATTERN } from '../../paths.js'; -import { UMB_LANGUAGE_WORKSPACE_MODAL } from '../../workspace/language/language-workspace.modal-token.js'; -import { customElement, html, property, state } from '@umbraco-cms/backoffice/external/lit'; -import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import { UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/modal'; -import type { ManifestCollectionAction } from '@umbraco-cms/backoffice/extension-registry'; -import { UMB_COLLECTION_CONTEXT } from '@umbraco-cms/backoffice/collection'; - -@customElement('umb-create-language-collection-action') -export class UmbCreateLanguageCollectionActionElement extends UmbLitElement { - @state() - private _createPath = ''; - - @state() - private _currentView?: string; - - @state() - private _rootPathName?: string; - - @property({ attribute: false }) - manifest?: ManifestCollectionAction; - - constructor() { - super(); - - new UmbModalRouteRegistrationController(this, UMB_LANGUAGE_WORKSPACE_MODAL) - .addAdditionalPath('language') - .onSetup(() => { - return { data: { entityType: UMB_LANGUAGE_ENTITY_TYPE, preset: {} } }; - }) - .observeRouteBuilder((routeBuilder) => { - this._createPath = routeBuilder({}); - }); - - this.consumeContext(UMB_COLLECTION_CONTEXT, (collectionContext) => { - this.observe(collectionContext.view.currentView, (currentView) => { - this._currentView = currentView?.meta.pathName; - }); - this.observe(collectionContext.view.rootPathName, (rootPathName) => { - this._rootPathName = rootPathName; - }); - }); - } - - #getCreateUrl() { - return ( - this._createPath.replace(`${this._rootPathName}`, `${this._rootPathName}/${this._currentView}`) + - UMB_CREATE_LANGUAGE_WORKSPACE_PATH_PATTERN.generateLocal({ - parentEntityType: UMB_LANGUAGE_ROOT_ENTITY_TYPE, - parentUnique: null, - }) - ); - } - - render() { - return html` `; - } -} - -export { UmbCreateLanguageCollectionActionElement as element }; - -declare global { - interface HTMLElementTagNameMap { - 'umb-create-language-collection-action': UmbCreateLanguageCollectionActionElement; - } -} diff --git a/src/Umbraco.Web.UI.Client/src/packages/language/collection/action/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/language/collection/action/manifests.ts index 22150ae2d5..4dfa891fbe 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/language/collection/action/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/language/collection/action/manifests.ts @@ -3,12 +3,13 @@ import type { ManifestCollectionAction, ManifestTypes } from '@umbraco-cms/backo export const createManifest: ManifestCollectionAction = { type: 'collectionAction', + kind: 'button', name: 'Create Language Collection Action', alias: 'Umb.CollectionAction.Language.Create', weight: 200, - element: () => import('./create-language-collection-action.element.js'), meta: { label: 'Create', + href: 'section/settings/workspace/language/create', }, conditions: [ {