Add signature panel and layout updates for ReportViewer

Enhanced `ReportViewer.razor` with a new layout structure:
- Added `receiver-page-layout` with `receiver-signature-panel` and `receiver-viewer-wrapper` for better organization.
- Introduced a button to export signed PDFs, conditionally enabled based on `SignatureApplied`.
- Added a `DxPopup` for capturing signatures with a "Close" button.

Updated `MainLayout.razor` to remove unnecessary padding from `<article>`.

Refined `app.css`:
- Defined styles for `receiver-page-layout`, `receiver-signature-panel`, and `receiver-viewer-wrapper` to improve layout flexibility.
- Adjusted `article` to use flexbox and ensure hidden overflow.
This commit is contained in:
2026-05-29 14:06:59 +02:00
8 changed files with 469 additions and 38 deletions

View File

@@ -0,0 +1,127 @@
using AutoMapper;
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Envelopes.Queries;
using EnvelopeGenerator.Application.Receivers.Queries;
using MediatR;
using EnvelopeGenerator.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
using EnvelopeGenerator.Application.Common.Query;
using EnvelopeGenerator.Application.Common.Extensions;
namespace EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
/// <summary>
/// Represents a query for reading an envelope receiver including sensitive fields
/// (access code, phone number) that are excluded from the standard <see cref="ReadEnvelopeReceiverQuery"/>.
/// </summary>
/// <remarks>
/// Returns a single <see cref="EnvelopeReceiverSecretDto"/> matched by UUID and receiver signature.
/// Equivalent to the legacy <c>ReadWithSecretByUuidSignatureAsync</c> service method.
/// </remarks>
public record ReadEnvelopeReceiverSecretQuery
: EnvelopeReceiverQueryBase<ReadEnvelopeQuery, ReadReceiverQuery>,
IRequest<EnvelopeReceiverSecretDto?>;
/// <summary>
/// Extension methods for dispatching <see cref="ReadEnvelopeReceiverSecretQuery"/> via <see cref="IMediator"/>.
/// </summary>
public static class ReadEnvelopeReceiverSecretQueryExtensions
{
/// <summary>
/// Sends a <see cref="ReadEnvelopeReceiverSecretQuery"/> using the composite key (uuid::signature).
/// </summary>
/// <param name="mediator">The mediator instance.</param>
/// <param name="key">Composite key in the format <c>uuid::signature</c>.</param>
/// <param name="cancel">Cancellation token.</param>
/// <returns>The matching <see cref="EnvelopeReceiverSecretDto"/>, or <c>null</c> if not found.</returns>
public static Task<EnvelopeReceiverSecretDto?> ReadEnvelopeReceiverSecretAsync(
this IMediator mediator,
string key,
CancellationToken cancel = default)
=> mediator.Send(new ReadEnvelopeReceiverSecretQuery { Key = key }, cancel);
/// <summary>
/// Sends a <see cref="ReadEnvelopeReceiverSecretQuery"/> using UUID and receiver signature.
/// </summary>
/// <param name="mediator">The mediator instance.</param>
/// <param name="uuid">Envelope UUID.</param>
/// <param name="signature">Receiver signature.</param>
/// <param name="cancel">Cancellation token.</param>
/// <returns>The matching <see cref="EnvelopeReceiverSecretDto"/>, or <c>null</c> if not found.</returns>
public static Task<EnvelopeReceiverSecretDto?> ReadEnvelopeReceiverSecretAsync(
this IMediator mediator,
string uuid,
string signature,
CancellationToken cancel = default)
{
var q = new ReadEnvelopeReceiverSecretQuery();
q.Envelope.Uuid = uuid;
q.Receiver.Signature = signature;
return mediator.Send(q, cancel);
}
/// <summary>
/// Handles <see cref="ReadEnvelopeReceiverSecretQuery"/> and returns a
/// <see cref="EnvelopeReceiverSecretDto"/> containing sensitive fields.
/// </summary>
public class ReadEnvelopeReceiverSecretQueryHandler
: IRequestHandler<ReadEnvelopeReceiverSecretQuery, EnvelopeReceiverSecretDto?>
{
private readonly IRepository<EnvelopeReceiver> _repo;
private readonly IRepository<Receiver> _rcvRepo;
private readonly IMapper _mapper;
/// <summary>
/// Initializes a new instance of <see cref="ReadEnvelopeReceiverSecretQueryHandler"/>.
/// </summary>
/// <param name="envelopeReceiver">Repository for <see cref="EnvelopeReceiver"/>.</param>
/// <param name="rcvRepo">Repository for <see cref="Receiver"/>.</param>
/// <param name="mapper">AutoMapper instance.</param>
public ReadEnvelopeReceiverSecretQueryHandler(
IRepository<EnvelopeReceiver> envelopeReceiver,
IRepository<Receiver> rcvRepo,
IMapper mapper)
{
_repo = envelopeReceiver;
_rcvRepo = rcvRepo;
_mapper = mapper;
}
/// <summary>
/// Handles the query and returns the matching <see cref="EnvelopeReceiverSecretDto"/>.
/// </summary>
/// <param name="request">The query containing filter criteria.</param>
/// <param name="cancel">Cancellation token.</param>
/// <returns>
/// The matched <see cref="EnvelopeReceiverSecretDto"/>, or <c>null</c> if no record is found.
/// </returns>
public async Task<EnvelopeReceiverSecretDto?> Handle(
ReadEnvelopeReceiverSecretQuery request,
CancellationToken cancel)
{
var q = _repo.Query.Where(request, notnull: false);
var envRcvs = await q
.Include(er => er.Envelope).ThenInclude(e => e!.Documents!).ThenInclude(d => d.Elements)
.Include(er => er.Envelope).ThenInclude(e => e!.Histories)
.Include(er => er.Envelope).ThenInclude(e => e!.User)
.Include(er => er.Receiver)
.ToListAsync(cancel);
if (request.Receiver.HasAnyCriteria && envRcvs.Count != 0)
{
var receiver = await _rcvRepo.Query.Where(request.Receiver).FirstAsync(cancel);
foreach (var item in envRcvs)
item.Envelope?.Documents?.FirstOrDefault()?.Elements?.RemoveAll(s => s.ReceiverId != receiver.Id);
}
var envRcv = envRcvs.FirstOrDefault();
if (envRcv is null)
return null;
return _mapper.Map<EnvelopeReceiverSecretDto>(envRcv);
}
}
}

