Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-548: Upgrade to Orchard Core 1.6 in Hosting-Tenants #55

Merged
merged 51 commits into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8bc572b
Upgrading to OC 1.6.
Psichorex Apr 25, 2023
a8eb49c
Giving workaround for Orchard related problem.
Psichorex Apr 28, 2023
902ae2f
Optimizing foreach loop.
Psichorex May 2, 2023
abfa52d
Using deferredTask to prevent recursive runs.
Psichorex May 11, 2023
51edc12
Adjusting handler to handle every possible case.
Psichorex May 15, 2023
a976c9d
Encapsulating whole method in a defferredTask.
Psichorex May 17, 2023
428c37e
DRYing the handler.
Psichorex May 17, 2023
73f0cb4
Optimizing handler.
Psichorex May 17, 2023
47e98e5
Removing empty line.
Psichorex May 17, 2023
5a6e309
Merge remote-tracking branch 'origin/dev' into issue/OSOE-548
Psichorex May 17, 2023
c482b98
Updating packages.
Psichorex May 17, 2023
96a3b30
Adding comments and structuring.
Psichorex May 17, 2023
4b959bd
Adding comment to DisableConditionallyEnabledFeaturesAsync.
Psichorex May 17, 2023
0a88d60
Generalized remark
Piedone May 17, 2023
d9a519d
Optimizing handler and refactoring.
Psichorex May 18, 2023
3ad6851
Merge branch 'issue/OSOE-548' of https://github.com/Lombiq/Hosting-Te…
Psichorex May 18, 2023
ba11aa8
Adding period.
Psichorex May 18, 2023
d3a2051
Adding parameter name.
Psichorex May 18, 2023
97f31af
Adding service to Deferred Task.
Psichorex May 18, 2023
ac98adc
Adding checks and Exceptions.
Psichorex May 18, 2023
cb7a796
Merge remote-tracking branch 'origin/dev' into issue/OSOE-548
Psichorex May 18, 2023
9b7a9bd
Code styling
Piedone May 18, 2023
6dc78ee
Conventional method name
Piedone May 18, 2023
5dfef24
Punctuation
Piedone May 18, 2023
e577208
Fixing variable usage.
Psichorex May 19, 2023
4624660
Consolidating HL.Common package.
Psichorex May 20, 2023
ddf1f4e
Upgrading Lombiq.ChartJs.Tests.UI package.
Psichorex May 20, 2023
4d48731
Updating to latest Lombiq alpha releases.
Psichorex May 22, 2023
6edeb65
Removing mistakenly included "v" from versions.
Psichorex May 22, 2023
8947a01
Updating to latest Lombiq.Tests.UI alpha release.
Psichorex May 22, 2023
691d54d
Removing interface name from method declarations.
Psichorex May 22, 2023
a0fa3e7
Merge branch 'dev' into issue/OSOE-548
Psichorex May 24, 2023
4084db8
Upgrading packages in Lombiq.Hosting.Tenants.EnvironmentRobots.
Psichorex May 24, 2023
153dc18
Merge remote-tracking branch 'origin/dev' into issue/OSOE-548
Psichorex May 24, 2023
ae8c2e4
Merge remote-tracking branch 'origin/dev' into issue/OSOE-548
Psichorex May 29, 2023
db022b6
Merge remote-tracking branch 'origin/dev' into issue/OSOE-548
Psichorex Jun 6, 2023
61e337d
Upgrading Lombiq.HelpfulLibraries.* package reference version
dministro Jun 9, 2023
7cd9f86
Merge branch 'dev' of https://github.com/Lombiq/Hosting-Tenants into …
dministro Jun 10, 2023
01fffcc
Merge branch 'issue/OSOE-548' of https://github.com/Lombiq/Hosting-Te…
dministro Jun 10, 2023
e59ee8d
Fixing analyzer violation
dministro Jun 10, 2023
8523609
Merge pull request #70 from Lombiq/issue/OSOE-641
Piedone Jun 10, 2023
7727f2d
Fixing local boolean to prevent multiple runs.
Psichorex Jun 11, 2023
14e36aa
Moving bool value changed out of deferredTask.
Psichorex Jun 12, 2023
070548d
Renaming variable
Piedone Jun 12, 2023
1f23c93
Merge remote-tracking branch 'origin/dev' into issue/OSOE-548
Piedone Jun 14, 2023
581877d
Updating Lombiq.HelpfulLibraries NuGet reference to latest alpha
Piedone Jun 16, 2023
92d37e5
Merge remote-tracking branch 'origin/dev' into issue/OSOE-548
sarahelsaig Jun 16, 2023
a68fd1a
Merge remote-tracking branch 'origin/dev' into issue/OSOE-548
Piedone Jun 18, 2023
f6f5550
Updating newly added OC packages to 1.6
Piedone Jun 18, 2023
b50508c
Updating Lombiq NuGet references
Piedone Jun 18, 2023
c605bc8
Updating Lombiq NuGet references to release versions
Piedone Jun 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static async Task SetUpNewTenantAndGoToFeaturesListAsync(UITestContext c

const string tenantName = "TestTenant";

await context.CreateAndSwitchToTenantManuallyAsync(tenantName, "tt1", string.Empty, "features guard");
await context.CreateAndSwitchToTenantManuallyAsync(tenantName, "tt1", string.Empty, "Features Guard");

await context.GoToSetupPageAndSetupOrchardCoreAsync(
new OrchardCoreSetupParameters(context)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using Lombiq.Hosting.Tenants.FeaturesGuard.Models;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;
using OrchardCore.Environment.Extensions.Features;
using OrchardCore.Environment.Shell;
using OrchardCore.Environment.Shell.Descriptor;
using OrchardCore.Environment.Shell.Descriptor.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand All @@ -19,11 +16,12 @@ public sealed class FeaturesEventHandler : IFeatureEventHandler
private readonly ShellSettings _shellSettings;
private readonly IShellDescriptorManager _shellDescriptorManager;

private readonly List<IFeatureInfo> _previouslyAddedFeatures = new();

public FeaturesEventHandler(
IShellFeaturesManager shellFeaturesManager,
IOptions<ConditionallyEnabledFeaturesOptions> conditionallyEnabledFeaturesOptions,
ShellSettings shellSettings,
IConfiguration configuration,
IShellDescriptorManager shellDescriptorManager)
{
_shellFeaturesManager = shellFeaturesManager;
Expand Down Expand Up @@ -90,9 +88,20 @@ public async Task EnableConditionallyEnabledFeaturesAsync(IFeatureInfo featureIn
// If Shell Descriptor's Features already contains a feature that is found in conditionalFeatures, remove it
// from the list. Handle multiple conditional features as well.
var featuresToEnable = allFeatures.Where(feature =>
conditionalFeatureIds.Contains(feature.Id) && !shellDescriptor.Features.Contains(new ShellFeature(feature.Id)));
conditionalFeatureIds.Contains(feature.Id) &&
!shellDescriptor.Features.Any(shellFeature => conditionalFeatureIds.Contains(shellFeature.Id)));

foreach (var feature in featuresToEnable)
{
if (_previouslyAddedFeatures.Contains(feature))
{
return;
}
Piedone marked this conversation as resolved.
Show resolved Hide resolved

_previouslyAddedFeatures.Add(feature);
}

await _shellFeaturesManager.EnableFeaturesAsync(featuresToEnable, force: true);
await _shellFeaturesManager.EnableFeaturesAsync(_previouslyAddedFeatures, force: true);
}

/// <summary>
Expand Down