Skip to content

Commit

Permalink
Merge pull request #6149 from umbraco/v8/feature/5335-multi-media-pic…
Browse files Browse the repository at this point in the history
…ker-parameter-editor

Fix #5335 - Multiple Media Picker not available as macro parameter
  • Loading branch information
Warren Buckley committed Aug 21, 2019
2 parents e4f19f7 + 82e11d7 commit 445e6d4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Umbraco.Core/Constants-PropertyEditors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public static class Aliases
/// </summary>
public const string MediaPicker = "Umbraco.MediaPicker";

/// <summary>
/// Multiple Media Picker.
/// </summary>
public const string MultipleMediaPicker = "Umbraco.MultipleMediaPicker";

/// <summary>
/// Member Picker.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Umbraco.Tests/Composing/TypeLoaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public void Resolves_Types()
public void GetDataEditors()
{
var types = _typeLoader.GetDataEditors();
Assert.AreEqual(38, types.Count());
Assert.AreEqual(39, types.Count());
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;

namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
/// <summary>
/// Represents a multiple media picker macro parameter editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.MultipleMediaPicker,
EditorType.MacroParameter,
"Multiple Media Picker",
"mediapicker",
ValueType = ValueTypes.Text)]
public class MultipleMediaPickerParameterEditor : DataEditor
{
/// <summary>
/// Initializes a new instance of the <see cref="MultipleMediaPickerParameterEditor"/> class.
/// </summary>
public MultipleMediaPickerParameterEditor(ILogger logger)
: base(logger)
{
DefaultConfiguration.Add("multiPicker", "1");
}
}
}
1 change: 1 addition & 0 deletions src/Umbraco.Web/Umbraco.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
<Compile Include="Mvc\SurfaceControllerTypeCollectionBuilder.cs" />
<Compile Include="Mvc\ValidateUmbracoFormRouteStringAttribute.cs" />
<Compile Include="Profiling\WebProfilingController.cs" />
<Compile Include="PropertyEditors\ParameterEditors\MultipleMediaPickerParameterEditor.cs" />
<Compile Include="PublishedCache\NuCache\PublishedSnapshotServiceOptions.cs" />
<Compile Include="PublishedCache\NuCache\Snap\GenObj.cs" />
<Compile Include="PublishedCache\NuCache\Snap\GenRef.cs" />
Expand Down

0 comments on commit 445e6d4

Please sign in to comment.