View File

@@ -0,0 +1,145 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using EnvelopeGenerator.Application;
using EnvelopeGenerator.Application.Common.Interfaces.Services;
using EnvelopeGenerator.Application.Services;
using EnvelopeGenerator.Infrastructure;
using DigitalData.EmailProfilerDispatcher;
using DigitalData.UserManager.DependencyInjection;
namespace EnvelopeGenerator.DependencyInjection;
/// <summary>
/// Controls which optional services are registered by <see cref="DependencyInjection.AddEnvelopeGenerator"/>.
/// All flags default to <c>true</c>. Set a flag to <c>false</c> if the consuming project
/// already registers that service itself or simply does not need it.
/// </summary>
public sealed class EnvelopeGeneratorOptions
{
/// <summary>Calls <c>AddHttpContextAccessor()</c>. Default: <c>true</c>.</summary>
public bool AddHttpContextAccessor { get; set; } = true;
/// <summary>
/// Calls <c>AddDistributedSqlServerCache()</c> with the supplied <see cref="SqlCacheOptions"/>.
/// Requires <see cref="SqlCacheOptions"/> to be configured. Default: <c>true</c>.
/// </summary>
public bool AddDistributedSqlServerCache { get; set; } = true;
/// <summary>
/// Options for the distributed SQL Server cache.
/// Required when <see cref="AddDistributedSqlServerCache"/> is <c>true</c>.
/// </summary>
public SqlCacheOptions? SqlCacheOptions { get; set; }
/// <summary>Calls <c>AddDispatcher&lt;TDbContext&gt;()</c>. Default: <c>true</c>.</summary>
public bool AddDispatcher { get; set; } = true;
/// <summary>Calls <c>AddMemoryCache()</c>. Default: <c>true</c>.</summary>
public bool AddMemoryCache { get; set; } = true;
/// <summary>Calls <c>AddUserManager&lt;TDbContext&gt;()</c>. Default: <c>true</c>.</summary>
public bool AddUserManager { get; set; } = true;
}
/// <summary>Options for <c>AddDistributedSqlServerCache</c>.</summary>
public sealed class SqlCacheOptions
{
/// <summary>SQL Server connection string.</summary>
public string ConnectionString { get; set; } = string.Empty;
/// <summary>Schema name. Default: <c>dbo</c>.</summary>
public string SchemaName { get; set; } = "dbo";
/// <summary>Table name. Default: <c>TBDD_CACHE</c>.</summary>
public string TableName { get; set; } = "TBDD_CACHE";
}
/// <summary>
/// Extension methods for registering EnvelopeGenerator services into an <see cref="IServiceCollection"/>.
/// Use <see cref="AddEnvelopeGenerator{TDbContext}"/> as the single entry-point for projects that need both the
/// application layer (MediatR, AutoMapper, CRUD services, configuration sections) and the infrastructure
/// layer (repositories, DbContext, SQL executors).
/// For projects that do not need a database (e.g. lightweight API gateways or unit-test hosts), use
/// <see cref="AddEnvelopeGeneratorCore"/> to register only the application layer.
/// </summary>
public static class DependencyInjection
{
/// <summary>
/// Registers the full EnvelopeGenerator stack using <see cref="EGDbContext"/> as the DbContext type.
/// </summary>
public static IServiceCollection AddEnvelopeGenerator(
this IServiceCollection services,
IConfiguration configuration,
Action<EnvelopeGenerator.Infrastructure.DependencyInjection.Config>? infrastructureOptions = null,
Action<EnvelopeGeneratorOptions>? options = null)
{
var opt = new EnvelopeGeneratorOptions();
options?.Invoke(opt);
#pragma warning disable CS0618
// Application layer: CRUD services, MediatR, AutoMapper, configuration sections.
services.AddEnvelopeGeneratorServices(configuration);
// Infrastructure layer: repositories, DbContext, Dapper type maps, SQL executors.
services.AddEnvelopeGeneratorInfrastructureServices(cfg =>
{
infrastructureOptions?.Invoke(cfg);
});
#pragma warning restore CS0618
if (opt.AddHttpContextAccessor)
services.AddHttpContextAccessor();
if (opt.AddDistributedSqlServerCache && opt.SqlCacheOptions is { } cacheOpts)
services.AddDistributedSqlServerCache(o =>
{
o.ConnectionString = cacheOpts.ConnectionString;
o.SchemaName = cacheOpts.SchemaName;
o.TableName = cacheOpts.TableName;
});
if (opt.AddDispatcher)
services.AddDispatcher<EGDbContext>();
if (opt.AddMemoryCache)
services.AddMemoryCache();
#pragma warning disable CS0618
if (opt.AddUserManager)
services.AddUserManager<EGDbContext>();
#pragma warning restore CS0618
return services;
}
/// <summary>
/// Registers only the <em>application</em> layer services (MediatR handlers, AutoMapper profiles,
/// CRUD services, configuration sections) without any infrastructure / database dependencies.
/// </summary>
/// <param name="services">Service collection to register services into.</param>
/// <param name="configuration">Application configuration used to bind application-level option sections.</param>
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
#pragma warning disable CS0618
public static IServiceCollection AddEnvelopeGeneratorCore(
this IServiceCollection services,
IConfiguration configuration)
{
services.AddEnvelopeGeneratorServices(configuration);
return services;
}
#pragma warning restore CS0618
/// <summary>
/// Registers <see cref="EnvelopeMailService"/> as the <see cref="IEnvelopeMailService"/> scoped
/// implementation.
/// </summary>
/// <param name="services">Service collection to register services into.</param>
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
#pragma warning disable CS0618
public static IServiceCollection AddEnvelopeMailService(this IServiceCollection services)
{
services.AddScoped<IEnvelopeMailService, EnvelopeMailService>();
return services;
}
#pragma warning restore CS0618
}

