Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Umbraco.Core/Constants-PropertyEditors.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.ComponentModel;
using Umbraco.Cms.Core.PropertyEditors;

namespace Umbraco.Cms.Core;
Expand Down Expand Up @@ -43,6 +44,7 @@ public static class Aliases
/// <summary>
/// Block Grid.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)] // TODO: Remove this for V11/V10.4
public const string BlockGrid = "Umbraco.BlockGrid";

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/Umbraco.Core/Models/Blocks/BlockGridArea.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.

using System.ComponentModel;
using System.Runtime.Serialization;

namespace Umbraco.Cms.Core.Models.Blocks;

[DataContract(Name = "area", Namespace = "")]
[EditorBrowsable(EditorBrowsableState.Never)] // TODO: Remove this for V11/V10.4
public class BlockGridArea : BlockModelCollection<BlockGridItem>
{
/// <summary>
Expand Down
8 changes: 5 additions & 3 deletions src/Umbraco.Core/Models/Blocks/BlockGridItem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.

using System.ComponentModel;
using System.Runtime.Serialization;
using Umbraco.Cms.Core.Models.PublishedContent;

Expand All @@ -9,8 +10,9 @@ namespace Umbraco.Cms.Core.Models.Blocks
/// <summary>
/// Represents a layout item for the Block Grid editor.
/// </summary>
/// <seealso cref="Umbraco.Core.Models.Blocks.IBlockReference{Umbraco.Core.Models.PublishedContent.IPublishedElement,Umbraco.Core.Models.PublishedContent.IPublishedElement}" />
/// <seealso cref="IPublishedElement" />
Comment thread
nikolajlauridsen marked this conversation as resolved.
Outdated
[DataContract(Name = "block", Namespace = "")]
[EditorBrowsable(EditorBrowsableState.Never)] // TODO: Remove this for V11/V10.4
public class BlockGridItem : IBlockReference<IPublishedElement, IPublishedElement>
{
/// <summary>
Expand Down Expand Up @@ -116,7 +118,7 @@ public BlockGridItem(Udi contentUdi, IPublishedElement content, Udi settingsUdi,
/// Represents a layout item with a generic content type for the Block List editor.
/// </summary>
/// <typeparam name="T">The type of the content.</typeparam>
/// <seealso cref="Umbraco.Core.Models.Blocks.IBlockReference{Umbraco.Core.Models.PublishedContent.IPublishedElement}" />
/// <seealso cref="IPublishedElement" />
Comment thread
nikolajlauridsen marked this conversation as resolved.
Outdated
public class BlockGridItem<T> : BlockGridItem
where T : IPublishedElement
{
Expand Down Expand Up @@ -149,7 +151,7 @@ public BlockGridItem(Udi contentUdi, T content, Udi settingsUdi, IPublishedEleme
/// </summary>
/// <typeparam name="TContent">The type of the content.</typeparam>
/// <typeparam name="TSettings">The type of the settings.</typeparam>
/// <seealso cref="Umbraco.Core.Models.Blocks.IBlockReference{Umbraco.Core.Models.PublishedContent.IPublishedElement}" />
/// <seealso cref="IPublishedElement" />
Comment thread
nikolajlauridsen marked this conversation as resolved.
Outdated
public class BlockGridItem<TContent, TSettings> : BlockGridItem<TContent>
where TContent : IPublishedElement
where TSettings : IPublishedElement
Expand Down
2 changes: 2 additions & 0 deletions src/Umbraco.Core/Models/Blocks/BlockGridModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See LICENSE for more details.

using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace Umbraco.Cms.Core.Models.Blocks;
Expand All @@ -11,6 +12,7 @@ namespace Umbraco.Cms.Core.Models.Blocks;
/// </summary>
/// <seealso cref="ReadOnlyCollection{BlockGridItem}" />
[DataContract(Name = "blockgrid", Namespace = "")]
[EditorBrowsable(EditorBrowsableState.Never)] // TODO: Remove this for V11/V10.4
public class BlockGridModel : BlockModelCollection<BlockGridItem>
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.

using System.ComponentModel;
using Newtonsoft.Json.Linq;
using Umbraco.Cms.Core.Serialization;

Expand All @@ -9,6 +10,7 @@ namespace Umbraco.Cms.Core.Models.Blocks;
/// <summary>
/// Data converter for the block grid property editor
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)] // TODO: Remove this for V11/V10.4
public class BlockGridEditorDataConverter : BlockEditorDataConverter
{
private readonly IJsonSerializer _jsonSerializer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using Newtonsoft.Json;
using System.ComponentModel;
using Newtonsoft.Json;

namespace Umbraco.Cms.Core.Models.Blocks;

[EditorBrowsable(EditorBrowsableState.Never)] // TODO: Remove this for V11/V10.4
public class BlockGridLayoutAreaItem
{
[JsonProperty("key", NullValueHandling = NullValueHandling.Ignore)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.

using System.ComponentModel;
using Newtonsoft.Json;
using Umbraco.Cms.Infrastructure.Serialization;

Expand All @@ -9,6 +10,7 @@ namespace Umbraco.Cms.Core.Models.Blocks;
/// <summary>
/// Used for deserializing the block grid layout
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)] // TODO: Remove this for V11/V10.4
public class BlockGridLayoutItem : IBlockLayoutItem
{
[JsonProperty("contentUdi", Required = Required.Always)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.

using System.ComponentModel;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.IO;

namespace Umbraco.Cms.Core.PropertyEditors;

/// <summary>
/// Represents a block list property editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.BlockGrid,
"Block Grid",
"blockgrid",
ValueType = ValueTypes.Json,
Group = Constants.PropertyEditors.Groups.RichContent,
Icon = "icon-layout")]
// TODO: Re-add this DataEditor attribute to re-enable the BlockGridEditor for V11/V10.4
// [DataEditor(
// Constants.PropertyEditors.Aliases.BlockGrid,
// "Block Grid",
// "blockgrid",
// ValueType = ValueTypes.Json,
// Group = Constants.PropertyEditors.Groups.RichContent,
// Icon = "icon-layout")]
[HideFromTypeFinder]
[EditorBrowsable(EditorBrowsableState.Never)]
public class BlockGridPropertyEditor : BlockGridPropertyEditorBase
{
private readonly IIOHelper _ioHelper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.

using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Blocks;
Expand All @@ -16,7 +18,9 @@ namespace Umbraco.Cms.Core.PropertyEditors;

/// <summary>
/// Abstract base class for block grid based editors.
/// </summary>
// /// </summary>
[HideFromTypeFinder]
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class BlockGridPropertyEditorBase : DataEditor
{
protected BlockGridPropertyEditorBase(IDataValueEditorFactory dataValueEditorFactory)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.

using System.ComponentModel;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;
using Umbraco.Cms.Core.Models.Blocks;
using Umbraco.Cms.Core.Models.PublishedContent;

namespace Umbraco.Extensions;

[EditorBrowsable(EditorBrowsableState.Never)]
public static class BlockGridTemplateExtensions
{
public const string DefaultFolder = "blockgrid/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ public void Resolves_Types()
public void GetDataEditors()
{
var types = _typeLoader.GetDataEditors();
Assert.AreEqual(42, types.Count());
// TODO: Increase this to 42 when BlockGridEditor is re-added
Assert.AreEqual(41, types.Count());
}

/// <summary>
Expand Down