diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs index db45fab96f..ec526d8c0f 100644 --- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs +++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs @@ -8,7 +8,6 @@ using Umbraco.Cms.Core.HealthChecks; using Umbraco.Cms.Core.HealthChecks.NotificationMethods; using Umbraco.Cms.Core.Manifest; using Umbraco.Cms.Core.Media.EmbedProviders; -using Umbraco.Cms.Core.PackageActions; using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Core.PropertyEditors.Validators; using Umbraco.Cms.Core.Routing; @@ -86,7 +85,6 @@ namespace Umbraco.Cms.Core.DependencyInjection .Add() .Add() .Add(builder.TypeLoader.GetTypes()); - builder.PackageActions().Add(() => builder.TypeLoader.GetPackageActions()); builder.DataValueReferenceFactories(); builder.PropertyValueConverters().Append(builder.TypeLoader.GetTypes()); builder.UrlSegmentProviders().Append(); @@ -203,13 +201,6 @@ namespace Umbraco.Cms.Core.DependencyInjection public static CacheRefresherCollectionBuilder CacheRefreshers(this IUmbracoBuilder builder) => builder.WithCollectionBuilder(); - /// - /// Gets the package actions collection builder. - /// - /// The builder. - internal static PackageActionCollectionBuilder PackageActions(this IUmbracoBuilder builder) - => builder.WithCollectionBuilder(); - /// /// Gets the data editor collection builder. /// diff --git a/src/Umbraco.Core/Extensions/TypeLoaderExtensions.cs b/src/Umbraco.Core/Extensions/TypeLoaderExtensions.cs index 515a1d2018..e6e67f6153 100644 --- a/src/Umbraco.Core/Extensions/TypeLoaderExtensions.cs +++ b/src/Umbraco.Core/Extensions/TypeLoaderExtensions.cs @@ -1,11 +1,10 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. using System; using System.Collections.Generic; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Composing; -using Umbraco.Cms.Core.PackageActions; using Umbraco.Cms.Core.PropertyEditors; namespace Umbraco.Extensions @@ -27,13 +26,5 @@ namespace Umbraco.Extensions { return mgr.GetTypes(); } - - /// - /// Gets all classes implementing IPackageAction. - /// - public static IEnumerable GetPackageActions(this TypeLoader mgr) - { - return mgr.GetTypes(); - } } } diff --git a/src/Umbraco.Core/Models/Packaging/ActionRunAt.cs b/src/Umbraco.Core/Models/Packaging/ActionRunAt.cs deleted file mode 100644 index e4f3538d20..0000000000 --- a/src/Umbraco.Core/Models/Packaging/ActionRunAt.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Umbraco.Cms.Core.Models.Packaging -{ - public enum ActionRunAt - { - Undefined = 0, - Install, - Uninstall - } -} diff --git a/src/Umbraco.Core/Models/Packaging/CompiledPackage.cs b/src/Umbraco.Core/Models/Packaging/CompiledPackage.cs index a975141205..db448a2c0a 100644 --- a/src/Umbraco.Core/Models/Packaging/CompiledPackage.cs +++ b/src/Umbraco.Core/Models/Packaging/CompiledPackage.cs @@ -26,8 +26,6 @@ namespace Umbraco.Cms.Core.Models.Packaging public string PackageView { get; set; } public string IconUrl { get; set; } - public string Actions { get; set; } // TODO: Should we make this strongly typed to IEnumerable ? - public PreInstallWarnings Warnings { get; set; } = new PreInstallWarnings(); public List Files { get; set; } = new List(); diff --git a/src/Umbraco.Core/Models/Packaging/PackageAction.cs b/src/Umbraco.Core/Models/Packaging/PackageAction.cs deleted file mode 100644 index 25c04c0480..0000000000 --- a/src/Umbraco.Core/Models/Packaging/PackageAction.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Runtime.Serialization; -using System.Xml.Linq; - -namespace Umbraco.Cms.Core.Models.Packaging -{ - /// - /// Defines a package action declared within a package manifest - /// - [Serializable] - [DataContract(IsReference = true)] - public class PackageAction - { - private ActionRunAt _runAt; - private bool? _undo; - public string Alias { get; set; } - - public string PackageName { get; set; } - - public ActionRunAt RunAt - { - get => _runAt == ActionRunAt.Undefined ? ActionRunAt.Install : _runAt; - set => _runAt = value; - } - - public bool Undo - { - get => _undo ?? true; - set => _undo = value; - } - - public XElement XmlData { get; set; } - } -} diff --git a/src/Umbraco.Core/PackageActions/AllowDoctype.cs b/src/Umbraco.Core/PackageActions/AllowDoctype.cs deleted file mode 100644 index 7e2bf47fab..0000000000 --- a/src/Umbraco.Core/PackageActions/AllowDoctype.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.Collections; -using System.Linq; -using System.Xml.Linq; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Core.PackageActions -{ - /// - /// This class implements the IPackageAction Interface, used to execute code when packages are installed. - /// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode. - /// - public class AllowDoctype : IPackageAction - { - private readonly IContentTypeService _contentTypeService; - - public AllowDoctype(IContentTypeService contentTypeService) - { - _contentTypeService = contentTypeService; - } - - #region IPackageAction Members - - /// - /// Allows a documentType to be created below another documentType. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// Returns true on success - public bool Execute(string packageName, XElement xmlData) - { - string doctypeName = xmlData.AttributeValue("documentTypeAlias"); - string parentDoctypeName = xmlData.AttributeValue("parentDocumentTypeAlias"); - - //global::umbraco.cms.businesslogic.ContentType ct = global::umbraco.cms.businesslogic.ContentType.GetByAlias(doctypeName); - //global::umbraco.cms.businesslogic.ContentType parentct = global::umbraco.cms.businesslogic.ContentType.GetByAlias(parentDoctypeName); - var ct = _contentTypeService.Get(doctypeName); - var parentct = _contentTypeService.Get(parentDoctypeName); - - if (ct != null && parentct != null) - { - bool containsId = false; - ArrayList tmp = new ArrayList(); - - foreach (int i in parentct.AllowedContentTypes.Select(x => x.Id.Value).ToList()) - { - tmp.Add(i); - if (i == ct.Id) - containsId = true; - } - - if (!containsId) - { - - int[] ids = new int[tmp.Count + 1]; - for (int i = 0; i < tmp.Count; i++) ids[i] = (int)tmp[i]; - ids[ids.Length - 1] = ct.Id; - - //parentct.AllowedChildContentTypeIDs = ids; - var so = 0; - parentct.AllowedContentTypes = ids.Select(x => new ContentTypeSort(x, so++)); - //parentct.Save(); - _contentTypeService.Save(parentct); - return true; - } - } - return false; - } - - /// - /// This action has no undo. - /// - /// Name of the package. - /// The XML data. - /// - public bool Undo(string packageName, XElement xmlData) - { - return true; - } - - /// - /// Action Alias. - /// - /// - public string Alias() - { - return "allowDocumenttype"; - } - - #endregion - - } -} diff --git a/src/Umbraco.Core/PackageActions/IPackageAction.cs b/src/Umbraco.Core/PackageActions/IPackageAction.cs deleted file mode 100644 index 65db0116ea..0000000000 --- a/src/Umbraco.Core/PackageActions/IPackageAction.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Xml.Linq; -using Umbraco.Cms.Core.Composing; - -namespace Umbraco.Cms.Core.PackageActions -{ - public interface IPackageAction : IDiscoverable - { - bool Execute(string packageName, XElement xmlData); - string Alias(); - bool Undo(string packageName, XElement xmlData); - } -} diff --git a/src/Umbraco.Core/PackageActions/PackageActionCollection.cs b/src/Umbraco.Core/PackageActions/PackageActionCollection.cs deleted file mode 100644 index 078eb0c09f..0000000000 --- a/src/Umbraco.Core/PackageActions/PackageActionCollection.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; -using Umbraco.Cms.Core.Composing; - -namespace Umbraco.Cms.Core.PackageActions -{ - public sealed class PackageActionCollection : BuilderCollectionBase - { - public PackageActionCollection(IEnumerable items) - : base(items) - { } - } -} diff --git a/src/Umbraco.Core/PackageActions/PackageActionCollectionBuilder.cs b/src/Umbraco.Core/PackageActions/PackageActionCollectionBuilder.cs deleted file mode 100644 index efabeeaad8..0000000000 --- a/src/Umbraco.Core/PackageActions/PackageActionCollectionBuilder.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Umbraco.Cms.Core.Composing; - -namespace Umbraco.Cms.Core.PackageActions -{ - public class PackageActionCollectionBuilder : LazyCollectionBuilderBase - { - protected override PackageActionCollectionBuilder This => this; - } -} diff --git a/src/Umbraco.Core/PackageActions/PublishRootDocument.cs b/src/Umbraco.Core/PackageActions/PublishRootDocument.cs deleted file mode 100644 index 8a73275e1e..0000000000 --- a/src/Umbraco.Core/PackageActions/PublishRootDocument.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.Xml.Linq; -using Umbraco.Cms.Core.Services; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Core.PackageActions -{ - /// - /// This class implements the IPackageAction Interface, used to execute code when packages are installed. - /// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode. - /// - public class PublishRootDocument : IPackageAction - { - private readonly IContentService _contentService; - - public PublishRootDocument(IContentService contentService) - { - _contentService = contentService; - } - - #region IPackageAction Members - - /// - /// Executes the specified package action. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// True if executed succesfully - public bool Execute(string packageName, XElement xmlData) - { - - string documentName = xmlData.AttributeValue("documentName"); - - var rootDocs = _contentService.GetRootContent(); - - foreach (var rootDoc in rootDocs) - { - if (rootDoc.Name.Trim() == documentName.Trim() && rootDoc.ContentType != null) - { - // TODO: variants? - _contentService.SaveAndPublishBranch(rootDoc, true); - break; - } - } - return true; - } - - /// - /// This action has no undo. - /// - /// Name of the package. - /// The XML data. - /// - public bool Undo(string packageName, XElement xmlData) - { - return true; - } - - /// - /// Action alias - /// - /// - public string Alias() - { - return "publishRootDocument"; - } - #endregion - - } -} diff --git a/src/Umbraco.Core/Packaging/CompiledPackageXmlParser.cs b/src/Umbraco.Core/Packaging/CompiledPackageXmlParser.cs index 5dc25c31f1..846a5eb6d8 100644 --- a/src/Umbraco.Core/Packaging/CompiledPackageXmlParser.cs +++ b/src/Umbraco.Core/Packaging/CompiledPackageXmlParser.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -148,52 +148,5 @@ namespace Umbraco.Cms.Core.Packaging return path; } - /// - /// Parses the package actions stored in the package definition - /// - /// - /// - /// - public static IEnumerable GetPackageActions(XElement actionsElement, string packageName) - { - if (actionsElement == null) return Enumerable.Empty(); - - //invariant check ... because people can really enter anything :/ - if (!string.Equals("actions", actionsElement.Name.LocalName, StringComparison.InvariantCultureIgnoreCase)) - throw new FormatException("Must be \"\" as root"); - - if (!actionsElement.HasElements) return Enumerable.Empty(); - - var actionElementName = actionsElement.Elements().First().Name.LocalName; - - //invariant check ... because people can really enter anything :/ - if (!string.Equals("action", actionElementName, StringComparison.InvariantCultureIgnoreCase)) - throw new FormatException("Must be \" - { - var aliasAttr = e.Attribute("alias") ?? e.Attribute("Alias"); //allow both ... because people can really enter anything :/ - if (aliasAttr == null) - throw new ArgumentException("missing \"alias\" attribute in alias element", nameof(actionsElement)); - - var packageAction = new PackageAction - { - XmlData = e, - Alias = aliasAttr.Value, - PackageName = packageName, - }; - - var attr = e.Attribute("runat") ?? e.Attribute("Runat"); //allow both ... because people can really enter anything :/ - - if (attr != null && Enum.TryParse(attr.Value, true, out ActionRunAt runAt)) { packageAction.RunAt = runAt; } - - attr = e.Attribute("undo") ?? e.Attribute("Undo"); //allow both ... because people can really enter anything :/ - - if (attr != null && bool.TryParse(attr.Value, out var undo)) { packageAction.Undo = undo; } - - return packageAction; - }).ToArray(); - } } } diff --git a/src/Umbraco.Core/Packaging/IPackageActionRunner.cs b/src/Umbraco.Core/Packaging/IPackageActionRunner.cs deleted file mode 100644 index e170ff7961..0000000000 --- a/src/Umbraco.Core/Packaging/IPackageActionRunner.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; -using System.Xml.Linq; - -namespace Umbraco.Cms.Core.Packaging -{ - public interface IPackageActionRunner - { - /// - /// Runs the package action with the specified action alias. - /// - /// Name of the package. - /// The action alias. - /// The action XML. - /// - bool RunPackageAction(string packageName, string actionAlias, XElement actionXml, out IEnumerable errors); - - /// - /// Undos the package action with the specified action alias. - /// - /// Name of the package. - /// The action alias. - /// The action XML. - /// - bool UndoPackageAction(string packageName, string actionAlias, XElement actionXml, out IEnumerable errors); - } -} diff --git a/src/Umbraco.Core/Packaging/InstallationSummary.cs b/src/Umbraco.Core/Packaging/InstallationSummary.cs index cf2efcd159..8070f1dfa8 100644 --- a/src/Umbraco.Core/Packaging/InstallationSummary.cs +++ b/src/Umbraco.Core/Packaging/InstallationSummary.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; @@ -23,9 +23,7 @@ namespace Umbraco.Cms.Core.Packaging public IEnumerable StylesheetsInstalled { get; set; } = Enumerable.Empty(); public IEnumerable ContentInstalled { get; set; } = Enumerable.Empty(); public IEnumerable MediaInstalled { get; set; } = Enumerable.Empty(); - public IEnumerable Actions { get; set; } = Enumerable.Empty(); - public IEnumerable ActionErrors { get; set; } = Enumerable.Empty(); - + } } diff --git a/src/Umbraco.Core/Packaging/PackageActionRunner.cs b/src/Umbraco.Core/Packaging/PackageActionRunner.cs deleted file mode 100644 index 8fd54fa431..0000000000 --- a/src/Umbraco.Core/Packaging/PackageActionRunner.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Xml.Linq; -using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.PackageActions; - -namespace Umbraco.Cms.Core.Packaging -{ - /// - /// Package actions are executed on package install / uninstall. - /// - public class PackageActionRunner : IPackageActionRunner - { - private readonly ILogger _logger; - private readonly PackageActionCollection _packageActions; - - public PackageActionRunner(ILogger logger, PackageActionCollection packageActions) - { - _logger = logger; - _packageActions = packageActions; - } - - /// - public bool RunPackageAction(string packageName, string actionAlias, XElement actionXml, out IEnumerable errors) - { - var e = new List(); - foreach (var ipa in _packageActions) - { - try - { - if (ipa.Alias() == actionAlias) - ipa.Execute(packageName, actionXml); - } - catch (Exception ex) - { - e.Add($"{ipa.Alias()} - {ex.Message}"); - _logger.LogError(ex, "Error loading package action '{PackageActionAlias}' for package {PackageName}", ipa.Alias(), packageName); - } - } - - errors = e; - return e.Count == 0; - } - - /// - public bool UndoPackageAction(string packageName, string actionAlias, XElement actionXml, out IEnumerable errors) - { - var e = new List(); - foreach (var ipa in _packageActions) - { - try - { - if (ipa.Alias() == actionAlias) - ipa.Undo(packageName, actionXml); - } - catch (Exception ex) - { - e.Add($"{ipa.Alias()} - {ex.Message}"); - _logger.LogError(ex, "Error undoing package action '{PackageActionAlias}' for package {PackageName}", ipa.Alias(), packageName); - } - } - errors = e; - return e.Count == 0; - } - - } -} diff --git a/src/Umbraco.Core/Packaging/UninstallationSummary.cs b/src/Umbraco.Core/Packaging/UninstallationSummary.cs index b751c46c50..315cf98c23 100644 --- a/src/Umbraco.Core/Packaging/UninstallationSummary.cs +++ b/src/Umbraco.Core/Packaging/UninstallationSummary.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; @@ -20,7 +20,6 @@ namespace Umbraco.Cms.Core.Packaging public IEnumerable TemplatesUninstalled { get; set; } = Enumerable.Empty(); public IEnumerable DocumentTypesUninstalled { get; set; } = Enumerable.Empty(); public IEnumerable StylesheetsUninstalled { get; set; } = Enumerable.Empty(); - public IEnumerable Actions { get; set; } = Enumerable.Empty(); - public IEnumerable ActionErrors { get; set; } = Enumerable.Empty(); + } } diff --git a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs index 30e8ae37f8..68d74fefeb 100644 --- a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs +++ b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs @@ -67,8 +67,6 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection builder.Services.AddUnique(); - builder.Services.AddUnique(); - builder.Services.AddUnique(); builder.Services.AddUnique(); builder.Services.AddUnique(factory => CreatePackageRepository(factory, "createdPackages.config")); diff --git a/src/Umbraco.Infrastructure/Packaging/PackageInstallation.cs b/src/Umbraco.Infrastructure/Packaging/PackageInstallation.cs index 5409e2de3f..119ee734e9 100644 --- a/src/Umbraco.Infrastructure/Packaging/PackageInstallation.cs +++ b/src/Umbraco.Infrastructure/Packaging/PackageInstallation.cs @@ -15,20 +15,18 @@ namespace Umbraco.Cms.Core.Packaging private readonly PackageDataInstallation _packageDataInstallation; private readonly PackageFileInstallation _packageFileInstallation; private readonly CompiledPackageXmlParser _parser; - private readonly IPackageActionRunner _packageActionRunner; private readonly DirectoryInfo _applicationRootFolder; /// /// Initializes a new instance of the class. /// - public PackageInstallation(PackageDataInstallation packageDataInstallation, PackageFileInstallation packageFileInstallation, CompiledPackageXmlParser parser, IPackageActionRunner packageActionRunner, IHostingEnvironment hostingEnvironment) + public PackageInstallation(PackageDataInstallation packageDataInstallation, PackageFileInstallation packageFileInstallation, CompiledPackageXmlParser parser, IHostingEnvironment hostingEnvironment) { _packageExtraction = new PackageExtraction(); _packageFileInstallation = packageFileInstallation ?? throw new ArgumentNullException(nameof(packageFileInstallation)); _packageDataInstallation = packageDataInstallation ?? throw new ArgumentNullException(nameof(packageDataInstallation)); _parser = parser ?? throw new ArgumentNullException(nameof(parser)); - _packageActionRunner = packageActionRunner ?? throw new ArgumentNullException(nameof(packageActionRunner)); _applicationRootFolder = new DirectoryInfo(hostingEnvironment.ApplicationPhysicalPath); } @@ -68,11 +66,6 @@ namespace Umbraco.Cms.Core.Packaging //running this will update the PackageDefinition with the items being removed var summary = _packageDataInstallation.UninstallPackageData(package, userId); - summary.Actions = CompiledPackageXmlParser.GetPackageActions(XElement.Parse(package.Actions), package.Name); - - //run actions before files are removed - summary.ActionErrors = UndoPackageActions(package, summary.Actions).ToList(); - var filesRemoved = _packageFileInstallation.UninstallFiles(package); summary.FilesUninstalled = filesRemoved; @@ -83,7 +76,6 @@ namespace Umbraco.Cms.Core.Packaging { var installationSummary = _packageDataInstallation.InstallPackageData(compiledPackage, userId); - installationSummary.Actions = CompiledPackageXmlParser.GetPackageActions(XElement.Parse(compiledPackage.Actions), compiledPackage.Name); installationSummary.MetaData = compiledPackage; installationSummary.FilesInstalled = packageDefinition.Files; @@ -98,64 +90,9 @@ namespace Umbraco.Cms.Core.Packaging var contentInstalled = installationSummary.ContentInstalled.ToList(); packageDefinition.ContentNodeId = contentInstalled.Count > 0 ? contentInstalled[0].Id.ToInvariantString() : null; - //run package actions - installationSummary.ActionErrors = RunPackageActions(packageDefinition, installationSummary.Actions).ToList(); - return installationSummary; } - private IEnumerable RunPackageActions(PackageDefinition packageDefinition, IEnumerable actions) - { - var actionsElement = XElement.Parse(packageDefinition.Actions); - foreach (PackageAction action in actions) - { - //if there is an undo section then save it to the definition so we can run it at uninstallation - var undo = action.Undo; - if (undo) - { - actionsElement.Add(action.XmlData); - } - - - //Run the actions tagged only for 'install' - if (action.RunAt != ActionRunAt.Install) - { - continue; - } - - if (action.Alias.IsNullOrWhiteSpace()) - { - continue; - } - - //run the actions and report errors - if (!_packageActionRunner.RunPackageAction(packageDefinition.Name, action.Alias, action.XmlData, out var err)) - { - foreach (var e in err) - { - yield return e; - } - } - } - - packageDefinition.Actions = actionsElement.ToString(); - } - - private IEnumerable UndoPackageActions(IPackageInfo packageDefinition, IEnumerable actions) - { - foreach (var n in actions) - { - //Run the actions tagged only for 'uninstall' - if (n.RunAt != ActionRunAt.Uninstall) continue; - - if (n.Alias.IsNullOrWhiteSpace()) continue; - - //run the actions and report errors - if (!_packageActionRunner.UndoPackageAction(packageDefinition.Name, n.Alias, n.XmlData, out var err)) - foreach (var e in err) yield return e; - } - } - private XDocument GetConfigXmlDoc(FileInfo packageFile) { var configXmlContent = _packageExtraction.ReadTextFileFromArchive(packageFile, "package.xml", out _); diff --git a/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs b/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs index 3df297b47a..8a10bc4f4c 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -161,8 +161,6 @@ namespace Umbraco.Cms.Core.Services.Implement allSummaries.Add(versionUninstallSummary); //merge the summary - summary.ActionErrors = summary.ActionErrors.Concat(versionUninstallSummary.ActionErrors).Distinct().ToList(); - summary.Actions = summary.Actions.Concat(versionUninstallSummary.Actions).Distinct().ToList(); summary.DataTypesUninstalled = summary.DataTypesUninstalled.Concat(versionUninstallSummary.DataTypesUninstalled).Distinct().ToList(); summary.DictionaryItemsUninstalled = summary.DictionaryItemsUninstalled.Concat(versionUninstallSummary.DictionaryItemsUninstalled).Distinct().ToList(); summary.DocumentTypesUninstalled = summary.DocumentTypesUninstalled.Concat(versionUninstallSummary.DocumentTypesUninstalled).Distinct().ToList(); diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/PackageActionCollectionTests.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/PackageActionCollectionTests.cs deleted file mode 100644 index f393ff9910..0000000000 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/PackageActionCollectionTests.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Umbraco. -// See LICENSE for more details. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml; -using System.Xml.Linq; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Moq; -using NUnit.Framework; -using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Cms.Core.PackageActions; -using Umbraco.Cms.Tests.UnitTests.TestHelpers; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Composing -{ - [TestFixture] - public class PackageActionCollectionTests : ComposingTestBase - { - [Test] - public void PackageActionCollectionBuilderWorks() - { - IServiceCollection container = TestHelper.GetServiceCollection(); - - var composition = new UmbracoBuilder(container, Mock.Of(), TestHelper.GetMockedTypeLoader()); - - IEnumerable expectedPackageActions = TypeLoader.GetPackageActions(); - composition.WithCollectionBuilder() - .Add(() => expectedPackageActions); - - IServiceProvider factory = composition.CreateServiceProvider(); - - PackageActionCollection actions = factory.GetRequiredService(); - Assert.AreEqual(2, actions.Count()); - - // order is unspecified, but both must be there - bool hasAction1 = actions.ElementAt(0) is PackageAction1 || actions.ElementAt(1) is PackageAction1; - bool hasAction2 = actions.ElementAt(0) is PackageAction2 || actions.ElementAt(1) is PackageAction2; - - Assert.IsTrue(hasAction1); - Assert.IsTrue(hasAction2); - } - - public class PackageAction1 : IPackageAction - { - public bool Execute(string packageName, XElement xmlData) => throw new NotImplementedException(); - - public string Alias() => "pa1"; - - public bool Undo(string packageName, XElement xmlData) => throw new NotImplementedException(); - - public XmlNode SampleXml() => throw new NotImplementedException(); - } - - public class PackageAction2 : IPackageAction - { - public bool Execute(string packageName, XElement xmlData) => throw new NotImplementedException(); - - public string Alias() => "pa2"; - - public bool Undo(string packageName, XElement xmlData) => throw new NotImplementedException(); - - public XmlNode SampleXml() => throw new NotImplementedException(); - } - } -} diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/edit.html b/src/Umbraco.Web.UI.Client/src/views/packages/edit.html index f78fc6e97b..86de554b16 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packages/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packages/edit.html @@ -285,29 +285,6 @@ -
- -
- -
- Documentation -
-
-
-
-
-
-
-
- diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/cs.xml b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/cs.xml index 83ad75acc2..f9453136d4 100644 --- a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/cs.xml +++ b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/cs.xml @@ -1119,7 +1119,6 @@ Zatím nebyly vytvořeny žádné balíčky Nemáte nainstalované žádné balíčky Balíčky v pravém horním rohu obrazovky.]]> - Akce balíčku Web autora Obsah balíčku Soubory balíčku diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml index 43acad00eb..3e8e80e1f1 100644 --- a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml @@ -991,7 +991,6 @@ Mange hilsner fra Umbraco robotten Der er ikke blevet oprettet nogle pakker endnu Du har ingen pakker installeret 'Pakker' øverst til højre på din skærm]]> - Pakkehandlinger Forfatter URL Pakkeindhold Pakkefiler diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/de.xml b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/de.xml index f09f434805..473d6952b2 100644 --- a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/de.xml +++ b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/de.xml @@ -1181,7 +1181,6 @@ 'Pakete' rechts, oben), um es zu installieren ]]> - Packet Aktionen Autor URL Paketinhalt Paketdateien diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml index 7da252c9d0..22a88f16e6 100644 --- a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml @@ -1235,7 +1235,6 @@ To manage your website, simply open the Umbraco backoffice and start adding cont No packages have been created yet You don’t have any packages installed 'Packages' icon in the top right of your screen]]> - Package Actions Author URL Package Content Package Files diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml index 2db8db4ae2..b1c76ae3d0 100644 --- a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml @@ -1247,7 +1247,6 @@ To manage your website, simply open the Umbraco backoffice and start adding cont No packages have been created yet You don’t have any packages installed 'Packages' icon in the top right of your screen]]> - Package Actions Author URL Package Content Package Files diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/fr.xml b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/fr.xml index 1c907f1340..7a0a7f938b 100644 --- a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/fr.xml +++ b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/fr.xml @@ -1183,7 +1183,6 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à Aucun package n'a encore été créé Vous n'avez aucun package installé 'Packages' en haut à droite de votre écran]]> - Actions du package URL de l'auteur Contenu du package Fichiers du package diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/nl.xml b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/nl.xml index 5613f830b6..1f692b8c77 100644 --- a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/nl.xml +++ b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/nl.xml @@ -1,4 +1,4 @@ - + The Umbraco community @@ -1037,7 +1037,6 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je Er zijn nog geen packages aangemaakt Er zijn geen packages geïnstalleerd 'Packages' rechtsboven in je scherm.]]> - Package Acties Auteur URL Package Inhoud Package Bestanden diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/tr.xml b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/tr.xml index d59cf248fc..7cb2c78e63 100644 --- a/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/tr.xml +++ b/src/Umbraco.Web.UI.NetCore/umbraco/config/lang/tr.xml @@ -1260,7 +1260,6 @@ Web sitenizi yönetmek için, Umbraco'nun arka ofisini açın ve içerik eklemey Henüz paket oluşturulmadı Kurulu paketiniz yok 'Paketler' simgesini kullanarak mevcut paketlere göz atın]]> - Paket İşlemleri Yazar URL'si Paket İçeriği Paket Dosyaları diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/cy.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/cy.xml index 6f52c24034..c915f42fd3 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/cy.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/cy.xml @@ -1,4 +1,4 @@ - + Method4 Ltd @@ -1340,7 +1340,6 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang 'Pecynnau' yng nghornel dop, dde eich sgrîn]]> Nid oes gan y pecyn hwn unrhyw olwg cyfluniad Nid oes unrhyw becynnau wedi'u creu eto - Camau Gweithredu Pecyn URL y Awdur Cynnwys y Pecyn Ffeiliau y Pecyn