View File

@@ -0,0 +1,176 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<!-- NuGet package metadata -->
<PackageId>EnvelopeGenerator</PackageId>
<Authors>Digital Data GmbH</Authors>
<Company>Digital Data GmbH</Company>
<Product>EnvelopeGenerator</Product>
<Description>
Envelope Generator ist eine Bibliothek zur Verwaltung und Verarbeitung digitaler Umschläge (Envelopes).
Dieses Paket enthält die Dependency-Injection-Erweiterungsmethoden und bündelt die Application-
sowie Infrastructure-Schicht in einer einzigen NuGet-Referenz.
</Description>
<Copyright>Copyright 2024 Digital Data GmbH</Copyright>
<RepositoryUrl>http://git.dd:3000/AppStd/EnvelopeGenerator.git</RepositoryUrl>
<PackageTags>digital data envelope generator di dependency injection</PackageTags>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Version>1.2.0.3</Version>
<AssemblyVersion>1.2.0.3</AssemblyVersion>
<FileVersion>1.2.0.3</FileVersion>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
<!-- ASP.NET Core shared framework (AddHttpContextAccessor, AddMemoryCache, etc.) -->
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<!--
All dependencies are declared here.
Because Application and Infrastructure DLLs are bundled via PrivateAssets=all,
their PackageReferences have been moved to this project so that the correct
dependencies are written to the nuspec and a consuming project works with
a single package install.
-->
<ItemGroup>
<!-- DigitalData BaGet packages -->
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.6.0" />
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
<PackageReference Include="DigitalData.Core.Infrastructure" Version="2.6.1" />
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="3.1.1" />
<PackageReference Include="UserManager" Version="1.1.3" />
<!-- ORM / Database -->
<PackageReference Include="Dapper" Version="2.1.66" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<!-- Application services -->
<PackageReference Include="MediatR" Version="12.5.0" />
<PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
<PackageReference Include="QuestPDF" Version="2025.7.1" />
<PackageReference Include="Otp.NET" Version="1.4.0" />
<!-- Security / Identity -->
<PackageReference Include="Microsoft.Identity.Client" Version="4.82.1" />
<!-- Utilities -->
<PackageReference Include="HtmlSanitizer" Version="9.0.892" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
<PackageReference Include="System.Formats.Asn1" Version="10.0.3" />
<PackageReference Include="System.Security.AccessControl" Version="6.0.1" />
<!-- DI abstractions -->
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.6" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.6" />
</ItemGroup>
<!-- TFM-specific packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="CommandDotNet" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.20" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="7.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.20" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="AutoMapper" Version="14.0.0" />
<PackageReference Include="CommandDotNet" Version="8.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.17" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.17" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="AutoMapper" Version="14.0.0" />
<PackageReference Include="CommandDotNet" Version="8.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.6" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="9.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
</ItemGroup>
<!-- Bundle dependency DLLs into the package lib folder -->
<Target Name="IncludeDependencyDlls" BeforeTargets="_GetPackageFiles">
<ItemGroup>
<_DepDlls Include="&#xD;&#xA; ..\EnvelopeGenerator.Application\bin\$(Configuration)\%(ProjectReference.TargetFramework)\EnvelopeGenerator.Application.dll;&#xD;&#xA; ..\EnvelopeGenerator.Domain\bin\$(Configuration)\%(ProjectReference.TargetFramework)\EnvelopeGenerator.Domain.dll;&#xD;&#xA; ..\EnvelopeGenerator.Infrastructure\bin\$(Configuration)\%(ProjectReference.TargetFramework)\EnvelopeGenerator.Infrastructure.dll" />
</ItemGroup>
</Target>
<!--
Rebuild all dependency projects for every TFM before packing so that
the DLLs bundled into the package are always up-to-date.
Run with: dotnet pack -c Release
-->
<Target Name="RebuildDependenciesBeforePack" BeforeTargets="GenerateNuspec">
<MSBuild Projects="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net7.0" />
<MSBuild Projects="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net8.0" />
<MSBuild Projects="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net9.0" />
<MSBuild Projects="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net7.0" />
<MSBuild Projects="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net8.0" />
<MSBuild Projects="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net9.0" />
<MSBuild Projects="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net7.0" />
<MSBuild Projects="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net8.0" />
<MSBuild Projects="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);TargetFramework=net9.0" />
</Target>
<Target Name="BundleReferencedDlls" AfterTargets="Build">
<ItemGroup>
<BuildOutputInPackage Include="..\EnvelopeGenerator.Application\bin\$(Configuration)\net7.0\EnvelopeGenerator.Application.dll" TargetFramework="net7.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Application\bin\$(Configuration)\net8.0\EnvelopeGenerator.Application.dll" TargetFramework="net8.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Application\bin\$(Configuration)\net9.0\EnvelopeGenerator.Application.dll" TargetFramework="net9.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Domain\bin\$(Configuration)\net7.0\EnvelopeGenerator.Domain.dll" TargetFramework="net7.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Domain\bin\$(Configuration)\net8.0\EnvelopeGenerator.Domain.dll" TargetFramework="net8.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Domain\bin\$(Configuration)\net9.0\EnvelopeGenerator.Domain.dll" TargetFramework="net9.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Infrastructure\bin\$(Configuration)\net7.0\EnvelopeGenerator.Infrastructure.dll" TargetFramework="net7.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Infrastructure\bin\$(Configuration)\net8.0\EnvelopeGenerator.Infrastructure.dll" TargetFramework="net8.0" />
<BuildOutputInPackage Include="..\EnvelopeGenerator.Infrastructure\bin\$(Configuration)\net9.0\EnvelopeGenerator.Infrastructure.dll" TargetFramework="net9.0" />
</ItemGroup>
</Target>
</Project>

