Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Saveable workspace interface + token #19220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: release/16.0
Choose a base branch
from

Conversation

nielslyngsoe
Copy link
Member

Implements a Saveable Workspace Interface and Token to enable just saving without submitting. Because Submit closes the modal, and we do not want to close the modal in Document Workspaces, cause the save method in those are not the primary action and neither is validation preventing the save to be successful, meaning when errors are present we previously just closed the modal. This changes that.

Please test Block Workspaces and others.

@nielslyngsoe nielslyngsoe requested review from Copilot and madsrasmussen and removed request for Copilot May 2, 2025 12:26
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a saveable workspace interface and token to enable a saving action without closing the modal, which is particularly useful for document workspaces when validation errors are present. Key changes include replacing submit actions with save actions, introducing a new context token and interface for saveable workspaces, and updating the content detail workspace to support saving without automatically closing the modal.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/packages/documents/workspace/document-workspace.context.ts Replaces public requestSubmit() with a protected _handleSave() method that calls the parent save handler.
src/packages/documents/workspace/document-workspace.context-token.ts Updates the context token type from UmbSubmittableWorkspaceContext to UmbWorkspaceContext.
src/packages/documents/workspace/actions/save.action.ts Changes the workspace action from submit to save by switching base classes and argument types.
src/packages/core/workspace/submittable/submittable-workspace-context-base.ts Adds a _validateAndLog() method to wrap validation with logging and rejection.
src/packages/core/workspace/contexts/tokens/saveable-workspace.context-token.ts & .../saveable-workspace.context.interface.ts Introduces a saveable workspace context token and interface.
src/packages/core/workspace/components/workspace-action/common/save/* Implements a new save action with context retrieval and execution logic that calls requestSave().
src/packages/content/content/workspace/content-detail-workspace-base.ts Updates the content detail workspace context to implement UmbSaveableWorkspaceContext and distinguishes between saving and submitting, affecting modal closing behavior.
Comments suppressed due to low confidence (1)

src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/content-detail-workspace-base.ts:788

  • Review the contrasting behavior between requestSave (which does not close the modal) and _handleSubmit (which unconditionally calls _closeModal). Confirm that this difference is intentional for UX consistency across different workspace types.
public requestSave() {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant