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

Commit f86b2f6

Browse files
authored
Merge pull request #224 from skttl/develop
Preparing 1.2.5
2 parents 67cd750 + 552b030 commit f86b2f6

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
- Resetting saveButtonState when validation contains errors #221
10+
- Handle null value when deserializing grid value in DataValueReference 50ba85aaeeb66ed305248d303d568e4698943094
11+
12+
## [1.2.4] - 2020-09-09
913
- Clear earlier serverside validation errors #217
1014
- Null Pointer Exception on save when no grid layout selected #211
1115
- Unsaved Changes dialog fires when hitting submit on grid editors #205
@@ -45,7 +49,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4549
- Developers Guide updated
4650
- New minimum Umbraco version requirement: 8.1.0 - Doc Type Grid Editor will not work in lower versions!
4751

48-
[unreleased]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.2.2...HEAD
52+
[unreleased]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.2.4...HEAD
53+
[1.2.4]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.2.3...1.2.4
4954
[1.2.3]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.2.2...1.2.3
5055
[1.2.2]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.2.1...1.2.2
5156
[1.2.1]: https://github.com/skttl/umbraco-doc-type-grid-editor/compare/1.2.0...1.2.1

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
297297
$routeParams.create = routeParamsCreate;
298298
// cleanup the blueprint immediately
299299
cleanup();
300+
vm.saveButtonState = "error";
300301
});
301302
}
302303
}

0 commit comments

Comments
 (0)