Compare commits
9 Commits
88b196ed6d
...
a3b33637fd
| Author | SHA1 | Date | |
|---|---|---|---|
| a3b33637fd | |||
| bc3134a033 | |||
| f106255c6b | |||
| cb103dcb69 | |||
| 8c1dd9c40d | |||
| ee358ffaab | |||
| 0780dbdd94 | |||
| d722742fe8 | |||
| 8c42105f58 |
@@ -51,7 +51,7 @@ public class EnvelopeController : ControllerBase
|
|||||||
/// <response code="401">Der Benutzer ist nicht authentifiziert.</response>
|
/// <response code="401">Der Benutzer ist nicht authentifiziert.</response>
|
||||||
/// <response code="403">Der Benutzer hat keine Berechtigung, auf die Ressource zuzugreifen.</response>
|
/// <response code="403">Der Benutzer hat keine Berechtigung, auf die Ressource zuzugreifen.</response>
|
||||||
/// <response code="500">Ein unerwarteter Fehler ist aufgetreten.</response>
|
/// <response code="500">Ein unerwarteter Fehler ist aufgetreten.</response>
|
||||||
[Authorize]
|
[Authorize(AuthenticationSchemes = AuthScheme.Sender)]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<IActionResult> GetAsync([FromQuery] ReadEnvelopeQuery envelope)
|
public async Task<IActionResult> GetAsync([FromQuery] ReadEnvelopeQuery envelope)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using EnvelopeGenerator.Domain.Interfaces;
|
using EnvelopeGenerator.Domain.Interfaces;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Common.Dto;
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
@@ -126,4 +129,9 @@ public record EnvelopeDto : IEnvelope
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<DocumentDto>? Documents { get; set; }
|
public IEnumerable<DocumentDto>? Documents { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<ReceiverDto>? Receivers { get; set; }
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<DocReceiverElement, DocReceiverElementDto>();
|
CreateMap<DocReceiverElement, DocReceiverElementDto>();
|
||||||
CreateMap<DocumentStatus, DocumentStatusDto>();
|
CreateMap<DocumentStatus, DocumentStatusDto>();
|
||||||
CreateMap<EmailTemplate, EmailTemplateDto>();
|
CreateMap<EmailTemplate, EmailTemplateDto>();
|
||||||
CreateMap<Envelope, EnvelopeDto>();
|
CreateMap<Envelope, EnvelopeDto>().ForMember(dest => dest.Receivers, opt => opt.MapFrom(src => src.EnvelopeReceivers.Select(er => er.Receiver)));
|
||||||
CreateMap<Document, DocumentDto>();
|
CreateMap<Document, DocumentDto>();
|
||||||
CreateMap<Domain.Entities.History, HistoryDto>().ForMember(dest => dest.ActionDate, opt => opt.MapFrom(src => src.ChangedWhen));
|
CreateMap<Domain.Entities.History, HistoryDto>().ForMember(dest => dest.ActionDate, opt => opt.MapFrom(src => src.ChangedWhen));
|
||||||
CreateMap<Domain.Entities.History, HistoryCreateDto>().ForMember(dest => dest.ActionDate, opt => opt.MapFrom(src => src.ChangedWhen));
|
CreateMap<Domain.Entities.History, HistoryCreateDto>().ForMember(dest => dest.ActionDate, opt => opt.MapFrom(src => src.ChangedWhen));
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest<IEnumerable<Envelo
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Optionaler Benutzerfilter; wenn gesetzt, werden nur Umschläge des Benutzers geladen.
|
/// Optionaler Benutzerfilter; wenn gesetzt, werden nur Umschläge des Benutzers geladen.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? UserId { get; init; }
|
internal int? UserId { get; init; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Setzt den Benutzerkontext für die Abfrage.
|
/// Setzt den Benutzerkontext für die Abfrage.
|
||||||
@@ -133,7 +133,7 @@ public class ReadEnvelopeQueryHandler : IRequestHandler<ReadEnvelopeQuery, IEnum
|
|||||||
}
|
}
|
||||||
|
|
||||||
var envelopes = await query
|
var envelopes = await query
|
||||||
.Include(e => e.Documents)
|
.Include(e => e.EnvelopeReceivers).ThenInclude(er => er.Receiver)
|
||||||
.ToListAsync(cancel);
|
.ToListAsync(cancel);
|
||||||
|
|
||||||
return _mapper.Map<IEnumerable<EnvelopeDto>>(envelopes);
|
return _mapper.Map<IEnumerable<EnvelopeDto>>(envelopes);
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
public string Language { get; set; }
|
public string Language { get; set; }
|
||||||
|
|
||||||
[Column("SEND_REMINDER_EMAILS")]
|
[Column("SEND_REMINDER_EMAILS")]
|
||||||
public bool SendReminderEmails { get; set; }
|
public bool? SendReminderEmails { get; set; }
|
||||||
|
|
||||||
[Column("FIRST_REMINDER_DAYS")]
|
[Column("FIRST_REMINDER_DAYS")]
|
||||||
public int? FirstReminderDays { get; set; }
|
public int? FirstReminderDays { get; set; }
|
||||||
@@ -114,7 +114,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
public int? CertificationType { get; set; }
|
public int? CertificationType { get; set; }
|
||||||
|
|
||||||
[Column("USE_ACCESS_CODE")]
|
[Column("USE_ACCESS_CODE")]
|
||||||
public bool UseAccessCode { get; set; }
|
public bool? UseAccessCode { get; set; }
|
||||||
|
|
||||||
[Column("FINAL_EMAIL_TO_CREATOR")]
|
[Column("FINAL_EMAIL_TO_CREATOR")]
|
||||||
public int? FinalEmailToCreator { get; set; }
|
public int? FinalEmailToCreator { get; set; }
|
||||||
@@ -132,7 +132,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
public User User { get; set; }
|
public User User { get; set; }
|
||||||
|
|
||||||
[Column("TFA_ENABLED")]
|
[Column("TFA_ENABLED")]
|
||||||
public bool TfaEnabled { get; set; }
|
public bool? TfaEnabled { get; set; }
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
= false;
|
= false;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -14,11 +14,11 @@
|
|||||||
<PackageIcon>Assets\icon.ico</PackageIcon>
|
<PackageIcon>Assets\icon.ico</PackageIcon>
|
||||||
<PackageTags>digital data envelope generator web</PackageTags>
|
<PackageTags>digital data envelope generator web</PackageTags>
|
||||||
<Description>EnvelopeGenerator.ReceiverUI is a Blazor WebAssembly application developed to manage signing processes. It uses Entity Framework Core (EF Core) for database operations. The user interface for signing processes is developed with Razor View Engine (.cshtml files) and JavaScript under wwwroot, integrated with PSPDFKit. This integration allows users to view and sign documents seamlessly.</Description>
|
<Description>EnvelopeGenerator.ReceiverUI is a Blazor WebAssembly application developed to manage signing processes. It uses Entity Framework Core (EF Core) for database operations. The user interface for signing processes is developed with Razor View Engine (.cshtml files) and JavaScript under wwwroot, integrated with PSPDFKit. This integration allows users to view and sign documents seamlessly.</Description>
|
||||||
<Version>1.4.1</Version>
|
<Version>1.4.2</Version>
|
||||||
<!-- NuGet package version -->
|
<!-- NuGet package version -->
|
||||||
<AssemblyVersion>1.4.1.0</AssemblyVersion>
|
<AssemblyVersion>1.4.2.0</AssemblyVersion>
|
||||||
<!-- Assembly version for API compatibility -->
|
<!-- Assembly version for API compatibility -->
|
||||||
<FileVersion>1.4.1.0</FileVersion>
|
<FileVersion>1.4.2.0</FileVersion>
|
||||||
<!-- Windows file version -->
|
<!-- Windows file version -->
|
||||||
<Copyright>Copyright © 2026 Digital Data GmbH. All rights reserved.</Copyright>
|
<Copyright>Copyright © 2026 Digital Data GmbH. All rights reserved.</Copyright>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
@page "/envelope/DxPdfViewer"
|
||||||
|
@using System.IO
|
||||||
|
@using DevExpress.Blazor
|
||||||
|
@using System.Reflection
|
||||||
|
|
||||||
|
<link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.min.css" rel="stylesheet" />
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.custom-drop-zone {
|
||||||
|
padding: 0 !important;
|
||||||
|
border-style: dashed;
|
||||||
|
border-width: 2px !important;
|
||||||
|
height: 230px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: rgba(183, 183, 183, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-drop-zone.custom-drop-zone-hover {
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-drop-zone svg {
|
||||||
|
width: 42px;
|
||||||
|
height: 42px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-drop-zone > *:not(#overviewDemoSelectButton) {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-viewer {
|
||||||
|
height: 800px !important;
|
||||||
|
min-height: 800px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-viewer .dxbrv-surface-wrapper,
|
||||||
|
.pdf-viewer .dxbrv-document-surface {
|
||||||
|
height: 100% !important;
|
||||||
|
min-height: 750px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-viewer .dxbrv-report-preview-content {
|
||||||
|
width: auto !important;
|
||||||
|
height: auto !important;
|
||||||
|
min-width: 200px !important;
|
||||||
|
min-height: 200px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div id="overviewDemoDropZone" class="card custom-drop-zone rounded-3 w-100 m-0">
|
||||||
|
<span class="drop-file-icon mb-3"></span>
|
||||||
|
<span class="drop-file-label">Drag and Drop File Here</span><span class="m-1">or</span>
|
||||||
|
<DxButton Id="overviewDemoSelectButton"
|
||||||
|
CssClass="m-1"
|
||||||
|
RenderStyle="ButtonRenderStyle.Primary"
|
||||||
|
Text="Select File" />
|
||||||
|
</div>
|
||||||
|
<DxFileInput @ref="fileInput"
|
||||||
|
AcceptedFileTypes="@ALLOWED_FILE_TYPES"
|
||||||
|
AllowedFileExtensions="@ALLOWED_FILE_TYPES"
|
||||||
|
CssClass="w-100"
|
||||||
|
ExternalDropZoneCssSelector="#overviewDemoDropZone"
|
||||||
|
ExternalDropZoneDragOverCssClass="custom-drop-zone-hover"
|
||||||
|
ExternalSelectButtonCssSelector="#overviewDemoSelectButton"
|
||||||
|
FilesUploading="OnFilesUploading"
|
||||||
|
MaxFileSize="2000000">
|
||||||
|
</DxFileInput>
|
||||||
|
|
||||||
|
@if (DocumentContent != null && DocumentContent.Length > 0)
|
||||||
|
{
|
||||||
|
<div class="alert alert-success mt-3">
|
||||||
|
PDF loaded: @DocumentContent.Length bytes
|
||||||
|
</div>
|
||||||
|
<DxPdfViewer CssClass="w-100 pdf-viewer" DocumentContent="@DocumentContent" />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="alert alert-info mt-3">
|
||||||
|
Please upload a PDF file to view it.
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@code {
|
||||||
|
readonly List<string> ALLOWED_FILE_TYPES = new List<string> { ".pdf" };
|
||||||
|
DxFileInput fileInput;
|
||||||
|
byte[] DocumentContent { get; set; }
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||||
|
Stream stream = assembly.GetManifestResourceStream("EnvelopeGenerator.ReceiverUI.Resources.Invoice.pdf");
|
||||||
|
if (stream != null)
|
||||||
|
{
|
||||||
|
using (stream)
|
||||||
|
using (var binaryReader = new BinaryReader(stream))
|
||||||
|
DocumentContent = binaryReader.ReadBytes((int)stream.Length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected async Task OnFilesUploading(FilesUploadingEventArgs args)
|
||||||
|
{
|
||||||
|
using (MemoryStream stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
IFileInputSelectedFile file = args.Files[0];
|
||||||
|
await file.OpenReadStream(file.Size).CopyToAsync(stream);
|
||||||
|
DocumentContent = stream.ToArray();
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
@page "/envelope/Embed"
|
||||||
|
@using System.IO
|
||||||
|
@using DevExpress.Blazor
|
||||||
|
@using System.Reflection
|
||||||
|
|
||||||
|
<link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.min.css" rel="stylesheet" />
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.custom-drop-zone {
|
||||||
|
padding: 0 !important;
|
||||||
|
border-style: dashed;
|
||||||
|
border-width: 2px !important;
|
||||||
|
height: 230px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: rgba(183, 183, 183, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-drop-zone.custom-drop-zone-hover {
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-drop-zone svg {
|
||||||
|
width: 42px;
|
||||||
|
height: 42px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-drop-zone > *:not(#overviewDemoSelectButton) {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-viewer {
|
||||||
|
height: 800px !important;
|
||||||
|
min-height: 800px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-viewer .dxbrv-surface-wrapper,
|
||||||
|
.pdf-viewer .dxbrv-document-surface {
|
||||||
|
height: 100% !important;
|
||||||
|
min-height: 750px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-viewer .dxbrv-report-preview-content {
|
||||||
|
width: auto !important;
|
||||||
|
height: auto !important;
|
||||||
|
min-width: 200px !important;
|
||||||
|
min-height: 200px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div id="overviewDemoDropZone" class="card custom-drop-zone rounded-3 w-100 m-0">
|
||||||
|
<span class="drop-file-icon mb-3"></span>
|
||||||
|
<span class="drop-file-label">Drag and Drop File Here</span><span class="m-1">or</span>
|
||||||
|
<DxButton Id="overviewDemoSelectButton"
|
||||||
|
CssClass="m-1"
|
||||||
|
RenderStyle="ButtonRenderStyle.Primary"
|
||||||
|
Text="Select File" />
|
||||||
|
</div>
|
||||||
|
<DxFileInput @ref="fileInput"
|
||||||
|
AcceptedFileTypes="@ALLOWED_FILE_TYPES"
|
||||||
|
AllowedFileExtensions="@ALLOWED_FILE_TYPES"
|
||||||
|
CssClass="w-100"
|
||||||
|
ExternalDropZoneCssSelector="#overviewDemoDropZone"
|
||||||
|
ExternalDropZoneDragOverCssClass="custom-drop-zone-hover"
|
||||||
|
ExternalSelectButtonCssSelector="#overviewDemoSelectButton"
|
||||||
|
FilesUploading="OnFilesUploading"
|
||||||
|
MaxFileSize="2000000">
|
||||||
|
</DxFileInput>
|
||||||
|
|
||||||
|
@if (DocumentContent != null && DocumentContent.Length > 0)
|
||||||
|
{
|
||||||
|
<div class="alert alert-success mt-3">
|
||||||
|
PDF loaded: @DocumentContent.Length bytes
|
||||||
|
</div>
|
||||||
|
<embed src="@GetPdfDataUrl()" type="application/pdf" class="w-100 pdf-viewer" />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="alert alert-info mt-3">
|
||||||
|
Please upload a PDF file to view it.
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@code {
|
||||||
|
readonly List<string> ALLOWED_FILE_TYPES = new List<string> { ".pdf" };
|
||||||
|
DxFileInput fileInput;
|
||||||
|
byte[] DocumentContent { get; set; }
|
||||||
|
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||||
|
Stream stream = assembly.GetManifestResourceStream("EnvelopeGenerator.ReceiverUI.Resources.Invoice.pdf");
|
||||||
|
if (stream != null)
|
||||||
|
{
|
||||||
|
using (stream)
|
||||||
|
using (var binaryReader = new BinaryReader(stream))
|
||||||
|
DocumentContent = binaryReader.ReadBytes((int)stream.Length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async Task OnFilesUploading(FilesUploadingEventArgs args)
|
||||||
|
{
|
||||||
|
using (MemoryStream stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
IFileInputSelectedFile file = args.Files[0];
|
||||||
|
await file.OpenReadStream(file.Size).CopyToAsync(stream);
|
||||||
|
DocumentContent = stream.ToArray();
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetPdfDataUrl()
|
||||||
|
{
|
||||||
|
if (DocumentContent == null || DocumentContent.Length == 0)
|
||||||
|
return string.Empty;
|
||||||
|
|
||||||
|
string base64 = Convert.ToBase64String(DocumentContent);
|
||||||
|
return $"data:application/pdf;base64,{base64}#toolbar=0&navpanes=0&scrollbar=1";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user