Add additional preview URLs option (#14479)
This commit is contained in:
@@ -14,6 +14,7 @@ public class ContentVariantDisplay : ITabbedContent<ContentPropertyDisplay>, ICo
|
||||
Tabs = new List<Tab<ContentPropertyDisplay>>();
|
||||
Notifications = new List<BackOfficeNotification>();
|
||||
AllowedActions = Enumerable.Empty<string>();
|
||||
AdditionalPreviewUrls = Enumerable.Empty<NamedUrl>();
|
||||
}
|
||||
|
||||
[DataMember(Name = "allowedActions", IsRequired = true)]
|
||||
@@ -72,6 +73,9 @@ public class ContentVariantDisplay : ITabbedContent<ContentPropertyDisplay>, ICo
|
||||
/// </summary>
|
||||
[DataMember(Name = "tabs")]
|
||||
public IEnumerable<Tab<ContentPropertyDisplay>> Tabs { get; set; }
|
||||
|
||||
[DataMember(Name = "additionalPreviewUrls")]
|
||||
public IEnumerable<NamedUrl> AdditionalPreviewUrls { get; set; }
|
||||
}
|
||||
|
||||
public class ContentVariantScheduleDisplay : ContentVariantDisplay
|
||||
|
||||
13
src/Umbraco.Core/Models/ContentEditing/NamedUrl.cs
Normal file
13
src/Umbraco.Core/Models/ContentEditing/NamedUrl.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models.ContentEditing;
|
||||
|
||||
[DataContract(Name = "namedUrl", Namespace = "")]
|
||||
public class NamedUrl
|
||||
{
|
||||
[DataMember(Name = "name")]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[DataMember(Name = "url")]
|
||||
public required string Url { get; set; }
|
||||
}
|
||||
@@ -127,6 +127,7 @@ internal class ContentMapDefinition : IMapDefinition
|
||||
target.Tabs = source.Tabs;
|
||||
target.UpdateDate = source.UpdateDate;
|
||||
target.AllowedActions = source.AllowedActions;
|
||||
target.AdditionalPreviewUrls = source.AdditionalPreviewUrls;
|
||||
}
|
||||
|
||||
// Umbraco.Code.MapAll
|
||||
@@ -189,6 +190,7 @@ internal class ContentMapDefinition : IMapDefinition
|
||||
target.Tabs = source.Tabs;
|
||||
target.UpdateDate = source.UpdateDate;
|
||||
target.AllowedActions = source.AllowedActions;
|
||||
target.AdditionalPreviewUrls = source.AdditionalPreviewUrls;
|
||||
|
||||
// We'll only try and map the ReleaseDate/ExpireDate if the "old" ContentVariantScheduleDisplay is in the context, otherwise we'll just skip it quietly.
|
||||
_ = context.Items.TryGetValue(nameof(ContentItemDisplayWithSchedule.Variants), out var variants);
|
||||
@@ -352,7 +354,7 @@ internal class ContentMapDefinition : IMapDefinition
|
||||
return result;
|
||||
}
|
||||
|
||||
// Umbraco.Code.MapAll -Segment -Language -DisplayName
|
||||
// Umbraco.Code.MapAll -Segment -Language -DisplayName -AdditionalPreviewUrls
|
||||
private void Map(IContent source, ContentVariantDisplay target, MapperContext context)
|
||||
{
|
||||
target.CreateDate = source.CreateDate;
|
||||
|
||||
Reference in New Issue
Block a user