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

Commit df71c72

Browse files
authored
Merge pull request #200 from skttl/develop
Preparing 1.2.2
2 parents 72503e7 + 41e1914 commit df71c72

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

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: 1.2.1.{build}
4+
version: 1.2.2.{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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ public HttpResponseMessage GetPreviewMarkup([FromBody] PreviewData data, [FromUr
159159
}
160160

161161
// Set the culture for the preview
162-
if (page != null)
162+
if (page != null && page.Cultures != null)
163163
{
164-
var currentCulture = page.GetCultureFromDomains();
165-
if (page.Cultures != null && page.Cultures.ContainsKey(currentCulture))
164+
var currentCulture = string.IsNullOrWhiteSpace(data.Culture) ? page.GetCultureFromDomains() : data.Culture;
165+
if (currentCulture != null && page.Cultures.ContainsKey(currentCulture))
166166
{
167167
var culture = new CultureInfo(page.Cultures[currentCulture].Culture);
168168
UmbracoContext.PublishedRequest.Culture = culture;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ public class PreviewData
2222

2323
[DataMember(Name = "viewPath")]
2424
public string ViewPath { get; set; }
25+
26+
[DataMember(Name = "culture")]
27+
public string Culture { get; set; }
2528
}
2629
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,13 @@
151151

152152
$scope.setPreview = function (model) {
153153
if ($scope.control.editor.config && "enablePreview" in $scope.control.editor.config && $scope.control.editor.config.enablePreview) {
154+
var activeVariant = editorState.current.variants.find(v => v.active);
155+
var culture = activeVariant ? activeVariant.language.culture : null;
154156
dtgeResources.getEditorMarkupForDocTypePartial(editorState.current.id, model.id,
155157
$scope.control.editor.alias, model.dtgeContentTypeAlias, model.value,
156158
$scope.control.editor.config.viewPath,
157159
$scope.control.editor.config.previewViewPath,
158-
!!editorState.current.publishDate)
160+
!!editorState.current.publishDate, culture)
159161
.then(function (response) {
160162
var htmlResult = response.data;
161163
if (htmlResult.trim().length > 0) {
@@ -316,6 +318,7 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
316318
createFromBlueprint(blueprintIds[0]);
317319
} else {
318320
$scope.dialogMode = "selectBlueprint";
321+
vm.loading = false;
319322
}
320323
} else {
321324
createBlank();

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
'Failed to retrieve datatypes'
3535
);
3636
},
37-
getEditorMarkupForDocTypePartial: function (pageId, id, editorAlias, contentTypeAlias, value, viewPath, previewViewPath, published) {
37+
getEditorMarkupForDocTypePartial: function (pageId, id, editorAlias, contentTypeAlias, value, viewPath, previewViewPath, published, culture) {
3838
var url = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + "/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetPreviewMarkup?dtgePreview=1&pageId=" + pageId;
3939
return $http({
4040
method: 'POST',
@@ -45,7 +45,8 @@
4545
contentTypeAlias: contentTypeAlias,
4646
value: JSON.stringify(value),
4747
viewPath: viewPath,
48-
previewViewPath: previewViewPath
48+
previewViewPath: previewViewPath,
49+
culture: culture
4950
}),
5051
headers: {
5152
'Content-Type': 'application/x-www-form-urlencoded'

0 commit comments

Comments
 (0)