From 80a2b4c23853fa4a98a157091f5f0edc117731a8 Mon Sep 17 00:00:00 2001 From: berg Date: Sat, 27 Feb 2021 18:29:59 +0100 Subject: [PATCH 1/3] Fixed cypress test --- .../cypress/integration/Content/content.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts index c862708bbe..ecfe3e95d8 100644 --- a/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts +++ b/src/Umbraco.Tests.AcceptanceTest/cypress/integration/Content/content.ts @@ -506,7 +506,7 @@ context('Content', () => { const pickerDocTypeName = 'Content picker doc type'; const pickerDocTypeAlias = AliasHelper.toAlias(pickerDocTypeName); const pickedDocTypeName = 'Picked content document type'; - + const pickedDocTypeAlias = AliasHelper.toAlias(pickedDocTypeName); cy.deleteAllContent(); cy.umbracoEnsureDocumentTypeNameNotExists(pickerDocTypeName); cy.umbracoEnsureTemplateNameNotExists(pickerDocTypeName); @@ -515,6 +515,7 @@ context('Content', () => { // Create the content type and content we'll be picking from. const pickedDocType = new DocumentTypeBuilder() .withName(pickedDocTypeName) + .withAlias(pickedDocTypeAlias) .withAllowAsRoot(true) .addGroup() .addTextBoxProperty() @@ -559,19 +560,13 @@ context('Content', () => { cy.saveDocumentType(pickerDocType); // Edit it the template to allow us to verify the rendered view. - cy.editTemplate(pickerDocTypeName, `@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage - @using ContentModels = Umbraco.Web.PublishedModels; + cy.editTemplate(pickerDocTypeName, `@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage @{ Layout = null; + var pickedItem = Model.Picker as PickedContentDocumentType; } - @{ - IPublishedContent typedContentPicker = Model.Value("picker"); - if (typedContentPicker != null) - { -

@typedContentPicker.Value("text")

- } - }`); +

@pickedItem.Text

`); // Create content with content picker cy.get('.umb-tree-root-link').rightclick(); From d7d99e5c0058f82370393973dd959d669e8e8ec6 Mon Sep 17 00:00:00 2001 From: berg Date: Sat, 27 Feb 2021 19:26:36 +0100 Subject: [PATCH 2/3] Fixed issue found by cypress test. script/css folders was not deleted because it search in contentroot and not wwwroot --- .../Controllers/CodeFileController.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.BackOffice/Controllers/CodeFileController.cs b/src/Umbraco.Web.BackOffice/Controllers/CodeFileController.cs index 25f8f21c01..ffdc45d5ac 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/CodeFileController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/CodeFileController.cs @@ -338,7 +338,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers switch (type) { case Constants.Trees.PartialViews: - if (IsDirectory(virtualPath, Constants.SystemDirectories.PartialViews)) + if (IsDirectory(_hostingEnvironment.MapPathContentRoot(Path.Combine(Constants.SystemDirectories.PartialViews, virtualPath)))) { _fileService.DeletePartialViewFolder(virtualPath); return Ok(); @@ -350,7 +350,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers return new UmbracoProblemResult("No Partial View or folder found with the specified path", HttpStatusCode.NotFound); case Constants.Trees.PartialViewMacros: - if (IsDirectory(virtualPath, Constants.SystemDirectories.MacroPartials)) + if (IsDirectory(_hostingEnvironment.MapPathContentRoot(Path.Combine(Constants.SystemDirectories.MacroPartials, virtualPath)))) { _fileService.DeletePartialViewMacroFolder(virtualPath); return Ok(); @@ -362,7 +362,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers return new UmbracoProblemResult("No Partial View Macro or folder found with the specified path", HttpStatusCode.NotFound); case Constants.Trees.Scripts: - if (IsDirectory(virtualPath, _globalSettings.UmbracoScriptsPath)) + if (IsDirectory(_hostingEnvironment.MapPathWebRoot(Path.Combine(_globalSettings.UmbracoScriptsPath, virtualPath)))) { _fileService.DeleteScriptFolder(virtualPath); return Ok(); @@ -374,7 +374,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers } return new UmbracoProblemResult("No Script or folder found with the specified path", HttpStatusCode.NotFound); case Constants.Trees.Stylesheets: - if (IsDirectory(virtualPath, _globalSettings.UmbracoCssPath)) + if (IsDirectory(_hostingEnvironment.MapPathWebRoot(Path.Combine(_globalSettings.UmbracoCssPath, virtualPath)))) { _fileService.DeleteStyleSheetFolder(virtualPath); return Ok(); @@ -665,9 +665,8 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers return value; } - private bool IsDirectory(string virtualPath, string systemDirectory) + private bool IsDirectory(string path) { - var path = _hostingEnvironment.MapPathContentRoot(systemDirectory + "/" + virtualPath); var dirInfo = new DirectoryInfo(path); return dirInfo.Attributes == FileAttributes.Directory; } From cb8fbb9c85970347667154f5f61f066d8e255f40 Mon Sep 17 00:00:00 2001 From: berg Date: Sat, 27 Feb 2021 19:35:37 +0100 Subject: [PATCH 3/3] Removed the modelsbuilder project (that is deleted) from the netcore only sln file --- src/umbraco-netcore-only.sln | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/umbraco-netcore-only.sln b/src/umbraco-netcore-only.sln index 3994d852cf..1bf32cf37b 100644 --- a/src/umbraco-netcore-only.sln +++ b/src/umbraco-netcore-only.sln @@ -124,8 +124,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IssueTemplates", "IssueTemp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Core", "Umbraco.Core\Umbraco.Core.csproj", "{29AA69D9-B597-4395-8D42-43B1263C240A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.ModelsBuilder.Embedded", "Umbraco.ModelsBuilder.Embedded\Umbraco.ModelsBuilder.Embedded.csproj", "{52AC0BA8-A60E-4E36-897B-E8B97A54ED1C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Infrastructure", "Umbraco.Infrastructure\Umbraco.Infrastructure.csproj", "{3AE7BF57-966B-45A5-910A-954D7C554441}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.PublishedCache.NuCache", "Umbraco.PublishedCache.NuCache\Umbraco.PublishedCache.NuCache.csproj", "{F6DE8DA0-07CC-4EF2-8A59-2BC81DBB3830}" @@ -158,10 +156,6 @@ Global {29AA69D9-B597-4395-8D42-43B1263C240A}.Debug|Any CPU.Build.0 = Debug|Any CPU {29AA69D9-B597-4395-8D42-43B1263C240A}.Release|Any CPU.ActiveCfg = Release|Any CPU {29AA69D9-B597-4395-8D42-43B1263C240A}.Release|Any CPU.Build.0 = Release|Any CPU - {52AC0BA8-A60E-4E36-897B-E8B97A54ED1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {52AC0BA8-A60E-4E36-897B-E8B97A54ED1C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {52AC0BA8-A60E-4E36-897B-E8B97A54ED1C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {52AC0BA8-A60E-4E36-897B-E8B97A54ED1C}.Release|Any CPU.Build.0 = Release|Any CPU {3AE7BF57-966B-45A5-910A-954D7C554441}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3AE7BF57-966B-45A5-910A-954D7C554441}.Debug|Any CPU.Build.0 = Debug|Any CPU {3AE7BF57-966B-45A5-910A-954D7C554441}.Release|Any CPU.ActiveCfg = Release|Any CPU