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

Commit

Permalink
Merge pull request #35 from umco/develop
Browse files Browse the repository at this point in the history
Preparing v1.1.0 release
  • Loading branch information
leekelleher authored Mar 5, 2018
2 parents b4ae138 + e633f4c commit 720df6d
Show file tree
Hide file tree
Showing 21 changed files with 108 additions and 115 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ artifacts/
src/packages/*/**
build/_nuget/
build/_umbraco/
assets/
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The issue tracker is the preferred channel for [bug reports](#bugs),
requests](#pull-requests), but please respect the following restrictions:

* Please **do not** use the issue tracker for personal support requests (use
[Our Umbraco](https://our.umbraco.org/projects/backoffice-extensions/nested-content/nested-content-feedback) or Twitter).
[Our Umbraco](https://our.umbraco.org/projects/backoffice-extensions/stacked-content/stacked-content-feedback) or Twitter).

* Please **do not** derail or troll issues. Keep the discussion on topic and
respect the opinions of others.
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ We also have a [MyGet package repository](https://www.myget.org/gallery/umbraco-

#### Manual build

If you prefer, you can compile Stacked Content yourself, you'll need:
If you prefer, you can compile Stacked Content yourself, you'll need:

* Visual Studio 2015 (or above)

Expand All @@ -44,7 +44,9 @@ To clone it locally click the "Clone in Windows" button above or run the followi

## Known Issues

* _[TBC]_
Please be aware that not all property-editors will work within Stacked Content. The following Umbraco core property-editors are known to have compatibility issues:

* Upload

---

Expand Down
12 changes: 6 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
os: Visual Studio 2015
image: Visual Studio 2017

# version format
version: 1.0.4.{build}
version: 1.1.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 @@ -15,7 +15,7 @@ before_build:
- nuget restore src

build_script:
- build-appveyor.cmd
- build-appveyor.cmd

artifacts:
- path: artifacts\*.nupkg
Expand All @@ -24,8 +24,8 @@ artifacts:
deploy:
# MyGet Deployment for builds & releases
- provider: NuGet
server: https://www.myget.org/F/umbraco-packages/
symbol_server: https://nuget.symbolsource.org/MyGet/umbraco-packages
server: https://www.myget.org/F/umbraco-packages/api/v2/package
symbol_server: https://www.myget.org/F/umbraco-packages/symbols/api/v2/package
api_key:
secure: 36/Ax5O+e6wENlhoTwgvoEBZV3FG4XjF429SNTej2qsGTAL+cdfA1kT/tm1St8vx
artifact: /.*\.nupkg/
Expand All @@ -47,7 +47,7 @@ deploy:
- provider: NuGet
server:
api_key:
secure: eSLiOXbGVrxSG+X7PV6qTTUZ5VzS9EFj5+EufaWPfd+QXkF6gc8rZ4mGoHIVp/fL
secure: 0+oAleUTnr9UuJrhLW5rphRR+QGz00XX1Ui3k5kwyr2kUdEamiQ3F+gW0q8MJbDT
artifact: /.*\.nupkg/
on:
branch: master
Expand Down
3 changes: 2 additions & 1 deletion build-appveyor.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ ECHO APPVEYOR_BUILD_NUMBER : %APPVEYOR_BUILD_NUMBER%
ECHO APPVEYOR_BUILD_VERSION : %APPVEYOR_BUILD_VERSION%

CALL build\tools\NuGet\NuGet.exe restore src\Our.Umbraco.StackedContent.sln
CALL "%programfiles(x86)%\MSBuild\14.0\Bin\amd64\MsBuild.exe" build\package.proj
CALL "%programfiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MsBuild.exe" build\package.proj
REM CALL "%programfiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\amd64\MsBuild.exe" build\package.proj
2 changes: 1 addition & 1 deletion build/package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<language></language>
<tags></tags>
<dependencies>
<dependency id="Our.Umbraco.InnerContent" version="1.0.3" />
<dependency id="Our.Umbraco.InnerContent" version="1.1" />
</dependencies>
</metadata>
<files />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions src/Our.Umbraco.StackedContent.sln
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2008
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Our.Umbraco.StackedContent", "Our.Umbraco.StackedContent\Our.Umbraco.StackedContent.csproj", "{E0F6B57D-F549-4EF0-B5A7-5C1A9B49FD80}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{52A49C4D-441F-4D54-A23F-444AF47DB250}"
ProjectSection(SolutionItems) = preProject
..\..\umbraco-stacked-content\CONTRIBUTING.md = ..\..\umbraco-stacked-content\CONTRIBUTING.md
..\..\umbraco-stacked-content\LICENSE.md = ..\..\umbraco-stacked-content\LICENSE.md
..\..\umbraco-stacked-content\README.md = ..\..\umbraco-stacked-content\README.md
..\CONTRIBUTING.md = ..\CONTRIBUTING.md
..\LICENSE.md = ..\LICENSE.md
..\README.md = ..\README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{95F00400-1FCA-4D98-9643-ACBC2203C1D0}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Scripts", "Build Scripts", "{95F00400-1FCA-4D98-9643-ACBC2203C1D0}"
ProjectSection(SolutionItems) = preProject
..\..\umbraco-stacked-content\appveyor.yml = ..\..\umbraco-stacked-content\appveyor.yml
..\..\umbraco-stacked-content\build-appveyor.cmd = ..\..\umbraco-stacked-content\build-appveyor.cmd
..\..\umbraco-stacked-content\build.cmd = ..\..\umbraco-stacked-content\build.cmd
..\..\umbraco-stacked-content\build\install.ps1 = ..\..\umbraco-stacked-content\build\install.ps1
..\..\umbraco-stacked-content\build\package.nuspec = ..\..\umbraco-stacked-content\build\package.nuspec
..\..\umbraco-stacked-content\build\package.proj = ..\..\umbraco-stacked-content\build\package.proj
..\..\umbraco-stacked-content\build\package.xml = ..\..\umbraco-stacked-content\build\package.xml
..\appveyor.yml = ..\appveyor.yml
..\build-appveyor.cmd = ..\build-appveyor.cmd
..\build.cmd = ..\build.cmd
..\build\install.ps1 = ..\build\install.ps1
..\build\package.nuspec = ..\build\package.nuspec
..\build\package.proj = ..\build\package.proj
..\build\package.xml = ..\build\package.xml
EndProjectSection
EndProject
Global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@ public override bool IsConverter(PublishedPropertyType propertyType)

public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
{
if (source == null)
return null;

var str = source.ToString();
if (string.IsNullOrWhiteSpace(str))
return null;

try
{
if (source != null && !source.ToString().IsNullOrWhiteSpace())
{
var rawValue = JsonConvert.DeserializeObject<JArray>(source.ToString());
var rawValue = JsonConvert.DeserializeObject<JArray>(str);

return ConvertInnerContentDataToSource(rawValue, null, 1, preview);
}
return ConvertInnerContentDataToSource(rawValue, null, 1, preview);
}
catch (Exception e)
catch (Exception ex)
{
LogHelper.Error<StackedContentValueConverter>("Error converting value", e);
LogHelper.Error<StackedContentValueConverter>("Error converting value", ex);
}

return null;
Expand Down
13 changes: 6 additions & 7 deletions src/Our.Umbraco.StackedContent/Our.Umbraco.StackedContent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Our.Umbraco.InnerContent, Version=1.0.6286.21529, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Our.Umbraco.InnerContent.Core.1.0.3\lib\net45\Our.Umbraco.InnerContent.dll</HintPath>
<Private>False</Private>
<Reference Include="Our.Umbraco.InnerContent, Version=1.1.6638.5280, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Our.Umbraco.InnerContent.Core.1.1.0\lib\net45\Our.Umbraco.InnerContent.dll</HintPath>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
Expand Down Expand Up @@ -279,11 +278,11 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>IF %25ComputerName%25 == MBP13-PC-BC (
<PostBuildEvent>IF %25ComputerName%25 == DESKTOP-ESFKU58 (
IF NOT "$(SolutionDir)" == "*Undefined*" (
xcopy /s /y "$(TargetPath)" "C:\Users\Matt\Work\Sandbox\Umbraco\UmbracoCms.7.5.2\bin\"
xcopy /s /y "$(TargetDir)$(ProjectName).pdb" "C:\Users\Matt\Work\Sandbox\Umbraco\UmbracoCms.7.5.2\bin\"
xcopy /s /y "$(ProjectDir)Web\UI\*.*" "C:\Users\Matt\Work\Sandbox\Umbraco\UmbracoCms.7.5.2\"
xcopy /s /y "$(TargetPath)" "C:\Users\Matt\Storage\Sandbox\Umbraco\UmbracoCms.7.7.6\bin\"
xcopy /s /y "$(TargetDir)$(ProjectName).pdb" "C:\Users\Matt\Storage\Sandbox\Umbraco\UmbracoCms.7.7.6\bin\"
xcopy /s /y "$(ProjectDir)Web\UI\*.*" "C:\Users\Matt\Storage\Sandbox\Umbraco\UmbracoCms.7.7.6\"
)
)</PostBuildEvent>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,49 +1,32 @@
using System.Collections.Generic;
using Umbraco.Core.PropertyEditors;
using Our.Umbraco.InnerContent.PropertyEditors;
using Umbraco.Core.PropertyEditors;

namespace Our.Umbraco.StackedContent.PropertyEditors
{
[PropertyEditor(PropertyEditorAlias, "Stacked Content", "/App_Plugins/StackedContent/views/stackedcontent.html", Group = "rich content", Icon = "icon-umb-contour", ValueType = "JSON")]
public class StackedContentPropertyEditor : PropertyEditor
public class StackedContentPropertyEditor : SimpleInnerContentPropertyEditor
{
public const string PropertyEditorAlias = "Our.Umbraco.StackedContent";

private IDictionary<string, object> _defaultPreValues;
public override IDictionary<string, object> DefaultPreValues
{
get { return _defaultPreValues; }
set { _defaultPreValues = value; }
}

public StackedContentPropertyEditor()
: base()
{
// Setup default values
_defaultPreValues = new Dictionary<string, object>
{
{"contentTypes", ""},
{"maxItems", 0},
{"singleItemMode", "0"},
{"disablePreview", "0"}
};
DefaultPreValues.Add("maxItems", 0);
DefaultPreValues.Add("singleItemMode", "0");
DefaultPreValues.Add("disablePreview", "0");
}

#region Pre Value Editor

protected override PreValueEditor CreatePreValueEditor()
{
return new StackPreValueEditor();
return new StackedContentPreValueEditor();
}

internal class StackPreValueEditor : PreValueEditor
internal class StackedContentPreValueEditor : SimpleInnerContentPreValueEditor
{
[PreValueField("contentTypes", "Doc Types", "~/App_Plugins/InnerContent/views/innercontent.doctypepicker.html", Description = "Select the doc types to use as the data blueprint.")]
public string[] ContentTypes { get; set; }

[PreValueField("maxItems", "Max Items", "number", Description = "Set the maximum number of items allowed in this stack.")]
public string MaxItems { get; set; }

[PreValueField("singleItemMode", "Single Item Mode", "boolean", Description = "Set whether to work in single item mode (only the first defined Doc Type will be used).")]
[PreValueField("singleItemMode", "Single Item Mode", "boolean", Description = "Set whether to work in single item mode (only the first defined Content Type will be used).")]
public string SingleItemMode { get; set; }

[PreValueField("hideLabel", "Hide Label", "boolean", Description = "Set whether to hide the editor label and have the list take up the full width of the editor window.")]
Expand All @@ -52,16 +35,5 @@ internal class StackPreValueEditor : PreValueEditor
[PreValueField("disablePreview", "Disable Preview", "boolean", Description = "Set whether to disable the preview of the items in the stack.")]
public string DisablePreview { get; set; }
}

#endregion

#region Value Editor

protected override PropertyValueEditor CreateValueEditor()
{
return new SimpleInnerContentPropertyValueEditor(base.CreateValueEditor());
}

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public HttpResponseMessage GetPreviewMarkup([FromBody] JObject item, int parentI
// Return response
var response = new HttpResponseMessage
{
Content = new StringContent(markup ?? "")
Content = new StringContent(markup ?? string.Empty)
};

response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html");
Expand Down
36 changes: 19 additions & 17 deletions src/Our.Umbraco.StackedContent/Web/Helpers/ViewHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,31 @@ class DummyController : Controller { }

public static string RenderPartial(string partialName, object model, string[] viewLocations)
{
var sw = new StringWriter();
var httpContext = new HttpContextWrapper(HttpContext.Current);
using (var sw = new StringWriter())
{
var httpContext = new HttpContextWrapper(HttpContext.Current);

var routeData = new RouteData();
routeData.Values.Add("controller", "DummyController");
var routeData = new RouteData();
routeData.Values.Add("controller", "DummyController");

var controllerContext = new ControllerContext(new RequestContext(httpContext, routeData), new DummyController());
var controllerContext = new ControllerContext(new RequestContext(httpContext, routeData), new DummyController());

var viewEngine = new RazorViewEngine
{
PartialViewLocationFormats = viewLocations
};
var viewEngine = new RazorViewEngine
{
PartialViewLocationFormats = viewLocations
};

var viewResult = viewEngine.FindPartialView(controllerContext, partialName, false);
if (viewResult.View == null)
{
//TODO: Log lack of view?
return null;
}
var viewResult = viewEngine.FindPartialView(controllerContext, partialName, false);
if (viewResult.View == null)
{
// TODO: Log lack of view?
return null;
}

viewResult.View.Render(new ViewContext(controllerContext, viewResult.View, new ViewDataDictionary { Model = model }, new TempDataDictionary(), sw), sw);
viewResult.View.Render(new ViewContext(controllerContext, viewResult.View, new ViewDataDictionary { Model = model }, new TempDataDictionary(), sw), sw);

return sw.ToString();
return sw.ToString();
}
}
}
}
Loading

0 comments on commit 720df6d

Please sign in to comment.