show id and selfie

This commit is contained in:
jojo aquino 2025-04-03 22:36:51 +01:00
parent c07ca4dbac
commit 8ae7873453
4 changed files with 70 additions and 11 deletions

View File

@ -137,22 +137,20 @@
<!-- Nav tabs -->
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="tab" href="#image1">Image 1</a>
<a class="nav-link active" data-bs-toggle="tab" href="#image1">Identification</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#image2">Image 2</a>
<a class="nav-link" data-bs-toggle="tab" href="#image2">Selfie</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div id="image1" class="container tab-pane active">
<br>
<img src="https://placehold.co/600x400?text=Hello" alt="Image 1" class="img-fluid">
<img id="IdentificationImage" src="https://placehold.co/600x400?text=World" alt="Image 2" class="img-fluid">
</div>
<div id="image2" class="container tab-pane fade">
<br>
<img src="https://placehold.co/600x400?text=World" alt="Image 2" class="img-fluid">
<img id="SelfieImage" src="https://placehold.co/600x400?text=Hello" alt="Image 1" class="img-fluid">
</div>
</div>
@ -161,7 +159,7 @@
<!-- Modal Footer -->
<div class="modal-footer justify-content-start">
<div class="flex-fill">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Approve</button>
<button type="button" class="btn btn-success" data-bs-dismiss="modal">Approve</button>
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Reject</button>
</div>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>

View File

@ -113,7 +113,7 @@ namespace EnotaryoPH.Web.Pages.Participant.VideoCall
var participants = _Transaction.Schedule.LawyerVideoConferenceParticipants.ConvertAll(p =>
new RoomParticipantViewModel
{
Id = p.LawyerVideoConferenceParticipant_UID.ToString(),
UID = p.LawyerVideoConferenceParticipant_UID.ToString(),
DisplayName =
$"{p.Participant.Firstname} {p.Participant.Lastname}".Trim()
.DefaultIfEmpty(p.Participant.Email),
@ -125,7 +125,7 @@ namespace EnotaryoPH.Web.Pages.Participant.VideoCall
participants.Add(new RoomParticipantViewModel
{
DisplayName = $"{host.Firstname} {host.Lastname}".Trim().DefaultIfEmpty(host.Email),
Id = Guid.Empty.ToString(),
UID = Guid.Empty.ToString(),
RoomUserID = _Transaction.Schedule.MeetingRoomUserID,
Type = nameof(UserType.Notary)
});
@ -137,5 +137,49 @@ namespace EnotaryoPH.Web.Pages.Participant.VideoCall
[BindProperty(SupportsGet = true)] public string ServerCallID { get; set; }
[BindProperty(SupportsGet = true)] public Guid Transaction_UID { get; set; }
public IActionResult OnGetSelfieImage(string meetingRoomUserID)
{
var participant = _dbContext.LawyerVideoConferenceParticipants
.AsNoTracking()
.FirstOrDefault(participant => participant.MeetingRoomUserID == meetingRoomUserID);
if (participant == null)
{
return NotFound();
}
var transactionSelfie = _dbContext.TransactionSelfies.FirstOrDefault(selfie => selfie.UserID == participant.ParticipantID && selfie.Transaction.Transaction_UID == Transaction_UID);
if (transactionSelfie == null)
{
return NotFound();
}
return new FileContentResult(transactionSelfie.File, "image/jpeg");
}
public IActionResult OnGetIdentificationDocument(string meetingRoomUserID)
{
var participant = _dbContext.LawyerVideoConferenceParticipants
.AsNoTracking()
.FirstOrDefault(participant => participant.MeetingRoomUserID == meetingRoomUserID);
if (participant == null)
{
return NotFound();
}
var identificationDocumentID = _dbContext.TransactionSelfies.AsNoTracking()
.Where(selfie => selfie.UserID == participant.ParticipantID && selfie.Transaction.Transaction_UID == Transaction_UID)
.Select(selfie => selfie.IdentificationDocumentID).FirstOrDefault();
if (identificationDocumentID == 0)
{
return NotFound();
}
var identificationDocument = _dbContext.IdentificationDocuments.FirstOrDefault(id => id.IdentificationDocumentID == identificationDocumentID);
if (identificationDocument == null)
{
return NotFound();
}
return new FileContentResult(identificationDocument.File, "image/jpeg");
}
}
}

View File

@ -18,6 +18,8 @@
control_serverCallIID = document.getElementById("ServerCallID"),
control_participantType = document.getElementById("ParticipantType"),
control_participantListGroup = document.getElementById("ParticipantListGroup"),
control_selfieImage = document.getElementById("SelfieImage"),
control_identificationImage = document.getElementById("IdentificationImage"),
x = 1;
let participants = JSON.parse(control_participants.value);
@ -236,6 +238,7 @@
const initials = participant.DisplayName.split(' ').map(n => n.charAt(0)).join('');
let tmpl = control_templateParticipantItem.cloneNode(true).content;
tmpl.querySelector('.participant-item').dataset.participantUid = participant.RoomUserID;
tmpl.querySelector('.participant-item').dataset.participantUid = participant.UID;
tmpl.querySelector('.participant-avatar').textContent = initials;
tmpl.querySelector('.participant-name').textContent = participant.DisplayName;
control_participantListGroup.appendChild(tmpl);
@ -247,8 +250,23 @@
let target = event.target?.closest('.list-group-item');
if (target) {
const participant = participants.find(p => p.UID == target.dataset.participantUid);
if (!participant) {
return;
}
let selfieUrl = jfa.utilities.routing.getCurrentURLWithHandler("SelfieImage");
selfieUrl.searchParams.append("meetingRoomUserID", participant.RoomUserID);
let identificationUrl = jfa.utilities.routing.getCurrentURLWithHandler("IdentificationDocument");
identificationUrl.searchParams.append("meetingRoomUserID", participant.RoomUserID);
control_selfieImage.src = selfieUrl;
const sidebarModal = bootstrap.Modal.getOrCreateInstance(control_rightSidebarModal);
sidebarModal.hide();
control_identificationImage.src = identificationUrl;
const draggableModal = bootstrap.Modal.getOrCreateInstance(control_draggableModal);
draggableModal.show();
@ -283,7 +301,6 @@
});
}
async function _init() {
_bindEvents();
//_updateGrid();

View File

@ -3,7 +3,7 @@
public class RoomParticipantViewModel
{
public string DisplayName { get; set; }
public string Id { get; set; }
public string UID { get; set; }
public string RoomUserID { get; set; }
public string Type { get; set; }
}