V11: merge dev to contrib (#13438)
* V11: add test flakyness reporting (#13386) * update json-models-builders * Add reporting to all before each loops * Add commitId to env for pipelines * Test reports correctly * Bumb testhelper version * Update playwright-testhelpers version * Bumb playwright test-helper version * Bumb playwright-testhelpers version * Add AgentOs to yaml env * Bumb playwright-testhelper version * Try different AgentOS * Revert "Try different AgentOS" This reverts commit fc90620aef7af01ceffcdfbea7c9ef4dd02007f3. * Revert logo test * Add missing semicolons * Update package-lock.json * Add reports to Blocklist tests Co-authored-by: Zeegaan <nge@umbraco.dk> * V10: AllowedUploadFiles appsetting not working (#13408) * Add new Settings * Use new settings instead of old ones * Implement AllowedUploadedFiles value to be copied to AllowedUplayedFileExtensions * Obsolete old settings * Rename DisallowedUploadFileExtensions * Implement same fix for DisallowedUploadFiles * Use new settings for backoffice server variables * Update the correct setting Co-authored-by: Zeegaan <nge@umbraco.dk> * V11: Add compatibility suppressions (#13425) * Add suprressions * Revert "Add suprressions" This reverts commit 1c924ee967375870b6d86be9e9480ced0e22f8c7. * Update CompatibilitySuppressions.xml Co-authored-by: Ronald Barendse <ronald@barend.se> * Bump socket.io-parser from 4.0.4 to 4.0.5 in /src/Umbraco.Web.UI.Client Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.0.4 to 4.0.5. - [Release notes](https://github.com/socketio/socket.io-parser/releases) - [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io-parser/compare/4.0.4...4.0.5) --- updated-dependencies: - dependency-name: socket.io-parser dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * update block grid panel name (#13325) Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> * Bump async from 2.6.3 to 2.6.4 in /src/Umbraco.Web.UI.Client Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4. - [Release notes](https://github.com/caolan/async/releases) - [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md) - [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4) --- updated-dependencies: - dependency-name: async dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump eventsource from 1.1.0 to 1.1.2 in /src/Umbraco.Web.UI.Client Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.2. - [Release notes](https://github.com/EventSource/eventsource/releases) - [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md) - [Commits](https://github.com/EventSource/eventsource/compare/v1.1.0...v1.1.2) --- updated-dependencies: - dependency-name: eventsource dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump minimist from 1.2.5 to 1.2.7 in /src/Umbraco.Web.UI.Client Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.7. - [Release notes](https://github.com/minimistjs/minimist/releases) - [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md) - [Commits](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.7) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Management API: SearchController improvements (#13420) * remove typo of double PagedViewModel in response * add providerProperties with custom formatter * use a more descriptive variable name * use a more descriptive variable name for property types * generate new schema Co-authored-by: Zeegaan <nge@umbraco.dk> * Bump minimatch from 3.0.4 to 3.1.2 in /src/Umbraco.Web.UI.Client Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2. - [Release notes](https://github.com/isaacs/minimatch/releases) - [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2) --- updated-dependencies: - dependency-name: minimatch dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Zeegaan <nge@umbraco.dk> Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> Co-authored-by: Ronald Barendse <ronald@barend.se> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Blake Watt <bkclerke@users.noreply.github.com> Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
This commit is contained in:
@@ -19,7 +19,7 @@ public class SearcherSearchSearchController : SearchControllerBase
|
||||
|
||||
[HttpGet("searcher/{searcherName}/search")]
|
||||
[MapToApiVersion("1.0")]
|
||||
[ProducesResponseType(typeof(PagedViewModel<PagedViewModel<SearchResultViewModel>>), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(PagedViewModel<SearchResultViewModel>), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
|
||||
public async Task<ActionResult<PagedViewModel<SearchResultViewModel>>> GetSearchResults(string searcherName, string? query, int skip, int take)
|
||||
{
|
||||
|
||||
@@ -37,6 +37,21 @@ public class IndexViewModelFactory : IIndexViewModelFactory
|
||||
|
||||
Attempt<string?> isHealthy = indexDiag.IsHealthy();
|
||||
|
||||
var properties = new Dictionary<string, object?>();
|
||||
|
||||
foreach (var property in indexDiag.Metadata)
|
||||
{
|
||||
if (property.Value is null)
|
||||
{
|
||||
properties[property.Key] = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var propertyType = property.Value.GetType();
|
||||
properties[property.Key] = propertyType.IsClass && !propertyType.IsArray ? property.Value?.ToString() : property.Value;
|
||||
}
|
||||
}
|
||||
|
||||
var indexerModel = new IndexViewModel
|
||||
{
|
||||
Name = index.Name,
|
||||
@@ -45,6 +60,7 @@ public class IndexViewModelFactory : IIndexViewModelFactory
|
||||
SearcherName = index.Searcher.Name,
|
||||
DocumentCount = indexDiag.GetDocumentCount(),
|
||||
FieldCount = indexDiag.GetFieldNames().Count(),
|
||||
ProviderProperties = properties,
|
||||
};
|
||||
|
||||
return indexerModel;
|
||||
|
||||
@@ -2827,7 +2827,7 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/PagedPaged"
|
||||
"$ref": "#/components/schemas/PagedSearchResult"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4854,11 +4854,18 @@
|
||||
"additionalProperties": false
|
||||
},
|
||||
"Index": {
|
||||
"required": [
|
||||
"canRebuild",
|
||||
"documentCount",
|
||||
"fieldCount",
|
||||
"isHealthy",
|
||||
"name"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"healthStatus": {
|
||||
"type": "string",
|
||||
@@ -4882,6 +4889,11 @@
|
||||
"fieldCount": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"providerProperties": {
|
||||
"type": "object",
|
||||
"additionalProperties": {},
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
@@ -5754,26 +5766,6 @@
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"PagedPaged": {
|
||||
"required": [
|
||||
"items",
|
||||
"total"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/PagedSearchResult"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"PagedRecycleBinItem": {
|
||||
"required": [
|
||||
"items",
|
||||
|
||||
@@ -1,18 +1,27 @@
|
||||
namespace Umbraco.Cms.ManagementApi.ViewModels.Search;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Umbraco.Cms.ManagementApi.ViewModels.Search;
|
||||
|
||||
public class IndexViewModel
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; init; } = null!;
|
||||
|
||||
public string? HealthStatus { get; init; }
|
||||
|
||||
[Required]
|
||||
public bool IsHealthy => HealthStatus == "Healthy";
|
||||
|
||||
[Required]
|
||||
public bool CanRebuild { get; init; }
|
||||
|
||||
public string SearcherName { get; init; } = null!;
|
||||
|
||||
[Required]
|
||||
public long DocumentCount { get; init; }
|
||||
|
||||
[Required]
|
||||
public int FieldCount { get; init; }
|
||||
|
||||
public IReadOnlyDictionary<string, object?>? ProviderProperties { get; init; }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Umbraco.Cms.Core.Models.Blocks.BlockGridItem.get_ForceLeft</Target>
|
||||
<Left>lib/net7.0/Umbraco.Core.dll</Left>
|
||||
<Right>lib/net7.0/Umbraco.Core.dll</Right>
|
||||
<IsBaselineSuppression>true</IsBaselineSuppression>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Umbraco.Cms.Core.Models.Blocks.BlockGridItem.get_ForceRight</Target>
|
||||
<Left>lib/net7.0/Umbraco.Core.dll</Left>
|
||||
<Right>lib/net7.0/Umbraco.Core.dll</Right>
|
||||
<IsBaselineSuppression>true</IsBaselineSuppression>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Umbraco.Cms.Core.Models.Blocks.BlockGridItem.set_ForceLeft(System.Boolean)</Target>
|
||||
<Left>lib/net7.0/Umbraco.Core.dll</Left>
|
||||
<Right>lib/net7.0/Umbraco.Core.dll</Right>
|
||||
<IsBaselineSuppression>true</IsBaselineSuppression>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Umbraco.Cms.Core.Models.Blocks.BlockGridItem.set_ForceRight(System.Boolean)</Target>
|
||||
<Left>lib/net7.0/Umbraco.Core.dll</Left>
|
||||
<Right>lib/net7.0/Umbraco.Core.dll</Right>
|
||||
<IsBaselineSuppression>true</IsBaselineSuppression>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Umbraco.Cms.Core.Deploy.IDataTypeConfigurationConnector.FromArtifact(Umbraco.Cms.Core.Models.IDataType,System.String,Umbraco.Cms.Core.Deploy.IContextCache)</Target>
|
||||
|
||||
@@ -10,9 +10,9 @@ public static class ContentSettingsExtensions
|
||||
/// Allow upload if extension is whitelisted OR if there is no whitelist and extension is NOT blacklisted.
|
||||
/// </summary>
|
||||
public static bool IsFileAllowedForUpload(this ContentSettings contentSettings, string extension) =>
|
||||
contentSettings.AllowedUploadFiles.Any(x => x.InvariantEquals(extension)) ||
|
||||
(contentSettings.AllowedUploadFiles.Any() == false &&
|
||||
contentSettings.DisallowedUploadFiles.Any(x => x.InvariantEquals(extension)) == false);
|
||||
contentSettings.AllowedUploadedFileExtensions.Any(x => x.InvariantEquals(extension)) ||
|
||||
(contentSettings.AllowedUploadedFileExtensions.Any() == false &&
|
||||
contentSettings.DisallowedUploadedFileExtensions.Any(x => x.InvariantEquals(extension)) == false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the auto-fill configuration for a specified property alias.
|
||||
|
||||
@@ -196,11 +196,13 @@ public class ContentSettings
|
||||
/// Gets or sets a value for the collection of file extensions that are disallowed for upload.
|
||||
/// </summary>
|
||||
[DefaultValue(StaticDisallowedUploadFiles)]
|
||||
[Obsolete("Please use DisAllowedUploadedFileExtensions instead, scheduled for removal in V13")]
|
||||
public IEnumerable<string> DisallowedUploadFiles { get; set; } = StaticDisallowedUploadFiles.Split(',');
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value for the collection of file extensions that are allowed for upload.
|
||||
/// </summary>
|
||||
[Obsolete("Please use AllowedUploadedFileExtensions instead, scheduled for removal in V13")]
|
||||
public IEnumerable<string> AllowedUploadFiles { get; set; } = Array.Empty<string>();
|
||||
|
||||
/// <summary>
|
||||
@@ -249,4 +251,15 @@ public class ContentSettings
|
||||
/// </summary>
|
||||
[DefaultValue(StaticAllowEditInvariantFromNonDefault)]
|
||||
public bool AllowEditInvariantFromNonDefault { get; set; } = StaticAllowEditInvariantFromNonDefault;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value for the collection of file extensions that are allowed for upload.
|
||||
/// </summary>
|
||||
public string[] AllowedUploadedFileExtensions { get; set; } = Array.Empty<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value for the collection of file extensions that are disallowed for upload.
|
||||
/// </summary>
|
||||
[DefaultValue(StaticDisallowedUploadFiles)]
|
||||
public string[] DisallowedUploadedFileExtensions { get; set; } = StaticDisallowedUploadFiles.Split(',');
|
||||
}
|
||||
|
||||
@@ -117,6 +117,32 @@ public static partial class UmbracoBuilderExtensions
|
||||
}
|
||||
});
|
||||
|
||||
// TODO: Remove this in V13
|
||||
// This is to avoid a breaking change in ContentSettings, if the old AllowedFileUploads has a value, and the new
|
||||
// AllowedFileUploadExtensions does not, copy the value over, if the new has a value, use that instead.
|
||||
builder.Services.Configure<ContentSettings>(settings =>
|
||||
{
|
||||
// We have to use Config.GetSection().Get<string[]>, as the GetSection.GetValue<string[]> simply cannot retrieve a string array
|
||||
var allowedUploadedFileExtensionsValue = builder.Config.GetSection($"{Constants.Configuration.ConfigContent}:{nameof(ContentSettings.AllowedUploadedFileExtensions)}").Get<string[]>();
|
||||
var allowedUploadFilesValue = builder.Config.GetSection($"{Constants.Configuration.ConfigContent}:{nameof(ContentSettings.AllowedUploadFiles)}").Get<string[]>();
|
||||
|
||||
if (allowedUploadedFileExtensionsValue is null && allowedUploadFilesValue is not null)
|
||||
{
|
||||
settings.AllowedUploadedFileExtensions = allowedUploadFilesValue;
|
||||
}
|
||||
});
|
||||
|
||||
// TODO: Remove this in V13
|
||||
builder.Services.Configure<ContentSettings>(settings =>
|
||||
{
|
||||
var disallowedUploadedFileExtensionsValue = builder.Config.GetSection($"{Constants.Configuration.ConfigContent}:{nameof(ContentSettings.DisallowedUploadedFileExtensions)}").Get<string[]>();
|
||||
var disallowedUploadFilesValue = builder.Config.GetSection($"{Constants.Configuration.ConfigContent}:{nameof(ContentSettings.DisallowedUploadFiles)}").Get<string[]>();
|
||||
|
||||
if (disallowedUploadedFileExtensionsValue is null && disallowedUploadFilesValue is not null)
|
||||
{
|
||||
settings.DisallowedUploadedFileExtensions = disallowedUploadFilesValue;
|
||||
}
|
||||
});
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Umbraco.Cms.Core.Models.Blocks.BlockGridLayoutItem.get_ForceLeft</Target>
|
||||
<Left>lib/net7.0/Umbraco.Infrastructure.dll</Left>
|
||||
<Right>lib/net7.0/Umbraco.Infrastructure.dll</Right>
|
||||
<IsBaselineSuppression>true</IsBaselineSuppression>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Umbraco.Cms.Core.Models.Blocks.BlockGridLayoutItem.get_ForceRight</Target>
|
||||
<Left>lib/net7.0/Umbraco.Infrastructure.dll</Left>
|
||||
<Right>lib/net7.0/Umbraco.Infrastructure.dll</Right>
|
||||
<IsBaselineSuppression>true</IsBaselineSuppression>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Umbraco.Cms.Core.Models.Blocks.BlockGridLayoutItem.set_ForceLeft(System.Boolean)</Target>
|
||||
<Left>lib/net7.0/Umbraco.Infrastructure.dll</Left>
|
||||
<Right>lib/net7.0/Umbraco.Infrastructure.dll</Right>
|
||||
<IsBaselineSuppression>true</IsBaselineSuppression>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Umbraco.Cms.Core.Models.Blocks.BlockGridLayoutItem.set_ForceRight(System.Boolean)</Target>
|
||||
<Left>lib/net7.0/Umbraco.Infrastructure.dll</Left>
|
||||
<Right>lib/net7.0/Umbraco.Infrastructure.dll</Right>
|
||||
<IsBaselineSuppression>true</IsBaselineSuppression>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Umbraco.Cms.Core.Deploy.IGridCellValueConnector.GetValue(Umbraco.Cms.Core.Models.GridValue.GridControl,System.Collections.Generic.ICollection{Umbraco.Cms.Core.Deploy.ArtifactDependency},Umbraco.Cms.Core.Deploy.IContextCache)</Target>
|
||||
|
||||
@@ -543,11 +543,11 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
},
|
||||
{
|
||||
"disallowedUploadFiles",
|
||||
string.Join(",", _contentSettings.DisallowedUploadFiles)
|
||||
string.Join(",", _contentSettings.DisallowedUploadedFileExtensions)
|
||||
},
|
||||
{
|
||||
"allowedUploadFiles",
|
||||
string.Join(",", _contentSettings.AllowedUploadFiles)
|
||||
string.Join(",", _contentSettings.AllowedUploadedFileExtensions)
|
||||
},
|
||||
{
|
||||
"maxFileSize",
|
||||
|
||||
Reference in New Issue
Block a user