Commit a0a2c735 authored by Mikael Lindemann's avatar Mikael Lindemann
Browse files

Now supports Umbraco 8.1.0+

parent 0ad47dcf
......@@ -24,7 +24,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="UmbracoCms.Core" Version="8.0.0" />
<PackageReference Include="UmbracoCms.Core" Version="8.1.0" />
</ItemGroup>
<ItemGroup>
......
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.PropertyEditors.ValueConverters;
namespace Appstract.UmbracoContactNumber
{
public class ContactNumberUserComposer : IUserComposer
{
public void Compose(Composition composition)
{
var converters = composition.PropertyValueConverters();
if (converters.Has<JsonValueConverter>())
{
composition.PropertyValueConverters().InsertBefore<JsonValueConverter, ContactNumberValueConverter>();
}
}
}
}
......@@ -7,19 +7,18 @@ namespace Appstract.UmbracoContactNumber
{
public class ContactNumberValueConverter : PropertyValueConverterBase
{
public override object ConvertIntermediateToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
public override object ConvertIntermediateToObject(IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
return inter;
}
public override object ConvertIntermediateToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
public override object ConvertIntermediateToXPath(IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
return null;
}
public override object ConvertSourceToIntermediate(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
public override object ConvertSourceToIntermediate(IPublishedElement owner, IPublishedPropertyType propertyType, object source, bool preview)
{
if (!(source is string s))
{
return null;
......@@ -28,17 +27,17 @@ namespace Appstract.UmbracoContactNumber
return JsonConvert.DeserializeObject<ContactNumber>(s);
}
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
public override PropertyCacheLevel GetPropertyCacheLevel(IPublishedPropertyType propertyType)
{
return PropertyCacheLevel.Element;
}
public override Type GetPropertyValueType(PublishedPropertyType propertyType)
public override Type GetPropertyValueType(IPublishedPropertyType propertyType)
{
return typeof(ContactNumber);
}
public override bool IsConverter(PublishedPropertyType propertyType)
public override bool IsConverter(IPublishedPropertyType propertyType)
{
return propertyType.EditorAlias.Equals("AppstractUmbracoContactNumber");
}
......
......@@ -47,7 +47,7 @@
<url>https://gitlab.dev.appstract.dk/internal/umbracocontactnumber</url>
<requirements>
<major>8</major>
<minor>0</minor>
<minor>1</minor>
<patch>0</patch>
</requirements>
</package>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment