Show disable action for deprecated features even if they are categorized as "Core" (#8468)

This commit is contained in:
Hermes Sbicego 2021-04-22 19:03:46 +02:00 committed by GitHub
parent f407af594f
commit 1d8c589055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,7 +91,8 @@
select (from f in Model.Features where f.Descriptor.Id.Equals(d, StringComparison.OrdinalIgnoreCase) select f).SingleOrDefault()).Where(f => f != null).OrderBy(f => f.Descriptor.Name); select (from f in Model.Features where f.Descriptor.Id.Equals(d, StringComparison.OrdinalIgnoreCase) select f).SingleOrDefault()).Where(f => f != null).OrderBy(f => f.Descriptor.Name);
var missingDependencies = feature.Descriptor.Dependencies var missingDependencies = feature.Descriptor.Dependencies
.Where(d => !Model.Features.Any(f => f.Descriptor.Id.Equals(d, StringComparison.OrdinalIgnoreCase))); .Where(d => !Model.Features.Any(f => f.Descriptor.Id.Equals(d, StringComparison.OrdinalIgnoreCase)));
var showDisable = categoryName.ToString() != "Core"; var showDisable = categoryName.ToString() != "Core"
|| lifecycleStatus == LifecycleStatus.Deprecated; // we should always be able to disable deprecated features even if they are categorized as "Core"
var showEnable = Model.IsAllowed(feature.Descriptor.Extension) && !missingDependencies.Any() && feature.Descriptor.Id != "Orchard.Setup"; var showEnable = Model.IsAllowed(feature.Descriptor.Extension) && !missingDependencies.Any() && feature.Descriptor.Id != "Orchard.Setup";
if (missingDependencies.Any()) { if (missingDependencies.Any()) {