From c94240aada6a0d8a422805c0fc7466deb5728236 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 7 Feb 2023 21:53:45 +0100 Subject: [PATCH] remove media move collection action --- ...llection-bulk-action-media-move.element.ts | 64 ------------------- .../collection/bulk-actions/manifests.ts | 12 ---- 2 files changed, 76 deletions(-) delete mode 100644 src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/bulk-actions/collection-bulk-action-media-move.element.ts diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/bulk-actions/collection-bulk-action-media-move.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/bulk-actions/collection-bulk-action-media-move.element.ts deleted file mode 100644 index 3367c5d691..0000000000 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/bulk-actions/collection-bulk-action-media-move.element.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { UUITextStyles } from '@umbraco-ui/uui-css'; -import { css, html } from 'lit'; -import { customElement } from 'lit/decorators.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { UmbCollectionContext, UMB_COLLECTION_CONTEXT_TOKEN } from '../collection.context'; -import { UmbModalService, UMB_MODAL_SERVICE_CONTEXT_TOKEN } from '../../../../core/modal'; -import { UmbLitElement } from '@umbraco-cms/element'; -import type { ManifestCollectionBulkAction } from '@umbraco-cms/models'; - -@customElement('umb-collection-bulk-action-media-move') -export class UmbCollectionBulkActionMoveElement extends UmbLitElement { - static styles = [UUITextStyles, css``]; - - // TODO: make a UmbCollectionContextMedia: - #collectionContext?: UmbCollectionContext; - - public manifest?: ManifestCollectionBulkAction; - - #modalService?: UmbModalService; - - constructor() { - super(); - - this.consumeContext(UMB_COLLECTION_CONTEXT_TOKEN, (context) => { - this.#collectionContext = context; - }); - - this.consumeContext(UMB_MODAL_SERVICE_CONTEXT_TOKEN, (instance) => { - this.#modalService = instance; - }); - - } - - #handleClick() { - const selectionSubscription = this.#collectionContext?.selection.subscribe((selection) => { - const modalHandler = this.#modalService?.mediaPicker({ - selection: [], - multiple: false, - }); - modalHandler?.onClose().then((data) => { - if (selection.length > 0) { - this.#collectionContext?.move(selection, data.selection[0]); - } - selectionSubscription?.unsubscribe(); - this.#collectionContext?.clearSelection(); - }); - }); - } - - render() { - // TODO: make a UmbCollectionContextMedia and use a deleteSelection method. - return html``; - } -} - -declare global { - interface HTMLElementTagNameMap { - 'umb-collection-bulk-action-media-move': UmbCollectionBulkActionMoveElement; - } -} diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/bulk-actions/manifests.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/bulk-actions/manifests.ts index ae878b0e1b..0a60ed6d77 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/bulk-actions/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/bulk-actions/manifests.ts @@ -13,16 +13,4 @@ export const manifests: Array = [ entityType: 'media', }, }, - { - type: 'collectionBulkAction', - alias: 'Umb.CollectionBulkAction.Move', - name: 'Delete', - elementName: 'umb-collection-bulk-action-media-move', - loader: () => import('./collection-bulk-action-media-move.element'), - weight: 100, - meta: { - label: 'Move', - entityType: 'media', - }, - }, ];