drapcode-utility 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -488,7 +488,20 @@ var replaceExternalParams = function (query, requiredExternal, externalParams, c
|
|
|
488
488
|
if (fieldType &&
|
|
489
489
|
!requiredExternal &&
|
|
490
490
|
["dynamic_option", "reference", "static_option", "belongsTo"].includes(fieldType)) {
|
|
491
|
-
|
|
491
|
+
var refCollection = query.refCollection, refField = query.refField;
|
|
492
|
+
var finalValue = "";
|
|
493
|
+
if (refCollection === drapcode_constant_1.CURRENT_USER) {
|
|
494
|
+
finalValue = currentUser[refField];
|
|
495
|
+
}
|
|
496
|
+
if (refCollection === drapcode_constant_1.CURRENT_TENANT) {
|
|
497
|
+
finalValue = currentTenant[refField];
|
|
498
|
+
}
|
|
499
|
+
if (value === drapcode_constant_1.CURRENT_USER) {
|
|
500
|
+
finalValue = currentUser["uuid"];
|
|
501
|
+
}
|
|
502
|
+
if (!finalValue)
|
|
503
|
+
finalValue = value;
|
|
504
|
+
return finalValue;
|
|
492
505
|
}
|
|
493
506
|
if (fieldType &&
|
|
494
507
|
fieldType === "boolean" &&
|
|
@@ -544,8 +557,6 @@ var replaceExternalParams = function (query, requiredExternal, externalParams, c
|
|
|
544
557
|
else
|
|
545
558
|
return startValue_1 + "---" + endValue_1;
|
|
546
559
|
}
|
|
547
|
-
console.log("==> value", value);
|
|
548
|
-
console.log("==> currentUser", currentUser);
|
|
549
560
|
if (value.includes(drapcode_constant_1.CURRENT_USER)) {
|
|
550
561
|
if (value === drapcode_constant_1.CURRENT_USER) {
|
|
551
562
|
return currentUser["uuid"];
|
|
@@ -612,8 +623,6 @@ var replaceExternalParams = function (query, requiredExternal, externalParams, c
|
|
|
612
623
|
refCollection = splitValues[0];
|
|
613
624
|
refCollectionField = "";
|
|
614
625
|
}
|
|
615
|
-
console.log("\n refCollection", refCollection);
|
|
616
|
-
console.log("\n refCollectionField", refCollectionField);
|
|
617
626
|
if (refCollection && refCollectionField) {
|
|
618
627
|
console.log("I have refCollection and Field");
|
|
619
628
|
if (refCollection === "CURRENT_TENANT") {
|
|
@@ -621,7 +630,6 @@ var replaceExternalParams = function (query, requiredExternal, externalParams, c
|
|
|
621
630
|
}
|
|
622
631
|
else {
|
|
623
632
|
var refCollectionData = currentTenant[refCollection];
|
|
624
|
-
console.log("\n refCollectionData", refCollectionData);
|
|
625
633
|
if (!refCollectionData)
|
|
626
634
|
return "";
|
|
627
635
|
if (refCollectionData.length > 1)
|
|
@@ -550,7 +550,17 @@ var replaceExternalParams = function (query, requiredExternal, externalParams, c
|
|
|
550
550
|
if (fieldType &&
|
|
551
551
|
!requiredExternal &&
|
|
552
552
|
["dynamic_option", "static_option", "reference"].includes(fieldType)) {
|
|
553
|
-
|
|
553
|
+
var refCollection = query.refCollection, refField = query.refField;
|
|
554
|
+
var finalValue = "";
|
|
555
|
+
if (refCollection === drapcode_constant_1.CURRENT_USER) {
|
|
556
|
+
finalValue = currentUser[refField];
|
|
557
|
+
}
|
|
558
|
+
if (value === drapcode_constant_1.CURRENT_USER) {
|
|
559
|
+
finalValue = currentUser["uuid"];
|
|
560
|
+
}
|
|
561
|
+
if (!finalValue)
|
|
562
|
+
finalValue = value;
|
|
563
|
+
return finalValue;
|
|
554
564
|
}
|
|
555
565
|
if (fieldType &&
|
|
556
566
|
fieldType === "boolean" &&
|