Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V14/merge #14589

Merged
merged 28 commits into from Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a090997
Added missing Danish translation for `general_change` (#14461)
abjerner Jun 27, 2023
1d14158
fix: Allows copying from unsaved content (#14464)
nikcio Jun 27, 2023
1d239a3
Fix broken CookieAuthenticationRedirect caused by PR #14036 for non-a…
mwillebrands Jul 4, 2023
c4c524d
Merge branch 'v12/dev' into contrib
nul800sebastiaan Jul 4, 2023
41805af
Updated the package validation baseline version to 12.0.0 (#14389)
bergmania Jul 6, 2023
0da33d0
Fixes #12904 UmbracoHelper.GetDictionaryValue defaults to en-US when …
uppercuut Jul 6, 2023
0c595cc
Only show groups when any filtered results in group (#14505)
bjarnef Jul 6, 2023
dd697ab
Delete add-issues-to-review-project.yml
nul800sebastiaan Jul 11, 2023
2b62969
Make it possible to remove blocks using tab key in block grid configu…
bjarnef Jul 11, 2023
9926311
Bump tough-cookie from 4.1.2 to 4.1.3 in /src/Umbraco.Web.UI.Client
dependabot[bot] Jul 10, 2023
531ad2e
Improve Enum performance (#14384)
Nuklon Jul 17, 2023
d52dcb7
Use built-in Enum parse method, avoids keeping single-use Enums in me…
Nuklon Jul 17, 2023
ab836d2
V10: Find and persist embedded images in rich text (#14546)
iOvergaard Jul 18, 2023
ba423a0
V12: Add ISO codes to make the migration from language IDs easier (#1…
elit0451 Jul 18, 2023
dad49b8
Merge branch 'v12/dev' into contrib
nul800sebastiaan Jul 18, 2023
d1aac39
Restored order of operations on scope dispose to that used in Umbraco…
AndyButland Jul 18, 2023
43b44b1
remove submodule
iOvergaard Jul 19, 2023
4824fc8
Supress execution context flow when queuing email task. (#14571)
nikolajlauridsen Jul 19, 2023
3a857ab
Added tests for TopoGraph. (#14583)
AndyButland Jul 20, 2023
0ae404c
Extends JSON schema/Intellisense to full details of InstallDefaultDat…
AndyButland Jul 20, 2023
0884ee0
Merge remote-tracking branch 'origin/v10/dev' into v11/dev
nikolajlauridsen Jul 21, 2023
04a10be
Merge remote-tracking branch 'origin/v11/dev' into v12/dev
nikolajlauridsen Jul 21, 2023
28dae03
Merge remote-tracking branch 'origin/v12/dev' into v13/dev
nikolajlauridsen Jul 21, 2023
7753df4
Merge v13/dev
nikolajlauridsen Jul 21, 2023
a4c287f
Try re-adding submodule
nikolajlauridsen Jul 21, 2023
90598dc
Re-add package validation skips
nikolajlauridsen Jul 21, 2023
473c272
Undo props changes
nikolajlauridsen Jul 21, 2023
7ed856a
Comment out richtext test
nikolajlauridsen Jul 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 0 additions & 58 deletions .github/workflows/add-issues-to-review-project.yml

This file was deleted.

5 changes: 1 addition & 4 deletions src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj
Expand Up @@ -2,10 +2,6 @@
<PropertyGroup>
<Title>Umbraco CMS - API Common</Title>
<Description>Contains the bits and pieces that are shared between the Umbraco CMS APIs.</Description>
<IsPackable>true</IsPackable>
<EnablePackageValidation>false</EnablePackageValidation>
<AssemblyName>Umbraco.Cms.Api.Common</AssemblyName>
<RootNamespace>Umbraco.Cms.Api.Common</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand All @@ -19,6 +15,7 @@
<PackageReference Include="OpenIddict.Abstractions" Version="4.5.0" />
<PackageReference Include="OpenIddict.AspNetCore" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Umbraco.Cms.Persistence.EFCore.Sqlite\Umbraco.Cms.Persistence.EFCore.Sqlite.csproj" />
<ProjectReference Include="..\Umbraco.Cms.Persistence.EFCore.SqlServer\Umbraco.Cms.Persistence.EFCore.SqlServer.csproj" />
Expand Down
6 changes: 0 additions & 6 deletions src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj
Expand Up @@ -2,14 +2,8 @@
<PropertyGroup>
<Title>Umbraco CMS - Delivery API</Title>
<Description>Contains the presentation layer for the Umbraco CMS Delivery API.</Description>
<IsPackable>true</IsPackable>
<EnablePackageValidation>false</EnablePackageValidation>
<AssemblyName>Umbraco.Cms.Api.Delivery</AssemblyName>
<RootNamespace>Umbraco.Cms.Api.Delivery</RootNamespace>
<PackageId>Umbraco.Cms.Api.Delivery</PackageId>
</PropertyGroup>


<ItemGroup>
<ProjectReference Include="..\Umbraco.Cms.Api.Common\Umbraco.Cms.Api.Common.csproj" />
<ProjectReference Include="..\Umbraco.Infrastructure\Umbraco.Infrastructure.csproj" />
Expand Down
Expand Up @@ -2,8 +2,6 @@
<PropertyGroup>
<Title>Umbraco CMS - Imaging - ImageSharp 2</Title>
<Description>Adds imaging support using ImageSharp/ImageSharp.Web version 2 to Umbraco CMS.</Description>
<!-- TODO: Enable when final version is shipped (because there's currently no previous version) -->
<EnablePackageValidation>false</EnablePackageValidation>
</PropertyGroup>

<ItemGroup>
Expand Down
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Title>Umbraco CMS - EF Core - SqlServer migrations</Title>
<Title>Umbraco CMS - Persistence - Entity Framework Core - SQL Server migrations</Title>
<Description>Adds support for Entity Framework Core SQL Server migrations to Umbraco CMS.</Description>
<!-- TODO: Enable when final version is shipped (because there's currently no previous version) -->
<EnablePackageValidation>false</EnablePackageValidation>
</PropertyGroup>
Expand Down
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Title>Umbraco CMS - EF Core - Sqlite migrations</Title>
<Title>Umbraco CMS - Persistence - Entity Framework Core - SQLite migrations</Title>
<Description>Adds support for Entity Framework Core SQLite migrations to Umbraco CMS.</Description>
<!-- TODO: Enable when final version is shipped (because there's currently no previous version) -->
<EnablePackageValidation>false</EnablePackageValidation>
</PropertyGroup>
Expand Down
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Title>Umbraco CMS - Persistence - EFCore</Title>
<!-- TODO: Enable when final version is shipped (because there's currently no previous version) -->
<EnablePackageValidation>false</EnablePackageValidation>
<Title>Umbraco CMS - Persistence - Entity Framework Core</Title>
<Description>Adds support for Entity Framework Core to Umbraco CMS.</Description>
</PropertyGroup>

<ItemGroup>
Expand All @@ -21,5 +20,4 @@
<_Parameter1>Umbraco.Tests.Integration</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

</Project>
Expand Up @@ -81,15 +81,16 @@ public override DatabaseType GetUpdatedDatabaseType(DatabaseType current, string
var setting = _globalSettings.Value.DatabaseFactoryServerVersion;
var fromSettings = false;

if (setting.IsNullOrWhiteSpace() || !setting.StartsWith("SqlServer.")
|| !Enum<VersionName>.TryParse(setting.Substring("SqlServer.".Length), out VersionName versionName, true))
if (setting.IsNullOrWhiteSpace() || !setting.StartsWith("SqlServer.") || !Enum.TryParse(setting.AsSpan("SqlServer.".Length), true, out VersionName versionName))
{
versionName = GetSetVersion(connectionString, ProviderName, _logger).ProductVersionName;
}

if (_logger.IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug))
{
_logger.LogDebug("SqlServer {SqlServerVersion}, DatabaseType is {DatabaseType} ({Source}).", versionName, DatabaseType.SqlServer2012, fromSettings ? "settings" : "detected");
}

return DatabaseType.SqlServer2012;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Umbraco.Core/Configuration/Models/ContentSettings.cs
Expand Up @@ -191,7 +191,7 @@ public class ContentSettings
/// Gets or sets a value for the macro error behaviour.
/// </summary>
[DefaultValue(StaticMacroErrors)]
public MacroErrorBehaviour MacroErrors { get; set; } = Enum<MacroErrorBehaviour>.Parse(StaticMacroErrors);
public MacroErrorBehaviour MacroErrors { get; set; } = Enum.Parse<MacroErrorBehaviour>(StaticMacroErrors);

/// <summary>
/// Gets or sets a value for the collection of file extensions that are disallowed for upload.
Expand Down Expand Up @@ -243,7 +243,7 @@ public class ContentSettings
public bool DisableUnpublishWhenReferenced { get; set; } = StaticDisableUnpublishWhenReferenced;

/// <summary>
/// Get or sets the model representing the global content version cleanup policy
/// Gets or sets the model representing the global content version cleanup policy
/// </summary>
public ContentVersionCleanupPolicySettings ContentVersionCleanupPolicy { get; set; } = new();

Expand Down
Expand Up @@ -25,8 +25,7 @@ public class HealthChecksNotificationMethodSettings
/// Gets or sets a value for the health check notifications reporting verbosity.
/// </summary>
[DefaultValue(StaticVerbosity)]
public HealthCheckNotificationVerbosity Verbosity { get; set; } =
Enum<HealthCheckNotificationVerbosity>.Parse(StaticVerbosity);
public HealthCheckNotificationVerbosity Verbosity { get; set; } = Enum.Parse<HealthCheckNotificationVerbosity>(StaticVerbosity);

/// <summary>
/// Gets or sets a value indicating whether the health check notifications should occur on failures only.
Expand Down
3 changes: 1 addition & 2 deletions src/Umbraco.Core/Configuration/Models/HostingSettings.cs
Expand Up @@ -23,8 +23,7 @@ public class HostingSettings
/// Gets or sets a value for the location of temporary files.
/// </summary>
[DefaultValue(StaticLocalTempStorageLocation)]
public LocalTempStorage LocalTempStorageLocation { get; set; } =
Enum<LocalTempStorage>.Parse(StaticLocalTempStorageLocation);
public LocalTempStorage LocalTempStorageLocation { get; set; } = Enum.Parse<LocalTempStorage>(StaticLocalTempStorageLocation);

/// <summary>
/// Gets or sets a value indicating whether umbraco is running in [debug mode].
Expand Down
Expand Up @@ -22,7 +22,7 @@ public class ModelsBuilderSettings
/// Gets or sets a value for the models mode.
/// </summary>
[DefaultValue(StaticModelsMode)]
public ModelsMode ModelsMode { get; set; } = Enum<ModelsMode>.Parse(StaticModelsMode);
public ModelsMode ModelsMode { get; set; } = Enum.Parse<ModelsMode>(StaticModelsMode);

/// <summary>
/// Gets or sets a value for models namespace.
Expand Down Expand Up @@ -52,10 +52,9 @@ public bool FlagOutOfDateModels
return _flagOutOfDateModels;
}

set => _flagOutOfDateModels = value;
set => _flagOutOfDateModels = value;
}


/// <summary>
/// Gets or sets a value for the models directory.
/// </summary>
Expand Down
3 changes: 1 addition & 2 deletions src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs
Expand Up @@ -24,8 +24,7 @@ public class NuCacheSettings
/// The serializer type that nucache uses to persist documents in the database.
/// </summary>
[DefaultValue(StaticNuCacheSerializerType)]
public NuCacheSerializerType NuCacheSerializerType { get; set; } =
Enum<NuCacheSerializerType>.Parse(StaticNuCacheSerializerType);
public NuCacheSerializerType NuCacheSerializerType { get; set; } = Enum.Parse<NuCacheSerializerType>(StaticNuCacheSerializerType);

/// <summary>
/// The paging size to use for nucache SQL queries.
Expand Down
Expand Up @@ -19,8 +19,7 @@ public class RuntimeMinificationSettings
/// The cache buster type to use
/// </summary>
[DefaultValue(StaticCacheBuster)]
public RuntimeMinificationCacheBuster CacheBuster { get; set; } =
Enum<RuntimeMinificationCacheBuster>.Parse(StaticCacheBuster);
public RuntimeMinificationCacheBuster CacheBuster { get; set; } = Enum.Parse<RuntimeMinificationCacheBuster>(StaticCacheBuster);

/// <summary>
/// The unique version string used if CacheBuster is 'Version'.
Expand Down
5 changes: 2 additions & 3 deletions src/Umbraco.Core/Configuration/Models/SmtpSettings.cs
Expand Up @@ -74,8 +74,7 @@ public class SmtpSettings : ValidatableEntryBase
/// Gets or sets a value for the secure socket options.
/// </summary>
[DefaultValue(StaticSecureSocketOptions)]
public SecureSocketOptions SecureSocketOptions { get; set; } =
Enum<SecureSocketOptions>.Parse(StaticSecureSocketOptions);
public SecureSocketOptions SecureSocketOptions { get; set; } = Enum.Parse<SecureSocketOptions>(StaticSecureSocketOptions);

/// <summary>
/// Gets or sets a value for the SMTP pick-up directory.
Expand All @@ -86,7 +85,7 @@ public class SmtpSettings : ValidatableEntryBase
/// Gets or sets a value for the SMTP delivery method.
/// </summary>
[DefaultValue(StaticDeliveryMethod)]
public SmtpDeliveryMethod DeliveryMethod { get; set; } = Enum<SmtpDeliveryMethod>.Parse(StaticDeliveryMethod);
public SmtpDeliveryMethod DeliveryMethod { get; set; } = Enum.Parse<SmtpDeliveryMethod>(StaticDeliveryMethod);

/// <summary>
/// Gets or sets a value for the SMTP user name.
Expand Down
Expand Up @@ -75,7 +75,7 @@ public class WebRoutingSettings
/// Gets or sets a value for the URL provider mode (<see cref="UrlMode" />).
/// </summary>
[DefaultValue(StaticUrlProviderMode)]
public UrlMode UrlProviderMode { get; set; } = Enum<UrlMode>.Parse(StaticUrlProviderMode);
public UrlMode UrlProviderMode { get; set; } = Enum.Parse<UrlMode>(StaticUrlProviderMode);

/// <summary>
/// Gets or sets a value for the Umbraco application URL.
Expand Down
4 changes: 4 additions & 0 deletions src/Umbraco.Core/Dictionary/ICultureDictionaryFactory.cs
@@ -1,6 +1,10 @@
using System.Globalization;

namespace Umbraco.Cms.Core.Dictionary;

public interface ICultureDictionaryFactory
{
ICultureDictionary CreateDictionary();

ICultureDictionary CreateDictionary(CultureInfo specificCulture) => throw new NotImplementedException();
}
3 changes: 2 additions & 1 deletion src/Umbraco.Core/Dictionary/UmbracoCultureDictionary.cs
@@ -1,4 +1,5 @@
using System.Globalization;
using System.Text.RegularExpressions;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
Expand Down Expand Up @@ -47,7 +48,7 @@ public DefaultCultureDictionary(CultureInfo specificCulture, ILocalizationServic
}

/// <summary>
/// Returns the current culture
/// Returns the defualt umbraco's back office culture
/// </summary>
public CultureInfo Culture => _specificCulture ?? Thread.CurrentThread.CurrentUICulture;

Expand Down
@@ -1,3 +1,4 @@
using System.Globalization;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Services;

Expand All @@ -23,4 +24,7 @@ public DefaultCultureDictionaryFactory(ILocalizationService localizationService,

public ICultureDictionary CreateDictionary() =>
new DefaultCultureDictionary(_localizationService, _appCaches.RequestCache);

public ICultureDictionary CreateDictionary(CultureInfo specificCulture) =>
new DefaultCultureDictionary(specificCulture, _localizationService, _appCaches.RequestCache);
}
29 changes: 8 additions & 21 deletions src/Umbraco.Core/Enum.cs
Expand Up @@ -22,7 +22,7 @@ static Enum()
IntToValue = new Dictionary<int, T>();
ValueToName = new Dictionary<T, string>();
SensitiveNameToValue = new Dictionary<string, T>();
InsensitiveNameToValue = new Dictionary<string, T>();
InsensitiveNameToValue = new Dictionary<string, T>(StringComparer.InvariantCultureIgnoreCase);

foreach (T value in Values)
{
Expand All @@ -31,15 +31,15 @@ static Enum()
IntToValue[Convert.ToInt32(value)] = value;
ValueToName[value] = name!;
SensitiveNameToValue[name!] = value;
InsensitiveNameToValue[name!.ToLowerInvariant()] = value;
InsensitiveNameToValue[name!] = value;
}
}

public static bool IsDefined(T value) => ValueToName.Keys.Contains(value);
public static bool IsDefined(T value) => ValueToName.ContainsKey(value);

public static bool IsDefined(string value) => SensitiveNameToValue.Keys.Contains(value);
public static bool IsDefined(string value) => SensitiveNameToValue.ContainsKey(value);

public static bool IsDefined(int value) => IntToValue.Keys.Contains(value);
public static bool IsDefined(int value) => IntToValue.ContainsKey(value);

public static IEnumerable<T> GetValues() => Values;

Expand All @@ -50,28 +50,15 @@ static Enum()
public static T Parse(string value, bool ignoreCase = false)
{
Dictionary<string, T> names = ignoreCase ? InsensitiveNameToValue : SensitiveNameToValue;
if (ignoreCase)
{
value = value.ToLowerInvariant();
}

if (names.TryGetValue(value, out T parsed))
{
return parsed;
}
return names.TryGetValue(value, out T parsed) ? parsed : Throw();

throw new ArgumentException(
$"Value \"{value}\"is not a valid {typeof(T).Name} enumeration value.",
nameof(value));
T Throw() => throw new ArgumentException($"Value \"{value}\"is not a valid {typeof(T).Name} enumeration value.", nameof(value));
}

public static bool TryParse(string value, out T returnValue, bool ignoreCase = false)
{
Dictionary<string, T> names = ignoreCase ? InsensitiveNameToValue : SensitiveNameToValue;
if (ignoreCase)
{
value = value.ToLowerInvariant();
}

return names.TryGetValue(value, out returnValue);
}
Expand All @@ -83,7 +70,7 @@ public static bool TryParse(string value, out T returnValue, bool ignoreCase = f
return null;
}

if (InsensitiveNameToValue.TryGetValue(value.ToLowerInvariant(), out T parsed))
if (InsensitiveNameToValue.TryGetValue(value, out T parsed))
{
return parsed;
}
Expand Down
3 changes: 3 additions & 0 deletions src/Umbraco.Core/Models/DictionaryItem.cs
Expand Up @@ -34,6 +34,9 @@ public DictionaryItem(Guid? parentId, string itemKey)
_translations = new List<IDictionaryTranslation>();
}

[Obsolete("This will be removed in V14.")]
public Func<int, ILanguage?>? GetLanguage { get; set; }

/// <summary>
/// Gets or Sets the Parent Id of the Dictionary Item
/// </summary>
Expand Down
6 changes: 5 additions & 1 deletion src/Umbraco.Core/Models/IDictionaryTranslation.cs
Expand Up @@ -5,10 +5,14 @@ namespace Umbraco.Cms.Core.Models;

public interface IDictionaryTranslation : IEntity, IRememberBeingDirty
{
/// <summary>
/// Gets the ISO code of the language.
/// </summary>
[DataMember]
string LanguageIsoCode { get; }

/// <summary>
/// Gets or sets the translated text
/// Gets or sets the translated text.
/// </summary>
[DataMember]
string Value { get; set; }
Expand Down