From 7fd3d58def32ed599b0a3382fd46539899220989 Mon Sep 17 00:00:00 2001 From: Claus Date: Tue, 12 Jan 2016 21:40:09 +0100 Subject: [PATCH 1/2] Fixes: U4-7630 Cannot save a document type when it has a date picker required property with the new property type editor in 7.4 Directive for disabling validation on forms. Passing on required validation from settings to textarea and textbox. Wrapping property editor preview in disabled validation form. --- .../umbdisableformvalidation.directive.js | 20 +++++++++++++++++++ .../less/components/umb-group-builder.less | 4 ++++ .../property/umb-property-editor.html | 2 +- .../propertyeditors/textarea/textarea.html | 3 ++- .../propertyeditors/textbox/textbox.html | 2 ++ 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/common/directives/components/umbdisableformvalidation.directive.js diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbdisableformvalidation.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbdisableformvalidation.directive.js new file mode 100644 index 0000000000..c101504ea7 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbdisableformvalidation.directive.js @@ -0,0 +1,20 @@ +(function() { + 'use strict'; + + function UmbDisableFormValidation() { + + var directive = { + restrict: 'A', + require: '?form', + link: function (scope, elm, attrs, ctrl) { + //override the $setValidity function of the form to disable validation + ctrl.$setValidity = function () { }; + } + }; + + return directive; + } + + angular.module('umbraco.directives').directive('umbDisableFormValidation', UmbDisableFormValidation); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less index 2768c370c9..002e857b3c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less @@ -279,6 +279,10 @@ input.umb-group-builder__group-sort-value { cursor: auto; } +.umb-group-builder__property-preview .help-inline { + display:none !important; +} + .umb-group-builder__property-preview-overlay { position: absolute; top: 0; diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-editor.html b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-editor.html index b191662ad1..0272ecd913 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-editor.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-editor.html @@ -1 +1 @@ -
\ No newline at end of file + \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.html index 8601155bda..0d1fae3f6f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textarea/textarea.html @@ -1,2 +1,3 @@ - + +Required \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html index 8b9babfdfa..c55fc350fa 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html @@ -2,6 +2,8 @@ + Required From f5f3126e4493bdba2874116fcda053a465bdc1ba Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 13 Jan 2016 10:22:57 +0100 Subject: [PATCH 2/2] move form outside directive to only disable validation in content type editor --- .../src/views/components/property/umb-property-editor.html | 3 ++- .../src/views/components/umb-groups-builder.html | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-editor.html b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-editor.html index 0272ecd913..80e854e9c2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-editor.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-editor.html @@ -1 +1,2 @@ - \ No newline at end of file + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html index 76df7457db..660660cf90 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html @@ -171,7 +171,12 @@ Preview - + + + +