diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/data-type/actions/save/workspace-action-data-type-save.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/data-type/actions/save/workspace-action-data-type-save.element.ts deleted file mode 100644 index 3724c14b88..0000000000 --- a/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/data-type/actions/save/workspace-action-data-type-save.element.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { css, html, LitElement } from 'lit'; -import { customElement, state } from 'lit/decorators.js'; -import { UUITextStyles } from '@umbraco-ui/uui-css/lib'; -import type { UUIButtonState } from '@umbraco-ui/uui'; -import type { UmbWorkspaceDataTypeContext } from '../../workspace-data-type.context'; -import { UmbContextConsumerMixin } from '@umbraco-cms/context-api'; - -@customElement('umb-workspace-action-data-type-save') -export class UmbWorkspaceActionDataTypeSaveElement extends UmbContextConsumerMixin(LitElement) { - static styles = [UUITextStyles, css``]; - - @state() - private _saveButtonState?: UUIButtonState; - - private _workspaceContext?: UmbWorkspaceDataTypeContext; - - constructor() { - super(); - - this.consumeContext('umbWorkspaceContext', (instance) => { - this._workspaceContext = instance; - } - ); - } - - private async _handleSave() { - if (!this._workspaceContext) return; - - this._saveButtonState = 'waiting'; - await this._workspaceContext.save().then(() => { - this._saveButtonState = 'success'; - }).catch(() => { - this._saveButtonState = 'failed'; - }) - } - - render() { - return html``; - } -} - -export default UmbWorkspaceActionDataTypeSaveElement; - -declare global { - interface HTMLElementTagNameMap { - 'umb-workspace-action-data-type-save': UmbWorkspaceActionDataTypeSaveElement; - } -} diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/document-type/workspace-document-type.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/document-type/workspace-document-type.element.ts index fd1fb08b05..017f3aacf4 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/document-type/workspace-document-type.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/document-type/workspace-document-type.element.ts @@ -124,7 +124,7 @@ export class UmbWorkspaceDocumentTypeElement extends UmbContextProviderMixin( type: 'workspaceAction', alias: 'Umb.WorkspaceAction.DocumentType.Save', name: 'Save Document Type Workspace Action', - loader: () => import('./actions/save/workspace-action-document-type-save.element'), + loader: () => import('../shared/actions/save/workspace-action-node-save.element'), meta: { workspaces: ['Umb.Workspace.DocumentType'], }, diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/document-type/actions/save/workspace-action-document-type-save.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/shared/actions/save/workspace-action-node-save.element.ts similarity index 72% rename from src/Umbraco.Web.UI.Client/src/backoffice/workspaces/document-type/actions/save/workspace-action-document-type-save.element.ts rename to src/Umbraco.Web.UI.Client/src/backoffice/workspaces/shared/actions/save/workspace-action-node-save.element.ts index d68c8f4fdc..de79f3ac9b 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/document-type/actions/save/workspace-action-document-type-save.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/shared/actions/save/workspace-action-node-save.element.ts @@ -2,18 +2,18 @@ import { css, html, LitElement } from 'lit'; import { customElement, state } from 'lit/decorators.js'; import { UUITextStyles } from '@umbraco-ui/uui-css/lib'; import type { UUIButtonState } from '@umbraco-ui/uui'; -import type { UmbWorkspaceDocumentTypeContext } from '../../workspace-document-type.context'; +import type { UmbWorkspaceNodeContext } from '../../workspace-context/workspace-node.context'; import { UmbContextConsumerMixin } from '@umbraco-cms/context-api'; @customElement('umb-workspace-action-document-type-save') -export class UmbWorkspaceActionDocumentTypeSaveElement extends UmbContextConsumerMixin(LitElement) { +export class UmbWorkspaceActionNodeSaveElement extends UmbContextConsumerMixin(LitElement) { static styles = [UUITextStyles, css``]; @state() private _saveButtonState?: UUIButtonState; - private _workspaceContext?: UmbWorkspaceDocumentTypeContext; + private _workspaceContext?: UmbWorkspaceNodeContext; constructor() { super(); @@ -45,10 +45,10 @@ export class UmbWorkspaceActionDocumentTypeSaveElement extends UmbContextConsume } } -export default UmbWorkspaceActionDocumentTypeSaveElement; +export default UmbWorkspaceActionNodeSaveElement; declare global { interface HTMLElementTagNameMap { - 'umb-workspace-action-document-type-save': UmbWorkspaceActionDocumentTypeSaveElement; + 'umb-workspace-action-node-save': UmbWorkspaceActionNodeSaveElement; } } diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/user-group/workspace-user-group.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/user-group/workspace-user-group.element.ts index 60a6894b7f..7d80f5f8aa 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/user-group/workspace-user-group.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/user-group/workspace-user-group.element.ts @@ -244,8 +244,8 @@ export class UmbWorkspaceUserGroupElement extends UmbContextProviderMixin( { type: 'workspaceAction', alias: 'Umb.WorkspaceAction.UserGroup.Save', - name: 'WorkspaceActionUserGroupSave', - loader: () => import('./actions/workspace-action-user-group-save.element'), + name: 'Save User Group Workspace Action', + loader: () => import('../shared/actions/save/workspace-action-node-save.element'), meta: { workspaces: ['Umb.Workspace.UserGroup'], }, diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/user/workspace-user.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/user/workspace-user.element.ts index eb57d33453..84b3b24f67 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/user/workspace-user.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/workspaces/user/workspace-user.element.ts @@ -161,8 +161,8 @@ export class UmbWorkspaceUserElement extends UmbContextProviderMixin( { type: 'workspaceAction', alias: 'Umb.WorkspaceAction.User.Save', - name: 'WorkspaceActionUserSave', - loader: () => import('./actions/workspace-action-user-save.element'), + name: 'Save User Workspace Action', + loader: () => import('../shared/actions/save/workspace-action-node-save.element'), meta: { workspaces: ['Umb.Workspace.User'], },