Skip to content

Commit 4c616dc

Browse files
committed
Merge branch 'v9/dev' into v9/feature/add-notifcation-for-url-collision
2 parents e64d1ff + 5fe30c7 commit 4c616dc

File tree

44 files changed

+1256
-611
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1256
-611
lines changed

build/templates/UmbracoProject/UmbracoProject.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot/media/**;</DefaultItemExcludes>
99
</PropertyGroup>
1010

11+
<!-- Force windows to use ICU. Otherwise Windows 10 2019H1+ will do it, but older windows 10 and most if not all winodws servers will run NLS -->
12+
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
13+
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.6" />
14+
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2" />
15+
</ItemGroup>
16+
1117
<ItemGroup>
1218
<PackageReference Include="Umbraco.Cms" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
1319
<PackageReference Include="Umbraco.Cms.SqlCe" Version="UMBRACO_VERSION_FROM_TEMPLATE" Condition="'$(UseSqlCe)' == 'true'" />
@@ -30,6 +36,10 @@
3036
<Compile Include="umbraco/models/**" Exclude="**/*.flag" />
3137
</ItemGroup>
3238

39+
<PropertyGroup>
40+
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
41+
</PropertyGroup>
42+
3343
<!-- Set this to true if ModelsBuilder mode is not InMemoryAuto-->
3444
<PropertyGroup>
3545
<RazorCompileOnBuild>false</RazorCompileOnBuild>

src/JsonSchema/AppSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public class CmsDefinition
4747
public RichTextEditorSettings RichTextEditor { get; set; }
4848
public RuntimeMinificationSettings RuntimeMinification { get; set; }
4949
public BasicAuthSettings BasicAuth { get; set; }
50+
public PackageMigrationSettings PackageMigration { get; set; }
5051
}
5152

5253
/// <summary>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright (c) Umbraco.
2+
// See LICENSE for more details.
3+
4+
using System.ComponentModel;
5+
6+
namespace Umbraco.Cms.Core.Configuration.Models
7+
{
8+
/// <summary>
9+
/// Typed configuration options for package migration settings.
10+
/// </summary>
11+
[UmbracoOptions(Constants.Configuration.ConfigPackageMigration)]
12+
public class PackageMigrationSettings
13+
{
14+
private const bool StaticRunSchemaAndContentMigrations = true;
15+
private const bool StaticAllowComponentOverrideOfRunSchemaAndContentMigrations = true;
16+
17+
/// <summary>
18+
/// Gets or sets a value indicating whether package migration steps that install schema and content should run.
19+
/// </summary>
20+
/// <remarks>
21+
/// By default this is true and schema and content defined in a package migration are installed.
22+
/// Using configuration, administrators can optionally switch this off in certain environments.
23+
/// Deployment tools such as Umbraco Deploy can also configure this option to run or not run these migration
24+
/// steps as is appropriate for normal use of the tool.
25+
/// </remarks>
26+
[DefaultValue(StaticRunSchemaAndContentMigrations)]
27+
public bool RunSchemaAndContentMigrations { get; set; } = StaticRunSchemaAndContentMigrations;
28+
29+
/// <summary>
30+
/// Gets or sets a value indicating whether components can override the configured value for <see cref="RunSchemaAndContentMigrations"/>.
31+
/// </summary>
32+
/// <remarks>
33+
/// By default this is true and components can override the configured setting for <see cref="RunSchemaAndContentMigrations"/>.
34+
/// If an administrator wants explicit control over which environments migration steps installing schema and content can run,
35+
/// they can set this to false. Components should respect this and not override the configuration.
36+
/// </remarks>
37+
[DefaultValue(StaticAllowComponentOverrideOfRunSchemaAndContentMigrations)]
38+
public bool AllowComponentOverrideOfRunSchemaAndContentMigrations { get; set; } = StaticAllowComponentOverrideOfRunSchemaAndContentMigrations;
39+
}
40+
}

src/Umbraco.Core/Configuration/Models/RuntimeMinificationSettings.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public class RuntimeMinificationSettings
77
{
88
internal const bool StaticUseInMemoryCache = false;
99
internal const string StaticCacheBuster = "Version";
10+
internal const string StaticVersion = null;
1011

1112
/// <summary>
1213
/// Use in memory cache
@@ -19,5 +20,11 @@ public class RuntimeMinificationSettings
1920
/// </summary>
2021
[DefaultValue(StaticCacheBuster)]
2122
public RuntimeMinificationCacheBuster CacheBuster { get; set; } = Enum<RuntimeMinificationCacheBuster>.Parse(StaticCacheBuster);
23+
24+
/// <summary>
25+
/// The unique version string used if CacheBuster is 'Version'.
26+
/// </summary>
27+
[DefaultValue(StaticVersion)]
28+
public string Version { get; set; } = StaticVersion;
2229
}
2330
}

