Skip to content

Commit

Permalink
Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Atulin committed Aug 11, 2023
1 parent 295f578 commit 025cf00
Show file tree
Hide file tree
Showing 17 changed files with 18,084 additions and 18,099 deletions.
6 changes: 4 additions & 2 deletions Ogma3/Areas/Admin/Pages/ContentBlock.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@
}
else
{
var handler = Model.Item.Blocked ? "Unblock" : "Block";

<h3>
<span class="text-faded">@(Model.Item?.Type):</span> @Model.Item.Title
<span class="text-faded">@(Model.Item.Type):</span> @Model.Item.Title
</h3>
if (Model.Item.Subtitle is not null)
{
<h4>@Model.Item.Subtitle</h4>
}

<form method="POST" class="auto" asp-page-handler="@(Model.Item.Blocked ? "Unblock" : "Block")">
<form method="POST" class="auto" asp-page-handler="@handler">
@if (TempData["error"] is not null)
{
<div class="validation-summary-errors">@TempData["error"]</div>
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Areas/Identity/Pages/Account/Register.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public async Task<IActionResult> OnPostAsync(string? returnUrl = null)
}

// Generate Gravatar
var avatar = new Url(_config.AvatarServiceUrl).AppendPathSegment($"{Input.Name}.png").ToString();
var avatar = new Url(_config.AvatarServiceUrl).AppendPathSegment($"{Input.Name}.png").ToString()!;
// var avatar = Gravatar.Generate(Input.Email, new Gravatar.Options
// {
// Default = new Url(_config.AvatarServiceUrl).AppendPathSegment($"{Input.Name}.png").ToString(),
Expand Down
58 changes: 29 additions & 29 deletions Ogma3/Ogma3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,55 +24,55 @@
<ItemGroup>
<PackageReference Include="AspNetCore.RouteAnalyzer" Version="0.5.3" />
<PackageReference Include="Atulin.MarkdigExtensions" Version="1.0.1" />
<PackageReference Include="AutoMapper" Version="12.0.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
<PackageReference Include="AutoMapper" Version="12.0.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="B2Net" Version="0.7.5" />
<PackageReference Include="Extensions.Hosting.AsyncInitialization" Version="1.0.0" />
<PackageReference Include="Extensions.Hosting.AsyncInitialization" Version="2.0.0" />
<PackageReference Include="FlexLabs.EntityFrameworkCore.Upsert" Version="7.0.0" />
<PackageReference Include="FluentValidation" Version="11.4.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="11.2.2" />
<PackageReference Include="FluentValidation" Version="11.7.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageReference Include="HaemmerElectronics.SeppPenner.Serilog.Sinks.Telegram" Version="1.0.16" />
<PackageReference Include="Hashids.net" Version="1.6.1" />
<PackageReference Include="Hashids.net" Version="1.7.0" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Markdig" Version="0.30.4" />
<PackageReference Include="Markdig" Version="0.32.0" />
<PackageReference Include="MediatR.Extensions.FluentValidation.AspNetCore" Version="4.0.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4-beta1.22464.1">
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.10" />
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.1">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.10">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.1">
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.1" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
<PackageReference Include="MiniProfiler.EntityFrameworkCore" Version="4.2.22" />
<PackageReference Include="NetDevPack.Security.PasswordHasher.Argon2" Version="7.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.1" />
<PackageReference Include="NSwag.AspNetCore" Version="13.18.2" />
<PackageReference Include="Postmark" Version="4.7.6" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.9" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageReference Include="MiniProfiler.EntityFrameworkCore" Version="4.3.8" />
<PackageReference Include="NetDevPack.Security.PasswordHasher.Argon2" Version="7.0.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.4" />
<PackageReference Include="NSwag.AspNetCore" Version="13.19.0" />
<PackageReference Include="Postmark" Version="4.7.7" />
<PackageReference Include="reCAPTCHA.AspNetCore" Version="3.0.10" />
<PackageReference Include="SendGrid" Version="9.28.1" />
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.Seq" Version="5.2.2" />
<PackageReference Include="SerilogTimings" Version="3.0.1" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
<PackageReference Include="System.ServiceModel.Syndication" Version="7.0.0" />
<PackageReference Include="System.Text.Json" Version="7.0.1" />
<PackageReference Include="System.Text.Json" Version="7.0.3" />
<PackageReference Include="Zack.EFCore.Batch.Npgsql_NET6" Version="6.1.3" />
</ItemGroup>

Expand Down
2 changes: 0 additions & 2 deletions Ogma3/Pages/Shared/Bars/_ClubBar.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
@using Microsoft.AspNetCore.Antiforgery
@using Microsoft.AspNetCore.Http
@using Ogma3.Data.Reports
@using Ogma3.Infrastructure.TagHelpers
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model ClubBar
@inject IAntiforgery Antiforgery
@inject IHttpContextAccessor Accessor;
Expand Down
2 changes: 0 additions & 2 deletions Ogma3/Pages/Shared/Bars/_ProfileBar.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
@using Microsoft.AspNetCore.Antiforgery
@using Microsoft.AspNetCore.Http
@using Ogma3.Infrastructure.Extensions
@using Ogma3.Infrastructure.TagHelpers
@using Ogma3.Infrastructure.Constants
@using Ogma3.Data.Reports
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model ProfileBar
@inject IAntiforgery Antiforgery
@inject IHttpContextAccessor Accessor;
Expand Down
2 changes: 0 additions & 2 deletions Ogma3/Pages/Shared/_Comments.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
@using Ogma3.Api.V1.Reports
@using Ogma3.Api.V1.Subscriptions
@using Ogma3.Data.Reports
@using Ogma3.Infrastructure.TagHelpers
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model CommentsThreadDto

<script>
Expand Down
2 changes: 0 additions & 2 deletions Ogma3/Pages/Story.cshtml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
@page "{id}/{slug?}"
@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Antiforgery
@using Ogma3.Infrastructure.Extensions
@using Ogma3.Infrastructure.TagHelpers
@using Ogma3.Infrastructure.Constants
@using System.Globalization
@using Ogma3.Data.Reports
@using Ogma3.Api.V1.ChaptersReads
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model StoryModel

@{
Expand Down
16 changes: 2 additions & 14 deletions Ogma3/Services/FileUploader/ImageUploader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
using Serilog;
using SerilogTimings;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Gif;
using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.Processing;

Expand Down Expand Up @@ -54,21 +51,12 @@ public async Task<FileUploaderResult> Upload(
if (width is not null || height is not null)
{
using var op = Operation.Time("Resizing image {Filename} that weighs {Size} bytes", file.FileName, file.Length);
// Create the appropriate decoder
IImageDecoder decoder = ext.ToUpper() switch
{
"JPG" => new JpegDecoder(),
"JPEG" => new JpegDecoder(),
"PNG" => new PngDecoder(),
"GIF" => new GifDecoder(),
_ => throw new ArgumentException("Unknown file format")
};

// Reset memory stream position
ms.Seek(0, SeekOrigin.Begin);

// Load and resize the image
using var img = await Image.LoadAsync(ms, decoder);
using var img = await Image.LoadAsync(ms);
img.Mutate(i => i.Resize(new ResizeOptions
{
Size = new Size((int)(width ?? height)!, (int)(height ?? width)!),
Expand Down
3 changes: 2 additions & 1 deletion Ogma3/Services/Initializers/DbSeedInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using System.Net.Http;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Extensions.Hosting.AsyncInitialization;
using Microsoft.EntityFrameworkCore;
Expand Down Expand Up @@ -45,7 +46,7 @@ public DbSeedInitializer(ApplicationDbContext context, OgmaUserManager userManag
private sealed record JsonData(string[] Icons, Rating[] Ratings, string QuotesUrl);


public async Task InitializeAsync()
public async Task InitializeAsync(CancellationToken ct)
{
await SeedRoles();
await SeedUserRoles();
Expand Down
9 changes: 9 additions & 0 deletions Ogma3/Services/Mailer/IMailer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity.UI.Services;

namespace Ogma3.Services.Mailer;

public interface IMailer : IEmailSender
{
Task SendEmailWithAttachmentsAsync(string email, string subject, string htmlMessage);
}
3 changes: 2 additions & 1 deletion Ogma3/Services/Mailer/PostmarkMailer.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.Extensions.Options;
Expand All @@ -21,7 +22,7 @@ public async Task SendEmailAsync(string email, string subject, string htmlMessag
TrackOpens = true,
TrackLinks = LinkTrackingOptions.HtmlAndText,
Subject = subject,
HtmlBody = htmlMessage
HtmlBody = htmlMessage, Attachments = new List<PostmarkMessageAttachment>()
};

var client = new PostmarkClient(_options.PostmarkKey);
Expand Down
Loading

0 comments on commit 025cf00

Please sign in to comment.