View File

@@ -438,4 +438,10 @@ public class EnvelopeController : ViewControllerBase
return this.ViewDocumentNotFound(); return this.ViewDocumentNotFound();
} }
} }
[HttpGet("EnvelopeReceiverWithSecretByMediatr")]
public async Task<IActionResult> EnvelopeReceiverWithSecretByMediatr([FromQuery] ReadEnvelopeReceiverSecretQuery q, CancellationToken cancel)
{
return await _mediator.Send(q, cancel) is EnvelopeReceiverSecretDto dto ? Ok(dto) : NotFound();
}
} }

View File

@@ -2175,6 +2175,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" /> <ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.DependencyInjection\EnvelopeGenerator.DependencyInjection.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" /> <ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.PdfEditor\EnvelopeGenerator.PdfEditor.csproj" /> <ProjectReference Include="..\EnvelopeGenerator.PdfEditor\EnvelopeGenerator.PdfEditor.csproj" />
</ItemGroup> </ItemGroup>

View File

@@ -1,4 +1,3 @@
using EnvelopeGenerator.Application.Services;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NLog; using NLog;
using Quartz; using Quartz;
@@ -9,14 +8,12 @@ using EnvelopeGenerator.Web.Models;
using System.Text.Encodings.Web; using System.Text.Encodings.Web;
using Ganss.Xss; using Ganss.Xss;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using EnvelopeGenerator.Application;
using DigitalData.EmailProfilerDispatcher; using DigitalData.EmailProfilerDispatcher;
using EnvelopeGenerator.Infrastructure; using EnvelopeGenerator.Infrastructure;
using EnvelopeGenerator.Web.Sanitizers; using EnvelopeGenerator.Web.Sanitizers;
using EnvelopeGenerator.Web.Models.Annotation; using EnvelopeGenerator.Web.Models.Annotation;
using DigitalData.UserManager.DependencyInjection;
using EnvelopeGenerator.Web.Middleware; using EnvelopeGenerator.Web.Middleware;
using EnvelopeGenerator.Application.Common.Interfaces.Services; using EnvelopeGenerator.DependencyInjection;
using EnvelopeGenerator.Web; using EnvelopeGenerator.Web;
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger(); var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
@@ -57,8 +54,6 @@ try
}); });
}); });
builder.Services.AddHttpContextAccessor();
builder.ConfigureBySection<TFARegParams>(); builder.ConfigureBySection<TFARegParams>();
// Add controllers and razor views // Add controllers and razor views
@@ -95,17 +90,9 @@ try
var connStr = config.GetConnectionString(cnnStrName) var connStr = config.GetConnectionString(cnnStrName)
?? throw new InvalidOperationException($"Connection string '{cnnStrName}' is missing in the application configuration."); ?? throw new InvalidOperationException($"Connection string '{cnnStrName}' is missing in the application configuration.");
builder.Services.AddDistributedSqlServerCache(options =>
{
options.ConnectionString = connStr;
options.SchemaName = "dbo";
options.TableName = "TBDD_CACHE";
});
// Add envelope generator services // Add envelope generator services
#pragma warning disable CS0618 // Type or member is obsolete builder.Services.AddEnvelopeGenerator(config,
builder.Services.AddEnvelopeGeneratorInfrastructureServices( infrastructureOptions: opt =>
opt =>
{ {
opt.AddDbTriggerParams(config); opt.AddDbTriggerParams(config);
opt.AddDbContext((provider, options) => opt.AddDbContext((provider, options) =>
@@ -116,12 +103,16 @@ try
.EnableSensitiveDataLogging() .EnableSensitiveDataLogging()
.EnableDetailedErrors(); .EnableDetailedErrors();
}); });
},
options: opt =>
{
opt.SqlCacheOptions = new()
{
ConnectionString = connStr,
SchemaName = "dbo",
TableName = "TBDD_CACHE"
};
}); });
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
builder.Services.AddEnvelopeGeneratorServices(config);
#pragma warning restore CS0618 // Type or member is obsolete
builder.Services.Configure<CookiePolicyOptions>(options => builder.Services.Configure<CookiePolicyOptions>(options =>
{ {
@@ -169,22 +160,12 @@ try
builder.Services.AddSingleton(sp => sp.GetRequiredService<IOptions<MultiCulture>>().Value); builder.Services.AddSingleton(sp => sp.GetRequiredService<IOptions<MultiCulture>>().Value);
// Register mail services // Register mail services
#pragma warning disable CS0618 // Type or member is obsolete builder.Services.AddEnvelopeMailService();
builder.Services.AddScoped<IEnvelopeMailService, EnvelopeMailService>();
#pragma warning restore CS0618 // Type or member is obsolete
builder.Services.AddDispatcher<EGDbContext>();
builder.Services.AddMemoryCache();
builder.ConfigureBySection<CustomImages>(); builder.ConfigureBySection<CustomImages>();
builder.ConfigureBySection<AnnotationParams>(); builder.ConfigureBySection<AnnotationParams>();
#pragma warning disable CS0618 // Type or member is obsolete
builder.Services.AddUserManager<EGDbContext>();
#pragma warning restore CS0618 // Type or member is obsolete
var app = builder.Build(); var app = builder.Build();
app.UseMiddleware<ExceptionHandlingMiddleware>(); app.UseMiddleware<ExceptionHandlingMiddleware>();

View File

@@ -1 +1 @@
function detailedCurrentDate(){return new Intl.DateTimeFormat(getCurrentCulture(),{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"shortOffset"}).format()}function findNearest(e,t,o,n){const r=n.reduce(((n,r)=>{const i=Math.sqrt((t(e)-t(r))**2+(o(e)-o(r))**2);return i<n.dist?{dist:i,dest:r}:n}),{dist:1/0,dest:null});return r.dest}const getCurrentCulture=()=>("undefined"!=typeof localized&&localized.culture)?localized.culture:navigator.language||"en-US";const B64ToBuff=e=>new Uint8Array(Array.from(atob(e),e=>e.charCodeAt(0))).buffer;const getLocaleDateString=e=>new Date().toLocaleDateString(getCurrentCulture()); function detailedCurrentDate(){return new Intl.DateTimeFormat(getCurrentCulture(),{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"shortOffset"}).format()}function findNearest(n,t,i,r){const u=r=>Math.sqrt((t(n)-t(r))**2+(i(n)-i(r))**2);return r.reduce((n,t)=>{const i=u(t);return i<n.dist?{dist:i,dest:t}:n},{dist:Infinity,dest:null}).dest}const getCurrentCulture=()=>typeof localized!="undefined"&&localized.culture?localized.culture:navigator.language||"en-US",B64ToBuff=n=>new Uint8Array(Array.from(atob(n),n=>n.charCodeAt(0))).buffer,getLocaleDateString=()=>(new Date).toLocaleDateString(getCurrentCulture());

View File

@@ -87,10 +87,6 @@ Global
{EC768913-6270-14F4-1DD3-69C87A659462}.Debug|Any CPU.Build.0 = Debug|Any CPU {EC768913-6270-14F4-1DD3-69C87A659462}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC768913-6270-14F4-1DD3-69C87A659462}.Release|Any CPU.ActiveCfg = Release|Any CPU {EC768913-6270-14F4-1DD3-69C87A659462}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC768913-6270-14F4-1DD3-69C87A659462}.Release|Any CPU.Build.0 = Release|Any CPU {EC768913-6270-14F4-1DD3-69C87A659462}.Release|Any CPU.Build.0 = Release|Any CPU
{FB2D306B-1042-4A70-31ED-F991A1599371}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB2D306B-1042-4A70-31ED-F991A1599371}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB2D306B-1042-4A70-31ED-F991A1599371}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB2D306B-1042-4A70-31ED-F991A1599371}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@@ -110,7 +106,6 @@ Global
{211619F5-AE25-4BA5-A552-BACAFE0632D3} = {9943209E-1744-4944-B1BA-4F87FC1A0EEB} {211619F5-AE25-4BA5-A552-BACAFE0632D3} = {9943209E-1744-4944-B1BA-4F87FC1A0EEB}
{224C4845-1CDE-22B7-F3A9-1FF9297F70E8} = {0CBC2432-A561-4440-89BC-671B66A24146} {224C4845-1CDE-22B7-F3A9-1FF9297F70E8} = {0CBC2432-A561-4440-89BC-671B66A24146}
{EC768913-6270-14F4-1DD3-69C87A659462} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB} {EC768913-6270-14F4-1DD3-69C87A659462} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
{FB2D306B-1042-4A70-31ED-F991A1599371} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {73E60370-756D-45AD-A19A-C40A02DACCC7} SolutionGuid = {73E60370-756D-45AD-A19A-C40A02DACCC7}