Compare commits

...
Author SHA1 Message Date
Sebastiaan Janssen e9be3dd4a5 Bump version to 8.18.0 2022-02-24 11:24:19 +01:00
Bjarke Berg 8ff1d49346 Added noop migration just to change state, so this database do not just directly to 9.3 when migrating 2022-02-17 14:09:26 +01:00
MoleandGitHub 1473e41a20 V8: Fix deleting file on external filesystem (#11998)
* Use IFileSystem to check if folder exists when deleting file

* Rename CanDeleteDirectory back to IsDirectory
2022-02-17 09:35:10 +01:00
Sebastiaan Janssen 2038898f4c Bump version to 8.18.0-rc2 2022-02-17 09:25:11 +01:00
Ronald BarendseandGitHub 40c08f81c4 Add support for readonly properties (#11730) 2022-02-16 11:42:34 +01:00
6 changed files with 39 additions and 21 deletions
+1 -1
View File
@@ -19,4 +19,4 @@ using System.Resources;
// these are FYI and changed automatically
[assembly: AssemblyFileVersion("8.18.0")]
[assembly: AssemblyInformationalVersion("8.18.0-rc")]
[assembly: AssemblyInformationalVersion("8.18.0")]
@@ -213,6 +213,7 @@ namespace Umbraco.Core.Migrations.Upgrade
//FINAL
To<AddContentVersionCleanupFeature>("{8BAF5E6C-DCB7-41AE-824F-4215AE4F1F98}");
To<NoopMigration>("{03482BB0-CF13-475C-845E-ECB8319DBE3C}");
}
}
}
@@ -182,23 +182,31 @@
}
);
$scope.propertyEditorDisabled = function (property) {
$scope.propertyEditorInherited = function (property) {
if (property.unlockInvariantValue) {
return false;
return false;
}
var contentLanguage = $scope.content.language;
var canEditCulture = !contentLanguage ||
// If the property culture equals the content culture it can be edited
property.culture === contentLanguage.culture ||
// A culture-invariant property can only be edited by the default language variant
(property.culture == null && contentLanguage.isDefault);
// If the property culture equals the content culture it can be edited
property.culture === contentLanguage.culture ||
// A culture-invariant property can only be edited by the default language variant
(property.culture == null && contentLanguage.isDefault);
var canEditSegment = property.segment === $scope.content.segment;
return !canEditCulture || !canEditSegment;
}
};
$scope.propertyEditorDisabled = function (property) {
if (property.readonly) {
return true;
}
return $scope.propertyEditorInherited(property);
};
}
var directive = {
@@ -11,7 +11,7 @@
data-element="property-{{property.alias}}"
ng-repeat="property in tab.properties track by property.alias"
property="property"
show-inherit="propertyEditorDisabled(property)"
show-inherit="propertyEditorInherited(property)"
inherits-from="defaultVariant.displayName">
<div ng-class="{'o-40 cursor-not-allowed': propertyEditorDisabled(property) }">
@@ -41,7 +41,7 @@
data-element="property-{{property.alias}}"
ng-repeat="property in group.properties track by property.alias"
property="property"
show-inherit="propertyEditorDisabled(property)"
show-inherit="propertyEditorInherited(property)"
inherits-from="defaultVariant.displayName">
<div ng-class="{'o-40 cursor-not-allowed': propertyEditorDisabled(property) }">
@@ -45,10 +45,10 @@
show-inherit="vm.model.variants.length > 1 && !property.culture && !activeVariant.language.isDefault"
inherits-from="defaultVariant.language.name">
<div ng-class="{'o-40 cursor-not-allowed': vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue}">
<div ng-class="{'o-40 cursor-not-allowed': property.readonly || (vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue)}">
<umb-property-editor
model="property"
preview="vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue">
preview="property.readonly || (vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue)">
</umb-property-editor>
</div>
+18 -9
View File
@@ -306,7 +306,7 @@ namespace Umbraco.Web.Editors
switch (type)
{
case Core.Constants.Trees.PartialViews:
if (IsDirectory(virtualPath, SystemDirectories.PartialViews))
if (IsDirectory(virtualPath, SystemDirectories.PartialViews, Current.FileSystems.PartialViewsFileSystem))
{
Services.FileService.DeletePartialViewFolder(virtualPath);
return Request.CreateResponse(HttpStatusCode.OK);
@@ -318,7 +318,7 @@ namespace Umbraco.Web.Editors
return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Partial View or folder found with the specified path");
case Core.Constants.Trees.PartialViewMacros:
if (IsDirectory(virtualPath, SystemDirectories.MacroPartials))
if (IsDirectory(virtualPath, SystemDirectories.MacroPartials, Current.FileSystems.MacroPartialsFileSystem))
{
Services.FileService.DeletePartialViewMacroFolder(virtualPath);
return Request.CreateResponse(HttpStatusCode.OK);
@@ -330,7 +330,7 @@ namespace Umbraco.Web.Editors
return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Partial View Macro or folder found with the specified path");
case Core.Constants.Trees.Scripts:
if (IsDirectory(virtualPath, SystemDirectories.Scripts))
if (IsDirectory(virtualPath, SystemDirectories.Scripts, Current.FileSystems.ScriptsFileSystem))
{
Services.FileService.DeleteScriptFolder(virtualPath);
return Request.CreateResponse(HttpStatusCode.OK);
@@ -343,7 +343,7 @@ namespace Umbraco.Web.Editors
return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Script or folder found with the specified path");
case Core.Constants.Trees.Stylesheets:
if (IsDirectory(virtualPath, SystemDirectories.Css))
if (IsDirectory(virtualPath, SystemDirectories.Css, Current.FileSystems.StylesheetsFileSystem))
{
Services.FileService.DeleteStyleSheetFolder(virtualPath);
return Request.CreateResponse(HttpStatusCode.OK);
@@ -634,14 +634,23 @@ namespace Umbraco.Web.Editors
return value;
}
private bool IsDirectory(string virtualPath, string systemDirectory)
private bool IsDirectory(string virtualPath, string systemDirectory, IFileSystem fileSystem)
{
var path = IOHelper.MapPath(systemDirectory + "/" + virtualPath);
var dirInfo = new DirectoryInfo(path);
// If you turn off indexing in Windows this will have the attribute:
// `FileAttributes.Directory | FileAttributes.NotContentIndexed`
return (dirInfo.Attributes & FileAttributes.Directory) != 0;
// If it's a physical filesystem check with directory info
if (fileSystem.CanAddPhysical)
{
var dirInfo = new DirectoryInfo(path);
// If you turn off indexing in Windows this will have the attribute:
// `FileAttributes.Directory | FileAttributes.NotContentIndexed`
return (dirInfo.Attributes & FileAttributes.Directory) != 0;
}
// Otherwise check the filesystem abstraction to see if the folder exists
// Since this is used for delete, it presumably exists if we're trying to delete it
return fileSystem.DirectoryExists(path);
}
// this is an internal class for passing stylesheet data from the client to the controller while editing