Skip to content

Commit

Permalink
feat: move to Sitko.Core 9
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicGD committed Jan 14, 2022
1 parent 903ec94 commit 531806d
Show file tree
Hide file tree
Showing 25 changed files with 51 additions and 56 deletions.
2 changes: 1 addition & 1 deletion apps/Sitko.Blockly.Demo/BlocklyApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Sitko.Blockly.AntDesignComponents;
using Sitko.Blockly.Demo.Data;
using Sitko.Core.App.Localization;
using Sitko.Core.Blazor.AntDesignComponents;
using Sitko.Core.Blazor.AntDesign.Server;
using Sitko.Core.Db.Postgres;
using Sitko.Core.Repository.EntityFrameworkCore;
using Sitko.Core.Storage;
Expand Down
2 changes: 1 addition & 1 deletion apps/Sitko.Blockly.Demo/Pages/PostForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using FluentValidation;
using Sitko.Blockly.Demo.Data.Entities;
using Sitko.Blockly.Validation;
using Sitko.Core.App.Blazor.Forms;
using Sitko.Core.Blazor.Forms;

namespace Sitko.Blockly.Demo.Pages;

Expand Down
9 changes: 5 additions & 4 deletions apps/Sitko.Blockly.Demo/Sitko.Blockly.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

<ItemGroup>
<PackageReference Include="AntDesign.ProLayout" Version="0.1.10" />
<PackageReference Include="Sitko.Core.Repository.EntityFrameworkCore" Version="8.36.1" />
<PackageReference Include="Sitko.Core.Repository.EntityFrameworkCore" Version="9.0.0-beta.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Sitko.Core.Storage.Metadata.Postgres" Version="8.36.1" />
<PackageReference Include="Sitko.Core.Configuration.Vault" Version="8.36.1" />
<PackageReference Include="Sitko.Core.Storage.FileSystem" Version="8.36.1" />
<PackageReference Include="Sitko.Core.Storage.Metadata.Postgres" Version="9.0.0-beta.1" />
<PackageReference Include="Sitko.Core.Configuration.Vault" Version="9.0.0-beta.1" />
<PackageReference Include="Sitko.Core.Storage.FileSystem" Version="9.0.0-beta.1" />
<PackageReference Include="Sitko.Core.Blazor.AntDesign.Server" Version="9.0.0-beta.1" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion apps/Sitko.Blockly.Demo/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Sitko.Core.Blazor.AntDesignComponents;
using Sitko.Core.Blazor.AntDesign.Server;

namespace Sitko.Blockly.Demo;

Expand Down
2 changes: 1 addition & 1 deletion apps/Sitko.Blockly.Demo/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@using Sitko.Blockly.Demo
@using Sitko.Blockly.AntDesignComponents.Forms
@using Sitko.Blockly.AntDesignComponents.Display
@using Sitko.Core.App.Blazor.Components
@using Sitko.Core.Blazor.Components
@using Sitko.Core.Blazor.AntDesignComponents.Components
@using AntDesign
@using AntDesign.ProLayout
4 changes: 2 additions & 2 deletions src/Sitko.Blockly.AntDesign/AntDesignBlocklyModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class AntDesignBlocklyModule : BlazorBlocklyModule<IBlazorBlockDescriptor

public override string OptionsKey => "Blockly:AntDesign";

public override void ConfigureServices(ApplicationContext context, IServiceCollection services,
public override void ConfigureServices(IApplicationContext context, IServiceCollection services,
AntDesignBlocklyModuleOptions startupOptions)
{
base.ConfigureServices(context, services, startupOptions);
Expand All @@ -27,7 +27,7 @@ public override void ConfigureServices(ApplicationContext context, IServiceColle
});
}

