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

Commit 03523bd

Browse files
authored
Merge pull request #3 from skttl/develop
Merge
2 parents 768622a + 1b8e8cd commit 03523bd

File tree

6 files changed

+91
-13
lines changed

6 files changed

+91
-13
lines changed

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
- Handle null value when deserializing grid value in DataValueReference 50ba85aaeeb66ed305248d303d568e4698943094
10+
11+
## [1.2.4] - 2020-09-09
12+
- Clear earlier serverside validation errors #217
13+
- Null Pointer Exception on save when no grid layout selected #211
14+
- Unsaved Changes dialog fires when hitting submit on grid editors #205
15+
16+
## [1.2.3] - 2020-06-05
17+
- #199 2 Element Types in same Nested Content freeze the Add content button in the grid layout
18+
- #202 Contenttemplates are left behind when validation is not succesfull
19+
- #203 "activeVariant.language is null" - thanks @Matthew-Wise
20+
21+
## [1.2.2] - 2020-05-14
22+
- Infinite loading when doc type has a content template #192 - thanks for reporting @OlePc
23+
- GetPreviewMarkup null reference error when getting cultures #195 - thanks for reporting *and fixing* @Matthew-Wise
24+
25+
## [1.2.1] - 2020-04-27
26+
- Disables notifications after each edit #190
27+
- Moves intrusive styling in previews to css file #188
28+
- Fixes JS error when no doctypes selected in multitype #186
29+
- Fixes bug where wrong editor gets removed when cancelling #185
30+
- Now works with custom backoffice URL #138
31+
32+
## [1.2.0] - 2020-04-12
33+
- #173 Added ValueProcessors and added processor for Umbraco.Tags
34+
- #176 Enables client side validation
35+
- #182 Enables media tracking in 8.6
36+
37+
## [1.1.0] - 2019-12-11
38+
- Changed the size attribute on grid editors to enable the new medium size in Umbraco 8.4 #167
39+
- Adds class to the preview container, so it's easier to target with custom css 47c8f5d
40+
- Check for culture variation when picking content types #154 f5453db c19a93f
41+
- Added implementation of Alias property #160
42+
43+
## [1.0.0] - 2019-08-20
44+
- Uses Infinite Editing (editorService) for editing DTGE content, instead of overlays.
45+
- Adds option to set dialog (infinite editor) size from grid editor config.
46+
- Adds Content Template aka Blueprints support for DTGE items.
47+
- Updates default placeholder for DTGEs without previews enabled.
48+
- Developers Guide updated
49+
- New minimum Umbraco version requirement: 8.1.0 - Doc Type Grid Editor will not work in lower versions!
50+
51+
[unreleased]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.2.4...HEAD
52+
[1.2.4]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.2.3...1.2.4
53+
[1.2.3]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.2.2...1.2.3
54+
[1.2.2]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.2.1...1.2.2
55+
[1.2.1]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.2.0...1.2.1
56+
[1.2.0]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.1.0...1.2.0
57+
[1.1.0]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.0.0...1.1.0
58+
[1.0.0]: https://github.com/skttl/umbraco-doc-type-grid-editor/releases/tag/1.0.0

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.3.{build}
4+
version: 1.2.4.{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.sln

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27004.2009
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30503.244
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Our.Umbraco.DocTypeGridEditor", "Our.Umbraco.DocTypeGridEditor\Our.Umbraco.DocTypeGridEditor.csproj", "{4BD1DB40-1B39-4966-8740-D6A39D658598}"
77
EndProject
@@ -19,6 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Package", "Build Pack
1919
EndProject
2020
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8412A31B-D80C-42DE-9589-4BD08F43F86B}"
2121
ProjectSection(SolutionItems) = preProject
22+
..\CHANGELOG.md = ..\CHANGELOG.md
2223
..\CONTRIBUTING.md = ..\CONTRIBUTING.md
2324
..\LICENSE.md = ..\LICENSE.md
2425
..\README.md = ..\README.md

