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-49: Enforce Windows newlines for C# files to avoid false positives with IDE0055 warning. #16

Merged
merged 11 commits into from
May 26, 2022
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
* text=auto

# Enforce Windows newlines for C# files to avoid false positives with IDE0055 warning.
# See https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/issues/106
*.cs text eol=crlf
4 changes: 3 additions & 1 deletion Lombiq.BaseTheme.Samples/Services/ResourceFilters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
namespace Lombiq.DataTables.Samples.Navigation;

// This service implements conditional configuration to direct the ResourceFilterMiddleware when and what styles need to
// be added to the resources.
// be added to the resources. The attribute indicates that the middleware should only invoke this provider if the
// current admin or site theme is the provided.
sarahelsaig marked this conversation as resolved.
Show resolved Hide resolved
[ResourceFilterThemeRequirement(FeatureIds.BaseThemeSamples)]
public class ResourceFilters : IResourceFilterProvider
{
public void AddResourceFilter(ResourceFilterBuilder builder)
Expand Down
Binary file added Lombiq.BaseTheme.Samples/wwwroot/Theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Lombiq.BaseTheme.Tests.UI/Lombiq.BaseTheme.Tests.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="2.1.1" />
<PackageReference Include="Lombiq.Tests.UI" Version="2.2.0-alpha.6" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion Lombiq.BaseTheme/Lombiq.BaseTheme.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@
<ProjectReference Include="..\..\..\Libraries\Lombiq.HelpfulLibraries\Lombiq.HelpfulLibraries\Lombiq.HelpfulLibraries.csproj" />
<ProjectReference Include="..\..\..\Modules\Lombiq.HelpfulExtensions\Lombiq.HelpfulExtensions.csproj" />
<ProjectReference Include="..\..\..\Utilities\Lombiq.Gulp.Extensions\Lombiq.Gulp.Extensions.csproj" />
<ProjectReference Include="..\..\..\Utilities\Lombiq.Npm.Targets\Lombiq.Npm.Targets.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.HelpfulLibraries" Version="4.2.0" />
<PackageReference Include="Lombiq.HelpfulLibraries" Version="4.2.1-alpha.4" />
<PackageReference Include="Lombiq.HelpfulExtensions" Version="3.2.0" />

<Content Include="Assets/Styles/**/*.*">
Expand Down
11 changes: 11 additions & 0 deletions Lombiq.BaseTheme/Services/ResourceFilters.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Lombiq.BaseTheme.Constants;
using Lombiq.HelpfulLibraries.OrchardCore.ResourceManagement;

namespace Lombiq.DataTables.Navigation;

[ResourceFilterThemeRequirement(FeatureIds.BaseTheme)]
public class ResourceFilters : IResourceFilterProvider
{
public void AddResourceFilter(ResourceFilterBuilder builder) =>
builder.Always().RegisterStylesheet(ResourceNames.Site);
}
0liver marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions Lombiq.BaseTheme/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Lombiq.BaseTheme.Migrations;
using Lombiq.BaseTheme.Services;
using Lombiq.DataTables.Navigation;
using Lombiq.HelpfulLibraries.OrchardCore.ResourceManagement;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
Expand All @@ -18,5 +20,7 @@ public override void ConfigureServices(IServiceCollection services)
services.Configure<MvcOptions>(options => options.Filters.Add(typeof(MainMenuWidgetFilter)));

services.AddScoped<IDataMigration, LayoutInjectionMigrations>();

services.AddScoped<IResourceFilterProvider, ResourceFilters>();
}
}
Binary file added Lombiq.BaseTheme/wwwroot/Theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.