diff --git a/src/Umbraco.Core/CompatibilitySuppressions.xml b/src/Umbraco.Core/CompatibilitySuppressions.xml index ad50b77190..6170e7c8d1 100644 --- a/src/Umbraco.Core/CompatibilitySuppressions.xml +++ b/src/Umbraco.Core/CompatibilitySuppressions.xml @@ -1,5 +1,96 @@  + + CP0001 + T:Umbraco.Cms.Core.Manifest.CompositePackageManifest + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0001 + T:Umbraco.Cms.Core.Manifest.IManifestFilter + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0001 + T:Umbraco.Cms.Core.Manifest.IManifestParser + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0001 + T:Umbraco.Cms.Core.Manifest.IPackageManifest + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0001 + T:Umbraco.Cms.Core.Manifest.ManifestAssets + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0001 + T:Umbraco.Cms.Core.Manifest.ManifestContentAppDefinition + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0001 + T:Umbraco.Cms.Core.Manifest.ManifestContentAppFactory + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0001 + T:Umbraco.Cms.Core.Manifest.ManifestDashboard + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0001 + T:Umbraco.Cms.Core.Manifest.ManifestFilterCollection + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0001 + T:Umbraco.Cms.Core.Manifest.ManifestFilterCollectionBuilder + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0001 + T:Umbraco.Cms.Core.Manifest.ManifestSection + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0001 + T:Umbraco.Cms.Core.Manifest.PackageManifest + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0002 + M:Umbraco.Cms.Core.Configuration.Grid.GridConfig.#ctor(Umbraco.Cms.Core.Cache.AppCaches,Umbraco.Cms.Core.Manifest.IManifestParser,Umbraco.Cms.Core.Serialization.IJsonSerializer,Umbraco.Cms.Core.Hosting.IHostingEnvironment,Microsoft.Extensions.Logging.ILoggerFactory) + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + CP0002 M:Umbraco.Cms.Core.Models.Blocks.BlockGridItem.get_ForceLeft @@ -343,6 +434,20 @@ lib/net7.0/Umbraco.Core.dll true + + CP0002 + M:Umbraco.Cms.Core.PropertyEditors.ParameterEditorCollection.#ctor(Umbraco.Cms.Core.PropertyEditors.DataEditorCollection,Umbraco.Cms.Core.Manifest.IManifestParser) + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + + + CP0002 + M:Umbraco.Cms.Core.PropertyEditors.PropertyEditorCollection.#ctor(Umbraco.Cms.Core.PropertyEditors.DataEditorCollection,Umbraco.Cms.Core.Manifest.IManifestParser) + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + CP0002 M:Umbraco.Cms.Core.Services.Implement.DataTypeService.#ctor(Umbraco.Cms.Core.PropertyEditors.IDataValueEditorFactory,Umbraco.Cms.Core.Scoping.ICoreScopeProvider,Microsoft.Extensions.Logging.ILoggerFactory,Umbraco.Cms.Core.Events.IEventMessagesFactory,Umbraco.Cms.Core.Persistence.Repositories.IDataTypeRepository,Umbraco.Cms.Core.Persistence.Repositories.IDataTypeContainerRepository,Umbraco.Cms.Core.Persistence.Repositories.IAuditRepository,Umbraco.Cms.Core.Persistence.Repositories.IEntityRepository,Umbraco.Cms.Core.Persistence.Repositories.IContentTypeRepository,Umbraco.Cms.Core.IO.IIOHelper,Umbraco.Cms.Core.Services.ILocalizedTextService,Umbraco.Cms.Core.Services.ILocalizationService,Umbraco.Cms.Core.Strings.IShortStringHelper,Umbraco.Cms.Core.Serialization.IJsonSerializer) @@ -567,6 +672,13 @@ lib/net7.0/Umbraco.Core.dll true + + CP0006 + M:Umbraco.Cms.Core.Telemetry.ITelemetryService.GetTelemetryReportDataAsync + lib/net7.0/Umbraco.Core.dll + lib/net7.0/Umbraco.Core.dll + true + CP0006 P:Umbraco.Cms.Core.Models.IDataType.ConfigurationData diff --git a/src/Umbraco.Core/Configuration/Grid/GridConfig.cs b/src/Umbraco.Core/Configuration/Grid/GridConfig.cs index be13776da8..a8ef00e9c0 100644 --- a/src/Umbraco.Core/Configuration/Grid/GridConfig.cs +++ b/src/Umbraco.Core/Configuration/Grid/GridConfig.cs @@ -13,24 +13,24 @@ public class GridConfig : IGridConfig { public GridConfig( AppCaches appCaches, - IManifestParser manifestParser, + ILegacyManifestParser legacyManifestParser, IJsonSerializer jsonSerializer, IHostingEnvironment hostingEnvironment, ILoggerFactory loggerFactory, IGridEditorsConfigFileProviderFactory gridEditorsConfigFileProviderFactory) => EditorsConfig = - new GridEditorsConfig(appCaches, hostingEnvironment, manifestParser, jsonSerializer, loggerFactory.CreateLogger(), gridEditorsConfigFileProviderFactory); + new GridEditorsConfig(appCaches, hostingEnvironment, legacyManifestParser, jsonSerializer, loggerFactory.CreateLogger(), gridEditorsConfigFileProviderFactory); [Obsolete("Use other ctor - Will be removed in Umbraco 13")] public GridConfig( AppCaches appCaches, - IManifestParser manifestParser, + ILegacyManifestParser legacyManifestParser, IJsonSerializer jsonSerializer, IHostingEnvironment hostingEnvironment, ILoggerFactory loggerFactory) : this( appCaches, - manifestParser, + legacyManifestParser, jsonSerializer, hostingEnvironment, loggerFactory, diff --git a/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs b/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs index ab0ec8b182..64d471faf9 100644 --- a/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs +++ b/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs @@ -21,19 +21,19 @@ internal class GridEditorsConfig : IGridEditorsConfig private readonly IJsonSerializer _jsonSerializer; private readonly ILogger _logger; private readonly IGridEditorsConfigFileProviderFactory _gridEditorsConfigFileProviderFactory; - private readonly IManifestParser _manifestParser; + private readonly ILegacyManifestParser _legacyManifestParser; public GridEditorsConfig( AppCaches appCaches, IHostingEnvironment hostingEnvironment, - IManifestParser manifestParser, + ILegacyManifestParser legacyManifestParser, IJsonSerializer jsonSerializer, ILogger logger, IGridEditorsConfigFileProviderFactory gridEditorsConfigFileProviderFactory) { _appCaches = appCaches; _hostingEnvironment = hostingEnvironment; - _manifestParser = manifestParser; + _legacyManifestParser = legacyManifestParser; _jsonSerializer = jsonSerializer; _logger = logger; _gridEditorsConfigFileProviderFactory = gridEditorsConfigFileProviderFactory; @@ -43,13 +43,13 @@ internal class GridEditorsConfig : IGridEditorsConfig public GridEditorsConfig( AppCaches appCaches, IHostingEnvironment hostingEnvironment, - IManifestParser manifestParser, + ILegacyManifestParser legacyManifestParser, IJsonSerializer jsonSerializer, ILogger logger) : this( appCaches, hostingEnvironment, - manifestParser, + legacyManifestParser, jsonSerializer, logger, StaticServiceProvider.Instance.GetRequiredService()) @@ -120,7 +120,7 @@ internal class GridEditorsConfig : IGridEditorsConfig } // Add manifest editors, skip duplicates - foreach (GridEditor gridEditor in _manifestParser.CombinedManifest.GridEditors) + foreach (GridEditor gridEditor in _legacyManifestParser.CombinedManifest.GridEditors) { if (editors.Contains(gridEditor) == false) { diff --git a/src/Umbraco.Core/ContentApps/ContentAppFactoryCollectionBuilder.cs b/src/Umbraco.Core/ContentApps/ContentAppFactoryCollectionBuilder.cs index fe6fdd423a..002fe15628 100644 --- a/src/Umbraco.Core/ContentApps/ContentAppFactoryCollectionBuilder.cs +++ b/src/Umbraco.Core/ContentApps/ContentAppFactoryCollectionBuilder.cs @@ -27,10 +27,10 @@ public class ContentAppFactoryCollectionBuilder : OrderedCollectionBuilderBase(); + ILegacyManifestParser legacyManifestParser = factory.GetRequiredService(); IIOHelper ioHelper = factory.GetRequiredService(); return base.CreateItems(factory) - .Concat(manifestParser.CombinedManifest.ContentApps.Select(x => - new ManifestContentAppFactory(x, ioHelper))); + .Concat(legacyManifestParser.CombinedManifest.ContentApps.Select(x => + new LegacyManifestContentAppFactory(x, ioHelper))); } } diff --git a/src/Umbraco.Core/Dashboards/DashboardCollectionBuilder.cs b/src/Umbraco.Core/Dashboards/DashboardCollectionBuilder.cs index 50867c90f4..3e3fed260f 100644 --- a/src/Umbraco.Core/Dashboards/DashboardCollectionBuilder.cs +++ b/src/Umbraco.Core/Dashboards/DashboardCollectionBuilder.cs @@ -13,17 +13,17 @@ public class DashboardCollectionBuilder : WeightedCollectionBuilderBase(); + ILegacyManifestParser legacyManifestParser = factory.GetRequiredService(); IEnumerable dashboardSections = - Merge(base.CreateItems(factory), manifestParser.CombinedManifest.Dashboards); + Merge(base.CreateItems(factory), legacyManifestParser.CombinedManifest.Dashboards); return dashboardSections; } private IEnumerable Merge( IEnumerable dashboardsFromCode, - IReadOnlyList dashboardFromManifest) => + IReadOnlyList dashboardFromManifest) => dashboardsFromCode.Concat(dashboardFromManifest) .Where(x => !string.IsNullOrEmpty(x.Alias)) .OrderBy(GetWeight); @@ -32,7 +32,7 @@ public class DashboardCollectionBuilder : WeightedCollectionBuilderBaseThe type of the manifest filter. /// The Builder. public static IUmbracoBuilder AddManifestFilter(this IUmbracoBuilder builder) - where T : class, IManifestFilter + where T : class, ILegacyManifestFilter { builder.ManifestFilters().Append(); return builder; diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs index 6f735a003c..93ac06f4f8 100644 --- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs +++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs @@ -83,7 +83,7 @@ public static partial class UmbracoBuilderExtensions .Add() .Add() .Add() - .Add() + .Add() .Add() .Add() .Add() @@ -270,8 +270,8 @@ public static partial class UmbracoBuilderExtensions /// Gets the manifest filter collection builder. /// /// The builder. - public static ManifestFilterCollectionBuilder ManifestFilters(this IUmbracoBuilder builder) - => builder.WithCollectionBuilder(); + public static LegacyManifestFilterCollectionBuilder ManifestFilters(this IUmbracoBuilder builder) + => builder.WithCollectionBuilder(); /// /// Gets the content finders collection builder. diff --git a/src/Umbraco.Core/Manifest/CompositePackageManifest.cs b/src/Umbraco.Core/Manifest/CompositeLegacyPackageManifest.cs similarity index 68% rename from src/Umbraco.Core/Manifest/CompositePackageManifest.cs rename to src/Umbraco.Core/Manifest/CompositeLegacyPackageManifest.cs index 5e41681ea6..d0512a1753 100644 --- a/src/Umbraco.Core/Manifest/CompositePackageManifest.cs +++ b/src/Umbraco.Core/Manifest/CompositeLegacyPackageManifest.cs @@ -5,17 +5,17 @@ namespace Umbraco.Cms.Core.Manifest; /// /// A package manifest made up of all combined manifests /// -public class CompositePackageManifest +public class CompositeLegacyPackageManifest { - public CompositePackageManifest( + public CompositeLegacyPackageManifest( IReadOnlyList propertyEditors, IReadOnlyList parameterEditors, IReadOnlyList gridEditors, - IReadOnlyList contentApps, - IReadOnlyList dashboards, - IReadOnlyList sections, - IReadOnlyDictionary> scripts, - IReadOnlyDictionary> stylesheets) + IReadOnlyList contentApps, + IReadOnlyList dashboards, + IReadOnlyList sections, + IReadOnlyDictionary> scripts, + IReadOnlyDictionary> stylesheets) { PropertyEditors = propertyEditors ?? throw new ArgumentNullException(nameof(propertyEditors)); ParameterEditors = parameterEditors ?? throw new ArgumentNullException(nameof(parameterEditors)); @@ -45,19 +45,19 @@ public class CompositePackageManifest /// /// Gets or sets the content apps listed in the manifest. /// - public IReadOnlyList ContentApps { get; } + public IReadOnlyList ContentApps { get; } /// /// Gets or sets the dashboards listed in the manifest. /// - public IReadOnlyList Dashboards { get; } + public IReadOnlyList Dashboards { get; } /// /// Gets or sets the sections listed in the manifest. /// - public IReadOnlyCollection Sections { get; } + public IReadOnlyCollection Sections { get; } - public IReadOnlyDictionary> Scripts { get; } + public IReadOnlyDictionary> Scripts { get; } - public IReadOnlyDictionary> Stylesheets { get; } + public IReadOnlyDictionary> Stylesheets { get; } } diff --git a/src/Umbraco.Core/Manifest/IManifestFilter.cs b/src/Umbraco.Core/Manifest/ILegacyManifestFilter.cs similarity index 79% rename from src/Umbraco.Core/Manifest/IManifestFilter.cs rename to src/Umbraco.Core/Manifest/ILegacyManifestFilter.cs index d2998a0839..fd72466cbc 100644 --- a/src/Umbraco.Core/Manifest/IManifestFilter.cs +++ b/src/Umbraco.Core/Manifest/ILegacyManifestFilter.cs @@ -3,7 +3,7 @@ namespace Umbraco.Cms.Core.Manifest; /// /// Provides filtering for package manifests. /// -public interface IManifestFilter +public interface ILegacyManifestFilter { /// /// Filters package manifests. @@ -12,5 +12,5 @@ public interface IManifestFilter /// /// It is possible to remove, change, or add manifests. /// - void Filter(List manifests); + void Filter(List manifests); } diff --git a/src/Umbraco.Core/Manifest/IManifestParser.cs b/src/Umbraco.Core/Manifest/ILegacyManifestParser.cs similarity index 66% rename from src/Umbraco.Core/Manifest/IManifestParser.cs rename to src/Umbraco.Core/Manifest/ILegacyManifestParser.cs index f8b29e9f56..0a854774b3 100644 --- a/src/Umbraco.Core/Manifest/IManifestParser.cs +++ b/src/Umbraco.Core/Manifest/ILegacyManifestParser.cs @@ -1,6 +1,6 @@ namespace Umbraco.Cms.Core.Manifest; -public interface IManifestParser +public interface ILegacyManifestParser { string AppPluginsPath { get; set; } @@ -8,16 +8,16 @@ public interface IManifestParser /// Gets all manifests, merged into a single manifest object. /// /// - CompositePackageManifest CombinedManifest { get; } + CompositeLegacyPackageManifest CombinedManifest { get; } /// /// Parses a manifest. /// - PackageManifest ParseManifest(string text); + LegacyPackageManifest ParseManifest(string text); /// /// Returns all package individual manifests /// /// - IEnumerable GetManifests(); + IEnumerable GetManifests(); } diff --git a/src/Umbraco.Core/Manifest/IPackageManifest.cs b/src/Umbraco.Core/Manifest/ILegacyPackageManifest.cs similarity index 89% rename from src/Umbraco.Core/Manifest/IPackageManifest.cs rename to src/Umbraco.Core/Manifest/ILegacyPackageManifest.cs index ba911b183c..21e1903e18 100644 --- a/src/Umbraco.Core/Manifest/IPackageManifest.cs +++ b/src/Umbraco.Core/Manifest/ILegacyPackageManifest.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core.PropertyEditors; namespace Umbraco.Cms.Core.Manifest; -public interface IPackageManifest +public interface ILegacyPackageManifest { /// /// Gets the source path of the manifest. @@ -50,17 +50,17 @@ public interface IPackageManifest /// Gets or sets the content apps listed in the manifest. /// [DataMember(Name = "contentApps")] - ManifestContentAppDefinition[] ContentApps { get; set; } + LegacyManifestContentAppDefinition[] ContentApps { get; set; } /// /// Gets or sets the dashboards listed in the manifest. /// [DataMember(Name = "dashboards")] - ManifestDashboard[] Dashboards { get; set; } + LegacyManifestDashboard[] Dashboards { get; set; } /// /// Gets or sets the sections listed in the manifest. /// [DataMember(Name = "sections")] - ManifestSection[] Sections { get; set; } + LegacyManifestSection[] Sections { get; set; } } diff --git a/src/Umbraco.Core/Manifest/ManifestAssets.cs b/src/Umbraco.Core/Manifest/LegacyManifestAssets.cs similarity index 72% rename from src/Umbraco.Core/Manifest/ManifestAssets.cs rename to src/Umbraco.Core/Manifest/LegacyManifestAssets.cs index 2bd84a1bdd..05b0123a0d 100644 --- a/src/Umbraco.Core/Manifest/ManifestAssets.cs +++ b/src/Umbraco.Core/Manifest/LegacyManifestAssets.cs @@ -1,8 +1,8 @@ namespace Umbraco.Cms.Core.Manifest; -public class ManifestAssets +public class LegacyManifestAssets { - public ManifestAssets(string? packageName, IReadOnlyList assets) + public LegacyManifestAssets(string? packageName, IReadOnlyList assets) { PackageName = packageName ?? throw new ArgumentNullException(nameof(packageName)); Assets = assets ?? throw new ArgumentNullException(nameof(assets)); diff --git a/src/Umbraco.Core/Manifest/ManifestContentAppDefinition.cs b/src/Umbraco.Core/Manifest/LegacyManifestContentAppDefinition.cs similarity index 93% rename from src/Umbraco.Core/Manifest/ManifestContentAppDefinition.cs rename to src/Umbraco.Core/Manifest/LegacyManifestContentAppDefinition.cs index 5bfc2a740e..914923ec31 100644 --- a/src/Umbraco.Core/Manifest/ManifestContentAppDefinition.cs +++ b/src/Umbraco.Core/Manifest/LegacyManifestContentAppDefinition.cs @@ -22,9 +22,9 @@ namespace Umbraco.Cms.Core.Manifest; /// /// Represents a content app definition, parsed from a manifest. /// -/// Is used to create an actual . +/// Is used to create an actual . [DataContract(Name = "appdef", Namespace = "")] -public class ManifestContentAppDefinition +public class LegacyManifestContentAppDefinition { private readonly string? _view; diff --git a/src/Umbraco.Core/Manifest/ManifestContentAppFactory.cs b/src/Umbraco.Core/Manifest/LegacyManifestContentAppFactory.cs similarity index 96% rename from src/Umbraco.Core/Manifest/ManifestContentAppFactory.cs rename to src/Umbraco.Core/Manifest/LegacyManifestContentAppFactory.cs index 122ecc1cb7..56795f7e59 100644 --- a/src/Umbraco.Core/Manifest/ManifestContentAppFactory.cs +++ b/src/Umbraco.Core/Manifest/LegacyManifestContentAppFactory.cs @@ -29,15 +29,15 @@ namespace Umbraco.Cms.Core.Manifest; /// /// Represents a content app factory, for content apps parsed from the manifest. /// -public class ManifestContentAppFactory : IContentAppFactory +public class LegacyManifestContentAppFactory : IContentAppFactory { - private readonly ManifestContentAppDefinition _definition; + private readonly LegacyManifestContentAppDefinition _definition; private readonly IIOHelper _ioHelper; private ContentApp? _app; private ShowRule[]? _showRules; - public ManifestContentAppFactory(ManifestContentAppDefinition definition, IIOHelper ioHelper) + public LegacyManifestContentAppFactory(LegacyManifestContentAppDefinition definition, IIOHelper ioHelper) { _definition = definition; _ioHelper = ioHelper; diff --git a/src/Umbraco.Core/Manifest/ManifestDashboard.cs b/src/Umbraco.Core/Manifest/LegacyManifestDashboard.cs similarity index 92% rename from src/Umbraco.Core/Manifest/ManifestDashboard.cs rename to src/Umbraco.Core/Manifest/LegacyManifestDashboard.cs index 75cdf24ebe..9cc0ad9091 100644 --- a/src/Umbraco.Core/Manifest/ManifestDashboard.cs +++ b/src/Umbraco.Core/Manifest/LegacyManifestDashboard.cs @@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Dashboards; namespace Umbraco.Cms.Core.Manifest; [DataContract] -public class ManifestDashboard : IDashboard +public class LegacyManifestDashboard : IDashboard { [DataMember(Name = "weight")] public int Weight { get; set; } = 100; diff --git a/src/Umbraco.Core/Manifest/ManifestFilterCollection.cs b/src/Umbraco.Core/Manifest/LegacyManifestFilterCollection.cs similarity index 56% rename from src/Umbraco.Core/Manifest/ManifestFilterCollection.cs rename to src/Umbraco.Core/Manifest/LegacyManifestFilterCollection.cs index a1d5cac0c1..a2af5ee440 100644 --- a/src/Umbraco.Core/Manifest/ManifestFilterCollection.cs +++ b/src/Umbraco.Core/Manifest/LegacyManifestFilterCollection.cs @@ -5,9 +5,9 @@ namespace Umbraco.Cms.Core.Manifest; /// /// Contains the manifest filters. /// -public class ManifestFilterCollection : BuilderCollectionBase +public class LegacyManifestFilterCollection : BuilderCollectionBase { - public ManifestFilterCollection(Func> items) + public LegacyManifestFilterCollection(Func> items) : base(items) { } @@ -16,9 +16,9 @@ public class ManifestFilterCollection : BuilderCollectionBase /// Filters package manifests. /// /// The package manifests. - public void Filter(List manifests) + public void Filter(List manifests) { - foreach (IManifestFilter filter in this) + foreach (ILegacyManifestFilter filter in this) { filter.Filter(manifests); } diff --git a/src/Umbraco.Core/Manifest/ManifestFilterCollectionBuilder.cs b/src/Umbraco.Core/Manifest/LegacyManifestFilterCollectionBuilder.cs similarity index 50% rename from src/Umbraco.Core/Manifest/ManifestFilterCollectionBuilder.cs rename to src/Umbraco.Core/Manifest/LegacyManifestFilterCollectionBuilder.cs index 5f012d10c9..ae8c41a9f0 100644 --- a/src/Umbraco.Core/Manifest/ManifestFilterCollectionBuilder.cs +++ b/src/Umbraco.Core/Manifest/LegacyManifestFilterCollectionBuilder.cs @@ -3,10 +3,10 @@ using Umbraco.Cms.Core.Composing; namespace Umbraco.Cms.Core.Manifest; -public class ManifestFilterCollectionBuilder : OrderedCollectionBuilderBase +public class LegacyManifestFilterCollectionBuilder : OrderedCollectionBuilderBase { - protected override ManifestFilterCollectionBuilder This => this; + protected override LegacyManifestFilterCollectionBuilder This => this; // do NOT cache this, it's only used once protected override ServiceLifetime CollectionLifetime => ServiceLifetime.Transient; diff --git a/src/Umbraco.Core/Manifest/ManifestSection.cs b/src/Umbraco.Core/Manifest/LegacyManifestSection.cs similarity index 87% rename from src/Umbraco.Core/Manifest/ManifestSection.cs rename to src/Umbraco.Core/Manifest/LegacyManifestSection.cs index c7671c91e2..e0b0446523 100644 --- a/src/Umbraco.Core/Manifest/ManifestSection.cs +++ b/src/Umbraco.Core/Manifest/LegacyManifestSection.cs @@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Sections; namespace Umbraco.Cms.Core.Manifest; [DataContract(Name = "section", Namespace = "")] -public class ManifestSection : ISection +public class LegacyManifestSection : ISection { [DataMember(Name = "alias")] public string Alias { get; set; } = string.Empty; diff --git a/src/Umbraco.Core/Manifest/PackageManifest.cs b/src/Umbraco.Core/Manifest/LegacyPackageManifest.cs similarity index 90% rename from src/Umbraco.Core/Manifest/PackageManifest.cs rename to src/Umbraco.Core/Manifest/LegacyPackageManifest.cs index 7bf07cfde9..64fd3f6267 100644 --- a/src/Umbraco.Core/Manifest/PackageManifest.cs +++ b/src/Umbraco.Core/Manifest/LegacyPackageManifest.cs @@ -8,7 +8,7 @@ namespace Umbraco.Cms.Core.Manifest; /// Represents the content of a package manifest. /// [DataContract] -public class PackageManifest +public class LegacyPackageManifest { private string? _packageName; @@ -99,17 +99,17 @@ public class PackageManifest /// Gets or sets the content apps listed in the manifest. /// [DataMember(Name = "contentApps")] - public ManifestContentAppDefinition[] ContentApps { get; set; } = Array.Empty(); + public LegacyManifestContentAppDefinition[] ContentApps { get; set; } = Array.Empty(); /// /// Gets or sets the dashboards listed in the manifest. /// [DataMember(Name = "dashboards")] - public ManifestDashboard[] Dashboards { get; set; } = Array.Empty(); + public LegacyManifestDashboard[] Dashboards { get; set; } = Array.Empty(); /// /// Gets or sets the sections listed in the manifest. /// [DataMember(Name = "sections")] - public ManifestSection[] Sections { get; set; } = Array.Empty(); + public LegacyManifestSection[] Sections { get; set; } = Array.Empty(); } diff --git a/src/Umbraco.Core/Models/Mapping/SectionMapDefinition.cs b/src/Umbraco.Core/Models/Mapping/SectionMapDefinition.cs index c64af5ac0a..7e943d1840 100644 --- a/src/Umbraco.Core/Models/Mapping/SectionMapDefinition.cs +++ b/src/Umbraco.Core/Models/Mapping/SectionMapDefinition.cs @@ -20,7 +20,7 @@ public class SectionMapDefinition : IMapDefinition // this is for AutoMapper ReverseMap - but really? mapper.Define(); mapper.Define(); - mapper.Define(Map); + mapper.Define(Map); mapper.Define(); mapper.Define(); mapper.Define(); @@ -30,7 +30,7 @@ public class SectionMapDefinition : IMapDefinition } // Umbraco.Code.MapAll - private static void Map(Section source, ManifestSection target, MapperContext context) + private static void Map(Section source, LegacyManifestSection target, MapperContext context) { target.Alias = source.Alias; target.Name = source.Name; diff --git a/src/Umbraco.Core/PropertyEditors/ParameterEditorCollection.cs b/src/Umbraco.Core/PropertyEditors/ParameterEditorCollection.cs index eec435ddf6..746a4e2c5e 100644 --- a/src/Umbraco.Core/PropertyEditors/ParameterEditorCollection.cs +++ b/src/Umbraco.Core/PropertyEditors/ParameterEditorCollection.cs @@ -5,10 +5,10 @@ namespace Umbraco.Cms.Core.PropertyEditors; public class ParameterEditorCollection : BuilderCollectionBase { - public ParameterEditorCollection(DataEditorCollection dataEditors, IManifestParser manifestParser) + public ParameterEditorCollection(DataEditorCollection dataEditors, ILegacyManifestParser legacyManifestParser) : base(() => dataEditors .Where(x => (x.Type & EditorType.MacroParameter) > 0) - .Union(manifestParser.CombinedManifest.PropertyEditors)) + .Union(legacyManifestParser.CombinedManifest.PropertyEditors)) { } diff --git a/src/Umbraco.Core/PropertyEditors/PropertyEditorCollection.cs b/src/Umbraco.Core/PropertyEditors/PropertyEditorCollection.cs index ff700431d5..04a111733c 100644 --- a/src/Umbraco.Core/PropertyEditors/PropertyEditorCollection.cs +++ b/src/Umbraco.Core/PropertyEditors/PropertyEditorCollection.cs @@ -6,10 +6,10 @@ namespace Umbraco.Cms.Core.PropertyEditors; public class PropertyEditorCollection : BuilderCollectionBase { - public PropertyEditorCollection(DataEditorCollection dataEditors, IManifestParser manifestParser) + public PropertyEditorCollection(DataEditorCollection dataEditors, ILegacyManifestParser legacyManifestParser) : base(() => dataEditors .Where(x => (x.Type & EditorType.PropertyValue) > 0) - .Union(manifestParser.CombinedManifest.PropertyEditors)) + .Union(legacyManifestParser.CombinedManifest.PropertyEditors)) { } diff --git a/src/Umbraco.Core/Sections/SectionCollectionBuilder.cs b/src/Umbraco.Core/Sections/SectionCollectionBuilder.cs index 7644b1cc8c..0b8971d223 100644 --- a/src/Umbraco.Core/Sections/SectionCollectionBuilder.cs +++ b/src/Umbraco.Core/Sections/SectionCollectionBuilder.cs @@ -14,8 +14,8 @@ public class // get the manifest parser just-in-time - injecting it in the ctor would mean that // simply getting the builder in order to configure the collection, would require // its dependencies too, and that can create cycles or other oddities - IManifestParser manifestParser = factory.GetRequiredService(); + ILegacyManifestParser legacyManifestParser = factory.GetRequiredService(); - return base.CreateItems(factory).Concat(manifestParser.CombinedManifest.Sections); + return base.CreateItems(factory).Concat(legacyManifestParser.CombinedManifest.Sections); } } diff --git a/src/Umbraco.Core/Telemetry/TelemetryService.cs b/src/Umbraco.Core/Telemetry/TelemetryService.cs index 09ab4483de..38537f080f 100644 --- a/src/Umbraco.Core/Telemetry/TelemetryService.cs +++ b/src/Umbraco.Core/Telemetry/TelemetryService.cs @@ -24,13 +24,13 @@ internal class TelemetryService : ITelemetryService [Obsolete("Please use the constructor that does not take an IManifestParser. Will be removed in V15.")] public TelemetryService( - IManifestParser manifestParser, + ILegacyManifestParser legacyManifestParser, IUmbracoVersion umbracoVersion, ISiteIdentifierService siteIdentifierService, IUsageInformationService usageInformationService, IMetricsConsentService metricsConsentService) : this( - manifestParser, + legacyManifestParser, umbracoVersion, siteIdentifierService, usageInformationService, @@ -41,7 +41,7 @@ internal class TelemetryService : ITelemetryService [Obsolete("Please use the constructor that does not take an IManifestParser. Will be removed in V15.")] public TelemetryService( - IManifestParser manifestParser, + ILegacyManifestParser legacyManifestParser, IUmbracoVersion umbracoVersion, ISiteIdentifierService siteIdentifierService, IUsageInformationService usageInformationService, diff --git a/src/Umbraco.Infrastructure/CompatibilitySuppressions.xml b/src/Umbraco.Infrastructure/CompatibilitySuppressions.xml index 7eb0063a32..d625ef54df 100644 --- a/src/Umbraco.Infrastructure/CompatibilitySuppressions.xml +++ b/src/Umbraco.Infrastructure/CompatibilitySuppressions.xml @@ -21,6 +21,13 @@ lib/net7.0/Umbraco.Infrastructure.dll true + + CP0001 + T:Umbraco.Cms.Core.Manifest.ManifestParser + lib/net7.0/Umbraco.Infrastructure.dll + lib/net7.0/Umbraco.Infrastructure.dll + true + CP0001 T:Umbraco.Cms.Infrastructure.Migrations.PostMigrations.ClearCsrfCookies @@ -77,6 +84,13 @@ lib/net7.0/Umbraco.Infrastructure.dll true + + CP0002 + M:Umbraco.Cms.Core.Services.Implement.PackagingService.#ctor(Umbraco.Cms.Core.Services.IAuditService,Umbraco.Cms.Core.Packaging.ICreatedPackagesRepository,Umbraco.Cms.Core.Packaging.IPackageInstallation,Umbraco.Cms.Core.Events.IEventAggregator,Umbraco.Cms.Core.Manifest.IManifestParser,Umbraco.Cms.Core.Services.IKeyValueService,Umbraco.Cms.Core.Packaging.PackageMigrationPlanCollection) + lib/net7.0/Umbraco.Infrastructure.dll + lib/net7.0/Umbraco.Infrastructure.dll + true + CP0002 M:Umbraco.Cms.Infrastructure.Install.PackageMigrationRunner.#ctor(Umbraco.Cms.Core.Logging.IProfilingLogger,Umbraco.Cms.Core.Scoping.ICoreScopeProvider,Umbraco.Cms.Core.Packaging.PendingPackageMigrations,Umbraco.Cms.Core.Packaging.PackageMigrationPlanCollection,Umbraco.Cms.Core.Migrations.IMigrationPlanExecutor,Umbraco.Cms.Core.Services.IKeyValueService,Umbraco.Cms.Core.Events.IEventAggregator) @@ -133,6 +147,20 @@ lib/net7.0/Umbraco.Infrastructure.dll true + + CP0002 + M:Umbraco.Cms.Infrastructure.WebAssets.BackOfficeWebAssets.#ctor(Umbraco.Cms.Core.WebAssets.IRuntimeMinifier,Umbraco.Cms.Core.Manifest.IManifestParser,Umbraco.Cms.Core.PropertyEditors.PropertyEditorCollection,Umbraco.Cms.Core.Hosting.IHostingEnvironment,Microsoft.Extensions.Options.IOptionsMonitor{Umbraco.Cms.Core.Configuration.Models.GlobalSettings},Umbraco.Cms.Core.WebAssets.CustomBackOfficeAssetsCollection) + lib/net7.0/Umbraco.Infrastructure.dll + lib/net7.0/Umbraco.Infrastructure.dll + true + + + CP0002 + M:Umbraco.Cms.Infrastructure.WebAssets.BackOfficeWebAssets.GetIndependentPackageBundleName(Umbraco.Cms.Core.Manifest.ManifestAssets,Umbraco.Cms.Core.WebAssets.AssetType) + lib/net7.0/Umbraco.Infrastructure.dll + lib/net7.0/Umbraco.Infrastructure.dll + true + CP0006 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) diff --git a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs index 2b5a4188bf..8507d93184 100644 --- a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs +++ b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs @@ -128,7 +128,7 @@ public static partial class UmbracoBuilderExtensions builder.Services.AddTransient(); // register manifest parser, will be injected in collection builders where needed - builder.Services.AddSingleton(); + builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); diff --git a/src/Umbraco.Infrastructure/Manifest/ManifestParser.cs b/src/Umbraco.Infrastructure/Manifest/LegacyManifestParser.cs similarity index 81% rename from src/Umbraco.Infrastructure/Manifest/ManifestParser.cs rename to src/Umbraco.Infrastructure/Manifest/LegacyManifestParser.cs index 887ac05dc4..76168320b0 100644 --- a/src/Umbraco.Infrastructure/Manifest/ManifestParser.cs +++ b/src/Umbraco.Infrastructure/Manifest/LegacyManifestParser.cs @@ -19,33 +19,33 @@ namespace Umbraco.Cms.Core.Manifest; /// /// Parses the Main.js file and replaces all tokens accordingly. /// -public class ManifestParser : IManifestParser +public class LegacyManifestParser : ILegacyManifestParser { private static readonly string _utf8Preamble = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble()); private readonly IAppPolicyCache _cache; private readonly IDataValueEditorFactory _dataValueEditorFactory; private readonly IManifestFileProviderFactory _manifestFileProviderFactory; - private readonly ManifestFilterCollection _filters; + private readonly LegacyManifestFilterCollection _filters; private readonly IHostingEnvironment _hostingEnvironment; private readonly IIOHelper _ioHelper; private readonly IJsonSerializer _jsonSerializer; private readonly ILocalizedTextService _localizedTextService; - private readonly ILogger _logger; + private readonly ILogger _logger; private readonly IShortStringHelper _shortStringHelper; private readonly ManifestValueValidatorCollection _validators; private string _path = null!; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ManifestParser( + public LegacyManifestParser( AppCaches appCaches, ManifestValueValidatorCollection validators, - ManifestFilterCollection filters, - ILogger logger, + LegacyManifestFilterCollection filters, + ILogger logger, IIOHelper ioHelper, IHostingEnvironment hostingEnvironment, IJsonSerializer jsonSerializer, @@ -74,11 +74,11 @@ public class ManifestParser : IManifestParser } [Obsolete("Use other ctor - Will be removed in Umbraco 13")] - public ManifestParser( + public LegacyManifestParser( AppCaches appCaches, ManifestValueValidatorCollection validators, - ManifestFilterCollection filters, - ILogger logger, + LegacyManifestFilterCollection filters, + ILogger logger, IIOHelper ioHelper, IHostingEnvironment hostingEnvironment, IJsonSerializer jsonSerializer, @@ -110,19 +110,19 @@ public class ManifestParser : IManifestParser /// Gets all manifests, merged into a single manifest object. /// /// - public CompositePackageManifest CombinedManifest + public CompositeLegacyPackageManifest CombinedManifest => _cache.GetCacheItem("Umbraco.Core.Manifest.ManifestParser::Manifests", () => { - IEnumerable manifests = GetManifests(); + IEnumerable manifests = GetManifests(); return MergeManifests(manifests); }, new TimeSpan(0, 4, 0))!; /// /// Gets all manifests. /// - public IEnumerable GetManifests() + public IEnumerable GetManifests() { - var manifests = new List(); + var manifests = new List(); IFileProvider? manifestFileProvider = _manifestFileProviderFactory.Create(); if (manifestFileProvider is null) @@ -143,7 +143,7 @@ public class ManifestParser : IManifestParser continue; } - PackageManifest manifest = ParseManifest(text); + LegacyPackageManifest manifest = ParseManifest(text); manifest.Source = file.PhysicalPath!; // We assure that the PhysicalPath is not null in GetManifestFiles() manifests.Add(manifest); } @@ -161,7 +161,7 @@ public class ManifestParser : IManifestParser /// /// Parses a manifest. /// - public PackageManifest ParseManifest(string text) + public LegacyPackageManifest ParseManifest(string text) { if (text == null) { @@ -173,7 +173,7 @@ public class ManifestParser : IManifestParser throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(text)); } - PackageManifest? manifest = JsonConvert.DeserializeObject( + LegacyPackageManifest? manifest = JsonConvert.DeserializeObject( text, new DataEditorConverter(_dataValueEditorFactory, _ioHelper, _localizedTextService, _shortStringHelper, _jsonSerializer), new ValueValidatorConverter(_validators), @@ -190,12 +190,12 @@ public class ManifestParser : IManifestParser manifest.Stylesheets[i] = _ioHelper.ResolveRelativeOrVirtualUrl(manifest.Stylesheets[i])!; } - foreach (ManifestContentAppDefinition contentApp in manifest.ContentApps) + foreach (LegacyManifestContentAppDefinition contentApp in manifest.ContentApps) { contentApp.View = _ioHelper.ResolveRelativeOrVirtualUrl(contentApp.View); } - foreach (ManifestDashboard dashboard in manifest.Dashboards) + foreach (LegacyManifestDashboard dashboard in manifest.Dashboards) { dashboard.View = _ioHelper.ResolveRelativeOrVirtualUrl(dashboard.View)!; } @@ -220,34 +220,34 @@ public class ManifestParser : IManifestParser /// /// Merges all manifests into one. /// - private static CompositePackageManifest MergeManifests(IEnumerable manifests) + private static CompositeLegacyPackageManifest MergeManifests(IEnumerable manifests) { - var scripts = new Dictionary>(); - var stylesheets = new Dictionary>(); + var scripts = new Dictionary>(); + var stylesheets = new Dictionary>(); var propertyEditors = new List(); var parameterEditors = new List(); var gridEditors = new List(); - var contentApps = new List(); - var dashboards = new List(); - var sections = new List(); + var contentApps = new List(); + var dashboards = new List(); + var sections = new List(); - foreach (PackageManifest manifest in manifests) + foreach (LegacyPackageManifest manifest in manifests) { - if (!scripts.TryGetValue(manifest.BundleOptions, out List? scriptsPerBundleOption)) + if (!scripts.TryGetValue(manifest.BundleOptions, out List? scriptsPerBundleOption)) { - scriptsPerBundleOption = new List(); + scriptsPerBundleOption = new List(); scripts[manifest.BundleOptions] = scriptsPerBundleOption; } - scriptsPerBundleOption.Add(new ManifestAssets(manifest.PackageName, manifest.Scripts)); + scriptsPerBundleOption.Add(new LegacyManifestAssets(manifest.PackageName, manifest.Scripts)); - if (!stylesheets.TryGetValue(manifest.BundleOptions, out List? stylesPerBundleOption)) + if (!stylesheets.TryGetValue(manifest.BundleOptions, out List? stylesPerBundleOption)) { - stylesPerBundleOption = new List(); + stylesPerBundleOption = new List(); stylesheets[manifest.BundleOptions] = stylesPerBundleOption; } - stylesPerBundleOption.Add(new ManifestAssets(manifest.PackageName, manifest.Stylesheets)); + stylesPerBundleOption.Add(new LegacyManifestAssets(manifest.PackageName, manifest.Stylesheets)); propertyEditors.AddRange(manifest.PropertyEditors); @@ -262,15 +262,15 @@ public class ManifestParser : IManifestParser sections.AddRange(manifest.Sections.DistinctBy(x => x.Alias, StringComparer.OrdinalIgnoreCase)); } - return new CompositePackageManifest( + return new CompositeLegacyPackageManifest( propertyEditors, parameterEditors, gridEditors, contentApps, dashboards, sections, - scripts.ToDictionary(x => x.Key, x => (IReadOnlyList)x.Value), - stylesheets.ToDictionary(x => x.Key, x => (IReadOnlyList)x.Value)); + scripts.ToDictionary(x => x.Key, x => (IReadOnlyList)x.Value), + stylesheets.ToDictionary(x => x.Key, x => (IReadOnlyList)x.Value)); } private static string TrimPreamble(string text) diff --git a/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs b/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs index a0330d75fd..c3dbc5b6f5 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs @@ -20,7 +20,7 @@ public class PackagingService : IPackagingService private readonly ICreatedPackagesRepository _createdPackages; private readonly IEventAggregator _eventAggregator; private readonly IKeyValueService _keyValueService; - private readonly IManifestParser _manifestParser; + private readonly ILegacyManifestParser _legacyManifestParser; private readonly IPackageInstallation _packageInstallation; private readonly PackageMigrationPlanCollection _packageMigrationPlans; @@ -29,7 +29,7 @@ public class PackagingService : IPackagingService ICreatedPackagesRepository createdPackages, IPackageInstallation packageInstallation, IEventAggregator eventAggregator, - IManifestParser manifestParser, + ILegacyManifestParser legacyManifestParser, IKeyValueService keyValueService, PackageMigrationPlanCollection packageMigrationPlans) { @@ -37,7 +37,7 @@ public class PackagingService : IPackagingService _createdPackages = createdPackages; _packageInstallation = packageInstallation; _eventAggregator = eventAggregator; - _manifestParser = manifestParser; + _legacyManifestParser = legacyManifestParser; _keyValueService = keyValueService; _packageMigrationPlans = packageMigrationPlans; } @@ -148,7 +148,7 @@ public class PackagingService : IPackagingService } // Collect and merge the packages from the manifests - foreach (PackageManifest package in _manifestParser.GetManifests()) + foreach (LegacyPackageManifest package in _legacyManifestParser.GetManifests()) { if (package.PackageName is null) { diff --git a/src/Umbraco.Infrastructure/WebAssets/BackOfficeWebAssets.cs b/src/Umbraco.Infrastructure/WebAssets/BackOfficeWebAssets.cs index ab25dc691c..3bb9872901 100644 --- a/src/Umbraco.Infrastructure/WebAssets/BackOfficeWebAssets.cs +++ b/src/Umbraco.Infrastructure/WebAssets/BackOfficeWebAssets.cs @@ -24,7 +24,7 @@ public class BackOfficeWebAssets public const string UmbracoUpgradeCssBundleName = "umbraco-authorize-upgrade-css"; private readonly CustomBackOfficeAssetsCollection _customBackOfficeAssetsCollection; private readonly IHostingEnvironment _hostingEnvironment; - private readonly IManifestParser _parser; + private readonly ILegacyManifestParser _parser; private readonly PropertyEditorCollection _propertyEditorCollection; private readonly IRuntimeMinifier _runtimeMinifier; @@ -32,7 +32,7 @@ public class BackOfficeWebAssets public BackOfficeWebAssets( IRuntimeMinifier runtimeMinifier, - IManifestParser parser, + ILegacyManifestParser parser, PropertyEditorCollection propertyEditorCollection, IHostingEnvironment hostingEnvironment, IOptionsMonitor globalSettings, @@ -48,8 +48,8 @@ public class BackOfficeWebAssets globalSettings.OnChange(x => _globalSettings = x); } - public static string GetIndependentPackageBundleName(ManifestAssets manifestAssets, AssetType assetType) - => $"{manifestAssets.PackageName.ToLowerInvariant()}-{(assetType == AssetType.Css ? "css" : "js")}"; + public static string GetIndependentPackageBundleName(LegacyManifestAssets legacyManifestAssets, AssetType assetType) + => $"{legacyManifestAssets.PackageName.ToLowerInvariant()}-{(assetType == AssetType.Css ? "css" : "js")}"; public void CreateBundles() { @@ -151,7 +151,7 @@ public class BackOfficeWebAssets } private void RegisterPackageBundlesForNoneOption( - IReadOnlyDictionary>? combinedPackageManifestAssets, + IReadOnlyDictionary>? combinedPackageManifestAssets, string bundleName) { var assets = new HashSet(StringComparer.InvariantCultureIgnoreCase); @@ -159,7 +159,7 @@ public class BackOfficeWebAssets // Create a bundle per package manifest that is declaring the matching BundleOptions if (combinedPackageManifestAssets?.TryGetValue( BundleOptions.None, - out IReadOnlyList? manifestAssetList) ?? false) + out IReadOnlyList? manifestAssetList) ?? false) { foreach (var asset in manifestAssetList.SelectMany(x => x.Assets)) { @@ -176,15 +176,15 @@ public class BackOfficeWebAssets } private void RegisterPackageBundlesForIndependentOptions( - IReadOnlyDictionary>? combinedPackageManifestAssets, + IReadOnlyDictionary>? combinedPackageManifestAssets, AssetType assetType) { // Create a bundle per package manifest that is declaring the matching BundleOptions if (combinedPackageManifestAssets?.TryGetValue( BundleOptions.Independent, - out IReadOnlyList? manifestAssetList) ?? false) + out IReadOnlyList? manifestAssetList) ?? false) { - foreach (ManifestAssets manifestAssets in manifestAssetList) + foreach (LegacyManifestAssets manifestAssets in manifestAssetList) { var bundleName = GetIndependentPackageBundleName(manifestAssets, assetType); var filePaths = FormatPaths(manifestAssets.Assets.ToArray()); @@ -215,7 +215,7 @@ public class BackOfficeWebAssets // only include scripts with the default bundle options here if (_parser.CombinedManifest.Scripts.TryGetValue( BundleOptions.Default, - out IReadOnlyList? manifestAssets)) + out IReadOnlyList? manifestAssets)) { foreach (var script in manifestAssets.SelectMany(x => x.Assets)) { @@ -255,7 +255,7 @@ public class BackOfficeWebAssets // only include css with the default bundle options here if (_parser.CombinedManifest.Stylesheets.TryGetValue( BundleOptions.Default, - out IReadOnlyList? manifestAssets)) + out IReadOnlyList? manifestAssets)) { foreach (var script in manifestAssets.SelectMany(x => x.Assets)) { diff --git a/src/Umbraco.Web.BackOffice/CompatibilitySuppressions.xml b/src/Umbraco.Web.BackOffice/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..de35de5021 --- /dev/null +++ b/src/Umbraco.Web.BackOffice/CompatibilitySuppressions.xml @@ -0,0 +1,17 @@ + + + + CP0002 + M:Umbraco.Cms.Web.BackOffice.Controllers.BackOfficeController.#ctor(Umbraco.Cms.Core.Security.IBackOfficeUserManager,Umbraco.Cms.Core.Services.IRuntimeState,Umbraco.Cms.Core.WebAssets.IRuntimeMinifier,Microsoft.Extensions.Options.IOptionsSnapshot{Umbraco.Cms.Core.Configuration.Models.GlobalSettings},Umbraco.Cms.Core.Hosting.IHostingEnvironment,Umbraco.Cms.Core.Services.ILocalizedTextService,Umbraco.Cms.Core.Configuration.Grid.IGridConfig,Umbraco.Cms.Web.BackOffice.Controllers.BackOfficeServerVariables,Umbraco.Cms.Core.Cache.AppCaches,Umbraco.Cms.Web.BackOffice.Security.IBackOfficeSignInManager,Umbraco.Cms.Core.Security.IBackOfficeSecurityAccessor,Microsoft.Extensions.Logging.ILogger{Umbraco.Cms.Web.BackOffice.Controllers.BackOfficeController},Umbraco.Cms.Core.Serialization.IJsonSerializer,Umbraco.Cms.Web.BackOffice.Security.IBackOfficeExternalLoginProviders,Microsoft.AspNetCore.Http.IHttpContextAccessor,Umbraco.Cms.Web.BackOffice.Security.IBackOfficeTwoFactorOptions,Umbraco.Cms.Core.Manifest.IManifestParser,Umbraco.Cms.Infrastructure.WebAssets.ServerVariablesParser,Microsoft.Extensions.Options.IOptions{Umbraco.Cms.Core.Configuration.Models.SecuritySettings}) + lib/net7.0/Umbraco.Web.BackOffice.dll + lib/net7.0/Umbraco.Web.BackOffice.dll + true + + + CP0002 + M:Umbraco.Extensions.RuntimeMinifierExtensions.GetScriptForLoadingBackOfficeAsync(Umbraco.Cms.Core.WebAssets.IRuntimeMinifier,Umbraco.Cms.Core.Configuration.Models.GlobalSettings,Umbraco.Cms.Core.Hosting.IHostingEnvironment,Umbraco.Cms.Core.Manifest.IManifestParser) + lib/net7.0/Umbraco.Web.BackOffice.dll + lib/net7.0/Umbraco.Web.BackOffice.dll + true + + \ No newline at end of file diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs index bd40d300c2..7a71242641 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs @@ -53,7 +53,7 @@ public class BackOfficeController : UmbracoController private readonly IHttpContextAccessor _httpContextAccessor; private readonly IJsonSerializer _jsonSerializer; private readonly ILogger _logger; - private readonly IManifestParser _manifestParser; + private readonly ILegacyManifestParser _legacyManifestParser; private readonly IRuntimeMinifier _runtimeMinifier; private readonly IRuntimeState _runtimeState; private readonly IOptions _securitySettings; @@ -89,7 +89,7 @@ public class BackOfficeController : UmbracoController IBackOfficeExternalLoginProviders externalLogins, IHttpContextAccessor httpContextAccessor, IBackOfficeTwoFactorOptions backOfficeTwoFactorOptions, - IManifestParser manifestParser, + ILegacyManifestParser legacyManifestParser, ServerVariablesParser serverVariables, IOptions securitySettings) { @@ -109,7 +109,7 @@ public class BackOfficeController : UmbracoController _externalLogins = externalLogins; _httpContextAccessor = httpContextAccessor; _backOfficeTwoFactorOptions = backOfficeTwoFactorOptions; - _manifestParser = manifestParser; + _legacyManifestParser = legacyManifestParser; _serverVariables = serverVariables; _securitySettings = securitySettings; } @@ -236,7 +236,7 @@ public class BackOfficeController : UmbracoController var result = await _runtimeMinifier.GetScriptForLoadingBackOfficeAsync( _globalSettings, _hostingEnvironment, - _manifestParser); + _legacyManifestParser); return new JavaScriptResult(result); } diff --git a/src/Umbraco.Web.BackOffice/Extensions/RuntimeMinifierExtensions.cs b/src/Umbraco.Web.BackOffice/Extensions/RuntimeMinifierExtensions.cs index d00d0285e7..95ca6adc10 100644 --- a/src/Umbraco.Web.BackOffice/Extensions/RuntimeMinifierExtensions.cs +++ b/src/Umbraco.Web.BackOffice/Extensions/RuntimeMinifierExtensions.cs @@ -17,7 +17,7 @@ public static class RuntimeMinifierExtensions this IRuntimeMinifier minifier, GlobalSettings globalSettings, IHostingEnvironment hostingEnvironment, - IManifestParser manifestParser) + ILegacyManifestParser legacyManifestParser) { var files = new HashSet(StringComparer.InvariantCultureIgnoreCase); foreach (var file in await minifier.GetJsAssetPathsAsync(BackOfficeWebAssets.UmbracoCoreJsBundleName)) @@ -31,10 +31,10 @@ public static class RuntimeMinifierExtensions } // process the independent bundles - if (manifestParser.CombinedManifest.Scripts.TryGetValue(BundleOptions.Independent, - out IReadOnlyList? independentManifestAssetsList)) + if (legacyManifestParser.CombinedManifest.Scripts.TryGetValue(BundleOptions.Independent, + out IReadOnlyList? independentManifestAssetsList)) { - foreach (ManifestAssets manifestAssets in independentManifestAssetsList) + foreach (LegacyManifestAssets manifestAssets in independentManifestAssetsList) { var bundleName = BackOfficeWebAssets.GetIndependentPackageBundleName(manifestAssets, AssetType.Javascript); @@ -58,7 +58,7 @@ public static class RuntimeMinifierExtensions globalSettings, hostingEnvironment); - result += await GetStylesheetInitializationAsync(minifier, manifestParser); + result += await GetStylesheetInitializationAsync(minifier, legacyManifestParser); return result; } @@ -68,7 +68,7 @@ public static class RuntimeMinifierExtensions /// private static async Task GetStylesheetInitializationAsync( IRuntimeMinifier minifier, - IManifestParser manifestParser) + ILegacyManifestParser legacyManifestParser) { var files = new HashSet(StringComparer.InvariantCultureIgnoreCase); foreach (var file in await minifier.GetCssAssetPathsAsync(BackOfficeWebAssets.UmbracoCssBundleName)) @@ -77,10 +77,10 @@ public static class RuntimeMinifierExtensions } // process the independent bundles - if (manifestParser.CombinedManifest.Stylesheets.TryGetValue(BundleOptions.Independent, - out IReadOnlyList? independentManifestAssetsList)) + if (legacyManifestParser.CombinedManifest.Stylesheets.TryGetValue(BundleOptions.Independent, + out IReadOnlyList? independentManifestAssetsList)) { - foreach (ManifestAssets manifestAssets in independentManifestAssetsList) + foreach (LegacyManifestAssets manifestAssets in independentManifestAssetsList) { var bundleName = BackOfficeWebAssets.GetIndependentPackageBundleName(manifestAssets, AssetType.Css); foreach (var asset in await minifier.GetCssAssetPathsAsync(bundleName)) diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestContentAppTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/LegacyManifestContentAppTests.cs similarity index 94% rename from tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestContentAppTests.cs rename to tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/LegacyManifestContentAppTests.cs index 350c1f1944..5d66ba7556 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestContentAppTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/LegacyManifestContentAppTests.cs @@ -14,7 +14,7 @@ using Umbraco.Cms.Tests.UnitTests.TestHelpers; namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Manifest; [TestFixture] -public class ManifestContentAppTests +public class LegacyManifestContentAppTests { [Test] public void Test() @@ -70,11 +70,11 @@ public class ManifestContentAppTests private void AssertDefinition(object source, bool expected, string[] show, IReadOnlyUserGroup[] groups) { - var definition = JsonConvert.DeserializeObject("{" + + var definition = JsonConvert.DeserializeObject("{" + (show.Length == 0 ? string.Empty : " \"show\": [" + string.Join(",", show.Select(x => "\"" + x + "\"")) + "] ") + "}"); - var factory = new ManifestContentAppFactory(definition, TestHelper.IOHelper); + var factory = new LegacyManifestContentAppFactory(definition, TestHelper.IOHelper); var app = factory.GetContentAppFor(source, groups); if (expected) { diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestParserTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/LegacyManifestParserTests.cs similarity index 96% rename from tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestParserTests.cs rename to tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/LegacyManifestParserTests.cs index 2cb1341f0a..fbef57a11a 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestParserTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/LegacyManifestParserTests.cs @@ -24,7 +24,7 @@ using Umbraco.Cms.Tests.UnitTests.TestHelpers; namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Manifest; [TestFixture] -public class ManifestParserTests +public class LegacyManifestParserTests { [SetUp] public void Setup() @@ -37,11 +37,11 @@ public class ManifestParserTests }; _ioHelper = TestHelper.IOHelper; var loggerFactory = NullLoggerFactory.Instance; - _parser = new ManifestParser( + _parser = new LegacyManifestParser( AppCaches.Disabled, new ManifestValueValidatorCollection(() => validators), - new ManifestFilterCollection(() => Enumerable.Empty()), - loggerFactory.CreateLogger(), + new LegacyManifestFilterCollection(() => Enumerable.Empty()), + loggerFactory.CreateLogger(), _ioHelper, TestHelper.GetHostingEnvironment(), new JsonNetSerializer(), @@ -51,7 +51,7 @@ public class ManifestParserTests Mock.Of()); } - private ManifestParser _parser; + private LegacyManifestParser _parser; private IIOHelper _ioHelper; [Test] @@ -410,14 +410,14 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2 var manifest = _parser.ParseManifest(json); Assert.AreEqual(2, manifest.ContentApps.Length); - Assert.IsInstanceOf(manifest.ContentApps[0]); + Assert.IsInstanceOf(manifest.ContentApps[0]); var app0 = manifest.ContentApps[0]; Assert.AreEqual("myPackageApp1", app0.Alias); Assert.AreEqual("My App1", app0.Name); Assert.AreEqual("icon-foo", app0.Icon); Assert.AreEqual(_ioHelper.ResolveUrl("/App_Plugins/MyPackage/ContentApps/MyApp1.html"), app0.View); - Assert.IsInstanceOf(manifest.ContentApps[1]); + Assert.IsInstanceOf(manifest.ContentApps[1]); var app1 = manifest.ContentApps[1]; Assert.AreEqual("myPackageApp2", app1.Alias); Assert.AreEqual("My App2", app1.Name); @@ -447,7 +447,7 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2 var manifest = _parser.ParseManifest(json); Assert.AreEqual(2, manifest.Dashboards.Length); - Assert.IsInstanceOf(manifest.Dashboards[0]); + Assert.IsInstanceOf(manifest.Dashboards[0]); var db0 = manifest.Dashboards[0]; Assert.AreEqual("something", db0.Alias); Assert.AreEqual(100, db0.Weight); @@ -460,7 +460,7 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2 Assert.AreEqual(AccessRuleType.Deny, db0.AccessRules[1].Type); Assert.AreEqual("foo", db0.AccessRules[1].Value); - Assert.IsInstanceOf(manifest.Dashboards[1]); + Assert.IsInstanceOf(manifest.Dashboards[1]); var db1 = manifest.Dashboards[1]; Assert.AreEqual("something.else", db1.Alias); Assert.AreEqual(-1, db1.Weight);