From 45459aaaeda3654e33c84f956e404717c874669f Mon Sep 17 00:00:00 2001 From: leekelleher Date: Fri, 7 Jun 2024 21:28:26 +0100 Subject: [PATCH 1/3] Excludes `package.json` from the NuGet pkg Fixes #400 --- .../Umbraco.Community.Contentment.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj b/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj index e2c65a66c..5d58106c2 100644 --- a/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj +++ b/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj @@ -47,8 +47,9 @@ + - + From 319dec3db4f486894055a0ec55a9616841ab94ce Mon Sep 17 00:00:00 2001 From: leekelleher Date: Fri, 7 Jun 2024 21:28:48 +0100 Subject: [PATCH 2/3] Incremented version number, v5.0.1 --- VERSION | 2 +- .../Umbraco.Community.Contentment.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 28cbf7c0a..32f3eaad0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.0.0 \ No newline at end of file +5.0.1 \ No newline at end of file diff --git a/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj b/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj index 5d58106c2..c855ac40e 100644 --- a/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj +++ b/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj @@ -14,7 +14,7 @@ Umbraco.Community.Contentment Contentment for Umbraco Contentment, a collection of components for Umbraco. - 5.0.0 + 5.0.1 Lee Kelleher Lee Kelleher $([System.DateTime]::Now.Year) © $(Company) From 2c5e415f4dfc96dbe01b2b2c98b59dea86fd611e Mon Sep 17 00:00:00 2001 From: leekelleher Date: Sun, 9 Jun 2024 15:30:36 +0100 Subject: [PATCH 3/3] DataPicker: Ensures the value is an array There is an edge-case scenario where the state of a property can change after the save event, but the property-editor is not re-initialized, e.g. `readonly` changes from true to false. ...and the value is set to an empty string, which causes an error for Data Picker. Fixes #401 --- .../DataEditors/DataPicker/data-picker.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Community.Contentment/DataEditors/DataPicker/data-picker.js b/src/Umbraco.Community.Contentment/DataEditors/DataPicker/data-picker.js index 9fca19bad..8069f930a 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/DataPicker/data-picker.js +++ b/src/Umbraco.Community.Contentment/DataEditors/DataPicker/data-picker.js @@ -49,11 +49,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. config.currentPageId = -1; } - $scope.model.value = $scope.model.value || config.defaultValue; - - if (Array.isArray($scope.model.value) === false) { - $scope.model.value = [$scope.model.value]; - } + ensureValueIsArray(); if (Array.isArray(config.displayMode) === true) { config.displayMode = config.displayMode[0]; @@ -120,6 +116,8 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. }, submit: function (selection) { + ensureValueIsArray(); + if (selection) { Object.entries(selection).forEach(item => { vm.itemLookup[item[0]] = item[1]; @@ -141,6 +139,14 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. }); }; + function ensureValueIsArray() { + $scope.model.value = $scope.model.value || config.defaultValue; + + if (Array.isArray($scope.model.value) === false) { + $scope.model.value = [$scope.model.value]; + } + } + function load() { if ($scope.model.value.length) { vm.loading = true;