public override async Task InitAsync(ApplicationContext context, IServiceProvider serviceProvider)
public override async Task InitAsync(IApplicationContext context, IServiceProvider serviceProvider)
{
await base.InitAsync(context, serviceProvider);
await CustomIconsProvider.InitAsync();
Expand Down
4 changes: 1 addition & 3 deletions src/Sitko.Blockly.AntDesign/ApplicationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using JetBrains.Annotations;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Sitko.Core.App;

namespace Sitko.Blockly.AntDesignComponents;
Expand All @@ -9,7 +7,7 @@ namespace Sitko.Blockly.AntDesignComponents;
public static class ApplicationExtensions
{
public static Application AddAntDesignBlockly(this Application application,
Action<IConfiguration, IHostEnvironment, AntDesignBlocklyModuleOptions> configure,
Action<IApplicationContext, AntDesignBlocklyModuleOptions> configure,
string? configKey = null) =>
application.AddModule<AntDesignBlocklyModule, AntDesignBlocklyModuleOptions>(configure, configKey);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@foreach (var message in CurrentEditContext.GetValidationMessages(BlockForm.FieldIdentifier).Distinct().ToArray())
@using Microsoft.AspNetCore.Components.Forms
@foreach (var message in CurrentEditContext.GetValidationMessages(BlockForm.FieldIdentifier).Distinct().ToArray())
{
<FormValidationMessageItem Message="@message" @key="message"></FormValidationMessageItem>
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sitko.Blockly.AntDesign/Sitko.Blockly.AntDesign.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Sitko.Blazor.CKEditor.Bundle" Version="3.0.3"/>
<PackageReference Include="Sitko.Core.Blazor.AntDesign" Version="8.36.1"/>
<PackageReference Include="Sitko.Core.Blazor.AntDesign" Version="9.0.0-beta.1"/>
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 1 addition & 3 deletions src/Sitko.Blockly.AntDesign/_Imports.razor
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.JSInterop
@using System
@using AntDesign
@using Sitko.Core.App.Blazor.Components
@using Sitko.Core.Blazor.Components
@using Sitko.Core.Blazor.AntDesignComponents.Components
@using Sitko.Blockly.Blazor.Forms
@using Sitko.Blockly.Blazor.Forms.Blocks
Expand Down
2 changes: 1 addition & 1 deletion src/Sitko.Blockly.Blazor/BlazorBlocklyModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public abstract class BlazorBlocklyModule<TDescriptor, TConfig> : BlocklyModule<
where TDescriptor : IBlazorBlockDescriptor
where TConfig : BlazorBlocklyModuleOptions<TDescriptor>, new()
{
public override void ConfigureServices(ApplicationContext context, IServiceCollection services,
public override void ConfigureServices(IApplicationContext context, IServiceCollection services,
TConfig startupOptions)
{
base.ConfigureServices(context, services, startupOptions);
Expand Down
2 changes: 1 addition & 1 deletion src/Sitko.Blockly.Blazor/Display/BlockComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Microsoft.AspNetCore.Components;
using Sitko.Core.App.Blazor.Components;
using Sitko.Core.Blazor.Components;

namespace Sitko.Blockly.Blazor.Display;

Expand Down
2 changes: 1 addition & 1 deletion src/Sitko.Blockly.Blazor/Display/BlocksList.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using JetBrains.Annotations;
using Microsoft.AspNetCore.Components;
using Sitko.Core.App.Blazor.Components;
using Sitko.Core.Blazor.Components;

namespace Sitko.Blockly.Blazor.Display;

Expand Down
2 changes: 1 addition & 1 deletion src/Sitko.Blockly.Blazor/Forms/BlockForm.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
using Sitko.Core.App.Blazor.Components;
using Sitko.Core.Blazor.Components;

namespace Sitko.Blockly.Blazor.Forms;

Expand Down
4 changes: 2 additions & 2 deletions src/Sitko.Blockly.Blazor/Sitko.Blockly.Blazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Sitko.Core.App.Blazor" Version="8.36.1"/>
<PackageReference Include="Sitko.Core.Blazor.FileUpload" Version="8.36.1"/>
<PackageReference Include="Sitko.Core.Blazor" Version="9.0.0-beta.1"/>
<PackageReference Include="Sitko.Core.Blazor.FileUpload" Version="9.0.0-beta.1"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Sitko.Core.Db.Postgres" Version="8.36.1"/>
<PackageReference Include="Sitko.Core.Db.Postgres" Version="9.0.0-beta.1"/>
</ItemGroup>

</Project>
4 changes: 1 addition & 3 deletions src/Sitko.Blockly/ApplicationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using JetBrains.Annotations;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Sitko.Core.App;

namespace Sitko.Blockly;
Expand All @@ -9,7 +7,7 @@ namespace Sitko.Blockly;
public static class ApplicationExtensions
{
public static Application AddBlockly(this Application application,
Action<IConfiguration, IHostEnvironment, BlocklyModuleOptions> configure, string? configKey = null) =>
Action<IApplicationContext, BlocklyModuleOptions> configure, string? configKey = null) =>
application.AddModule<BlocklyModule, BlocklyModuleOptions>(configure, configKey);

public static Application AddBlockly(this Application application,
Expand Down
4 changes: 2 additions & 2 deletions src/Sitko.Blockly/BlocklyModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class BlocklyModule<TBlockDescriptor, TConfig> : BaseApplicationModule<TC
{
public override string OptionsKey => "Blockly";

public override void ConfigureServices(ApplicationContext context, IServiceCollection services,
public override void ConfigureServices(IApplicationContext context, IServiceCollection services,
TConfig startupOptions)
{
base.ConfigureServices(context, services, startupOptions);
Expand All @@ -27,7 +27,7 @@ public override void ConfigureServices(ApplicationContext context, IServiceColle
});
}

public override async Task InitAsync(ApplicationContext context, IServiceProvider serviceProvider)
public override async Task InitAsync(IApplicationContext context, IServiceProvider serviceProvider)
{
await base.InitAsync(context, serviceProvider);
var blockly = serviceProvider.GetRequiredService<IBlockly<TBlockDescriptor>>();
Expand Down
20 changes: 10 additions & 10 deletions src/Sitko.Blockly/Blocks/TwitchBlock.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.WebUtilities;
using System.Web;
using Sitko.Core.App.Localization;

namespace Sitko.Blockly.Blocks;
Expand Down Expand Up @@ -52,27 +52,27 @@ protected override void ParseUrl(string? url)
{
if (uri.Host == "player.twitch.tv")
{
var queryParams = QueryHelpers.ParseQuery(uri.Query);
if (queryParams.ContainsKey("collection"))
var queryParams = HttpUtility.ParseQueryString(uri.Query);
if (queryParams.AllKeys.Contains("collection"))
{
CollectionId = queryParams["collection"][0];
CollectionId = queryParams["collection"];
ChannelId = null;
if (queryParams.ContainsKey("video"))
if (queryParams.AllKeys.Contains("video"))
{
VideoId = queryParams["video"][0];
VideoId = queryParams["video"];
}
}
else if (queryParams.ContainsKey("video"))
else if (queryParams.AllKeys.Contains("video"))
{
VideoId = queryParams["video"][0];
VideoId = queryParams["video"];
CollectionId = null;
ChannelId = null;
}
else if (queryParams.ContainsKey("channel"))
else if (queryParams.AllKeys.Contains("channel"))
{
VideoId = null;
CollectionId = null;
ChannelId = queryParams["channel"][0];
ChannelId = queryParams["channel"];
}

else
Expand Down
6 changes: 3 additions & 3 deletions src/Sitko.Blockly/Blocks/YoutubeBlock.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.WebUtilities;
using System.Web;
using Sitko.Core.App.Localization;

namespace Sitko.Blockly.Blocks;
Expand All @@ -17,9 +17,9 @@ protected override void ParseUrl(string? url)
{
var uri = new Uri(url);

var queryParams = QueryHelpers.ParseQuery(uri.Query);
var queryParams = HttpUtility.ParseQueryString(uri.Query);

YoutubeId = queryParams.ContainsKey("v") ? queryParams["v"][0] : uri.Segments.Last();
YoutubeId = queryParams["v"] ?? uri.Segments.Last();
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/Sitko.Blockly/Sitko.Blockly.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Sitko.Core.App.Web" Version="8.36.1"/>
<PackageReference Include="Sitko.Core.Storage" Version="8.36.1"/>
<PackageReference Include="Sitko.Core.App" Version="9.0.0-beta.1"/>
<PackageReference Include="Sitko.Core.Storage" Version="9.0.0-beta.1"/>
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 3 additions & 5 deletions tests/Sitko.Blockly.HtmlParser.Tests/HtmlParserTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using HtmlAgilityPack;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Sitko.Blockly.Blocks;
using Sitko.Blockly.Tests;
using Sitko.Core.App;
using Sitko.Core.Storage;
using Sitko.Core.Storage.FileSystem;
using Sitko.Core.Xunit;
Expand Down Expand Up @@ -119,12 +118,11 @@ protected override TestApplication ConfigureApplication(TestApplication applicat
return application;
}

protected override IServiceCollection ConfigureServices(IConfiguration configuration,
IHostEnvironment environment,
protected override IServiceCollection ConfigureServices(IApplicationContext applicationContext,
IServiceCollection services, string name)
{
services.AddHttpClient();
return base.ConfigureServices(configuration, environment, services, name);
return base.ConfigureServices(applicationContext, services, name);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Sitko.Core.Repository.EntityFrameworkCore" Version="8.36.1"/>
<PackageReference Include="Sitko.Core.Xunit" Version="8.36.1"/>
<PackageReference Include="Sitko.Core.Storage.FileSystem" Version="8.36.1"/>
<PackageReference Include="Sitko.Core.Repository.EntityFrameworkCore" Version="9.0.0-beta.1"/>
<PackageReference Include="Sitko.Core.Xunit" Version="9.0.0-beta.1"/>
<PackageReference Include="Sitko.Core.Storage.FileSystem" Version="9.0.0-beta.1"/>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/Sitko.Blockly.Tests/ChangesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Sitko.Blockly.Blocks;
using Sitko.Blockly.EntityFrameworkCore;
using Sitko.Core.App.Collections;
using Sitko.Core.Blazor.AntDesignComponents;
using Sitko.Core.Blazor.AntDesign.Server;
using Sitko.Core.Repository;
using Sitko.Core.Repository.EntityFrameworkCore;
using Sitko.Core.Xunit;
Expand Down
5 changes: 3 additions & 2 deletions tests/Sitko.Blockly.Tests/Sitko.Blockly.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Sitko.Core.Repository.EntityFrameworkCore" Version="8.36.1"/>
<PackageReference Include="Sitko.Core.Xunit" Version="8.36.1"/>
<PackageReference Include="Sitko.Core.Repository.EntityFrameworkCore" Version="9.0.0-beta.1"/>
<PackageReference Include="Sitko.Core.Xunit" Version="9.0.0-beta.1"/>
<PackageReference Include="Sitko.Core.Blazor.AntDesign.Server" Version="9.0.0-beta.1"/>
</ItemGroup>
</Project>

0 comments on commit 531806d

Please sign in to comment.