src/Umbraco.Core/Configuration/Models/UnattendedSettings.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
using System.ComponentModel;
1+
// Copyright (c) Umbraco.
2+
// See LICENSE for more details.
3+
4+
using System.ComponentModel;
25
using System.ComponentModel.DataAnnotations;
36

47
namespace Umbraco.Cms.Core.Configuration.Models
58
{
6-
79
/// <summary>
810
/// Typed configuration options for unattended settings.
911
/// </summary>
1012
[UmbracoOptions(Constants.Configuration.ConfigUnattended)]
1113
public class UnattendedSettings
1214
{
13-
internal const bool StaticInstallUnattended = false;
14-
internal const bool StaticUpgradeUnattended = false;
15+
private const bool StaticInstallUnattended = false;
16+
private const bool StaticUpgradeUnattended = false;
1517

1618
/// <summary>
1719
/// Gets or sets a value indicating whether unattended installs are enabled.

src/Umbraco.Core/Constants-Configuration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public static class Configuration
5252
public const string ConfigWebRouting = ConfigPrefix + "WebRouting";
5353
public const string ConfigUserPassword = ConfigPrefix + "Security:UserPassword";
5454
public const string ConfigRichTextEditor = ConfigPrefix + "RichTextEditor";
55+
public const string ConfigPackageMigration = ConfigPrefix + "PackageMigration";
5556
}
5657
}
5758
}

src/Umbraco.Web.Common/DependencyInjection/StaticServiceProvider.cs renamed to src/Umbraco.Core/DependencyInjection/StaticServiceProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
namespace Umbraco.Cms.Web.Common.DependencyInjection
55
{
66
/// <summary>
7-
/// INTERNAL Service locator. Should only be used if no other ways exist.
7+
/// Service locator for internal (umbraco cms) only purposes. Should only be used if no other ways exist.
88
/// </summary>
99
/// <remarks>
1010
/// It is created with only two goals in mind
1111
/// 1) Continue to have the same extension methods on IPublishedContent and IPublishedElement as in V8. To make migration easier.
12-
/// 2) To have a tool to avoid breaking changes in minor versions. All methods using this should in theory be obsolete.
12+
/// 2) To have a tool to avoid breaking changes in minor and patch versions. All methods using this should in theory be obsolete.
1313
///
1414
/// Keep in mind, every time this is used, the code becomes basically untestable.
1515
/// </remarks>
1616
[EditorBrowsable(EditorBrowsableState.Never)]
17-
internal static class StaticServiceProvider
17+
public static class StaticServiceProvider
1818
{
1919
/// <summary>
2020
/// The service locator.
2121
/// </summary>
2222
[EditorBrowsable(EditorBrowsableState.Never)]
23-
internal static IServiceProvider Instance { get; set; }
23+
public static IServiceProvider Instance { get; set; }
2424
}
2525
}

src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public static IUmbracoBuilder AddConfiguration(this IUmbracoBuilder builder)
7272
.AddUmbracoOptions<UnattendedSettings>()
7373
.AddUmbracoOptions<RichTextEditorSettings>()
7474
.AddUmbracoOptions<BasicAuthSettings>()
75-
.AddUmbracoOptions<RuntimeMinificationSettings>();
75+
.AddUmbracoOptions<RuntimeMinificationSettings>()
76+
.AddUmbracoOptions<PackageMigrationSettings>();
7677

7778
return builder;
7879
}

src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
using Umbraco.Cms.Core.Sync;
3939
using Umbraco.Cms.Core.Templates;
4040
using Umbraco.Cms.Core.Web;
41+
using Umbraco.Cms.Web.Common.DependencyInjection;
4142
using Umbraco.Extensions;
4243

4344
namespace Umbraco.Cms.Core.DependencyInjection
@@ -179,6 +180,7 @@ private void AddCoreServices()
179180
Services.AddUnique<UriUtility>();
180181

181182
Services.AddUnique<IDashboardService, DashboardService>();
183+
Services.AddUnique<IUserDataService, UserDataService>();
182184

183185
// will be injected in controllers when needed to invoke rest endpoints on Our
184186
Services.AddUnique<IInstallationService, InstallationService>();

src/Umbraco.Core/Models/UserData.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Runtime.Serialization;
2+
3+
namespace Umbraco.Cms.Core.Models
4+
{
5+
[DataContract]
6+
public class UserData
7+
{
8+
[DataMember(Name = "name")]
9+
public string Name { get; }
10+
[DataMember(Name = "data")]
11+
public string Data { get; }
12+
13+
public UserData(string name, string data)
14+
{
15+
Name = name;
16+
Data = data;
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)