completes U4-2706 Change form watching in the validators over to use functions , test using other manifest property editors as parameter editors, fixes up validation in the dialog.

This commit is contained in:
Shannon
2013-09-20 17:00:34 +10:00
parent 7396b01466
commit 7037f0626a
12 changed files with 125 additions and 73 deletions

View File

@@ -27,7 +27,20 @@ namespace Umbraco.Web.Models.Mapping
.ConvertUsing(macro => macro.Properties.Select(Mapper.Map<MacroParameter>).ToList());
config.CreateMap<IMacroProperty, MacroParameter>()
.ForMember(parameter => parameter.View, expression => expression.ResolveUsing<ParameterEditorViewResolver>());
.AfterMap((property, parameter) =>
{
//map the view and the config
var paramEditor = ParameterEditorResolver.Current.GetByAlias(property.EditorAlias);
if (paramEditor == null)
{
throw new InvalidOperationException("Could not resolve macro parameter editor: " + property.EditorAlias);
}
parameter.View = paramEditor.ValueEditor.View;
//set the config
parameter.Configuration = paramEditor.Configuration;
});
}