Skip to content

Commit

Permalink
Add site settings deployment for Content Audit Trail Settings and Goo…
Browse files Browse the repository at this point in the history
…gle features (Lombiq Technologies: OCORE-63) (#10088)
  • Loading branch information
Piedone authored Aug 12, 2021
1 parent ef1aad9 commit ec53af7
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 176 deletions.
9 changes: 5 additions & 4 deletions src/OrchardCore.Modules/OrchardCore.Contents/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Fluid;
using Fluid.Values;
Expand All @@ -18,6 +16,7 @@
using OrchardCore.ContentManagement.Metadata.Models;
using OrchardCore.ContentManagement.Routing;
using OrchardCore.Contents.AdminNodes;
using OrchardCore.Contents.AuditTrail.Settings;
using OrchardCore.Contents.Controllers;
using OrchardCore.Contents.Deployment;
using OrchardCore.Contents.Drivers;
Expand All @@ -42,9 +41,7 @@
using OrchardCore.DisplayManagement.Liquid;
using OrchardCore.DisplayManagement.Liquid.Tags;
using OrchardCore.DisplayManagement.Views;
using OrchardCore.Entities;
using OrchardCore.Feeds;
using YesSql.Filters.Query;
using OrchardCore.Indexing;
using OrchardCore.Liquid;
using OrchardCore.Lists.Settings;
Expand All @@ -53,10 +50,12 @@
using OrchardCore.Navigation;
using OrchardCore.Recipes;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings.Deployment;
using OrchardCore.Sitemaps.Builders;
using OrchardCore.Sitemaps.Handlers;
using OrchardCore.Sitemaps.Models;
using OrchardCore.Sitemaps.Services;
using YesSql.Filters.Query;

namespace OrchardCore.Contents
{
Expand Down Expand Up @@ -327,6 +326,8 @@ public override void ConfigureServices(IServiceCollection services)
services.AddTransient<IDeploymentSource, ContentDeploymentSource>();
services.AddSingleton<IDeploymentStepFactory>(new DeploymentStepFactory<ContentDeploymentStep>());
services.AddScoped<IDisplayDriver<DeploymentStep>, ContentDeploymentStepDriver>();

services.AddSiteSettingsPropertyDeploymentStep<ContentAuditTrailSettings, DeploymentStartup>(S => S["Content Audit Trail settings"], S => S["Exports the content audit trail settings."]);
}
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

51 changes: 28 additions & 23 deletions src/OrchardCore.Modules/OrchardCore.Google/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,25 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using OrchardCore.Deployment;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.Google.Analytics;
using OrchardCore.Google.Analytics.Deployment;
using OrchardCore.Google.Analytics.Drivers;
using OrchardCore.Google.Analytics.Recipes;
using OrchardCore.Google.Analytics.Services;
using OrchardCore.Google.TagManager;
using OrchardCore.Google.TagManager.Drivers;
using OrchardCore.Google.TagManager.Services;
using OrchardCore.Google.Analytics.Settings;
using OrchardCore.Google.Authentication.Configuration;
using OrchardCore.Google.Authentication.Drivers;
using OrchardCore.Google.Authentication.Recipes;
using OrchardCore.Google.Authentication.Services;
using OrchardCore.Google.Authentication.Settings;
using OrchardCore.Google.TagManager;
using OrchardCore.Google.TagManager.Drivers;
using OrchardCore.Google.TagManager.Services;
using OrchardCore.Google.TagManager.Settings;
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Recipes;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;
using OrchardCore.Settings.Deployment;
using OrchardCore.Google.TagManager.Settings;

namespace OrchardCore.Google
{
Expand All @@ -35,7 +31,6 @@ public class GoogleAuthenticationStartup : StartupBase
public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IPermissionProvider, Permissions.GoogleAuthentication>();
services.AddRecipeExecutionStep<GoogleAuthenticationSettingsStep>();
services.AddSingleton<GoogleAuthenticationService, GoogleAuthenticationService>();
services.AddScoped<IDisplayDriver<ISite>, GoogleAuthenticationSettingsDisplayDriver>();
services.AddScoped<INavigationProvider, GoogleAuthenticationAdminMenu>();
Expand All @@ -58,7 +53,6 @@ public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IPermissionProvider, Permissions.GoogleAnalytics>();
services.AddSingleton<IGoogleAnalyticsService, GoogleAnalyticsService>();
services.AddRecipeExecutionStep<GoogleAnalyticsSettingsStep>();

services.AddScoped<IDisplayDriver<ISite>, GoogleAnalyticsSettingsDisplayDriver>();
services.AddScoped<INavigationProvider, GoogleAnalyticsAdminMenu>();
Expand Down Expand Up @@ -86,22 +80,33 @@ public override void ConfigureServices(IServiceCollection services)
}
}

[Feature(GoogleConstants.Features.GoogleAuthentication)]
[RequireFeatures("OrchardCore.Deployment")]
public class DeploymentStartup : StartupBase
public class GoogleAuthenticationDeploymentStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IDisplayDriver<DeploymentStep>, GoogleAnalyticsDeploymentStepDriver>();
services.AddTransient<IDeploymentSource, GoogleAnalyticsDeploymentSource>();
services.AddSingleton<IDeploymentStepFactory, DeploymentStepFactory<GoogleAnalyticsDeploymentStep>>();
services.AddSiteSettingsPropertyDeploymentStep<GoogleAuthenticationSettings, GoogleAuthenticationDeploymentStartup>(S => S["Google Authentication Settings"], S => S["Exports the Google Authentication settings."]);
}
}

services.AddTransient<IDeploymentSource, SiteSettingsPropertyDeploymentSource<GoogleTagManagerSettings>>();
services.AddScoped<IDisplayDriver<DeploymentStep>>(sp =>
{
var S = sp.GetService<IStringLocalizer<DeploymentStartup>>();
return new SiteSettingsPropertyDeploymentStepDriver<GoogleTagManagerSettings>(S["Google Tag Manager Settings"], S["Exports the Google Tag Manager settings."]);
});
services.AddSingleton<IDeploymentStepFactory>(new SiteSettingsPropertyDeploymentStepFactory<GoogleTagManagerSettings>());
[Feature(GoogleConstants.Features.GoogleAnalytics)]
[RequireFeatures("OrchardCore.Deployment")]
public class GoogleAnalyticsDeploymentStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddSiteSettingsPropertyDeploymentStep<GoogleAnalyticsSettings, GoogleAnalyticsDeploymentStartup>(S => S["Google Analytics Settings"], S => S["Exports the Google Analytics settings."]);
}
}

[Feature(GoogleConstants.Features.GoogleTagManager)]
[RequireFeatures("OrchardCore.Deployment")]
public class GoogleTagManagerDeploymentStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddSiteSettingsPropertyDeploymentStep<GoogleTagManagerSettings, GoogleTagManagerDeploymentStartup>(S => S["Google Tag Manager Settings"], S => S["Exports the Google Tag Manager settings."]);
}
}
}

0 comments on commit ec53af7

Please sign in to comment.