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

Commit

Permalink
Merge pull request #191 from skttl/develop
Browse files Browse the repository at this point in the history
Preparing 1.2.1
  • Loading branch information
skttl authored Apr 27, 2020
2 parents a3ad8b5 + 7323c39 commit 72503e7
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 49 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
image: Visual Studio 2017

# version format
version: 1.2.0.{build}
version: 1.2.1.{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 Down Expand Up @@ -45,7 +45,7 @@ deploy:

# NuGet Deployment for releases
- provider: NuGet
server:
server:
skip_symbols: true
api_key:
secure: RYtJVVEuX1s2cy3Wo1Xly0yvp1n40wDdndhNsXQGgrAUmZDnlwujEycsLxUL8NsN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
border: 1px solid #bbbabf;
}

.dtge-editor-preview-container {
text-align: initial;
}
/*
Style the doc type grid editor previews
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,54 +93,57 @@
id: $scope.control.value.id
};
overlayOptions.close = function () {
// ensure an empty doctype is not persisted
if($scope.control.$initializing){
$scope.removeControl($scope.area, $scope.control.$index -1);
// ensure an empty DTGE without ContentType Alias is not persisted
if ($scope.control.value && $scope.control.value.dtgeContentTypeAlias === "") {
let indexOfThis = $scope.area.controls.map(function (control) { return control.$uniqueId }).indexOf($scope.control.$uniqueId);
if (indexOfThis > -1) {
$scope.removeControl($scope.area, indexOfThis);
}
}

editorService.close();
}
overlayOptions.submit = function (newModel) {

// Copy property values to scope model value
if (newModel.node) {
var value = {
name: newModel.editorName
};

for (var v = 0; v < newModel.node.variants.length; v++) {
var variant = newModel.node.variants[v];
for (var t = 0; t < variant.tabs.length; t++) {
var tab = variant.tabs[t];
for (var p = 0; p < tab.properties.length; p++) {
var prop = tab.properties[p];
if (typeof prop.value !== "function") {
value[prop.alias] = prop.value;
}
}
}
}
// Copy property values to scope model value
if (newModel.node) {
var value = {
name: newModel.editorName
};

if (newModel.nameExp) {
var newName = newModel.nameExp(value); // Run it against the stored dictionary value, NOT the node object
if (newName && (newName = $.trim(newName))) {
value.name = newName;
for (var v = 0; v < newModel.node.variants.length; v++) {
var variant = newModel.node.variants[v];
for (var t = 0; t < variant.tabs.length; t++) {
var tab = variant.tabs[t];
for (var p = 0; p < tab.properties.length; p++) {
var prop = tab.properties[p];
if (typeof prop.value !== "function") {
value[prop.alias] = prop.value;
}
}
}
}

newModel.dialogData.value = value;
} else {
newModel.dialogData.value = null;

if (newModel.nameExp) {
var newName = newModel.nameExp(value); // Run it against the stored dictionary value, NOT the node object
if (newName && (newName = $.trim(newName))) {
value.name = newName;
}
}

$scope.setValue({
dtgeContentTypeAlias: newModel.dialogData.docTypeAlias,
value: newModel.dialogData.value,
id: newModel.dialogData.id
});
$scope.setPreview($scope.control.value);
editorService.close();
newModel.dialogData.value = value;
} else {
newModel.dialogData.value = null;

}

$scope.setValue({
dtgeContentTypeAlias: newModel.dialogData.docTypeAlias,
value: newModel.dialogData.value,
id: newModel.dialogData.id
});
$scope.setPreview($scope.control.value);
editorService.close();
};

editorService.open(overlayOptions);
Expand Down Expand Up @@ -244,7 +247,7 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
vm.blueprintConfig = blueprintConfig;

function cleanup() {
if ($scope.model.node.id > 0){
if ($scope.model.node && $scope.model.node.id > 0) {
// delete any temporary blueprints used for validation
contentResource.deleteBlueprint($scope.model.node.id);
}
Expand All @@ -268,15 +271,15 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
content: $scope.model.node,
create: true,
action: "save",
showNotifications: true,
showNotifications: false,
softRedirect: true
}

contentEditingHelper.contentEditorPerformSave(args).then(function (data) {
$scope.model.submit($scope.model);
},
$scope.model.submit($scope.model);
},
function (err) {

});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
function ($q, $http, umbRequestHelper) {
return {
getContentTypeAliasByGuid: function (guid) {
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypeAliasByGuid?guid=" + guid);
var url = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + "/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypeAliasByGuid?guid=" + guid;
return umbRequestHelper.resourcePromise(
$http.get(url),
'Failed to retrieve content type alias by guid'
);
},
getContentTypes: function (allowedContentTypes) {
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypes");
var url = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + "/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypes";
if (allowedContentTypes) {
for (var i = 0; i < allowedContentTypes.length; i++) {
url += (i == 0 ? "?" : "&") + "allowedContentTypes=" + allowedContentTypes[i];
Expand All @@ -21,21 +21,21 @@
);
},
getContentType: function (contentTypeAlias) {
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentType?contentTypeAlias=" + contentTypeAlias);
var url = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + "/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentType?contentTypeAlias=" + contentTypeAlias;
return umbRequestHelper.resourcePromise(
$http.get(url),
'Failed to retrieve content type icon'
);
},
getDataTypePreValues: function (dtdId) {
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetDataTypePreValues?dtdid=" + dtdId);
var url = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + "/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetDataTypePreValues?dtdid=" + dtdId;
return umbRequestHelper.resourcePromise(
$http.get(url),
'Failed to retrieve datatypes'
);
},
getEditorMarkupForDocTypePartial: function (pageId, id, editorAlias, contentTypeAlias, value, viewPath, previewViewPath, published) {
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetPreviewMarkup?dtgePreview=1&pageId=" + pageId);
var url = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + "/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetPreviewMarkup?dtgePreview=1&pageId=" + pageId;
return $http({
method: 'POST',
url: url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</div>
<div ng-if="preview"
class="dtge-editor-preview-container"
style="text-align: left;"
dtge-bind-html-compile="preview"
prevent-default>
</div>
Expand Down

0 comments on commit 72503e7

Please sign in to comment.