Management API: Property editor temporary file handling (#14244)
* Use new temporary files handling for property editors * Add compat suppressions * Add missing compat suppressions * Don't discard valid file upload values * Rename cuid and puid to contentKey and propertyTypeKey * Update src/Umbraco.Infrastructure/PropertyEditors/MediaPicker3PropertyEditor.cs Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> * Fetch user async + remove unnecessary dependency --------- Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
This commit is contained in:
@@ -11,8 +11,6 @@ namespace Umbraco.Cms.Core.Models.ContentEditing;
|
||||
public abstract class ContentBaseSave<TPersisted> : ContentItemBasic<ContentPropertyBasic>, IContentSave<TPersisted>
|
||||
where TPersisted : IContentBase
|
||||
{
|
||||
protected ContentBaseSave() => UploadedFiles = new List<ContentPropertyFile>();
|
||||
|
||||
#region IContentSave
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -27,9 +25,6 @@ public abstract class ContentBaseSave<TPersisted> : ContentItemBasic<ContentProp
|
||||
set => base.Properties = value;
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public List<ContentPropertyFile> UploadedFiles { get; }
|
||||
|
||||
// These need explicit implementation because we are using internal models
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -12,7 +12,6 @@ public class ContentItemSave : IContentSave<IContent>
|
||||
{
|
||||
public ContentItemSave()
|
||||
{
|
||||
UploadedFiles = new List<ContentPropertyFile>();
|
||||
Variants = new List<ContentVariantSave>();
|
||||
}
|
||||
|
||||
@@ -43,9 +42,6 @@ public class ContentItemSave : IContentSave<IContent>
|
||||
[Required]
|
||||
public ContentSaveAction Action { get; set; }
|
||||
|
||||
[IgnoreDataMember]
|
||||
public List<ContentPropertyFile> UploadedFiles { get; }
|
||||
|
||||
// These need explicit implementation because we are using internal models
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Cms.Core.Models.ContentEditing;
|
||||
/// logic
|
||||
/// </summary>
|
||||
/// <typeparam name="TPersisted"></typeparam>
|
||||
public interface IContentSave<TPersisted> : IHaveUploadedFiles
|
||||
public interface IContentSave<TPersisted>
|
||||
where TPersisted : IContentBase
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
using Umbraco.Cms.Core.Models.Editors;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models.ContentEditing;
|
||||
|
||||
public interface IHaveUploadedFiles
|
||||
{
|
||||
List<ContentPropertyFile> UploadedFiles { get; }
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Cms.Core.Models.Editors;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models.ContentEditing;
|
||||
|
||||
/// <summary>
|
||||
/// This is used for the response of PostAddFile so that we can analyze the response in a filter and remove the
|
||||
/// temporary files that were created.
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class PostedFiles : IHaveUploadedFiles, INotificationModel
|
||||
{
|
||||
public PostedFiles()
|
||||
{
|
||||
UploadedFiles = new List<ContentPropertyFile>();
|
||||
Notifications = new List<BackOfficeNotification>();
|
||||
}
|
||||
|
||||
public List<ContentPropertyFile> UploadedFiles { get; }
|
||||
|
||||
[DataMember(Name = "notifications")]
|
||||
public List<BackOfficeNotification> Notifications { get; private set; }
|
||||
}
|
||||
Reference in New Issue
Block a user