From 5005237dfdbd1e43b326f52005ba910b02c003ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Vanbrabandt?= Date: Sat, 1 Jun 2019 14:36:49 +0200 Subject: [PATCH 1/2] Add validation to the Version and UmbracoVersion properties when editing a Package in the Umbraco backoffice. --- .../src/views/packages/edit.controller.js | 3 +++ src/Umbraco.Web.UI.Client/src/views/packages/edit.html | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js index ad251120f7a2..8370737b1f46 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js @@ -26,6 +26,9 @@ vm.buttonLabel = ""; + vm.packageVersionRegex = /^(\d+\.)(\d+\.)?(\*|\d+)$/; + vm.umbracoVersionRegex = /^(\d+\.)(\d+\.)(\*|\d+)$/; + const packageId = $routeParams.id; const create = $routeParams.create; diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/edit.html b/src/Umbraco.Web.UI.Client/src/views/packages/edit.html index 1b09453804db..26cdc20b7c50 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packages/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packages/edit.html @@ -36,7 +36,7 @@ - + Required @@ -54,7 +54,7 @@ --> - + {{editPackageForm.umbracoVersion.errorMsg}} From 8bc65c8ca73485cd1797033db93618ae3498e1c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Vanbrabandt?= Date: Mon, 3 Jun 2019 13:57:26 +0200 Subject: [PATCH 2/2] Update regex to only use one format for package and umbraco version properties --- .../src/views/packages/edit.controller.js | 3 +-- src/Umbraco.Web.UI.Client/src/views/packages/edit.html | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js index 8370737b1f46..623621c536e8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js @@ -26,8 +26,7 @@ vm.buttonLabel = ""; - vm.packageVersionRegex = /^(\d+\.)(\d+\.)?(\*|\d+)$/; - vm.umbracoVersionRegex = /^(\d+\.)(\d+\.)(\*|\d+)$/; + vm.versionRegex = /^(\d+\.)(\d+\.)(\*|\d+)$/; const packageId = $routeParams.id; const create = $routeParams.create; diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/edit.html b/src/Umbraco.Web.UI.Client/src/views/packages/edit.html index 26cdc20b7c50..2df95cec0d22 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packages/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packages/edit.html @@ -36,7 +36,7 @@ - + Required @@ -54,7 +54,7 @@ --> - + {{editPackageForm.umbracoVersion.errorMsg}}