Compare commits
7 Commits
b66c2f67da
...
customer/C
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd7454d38e | ||
|
|
f7c3ed280a | ||
|
|
9ffeb7afe8 | ||
|
|
a83994af43 | ||
|
|
8345034fcd | ||
|
|
a763d3c353 | ||
|
|
5ba5d2755b |
@@ -1,6 +1,6 @@
|
||||
using DigitalData.Core.DTO;
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Common;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
@@ -11,8 +10,6 @@ namespace EnvelopeGenerator.Application.Contracts
|
||||
|
||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false);
|
||||
|
||||
Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadSecretByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true);
|
||||
|
||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true);
|
||||
|
||||
Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true);
|
||||
@@ -28,7 +25,5 @@ namespace EnvelopeGenerator.Application.Contracts
|
||||
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
|
||||
|
||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||
|
||||
Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
@@ -10,7 +11,5 @@ namespace EnvelopeGenerator.Application.Contracts
|
||||
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
|
||||
|
||||
Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
|
||||
|
||||
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[]ignore_statuses);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
|
||||
int EnvelopeId,
|
||||
string UserReference,
|
||||
int Status,
|
||||
string? StatusName,
|
||||
DateTime AddedWhen,
|
||||
DateTime? ActionDate,
|
||||
UserCreateDto? Sender,
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
||||
{
|
||||
public record EnvelopeReceiverBasicDto()
|
||||
{
|
||||
public int EnvelopeId { get; init; }
|
||||
|
||||
public int ReceiverId { get; init; }
|
||||
|
||||
public int Sequence { get; init; }
|
||||
|
||||
[TemplatePlaceholder("[NAME_RECEIVER]")]
|
||||
public string? Name { get; init; }
|
||||
|
||||
public string? JobTitle { get; init; }
|
||||
|
||||
public string? CompanyName { get; init; }
|
||||
|
||||
public string? PrivateMessage { get; init; }
|
||||
|
||||
public DateTime AddedWhen { get; init; }
|
||||
|
||||
public DateTime? ChangedWhen { get; init; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
||||
{
|
||||
public record EnvelopeReceiverDto() : EnvelopeReceiverBasicDto()
|
||||
{
|
||||
public EnvelopeDto? Envelope { get; set; }
|
||||
|
||||
public ReceiverReadDto? Receiver { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
||||
{
|
||||
public record EnvelopeReceiverSecretDto(string? AccessCode) : EnvelopeReceiverDto;
|
||||
}
|
||||
31
EnvelopeGenerator.Application/DTOs/EnvelopeReceiverDto.cs
Normal file
31
EnvelopeGenerator.Application/DTOs/EnvelopeReceiverDto.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record EnvelopeReceiverDto()
|
||||
{
|
||||
public int EnvelopeId { get; set; }
|
||||
|
||||
public int ReceiverId { get; set; }
|
||||
|
||||
public int Sequence { get; set; }
|
||||
|
||||
[TemplatePlaceholder("[NAME_RECEIVER]")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
public string? JobTitle { get; set; }
|
||||
|
||||
public string? CompanyName { get; set; }
|
||||
|
||||
public string? PrivateMessage { get; set; }
|
||||
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
|
||||
public EnvelopeDto? Envelope { get; set; }
|
||||
|
||||
public ReceiverReadDto? Receiver { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs.Receiver
|
||||
{
|
||||
@@ -8,12 +6,6 @@ namespace EnvelopeGenerator.Application.DTOs.Receiver
|
||||
int Id,
|
||||
string EmailAddress,
|
||||
string Signature,
|
||||
DateTime AddedWhen
|
||||
) : BaseDTO<int>(Id)
|
||||
{
|
||||
[JsonIgnore]
|
||||
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; init; }
|
||||
|
||||
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
|
||||
};
|
||||
DateTime AddedWhen
|
||||
) : BaseDTO<int>(Id);
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="1.0.1.1" />
|
||||
<PackageReference Include="DigitalData.Core.Application" Version="1.0.0" />
|
||||
<PackageReference Include="DigitalData.Core.DTO" Version="1.0.0.1" />
|
||||
<PackageReference Include="DigitalData.Core.DTO" Version="1.0.0" />
|
||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="1.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
|
||||
<PackageReference Include="UserManager.Application" Version="1.0.0" />
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using AutoMapper;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
@@ -22,7 +21,6 @@ namespace EnvelopeGenerator.Application.MappingProfiles
|
||||
CreateMap<EnvelopeHistory, EnvelopeHistoryDto>();
|
||||
CreateMap<EnvelopeHistory, EnvelopeHistoryCreateDto>();
|
||||
CreateMap<EnvelopeReceiver, EnvelopeReceiverDto>();
|
||||
CreateMap<EnvelopeReceiver, EnvelopeReceiverSecretDto>();
|
||||
CreateMap<EnvelopeType, EnvelopeTypeDto>();
|
||||
CreateMap<Receiver, ReceiverReadDto>();
|
||||
CreateMap<Receiver, ReceiverCreateDto>();
|
||||
@@ -45,7 +43,6 @@ namespace EnvelopeGenerator.Application.MappingProfiles
|
||||
CreateMap<ReceiverCreateDto, Receiver>();
|
||||
CreateMap<ReceiverUpdateDto, Receiver>();
|
||||
CreateMap<UserReceiverDto, UserReceiver>();
|
||||
CreateMap<EnvelopeReceiverBase, EnvelopeReceiverBasicDto>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -210,6 +210,9 @@
|
||||
<data name="UnexpectedError" xml:space="preserve">
|
||||
<value>Ein unerwarteter Fehler ist aufgetreten.</value>
|
||||
</data>
|
||||
<data name="WelcomeToTheESignPortal" xml:space="preserve">
|
||||
<value>Herzlich willkommen im eSign-Portal</value>
|
||||
</data>
|
||||
<data name="WrongAccessCode" xml:space="preserve">
|
||||
<value>Ungültiger Zugangscode.</value>
|
||||
</data>
|
||||
|
||||
@@ -210,6 +210,9 @@
|
||||
<data name="UnexpectedError" xml:space="preserve">
|
||||
<value>An unexpected error has occurred.</value>
|
||||
</data>
|
||||
<data name="WelcomeToTheESignPortal" xml:space="preserve">
|
||||
<value>Welcome to the eSign portal</value>
|
||||
</data>
|
||||
<data name="WrongAccessCode" xml:space="preserve">
|
||||
<value>Invalid access code.</value>
|
||||
</data>
|
||||
|
||||
@@ -5,7 +5,7 @@ using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
|
||||
using DigitalData.UserManager.Application;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Common;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -14,7 +14,7 @@ using static EnvelopeGenerator.Common.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class EnvelopeMailService : EmailOutService, IEnvelopeMailService
|
||||
public class EnvelopeMailService : EmailOutService, IEnvelopeMailService
|
||||
{
|
||||
private readonly IEmailTemplateService _tempService;
|
||||
private readonly IEnvelopeReceiverService _envRcvService;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using DigitalData.Core.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
@@ -33,12 +33,6 @@ namespace EnvelopeGenerator.Application.Services
|
||||
return Result.Success(_mapper.MapOrThrow<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
|
||||
}
|
||||
|
||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadSecretByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true)
|
||||
{
|
||||
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
||||
return Result.Success(_mapper.MapOrThrow<IEnumerable<EnvelopeReceiverSecretDto>>(env_rcvs));
|
||||
}
|
||||
|
||||
public async Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true)
|
||||
{
|
||||
var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
||||
@@ -128,11 +122,5 @@ namespace EnvelopeGenerator.Application.Services
|
||||
var dto_list = _mapper.MapOrThrow<IEnumerable<EnvelopeReceiverDto>>(er_list);
|
||||
return Result.Success(dto_list);
|
||||
}
|
||||
|
||||
public async Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail)
|
||||
{
|
||||
var er = await _repository.ReadLastByReceiver(mail);
|
||||
return er is null ? Result.Fail<string?>().Notice(LogLevel.None, Flag.NotFound) : Result.Success(er.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,16 +3,21 @@ using DigitalData.Core.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>, IEnvelopeService
|
||||
{
|
||||
public EnvelopeService(IEnvelopeRepository repository, IMapper mapper)
|
||||
private readonly ILogger _logger;
|
||||
public EnvelopeService(IEnvelopeRepository repository, IMapper mapper, ILogger<EnvelopeService> logger)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false)
|
||||
@@ -32,12 +37,5 @@ namespace EnvelopeGenerator.Application.Services
|
||||
var readDto = _mapper.MapOrThrow<EnvelopeDto>(envelope);
|
||||
return Result.Success(readDto);
|
||||
}
|
||||
|
||||
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
|
||||
{
|
||||
var users = await _repository.ReadByUserAsync(userId: userId, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
||||
var readDto = _mapper.MapOrThrow<IEnumerable<EnvelopeDto>>(users);
|
||||
return Result.Success(readDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,19 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using DigitalData.Core.DTO;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDto, EnvelopeType, int>, IEnvelopeTypeService
|
||||
{
|
||||
private static readonly Guid CacheKey = Guid.NewGuid();
|
||||
|
||||
private readonly IMemoryCache _cache;
|
||||
|
||||
public EnvelopeTypeService(IEnvelopeTypeRepository repository, IMapper mapper, IMemoryCache cache)
|
||||
public EnvelopeTypeService(IEnvelopeTypeRepository repository, IMapper mapper)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
_cache = cache;
|
||||
}
|
||||
|
||||
public override async Task<DataResult<IEnumerable<EnvelopeTypeDto>>> ReadAllAsync()
|
||||
=> await _cache.GetOrCreateAsync(CacheKey, async entry => await base.ReadAllAsync())
|
||||
?? Result.Fail<IEnumerable<EnvelopeTypeDto>>().Notice(LogLevel.Error, Flag.NotFound, "No cached envelope types are available in the database. If you have added any envelope types after the server started, please restart the server.");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,6 @@
|
||||
MessageCompletionSent = 3005
|
||||
End Enum
|
||||
|
||||
'TODO: standardize in xwiki
|
||||
Public Enum ReferenceType
|
||||
Receiver
|
||||
Sender
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
|
||||
[Required]
|
||||
[Column("USER_REFERENCE", TypeName = "nvarchar(128)")]
|
||||
public required string UserReference { get; init; }
|
||||
public string UserReference { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("STATUS")]
|
||||
@@ -43,17 +43,11 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
public virtual Receiver? Receiver { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public ReferenceType ReferenceType => (Status / 1000) switch
|
||||
public ReferenceType ReferenceType => (Status / 3) switch
|
||||
{
|
||||
1 => ReferenceType.Sender,
|
||||
2 or 3 => ReferenceType.Receiver,
|
||||
_ => ReferenceType.Unknown,
|
||||
};
|
||||
|
||||
[NotMapped]
|
||||
public string? StatusName
|
||||
=> (Enum.IsDefined(typeof(EnvelopeStatus), Status))
|
||||
? Enum.GetName(typeof(EnvelopeStatus), Status)
|
||||
: null;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,45 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
|
||||
public class EnvelopeReceiver : EnvelopeReceiverBase
|
||||
public class EnvelopeReceiver
|
||||
{
|
||||
[Key]
|
||||
[Column("ENVELOPE_ID")]
|
||||
public int EnvelopeId { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column("RECEIVER_ID")]
|
||||
public int ReceiverId { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("SEQUENCE")]
|
||||
public int Sequence { get; set; }
|
||||
|
||||
[Column("NAME", TypeName = "nvarchar(128)")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[Column("JOB_TITLE", TypeName = "nvarchar(128)")]
|
||||
public string? JobTitle { get; set; }
|
||||
|
||||
[Column("COMPANY_NAME", TypeName = "nvarchar(128)")]
|
||||
public string? CompanyName { get; set; }
|
||||
|
||||
[Column("PRIVATE_MESSAGE", TypeName = "nvarchar(max)")]
|
||||
public string? PrivateMessage { get; set; }
|
||||
|
||||
[Column("ACCESS_CODE", TypeName = "nvarchar(64)")]
|
||||
public string? AccessCode { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
|
||||
[ForeignKey("EnvelopeId")]
|
||||
public Envelope? Envelope { get; set; }
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
[Table("TBSIG_ENVELOPE_RECEIVER", Schema = "dbo")]
|
||||
public class EnvelopeReceiverBase
|
||||
{
|
||||
[Key]
|
||||
[Column("ENVELOPE_ID")]
|
||||
public int EnvelopeId { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column("RECEIVER_ID")]
|
||||
public int ReceiverId { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("SEQUENCE")]
|
||||
public int Sequence { get; set; }
|
||||
|
||||
[Column("NAME", TypeName = "nvarchar(128)")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[Column("JOB_TITLE", TypeName = "nvarchar(128)")]
|
||||
public string? JobTitle { get; set; }
|
||||
|
||||
[Column("COMPANY_NAME", TypeName = "nvarchar(128)")]
|
||||
public string? CompanyName { get; set; }
|
||||
|
||||
[Column("PRIVATE_MESSAGE", TypeName = "nvarchar(max)")]
|
||||
public string? PrivateMessage { get; set; }
|
||||
|
||||
[Column("ACCESS_CODE", TypeName = "nvarchar(64)")]
|
||||
public string? AccessCode { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,5 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Required]
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
public IEnumerable<EnvelopeReceiver>? EnvelopeReceivers { get; init; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ApplicationConfig, APP_INITIALIZER } from '@angular/core';
|
||||
import { ApplicationConfig } from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { routes } from './app.routes';
|
||||
import { provideClientHydration } from '@angular/platform-browser';
|
||||
@@ -8,7 +8,6 @@ import { UrlService } from './services/url.service';
|
||||
import { API_URL } from './tokens/index'
|
||||
import { HTTP_INTERCEPTORS, provideHttpClient, withFetch } from '@angular/common/http';
|
||||
import { HttpRequestInterceptor } from './http.interceptor';
|
||||
import { ConfigurationService } from './services/configuration.service';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
@@ -30,12 +29,6 @@ export const appConfig: ApplicationConfig = {
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: HttpRequestInterceptor,
|
||||
multi: true
|
||||
},
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: (configService: ConfigurationService) => async () => await configService.ngOnInit(),
|
||||
deps: [ConfigurationService],
|
||||
multi: true
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,48 @@
|
||||
<table #table mat-table [dataSource]="data" class="mat-elevation-z8">
|
||||
|
||||
@for (colId of displayedColumns; track colId) {
|
||||
<ng-container matColumnDef="{{colId}}">
|
||||
<th mat-header-cell *matHeaderCellDef> {{schema[colId].header}} </th>
|
||||
<td mat-cell *matCellDef="let element"> {{schema[colId].field(element)}} </td>
|
||||
</ng-container>
|
||||
}
|
||||
|
||||
<ng-container matColumnDef="expand">
|
||||
<th mat-header-cell *matHeaderCellDef aria-label="row actions"> </th>
|
||||
<td mat-cell *matCellDef="let element">
|
||||
<button mat-icon-button aria-label="expand row"
|
||||
(click)="(expandedElement = expandedElement === element ? null : element); $event.stopPropagation()">
|
||||
@if (expandedElement === element) {
|
||||
<mat-icon>keyboard_arrow_up</mat-icon>
|
||||
} @else {
|
||||
<mat-icon>keyboard_arrow_down</mat-icon>
|
||||
}
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Expanded Content Column - The detail row is made up of this one column that spans across all columns -->
|
||||
<ng-container matColumnDef="expandedDetail">
|
||||
<td mat-cell *matCellDef="let element" [attr.colspan]="columnsToDisplayWithExpand.length">
|
||||
<div class="example-element-detail" [@detailExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
|
||||
<div class="example-element-diagram">
|
||||
<div class="example-element-position"> {{"element.position"}} </div>
|
||||
<div class="example-element-symbol"> {{"element.symbol"}} </div>
|
||||
<div class="example-element-name"> {{"element.name"}} </div>
|
||||
<div class="example-element-weight"> {{"element.weight"}} </div>
|
||||
</div>
|
||||
<div class="example-element-description">
|
||||
{{"element.description"}}
|
||||
<span class="example-element-description-attribution"> -- Wikipedia </span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="columnsToDisplayWithExpand"></tr>
|
||||
<tr mat-row *matRowDef="let element; columns: columnsToDisplayWithExpand;" class="example-element-row"
|
||||
[class.example-expanded-row]="expandedElement === element"
|
||||
(click)="expandedElement = expandedElement === element ? null : element">
|
||||
</tr>
|
||||
<!--<tr mat-row *matRowDef="let row; columns: ['expandedDetail']; when: isExpandedRow" class="example-detail-row"></tr>-->
|
||||
</table>
|
||||
@@ -0,0 +1,31 @@
|
||||
.example-element-row td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
.example-element-detail {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.example-element-diagram {
|
||||
min-width: 80px;
|
||||
border: 2px solid black;
|
||||
padding: 8px;
|
||||
font-weight: lighter;
|
||||
margin: 8px 0;
|
||||
height: 104px;
|
||||
}
|
||||
|
||||
.example-element-symbol {
|
||||
font-weight: bold;
|
||||
font-size: 40px;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.example-element-description {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.example-element-description-attribution {
|
||||
opacity: 0.5;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import { Component, Input, ViewChild } from '@angular/core';
|
||||
import { EnvelopeReceiverService } from '../../services/envelope-receiver.service';
|
||||
import { MatTable, MatTableModule } from '@angular/material/table';
|
||||
import { CommonModule } from '@angular/common'
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
||||
|
||||
@Component({
|
||||
selector: 'app-envelope-table',
|
||||
standalone: true,
|
||||
imports: [MatTableModule, CommonModule, MatTableModule, MatButtonModule, MatIconModule],
|
||||
templateUrl: './envelope-table.component.html',
|
||||
animations: [
|
||||
trigger('detailExpand', [
|
||||
state('collapsed,void', style({ height: '0px', minHeight: '0' })),
|
||||
state('expanded', style({ height: '*' })),
|
||||
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
|
||||
]),
|
||||
],
|
||||
styleUrl: './envelope-table.component.scss'
|
||||
})
|
||||
export class EnvelopeTableComponent {
|
||||
|
||||
@Input() data: Array<any> = []
|
||||
|
||||
@Input() options?: { min_status?: number; max_status?: number; ignore_status?: number[] }
|
||||
|
||||
@Input() displayedColumns: string[] = ['title', 'status', 'type', 'privateMessage', 'addedWhen'];
|
||||
|
||||
@Input() schema: Record<string, { header: string; field: (element: any) => any; }> = {
|
||||
'title': {
|
||||
header: 'Title',
|
||||
field: (element: any) => element.envelope.title
|
||||
},
|
||||
'status': {
|
||||
header: 'Status',
|
||||
field: (element: any) => element.envelope.statusName
|
||||
},
|
||||
'type': {
|
||||
header: 'Type',
|
||||
field: (element: any) => element.envelope.contractType
|
||||
},
|
||||
'privateMessage': {
|
||||
header: 'Private Message',
|
||||
field: (element: any) => element.privateMessage
|
||||
},
|
||||
'addedWhen': {
|
||||
header: 'Added When',
|
||||
field: (element: any) => element.addedWhen
|
||||
},
|
||||
}
|
||||
|
||||
columnsToDisplayWithExpand = [...this.displayedColumns, 'expand'];
|
||||
|
||||
expandedElement: any | null;
|
||||
|
||||
@ViewChild(MatTable) table!: MatTable<any>;
|
||||
|
||||
constructor(private erService: EnvelopeReceiverService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
if (this.data.length === 0)
|
||||
this.data = await this.erService.getEnvelopeReceiverAsync(this.options);
|
||||
}
|
||||
|
||||
public updateTable() {
|
||||
this.table.renderRows();
|
||||
}
|
||||
|
||||
isExpandedRow(index: number, row: any): boolean {
|
||||
return (row?.envelopeId === this.expandedElement?.envelopeId) && (row?.receiverId === this.expandedElement?.receiverId);
|
||||
}
|
||||
}
|
||||
@@ -37,19 +37,19 @@ export class ReceiverInputComponent implements OnInit, OnChanges {
|
||||
private setupFiltering(): void {
|
||||
this.filteredOptions = this.control.valueChanges.pipe(
|
||||
startWith(''),
|
||||
map(value => this.filter(value || '', this.options, this.index)),
|
||||
map(value => this.filter(value || '', this.options)),
|
||||
);
|
||||
}
|
||||
|
||||
control = new FormControl('');
|
||||
filteredOptions!: Observable<string[]>;
|
||||
|
||||
|
||||
@Input() options: string[] = [];
|
||||
@Input() filter: (value: string, options: string[], index?: number) => string[] = value => {
|
||||
@Input() filter: (value: string, options: string[]) => string[] = value => {
|
||||
const filterValue = value.toLowerCase();
|
||||
return this.options.filter(option => option.toLowerCase().includes(filterValue));
|
||||
}
|
||||
@Input() index?: number;
|
||||
|
||||
public get text(): string {
|
||||
return this.control.value || '';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<table mat-table [dataSource]="receiverData" class="mat-elevation-z8">
|
||||
<ng-container matColumnDef="email">
|
||||
<th mat-header-cell *matHeaderCellDef> Email </th>
|
||||
<td mat-cell *matCellDef="let element; let i = index">
|
||||
<td mat-cell *matCellDef="let element">
|
||||
<receiver-input [options]="receiver_mails" [filter]="receiver_filter"></receiver-input>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { Component, OnInit, QueryList, ViewChildren } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { Component, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule, FormControl } from '@angular/forms';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { ReceiverService } from '../../../services/receiver.service'
|
||||
import { ReceiverInputComponent } from '../../receiver-input/receiver-input.component';
|
||||
import { ReceiverService } from '../../services/receiver.service'
|
||||
import { ReceiverInputComponent } from '../receiver-input/receiver-input.component';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { ClearableInputComponent } from '../../clearable-input/clearable-input.component'
|
||||
import { ClearableInputComponent } from '../clearable-input/clearable-input.component'
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
@Component({
|
||||
@@ -34,41 +34,24 @@ export class ReceiverTableComponent implements OnInit {
|
||||
constructor(private receiverService: ReceiverService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
const receivers = await this.receiverService.getReceiverAsync();
|
||||
this.receiver_mails = receivers.map((r: any) => r.emailAddress);
|
||||
this.last_used_name = receivers.reduce((acc: any, r: any) => {
|
||||
acc[r.emailAddress] = r.lastUsedName;
|
||||
return acc;
|
||||
}, {} as { [key: string]: string | null });
|
||||
this.receiver_mails = await this.receiverService.getReceiverAsync().then((receivers: any[]) => receivers.map(r => r.emailAddress));
|
||||
}
|
||||
|
||||
receiver_filter: (value: string, options: string[], index?: number) => string[] = (value, options, index) => {
|
||||
receiver_filter: (value: string, options: string[]) => string[] = (value, options) => {
|
||||
const filterValue = value.toLowerCase();
|
||||
|
||||
// set the name if it is used before
|
||||
const name = this.last_used_name[value];
|
||||
|
||||
if (name && index != null && index != undefined) {
|
||||
this.receiverData.at(index)!.name = name
|
||||
}
|
||||
|
||||
// !!! do not allow email duplication !!!
|
||||
var similarMails = this.receiver_mails.filter(m => m.toLocaleLowerCase() === value.toLocaleLowerCase() && m !== value)
|
||||
if (similarMails.length > 0 && index != undefined) {
|
||||
this.receiverInputs[index].text = similarMails[0];
|
||||
}
|
||||
|
||||
// if added into last row
|
||||
if (value.length > 0 && (this.receiverInputs.at(-1)?.lenght ?? 0) > 0) {
|
||||
this.receiverData.at(-1)!.accessCode = generateAccessCode();
|
||||
this.receiverData.push({ email: "", name: "", accessCode: "" });
|
||||
this.update();
|
||||
}
|
||||
// delete the row with out mail
|
||||
else if (value.length === 0 && this.receiverInputs.length - 1 !== index) {
|
||||
if (this.receiverInputs.length > 1 && this.receiverInputs[index!]?.lenght === 0) {
|
||||
this.receiverData.splice(index!, 1);
|
||||
this.update();
|
||||
else if (value.length == 0) {
|
||||
for (var i = 0; i < this.receiverInputs.length - 1; i++) {
|
||||
if (this.receiverInputs[i].lenght === 0) {
|
||||
this.receiverData.splice(i, 1);
|
||||
this.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +59,6 @@ export class ReceiverTableComponent implements OnInit {
|
||||
}
|
||||
|
||||
receiver_mails: string[] = [];
|
||||
last_used_name: { [key: string]: string | null } = {};
|
||||
|
||||
@ViewChildren(ReceiverInputComponent) receiverInputsQueryList!: QueryList<ReceiverInputComponent>;
|
||||
get receiverInputs(): ReceiverInputComponent[] {
|
||||
@@ -1,59 +0,0 @@
|
||||
@if(isFilterable) {
|
||||
<mat-form-field>
|
||||
<mat-label>{{filter.label}}</mat-label>
|
||||
<input matInput (keyup)="applyFilter($event)" [placeholder]="filter.placeholder" #input>
|
||||
</mat-form-field>
|
||||
}
|
||||
|
||||
<table mat-table [dataSource]="dataSource" multiTemplateDataRows class="mat-elevation-z8" matSort>
|
||||
@for (column of __columnsToDisplay; track column) {
|
||||
<ng-container matColumnDef="{{column}}">
|
||||
@if(isSortable) {
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{schema[column].header}} </th>
|
||||
}
|
||||
@else {
|
||||
<th mat-header-cell *matHeaderCellDef> {{schema[column].header}} </th>
|
||||
}
|
||||
<td mat-cell *matCellDef="let element"> {{schema[column].field(element)}} </td>
|
||||
</ng-container>
|
||||
}
|
||||
|
||||
<!-- Expanded Content Column - The detail row is made up of this one column that spans across all columns -->
|
||||
@if(isExpandable) {
|
||||
<ng-container matColumnDef="expand">
|
||||
<th mat-header-cell *matHeaderCellDef aria-label="row actions"> </th>
|
||||
<td mat-cell *matCellDef="let element">
|
||||
<button mat-icon-button aria-label="expand row" (click)="toggleExpandedRow(element, $event)">
|
||||
@if (__expandedElement === element) {
|
||||
<mat-icon>keyboard_arrow_up</mat-icon>
|
||||
} @else {
|
||||
<mat-icon>keyboard_arrow_down</mat-icon>
|
||||
}
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="expandedDetail">
|
||||
<td mat-cell *matCellDef="let element" [attr.colspan]="__columnsToDisplayWithExpand.length">
|
||||
<div class="example-element-detail" [@detailExpand]="element == __expandedElement ? 'expanded' : 'collapsed'">
|
||||
@if(__expandedElement === element){
|
||||
<ng-content select="[expanded]" detailed></ng-content>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</ng-container>
|
||||
}
|
||||
@if(isExpandable) {
|
||||
<tr mat-header-row *matHeaderRowDef="__columnsToDisplayWithExpand"></tr>
|
||||
<tr mat-row *matRowDef="let element; columns: __columnsToDisplayWithExpand;" class="example-element-row"
|
||||
[class.example-expanded-row]="__expandedElement === element" (click)="toggleExpandedRow(element, $event)">
|
||||
</tr>
|
||||
<tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="example-detail-row"></tr>
|
||||
}
|
||||
@else {
|
||||
<tr mat-header-row *matHeaderRowDef="__columnsToDisplay"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: __columnsToDisplay;"></tr>
|
||||
}
|
||||
</table>
|
||||
@if(paginatorSizeOptions && paginatorSizeOptions.length > 0) {
|
||||
<mat-paginator [pageSizeOptions]="paginatorSizeOptions" aria-label="Select page of users"></mat-paginator>
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
tr.example-detail-row {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
tr.example-element-row:not(.example-expanded-row):hover {
|
||||
background: whitesmoke;
|
||||
}
|
||||
|
||||
tr.example-element-row:not(.example-expanded-row):active {
|
||||
background: #efefef;
|
||||
}
|
||||
|
||||
.example-element-row td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
.example-element-detail {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.example-element-diagram {
|
||||
min-width: 80px;
|
||||
border: 2px solid black;
|
||||
padding: 8px;
|
||||
font-weight: lighter;
|
||||
margin: 8px 0;
|
||||
height: 104px;
|
||||
}
|
||||
|
||||
.example-element-symbol {
|
||||
font-weight: bold;
|
||||
font-size: 40px;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.example-element-description {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.example-element-description-attribution {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.mat-mdc-form-field {
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DDTable } from './dd-table.component';
|
||||
|
||||
describe('TableExpandableRowsExampleComponent', () => {
|
||||
let component: DDTable;
|
||||
let fixture: ComponentFixture<DDTable>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [DDTable]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(DDTable);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,103 +0,0 @@
|
||||
import { AfterViewInit, Component, Input, ViewChild, inject } from '@angular/core';
|
||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatTable, MatTableDataSource, MatTableModule } from '@angular/material/table';
|
||||
import { ConfigurationService } from '../../../services/configuration.service';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatSort, MatSortModule } from '@angular/material/sort';
|
||||
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
||||
|
||||
/**
|
||||
* @title Table with expandable rows
|
||||
*/
|
||||
@Component({
|
||||
selector: 'dd-table',
|
||||
styleUrl: 'dd-table.component.scss',
|
||||
templateUrl: 'dd-table.component.html',
|
||||
animations: [
|
||||
trigger('detailExpand', [
|
||||
state('collapsed,void', style({ height: '0px', minHeight: '0' })),
|
||||
state('expanded', style({ height: '*' })),
|
||||
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
|
||||
]),
|
||||
],
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatTableModule,
|
||||
MatButtonModule,
|
||||
MatIconModule,
|
||||
MatFormFieldModule,
|
||||
MatInputModule,
|
||||
MatTableModule,
|
||||
MatSort,
|
||||
MatSortModule,
|
||||
MatPaginator,
|
||||
MatPaginatorModule
|
||||
],
|
||||
})
|
||||
export class DDTable implements AfterViewInit {
|
||||
public readonly dataSource: any = new MatTableDataSource();
|
||||
@Input() public set columnsToDisplay(value: string[]) {
|
||||
this.__columnsToDisplay = value;
|
||||
this.__columnsToDisplayWithExpand = [...value, 'expand'];
|
||||
}
|
||||
@Input() public set data(value: any[]) {
|
||||
this.dataSource.data = value;
|
||||
}
|
||||
@Input() schema: Record<string, { header: string; field: (element: any) => any; }> = {}
|
||||
|
||||
@Input() paginatorSizeOptions?: number[];
|
||||
|
||||
@Input() filter: { label: string, placeholder: string } = { label: '', placeholder: '' }
|
||||
|
||||
@Input() isFilterable: boolean = false;
|
||||
|
||||
@Input() isExpandable: boolean = false;
|
||||
|
||||
@Input() isSortable: boolean = false;
|
||||
|
||||
@Input() onToggleExpandedRow: (element: any, event: Event) => Promise<void> = async (element: any, event: Event) => { }
|
||||
|
||||
public get data(): any[] {
|
||||
return this.dataSource.data;
|
||||
}
|
||||
__columnsToDisplay: string[] = [];
|
||||
__columnsToDisplayWithExpand: string[] = [];
|
||||
__expandedElement!: any;
|
||||
|
||||
config: ConfigurationService = inject(ConfigurationService);
|
||||
|
||||
@ViewChild(MatSort) sort!: MatSort;
|
||||
@ViewChild(MatPaginator) paginator!: MatPaginator;
|
||||
@ViewChild(MatTable) table!: MatTable<any>;
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
if (this.isSortable)
|
||||
this.dataSource.sort = this.sort;
|
||||
if (this.paginatorSizeOptions && this.paginatorSizeOptions.length > 0)
|
||||
this.dataSource.paginator = this.paginator;
|
||||
}
|
||||
|
||||
applyFilter(event: Event) {
|
||||
const filterValue = (event.target as HTMLInputElement).value;
|
||||
this.dataSource.filter = filterValue.trim().toLowerCase();
|
||||
}
|
||||
|
||||
update() {
|
||||
this.table.renderRows();
|
||||
}
|
||||
|
||||
async toggleExpandedRow(element: any, event: Event): Promise<void> {
|
||||
// first determine the new expanded element, thus it would be possible to use up-to-date
|
||||
const newExpandedElement = this.__expandedElement === element ? null : element;
|
||||
|
||||
// before update the expanded element call the call-back method to show up-to-date component
|
||||
await this.onToggleExpandedRow(newExpandedElement, event);
|
||||
|
||||
// assign expanded element
|
||||
this.__expandedElement = newExpandedElement;
|
||||
event.stopPropagation();
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<dd-table [data]="data" [columnsToDisplay]="displayedColumns" [schema]="schema"
|
||||
[paginatorSizeOptions]="[5, 10, 25, 100]" [filter]="{label: 'Filter', placeholder: ''}"
|
||||
[onToggleExpandedRow]="onToggleExpandedRow" [isSortable]="true" [isExpandable]="true" [isFilterable]="true">
|
||||
<mat-tab-group expanded>
|
||||
<mat-tab label="Emfänger">
|
||||
<receiver-status-table></receiver-status-table>
|
||||
</mat-tab>
|
||||
<mat-tab label="History">
|
||||
<history-table></history-table>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
</dd-table>
|
||||
@@ -1,59 +0,0 @@
|
||||
/* Structure */
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mat-mdc-form-field {
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* For expanding table */
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
tr.example-detail-row {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
tr.example-element-row:not(.example-expanded-row):hover {
|
||||
background: whitesmoke;
|
||||
}
|
||||
|
||||
tr.example-element-row:not(.example-expanded-row):active {
|
||||
background: #efefef;
|
||||
}
|
||||
|
||||
.example-element-row td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
.example-element-detail {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.example-element-diagram {
|
||||
min-width: 80px;
|
||||
border: 2px solid black;
|
||||
padding: 8px;
|
||||
font-weight: lighter;
|
||||
margin: 8px 0;
|
||||
height: 104px;
|
||||
}
|
||||
|
||||
.example-element-symbol {
|
||||
font-weight: bold;
|
||||
font-size: 40px;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.example-element-description {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.example-element-description-attribution {
|
||||
opacity: 0.5;
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
import { AfterViewInit, Component, Input, ViewChild, inject, viewChild } from '@angular/core';
|
||||
import { EnvelopeService } from '../../../services/envelope.service';
|
||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
||||
import { ConfigurationService } from '../../../services/configuration.service';
|
||||
import { DDTable } from "../dd-table/dd-table.component";
|
||||
import { ClearableInputComponent } from '../../clearable-input/clearable-input.component'
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { ReceiverStatusTableComponent } from "../receiver-status-table/receiver-status-table.component";
|
||||
import { HistoryTableComponent } from "../history-table/history-table.component";
|
||||
import { EnvelopeReceiverService } from '../../../services/envelope-receiver.service';
|
||||
import { HistoryService } from '../../../services/history.service';
|
||||
|
||||
@Component({
|
||||
selector: 'envelope-table',
|
||||
standalone: true,
|
||||
imports: [DDTable, ClearableInputComponent, MatTabsModule, ReceiverStatusTableComponent, HistoryTableComponent],
|
||||
templateUrl: './envelope-table.component.html',
|
||||
animations: [
|
||||
trigger('detailExpand', [
|
||||
state('collapsed,void', style({ height: '0px', minHeight: '0' })),
|
||||
state('expanded', style({ height: '*' })),
|
||||
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
|
||||
]),
|
||||
],
|
||||
styleUrl: './envelope-table.component.scss'
|
||||
})
|
||||
export class EnvelopeTableComponent implements AfterViewInit {
|
||||
|
||||
@Input() options?: { min_status?: number; max_status?: number; ignore_status?: number[] }
|
||||
|
||||
displayedColumns: string[] = ['title', 'status', 'type', 'addedWhen'];
|
||||
|
||||
schema: Record<string, { header: string; field: (element: any) => any; }> = {
|
||||
'title': {
|
||||
header: 'Title',
|
||||
field: (element: any) => element.title
|
||||
},
|
||||
'status': {
|
||||
header: 'Status',
|
||||
field: (element: any) => element.statusName
|
||||
},
|
||||
'type': {
|
||||
header: 'Type',
|
||||
field: (element: any) => this.config.envelopeTypeTitles[element.contractType - 1]
|
||||
},
|
||||
'addedWhen': {
|
||||
header: 'Added When',
|
||||
field: (element: any) => element.addedWhen
|
||||
}
|
||||
}
|
||||
|
||||
data: any[] = [];
|
||||
|
||||
@ViewChild(ReceiverStatusTableComponent) rsTable!: ReceiverStatusTableComponent
|
||||
|
||||
@ViewChild(HistoryTableComponent) histTable!: HistoryTableComponent
|
||||
|
||||
onToggleExpandedRow: (envelope: any, event: Event) => Promise<void> = async (envelope, event) => {
|
||||
if (envelope === null || envelope === undefined)
|
||||
return;
|
||||
|
||||
var uuid: string = envelope.uuid;
|
||||
this.rsTable.data = await this.erService.getSecretAsync(uuid);
|
||||
|
||||
var id: number = envelope.id;
|
||||
var refType: number = this.config.referenceType.receiver;
|
||||
const histories = await this.histService.getHistoryAsync({ envelopeId: id, referenceType: refType, withReceiver: true })
|
||||
this.histTable.data = histories;
|
||||
}
|
||||
|
||||
private eService: EnvelopeService = inject(EnvelopeService);
|
||||
|
||||
private config: ConfigurationService = inject(ConfigurationService);
|
||||
|
||||
private readonly erService: EnvelopeReceiverService = inject(EnvelopeReceiverService);
|
||||
|
||||
private readonly histService: HistoryService = inject(HistoryService);
|
||||
|
||||
async ngAfterViewInit() {
|
||||
this.data = await this.eService.getEnvelopeAsync(this.options);
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<dd-table [data]="data" [columnsToDisplay]="columnsToDisplay" [schema]="schema" [isSortable]="true"></dd-table>
|
||||
@@ -1,23 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HistoryTableComponent } from './history-table.component';
|
||||
|
||||
describe('HistoryTableComponent', () => {
|
||||
let component: HistoryTableComponent;
|
||||
let fixture: ComponentFixture<HistoryTableComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [HistoryTableComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(HistoryTableComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,30 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { DDTable } from '../dd-table/dd-table.component'
|
||||
|
||||
@Component({
|
||||
selector: 'history-table',
|
||||
standalone: true,
|
||||
imports: [DDTable],
|
||||
templateUrl: './history-table.component.html',
|
||||
styleUrl: './history-table.component.scss'
|
||||
})
|
||||
export class HistoryTableComponent {
|
||||
data: any[] = [];
|
||||
|
||||
schema: Record<string, { header: string; field: (element: any) => any; }> = {
|
||||
"status": {
|
||||
"header": "Status",
|
||||
"field": hist => hist.statusName
|
||||
},
|
||||
"user": {
|
||||
"header": "Benutzer",
|
||||
"field": hist => hist.userReference
|
||||
},
|
||||
"date": {
|
||||
"header": "Datum",
|
||||
"field": hist => hist.actionDate
|
||||
}
|
||||
}
|
||||
|
||||
columnsToDisplay: string[] = ["status", "user", "date"];
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<dd-table [data]="data" [columnsToDisplay]="columnsToDisplay" [schema]="schema" [isSortable]="true"></dd-table>
|
||||
@@ -1,23 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ReceiverStatusTableComponent } from './receiver-status-table.component';
|
||||
|
||||
describe('ReceiverStatusTableComponent', () => {
|
||||
let component: ReceiverStatusTableComponent;
|
||||
let fixture: ComponentFixture<ReceiverStatusTableComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ReceiverStatusTableComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ReceiverStatusTableComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,30 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { DDTable } from '../dd-table/dd-table.component'
|
||||
|
||||
@Component({
|
||||
selector: 'receiver-status-table',
|
||||
standalone: true,
|
||||
imports: [DDTable],
|
||||
templateUrl: './receiver-status-table.component.html',
|
||||
styleUrl: './receiver-status-table.component.scss'
|
||||
})
|
||||
export class ReceiverStatusTableComponent {
|
||||
data: any[] = [];
|
||||
|
||||
schema: Record<string, { header: string; field: (element: any) => any; }> = {
|
||||
"name": {
|
||||
"header": "Email Anrede",
|
||||
"field": (er) => er.name
|
||||
},
|
||||
"email": {
|
||||
"header": "Email",
|
||||
"field": (er) => er.receiver.emailAddress
|
||||
},
|
||||
"access_code": {
|
||||
"header": "Email",
|
||||
"field": (er) => er.accessCode
|
||||
},
|
||||
}
|
||||
|
||||
columnsToDisplay: string[] = ["name", "email", "access_code"];
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<table mat-table [dataSource]="receiverData" class="mat-elevation-z8">
|
||||
<ng-container matColumnDef="email">
|
||||
<th mat-header-cell *matHeaderCellDef> Email </th>
|
||||
<td mat-cell *matCellDef="let element; let i = index">
|
||||
<receiver-input [options]="receiver_mails" [filter]="receiver_filter" [index]="i"></receiver-input>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef> Anrede Email </th>
|
||||
<td mat-cell *matCellDef="let element">
|
||||
<clearable-input [label]="'Anrede Email'" [value]="element.name"></clearable-input>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="accessCode">
|
||||
<th mat-header-cell *matHeaderCellDef> Zugriffscode </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.accessCode}} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
@@ -5,7 +5,7 @@ import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatStepperModule } from '@angular/material/stepper';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { ReceiverTableComponent } from "../../components/tables/receiver-table/receiver-table.component";
|
||||
import { ReceiverTableComponent } from "../../components/receiver-table/receiver-table.component";
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div id="table">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Offene Umschläge">
|
||||
<envelope-table [options]="{max_status: Status.EnvelopePartlySigned}"></envelope-table>
|
||||
<app-envelope-table [options]="{max_status: Status.EnvelopePartlySigned}"></app-envelope-table>
|
||||
</mat-tab>
|
||||
<mat-tab label="Abgeschlossene Umschläge">
|
||||
<envelope-table [options]="{min_status: Status.EnvelopeCompletelySigned, ignore_status: [Status.EnvelopeDeleted]}"></envelope-table>
|
||||
<app-envelope-table [options]="{min_status: Status.EnvelopeCompletelySigned, ignore_status: [Status.EnvelopeDeleted]}"></app-envelope-table>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { EnvelopeTableComponent } from "../../components/tables/envelope-table/envelope-table.component";
|
||||
import { EnvelopeTableComponent } from "../../components/envelope-table/envelope-table.component";
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { LocalizationService } from '../../services/localization.service';
|
||||
import { Status } from '../../enums/envelope-const'
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ConfigurationService } from './configuration.service';
|
||||
|
||||
describe('ConfigurationService', () => {
|
||||
let service: ConfigurationService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ConfigurationService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,47 +0,0 @@
|
||||
import { Injectable, OnInit, inject } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Observable, firstValueFrom } from 'rxjs';
|
||||
import { API_URL } from '../tokens/index';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ConfigurationService implements OnInit {
|
||||
|
||||
protected url: string;
|
||||
|
||||
private _envelopeTypes! : any[];
|
||||
|
||||
private _envelopeTypeTitles! : any[];
|
||||
|
||||
private _referenceType!: any;
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
const api_url = inject(API_URL);
|
||||
this.url = `${api_url}`;
|
||||
}
|
||||
|
||||
async ngOnInit(): Promise<void> {
|
||||
const envelopeTypes$: Observable<any[]> = this.http.get<any[]>(`${this.url}/EnvelopeType`)
|
||||
envelopeTypes$.subscribe({next: res => {
|
||||
this._envelopeTypes = res;
|
||||
this._envelopeTypeTitles = res.map(e => e.title);
|
||||
}});
|
||||
|
||||
this.http.get<any>(`${this.url}/History/reference-type`).subscribe({
|
||||
next: res => this._referenceType = res
|
||||
})
|
||||
}
|
||||
|
||||
public get envelopeTypes() {
|
||||
return this._envelopeTypes;
|
||||
}
|
||||
|
||||
public get envelopeTypeTitles() {
|
||||
return this._envelopeTypeTitles;
|
||||
}
|
||||
|
||||
public get referenceType() {
|
||||
return this._referenceType;
|
||||
}
|
||||
}
|
||||
@@ -27,18 +27,8 @@ export class EnvelopeReceiverService {
|
||||
return this.http.get<any>(this.url, { params });
|
||||
}
|
||||
|
||||
|
||||
getEnvelopeReceiverAsync(options?: { min_status?: number; max_status?: number; ignore_status?: number[] }): Promise<any> {
|
||||
return firstValueFrom(this.getEnvelopeReceiver(options));
|
||||
}
|
||||
|
||||
getSecret(uuid: string): Observable<any> {
|
||||
let params = new HttpParams();
|
||||
params = params.set('uuid', uuid);
|
||||
|
||||
return this.http.get<any>(`${this.url}/secret`, { params });
|
||||
}
|
||||
|
||||
getSecretAsync(uuid: string): Promise<any> {
|
||||
return firstValueFrom(this.getSecret(uuid));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EnvelopeService } from './envelope.service';
|
||||
|
||||
describe('EnvelopeService', () => {
|
||||
let service: EnvelopeService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(EnvelopeService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,33 +0,0 @@
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Observable, firstValueFrom } from 'rxjs';
|
||||
import { API_URL } from '../tokens/index';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class EnvelopeService {
|
||||
protected url: string;
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
const api_url = inject(API_URL);
|
||||
this.url = `${api_url}/envelope`;
|
||||
}
|
||||
|
||||
public getEnvelope(options?: { min_status?: number; max_status?: number; ignore_status?: number[] }): Observable<any> {
|
||||
let params = new HttpParams();
|
||||
if (options) {
|
||||
if (options.min_status)
|
||||
params = params.set('min_status', options.min_status.toString());
|
||||
if (options.max_status)
|
||||
params = params.set('max_status', options.max_status.toString());
|
||||
if (options.ignore_status)
|
||||
params = params.set('ignore_status', options.ignore_status.join(','));
|
||||
}
|
||||
return this.http.get(this.url, { params });
|
||||
}
|
||||
|
||||
public async getEnvelopeAsync(options?: { min_status?: number; max_status?: number; ignore_status?: number[] }): Promise<any> {
|
||||
return await firstValueFrom(this.getEnvelope(options));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HistoryService } from './history.service';
|
||||
|
||||
describe('HistoryService', () => {
|
||||
let service: HistoryService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(HistoryService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,46 +0,0 @@
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Observable, firstValueFrom } from 'rxjs';
|
||||
import { API_URL } from '../tokens/index';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class HistoryService {
|
||||
protected url: string;
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
const api_url = inject(API_URL);
|
||||
this.url = `${api_url}/history`;
|
||||
}
|
||||
|
||||
public getHistory(options?: Options): Observable<any> {
|
||||
let params = new HttpParams();
|
||||
if (options) {
|
||||
if (options.envelopeId)
|
||||
params = params.set('envelopeId', options.envelopeId);
|
||||
if (options.referenceType != null)
|
||||
params = params.set('referenceType', options.referenceType);
|
||||
if (options.userReference)
|
||||
params = params.set('userReference', options.userReference);
|
||||
if (options.withReceiver)
|
||||
params = params.set('withReceiver', options.withReceiver);
|
||||
if (options.withSender)
|
||||
params = params.set('withSender', options.withSender);
|
||||
}
|
||||
return this.http.get(this.url, { params });
|
||||
}
|
||||
|
||||
public async getHistoryAsync(options?: Options): Promise<any> {
|
||||
return firstValueFrom(this.getHistory(options));
|
||||
}
|
||||
}
|
||||
|
||||
class Options {
|
||||
envelopeId?: number;
|
||||
userReference?: string;
|
||||
referenceType: number | null = null;
|
||||
withSender?: boolean;
|
||||
withReceiver?: boolean;
|
||||
}
|
||||
@@ -5,20 +5,20 @@ namespace EnvelopeGenerator.GeneratorAPI.Controllers
|
||||
{
|
||||
public static class ControllerExtensions
|
||||
{
|
||||
public static int? GetId(this ClaimsPrincipal user)
|
||||
=> int.TryParse(user.FindFirst(ClaimTypes.NameIdentifier)?.Value, out int result)
|
||||
public static int? GetId(this ControllerBase controller)
|
||||
=> int.TryParse(controller.User.FindFirst(ClaimTypes.NameIdentifier)?.Value, out int result)
|
||||
? result : null;
|
||||
|
||||
public static string? GetUsername(this ClaimsPrincipal user)
|
||||
=> user.FindFirst(ClaimTypes.Name)?.Value;
|
||||
public static string? GetUsername(this ControllerBase controller)
|
||||
=> controller.User.FindFirst(ClaimTypes.Name)?.Value;
|
||||
|
||||
public static string? GetName(this ClaimsPrincipal user)
|
||||
=> user.FindFirst(ClaimTypes.Surname)?.Value;
|
||||
public static string? GetName(this ControllerBase controller)
|
||||
=> controller.User.FindFirst(ClaimTypes.Surname)?.Value;
|
||||
|
||||
public static string? GetPrename(this ClaimsPrincipal user)
|
||||
=> user.FindFirst(ClaimTypes.GivenName)?.Value;
|
||||
public static string? GetPrename(this ControllerBase controller)
|
||||
=> controller.User.FindFirst(ClaimTypes.GivenName)?.Value;
|
||||
|
||||
public static string? GetEmail(this ClaimsPrincipal user)
|
||||
=> user.FindFirst(ClaimTypes.Email)?.Value;
|
||||
public static string? GetEmail(this ControllerBase controller)
|
||||
=> controller.User.FindFirst(ClaimTypes.Email)?.Value;
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.GeneratorAPI.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
[Authorize]
|
||||
public class EnvelopeController : ControllerBase
|
||||
{
|
||||
private readonly ILogger<EnvelopeController> _logger;
|
||||
private readonly IEnvelopeService _envelopeService;
|
||||
|
||||
public EnvelopeController(ILogger<EnvelopeController> logger, IEnvelopeService envelopeService)
|
||||
{
|
||||
_logger = logger;
|
||||
_envelopeService = envelopeService;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetCurrentAsync(
|
||||
[FromQuery] int? min_status = null,
|
||||
[FromQuery] int? max_status = null,
|
||||
[FromQuery] params int[] ignore_statuses)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (User.GetId() is int intId)
|
||||
return await _envelopeService.ReadByUserAsync(intId, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses).ThenAsync(
|
||||
Success: Ok,
|
||||
Fail: IActionResult (msg, ntc) =>
|
||||
{
|
||||
_logger.LogNotice(ntc);
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
});
|
||||
else
|
||||
{
|
||||
_logger.LogError("Despite successful authorization, the 'api/envelope' route encountered an issue: the user ID is not recognized as an integer. This may be due to the removal of the ID during the creation of the claims list.");
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "{Message}", ex.Message);
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,11 @@
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Common.My.Resources;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.GeneratorAPI.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[Authorize]
|
||||
[ApiController]
|
||||
public class EnvelopeReceiverController : ControllerBase
|
||||
{
|
||||
@@ -19,18 +17,19 @@ namespace EnvelopeGenerator.GeneratorAPI.Controllers
|
||||
_logger = logger;
|
||||
_erService = envelopeReceiverService;
|
||||
}
|
||||
|
||||
|
||||
[Authorize]
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetEnvelopeReceiver([FromQuery] int? min_status = null, [FromQuery] int? max_status = null, [FromQuery] int[]? ignore_status = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var username = User.GetUsername();
|
||||
var username = this.GetUsername();
|
||||
|
||||
if (username is null)
|
||||
{
|
||||
_logger.LogError(@"Envelope Receiver dto cannot be sent because username claim is null. Potential authentication and authorization error. The value of other claims are [id: {id}], [username: {username}], [name: {name}], [prename: {prename}], [email: {email}].",
|
||||
User.GetId(), User.GetUsername(), User.GetName(), User.GetPrename(), User.GetEmail());
|
||||
this.GetId(), this.GetUsername(), this.GetName(), this.GetPrename(), this.GetEmail());
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
}
|
||||
|
||||
@@ -50,49 +49,5 @@ namespace EnvelopeGenerator.GeneratorAPI.Controllers
|
||||
return new StatusCodeResult(StatusCodes.Status500InternalServerError);
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet("receiver-name/{mail}")]
|
||||
public async Task<IActionResult> GetReceiverName([FromRoute] string mail)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _erService.ReadLastUsedReceiverNameByMail(mail).ThenAsync(
|
||||
Success: res => res is null ? Ok(string.Empty) : Ok(res),
|
||||
Fail: IActionResult (msg, ntc) =>
|
||||
{
|
||||
if (ntc.HasFlag(Flag.NotFound))
|
||||
return NotFound();
|
||||
|
||||
_logger.LogNotice(ntc);
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
});
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "{message}", ex.Message);
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet("secret")]
|
||||
[Authorize]
|
||||
public async Task<IActionResult> GetSecretAsync([FromQuery] string uuid)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _erService.ReadSecretByUuidAsync(uuid: uuid).ThenAsync(
|
||||
Success: Ok,
|
||||
Fail: IActionResult (msg, ntc) =>
|
||||
{
|
||||
_logger.LogNotice(ntc);
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "{message}", ex.Message);
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Net.Mail;
|
||||
using System.Security.Cryptography.Xml;
|
||||
|
||||
namespace EnvelopeGenerator.GeneratorAPI.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class EnvelopeTypeController : ControllerBase
|
||||
{
|
||||
private readonly ILogger<EnvelopeTypeController> _logger;
|
||||
private readonly IEnvelopeTypeService _service;
|
||||
|
||||
public EnvelopeTypeController(ILogger<EnvelopeTypeController> logger, IEnvelopeTypeService service)
|
||||
{
|
||||
_logger = logger;
|
||||
_service = service;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetAllAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _service.ReadAllAsync().ThenAsync(
|
||||
Success: Ok,
|
||||
Fail: IActionResult (msg, ntc) =>
|
||||
{
|
||||
_logger.LogNotice(ntc);
|
||||
return ntc.HasFlag(Flag.NotFound) ? NotFound() : StatusCode(StatusCodes.Status500InternalServerError);
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "{Message}", ex.Message);
|
||||
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using static EnvelopeGenerator.Common.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.GeneratorAPI.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
[Authorize]
|
||||
public class HistoryController : ControllerBase
|
||||
{
|
||||
private readonly ILogger<HistoryController> _logger;
|
||||
|
||||
private readonly IEnvelopeHistoryService _service;
|
||||
|
||||
public HistoryController(ILogger<HistoryController> logger, IEnvelopeHistoryService service)
|
||||
{
|
||||
_logger = logger;
|
||||
_service = service;
|
||||
}
|
||||
|
||||
[HttpGet("reference-type")]
|
||||
[Authorize]
|
||||
public IActionResult GetReferenceTypes()
|
||||
{
|
||||
// Enum to Key-Value pair
|
||||
var referenceTypes = Enum.GetValues(typeof(ReferenceType))
|
||||
.Cast<ReferenceType>()
|
||||
.ToDictionary(rt =>
|
||||
{
|
||||
var key = rt.ToString();
|
||||
var keyAsCamelCase = char.ToLower(key[0]) + key[1..];
|
||||
return keyAsCamelCase;
|
||||
}, rt => (int)rt);
|
||||
|
||||
return Ok(referenceTypes);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public async Task<IActionResult> GetAllAsync([FromQuery] int? envelopeId = null, [FromQuery] string? userReference = null, [FromQuery] int? referenceType = null, [FromQuery] bool withSender = false, [FromQuery] bool withReceiver = false)
|
||||
{
|
||||
ReferenceType? refTypEnum = null;
|
||||
|
||||
if (referenceType is int refTypInt)
|
||||
if (Enum.IsDefined(typeof(ReferenceType), refTypInt))
|
||||
refTypEnum = (ReferenceType)refTypInt;
|
||||
else
|
||||
throw new ArgumentException($"The provided referenceType '{referenceType}' is not valid. It must correspond to a valid value in the {nameof(ReferenceType)} enum.");
|
||||
|
||||
switch(referenceType)
|
||||
{
|
||||
case (int)ReferenceType.Receiver:
|
||||
withReceiver = true;
|
||||
break;
|
||||
case (int)ReferenceType.Sender:
|
||||
withSender = true;
|
||||
break;
|
||||
}
|
||||
|
||||
var histories = await _service.ReadAsync(
|
||||
envelopeId: envelopeId,
|
||||
userReference: userReference,
|
||||
referenceType: refTypEnum,
|
||||
withSender: withSender,
|
||||
withReceiver: withReceiver);
|
||||
|
||||
return Ok(histories);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,8 @@ namespace EnvelopeGenerator.GeneratorAPI.Controllers
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> Get([FromQuery] string? emailAddress = null, [FromQuery] string? signature = null)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,5 @@ namespace EnvelopeGenerator.Infrastructure.Contracts
|
||||
Task<string?> ReadAccessCodeByIdAsync(int envelopeId, int receiverId);
|
||||
|
||||
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||
|
||||
Task<EnvelopeReceiver?> ReadLastByReceiver(string email);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,5 @@ namespace EnvelopeGenerator.Infrastructure.Contracts
|
||||
Task<IEnumerable<Envelope>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
|
||||
|
||||
Task<Envelope?> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
|
||||
|
||||
Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using DigitalData.Core.Infrastructure;
|
||||
using DigitalData.UserManager.Infrastructure.Repositories;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -13,7 +14,7 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
|
||||
public async Task<IEnumerable<Envelope>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false)
|
||||
{
|
||||
var query = _dbSet.AsNoTracking();
|
||||
var query = _dbSet.AsQueryable();
|
||||
|
||||
if (documents)
|
||||
if (documentReceiverElement)
|
||||
@@ -29,7 +30,7 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
|
||||
public async Task<Envelope?> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false)
|
||||
{
|
||||
var query = _dbSet.AsNoTracking().Where(e => e.Uuid == uuid);
|
||||
var query = _dbSet.Where(e => e.Uuid == uuid);
|
||||
|
||||
if (withAll || withDocuments)
|
||||
if (withAll || withDocumentReceiverElement)
|
||||
@@ -45,21 +46,5 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
|
||||
return await query.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
|
||||
{
|
||||
var query = _dbSet.AsNoTracking().Where(e => e.UserId == userId);
|
||||
|
||||
if (min_status is not null)
|
||||
query = query.Where(e => e.Status >= min_status);
|
||||
|
||||
if (max_status is not null)
|
||||
query = query.Where(e => e.Status <= max_status);
|
||||
|
||||
foreach (var ignore_status in ignore_statuses)
|
||||
query = query.Where(e => e.Status != ignore_status);
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using DigitalData.Core.Infrastructure;
|
||||
using DigitalData.UserManager.Infrastructure.Repositories;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -75,10 +76,5 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
|
||||
return await query.Include(er => er.Envelope).Include(er => er.Receiver).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<EnvelopeReceiver?> ReadLastByReceiver(string email)
|
||||
{
|
||||
return await _dbSet.Where(er => er.Receiver!.EmailAddress == email).OrderBy(er => er.EnvelopeId).LastOrDefaultAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
{
|
||||
}
|
||||
|
||||
protected IQueryable<Receiver> ReadBy(string? emailAddress = null, string? signature = null, bool withLastUsedName = true)
|
||||
protected IQueryable<Receiver> ReadBy(string? emailAddress = null, string? signature = null)
|
||||
{
|
||||
IQueryable<Receiver> query = _dbSet.AsNoTracking();
|
||||
|
||||
@@ -21,17 +21,9 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
if(signature is not null)
|
||||
query = query.Where(r => r.Signature == signature);
|
||||
|
||||
// envelope receivers are ignored (with '[JsonIgnore]' attribute). The reson to add them is to get the las used receiver name
|
||||
if (withLastUsedName)
|
||||
{
|
||||
query = query.Include(r => r.EnvelopeReceivers!.OrderByDescending(er => er.EnvelopeId).Take(1));
|
||||
}
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
public async Task<Receiver?> ReadByAsync(string? emailAddress = null, string? signature = null) => await ReadBy(emailAddress, signature).FirstOrDefaultAsync();
|
||||
|
||||
public async override Task<IEnumerable<Receiver>> ReadAllAsync() => await ReadBy().ToListAsync();
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ using DigitalData.Core.API;
|
||||
using EnvelopeGenerator.Application;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using System.Text.Encodings.Web;
|
||||
using EnvelopeGenerator.Web.Models;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Net;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers.Test
|
||||
{
|
||||
[ApiController]
|
||||
[ApiController]
|
||||
[Route("api/test/[controller]")]
|
||||
public class TestEnvelopeMailController : ControllerBase
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using DigitalData.Core.API;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers.Test
|
||||
{
|
||||
|
||||
@@ -5,9 +5,13 @@
|
||||
ViewData["Title"] = _localizer[WebKey.DocProtected];
|
||||
var userCulture = ViewData["UserCulture"] as Culture;
|
||||
}
|
||||
<div class="page container py-5 px-2">
|
||||
<div class="page container py-4 px-4">
|
||||
<header class="text-center">
|
||||
<div class="icon locked">
|
||||
<div class="header-1 alert alert-secondary" role="alert">
|
||||
<h3 class="text">@_localizer[WebKey.WelcomeToTheESignPortal]</h3>
|
||||
<img class="cursor-logo" src="/img/cursor_logo.png" />
|
||||
</div>
|
||||
<div class="icon locked mt-4 mb-1">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" fill="currentColor" class="bi bi-shield-lock" viewBox="0 0 16 16">
|
||||
<path d="M5.338 1.59a61 61 0 0 0-2.837.856.48.48 0 0 0-.328.39c-.554 4.157.726 7.19 2.253 9.188a10.7 10.7 0 0 0 2.287 2.233c.346.244.652.42.893.533q.18.085.293.118a1 1 0 0 0 .101.025 1 1 0 0 0 .1-.025q.114-.034.294-.118c.24-.113.547-.29.893-.533a10.7 10.7 0 0 0 2.287-2.233c1.527-1.997 2.807-5.031 2.253-9.188a.48.48 0 0 0-.328-.39c-.651-.213-1.75-.56-2.837-.855C9.552 1.29 8.531 1.067 8 1.067c-.53 0-1.552.223-2.662.524zM5.072.56C6.157.265 7.31 0 8 0s1.843.265 2.928.56c1.11.3 2.229.655 2.887.87a1.54 1.54 0 0 1 1.044 1.262c.596 4.477-.787 7.795-2.465 9.99a11.8 11.8 0 0 1-2.517 2.453 7 7 0 0 1-1.048.625c-.28.132-.581.24-.829.24s-.548-.108-.829-.24a7 7 0 0 1-1.048-.625 11.8 11.8 0 0 1-2.517-2.453C1.928 10.487.545 7.169 1.141 2.692A1.54 1.54 0 0 1 2.185 1.43 63 63 0 0 1 5.072.56" />
|
||||
<path d="M9.5 6.5a1.5 1.5 0 0 1-1 1.415l.385 1.99a.5.5 0 0 1-.491.595h-.788a.5.5 0 0 1-.49-.595l.384-1.99a1.5 1.5 0 1 1 2-1.415" />
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
@{
|
||||
var nonce = _accessor.HttpContext?.Items["csp-nonce"] as string;
|
||||
}
|
||||
@ using DigitalData.Core.DTO;
|
||||
@ using EnvelopeGenerator.Application.DTOs;
|
||||
@ using Newtonsoft.Json
|
||||
@ using Newtonsoft.Json.Serialization
|
||||
@using DigitalData.Core.DTO;
|
||||
@using EnvelopeGenerator.Application.DTOs;
|
||||
@using Newtonsoft.Json
|
||||
@using Newtonsoft.Json.Serialization
|
||||
@model EnvelopeReceiverDto;
|
||||
<partial name="_CookieConsentPartial" />
|
||||
@{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
@{
|
||||
var nonce = _accessor.HttpContext?.Items["csp-nonce"] as string;
|
||||
}
|
||||
@ using DigitalData.Core.DTO;
|
||||
@ using EnvelopeGenerator.Application.DTOs;
|
||||
@ using Newtonsoft.Json
|
||||
@ using Newtonsoft.Json.Serialization
|
||||
@using DigitalData.Core.DTO;
|
||||
@using EnvelopeGenerator.Application.DTOs;
|
||||
@using Newtonsoft.Json
|
||||
@using Newtonsoft.Json.Serialization
|
||||
@model EnvelopeReceiverDto;
|
||||
@{
|
||||
ViewData["Title"] = _localizer[WebKey.SignDoc];
|
||||
@@ -21,40 +21,43 @@
|
||||
}
|
||||
<div class="d-flex flex-column min-vh-100">
|
||||
<nav class="navbar navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<div class="container">
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
<span class="material-symbols-outlined">
|
||||
more_vert
|
||||
</span>
|
||||
</button>
|
||||
<div class="navbar-brand me-auto ms-5 envelope-message">@($"{_localizer[WebKey.Hello]} {Model.Name}, {@envelope?.Message}".TrySanitize(_sanitizer))</div>
|
||||
<div class="col-1 p-0 m-0 me-3 d-flex">
|
||||
<img src="~/img/digital_data.svg" alt="...">
|
||||
<div class="envelope-message">
|
||||
<span class="icon material-symbols-outlined">history_edu</span>
|
||||
<span class="message navbar-brand">@($"{_localizer[WebKey.Hello]} {Model.Name}, {@envelope?.Message}".TrySanitize(_sanitizer))</span>
|
||||
</div>
|
||||
<div class="logo">
|
||||
<img class="cursor-img" src="~/img/cursor_logo.png" alt="...">
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="collapse show" id="navbarToggleExternalContent" data-bs-theme="light">
|
||||
<div class="bg-light p-1">
|
||||
<div class="card sender-card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col p-0 m-0">
|
||||
<div class="card-body p-0 m-0 ms-4">
|
||||
<h5 class="card-title p-0 m-0">
|
||||
<span class="signature-process-title">@($"{_localizer[WebKey.SigningProcessTitle]}: ".TrySanitize(_sanitizer))</span>
|
||||
<span class="signature-process-name">@($"{envelope?.Title}".TrySanitize(_sanitizer))</span>
|
||||
</h5>
|
||||
<p class="card-text p-0 m-0">@Html.Raw(string.Format(_localizer[WebKey.EnvelopeInfo1], pages.Count(), stPageIndexes).TrySanitize(_hlSanitizer))</p>
|
||||
<p class="card-text p-0 m-0">
|
||||
<small class="text-body-secondary">
|
||||
@Html.Raw(string.Format(_localizer[WebKey.EnvelopeInfo2], /* sanitize separately but don't sanitize the URI */
|
||||
envelope?.AddedWhen.ToString(userCulture?.Info?.DateTimeFormat).TrySanitize(_sanitizer),
|
||||
$"{sender?.Prename} {sender?.Name}".TrySanitize(_sanitizer),
|
||||
sender?.Email.TrySanitize(_sanitizer),
|
||||
envelope?.Title.TrySanitize(_sanitizer),
|
||||
sender?.Prename.TrySanitize(_sanitizer),
|
||||
sender?.Name.TrySanitize(_sanitizer),
|
||||
sender?.Email.TrySanitize(_sanitizer)))
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="collapse show bg-light " id="navbarToggleExternalContent" data-bs-theme="light">
|
||||
<div class="card sender-card p-1 mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col p-0 m-0">
|
||||
<div class="card-body p-0 m-0 ms-4">
|
||||
<h5 class="card-title p-0 m-0">
|
||||
<span class="signature-process-title">@($"{_localizer[WebKey.SigningProcessTitle]}: ".TrySanitize(_sanitizer))</span>
|
||||
<span class="signature-process-name">@($"{envelope?.Title}".TrySanitize(_sanitizer))</span>
|
||||
</h5>
|
||||
<p class="card-text p-0 m-0">@Html.Raw(string.Format(_localizer[WebKey.EnvelopeInfo1], pages.Count(), stPageIndexes).TrySanitize(_hlSanitizer))</p>
|
||||
<p class="card-text p-0 m-0">
|
||||
<small class="text-body-secondary">
|
||||
@Html.Raw(string.Format(_localizer[WebKey.EnvelopeInfo2], /* sanitize separately but don't sanitize the URI */
|
||||
envelope?.AddedWhen.ToString(userCulture?.Info?.DateTimeFormat).TrySanitize(_sanitizer),
|
||||
$"{sender?.Prename} {sender?.Name}".TrySanitize(_sanitizer),
|
||||
sender?.Email.TrySanitize(_sanitizer),
|
||||
envelope?.Title.TrySanitize(_sanitizer),
|
||||
sender?.Prename.TrySanitize(_sanitizer),
|
||||
sender?.Name.TrySanitize(_sanitizer),
|
||||
sender?.Email.TrySanitize(_sanitizer)))
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,12 +13,20 @@
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="~/lib/sweetalert2/sweetalert2.min.css" />
|
||||
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/css/cursor.min.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/EnvelopeGenerator.Web.styles.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/lib/flag-icons-main/css/flag-icons.min.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/lib/alertifyjs/css/alertify.min.css" />
|
||||
<link rel="stylesheet" href="~/lib/alertifyjs/css/themes/default.min.css" />
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />
|
||||
</head>
|
||||
<body>
|
||||
<style>
|
||||
.material-symbols-outlined {
|
||||
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24
|
||||
}
|
||||
</style>
|
||||
@if (ViewData["EnvelopeKey"] is string envelopeKey)
|
||||
{
|
||||
<script nonce="@nonce">const ENV_KEY = "@envelopeKey.TrySanitize(_sanitizer)"</script>
|
||||
|
||||
@@ -33,5 +33,6 @@
|
||||
public static readonly string RejectionInfo1_ext = nameof(RejectionInfo1_ext);
|
||||
public static readonly string RejectionInfo2_ext = nameof(RejectionInfo2_ext);
|
||||
public static readonly string SigningProcessTitle = nameof(SigningProcessTitle);
|
||||
public static readonly string WelcomeToTheESignPortal = nameof(WelcomeToTheESignPortal);
|
||||
}
|
||||
}
|
||||
@@ -20,9 +20,9 @@
|
||||
"Content-Security-Policy": [ // The first format parameter {0} will be replaced by the nonce value.
|
||||
"default-src 'self'",
|
||||
"script-src 'self' 'nonce-{0}' 'unsafe-eval'",
|
||||
"style-src 'self' 'unsafe-inline'",
|
||||
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com:*",
|
||||
"img-src 'self' data: https: blob:",
|
||||
"font-src 'self'",
|
||||
"font-src 'self' https://fonts.gstatic.com:*",
|
||||
"connect-src 'self' https://nominatim.openstreetmap.org:* http://localhost:* https://localhost:* ws://localhost:* wss://localhost:* blob:",
|
||||
"frame-src 'self'",
|
||||
"media-src 'self'",
|
||||
|
||||
@@ -58,5 +58,11 @@
|
||||
"inputFiles": [
|
||||
"wwwroot/lib/bootstrap-cookie-consent-settings-main/bootstrap-cookie-consent-settings.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"outputFileName": "wwwroot/css/cursor.min.css",
|
||||
"inputFiles": [
|
||||
"wwwroot/css/cursor.css"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
8
EnvelopeGenerator.Web/wwwroot/css/cursor.css
Normal file
8
EnvelopeGenerator.Web/wwwroot/css/cursor.css
Normal file
@@ -0,0 +1,8 @@
|
||||
.cursor-logo {
|
||||
width: 7rem;
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.cursor-img {
|
||||
width: 5rem;
|
||||
}
|
||||
1
EnvelopeGenerator.Web/wwwroot/css/cursor.min.css
vendored
Normal file
1
EnvelopeGenerator.Web/wwwroot/css/cursor.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.cursor-logo{width:7rem;padding-top:1rem}.cursor-img{width:5rem}
|
||||
@@ -10,12 +10,15 @@
|
||||
height: 80vh;
|
||||
}
|
||||
|
||||
.navbar-toggler {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
margin-right: 10vw;
|
||||
margin-bottom: 10vh;
|
||||
}
|
||||
|
||||
|
||||
.btn_refresh, .btn_reject, .btn_complete {
|
||||
height:2.5rem;
|
||||
}
|
||||
@@ -163,8 +166,43 @@ footer#page-footer {
|
||||
border-radius: 3.125rem;
|
||||
}
|
||||
|
||||
.navbar .container {
|
||||
display: flex;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navbar-toggler {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 4rem;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.envelope-message {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
width: calc(100% - 8rem);
|
||||
align-items: center;
|
||||
justify-content: start;
|
||||
margin-left: 4rem;
|
||||
}
|
||||
|
||||
.envelope-message .icon {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
.envelope-message .message {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-size: 16px;
|
||||
font-weight: 550;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 5rem;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
margin-right:2rem;
|
||||
}
|
||||
|
||||
.none-display {
|
||||
@@ -224,18 +262,79 @@ footer#page-footer {
|
||||
z-index: 1050;
|
||||
}
|
||||
|
||||
.header-1 {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top:0;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.header-1 .text {
|
||||
text-align: center;
|
||||
margin-left: 1.5vw;
|
||||
margin-top:0;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.header-1 .logo {
|
||||
width: 9rem;
|
||||
margin-top:0;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
/* styles for mobile responsiveness */
|
||||
@media (max-height: 850px) {
|
||||
.navbar .container {
|
||||
display: flex;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navbar-toggler {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 4rem;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.envelope-message {
|
||||
width: calc(100% - 4rem -9rem);
|
||||
}
|
||||
|
||||
.envelope-message .message {
|
||||
font-size: 14px;
|
||||
font-weight: 550;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 9rem;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
margin-right: 0rem;
|
||||
}
|
||||
|
||||
.card-text, .card-text {
|
||||
font-size: 0.6rem; /* Font size reduced */
|
||||
margin: 0rem;
|
||||
padding: 0rem;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
font-weight: 700;
|
||||
font-size: 0.5rem;
|
||||
}
|
||||
|
||||
.signature-process-title, .signature-process-name {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.navbar {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.navbar-toggler {
|
||||
transform: scale(0.75);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-size: 0.5rem;
|
||||
text-align: center;
|
||||
@@ -243,14 +342,25 @@ footer#page-footer {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.collapse .card-text, .collapsing .card-text {
|
||||
font-size: 0.6rem; /* Font size reduced */
|
||||
margin: 0rem;
|
||||
padding: 0rem;
|
||||
.envelope-message {
|
||||
width: calc(100% - 4rem - 4.5rem);
|
||||
margin-left: 3rem;
|
||||
}
|
||||
|
||||
.sender-card .card-body {
|
||||
padding: 0.5rem;
|
||||
.envelope-message .message {
|
||||
font-size: 12px;
|
||||
font-weight: 550;
|
||||
}
|
||||
|
||||
.envelope-message .icon {
|
||||
margin-right: 0.1rem;
|
||||
font-size: 1rem
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 5rem;
|
||||
right: 0;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
.btn_group {
|
||||
@@ -266,10 +376,6 @@ footer#page-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 4rem;
|
||||
}
|
||||
|
||||
.page {
|
||||
margin-top: 1rem;
|
||||
max-width: 90%;
|
||||
@@ -279,29 +385,10 @@ footer#page-footer {
|
||||
.page section {
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
font-weight: 700;
|
||||
font-size: 0.5rem;
|
||||
}
|
||||
|
||||
.signature-process-title, .signature-process-name {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
}
|
||||
@media (max-height: 850px) {
|
||||
.collapse .card-text, .collapsing .card-text {
|
||||
font-size: 0.5rem; /* Font size reduced */
|
||||
margin: 0rem;
|
||||
padding: 0rem;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
font-weight: 700;
|
||||
font-size: 0.5rem;
|
||||
}
|
||||
|
||||
.signature-process-title, .signature-process-name {
|
||||
font-size: 0.7rem;
|
||||
@media (max-height: 600px) {
|
||||
.collapse {
|
||||
height: 4rem;
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
#app{background:#808080;width:100vw;height:80vh}.btn-group{margin-right:10vw;margin-bottom:10vh}.btn_refresh,.btn_reject,.btn_complete{height:2.5rem}.btn_complete .icon,.btn_reject .icon,.btn_refresh .icon{width:1.1rem}.btn_complete span,.btn_reject span,.btn_refresh span{vertical-align:middle}.button-finish{transition:background-color linear 300ms;background-color:#059669;color:#fff;border-left:0}.button-finish:hover,.button-finish:focus,.button-finish:active{background-color:#10b981;color:#fff}.button-reject{transition:background-color linear 300ms;background-color:#d97706;color:#fff;border-left:0}.button-reject:hover,.button-reject:focus,.button-reject:active{background-color:#f59e0b;color:#fff}.button-reset{transition:background-color linear 300ms;background-color:#2563eb;color:#fff;border-left:0}.button-reset:hover,.button-reset:focus,.button-reset:active{background-color:#3b82f6;color:#fff}body{background-color:#bbb}.page{margin-top:3rem;background:#fff;border-radius:.313rem;box-shadow:rgba(9,30,66,.25) 0 .25rem .5rem -.125rem,rgba(9,30,66,.08) 0 0 0 .063rem;max-width:40rem}.page section{max-width:30rem;margin:0 auto}.page header .icon{display:inline-block;border-radius:6.25rem;padding:.938rem;margin-bottom:2rem}.page header .icon.admin{background-color:#331904;color:#fecba1}.page header .icon.locked{background-color:#ffc107;color:#000}.page header .icon.signed{background-color:#146c43;color:#fff}.page header .icon.rejected{background-color:#e4d8d5;color:#fff}.page .form{max-width:30rem;margin:2rem auto;display:flex;gap:1rem}#form-access-code>.input,#form-admin-password>.input{flex-grow:1}#page-admin header .icon{background-color:#331904;color:#fecba1}.envelope{display:block;border:.063rem solid #eee;margin-bottom:1rem;padding:.5rem}footer#page-footer{color:#333;max-width:40rem;margin-top:1rem;font-size:.85rem}footer#page-footer a,footer#page-footer a:link,footer#page-footer a:hover,footer#page-footer a:visited,footer#page-footer a:focus{color:#444}.sender-card{background-color:transparent;border:0}.sender-card .row{height:7vh}.sender-card img{height:7vh;background-color:#d1cfcf;border-radius:3.125rem}.envelope-message{font-family:'Roboto',sans-serif}.none-display{display:none}.dropdown-flag img,.img-flag{width:30%;height:70%}.dropdown-flag{height:75%;width:75%}.increase-dropdown-height{min-height:25rem}.dropdown-flag .select2-container{width:100%!important;max-width:11.25rem}.lang-item{font-size:.85rem}#langDropdownMenuButton{min-width:4vw}.highlight{font-weight:700;font-size:.85rem}.signature-process-title,.signature-process-name{font-size:1.125rem}.mail-link{color:#000;text-decoration:none}.mail-link:hover{text-decoration:underline}#flex-action-panel{z-index:1050}@media(max-width:767px){.navbar{flex-direction:column;align-items:flex-start}.navbar-toggler{transform:scale(.75);padding:0}.navbar-brand{font-size:.5rem;text-align:center;overflow:hidden;text-overflow:ellipsis}.collapse .card-text,.collapsing .card-text{font-size:.6rem;margin:0;padding:0}.sender-card .card-body{padding:.5rem}.btn_group{position:fixed;flex-direction:row;bottom:.5rem;right:.5rem}.img-fluid{width:1.2rem;height:100%;display:none}img{max-width:4rem}.page{margin-top:1rem;max-width:90%;padding:.5rem}.page section{max-width:90%}.highlight{font-weight:700;font-size:.5rem}.signature-process-title,.signature-process-name{font-size:.7rem}}@media(max-height:850px){.collapse .card-text,.collapsing .card-text{font-size:.5rem;margin:0;padding:0}.highlight{font-weight:700;font-size:.5rem}.signature-process-title,.signature-process-name{font-size:.7rem}}
|
||||
#app{background:#808080;width:100vw;height:80vh}.navbar-toggler{border:0}.btn-group{margin-right:10vw;margin-bottom:10vh}.btn_refresh,.btn_reject,.btn_complete{height:2.5rem}.btn_complete .icon,.btn_reject .icon,.btn_refresh .icon{width:1.1rem}.btn_complete span,.btn_reject span,.btn_refresh span{vertical-align:middle}.button-finish{transition:background-color linear 300ms;background-color:#059669;color:#fff;border-left:0}.button-finish:hover,.button-finish:focus,.button-finish:active{background-color:#10b981;color:#fff}.button-reject{transition:background-color linear 300ms;background-color:#d97706;color:#fff;border-left:0}.button-reject:hover,.button-reject:focus,.button-reject:active{background-color:#f59e0b;color:#fff}.button-reset{transition:background-color linear 300ms;background-color:#2563eb;color:#fff;border-left:0}.button-reset:hover,.button-reset:focus,.button-reset:active{background-color:#3b82f6;color:#fff}body{background-color:#bbb}.page{margin-top:3rem;background:#fff;border-radius:.313rem;box-shadow:rgba(9,30,66,.25) 0 .25rem .5rem -.125rem,rgba(9,30,66,.08) 0 0 0 .063rem;max-width:40rem}.page section{max-width:30rem;margin:0 auto}.page header .icon{display:inline-block;border-radius:6.25rem;padding:.938rem;margin-bottom:2rem}.page header .icon.admin{background-color:#331904;color:#fecba1}.page header .icon.locked{background-color:#ffc107;color:#000}.page header .icon.signed{background-color:#146c43;color:#fff}.page header .icon.rejected{background-color:#e4d8d5;color:#fff}.page .form{max-width:30rem;margin:2rem auto;display:flex;gap:1rem}#form-access-code>.input,#form-admin-password>.input{flex-grow:1}#page-admin header .icon{background-color:#331904;color:#fecba1}.envelope{display:block;border:.063rem solid #eee;margin-bottom:1rem;padding:.5rem}footer#page-footer{color:#333;max-width:40rem;margin-top:1rem;font-size:.85rem}footer#page-footer a,footer#page-footer a:link,footer#page-footer a:hover,footer#page-footer a:visited,footer#page-footer a:focus{color:#444}.sender-card{background-color:transparent;border:0}.sender-card .row{height:7vh}.sender-card img{height:7vh;background-color:#d1cfcf;border-radius:3.125rem}.navbar .container{display:flex;padding:0;margin:0}.navbar-toggler{padding:0;margin:0;width:4rem;left:0}.envelope-message{position:absolute;display:flex;width:calc(100% - 8rem);align-items:center;justify-content:start;margin-left:4rem}.envelope-message .icon{margin-right:.5rem}.envelope-message .message{font-family:'Roboto',sans-serif;font-size:16px;font-weight:550}.logo{width:5rem;position:absolute;right:0;margin-right:2rem}.none-display{display:none}.dropdown-flag img,.img-flag{width:30%;height:70%}.dropdown-flag{height:75%;width:75%}.increase-dropdown-height{min-height:25rem}.dropdown-flag .select2-container{width:100%!important;max-width:11.25rem}.lang-item{font-size:.85rem}#langDropdownMenuButton{min-width:4vw}.highlight{font-weight:700;font-size:.85rem}.signature-process-title,.signature-process-name{font-size:1.125rem}.mail-link{color:#000;text-decoration:none}.mail-link:hover{text-decoration:underline}#flex-action-panel{z-index:1050}.header-1{align-items:center;justify-content:space-between;margin-top:0;padding-top:0}.header-1 .text{text-align:center;margin-left:1.5vw;margin-top:0;padding-top:0}.header-1 .logo{width:9rem;margin-top:0;padding-top:0}@media(max-height:850px){.navbar .container{display:flex;padding:0;margin:0}.navbar-toggler{padding:0;margin:0;width:4rem;left:0}.envelope-message{width:calc(100% - 4rem - 9rem)}.envelope-message .message{font-size:14px;font-weight:550}.logo{width:9rem;position:absolute;right:0;margin-right:0}.card-text,.card-text{font-size:.6rem;margin:0;padding:0}.highlight{font-weight:700;font-size:.5rem}.signature-process-title,.signature-process-name{font-size:.7rem}}@media(max-width:767px){.navbar{flex-direction:column;align-items:flex-start}.navbar-brand{font-size:.5rem;text-align:center;overflow:hidden;text-overflow:ellipsis}.envelope-message{width:calc(100% - 4rem - 4.5rem);margin-left:3rem}.envelope-message .message{font-size:12px;font-weight:550}.envelope-message .icon{margin-right:.1rem;font-size:1rem}.logo{width:5rem;right:0;margin-right:1rem}.btn_group{position:fixed;flex-direction:row;bottom:.5rem;right:.5rem}.img-fluid{width:1.2rem;height:100%;display:none}.page{margin-top:1rem;max-width:90%;padding:.5rem}.page section{max-width:90%}}@media(max-height:600px){.collapse{height:4rem}}
|
||||
BIN
EnvelopeGenerator.Web/wwwroot/img/cursor_logo.png
Normal file
BIN
EnvelopeGenerator.Web/wwwroot/img/cursor_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
Reference in New Issue
Block a user