Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit 9a13c1a

Browse files
authored
Merge pull request #9 from cleversolutions/v8upgrade
V8upgrade
2 parents bf9bbc3 + 442526b commit 9a13c1a

File tree

10 files changed

+37
-30
lines changed

10 files changed

+37
-30
lines changed

docs/developers-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ By inheriting from the `DocTypeGridEditorSurfaceController` base class, you'll a
180180

181181
| Member | Type | Description |
182182
|---------------------------------------------------|-------------------|-------------|
183-
| Model | IPublishedContent | The IPublishedContent instance for you cells data. |
183+
| Model | IPublishedElement | The IPublishedElement instance of your cell's data. |
184184
| ViewPath | String | A reference to the currently configured ViewPath |
185185
| CurrentPartialView(object model = null) | Method | Helper method to return you to the default partial view for this cell. If no model is passed in, the standard Model will be passed down. |
186186
| PartialView(string viewName, object model = null) | Method | Helper method to return you to an alternative partial view for this cell. If no model is passed in, the standard Model will be passed down. |

src/Our.Umbraco.DocTypeGridEditor/Models/DetachedPublishedElement.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ namespace Our.Umbraco.DocTypeGridEditor.Models
88
{
99
internal class DetachedPublishedElement : IPublishedElement
1010
{
11-
private readonly PublishedContentType _contentType;
11+
private readonly IPublishedContentType _contentType;
1212
private readonly IEnumerable<IPublishedProperty> _properties;
1313
private readonly bool _isPreviewing;
1414
private readonly Guid _key;
1515

1616

1717
public DetachedPublishedElement(
1818
Guid key,
19-
PublishedContentType contentType,
19+
IPublishedContentType contentType,
2020
IEnumerable<IPublishedProperty> properties,
2121
bool isPreviewing = false)
2222
{
@@ -25,7 +25,7 @@ public DetachedPublishedElement(
2525
_properties = properties;
2626
_isPreviewing = isPreviewing;
2727
}
28-
public PublishedContentType ContentType => _contentType;
28+
public IPublishedContentType ContentType => _contentType;
2929

3030
public IPublishedProperty GetProperty(string alias) => _properties.FirstOrDefault(x => x.PropertyType.Alias.InvariantEquals(alias));
3131

src/Our.Umbraco.DocTypeGridEditor/Models/DetachedPublishedProperty.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ namespace Our.Umbraco.DocTypeGridEditor.Models
77
{
88
internal class DetachedPublishedProperty : IPublishedProperty
99
{
10-
private readonly PublishedPropertyType _propertyType;
10+
private readonly IPublishedPropertyType _propertyType;
1111
private readonly object _rawValue;
1212
private readonly Lazy<object> _sourceValue;
1313
private readonly Lazy<object> _objectValue;
1414
private readonly Lazy<object> _xpathValue;
1515
private readonly bool _isPreview;
1616

17-
public DetachedPublishedProperty(PublishedPropertyType propertyType, object value)
17+
public DetachedPublishedProperty(IPublishedPropertyType propertyType, object value)
1818
: this(propertyType, value, false)
1919
{ }
2020

21-
public DetachedPublishedProperty(PublishedPropertyType propertyType, object value, bool isPreview)
21+
public DetachedPublishedProperty(IPublishedPropertyType propertyType, object value, bool isPreview)
2222
{
2323
_propertyType = propertyType;
2424
_isPreview = isPreview;
@@ -78,7 +78,7 @@ public object GetXPathValue(string culture = null, string segment = null)
7878
return XPathValue;
7979
}
8080

81-
public PublishedPropertyType PropertyType
81+
public IPublishedPropertyType PropertyType
8282
{
8383
get
8484
{

src/Our.Umbraco.DocTypeGridEditor/Models/UnpublishedContent.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal class UnpublishedContent : IPublishedContent
1818
private readonly IContent content;
1919

2020
private readonly Lazy<IEnumerable<IPublishedContent>> children;
21-
private readonly Lazy<PublishedContentType> contentType;
21+
private readonly Lazy<IPublishedContentType> contentType;
2222
private readonly Lazy<string> creatorName;
2323
private readonly Lazy<IPublishedContent> parent;
2424
private readonly Lazy<Dictionary<string, IPublishedProperty>> properties;
@@ -38,7 +38,7 @@ public UnpublishedContent(IContent content, ServiceContext serviceContext)
3838
var contentType = Current.Services.ContentTypeService.Get(this.content.ContentType.Id);
3939

4040
//this.children = new Lazy<IEnumerable<IPublishedContent>>(() => this.content.Children().Select(x => new UnpublishedContent(x, serviceContext)).ToList());
41-
this.contentType = new Lazy<PublishedContentType>(() => Current.PublishedContentTypeFactory.CreateContentType(contentType));
41+
this.contentType = new Lazy<IPublishedContentType>(() => Current.PublishedContentTypeFactory.CreateContentType(contentType));
4242
this.creatorName = new Lazy<string>(() => this.content.GetCreatorProfile(userService.Value).Name);
4343
this.parent = new Lazy<IPublishedContent>(() => new UnpublishedContent(Current.Services.ContentService.GetById(this.content.ParentId), serviceContext));
4444
this.properties = new Lazy<Dictionary<string, IPublishedProperty>>(() => MapProperties(serviceContext));
@@ -113,10 +113,12 @@ public bool IsPublished(string culture = null)
113113

114114
public IEnumerable<IPublishedContent> Children => this.children.Value;
115115

116-
public PublishedContentType ContentType => this.contentType.Value;
116+
public IPublishedContentType ContentType => this.contentType.Value;
117117

118118
public ICollection<IPublishedProperty> Properties => this.properties.Value.Values;
119119

120+
public IEnumerable<IPublishedContent> ChildrenForAllCultures => this.children.Value;
121+
120122
public IPublishedProperty GetProperty(string alias)
121123
{
122124
return this.properties.Value.TryGetValue(alias, out IPublishedProperty property) ? property : null;

src/Our.Umbraco.DocTypeGridEditor/Models/UnpublishedProperty.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ namespace Our.Umbraco.DocTypeGridEditor.Models
77
{
88
internal class UnpublishedProperty : IPublishedProperty
99
{
10-
private readonly PublishedPropertyType propertyType;
10+
private readonly IPublishedPropertyType propertyType;
1111
private readonly object dataValue;
1212
private readonly Lazy<bool> hasValue;
1313
private readonly Lazy<object> sourceValue;
1414
private readonly Lazy<object> objectValue;
1515
private readonly Lazy<object> xpathValue;
1616

17-
public UnpublishedProperty(PublishedPropertyType propertyType, object value)
17+
public UnpublishedProperty(IPublishedPropertyType propertyType, object value)
1818
{
1919
this.propertyType = propertyType;
2020

@@ -42,7 +42,7 @@ public UnpublishedProperty(PublishedPropertyType propertyType, object value)
4242

4343
public object GetXPathValue(string culture = null, string segment = null) => this.xpathValue.Value;
4444

45-
public PublishedPropertyType PropertyType => this.PropertyType;
45+
public IPublishedPropertyType PropertyType => this.PropertyType;
4646

4747
public string Alias => this.Alias;
4848
}

src/Our.Umbraco.DocTypeGridEditor/Our.Umbraco.DocTypeGridEditor.csproj

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535
<WarningLevel>4</WarningLevel>
3636
</PropertyGroup>
3737
<ItemGroup>
38-
<Reference Include="AutoMapper, Version=8.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
39-
<HintPath>..\packages\AutoMapper.8.0.0\lib\net461\AutoMapper.dll</HintPath>
40-
</Reference>
4138
<Reference Include="CSharpTest.Net.Collections, Version=14.906.1403.1082, Culture=neutral, PublicKeyToken=06aee00cce822474, processorArchitecture=MSIL">
4239
<HintPath>..\packages\CSharpTest.Net.Collections.14.906.1403.1082\lib\net40\CSharpTest.Net.Collections.dll</HintPath>
4340
</Reference>
@@ -134,9 +131,15 @@
134131
<Reference Include="Serilog.Settings.AppSettings, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
135132
<HintPath>..\packages\Serilog.Settings.AppSettings.2.2.2\lib\net45\Serilog.Settings.AppSettings.dll</HintPath>
136133
</Reference>
134+
<Reference Include="Serilog.Sinks.Async, Version=1.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
135+
<HintPath>..\packages\Serilog.Sinks.Async.1.3.0\lib\net45\Serilog.Sinks.Async.dll</HintPath>
136+
</Reference>
137137
<Reference Include="Serilog.Sinks.File, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
138138
<HintPath>..\packages\Serilog.Sinks.File.4.0.0\lib\net45\Serilog.Sinks.File.dll</HintPath>
139139
</Reference>
140+
<Reference Include="Serilog.Sinks.Map, Version=1.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
141+
<HintPath>..\packages\Serilog.Sinks.Map.1.0.0\lib\netstandard2.0\Serilog.Sinks.Map.dll</HintPath>
142+
</Reference>
140143
<Reference Include="Superpower, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aec39280ded1b3a7, processorArchitecture=MSIL">
141144
<HintPath>..\packages\Superpower.2.0.0\lib\net45\Superpower.dll</HintPath>
142145
</Reference>
@@ -203,16 +206,16 @@
203206
<Reference Include="System.Xml" />
204207
<Reference Include="System.Xml.Linq" />
205208
<Reference Include="Umbraco.Core, Version=8.0.0.0, Culture=neutral, processorArchitecture=MSIL">
206-
<HintPath>..\packages\UmbracoCms.Core.8.0.2\lib\net472\Umbraco.Core.dll</HintPath>
209+
<HintPath>..\packages\UmbracoCms.Core.8.1.0\lib\net472\Umbraco.Core.dll</HintPath>
207210
</Reference>
208211
<Reference Include="Umbraco.Examine, Version=8.0.0.0, Culture=neutral, processorArchitecture=MSIL">
209-
<HintPath>..\packages\UmbracoCms.Web.8.0.2\lib\net472\Umbraco.Examine.dll</HintPath>
212+
<HintPath>..\packages\UmbracoCms.Web.8.1.0\lib\net472\Umbraco.Examine.dll</HintPath>
210213
</Reference>
211214
<Reference Include="Umbraco.Web, Version=8.0.0.0, Culture=neutral, processorArchitecture=MSIL">
212-
<HintPath>..\packages\UmbracoCms.Web.8.0.2\lib\net472\Umbraco.Web.dll</HintPath>
215+
<HintPath>..\packages\UmbracoCms.Web.8.1.0\lib\net472\Umbraco.Web.dll</HintPath>
213216
</Reference>
214217
<Reference Include="Umbraco.Web.UI, Version=8.0.0.0, Culture=neutral, processorArchitecture=MSIL">
215-
<HintPath>..\packages\UmbracoCms.Web.8.0.2\lib\net472\Umbraco.Web.UI.dll</HintPath>
218+
<HintPath>..\packages\UmbracoCms.Web.8.1.0\lib\net472\Umbraco.Web.UI.dll</HintPath>
216219
</Reference>
217220
</ItemGroup>
218221
<ItemGroup>

src/Our.Umbraco.DocTypeGridEditor/Properties/VersionInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was generated by a tool.
4-
// Runtime Version:4.0.30319.34209
4+
// Runtime Version:4.0.30319.42000
55
//
66
// Changes to this file may cause incorrect behavior and will be lost if
77
// the code is regenerated.
@@ -13,7 +13,7 @@
1313
using System.Runtime.CompilerServices;
1414
using System.Runtime.InteropServices;
1515

16-
[assembly: AssemblyVersion("0.0.*")]
17-
[assembly: AssemblyInformationalVersion("0.0.0-develop")]
16+
[assembly: AssemblyVersion("0.6.*")]
17+
[assembly: AssemblyInformationalVersion("0.6.2-alpha-000230")]
1818

1919

src/Our.Umbraco.DocTypeGridEditor/Web/Controllers/DocTypeGridEditorApiController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,10 @@ public HttpResponseMessage GetPreviewMarkup([FromBody] PreviewData data, [FromUr
152152
// Set the culture for the preview
153153
if (page != null)
154154
{
155-
if (page.GetCulture() != null)
155+
var currentCulture = page.GetCultureFromDomains();
156+
if (page.Cultures != null && page.Cultures.ContainsKey(currentCulture))
156157
{
157-
var culture = new CultureInfo(page.GetCulture().Culture);
158+
var culture = new CultureInfo(page.Cultures[currentCulture].Culture);
158159
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
159160
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
160161
}

src/Our.Umbraco.DocTypeGridEditor/Web/Models/PreviewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class PreviewModel : IPublishedElement
2020

2121
public IPublishedProperty GetProperty(string alias) => Item.GetProperty(alias);
2222

23-
public PublishedContentType ContentType => Item.ContentType;
23+
public IPublishedContentType ContentType => Item.ContentType;
2424

2525
public Guid Key => Item.Key;
2626

src/Our.Umbraco.DocTypeGridEditor/packages.config

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="AutoMapper" version="8.0.0" targetFramework="net472" />
43
<package id="ClientDependency" version="1.9.7" targetFramework="net45" />
54
<package id="ClientDependency-Mvc" version="1.8.0.0" targetFramework="net45" />
65
<package id="ClientDependency-Mvc5" version="1.8.0.0" targetFramework="net45" />
@@ -57,15 +56,17 @@
5756
<package id="Serilog.Formatting.Compact" version="1.0.0" targetFramework="net472" />
5857
<package id="Serilog.Formatting.Compact.Reader" version="1.0.3" targetFramework="net472" />
5958
<package id="Serilog.Settings.AppSettings" version="2.2.2" targetFramework="net472" />
59+
<package id="Serilog.Sinks.Async" version="1.3.0" targetFramework="net472" />
6060
<package id="Serilog.Sinks.File" version="4.0.0" targetFramework="net472" />
61+
<package id="Serilog.Sinks.Map" version="1.0.0" targetFramework="net472" />
6162
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
6263
<package id="Superpower" version="2.0.0" targetFramework="net472" />
6364
<package id="System.Diagnostics.DiagnosticSource" version="4.4.1" targetFramework="net472" />
6465
<package id="System.Threading.Tasks.Dataflow" version="4.9.0" targetFramework="net472" />
6566
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
6667
<package id="Umbraco.SqlServerCE" version="4.0.0.1" targetFramework="net472" />
67-
<package id="UmbracoCms.Core" version="8.0.2" targetFramework="net472" />
68-
<package id="UmbracoCms.Web" version="8.0.2" targetFramework="net472" />
68+
<package id="UmbracoCms.Core" version="8.1.0" targetFramework="net472" />
69+
<package id="UmbracoCms.Web" version="8.1.0" targetFramework="net472" />
6970
<package id="UrlRewritingNet" version="2.0.7" targetFramework="net45" />
7071
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
7172
</packages>

0 commit comments

Comments
 (0)