Skip to content
This repository was archived by the owner on Dec 13, 2021. It is now read-only.

Commit f9bc223

Browse files
authored
Merge pull request #37 from umco/develop
Preparing v2.0.1 release
2 parents e6cae23 + 71d0dbe commit f9bc223

File tree

10 files changed

+45
-11
lines changed

10 files changed

+45
-11
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![NuGet release](https://img.shields.io/nuget/v/Our.Umbraco.InnerContent.svg)](https://www.nuget.org/packages/Our.Umbraco.InnerContent)
55

66

7-
A helper library for Umbraco Doc Type based property editors providing overlays and conversion helpers.
7+
A helper library for Umbraco Content Type based property editors providing overlays and conversion helpers.
88

99
## Getting Started
1010

@@ -39,7 +39,7 @@ To clone it locally click the "Clone in Windows" button above or run the followi
3939

4040
## Known Issues
4141

42-
- _[TBC]_
42+
- _**Please note that the following property aliases are reserved and can not be used in your Content Types:**_ "`name`", "`key`", "`children`" and "`icon`".
4343

4444
---
4545

@@ -48,6 +48,7 @@ To clone it locally click the "Clone in Windows" button above or run the followi
4848
Umbraco packages that use Inner Content as a dependency library.
4949

5050
- [Stacked Content](https://github.com/umco/umbraco-stacked-content)
51+
- [Content List](https://github.com/umco/umbraco-content-list)
5152

5253
---
5354

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
image: Visual Studio 2017
22

33
# version format
4-
version: 2.0.0.{build}
4+
version: 2.0.1.{build}
55

66
# UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha
77
# example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta

build/package.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PropertyGroup>
1919
<ProjectName>Our.Umbraco.InnerContent</ProjectName>
2020
<PackageName>Inner Content</PackageName>
21-
<MinUmbracoVersion>7.4.0</MinUmbracoVersion>
21+
<MinUmbracoVersion>7.7.0</MinUmbracoVersion>
2222
<Readme>Inner Content is a helper package for other Doc Type based property editors</Readme>
2323
<AuthorName>Matt Brailsford, Lee Kelleher</AuthorName>
2424
<AuthorUrl>https://github.com/umco/umbraco-inner-content/graphs/contributors</AuthorUrl>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System.Collections.Generic;
2+
using Umbraco.Core.PropertyEditors;
3+
4+
namespace Our.Umbraco.InnerContent.PropertyEditors
5+
{
6+
public static class PreValueFieldExtensions
7+
{
8+
public static void Add(this List<PreValueField> fields, string key, string name, string view, string description)
9+
{
10+
fields.Add(new PreValueField
11+
{
12+
Key = key,
13+
Name = name,
14+
View = view,
15+
Description = description
16+
});
17+
}
18+
19+
public static void AddHideLabel(this List<PreValueField> fields)
20+
{
21+
fields.Add(new PreValueField
22+
{
23+
Key = InnerContentConstants.HideLabelPreValueKey,
24+
Name = "Hide Label",
25+
View = "boolean",
26+
Description = "Set whether to hide the editor label and have the list take up the full width of the editor window."
27+
});
28+
}
29+
}
30+
}

src/Our.Umbraco.InnerContent/InnerContentConstants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ public static class InnerContentConstants
99
internal const string PreValuesCacheKey = "Our.Umbraco.InnerContent.GetPreValuesCollectionByDataTypeId_{0}";
1010

1111
internal const string ContentTypesPreValueKey = "contentTypes";
12+
13+
internal const string HideLabelPreValueKey = "hideLabel";
1214
}
1315
}

src/Our.Umbraco.InnerContent/Our.Umbraco.InnerContent.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
</ItemGroup>
6868
<ItemGroup>
6969
<Compile Include="Bootstrap.cs" />
70+
<Compile Include="Extensions\PreValueFieldExtensions.cs" />
7071
<Compile Include="ValueConverters\InnerContentValueConverter.cs" />
7172
<Compile Include="Helpers\ContentTypeCacheHelper.cs" />
7273
<Compile Include="Helpers\InnerContentHelper.cs" />

src/Our.Umbraco.InnerContent/PropertyEditors/InnerContentPropertyValueEditor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public override void ConfigureForDisplay(PreValueCollection preValues)
2222
{
2323
base.ConfigureForDisplay(preValues);
2424

25-
if (preValues.PreValuesAsDictionary.ContainsKey("hideLabel"))
25+
if (preValues.PreValuesAsDictionary.ContainsKey(InnerContentConstants.HideLabelPreValueKey))
2626
{
27-
HideLabel = preValues.PreValuesAsDictionary["hideLabel"].Value == "1";
27+
HideLabel = preValues.PreValuesAsDictionary[InnerContentConstants.HideLabelPreValueKey].Value == "1";
2828
}
2929
}
3030

src/Our.Umbraco.InnerContent/Web/Controllers/InnerContentApiController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class InnerContentApiController : UmbracoAuthorizedJsonController
2020
public IEnumerable<object> GetAllContentTypes()
2121
{
2222
return Services.ContentTypeService.GetAllContentTypes()
23-
.OrderBy(x => x.SortOrder)
23+
.OrderBy(x => x.Name)
2424
.Select(x => new
2525
{
2626
id = x.Id,
@@ -35,7 +35,7 @@ public IEnumerable<object> GetAllContentTypes()
3535
[HttpGet]
3636
public IEnumerable<object> GetContentTypesByGuid([ModelBinder] Guid[] guids)
3737
{
38-
var contentTypes = Services.ContentTypeService.GetAllContentTypes(guids).OrderBy(x => x.SortOrder).ToList();
38+
var contentTypes = Services.ContentTypeService.GetAllContentTypes(guids).OrderBy(x => Array.IndexOf(guids, x.Key)).ToList();
3939
var blueprints = Services.ContentService.GetBlueprintsForContentTypes(contentTypes.Select(x => x.Id).ToArray()).ToArray();
4040

4141
// NOTE: Using an anonymous class, as the `ContentTypeBasic` type is heavier than what we need (for our requirements)

src/Our.Umbraco.InnerContent/Web/UI/App_Plugins/InnerContent/views/innercontent.create.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h5 ng-show="selectBlueprint"><localize key="blueprints_selectBlueprint">Select
99

1010
<ul class="umb-actions umb-actions-child" ng-show="selectContentType">
1111

12-
<li data-element="action-create-{{docType.alias}}" ng-repeat="docType in allowedTypes | orderBy:'name':false">
12+
<li data-element="action-create-{{docType.alias}}" ng-repeat="docType in allowedTypes">
1313
<a ng-click="createOrSelectBlueprintIfAny(docType)">
1414
<i class="large {{docType.icon}}"></i>
1515
<span class="menu-label">
@@ -25,7 +25,7 @@ <h5 ng-show="selectBlueprint"><localize key="blueprints_selectBlueprint">Select
2525

2626
<ul class="umb-actions umb-actions-child" ng-show="selectBlueprint">
2727

28-
<li ng-repeat="(key, value) in selectedDocType.blueprints | orderBy:'name':false">
28+
<li ng-repeat="(key, value) in selectedDocType.blueprints">
2929
<a ng-click="createFromBlueprint(selectedDocType.key, key)">
3030
<i class="large {{selectedDocType.icon}}"></i>
3131
<span class="menu-label">

src/Our.Umbraco.InnerContent/Web/UI/App_Plugins/InnerContent/views/innercontent.doctypepicker.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<tr ng-repeat="config in model.value">
2222
<td class="icon icon-navigation"></td>
2323
<td>
24-
<select ng-options="dt.guid as dt.name for dt in vm.docTypes | orderBy: 'name'"
24+
<select ng-options="dt.guid as dt.name for dt in vm.docTypes"
2525
ng-model="config.icContentTypeGuid" required></select>
2626
</td>
2727
<td>

0 commit comments

Comments
 (0)