src/Our.Umbraco.DocTypeGridEditor/ValueProcessing/DocTypeGridEditorDataValueReference.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public IEnumerable<UmbracoEntityReference> GetReferences(object value)
3030
var result = new List<UmbracoEntityReference>();
3131
var _propertyEditors = Current.PropertyEditors;
3232
var rawJson = value == null ? string.Empty : value is string str ? str : value.ToString();
33-
33+
3434
if(rawJson.IsNullOrWhiteSpace()) return result;
35-
35+
3636
DeserializeGridValue(rawJson, out var dtgeValues);
3737

3838
foreach (var control in dtgeValues)
@@ -67,9 +67,16 @@ internal GridValue DeserializeGridValue(string rawJson, out IEnumerable<DocTypeG
6767
{
6868
var grid = JsonConvert.DeserializeObject<GridValue>(rawJson);
6969

70-
// Find all controls that uses DTGE editor
71-
var controls = grid.Sections.SelectMany(x => x.Rows.SelectMany(r => r.Areas).SelectMany(a => a.Controls)).ToArray();
72-
dtgeValues = controls.Where(x => x.Editor.Alias.ToLowerInvariant() == "doctype").Select(x => x.Value.ToObject<DocTypeGridEditorValue>());
70+
if (grid != null)
71+
{
72+
// Find all controls that uses DTGE editor
73+
var controls = grid.Sections.SelectMany(x => x.Rows.SelectMany(r => r.Areas).SelectMany(a => a.Controls)).ToArray();
74+
dtgeValues = controls.Where(x => x.Editor.Alias.ToLowerInvariant() == "doctype").Select(x => x.Value.ToObject<DocTypeGridEditorValue>());
75+
}
76+
else
77+
{
78+
dtgeValues = Enumerable.Empty<DocTypeGridEditorValue>();
79+
}
7380

7481
return grid;
7582
}

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.GridEditors.DocTypeGridEditor", [
1+
angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.GridEditors.DocTypeGridEditor", [
22

33
"$scope",
44
"$rootScope",
@@ -239,14 +239,16 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
239239
"blueprintConfig",
240240
"contentEditingHelper",
241241
"serverValidationManager",
242+
"$routeParams",
242243

243-
function ($scope, $interpolate, formHelper, contentResource, dtgeResources, dtgeUtilityService, blueprintConfig, contentEditingHelper, serverValidationManager) {
244+
function ($scope, $interpolate, formHelper, contentResource, dtgeResources, dtgeUtilityService, blueprintConfig, contentEditingHelper, serverValidationManager, $routeParams) {
244245

245246
var vm = this;
246247
vm.submit = submit;
247248
vm.close = close;
248249
vm.loading = true;
249250
vm.blueprintConfig = blueprintConfig;
251+
vm.saveButtonState = "init";
250252

251253
function cleanup() {
252254
if ($scope.model.node && $scope.model.node.id > 0) {
@@ -265,10 +267,15 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
265267

266268
function submit() {
267269
if ($scope.model.submit) {
270+
vm.saveButtonState = "busy";
268271
$scope.model.node.name = "Dtge Temp: " + $scope.model.node.key;
269272
$scope.model.node.variants[0].name = $scope.model.node.name
270273
$scope.model.node.variants[0].save = true;
271274

275+
// Reset route create to prevent showing up the changed content dialog
276+
var routeParamsCreate = $routeParams.create;
277+
$routeParams.create = undefined;
278+
272279
// save the content as a blueprint, to trigger validation
273280
var args = {
274281
saveMethod: contentResource.saveBlueprint,
@@ -282,10 +289,14 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
282289

283290
contentEditingHelper.contentEditorPerformSave(args).then(function (data) {
284291
$scope.model.submit($scope.model);
292+
// Reset original value of $routeParams.create
293+
$routeParams.create = routeParamsCreate;
285294
},
286-
function (err) {
287-
// cleanup the blueprint immediately
288-
cleanup();
295+
function (err) {
296+
// Set original value of $routeParams.create
297+
$routeParams.create = routeParamsCreate;
298+
// cleanup the blueprint immediately
299+
cleanup();
289300
});
290301
}
291302
}

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.dialog.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
</umb-button>
108108
<umb-button type="button"
109109
button-style="action"
110+
state="vm.saveButtonState"
110111
label-key="general_submit"
111112
shortcut="ctrl+s"
112113
ng-if="dialogMode == 'edit'"

0 commit comments

Comments
 (0)