From 7d589eb6076e5ca7558a3d714936d731ecb32fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 12 Feb 2019 14:39:12 +0100 Subject: [PATCH 1/5] V8: datepicker style matching the light interface of v8 --- src/Umbraco.Web.UI.Client/src/less/forms.less | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/forms.less b/src/Umbraco.Web.UI.Client/src/less/forms.less index 7b2afad20b..6507b22397 100644 --- a/src/Umbraco.Web.UI.Client/src/less/forms.less +++ b/src/Umbraco.Web.UI.Client/src/less/forms.less @@ -574,14 +574,19 @@ div.help { width: auto; height: 22px; min-width: 18px; - padding: 4px 6px; + padding: 5px 6px 3px 6px; font-size: @baseFontSize; font-weight: normal; line-height: @baseLineHeight; text-align: center; - text-shadow: 0 1px 0 @white; - background-color: @gray-10; - border: 1px solid @purple-l3; + //text-shadow: 0 1px 0 @white; + background-color: @white; + border: 1px solid @inputBorder; + color: @ui-option-type; + &:hover { + border-color:@inputBorderFocus; + color: @ui-option-type-hover; + } } .add-on, .btn, From 385a86b3b3e56739406f7e11c870a374e03440ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 12 Feb 2019 14:52:21 +0100 Subject: [PATCH 2/5] V8: UI datepicker style update --- .../src/less/property-editors.less | 17 +++++++++++++++++ .../propertyeditors/datepicker/datepicker.html | 12 ++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index 09cdaf4939..9b0daa1e4d 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -884,6 +884,23 @@ .bootstrap-datetimepicker-widget .btn{padding: 0;} .bootstrap-datetimepicker-widget .picker-switch .btn{ background: none; border: none;} .umb-datepicker .input-append .add-on{cursor: pointer;} +.umb-datepicker .input-append .on-top { + position: absolute; + margin-left: -31px; + margin-top: 1px; + display: inline-block; + height: 22px; + padding: 5px 6px 3px 6px; + font-size: @baseFontSize; + font-weight: normal; + line-height: @baseLineHeight; + text-align: center; + background-color: @white; + color: @ui-option-type; + &:hover { + color: @ui-option-type-hover; + } +} .umb-datepicker p {margin-top:10px;} .umb-datepicker p a{color: @gray-3;} diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html index 47c9182650..0d3fad580e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html @@ -13,12 +13,15 @@
+ + + @@ -38,9 +41,6 @@ This translates to the following time on the server: {{serverTime}}
What does this mean?

-

- Clear date -

From ff8f9083ec7b143333376577531c251d631460a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 13 Feb 2019 11:37:09 +0100 Subject: [PATCH 3/5] Dimmed overlay on property preview + removed background from "add property group" + adjust sizes for umb-panel-header and added hovers. --- .../src/less/components/editor.less | 3 +- .../less/components/umb-group-builder.less | 46 ++++++++++++------- src/Umbraco.Web.UI.Client/src/less/panel.less | 13 ++++-- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/editor.less b/src/Umbraco.Web.UI.Client/src/less/components/editor.less index d576c33b67..f165c0c865 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/editor.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/editor.less @@ -75,6 +75,7 @@ .umb-editor-header__back { color: @gray-6; + margin-bottom: 1px; transition: color 0.1s ease-in-out; } @@ -95,7 +96,7 @@ input.umb-editor-header__name-input { margin-bottom: 0; font-weight: bold; box-sizing: border-box; - height: 32px; + height: 30px; line-height: 32px; width: 100%; padding: 0 10px; 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 331fd9eb66..d8c7224d57 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 @@ -16,10 +16,6 @@ box-shadow: 0 1px 1px 0 rgba(0,0,0,0.16); } -.umb-group-builder__group.-active { - border-color: @ui-active; -} - .umb-group-builder__group.-inherited { border-color: @gray-9; animation: fadeIn 0.5s; @@ -33,6 +29,7 @@ align-items: center; cursor: pointer; border: 1px dashed @gray-7; + background-color: transparent; color: @ui-action-type; font-weight: bold; position: relative; @@ -253,24 +250,38 @@ input.umb-group-builder__group-title-input:disabled:hover { } .umb-group-builder__property-preview { - flex: 1; - height: 30px; - overflow: hidden; - position: relative; - padding: 35px 10px 25px 10px; - background-color: @gray-10; + flex: 1; + height: 30px; + overflow: hidden; + position: relative; + padding: 35px 10px 25px 10px; + border-radius: 3px; + cursor: pointer; + + &::after { + content: ""; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: rgba(0,0,0,0.1); + transition: opacity 120ms; + } } .umb-group-builder__property-preview:hover { - cursor: pointer; + &::after { + opacity: .8; + } } .umb-group-builder__property-preview:focus { - outline: none; + outline: none; } -.umb-group-builder__property-preview.-not-clickable:hover { - cursor: auto; +.umb-group-builder__property-preview.-not-clickable { + cursor: auto; } .umb-group-builder__property-preview .help-inline { @@ -312,8 +323,8 @@ input.umb-group-builder__group-title-input:disabled:hover { .umb-group-builder__property-tags { position: absolute; z-index: 20; - top: 0; - left: 0; + top: 4px; + left: 4px; display: flex; flex-direction: row; } @@ -326,9 +337,10 @@ input.umb-group-builder__group-title-input:disabled:hover { .umb-group-builder__property-tag { font-size: 12px; background-color: @gray-8; - margin-left: 10px; + margin-left: 4px; padding: 0 4px; display: flex; + border-radius: 3px; } .umb-group-builder__property-tag:first-child { diff --git a/src/Umbraco.Web.UI.Client/src/less/panel.less b/src/Umbraco.Web.UI.Client/src/less/panel.less index ae930d6fb0..29b05558cf 100644 --- a/src/Umbraco.Web.UI.Client/src/less/panel.less +++ b/src/Umbraco.Web.UI.Client/src/less/panel.less @@ -346,10 +346,16 @@ justify-content: center; align-items: center; background: @white; - border: 1px solid @gray-8; + border: 1px solid @ui-action-disgrete-border; animation: fadeIn 0.5s; border-radius: 3px; width: 50px; + &:hover { + .icon { + opacity: 0.8; + } + border-color: @ui-action-disgrete-border-hover; + } } .umb-panel-header-title-wrapper { @@ -382,8 +388,9 @@ } .umb-panel-header-icon .icon { - font-size: 30px; - color: @gray-7; + font-size: 30px; + color: @gray-7; + transition: opacity 120ms; } .umb-panel-header-icon-text { From 2b0cfdb1434500be605cfa7b6c560a6744716f09 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 13 Feb 2019 15:33:48 +0100 Subject: [PATCH 4/5] #4451 - Changed the default ordering of toolbar in tinymce, to be the same as the ordering in config --- .../src/common/services/tinymce.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index 597992b61e..4fe7f8b7d7 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -312,7 +312,7 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s */ defaultPrevalues: function () { var cfg = {}; - cfg.toolbar = ["code", "bold", "italic", "styleselect", "alignleft", "aligncenter", "alignright", "bullist", "numlist", "outdent", "indent", "link", "image", "umbmediapicker", "umbembeddialog", "umbmacro"]; + cfg.toolbar = ["ace", "styleselect", "bold", "italic", "alignleft", "aligncenter", "alignright", "bullist", "numlist", "outdent", "indent", "link", "umbmediapicker", "umbmacro", "umbembeddialog"]; cfg.stylesheets = []; cfg.maxImageSize = 500; return cfg; From f814a80ab7fb1451d7b2abbd274ac6ace1338691 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 14 Feb 2019 11:37:27 +1100 Subject: [PATCH 5/5] Fixes the ContentSaveValidationAttribute since it was capturing a request based object in it's ctor when it's a singleton, moves the OnlyLocalRequestsAttribute to the correct namespace, WebSecurity shouldn't be IDisposable --- .../Filters/ContentSaveValidationAttribute.cs | 16 +++++++--------- src/Umbraco.Web/Editors/KeepAliveController.cs | 1 + src/Umbraco.Web/Security/WebSecurity.cs | 10 +++------- src/Umbraco.Web/Umbraco.Web.csproj | 2 +- .../Filters}/OnlyLocalRequestsAttribute.cs | 3 +-- 5 files changed, 13 insertions(+), 19 deletions(-) rename src/Umbraco.Web/{Mvc => WebApi/Filters}/OnlyLocalRequestsAttribute.cs (92%) diff --git a/src/Umbraco.Web/Editors/Filters/ContentSaveValidationAttribute.cs b/src/Umbraco.Web/Editors/Filters/ContentSaveValidationAttribute.cs index a0565c1d2f..6286572946 100644 --- a/src/Umbraco.Web/Editors/Filters/ContentSaveValidationAttribute.cs +++ b/src/Umbraco.Web/Editors/Filters/ContentSaveValidationAttribute.cs @@ -15,7 +15,6 @@ using Umbraco.Web.Actions; using Umbraco.Web.Composing; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Security; -using Umbraco.Web.WebApi; namespace Umbraco.Web.Editors.Filters { @@ -24,23 +23,21 @@ namespace Umbraco.Web.Editors.Filters /// internal sealed class ContentSaveValidationAttribute : ActionFilterAttribute { - public ContentSaveValidationAttribute(): this(Current.Logger, Current.UmbracoContextAccessor, Current.Services.ContentService, Current.Services.UserService, Current.Services.EntityService, UmbracoContext.Current.Security) + public ContentSaveValidationAttribute(): this(Current.Logger, Current.UmbracoContextAccessor, Current.Services.ContentService, Current.Services.UserService, Current.Services.EntityService) { } - public ContentSaveValidationAttribute(ILogger logger, IUmbracoContextAccessor umbracoContextAccessor, IContentService contentService, IUserService userService, IEntityService entityService, WebSecurity security) + public ContentSaveValidationAttribute(ILogger logger, IUmbracoContextAccessor umbracoContextAccessor, IContentService contentService, IUserService userService, IEntityService entityService) { _logger = logger; _umbracoContextAccessor = umbracoContextAccessor; _contentService = contentService ?? throw new ArgumentNullException(nameof(contentService)); _userService = userService ?? throw new ArgumentNullException(nameof(userService)); _entityService = entityService ?? throw new ArgumentNullException(nameof(entityService)); - _security = security ?? throw new ArgumentNullException(nameof(security)); } private readonly ILogger _logger; private readonly IUmbracoContextAccessor _umbracoContextAccessor; private readonly IContentService _contentService; - private readonly WebSecurity _security; private readonly IUserService _userService; private readonly IEntityService _entityService; @@ -51,7 +48,7 @@ namespace Umbraco.Web.Editors.Filters if (!ValidateAtLeastOneVariantIsBeingSaved(model, actionContext)) return; if (!contentItemValidator.ValidateExistingContent(model, actionContext)) return; - if (!ValidateUserAccess(model, actionContext)) return; + if (!ValidateUserAccess(model, actionContext, _umbracoContextAccessor.UmbracoContext.Security)) return; //validate for each variant that is being updated foreach (var variant in model.Variants.Where(x => x.Save)) @@ -83,7 +80,8 @@ namespace Umbraco.Web.Editors.Filters /// /// /// - private bool ValidateUserAccess(ContentItemSave contentItem, HttpActionContext actionContext) + /// + private bool ValidateUserAccess(ContentItemSave contentItem, HttpActionContext actionContext, WebSecurity webSecurity) { //We now need to validate that the user is allowed to be doing what they are doing. @@ -194,13 +192,13 @@ namespace Umbraco.Web.Editors.Filters actionContext.Request.Properties[typeof(IContent).ToString()] = contentItem; accessResult = ContentPermissionsHelper.CheckPermissions( - contentToCheck, _security.CurrentUser, + contentToCheck, webSecurity.CurrentUser, _userService, _entityService, permissionToCheck.ToArray()); } else { accessResult = ContentPermissionsHelper.CheckPermissions( - contentIdToCheck, _security.CurrentUser, + contentIdToCheck, webSecurity.CurrentUser, _userService, _contentService, _entityService, out contentToCheck, permissionToCheck.ToArray()); diff --git a/src/Umbraco.Web/Editors/KeepAliveController.cs b/src/Umbraco.Web/Editors/KeepAliveController.cs index b15621ee23..23815e1bbe 100644 --- a/src/Umbraco.Web/Editors/KeepAliveController.cs +++ b/src/Umbraco.Web/Editors/KeepAliveController.cs @@ -2,6 +2,7 @@ using System.Web.Http; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi; +using Umbraco.Web.WebApi.Filters; namespace Umbraco.Web.Editors { diff --git a/src/Umbraco.Web/Security/WebSecurity.cs b/src/Umbraco.Web/Security/WebSecurity.cs index ef6193694c..55ac421b92 100644 --- a/src/Umbraco.Web/Security/WebSecurity.cs +++ b/src/Umbraco.Web/Security/WebSecurity.cs @@ -21,9 +21,9 @@ namespace Umbraco.Web.Security /// /// A utility class used for dealing with USER security in Umbraco /// - public class WebSecurity : DisposableObjectSlim + public class WebSecurity { - private HttpContextBase _httpContext; + private readonly HttpContextBase _httpContext; private readonly IUserService _userService; private readonly IGlobalSettings _globalSettings; @@ -263,10 +263,6 @@ namespace Umbraco.Web.Security { return _httpContext.User != null && _httpContext.User.Identity.IsAuthenticated && _httpContext.GetCurrentIdentity(false) != null; } - - protected override void DisposeResources() - { - _httpContext = null; - } + } } diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index f8570d6dcc..bdea3f1a66 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -207,7 +207,7 @@ - + diff --git a/src/Umbraco.Web/Mvc/OnlyLocalRequestsAttribute.cs b/src/Umbraco.Web/WebApi/Filters/OnlyLocalRequestsAttribute.cs similarity index 92% rename from src/Umbraco.Web/Mvc/OnlyLocalRequestsAttribute.cs rename to src/Umbraco.Web/WebApi/Filters/OnlyLocalRequestsAttribute.cs index ed36e6e3df..6906519b17 100644 --- a/src/Umbraco.Web/Mvc/OnlyLocalRequestsAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/OnlyLocalRequestsAttribute.cs @@ -1,11 +1,10 @@ - using System.Net; using System.Net.Http; using System.Web.Http; using System.Web.Http.Controllers; using System.Web.Http.Filters; -namespace Umbraco.Web.Mvc +namespace Umbraco.Web.WebApi.Filters { public class OnlyLocalRequestsAttribute : ActionFilterAttribute {