Skip to content
This repository has been archived by the owner on Jun 18, 2018. It is now read-only.

Commit

Permalink
Merge pull request #112 from umco/develop
Browse files Browse the repository at this point in the history
Preparing for v0.4.0 release
  • Loading branch information
leekelleher authored Mar 18, 2017
2 parents 99ebbf7 + b58aca2 commit c38c11a
Show file tree
Hide file tree
Showing 19 changed files with 265 additions and 114 deletions.
2 changes: 2 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
The MIT License (MIT)

Copyright © 2014 Umbrella Inc, Our Umbraco and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Nested Content

[![Build status](https://img.shields.io/appveyor/ci/leekelleher/umbraco-nested-content.svg)](https://ci.appveyor.com/project/leekelleher/umbraco-nested-content)
[![Build status](https://img.shields.io/appveyor/ci/UMCO/umbraco-nested-content.svg)](https://ci.appveyor.com/project/UMCO/umbraco-nested-content)
[![NuGet release](https://img.shields.io/nuget/v/Our.Umbraco.NestedContent.svg)](https://www.nuget.org/packages/Our.Umbraco.NestedContent)
[![Our Umbraco project page](https://img.shields.io/badge/our-umbraco-orange.svg)](https://our.umbraco.org/projects/backoffice-extensions/nested-content)
[![Chat on Gitter](https://img.shields.io/badge/gitter-join_chat-green.svg)](https://gitter.im/leekelleher/umbraco-nested-content)
Expand All @@ -21,7 +21,7 @@ Nested Content can be installed from either Our Umbraco or NuGet package reposit

To install from Our Umbraco, please download the package from:

> [https://our.umbraco.org/projects/backoffice-extensions/nested-content](https://our.umbraco.org/projects/backoffice-extensions/nested-content)
> <https://our.umbraco.org/projects/backoffice-extensions/nested-content>
#### NuGet package repository

Expand All @@ -39,7 +39,7 @@ If you prefer, you can compile Nested Content yourself, you'll need:

To clone it locally click the "Clone in Windows" button above or run the following git commands.

git clone https://github.com/leekelleher/umbraco-nested-content.git umbraco-nested-content
git clone https://github.com/umco/umbraco-nested-content.git umbraco-nested-content
cd umbraco-nested-content
.\build.cmd

Expand All @@ -55,14 +55,16 @@ A PDF download is also available: [Nested Content - Developers Guide v1.0.pdf](d

## Known Issues

Please be aware that not all property-editors will work within Nested Content. The following property-editors are known to have compatibility issues:
Please be aware that not all property-editors will work within Nested Content. The following Umbraco core property-editors are known to have compatibility issues:

* Checkbox List (default Umbraco core)
* Image Cropper (default Umbraco core)
* Macro Container (default Umbraco core)
* Radiobutton List (default Umbraco core)
* Repeatable Textstring (default Umbraco core) - this works in the back-office, but due to a bug in the value-converter it will produce additional blank entries
* Upload (default Umbraco core)
* Checkbox List
* Dropdown List Multiple
* Image Cropper
* Macro Container
* Radiobutton List
* Repeatable Textstring - _this works in the back-office, but due to a bug in the value-converter it will produce additional blank entries_
* Tags - _this appears to work, but by design it is intended to work once per page_
* Upload

---

Expand All @@ -80,7 +82,7 @@ Anyone and everyone is welcome to contribute. Please take a moment to review the
Have a question?

* [Nested Content Forum](https://our.umbraco.org/projects/backoffice-extensions/nested-content/nested-content-feedback) on Our Umbraco
* [Raise an issue](https://github.com/leekelleher/umbraco-nested-content/issues) on GitHub
* [Raise an issue](https://github.com/umco/umbraco-nested-content/issues) on GitHub


## Dev Team
Expand All @@ -95,6 +97,6 @@ Have a question?

## License

Copyright &copy; 2015 Umbrella Inc, Our Umbraco and [other contributors](https://github.com/leekelleher/umbraco-nested-content/graphs/contributors)
Copyright &copy; 2015 Umbrella Inc, Our Umbraco and [other contributors](https://github.com/umco/umbraco-nested-content/graphs/contributors)

Licensed under the [MIT License](LICENSE.md)
20 changes: 5 additions & 15 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# version format
version: 0.3.0.{build}
version: 0.4.0.{build}

# UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha
# example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta
Expand All @@ -17,30 +17,20 @@ artifacts:
- path: artifacts\*.zip

deploy:
# MyGet (Nested Content feed) Deployment for builds & releases
- provider: NuGet
server: https://www.myget.org/F/umbraco-nested-content/
symbol_server: https://nuget.symbolsource.org/MyGet/umbraco-nested-content
api_key:
secure: Q1/4K8VSwr7BjwmKDTef8y5lOc7S+jK9ELuWy67y6OVRpjxmnF9M3Gfs1kT+ir8x
artifact: /.*\.nupkg/
on:
branch: develop

# MyGet (Umbraco Community feed) Deployment for builds & releases
# MyGet Deployment for builds & releases
- provider: NuGet
server: https://www.myget.org/F/umbraco-packages/
symbol_server: https://nuget.symbolsource.org/MyGet/umbraco-packages
api_key:
secure: Q1/4K8VSwr7BjwmKDTef8y5lOc7S+jK9ELuWy67y6OVRpjxmnF9M3Gfs1kT+ir8x
secure: 36/Ax5O+e6wENlhoTwgvoEBZV3FG4XjF429SNTej2qsGTAL+cdfA1kT/tm1St8vx
artifact: /.*\.nupkg/
on:
branch: develop

# GitHub Deployment for releases
- provider: GitHub
auth_token:
secure: pEozEGTqJutQwOidJU6BTB+Ix0NV4vrUnomhfeqheVz4RNwfxjEYLoqR4XabhlPz
secure: yDxrRTveSScJA35MQTOaLYVjoPKFKl2bHBkG+JMZjiN0r7AfuUCxVU3CgW8Imu4h
artifact: /.*\.zip/ # upload all Zip packages to release assets
draft: false
prerelease: false
Expand All @@ -52,7 +42,7 @@ deploy:
- provider: NuGet
server:
api_key:
secure: CGzDKxw4QI/z2VSe9ceiYlIabqGXHolgBgVNWWZjVAJ2V5WLF11IFdlp9r5Qp+Sw
secure: eSLiOXbGVrxSG+X7PV6qTTUZ5VzS9EFj5+EufaWPfd+QXkF6gc8rZ4mGoHIVp/fL
artifact: /.*\.nupkg/
on:
branch: master
Expand Down
8 changes: 4 additions & 4 deletions build/package.proj
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
<MinUmbracoVersion>7.1.4</MinUmbracoVersion>
<Readme>Nested Content is a list editing property editor for Umbraco 7.1+</Readme>
<AuthorName>Matt Brailsford, Lee Kelleher</AuthorName>
<AuthorUrl>https://github.com/leekelleher/umbraco-nested-content/graphs/contributors</AuthorUrl>
<AuthorUrl>https://github.com/umco/umbraco-nested-content/graphs/contributors</AuthorUrl>
<PackageLicenseName>MIT license</PackageLicenseName>
<PackageLicenseUrl>http://opensource.org/licenses/MIT</PackageLicenseUrl>
<ProjectUrl>https://github.com/leekelleher/umbraco-nested-content</ProjectUrl>
<ProjectUrl>https://github.com/umco/umbraco-nested-content</ProjectUrl>
</PropertyGroup>

<!-- NUGET ONLY PROPERTIES -->
<PropertyGroup>
<PackageId>Our.Umbraco.NestedContent</PackageId>
<NuGetPackageName>Umbraco Nested Content</NuGetPackageName>
<Copyright>Copyright &#169; 2015 Matt Brailsford, Lee Kelleher, Our Umbraco and other contributors</Copyright>
<NuGetPackageName>Nested Content for Umbraco</NuGetPackageName>
<Copyright>Copyright &#169; 2015 Umbrella Inc, Our Umbraco and other contributors</Copyright>
<Owners>Matt Brailsford, Lee Kelleher</Owners>
<IconUrl>https://our.umbraco.org/media/wiki/145710/635623752021571595_ncpng.png</IconUrl>
<Tags>umbraco list editor</Tags>
Expand Down
8 changes: 4 additions & 4 deletions docs/developers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ The prevalue editor allows you to configure the following properties.

| Member | Type | Description |
|-----------------|---------|-------------|
| Doc Types | List | Defines a list of doc types to use as data blue prints for this **Nested Content** instance. For each doc type you can provide the alias of the tab you wish to render (first tab is used by default if not set) as well as a template for generating list item labels using the syntax `{{propertyAlias}}`. |
| Min Items | Int | Sets the minimum number of items that should be allowed in the list. If greater than 0, **Nested Content** will pre-populate your list with the minimum amount of allowed items and prevent deleting items below this level. Defaults to 0.
| Max Itemd | Int | Sets the maximum number of items that should be allowed in the list. If greater than 0, **Nested Content** will prevent new items being added to the list above this threshold. Defaults to 0. |
| Confirm Deletes | Boolean | Enabling this will require item deletions to require a confirmation before being deleted. Defaults to TRUE |
| Doc Types | List | Defines a list of doc types to use as data blue prints for this **Nested Content** instance. For each doc type you can provide the alias of the tab you wish to render (first tab is used by default if not set) as well as a template for generating list item labels using the syntax `{{propertyAlias}}`. If you would like to include the index position in the label, you can use `{{$index}}`. |
| Min Items | Integer | Sets the minimum number of items that should be allowed in the list. If greater than `0`, **Nested Content** will pre-populate your list with the minimum amount of allowed items and prevent deleting items below this level. Defaults to `0`.
| Max Items | Integer | Sets the maximum number of items that should be allowed in the list. If greater than `0`, **Nested Content** will prevent new items being added to the list above this threshold. Defaults to `0`. |
| Confirm Deletes | Boolean | Enabling this will require item deletions to require a confirmation before being deleted. Defaults to `true`. |
| Show Icons | Boolean | Enabling this will display the items doc type icon next to the name in the **Nested Content** list. |
| Hide Label | Boolean | Enabling this will hide the property editors label and expand the **Nested Content** property editor to the full with of the editor window. |

Expand Down
7 changes: 3 additions & 4 deletions src/Our.Umbraco.NestedContent.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CEE9961C-D747-40CD-B0B2-868D6B46833E}"
ProjectSection(SolutionItems) = preProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public override object ConvertDataToSource(PublishedPropertyType propertyType, o
{
try
{
return propertyType.ConvertPropertyToNestedContent(source);
return propertyType.ConvertPropertyToNestedContent(source, preview);
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public override object ConvertDataToSource(PublishedPropertyType propertyType, o
{
try
{
return propertyType.ConvertPropertyToNestedContent(source);
return propertyType.ConvertPropertyToNestedContent(source, preview);
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static bool IsSingleNestedContentProperty(this PublishedPropertyType publ
int.TryParse(preValueDictionary["maxItems"], out maxItems) && maxItems == 1;
}

public static object ConvertPropertyToNestedContent(this PublishedPropertyType propertyType, object source)
public static object ConvertPropertyToNestedContent(this PublishedPropertyType propertyType, object source, bool preview)
{
using (DisposableTimer.DebugDuration<PublishedPropertyType>(string.Format("ConvertPropertyToNestedContent ({0})", propertyType.DataTypeId)))
{
Expand Down Expand Up @@ -78,7 +78,7 @@ public static object ConvertPropertyToNestedContent(this PublishedPropertyType p
var propType = publishedContentType.GetPropertyType(jProp.Key);
if (propType != null)
{
properties.Add(new DetachedPublishedProperty(propType, jProp.Value));
properties.Add(new DetachedPublishedProperty(propType, jProp.Value, preview));
}
}

Expand All @@ -98,7 +98,8 @@ public static object ConvertPropertyToNestedContent(this PublishedPropertyType p
publishedContentType,
properties.ToArray(),
containerNode,
i));
i,
preview));
}

if (propertyType.IsSingleNestedContentProperty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="Web\UI\App_Plugins\NestedContent\Js\nestedcontent.filters.js" />
<Content Include="Web\UI\App_Plugins\NestedContent\Js\nestedcontent.controllers.js" />
<Content Include="Web\UI\App_Plugins\NestedContent\Js\nestedcontent.directives.js" />
<Content Include="Web\UI\App_Plugins\NestedContent\Js\nestedcontent.resources.js" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -46,7 +47,7 @@ public NestedContentPropertyEditor()

protected override PreValueEditor CreatePreValueEditor()
{
return new NestedContentPreValueEditor();
return new NestedContentPreValueEditor();
}

internal class NestedContentPreValueEditor : PreValueEditor
Expand Down Expand Up @@ -160,15 +161,26 @@ public override string ConvertDbToString(Property property, PropertyType propert
}
else
{
// Create a fake property using the property abd stored value
var prop = new Property(propType, propValues[propKey] == null ? null : propValues[propKey].ToString());
try
{
// Create a fake property using the property abd stored value
var prop = new Property(propType, propValues[propKey] == null ? null : propValues[propKey].ToString());

// Lookup the property editor
var propEditor = PropertyEditorResolver.Current.GetByAlias(propType.PropertyEditorAlias);
// Lookup the property editor
var propEditor = PropertyEditorResolver.Current.GetByAlias(propType.PropertyEditorAlias);

// Get the editor to do it's conversion, and store it back
propValues[propKey] = propEditor.ValueEditor.ConvertDbToString(prop, propType,
ApplicationContext.Current.Services.DataTypeService);
// Get the editor to do it's conversion, and store it back
propValues[propKey] = propEditor.ValueEditor.ConvertDbToString(prop, propType,
ApplicationContext.Current.Services.DataTypeService);
}
catch (InvalidOperationException)
{
// https://github.com/umco/umbraco-nested-content/issues/111
// Catch any invalid cast operations as likely means courier failed due to missing
// or trashed item so couldn't convert a guid back to an int

propValues[propKey] = null;
}
}

}
Expand Down Expand Up @@ -225,18 +237,29 @@ public override object ConvertDbToEditor(Property property, PropertyType propert
}
else
{
// Create a fake property using the property abd stored value
var prop = new Property(propType, propValues[propKey] == null ? null : propValues[propKey].ToString());
try
{
// Create a fake property using the property abd stored value
var prop = new Property(propType, propValues[propKey] == null ? null : propValues[propKey].ToString());

// Lookup the property editor
var propEditor = PropertyEditorResolver.Current.GetByAlias(propType.PropertyEditorAlias);
// Lookup the property editor
var propEditor = PropertyEditorResolver.Current.GetByAlias(propType.PropertyEditorAlias);

// Get the editor to do it's conversion
var newValue = propEditor.ValueEditor.ConvertDbToEditor(prop, propType,
ApplicationContext.Current.Services.DataTypeService);
// Get the editor to do it's conversion
var newValue = propEditor.ValueEditor.ConvertDbToEditor(prop, propType,
ApplicationContext.Current.Services.DataTypeService);

// Store the value back
propValues[propKey] = (newValue == null) ? null : JToken.FromObject(newValue);
// Store the value back
propValues[propKey] = (newValue == null) ? null : JToken.FromObject(newValue);
}
catch (InvalidOperationException)
{
// https://github.com/umco/umbraco-nested-content/issues/111
// Catch any invalid cast operations as likely means courier failed due to missing
// or trashed item so couldn't convert a guid back to an int

propValues[propKey] = null;
}
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Our.Umbraco.NestedContent.Extensions;
using Umbraco.Web.Editors;
using Umbraco.Web.Mvc;
using System.Web.Http.ModelBinding;

namespace Our.Umbraco.NestedContent.Web.Controllers
{
Expand Down
Loading

0 comments on commit c38c11a

Please sign in to comment.