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

Commit 117b3f7

Browse files
authored
Merge pull request #128 from umco/develop
Preparing v0.6.1 release
2 parents fd809be + d9d11f2 commit 117b3f7

File tree

7 files changed

+24
-19
lines changed

7 files changed

+24
-19
lines changed

appveyor.yml

Lines changed: 2 additions & 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: 0.6.0.{build}
4+
version: 0.6.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
@@ -46,6 +46,7 @@ deploy:
4646
# NuGet Deployment for releases
4747
- provider: NuGet
4848
server:
49+
skip_symbols: true
4950
api_key:
5051
secure: vEophXSqus5F60LRBY4/j1l6K/S5+n3/yYpiID3O7JJW1gyj+0q0enuHhN3tgdhl
5152
artifact: /.*\.nupkg/

docs/developers-guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
1. [Introduction](#introduction)
66
2. [Getting Set Up](#getting-set-up)
7-
a. [System Requirements](#system-requirements)
7+
1. [System Requirements](#system-requirements)
88
3. [Configuring The Doc Type Grid Editor](#configuring-the-doc-type-grid-editor)
99
4. [Hooking Up The Doc Type Grid Editor](#hooking-up-the-doc-type-grid-editor)
1010
5. [Rendering a Doc Type Grid Editor](#rendering-a-doc-type-grid-editor)
11-
a. [Rendering Alternative Preview Content](#rendering-alternative-preview-content)
12-
b. [DocTypeGridEditorSurfaceController](#doctypegrideditorsurfacecontroller)
11+
1. [Rendering Alternative Preview Content](#rendering-alternative-preview-content)
12+
2. [DocTypeGridEditorSurfaceController](#doctypegrideditorsurfacecontroller)
1313
6. [Useful Links](#useful-links)
1414

1515
---
@@ -139,11 +139,11 @@ Because we treat your data as a standard `IPublishedContent` entity, that means
139139

140140
#### Rendering Alternative Preview Content
141141

142-
If your front end view is rather complex, you may decide that you want to feed the back office preview an alternative, less complex view. To do this, within your Razor view/partial, check for a RouteData parameter `dtgePreview` being set to true to detect being in preview mode to provide an alternative view.
142+
If your front end view is rather complex, you may decide that you want to feed the back office preview an alternative, less complex view. To do this, within your Razor view/partial, check for a querystring parameter `dtgePreview` being set to "1" to detect being in preview mode to provide an alternative view.
143143

144144
```
145145
@inherits Umbraco.Web.Mvc.UmbracoViewPage
146-
@if (ViewContext.RouteData.Values["dtgePreview"])
146+
@if (Request.QueryString["dtgePreview"] == "1")
147147
{
148148
// Render preview view
149149
}

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,6 @@ public HttpResponseMessage GetPreviewMarkup([FromBody] PreviewData data, [FromUr
136136
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
137137
}
138138

139-
// Set DTGE's preview to be in "preview mode", (storing the original value in a temp variable for resetting it later).
140-
var inPreviewMode = UmbracoContext.InPreviewMode;
141-
UmbracoContext.InPreviewMode = true;
142-
143139
// Get content node object
144140
var content = DocTypeGridEditorHelper.ConvertValueToContent(data.Id, data.ContentTypeAlias, data.Value);
145141

@@ -157,9 +153,6 @@ public HttpResponseMessage GetPreviewMarkup([FromBody] PreviewData data, [FromUr
157153
var partialName = "~/App_Plugins/DocTypeGridEditor/Render/DocTypeGridEditorPreviewer.cshtml";
158154
var markup = Helpers.ViewHelper.RenderPartial(partialName, model, UmbracoContext.HttpContext);
159155

160-
// Restore the "preview mode" to its original value
161-
UmbracoContext.InPreviewMode = inPreviewMode;
162-
163156
// Return response
164157
var response = new HttpResponseMessage
165158
{

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Web.Mvc;
3-
using Our.Umbraco.DocTypeGridEditor.Extensions;
43
using Our.Umbraco.DocTypeGridEditor.Web.Helpers;
54
using Umbraco.Core;
65
using Umbraco.Core.Models;

src/Our.Umbraco.DocTypeGridEditor/Web/Extensions/HtmlHelperExtensions.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Web;
22
using System.Web.Mvc;
33
using System.Web.Mvc.Html;
4-
using Our.Umbraco.DocTypeGridEditor.Extensions;
54
using Our.Umbraco.DocTypeGridEditor.Web.Helpers;
65
using Our.Umbraco.DocTypeGridEditor.Web.Mvc;
76
using Umbraco.Core;
@@ -86,8 +85,7 @@ public static HtmlString RenderDocTypeGridEditorItem(
8685
}
8786

8887
// Check for preview view
89-
if (string.IsNullOrWhiteSpace(previewViewPath) == false
90-
&& isPreview)
88+
if (string.IsNullOrWhiteSpace(previewViewPath) == false && isPreview)
9189
{
9290
var fullPreviewViewPath = $"{previewViewPath}{editorAlias}.cshtml";
9391
if (ViewHelper.ViewExists(helper.ViewContext, fullPreviewViewPath, true))

src/Our.Umbraco.DocTypeGridEditor/Web/Helpers/ViewHelper.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,37 @@
33
using System.Web.Mvc;
44
using System.Web.Routing;
55
using Umbraco.Core.Logging;
6+
using Umbraco.Web;
7+
using Umbraco.Web.Mvc;
8+
using UmbracoWebConstants = Umbraco.Core.Constants.Web;
69

710
namespace Our.Umbraco.DocTypeGridEditor.Web.Helpers
811
{
912
internal static class ViewHelper
1013
{
1114
private class DummyController : Controller { }
1215

13-
public static string RenderPartial(string partialName, object model, HttpContextBase httpContext = null)
16+
public static string RenderPartial(string partialName, object model, HttpContextBase httpContext = null, UmbracoContext umbracoContext = null)
1417
{
1518
using (var sw = new StringWriter())
1619
{
1720
if (httpContext == null)
1821
httpContext = new HttpContextWrapper(HttpContext.Current);
1922

23+
if (umbracoContext == null)
24+
umbracoContext = UmbracoContext.Current;
25+
2026
var routeData = new RouteData();
2127
routeData.Values.Add("controller", "DummyController");
2228

29+
if (umbracoContext.PublishedContentRequest != null)
30+
{
31+
routeData.DataTokens[UmbracoWebConstants.UmbracoRouteDefinitionDataToken] = new RouteDefinition
32+
{
33+
PublishedContentRequest = umbracoContext.PublishedContentRequest
34+
};
35+
}
36+
2337
var controllerContext = new ControllerContext(new RequestContext(httpContext, routeData), new DummyController());
2438

2539
var viewResult = ViewEngines.Engines.FindPartialView(controllerContext, partialName);

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.resources.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
);
3636
},
3737
getEditorMarkupForDocTypePartial: function (pageId, id, editorAlias, contentTypeAlias, value, viewPath, previewViewPath, published) {
38-
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetPreviewMarkup?pageId=" + pageId);
38+
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetPreviewMarkup?dtgePreview=1&pageId=" + pageId);
3939
return $http({
4040
method: 'POST',
4141
url: url,

0 commit comments

Comments
 (0)