Merge branch 'netcore/dev' into netcore/members-passwordchange-temp

This commit is contained in:
emmagarland
2021-02-28 17:05:59 +00:00
3 changed files with 10 additions and 22 deletions

View File

@@ -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<ContentModels.ContentPickerDocType>
@using ContentModels = Umbraco.Web.PublishedModels;
cy.editTemplate(pickerDocTypeName, `@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentPickerDocType>
@{
Layout = null;
var pickedItem = Model.Picker as PickedContentDocumentType;
}
@{
IPublishedContent typedContentPicker = Model.Value<IPublishedContent>("picker");
if (typedContentPicker != null)
{
<p>@typedContentPicker.Value("text")</p>
}
}`);
<p>@pickedItem.Text</p>`);
// Create content with content picker
cy.get('.umb-tree-root-link').rightclick();

View File

@@ -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;
}

View File

@@ -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