Skip to content

Commit 0253a93

Browse files
muenchrisChris MuenchMarkusHorstmannChris Muench
authored
NMI Render fix (#66)
* Fix for SubProperties in NMI * proper UX Management of Sub-Properties * Fix for super large collapsible groups * Fix for missing Template assignment; fix for SideBar in ClassicMode * no checkin of cdeWorker.js * LiveChart with PixelWidth * Bar with PixelHeight/Width; remove od debugger * fix for Chart Control * Fix for Pixel precision sizing of NMI Controls * Fix for Bar PixelWidth * code smell removed * fix for sonarcloud * Fix for Foreign Things in Screens * Fix for FacePlate inlines pointing at other Things * Missing Event Fire on Screen Model Update * Tuning of Faceplate tags * Fix for custom HomeScreen OnShow not firing; fix for FacePlate parsing * fix for faceplate parsing * SonarCloud Cleanup; Final FacePlate Fix * remove allowanonymour from nmi initialization * SonarCloud cleanup; Support for ReloadAfterLogout; Support for DefaultPortal of a plugin; Fix of Login Screen if host name has changed; * code smell fix * Small Fix for Dashboard Tiles * ForceLoad if DefaultPortal is set * new FitToScreen option for Forms; some more SonarCloud cleanup * code smell fix * Fit To Screen for vertical adjustments * Fix for FitToScreen; new ClassName Macro for Faceplates * FacePlate fix; Copyright to 2023 * Fix for SonarCloud duplication * Correct fetch of images from Mesh Sources; Sonarcloud fixes * sonar cloud fix * Initial work on NMI Editor * Updates to NMI Editor * Support the for the NMI Editor with RedPill * fix for sonar * No Sonar for webworker * still fighting sonarcloud * Still fighting * NMI Model preparation for NMI Editor allowing to remove sub-controls on the fly * Fix for Canvas Controls with Scaling of Screens * New Numeric Macro for html templates * SonarCloud bugfix * Fix for dragging not canceled by screenchange; fix for value crash on SmartGauge2; Fix for NMI Editor Creation * Preview of Gesture Support to delete a control from a "Group" screen Fix for Overlay on fullscreens * Color Scheme update for NMI Editor * Theme updates * Fix for Property Updates in NMI are only sent to TheThing owner. * Support for search in ComboBox * Support for TimeSpan NMI control * Improvement for control dragging * Fix for lazy control loading * C3 Smoothy update * Support for TileFactor and Pixelwidth on ctrlGauge * Minor fixe * Ignore AzureBat * AzureSign * Updates styles for Pins * ComboBox Cleanup * CertPicker Cleanup * AzureSign Removed * Code Signing: switch to Azure Vault * copy * Update workflow for azure vault * signme fix * Removed double definition * updated nuget * ready for NetStd 2.1 * Update to .NET Standard 2.1 * Min version to * Nuget Remove * buidl targets * Hide Sidebar on Screen Transition fix Correct loading of 6.* nugets * better drag rounding. Still not perfect * Force Screen override delete with shift key * Support for NMI Editor OnHide Event; Theme Improvements for NMI Editor in RightSideBar * New area for custom Pins * dep5 * Update dotnetcore.yml * Update dotnetcore.yml * Packager * solution * artifact licenses * Flow style Update * latest nuget * FitToScreen improvements * latest nugets * support for SVG tags * Support for SVG animations * SUpport for Attribute Defaults * nuget update * New Smoothie and Data update * Fix for top margin on phones TileSize on Mobile to default * Packager Update * updated CDE * Fix for GenerateFinalStr --------- Co-authored-by: Chris Muench <chris.muench@live.com> Co-authored-by: Markus Horstmann <markushorstmann@hotmail.com> Co-authored-by: Chris Muench <muenchris@c-labs.com> Co-authored-by: Chris Muench <chris@hyviva.com>
1 parent c713d91 commit 0253a93

File tree

3 files changed

+187
-198
lines changed

3 files changed

+187
-198
lines changed

src/HTML5/CDMyNMIHtml5RT/ClientBin/CDE/cde.min.js

Lines changed: 97 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -9004,120 +9004,115 @@ var cdeNMI;
90049004
return pInStr;
90059005
if (typeof pInStr !== "string")
90069006
pInStr = pInStr.toString();
9007+
let tInStr;
90079008
let outStr = pInStr;
9008-
if (outStr.indexOf('<%UN%>') >= 0) {
9009-
if (cde.MyBaseAssets.MyCommStatus.UserPref && cde.MyBaseAssets.MyCommStatus.UserPref.CurrentUserName)
9010-
outStr = outStr.replace('<%UN%>', cde.MyBaseAssets.MyCommStatus.UserPref.CurrentUserName);
9011-
else
9012-
outStr = outStr.replace('<%UN%>', '');
9013-
}
9014-
if (outStr.indexOf('<%ISID%>') >= 0) {
9015-
const tN = cde.MyBaseAssets.MyCommStatus.InitialNPA;
9016-
const len = (tN.indexOf(".ashx") > 0 ? 5 : 0);
9017-
const tISID = (!tN ? "" : "?SID=" + tN.substring(4, tN.length - len));
9018-
outStr = outStr.replace('<%ISID%>', tISID);
9019-
}
9020-
if (outStr.indexOf('<%NOW%>') >= 0) {
9021-
outStr = outStr.replace('<%NOW%>', moment(Date.now()).format("YYYY-MM-DD HH:mm:ss"));
9022-
}
9023-
if (pTRF && !pData) {
9024-
const tScreenInfo = cdeNMI.MyNMIModels[pTRF.ModelID];
9025-
if (tScreenInfo && tScreenInfo.MyStorageMirror && tScreenInfo.MyStorageMirror[pTRF.TableName])
9026-
pData = tScreenInfo.MyStorageMirror[pTRF.TableName][pTRF.RowNo];
9027-
}
9028-
if (pData && pData !== true) {
9029-
if (outStr.indexOf('<%NN%>') >= 0) {
9030-
try {
9031-
outStr = outStr.replace('<%NN%>', pData.cdeN && cdeNMI.MyEngine ? cdeNMI.MyEngine.GetKnownNodeName(pData.cdeN) : '');
9032-
}
9033-
catch (_a) {
9034-
outStr = outStr.replace('<%NN%>', '');
9035-
}
9009+
do {
9010+
tInStr = outStr;
9011+
if (outStr.indexOf('<%UN%>') >= 0) {
9012+
if (cde.MyBaseAssets.MyCommStatus.UserPref && cde.MyBaseAssets.MyCommStatus.UserPref.CurrentUserName)
9013+
outStr = outStr.replace('<%UN%>', cde.MyBaseAssets.MyCommStatus.UserPref.CurrentUserName);
9014+
else
9015+
outStr = outStr.replace('<%UN%>', '');
90369016
}
9037-
for (const index in pData) {
9038-
if (Object.prototype.hasOwnProperty.call(pData, index)) {
9039-
if (index === "MyPropertyBag" && outStr.indexOf('%') >= 0) {
9040-
const myPropertyBag = pData["MyPropertyBag"];
9041-
for (const tBagItem in myPropertyBag) {
9042-
if (Object.prototype.hasOwnProperty.call(myPropertyBag, tBagItem)) {
9043-
if (outStr.indexOf('%MyPropertyBag.' + tBagItem + '.Value%') >= 0) {
9044-
outStr = outStr.replace('%MyPropertyBag.' + tBagItem + '.Value%', myPropertyBag[tBagItem]["Value"]);
9045-
}
9046-
else if (outStr.indexOf('<%' + tBagItem + '%>') >= 0) {
9047-
outStr = outStr.replace('<%' + tBagItem + '%>', myPropertyBag[tBagItem]["Value"]);
9048-
}
9049-
else if (outStr.indexOf('%' + tBagItem + '%') >= 0 && myPropertyBag[tBagItem]["Value"]) {
9050-
outStr = outStr
9051-
.replace('%' + tBagItem + '%', myPropertyBag[tBagItem]["Value"]);
9017+
if (outStr.indexOf('<%ISID%>') >= 0) {
9018+
const tN = cde.MyBaseAssets.MyCommStatus.InitialNPA;
9019+
const len = (tN.indexOf(".ashx") > 0 ? 5 : 0);
9020+
const tISID = (!tN ? "" : "?SID=" + tN.substring(4, tN.length - len));
9021+
outStr = outStr.replace('<%ISID%>', tISID);
9022+
}
9023+
if (outStr.indexOf('<%NOW%>') >= 0) {
9024+
outStr = outStr.replace('<%NOW%>', moment(Date.now()).format("YYYY-MM-DD HH:mm:ss"));
9025+
}
9026+
if (pTRF && !pData) {
9027+
const tScreenInfo = cdeNMI.MyNMIModels[pTRF.ModelID];
9028+
if (tScreenInfo && tScreenInfo.MyStorageMirror && tScreenInfo.MyStorageMirror[pTRF.TableName])
9029+
pData = tScreenInfo.MyStorageMirror[pTRF.TableName][pTRF.RowNo];
9030+
}
9031+
if (pData && pData !== true) {
9032+
if (outStr.indexOf('<%NN%>') >= 0) {
9033+
try {
9034+
outStr = outStr.replace('<%NN%>', pData.cdeN && cdeNMI.MyEngine ? cdeNMI.MyEngine.GetKnownNodeName(pData.cdeN) : '');
9035+
}
9036+
catch (_a) {
9037+
outStr = outStr.replace('<%NN%>', '');
9038+
}
9039+
}
9040+
for (const index in pData) {
9041+
if (Object.prototype.hasOwnProperty.call(pData, index)) {
9042+
if (index === "MyPropertyBag" && outStr.indexOf('%') >= 0) {
9043+
const myPropertyBag = pData["MyPropertyBag"];
9044+
for (const tBagItem in myPropertyBag) {
9045+
if (Object.prototype.hasOwnProperty.call(myPropertyBag, tBagItem)) {
9046+
if (outStr.indexOf('%MyPropertyBag.' + tBagItem + '.Value%') >= 0) {
9047+
outStr = outStr.replace('%MyPropertyBag.' + tBagItem + '.Value%', myPropertyBag[tBagItem]["Value"]);
9048+
}
9049+
else if (outStr.indexOf('<%' + tBagItem + '%>') >= 0) {
9050+
outStr = outStr.replace('<%' + tBagItem + '%>', myPropertyBag[tBagItem]["Value"]);
9051+
}
9052+
else if (outStr.indexOf('%' + tBagItem + '%') >= 0 && myPropertyBag[tBagItem]["Value"]) {
9053+
outStr = outStr
9054+
.replace('%' + tBagItem + '%', myPropertyBag[tBagItem]["Value"]);
9055+
}
90529056
}
90539057
}
90549058
}
9055-
}
9056-
let repl;
9057-
let tInStr;
9058-
if (outStr.indexOf('<%' + index + '%>') >= 0) {
9059-
repl = "";
9060-
if (pData[index]) {
9061-
if (typeof pData[index] !== "string")
9062-
repl = pData[index].toString();
9063-
else
9064-
repl = pData[index];
9065-
}
9066-
tInStr = "";
9067-
do {
9068-
tInStr = outStr;
9059+
let repl;
9060+
if (outStr.indexOf('<%' + index + '%>') >= 0) {
9061+
repl = "";
9062+
if (pData[index]) {
9063+
if (typeof pData[index] !== "string")
9064+
repl = pData[index].toString();
9065+
else
9066+
repl = pData[index];
9067+
}
90699068
outStr = outStr.replace('<%' + index + '%>', GenerateFinalString(repl, pData, pTRF));
9070-
} while (tInStr !== outStr);
9071-
}
9072-
else if (pData[index] &&
9073-
pData[index].MyFieldInfo &&
9074-
pData[index].MyFieldInfo.FldOrder &&
9075-
outStr.indexOf('<%' + pData[index].MyFieldInfo.FldOrder + ".") >= 0) {
9076-
const tFldO = pData[index].MyFieldInfo.FldOrder.toString();
9077-
const tPos = outStr.indexOf('<%' + tFldO + ".") + tFldO.length + 3;
9078-
const tPosEnd = outStr.indexOf("%>", tPos);
9079-
const tPropName = outStr.substring(tPos, tPosEnd);
9080-
const tVal = pData[index].GetProperty(tPropName);
9081-
if (tVal) {
9082-
outStr = tVal.toString();
90839069
}
9084-
}
9085-
else if (outStr.indexOf('%' + index + '%') >= 0) {
9086-
repl = "";
9087-
if (pData[index]) {
9088-
if (typeof pData[index] !== "string")
9089-
repl = pData[index].toString();
9090-
else
9091-
repl = pData[index];
9070+
else if (pData[index] &&
9071+
pData[index].MyFieldInfo &&
9072+
pData[index].MyFieldInfo.FldOrder &&
9073+
outStr.indexOf('<%' + pData[index].MyFieldInfo.FldOrder + ".") >= 0) {
9074+
const tFldO = pData[index].MyFieldInfo.FldOrder.toString();
9075+
const tPos = outStr.indexOf('<%' + tFldO + ".") + tFldO.length + 3;
9076+
const tPosEnd = outStr.indexOf("%>", tPos);
9077+
const tPropName = outStr.substring(tPos, tPosEnd);
9078+
const tVal = pData[index].GetProperty(tPropName);
9079+
if (tVal) {
9080+
outStr = tVal.toString();
9081+
}
90929082
}
9093-
tInStr = "";
9094-
do {
9095-
tInStr = outStr;
9083+
else if (outStr.indexOf('%' + index + '%') >= 0) {
9084+
repl = "";
9085+
if (pData[index]) {
9086+
if (typeof pData[index] !== "string")
9087+
repl = pData[index].toString();
9088+
else
9089+
repl = pData[index];
9090+
}
90969091
outStr = outStr.replace('%' + index + '%', GenerateFinalString(repl, pData, pTRF));
9097-
} while (tInStr !== outStr);
9092+
}
90989093
}
90999094
}
91009095
}
9101-
}
9102-
if (pTRF && pTRF.FldInfo) {
9103-
let tT = 1;
9104-
let gfsoutStr;
9105-
while (tT === 1) {
9106-
gfsoutStr = outStr;
9107-
if (gfsoutStr.indexOf("%") < 0)
9108-
break; // 3 Recursions allowed then out...
9109-
const tFound = cdeNMI.ReturnStringSegment(gfsoutStr, "%", "%");
9110-
if (tFound) {
9111-
const tFl = pTRF.FldInfo[tFound.Inner];
9112-
if (tFl)
9113-
gfsoutStr = gfsoutStr.replace(tFound.Outer, tFl);
9114-
}
9115-
if (gfsoutStr !== outStr)
9116-
outStr = gfsoutStr;
9117-
else
9118-
tT = 0;
9096+
if (pTRF && pTRF.FldInfo) {
9097+
let tT = 1;
9098+
let gfsoutStr;
9099+
while (tT === 1) {
9100+
gfsoutStr = outStr;
9101+
if (gfsoutStr.indexOf("%") < 0)
9102+
break; // 3 Recursions allowed then out...
9103+
const tFound = cdeNMI.ReturnStringSegment(gfsoutStr, "%", "%");
9104+
if (tFound) {
9105+
const tFl = pTRF.FldInfo[tFound.Inner];
9106+
if (tFl)
9107+
gfsoutStr = gfsoutStr.replace(tFound.Outer, tFl);
9108+
}
9109+
if (gfsoutStr !== outStr)
9110+
outStr = gfsoutStr;
9111+
else
9112+
tT = 0;
9113+
}
91199114
}
9120-
}
9115+
} while (tInStr !== outStr);
91219116
if (!pKeepMacro) {
91229117
while (outStr.indexOf("<%") >= 0) {
91239118
if (outStr.indexOf("%>") > 0) {
@@ -23187,7 +23182,7 @@ var cdeNMI;
2318723182
this.mPWD2.MyNMIControl.RegisterEvent("OnReturn", () => { this.LoginClick(); });
2318823183
if (cde.MyBaseAssets.MyServiceHostInfo.AllowSetScopeWithSetAdmin)
2318923184
this.mScope.SetProperty("Visibility", true);
23190-
this.mHeaderHelp.MyNMIControl.SetProperty("Text", "The Administrator password and email are not set, yet. Please enter a strong password to ensure maximum security.");
23185+
this.mHeaderHelp.MyNMIControl.SetProperty("Text", "The Administrator password and email are not set, yet. Please enter a strong password.");
2319123186
}
2319223187
else {
2319323188
if (cde.MyBaseAssets.MyServiceHostInfo.IsUsingUserMapper) {

0 commit comments

Comments
 (0)