From 8c26a8e48665a666cfeaa23f4da532a80956ffb6 Mon Sep 17 00:00:00 2001 From: Matthew Wise Date: Mon, 18 May 2020 14:49:22 +0100 Subject: [PATCH 1/4] Fix for 201 --- .../DocTypeGridEditor/Js/doctypegrideditor.controllers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js b/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js index 9cc00da..9d58602 100644 --- a/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js +++ b/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js @@ -151,8 +151,8 @@ $scope.setPreview = function (model) { if ($scope.control.editor.config && "enablePreview" in $scope.control.editor.config && $scope.control.editor.config.enablePreview) { - var activeVariant = editorState.current.variants.find(v => v.active); - var culture = activeVariant ? activeVariant.language.culture : null; + var activeVariant = editorState.current.variants?.find(v => v.active); + var culture = activeVariant?.language?.culture; dtgeResources.getEditorMarkupForDocTypePartial(editorState.current.id, model.id, $scope.control.editor.alias, model.dtgeContentTypeAlias, model.value, $scope.control.editor.config.viewPath, From d211de9cd58a12b5faa6f2cadf34af3a8223d6b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Kottal?= Date: Wed, 27 May 2020 13:06:04 +0200 Subject: [PATCH 2/4] cleanup the blueprint immediately, when validation errors occur --- .../Js/doctypegrideditor.controllers.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js b/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js index 9cc00da..4114c39 100644 --- a/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js +++ b/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js @@ -252,6 +252,9 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT if ($scope.model.node && $scope.model.node.id > 0) { // delete any temporary blueprints used for validation contentResource.deleteBlueprint($scope.model.node.id); + + // set current node id, so subsequent deletes, giving 404 errors is avoided + $scope.model.node.id = 0; } //clear server validation messages when this editor is destroyed @@ -280,9 +283,10 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT contentEditingHelper.contentEditorPerformSave(args).then(function (data) { $scope.model.submit($scope.model); }, - function (err) { - - }); + function (err) { + // cleanup the blueprint immediately + cleanup(); + }); } } function close() { From e36d42434cea9ea76b386df3d62ba56a85a9af30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Kottal?= Date: Wed, 27 May 2020 13:36:40 +0200 Subject: [PATCH 3/4] Workaround fix for #199 --- .../DocTypeGridEditor/Css/doctypegrideditor.css | 8 ++++++++ .../DocTypeGridEditor/Js/doctypegrideditor.controllers.js | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Css/doctypegrideditor.css b/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Css/doctypegrideditor.css index 14fdc90..4bf1a17 100644 --- a/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Css/doctypegrideditor.css +++ b/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Css/doctypegrideditor.css @@ -44,3 +44,11 @@ display: block; } */ + +/* workaround for https://github.com/skttl/umbraco-doc-type-grid-editor/issues/199 from https://github.com/umbraco/Umbraco-CMS/issues/7754 */ +body.pre870 .dtge-dialog .umb-overlay { + left: inherit !important; + right: 0 !important; + top: 0 !important; + bottom: 0 !important; +} \ No newline at end of file diff --git a/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js b/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js index aeee388..b403fb5 100644 --- a/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js +++ b/src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js @@ -387,6 +387,10 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT }); } + if (dtgeUtilityService.compareCurrentUmbracoVersion("8.7.0", {}) && !$("body").hasClass("pre870")) { + $("body").addClass("pre870"); + }; + } ]); From 3c86ba51a924d87a8ed984fa1d86e8f94ca77b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Kottal?= Date: Wed, 3 Jun 2020 22:20:38 +0200 Subject: [PATCH 4/4] bumps version to 1.2.3 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 93b1af4..1fc68c9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ image: Visual Studio 2017 # version format -version: 1.2.2.{build} +version: 1.2.3.{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