Merge branch 'contrib' into v11/dev
This commit is contained in:
12
.github/CONTRIBUTING.md
vendored
12
.github/CONTRIBUTING.md
vendored
@@ -103,7 +103,7 @@ Great question! The short version goes like this:
|
||||
|
||||
1. **Switch to the correct branch**
|
||||
|
||||
Switch to the `v11/contrib` branch
|
||||
Switch to the `contrib` branch
|
||||
|
||||
1. **Build**
|
||||
|
||||
@@ -111,7 +111,7 @@ Great question! The short version goes like this:
|
||||
|
||||
1. **Branch**
|
||||
|
||||
Create a new branch now and name it after the issue you're fixing, we usually follow the format: `temp-12345`. This means it's a temporary branch for the particular issue you're working on, in this case issue number `12345`. Don't commit to `v11/contrib`, create a new branch first.
|
||||
Create a new branch now and name it after the issue you're fixing, we usually follow the format: `temp-12345`. This means it's a temporary branch for the particular issue you're working on, in this case issue number `12345`. Don't commit to `contrib`, create a new branch first.
|
||||
|
||||
1. **Change**
|
||||
|
||||
@@ -121,7 +121,7 @@ Great question! The short version goes like this:
|
||||
|
||||
Done? Yay! 🎉
|
||||
|
||||
Remember to commit to your new `temp` branch, and don't commit to `v11/contrib`. Then you can push the changes up to your fork on GitHub.
|
||||
Remember to commit to your new `temp` branch, and don't commit to `contrib`. Then you can push the changes up to your fork on GitHub.
|
||||
|
||||
#### Keeping your Umbraco fork in sync with the main repository
|
||||
[sync fork]: #keeping-your-umbraco-fork-in-sync-with-the-main-repository
|
||||
@@ -138,10 +138,10 @@ Then when you want to get the changes from the main repository:
|
||||
|
||||
```
|
||||
git fetch upstream
|
||||
git rebase upstream/v11/contrib
|
||||
git rebase upstream/contrib
|
||||
```
|
||||
|
||||
In this command we're syncing with the `v11/contrib` branch, but you can of course choose another one if needed.
|
||||
In this command we're syncing with the `contrib` branch, but you can of course choose another one if needed.
|
||||
|
||||
[More information on how this works can be found on the thoughtbot blog.][sync fork ext]
|
||||
|
||||
@@ -169,7 +169,7 @@ We recommend you to [sync with our repository][sync fork] before you submit your
|
||||
GitHub will have picked up on the new branch you've pushed and will offer to create a Pull Request. Click that green button and away you go.
|
||||

