From 3ee43e2f1d03d780f94affbe585298f0fe569d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 20 Nov 2024 10:53:56 +0100 Subject: [PATCH] only skip validation for documents --- .../workspace/content-detail-workspace-base.ts | 17 ++--------------- .../workspace/document-workspace.context.ts | 13 +++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/content-detail-workspace-base.ts b/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/content-detail-workspace-base.ts index bd3b2f9517..814ffafd88 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/content-detail-workspace-base.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/content-detail-workspace-base.ts @@ -470,24 +470,11 @@ export abstract class UmbContentDetailWorkspaceContextBase< } } - /** - * Request a submit of the workspace, in the case of Content Workspaces the validation does not need to be valid for this to be submitted. - * @returns {Promise} a promise which resolves once it has been completed. - */ - public override requestSubmit() { - return this.#handleSubmit(); - } - public override submit() { - return this.#handleSubmit(); + return this._handleSubmit(); } - // Because we do not make validation prevent submission this also submits the workspace. [NL] - public override invalidSubmit() { - return this.#handleSubmit(); - } - - async #handleSubmit() { + protected async _handleSubmit() { const data = this.getData(); if (!data) { throw new Error('Data is missing'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace.context.ts index 44afaabd8e..e77dac1867 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace.context.ts @@ -208,6 +208,19 @@ export class UmbDocumentWorkspaceContext this._data.updateCurrent({ template: { unique: templateUnique } }); } + /** + * Request a submit of the workspace, in the case of Document Workspaces the validation does not need to be valid for this to be submitted. + * @returns {Promise} a promise which resolves once it has been completed. + */ + public override requestSubmit() { + return this._handleSubmit(); + } + + // Because we do not make validation prevent submission this also submits the workspace. [NL] + public override invalidSubmit() { + return this._handleSubmit(); + } + async #handleSaveAndPreview() { const unique = this.getUnique(); if (!unique) throw new Error('Unique is missing');