@optimiser/common 1.0.385 → 1.0.386
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.
- package/dist/lib/utility.js +7 -30
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -1860,7 +1860,7 @@ function CheckDataBeforeAdd(updateObj, objectSchema, db) {
|
|
|
1860
1860
|
switch (_c.label) {
|
|
1861
1861
|
case 0:
|
|
1862
1862
|
fieldSchema = objectSchema.Fields.find(function (x) { return x.Name == fldName; });
|
|
1863
|
-
if (!fieldSchema) return [3 /*break*/,
|
|
1863
|
+
if (!fieldSchema) return [3 /*break*/, 7];
|
|
1864
1864
|
cityfield = void 0;
|
|
1865
1865
|
if (fieldSchema.LookupObject == "City") {
|
|
1866
1866
|
cityfield = updateObj[fldName];
|
|
@@ -1901,14 +1901,7 @@ function CheckDataBeforeAdd(updateObj, objectSchema, db) {
|
|
|
1901
1901
|
if (fieldSchema.UIDataType == 'formula')
|
|
1902
1902
|
delete updateObj[fldName];
|
|
1903
1903
|
_c.label = 7;
|
|
1904
|
-
case 7:
|
|
1905
|
-
// QPC-9020 for State and Country Field Server Side Validation
|
|
1906
|
-
return [4 /*yield*/, ValidateStateCountryField({ fieldSchema: fieldSchema, updateObj: updateObj, objectSchema: objectSchema, db: db, cityfield: cityfield })];
|
|
1907
|
-
case 8:
|
|
1908
|
-
// QPC-9020 for State and Country Field Server Side Validation
|
|
1909
|
-
_c.sent();
|
|
1910
|
-
_c.label = 9;
|
|
1911
|
-
case 9: return [2 /*return*/];
|
|
1904
|
+
case 7: return [2 /*return*/];
|
|
1912
1905
|
}
|
|
1913
1906
|
});
|
|
1914
1907
|
};
|
|
@@ -1944,10 +1937,10 @@ function CheckDataBeforeUpdate(updateObj, objectData, objectSchema, db) {
|
|
|
1944
1937
|
case 0:
|
|
1945
1938
|
if (!(fldName == '_id')) return [3 /*break*/, 1];
|
|
1946
1939
|
delete updateObj[fldName];
|
|
1947
|
-
return [3 /*break*/,
|
|
1940
|
+
return [3 /*break*/, 5];
|
|
1948
1941
|
case 1:
|
|
1949
1942
|
fieldSchema = objectSchema.Fields.find(function (x) { return x.Name == fldName; });
|
|
1950
|
-
if (!fieldSchema) return [3 /*break*/,
|
|
1943
|
+
if (!fieldSchema) return [3 /*break*/, 5];
|
|
1951
1944
|
cityfield = void 0;
|
|
1952
1945
|
if (fieldSchema.LookupObject == "City") {
|
|
1953
1946
|
cityfield = updateObj[fldName];
|
|
@@ -1975,14 +1968,7 @@ function CheckDataBeforeUpdate(updateObj, objectData, objectSchema, db) {
|
|
|
1975
1968
|
case 4:
|
|
1976
1969
|
_c.sent();
|
|
1977
1970
|
_c.label = 5;
|
|
1978
|
-
case 5:
|
|
1979
|
-
// QPC-9020 for State and Country Field Server Side Validation
|
|
1980
|
-
return [4 /*yield*/, ValidateStateCountryField({ fieldSchema: fieldSchema, updateObj: updateObj, objectSchema: objectSchema, db: db, cityfield: cityfield })];
|
|
1981
|
-
case 6:
|
|
1982
|
-
// QPC-9020 for State and Country Field Server Side Validation
|
|
1983
|
-
_c.sent();
|
|
1984
|
-
_c.label = 7;
|
|
1985
|
-
case 7: return [2 /*return*/];
|
|
1971
|
+
case 5: return [2 /*return*/];
|
|
1986
1972
|
}
|
|
1987
1973
|
});
|
|
1988
1974
|
};
|
|
@@ -4736,17 +4722,8 @@ function IsAnotherObjectField(pageData, fieldName) {
|
|
|
4736
4722
|
return false;
|
|
4737
4723
|
}
|
|
4738
4724
|
var CustomSanitizeHtml = function (dirtyHtml) {
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
allowedAttributes: {
|
|
4742
|
-
'*': ['href', 'align', 'alt', 'center', 'bgcolor', 'src', 'title', 'width'],
|
|
4743
|
-
},
|
|
4744
|
-
allowedSchemes: ['http', 'https', 'mailto'], // Allow URLs with these schemes
|
|
4745
|
-
textFilter: function (text) { return text; }, // Keep special characters like & intact
|
|
4746
|
-
parser: {
|
|
4747
|
-
decodeEntities: false, // Prevent converting & to &
|
|
4748
|
-
},
|
|
4749
|
-
});
|
|
4725
|
+
var sanitizeHtmlContent = (0, sanitize_html_1.default)(dirtyHtml);
|
|
4726
|
+
return sanitizeHtmlContent.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
4750
4727
|
};
|
|
4751
4728
|
/*
|
|
4752
4729
|
* Created by: Nirbhay as on 01-09-22
|