diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html
index 3304953..7a81cb9 100644
--- a/Resources/ChangeLog.html
+++ b/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
WebDoorCreator - Egalware
- Version: 0.9.2405.0919
+ Version: 0.9.2406.1909
Release note:
-
diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt
index 3ff7550..d8cde43 100644
--- a/Resources/VersNum.txt
+++ b/Resources/VersNum.txt
@@ -1 +1 @@
-0.9.2405.0919
+0.9.2406.1909
diff --git a/Resources/manifest.xml b/Resources/manifest.xml
index f2a21f1..5e25c7e 100644
--- a/Resources/manifest.xml
+++ b/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 0.9.2405.0919
+ 0.9.2406.1909
http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip
http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html
false
diff --git a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs
index ab6d91a..1565ce2 100644
--- a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs
+++ b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs
@@ -101,6 +101,11 @@ namespace WebDoorCreator.UI.Components.Hardware
[Inject]
protected WDCVocabularyService WDVService { get; set; } = null!;
+ [Inject]
+ protected NavigationManager NavMan { get; set; } = null!;
+ [Inject]
+ protected WDCUserService WDCUService { get; set; } = null!;
+
#endregion Protected Properties
#region Protected Methods
@@ -225,6 +230,14 @@ namespace WebDoorCreator.UI.Components.Hardware
JsoncConfigVal = jsonDef,
JsoncActVal = jsonAct
};
+
+ // se debug + superadmin --> auto confirm
+ if (autoApprove)
+ {
+ doorOpToAdd.userConfirm = UserId;
+ doorOpToAdd.DtConfirm = DateTime.Now;
+ }
+
listOp.Add(doorOpToAdd);
// salvo Door OP associate
bool fatto = await WDCService.DoorOpInsert(DoorId, listOp);
@@ -239,6 +252,7 @@ namespace WebDoorCreator.UI.Components.Hardware
}
}
}
+ private bool autoApprove = false;
///
/// Gestione update da oggetto sottostante
@@ -261,10 +275,25 @@ namespace WebDoorCreator.UI.Components.Hardware
DoorOp2ModList.Add(currItem);
}
}
-
+ ///
+ /// Blazor: get query parm from the URL
+ ///
+ ///
+ ///
+ protected string GetQueryParm(string parmName)
+ {
+ var uriBuilder = new UriBuilder(NavMan.Uri);
+ var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query);
+ return q[parmName] ?? "";
+ }
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
+ var currMode = GetQueryParm("currMode");
+ if (!string.IsNullOrEmpty(currMode) && WDCUService.userRole == "SuperAdmin")
+ {
+ autoApprove = currMode.Equals("debug");
+ }
WDCRefresh.EA_ConfDoorOp += WDCRefresh_EA_ConfDoorOp;
}
diff --git a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs
index f1f620b..3dcb719 100644
--- a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs
+++ b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using Newtonsoft.Json;
using NLog;
+using System;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.Data.Services;
using WebDoorCreator.UI.Data;
@@ -90,6 +91,10 @@ namespace WebDoorCreator.UI.Components.Hardware
protected List? listValuesFiles { get; set; } = null!;
protected List? listValuesFname { get; set; } = null!;
protected List? listValuesHW { get; set; } = null!;
+
+ [Inject]
+ protected NavigationManager NavMan { get; set; } = null!;
+
protected List ordListVal { get; set; } = new List();
[Inject]
@@ -142,6 +147,9 @@ namespace WebDoorCreator.UI.Components.Hardware
[Inject]
protected WebDoorCreatorService WDCService { get; set; } = null!;
+ [Inject]
+ protected WDCUserService WDCUService { get; set; } = null!;
+
[Inject]
protected WDCVocabularyService WDVService { get; set; } = null!;
@@ -199,6 +207,12 @@ namespace WebDoorCreator.UI.Components.Hardware
// salvo i NUOVI valori...
DoorOpInst.CurrVals = dictValCurr;
DoorOpInst.GraphicParams = graphicParams;
+ // se debug + superadmin --> auto confirm
+ if (autoApprove && string.IsNullOrEmpty(DoorOpInst.userConfirm))
+ {
+ DoorOpInst.userConfirm = WDCUService.userId;
+ DoorOpInst.DtConfirm = DateTime.Now;
+ }
// salvo!
List doorOpUpd = new List() { DoorOpInst };
await WDCService.DoorOpUpdate(doorOpUpd);
@@ -211,6 +225,18 @@ namespace WebDoorCreator.UI.Components.Hardware
}
}
+ ///
+ /// Blazor: get query parm from the URL
+ ///
+ ///
+ ///
+ protected string GetQueryParm(string parmName)
+ {
+ var uriBuilder = new UriBuilder(NavMan.Uri);
+ var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query);
+ return q[parmName] ?? "";
+ }
+
protected string getTrad(string objId)
{
string answ = "";
@@ -235,6 +261,12 @@ namespace WebDoorCreator.UI.Components.Hardware
hasChanged = currSer != origSer;
if (hasChanged)
{
+ // se debug + superadmin --> auto confirm
+ if (autoApprove && string.IsNullOrEmpty(DoorOpInst.userConfirm))
+ {
+ DoorOpInst.userConfirm = WDCUService.userId;
+ DoorOpInst.DtConfirm = DateTime.Now;
+ }
DoorOpInst.JsoncActVal = JsonConvert.SerializeObject(dictValCurr);
Task.Run(async () =>
{
@@ -256,6 +288,11 @@ namespace WebDoorCreator.UI.Components.Hardware
protected override void OnInitialized()
{
base.OnInitialized();
+ var currMode = GetQueryParm("currMode");
+ if (!string.IsNullOrEmpty(currMode) && WDCUService.userRole == "SuperAdmin")
+ {
+ autoApprove = currMode.Equals("debug");
+ }
string vers = config.GetValue("ConfDDF:VersNumber");
bool remDoorOp = config.GetValue("ConfDDF:RemoveDoorOps");
var headRows = config.GetSection("ConfDDF:Header").Get
>();
@@ -328,6 +365,7 @@ namespace WebDoorCreator.UI.Components.Hardware
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
+ private bool autoApprove = false;
#endregion Private Fields
diff --git a/WebDoorCreator.UI/WebDoorCreator.UI.csproj b/WebDoorCreator.UI/WebDoorCreator.UI.csproj
index b4abfd7..c40be86 100644
--- a/WebDoorCreator.UI/WebDoorCreator.UI.csproj
+++ b/WebDoorCreator.UI/WebDoorCreator.UI.csproj
@@ -3,7 +3,7 @@
net6.0
enable
- 0.9.2405.0919
+ 0.9.2406.1909
enable
aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608