From 5915c9b29fc1f00a3bd381a82b473464e2fae29f Mon Sep 17 00:00:00 2001 From: Donald Nairn Date: Thu, 15 Dec 2022 23:04:02 +0000 Subject: [PATCH] Remove limitation on nested content to 1,000 items where max items unset. --- .../nestedcontent/nestedcontent.controller.js | 15 ++++++++++----- .../nestedcontent.propertyeditor.html | 8 ++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js index 1320bd6804..64363914f9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js @@ -104,9 +104,6 @@ vm.minItems = model.config.minItems || 0; vm.maxItems = model.config.maxItems || 0; - if (vm.maxItems === 0) - vm.maxItems = 1000; - vm.singleMode = vm.minItems === 1 && vm.maxItems === 1 && model.config.contentTypes.length === 1; vm.expandsOnLoad = Object.toBoolean(model.config.expandsOnLoad) vm.showIcons = Object.toBoolean(model.config.showIcons); @@ -204,9 +201,17 @@ validate(); }; + vm.maxItemsExceeded = function () { + return vm.maxItems !== 0 && vm.nodes.length > vm.maxItems; + } + + vm.maxItemsReached = function () { + return vm.maxItems !== 0 && vm.nodes.length >= vm.maxItems; + } + vm.openNodeTypePicker = function ($event) { - if (vm.nodes.length >= vm.maxItems) { + if (vm.maxItemsReached()) { return; } @@ -767,7 +772,7 @@ $scope.nestedContentForm.minCount.$setValidity("minCount", true); } - if (vm.nodes.length > vm.maxItems) { + if (vm.maxItemsExceeded()) { $scope.nestedContentForm.maxCount.$setValidity("maxCount", false); } else { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html index f2654e9851..e5f4564e08 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html @@ -1,4 +1,4 @@ -
+
@@ -60,9 +60,9 @@ @@ -78,7 +78,7 @@ Minimum %0% entries, needs %1% more.
-
+
Maximum %0% entries, %1% too many.