Fix confirm solo ove necessario

This commit is contained in:
Samuele Locatelli
2024-04-26 10:00:25 +02:00
parent 6b82975b9d
commit 7bebc6e8ea
4 changed files with 16 additions and 9 deletions
@@ -9,7 +9,7 @@ else
<div class="text-center d-flex justify-content-between px-2 mb-3">
@if (DoorOpInst.userConfirm != "" && DoorOpInst.DtConfirm != null)
{
<NavLink href="@pathFinder(DoorOpInst.DoorOpId)" target="_blank">
<NavLink href="@pathFinder(DoorOpInst.DoorOpId, false)" target="_blank">
<button class="btnPdfSuccess">
<i class="fa-solid fa-file-pdf"></i>
</button>
@@ -160,7 +160,7 @@ else
}
else
{
<NavLink href="@pathFinder(DoorOpInst.DoorOpId)" target="_blank">
<NavLink href="@pathFinder(DoorOpInst.DoorOpId, true)" target="_blank">
<button class="btnPdfPending">
<i class="fa-solid fa-file-pdf"></i>
</button>
@@ -350,9 +350,9 @@ namespace WebDoorCreator.UI.Components.Hardware
await SetSelectedData();
}
private string pathFinder(int id)
private string pathFinder(int id, bool reqConf)
{
string answ = $"HwPdfConfirm?doorOpId={id}&doorId={DoorOpInst.DoorId}&objectId={DoorOpInst.ObjectId}";
string answ = $"HwPdfConfirm?doorOpId={id}&doorId={DoorOpInst.DoorId}&objectId={DoorOpInst.ObjectId}&reqConf={reqConf}";
return answ;
}
+6 -5
View File
@@ -4,11 +4,12 @@
{
<div>
<div class="col-12 text-center mb-2">
Please press
<button class="btn btn-outline-dark" style="cursor: pointer;" @onclick="()=>doConfirm()">
CONFIRM
</button>
after reading the whole Document
@if (reqConf)
{
<button class="btn btn-outline-dark" style="cursor: pointer;" @onclick="()=>doConfirm()">
Press CONFIRM after reading the whole Document
</button>
}
</div>
@* <embed src="@docUrl" width="100%" height="800px" /> *@
<div class="bg-light p-1">
@@ -32,6 +32,8 @@ namespace WebDoorCreator.UI.Pages
protected int doorOpId { get; set; } = 0;
protected bool reqConf { get; set; } = false;
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
@@ -135,6 +137,10 @@ namespace WebDoorCreator.UI.Pages
{
int.TryParse(sDoorId, out doorId);
}
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("reqConf", out var sReqConf))
{
reqConf = bool.Parse(sReqConf);
}
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("doorOpId", out var sDoorOpId))
{
doorOpId = int.Parse(sDoorOpId);