Merge branch 'temp8' into temp8-implement-GetByContentType-nucache

This commit is contained in:
Shannon
2019-02-14 16:51:07 +11:00
12 changed files with 87 additions and 51 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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,

View File

@@ -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 {

View File

@@ -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;}

View File

@@ -13,12 +13,15 @@
<div class="input-append">
<input
name="datepicker"
id="{{model.alias}}"
type="text"
id="{{model.alias}}"
type="text"
ng-model="model.datetimePickerValue"
ng-required="model.validation.mandatory"
val-server="value"
val-server="value"
class="datepickerinput">
<span class="on-top" ng-click="clearDate()" ng-show="hasDatetimePickerValue === true || datePickerForm.datepicker.$error.pickerError === true">
<i class="icon-delete"></i>
</span>
<span class="add-on">
<i class="icon-calendar"></i>
</span>
@@ -38,9 +41,6 @@
<small><localize key="content_scheduledPublishServerTime">This translates to the following time on the server:</localize> {{serverTime}}</small><br />
<small><localize key="content_scheduledPublishDocumentation">What does this mean?</localize></small>
</p>
<p ng-show="hasDatetimePickerValue === true || datePickerForm.datepicker.$error.pickerError === true">
<a href ng-click="clearDate()"><i class="icon-delete"></i><small><localize key="content_removeDate">Clear date</localize></small></a>
</p>
</ng-form>
</div>

View File

@@ -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
/// </summary>
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
/// </summary>
/// <param name="actionContext"></param>
/// <param name="contentItem"></param>
private bool ValidateUserAccess(ContentItemSave contentItem, HttpActionContext actionContext)
/// <param name="webSecurity"></param>
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());

View File

@@ -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
{

View File

@@ -21,9 +21,9 @@ namespace Umbraco.Web.Security
/// <summary>
/// A utility class used for dealing with USER security in Umbraco
/// </summary>
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;
}
}
}

View File

@@ -207,7 +207,7 @@
<Compile Include="Models\Link.cs" />
<Compile Include="Models\LinkType.cs" />
<Compile Include="Models\TemplateQuery\OperatorFactory.cs" />
<Compile Include="Mvc\OnlyLocalRequestsAttribute.cs" />
<Compile Include="WebApi\Filters\OnlyLocalRequestsAttribute.cs" />
<Compile Include="PropertyEditors\MultiUrlPickerConfiguration.cs" />
<Compile Include="PropertyEditors\MultiUrlPickerConfigurationEditor.cs" />
<Compile Include="PropertyEditors\MultiUrlPickerPropertyEditor.cs" />

View File

@@ -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
{