-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
OSOE-91: Normalize line endings to auto across all submodules
- Loading branch information
Showing
45 changed files
with
1,533 additions
and
1,531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* -crlf | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
name: publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
call-publish-workflow: | ||
uses: Lombiq/GitHub-Actions/.github/workflows/publish.yml@dev | ||
secrets: | ||
API_KEY: ${{ secrets.DEFAULT_NUGET_PUBLISH_API_KEY }} | ||
name: publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
call-publish-workflow: | ||
uses: Lombiq/GitHub-Actions/.github/workflows/publish.yml@dev | ||
secrets: | ||
API_KEY: ${{ secrets.DEFAULT_NUGET_PUBLISH_API_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
.vs/ | ||
obj/ | ||
bin/ | ||
artifacts/ | ||
wwwroot/ | ||
node_modules/ | ||
*.user | ||
.pnpm-debug.log | ||
.vs/ | ||
.idea/ | ||
.vscode/ | ||
obj/ | ||
bin/ | ||
artifacts/ | ||
wwwroot/ | ||
node_modules/ | ||
*.user | ||
.pnpm-debug.log |
504 changes: 252 additions & 252 deletions
504
Extensions/CodeGeneration/CodeGenerationDisplayDriver.cs
Large diffs are not rendered by default.
Oops, something went wrong.
18 changes: 9 additions & 9 deletions
18
Extensions/CodeGeneration/ContentTypeMigrationsViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
using System; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.CodeGeneration; | ||
|
||
public class ContentTypeMigrationsViewModel | ||
{ | ||
internal Lazy<string> MigrationCodeLazy { get; set; } | ||
public string MigrationCode => MigrationCodeLazy.Value; | ||
} | ||
using System; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.CodeGeneration; | ||
|
||
public class ContentTypeMigrationsViewModel | ||
{ | ||
internal Lazy<string> MigrationCodeLazy { get; set; } | ||
public string MigrationCode => MigrationCodeLazy.Value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Routing; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using OrchardCore.ContentTypes.Editors; | ||
using OrchardCore.Modules; | ||
using System; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.CodeGeneration; | ||
|
||
[Feature(FeatureIds.CodeGeneration)] | ||
public class Startup : StartupBase | ||
{ | ||
public override void ConfigureServices(IServiceCollection services) => | ||
services.AddScoped<IContentTypeDefinitionDisplayDriver, CodeGenerationDisplayDriver>(); | ||
|
||
public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) | ||
{ | ||
// No need for anything here yet. | ||
} | ||
} | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Routing; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using OrchardCore.ContentTypes.Editors; | ||
using OrchardCore.Modules; | ||
using System; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.CodeGeneration; | ||
|
||
[Feature(FeatureIds.CodeGeneration)] | ||
public class Startup : StartupBase | ||
{ | ||
public override void ConfigureServices(IServiceCollection services) => | ||
services.AddScoped<IContentTypeDefinitionDisplayDriver, CodeGenerationDisplayDriver>(); | ||
|
||
public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) | ||
{ | ||
// No need for anything here yet. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace Lombiq.HelpfulExtensions.Extensions.ContentTypes; | ||
|
||
public static class ContentTypes | ||
{ | ||
public const string Page = nameof(Page); | ||
} | ||
namespace Lombiq.HelpfulExtensions.Extensions.ContentTypes; | ||
|
||
public static class ContentTypes | ||
{ | ||
public const string Page = nameof(Page); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
using OrchardCore.Autoroute.Models; | ||
using OrchardCore.ContentManagement.Metadata; | ||
using OrchardCore.ContentManagement.Metadata.Settings; | ||
using OrchardCore.Data.Migration; | ||
using static Lombiq.HelpfulExtensions.Extensions.ContentTypes.ContentTypes; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.ContentTypes; | ||
|
||
public class Migrations : DataMigration | ||
{ | ||
private readonly IContentDefinitionManager _contentDefinitionManager; | ||
|
||
public Migrations(IContentDefinitionManager contentDefinitionManager) => | ||
_contentDefinitionManager = contentDefinitionManager; | ||
|
||
public int Create() | ||
{ | ||
_contentDefinitionManager.AlterTypeDefinition(Page, builder => builder | ||
.Creatable() | ||
.Securable() | ||
.Draftable() | ||
.Listable() | ||
.Versionable() | ||
.WithPart("TitlePart", part => part.WithPosition("0")) | ||
.WithPart("AutoroutePart", part => part | ||
.WithPosition("1") | ||
.WithSettings(new AutoroutePartSettings | ||
{ | ||
ShowHomepageOption = true, | ||
AllowCustomPath = true, | ||
}) | ||
) | ||
.WithPart("FlowPart", part => part.WithPosition("2")) | ||
); | ||
|
||
return 2; | ||
} | ||
|
||
public int UpdateFrom1() | ||
{ | ||
_contentDefinitionManager.AlterTypeDefinition(Page, builder => builder | ||
.WithPart("TitlePart", part => part.WithPosition("0")) | ||
.WithPart("AutoroutePart", part => part.WithPosition("1")) | ||
.WithPart("FlowPart", part => part.WithPosition("2")) | ||
); | ||
|
||
return 2; | ||
} | ||
} | ||
using OrchardCore.Autoroute.Models; | ||
using OrchardCore.ContentManagement.Metadata; | ||
using OrchardCore.ContentManagement.Metadata.Settings; | ||
using OrchardCore.Data.Migration; | ||
using static Lombiq.HelpfulExtensions.Extensions.ContentTypes.ContentTypes; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.ContentTypes; | ||
|
||
public class Migrations : DataMigration | ||
{ | ||
private readonly IContentDefinitionManager _contentDefinitionManager; | ||
|
||
public Migrations(IContentDefinitionManager contentDefinitionManager) => | ||
_contentDefinitionManager = contentDefinitionManager; | ||
|
||
public int Create() | ||
{ | ||
_contentDefinitionManager.AlterTypeDefinition(Page, builder => builder | ||
.Creatable() | ||
.Securable() | ||
.Draftable() | ||
.Listable() | ||
.Versionable() | ||
.WithPart("TitlePart", part => part.WithPosition("0")) | ||
.WithPart("AutoroutePart", part => part | ||
.WithPosition("1") | ||
.WithSettings(new AutoroutePartSettings | ||
{ | ||
ShowHomepageOption = true, | ||
AllowCustomPath = true, | ||
}) | ||
) | ||
.WithPart("FlowPart", part => part.WithPosition("2")) | ||
); | ||
|
||
return 2; | ||
} | ||
|
||
public int UpdateFrom1() | ||
{ | ||
_contentDefinitionManager.AlterTypeDefinition(Page, builder => builder | ||
.WithPart("TitlePart", part => part.WithPosition("0")) | ||
.WithPart("AutoroutePart", part => part.WithPosition("1")) | ||
.WithPart("FlowPart", part => part.WithPosition("2")) | ||
); | ||
|
||
return 2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Routing; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using OrchardCore.Data.Migration; | ||
using OrchardCore.Modules; | ||
using System; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.ContentTypes; | ||
|
||
[Feature(FeatureIds.ContentTypes)] | ||
public class Startup : StartupBase | ||
{ | ||
public override void ConfigureServices(IServiceCollection services) => services.AddScoped<IDataMigration, Migrations>(); | ||
|
||
public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) | ||
{ | ||
// No need for anything here yet. | ||
} | ||
} | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Routing; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using OrchardCore.Data.Migration; | ||
using OrchardCore.Modules; | ||
using System; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.ContentTypes; | ||
|
||
[Feature(FeatureIds.ContentTypes)] | ||
public class Startup : StartupBase | ||
{ | ||
public override void ConfigureServices(IServiceCollection services) => services.AddScoped<IDataMigration, Migrations>(); | ||
|
||
public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) | ||
{ | ||
// No need for anything here yet. | ||
} | ||
} |
80 changes: 40 additions & 40 deletions
80
Extensions/Emails/Extensions/EmailSenderShellScopeExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
using Lombiq.HelpfulExtensions.Extensions.Emails.Models; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Logging; | ||
using OrchardCore.Email; | ||
using OrchardCore.Environment.Shell.Scope; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.Emails.Extensions; | ||
|
||
public static class EmailSenderShellScopeExtensions | ||
{ | ||
/// <summary> | ||
/// Sends an HTML email after the current shell scope has ended. If any errors occur during the process they will be | ||
/// logged. | ||
/// </summary> | ||
/// <param name="parameters">Parameters required for sending emails (e.g., recipients, subject, CC).</param> | ||
public static void SendEmailDeferred(this ShellScope shellScope, EmailParameters parameters) => | ||
shellScope.AddDeferredTask(async scope => | ||
{ | ||
var smtpService = scope.ServiceProvider.GetRequiredService<ISmtpService>(); | ||
var result = await smtpService.SendAsync(new MailMessage | ||
{ | ||
Sender = parameters.Sender, | ||
To = parameters.To?.Join(","), | ||
Cc = parameters.Cc?.Join(","), | ||
Bcc = parameters.Bcc?.Join(","), | ||
Subject = parameters.Subject, | ||
ReplyTo = parameters.ReplyTo, | ||
Body = parameters.Body, | ||
IsBodyHtml = true, | ||
}); | ||
|
||
if (!result.Succeeded) | ||
{ | ||
var logger = scope.ServiceProvider.GetRequiredService<ILogger<ShellScope>>(); | ||
logger.LogError("Email sending was unsuccessful: {Error}", result.Errors.Select(error => error.ToString()).Join()); | ||
} | ||
}); | ||
} | ||
using Lombiq.HelpfulExtensions.Extensions.Emails.Models; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Logging; | ||
using OrchardCore.Email; | ||
using OrchardCore.Environment.Shell.Scope; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.Emails.Extensions; | ||
|
||
public static class EmailSenderShellScopeExtensions | ||
{ | ||
/// <summary> | ||
/// Sends an HTML email after the current shell scope has ended. If any errors occur during the process they will be | ||
/// logged. | ||
/// </summary> | ||
/// <param name="parameters">Parameters required for sending emails (e.g., recipients, subject, CC).</param> | ||
public static void SendEmailDeferred(this ShellScope shellScope, EmailParameters parameters) => | ||
shellScope.AddDeferredTask(async scope => | ||
{ | ||
var smtpService = scope.ServiceProvider.GetRequiredService<ISmtpService>(); | ||
var result = await smtpService.SendAsync(new MailMessage | ||
{ | ||
Sender = parameters.Sender, | ||
To = parameters.To?.Join(","), | ||
Cc = parameters.Cc?.Join(","), | ||
Bcc = parameters.Bcc?.Join(","), | ||
Subject = parameters.Subject, | ||
ReplyTo = parameters.ReplyTo, | ||
Body = parameters.Body, | ||
IsBodyHtml = true, | ||
}); | ||
|
||
if (!result.Succeeded) | ||
{ | ||
var logger = scope.ServiceProvider.GetRequiredService<ILogger<ShellScope>>(); | ||
logger.LogError("Email sending was unsuccessful: {Error}", result.Errors.Select(error => error.ToString()).Join()); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.Emails.Models; | ||
|
||
public class EmailParameters | ||
{ | ||
public string Sender { get; set; } | ||
public IEnumerable<string> To { get; set; } | ||
public IEnumerable<string> Cc { get; set; } | ||
public IEnumerable<string> Bcc { get; set; } | ||
public string Subject { get; set; } | ||
public string Body { get; set; } | ||
public string ReplyTo { get; set; } | ||
} | ||
using System.Collections.Generic; | ||
|
||
namespace Lombiq.HelpfulExtensions.Extensions.Emails.Models; | ||
|
||
public class EmailParameters | ||
{ | ||
public string Sender { get; set; } | ||
public IEnumerable<string> To { get; set; } | ||
public IEnumerable<string> Cc { get; set; } | ||
public IEnumerable<string> Bcc { get; set; } | ||
public string Subject { get; set; } | ||
public string Body { get; set; } | ||
public string ReplyTo { get; set; } | ||
} |
Oops, something went wrong.