|
||||
|
||||
We like to use [git flow][git flow] as much as possible, but don't worry if you are not familiar with it. The most important thing you need to know is that when you fork the Umbraco repository, the default branch is set to something, usually `v11/contrib`. If you are working on v9, this is the branch you should be targeting.
|
||||
We like to use [git flow][git flow] as much as possible, but don't worry if you are not familiar with it. The most important thing you need to know is that when you fork the Umbraco repository, the default branch is set to `contrib`. This is the branch you should be targeting.
|
||||
|
||||
Please note: we are no longer accepting features for v8 and below but will continue to merge security fixes as and when they arise.
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public class UmbracoPluginSettings
|
||||
".css", // styles
|
||||
".js", // scripts
|
||||
".jpg", ".jpeg", ".gif", ".png", ".svg", // images
|
||||
".eot", ".ttf", ".woff", // fonts
|
||||
".eot", ".ttf", ".woff", ".woff2", // fonts
|
||||
".xml", ".json", ".config", // configurations
|
||||
".lic", // license
|
||||
".map", // js map files
|
||||
|
||||
@@ -29,7 +29,7 @@ internal class ExpressionFilter : ILogFilter
|
||||
// If the expression is one word and doesn't contain a serilog operator then we can perform a like search
|
||||
if (!filterExpression.Contains(" ") && !filterExpression.ContainsAny(ExpressionOperators.Select(c => c)))
|
||||
{
|
||||
filter = PerformMessageLikeFilter(filterExpression);
|
||||
filter = PerformMessageLikeFilter(filterExpression, customSerilogFunctions);
|
||||
}
|
||||
|
||||
// check if it's a valid expression
|
||||
@@ -48,7 +48,7 @@ internal class ExpressionFilter : ILogFilter
|
||||
{
|
||||
// 'error' describes a syntax error, where it was unable to compile an expression
|
||||
// Assume the expression was a search string and make a Like filter from that
|
||||
filter = PerformMessageLikeFilter(filterExpression);
|
||||
filter = PerformMessageLikeFilter(filterExpression, customSerilogFunctions);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,10 @@ internal class ExpressionFilter : ILogFilter
|
||||
|
||||
public bool TakeLogEvent(LogEvent e) => _filter == null || _filter(e);
|
||||
|
||||
private Func<LogEvent, bool>? PerformMessageLikeFilter(string filterExpression)
|
||||
private Func<LogEvent, bool>? PerformMessageLikeFilter(string filterExpression, SerilogLegacyNameResolver serilogLegacyNameResolver)
|
||||
{
|
||||
var filterSearch = $"@Message like '%{SerilogExpression.EscapeLikeExpressionContent(filterExpression)}%'";
|
||||
if (SerilogExpression.TryCompile(filterSearch, out CompiledExpression? compiled, out var error))
|
||||
if (SerilogExpression.TryCompile(filterSearch, null, serilogLegacyNameResolver, out CompiledExpression? compiled, out var error))
|
||||
{
|
||||
// `compiled` is a function that can be executed against `LogEvent`s:
|
||||
return evt =>
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Dynamic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using Examine.Search;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
||||
@@ -15,6 +18,7 @@ using Umbraco.Cms.Core.Models.Entities;
|
||||
using Umbraco.Cms.Core.Models.Membership;
|
||||
using Umbraco.Cms.Core.Models.PublishedContent;
|
||||
using Umbraco.Cms.Core.Models.TemplateQuery;
|
||||
using Umbraco.Cms.Core.Persistence;
|
||||
using Umbraco.Cms.Core.Routing;
|
||||
using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
@@ -745,7 +749,11 @@ public class EntityController : UmbracoAuthorizedJsonController
|
||||
{
|
||||
return new PagedResult<EntityBasic>(0, 0, 0);
|
||||
}
|
||||
|
||||
//adding multiple conditions ,considering id,key & name as filter param
|
||||
//for id as int
|
||||
int.TryParse(filter, out int filterAsIntId);
|
||||
//for key as Guid
|
||||
Guid.TryParse(filter, out Guid filterAsGuid);
|
||||
// else proceed as usual
|
||||
entities = _entityService.GetPagedChildren(
|
||||
id,
|
||||
@@ -755,7 +763,9 @@ public class EntityController : UmbracoAuthorizedJsonController
|
||||
out long totalRecords,
|
||||
filter.IsNullOrWhiteSpace()
|
||||
? null
|
||||
: _sqlContext.Query<IUmbracoEntity>().Where(x => x.Name!.Contains(filter)),
|
||||
: _sqlContext.Query<IUmbracoEntity>().Where(x => x.Name!.Contains(filter)
|
||||
|| x.Id == filterAsIntId
|
||||
|| x.Key == filterAsGuid),
|
||||
Ordering.By(orderBy, orderDirection));
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class MemberManager : UmbracoUserManager<MemberIdentityUser, MemberPasswo
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> IsMemberAuthorizedAsync(
|
||||
public virtual async Task<bool> IsMemberAuthorizedAsync(
|
||||
IEnumerable<string>? allowTypes = null,
|
||||
IEnumerable<string>? allowGroups = null,
|
||||
IEnumerable<int>? allowMembers = null)
|
||||
@@ -122,14 +122,14 @@ public class MemberManager : UmbracoUserManager<MemberIdentityUser, MemberPasswo
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsLoggedIn()
|
||||
public virtual bool IsLoggedIn()
|
||||
{
|
||||
HttpContext? httpContext = _httpContextAccessor.HttpContext;
|
||||
return httpContext?.User.Identity?.IsAuthenticated ?? false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> MemberHasAccessAsync(string path)
|
||||
public virtual async Task<bool> MemberHasAccessAsync(string path)
|
||||
{
|
||||
if (await IsProtectedAsync(path))
|
||||
{
|
||||
@@ -140,7 +140,7 @@ public class MemberManager : UmbracoUserManager<MemberIdentityUser, MemberPasswo
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyDictionary<string, bool>> MemberHasAccessAsync(IEnumerable<string> paths)
|
||||
public virtual async Task<IReadOnlyDictionary<string, bool>> MemberHasAccessAsync(IEnumerable<string> paths)
|
||||
{
|
||||
IReadOnlyDictionary<string, bool> protectedPaths = await IsProtectedAsync(paths);
|
||||
|
||||
@@ -163,10 +163,10 @@ public class MemberManager : UmbracoUserManager<MemberIdentityUser, MemberPasswo
|
||||
/// <remarks>
|
||||
/// this is a cached call
|
||||
/// </remarks>
|
||||
public Task<bool> IsProtectedAsync(string path) => Task.FromResult(_publicAccessService.IsProtected(path).Success);
|
||||
public virtual Task<bool> IsProtectedAsync(string path) => Task.FromResult(_publicAccessService.IsProtected(path).Success);
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyDictionary<string, bool>> IsProtectedAsync(IEnumerable<string> paths)
|
||||
public virtual Task<IReadOnlyDictionary<string, bool>> IsProtectedAsync(IEnumerable<string> paths)
|
||||
{
|
||||
var result = new Dictionary<string, bool>();
|
||||
foreach (var path in paths)
|
||||
@@ -179,7 +179,7 @@ public class MemberManager : UmbracoUserManager<MemberIdentityUser, MemberPasswo
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<MemberIdentityUser?> GetCurrentMemberAsync()
|
||||
public virtual async Task<MemberIdentityUser?> GetCurrentMemberAsync()
|
||||
{
|
||||
if (_currentMember == null)
|
||||
{
|
||||
@@ -194,7 +194,7 @@ public class MemberManager : UmbracoUserManager<MemberIdentityUser, MemberPasswo
|
||||
return _currentMember;
|
||||
}
|
||||
|
||||
public IPublishedContent? AsPublishedMember(MemberIdentityUser user) => _store.GetPublishedMember(user);
|
||||
public virtual IPublishedContent? AsPublishedMember(MemberIdentityUser user) => _store.GetPublishedMember(user);
|
||||
|
||||
/// <summary>
|
||||
/// This will check if the member has access to this path
|
||||
|
||||
@@ -126,7 +126,7 @@ public class MemberSignInManager : UmbracoSignInManager<MemberIdentityUser>, IMe
|
||||
/// <summary>
|
||||
/// Custom ExternalLoginSignInAsync overload for handling external sign in with auto-linking
|
||||
/// </summary>
|
||||
public async Task<SignInResult> ExternalLoginSignInAsync(ExternalLoginInfo loginInfo, bool isPersistent, bool bypassTwoFactor = false)
|
||||
public virtual async Task<SignInResult> ExternalLoginSignInAsync(ExternalLoginInfo loginInfo, bool isPersistent, bool bypassTwoFactor = false)
|
||||
{
|
||||
// borrowed from https://github.com/dotnet/aspnetcore/blob/master/src/Identity/Core/src/SignInManager.cs
|
||||
// to be able to deal with auto-linking and reduce duplicate lookups
|
||||
|
||||
12
src/Umbraco.Web.UI.Client/package-lock.json
generated
12
src/Umbraco.Web.UI.Client/package-lock.json
generated
@@ -16459,9 +16459,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/ua-parser-js": {
|
||||
"version": "0.7.31",
|
||||
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz",
|
||||
"integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==",
|
||||
"version": "0.7.33",
|
||||
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.33.tgz",
|
||||
"integrity": "sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -30236,9 +30236,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"ua-parser-js": {
|
||||
"version": "0.7.31",
|
||||
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz",
|
||||
"integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==",
|
||||
"version": "0.7.33",
|
||||
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.33.tgz",
|
||||
"integrity": "sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==",
|
||||
"dev": true
|
||||
},
|
||||
"unbox-primitive": {
|
||||
|
||||
@@ -69,8 +69,9 @@ Use this directive to render an avatar.
|
||||
}
|
||||
|
||||
function getNameInitials(name) {
|
||||
if(name) {
|
||||
var names = name.split(' '),
|
||||
if (name) {
|
||||
const notAllowed = /[\[\]\{\}\*\?\&\$\@\!\(\)\%\#]+/g;
|
||||
var names = name.replace(notAllowed,'').trim().split(' '),
|
||||
initials = names[0].substring(0, 1);
|
||||
|
||||
if (names.length > 1) {
|
||||
|
||||
@@ -80,12 +80,12 @@ function listViewController($scope, $interpolate, $routeParams, $injector, $time
|
||||
var idsWithPermissions = null;
|
||||
|
||||
$scope.buttonPermissions = {
|
||||
canCopy: true,
|
||||
canCreate: true,
|
||||
canDelete: true,
|
||||
canMove: true,
|
||||
canPublish: true,
|
||||
canUnpublish: true
|
||||
canCopy: false,
|
||||
canCreate: false,
|
||||
canDelete: false,
|
||||
canMove: false,
|
||||
canPublish: false,
|
||||
canUnpublish: false
|
||||
};
|
||||
|
||||
$scope.$watch("selection.length", function (newVal, oldVal) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<ng-form name="rteForm">
|
||||
<div class="umb-rte-editor-con">
|
||||
<input type="text" id="{{model.alias}}" ng-focus="focus()" name="modelValue" ng-model="model.value" style="position:absolute;top:0;width:0;height:0;" />
|
||||
<input type="text" id="{{model.alias}}" ng-focus="focus()" name="modelValue" ng-model="model.value" style="position:absolute;top:0;width:0;height:0;padding:0;border:none;" />
|
||||
<div disable-hotkeys id="{{textAreaHtmlId}}" class="umb-rte-editor" ng-style="{ width: containerWidth, height: containerHeight, overflow: containerOverflow}"></div>
|
||||
</div>
|
||||
</ng-form>
|
||||
|
||||
@@ -197,6 +197,8 @@ public class LogviewerTests
|
||||
[TestCase("@mt = '{EndMessage} ({Duration}ms) [Timing {TimingId}]'", 26)]
|
||||
[TestCase("SortedComponentTypes[?] = 'Umbraco.Web.Search.ExamineComponent'", 1)]
|
||||
[TestCase("Contains(SortedComponentTypes[?], 'DatabaseServer')", 1)]
|
||||
[TestCase("@Message like '%definition%'", 6)]
|
||||
[TestCase("definition", 6)]
|
||||
[Test]
|
||||
public void Logs_Can_Query_With_Expressions(string queryToVerify, int expectedCount)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user