@optimiser/common 1.0.296 → 1.0.298

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.
Files changed (2) hide show
  1. package/dist/lib/utility.js +40 -39
  2. package/package.json +1 -1
@@ -1865,6 +1865,8 @@ function BuildGridFieldProjection(project, field, group) {
1865
1865
  // below code was added by Shahzaib on 05/09/2022
1866
1866
  case "lookup":
1867
1867
  case "multilookup":
1868
+ case "dropdown":
1869
+ case "multiselect":
1868
1870
  alias = fldName + constants_1.default.LookupAlias;
1869
1871
  project[fldName] = 1;
1870
1872
  project[alias] = 1;
@@ -1908,45 +1910,41 @@ function BuildGridFieldProjection(project, field, group) {
1908
1910
  // }
1909
1911
  // };
1910
1912
  // break;
1911
- case "dropdown":
1912
- alias = fldName + constants_1.default.LookupAlias;
1913
- project[fldName] = 1;
1914
- project[alias] = 1;
1915
- if (field.Schema.LookupObject) {
1916
- for (var i = 0; i < field.Schema.LookupFields.length; i++) {
1917
- //searchConcatArry.push({ "$ifNull": ['$' + alias + '.' + field.Schema.LookupFields[i], ""] });
1918
- // added by Mohan, make int to string and concat
1919
- searchConcatArry.push({ "$ifNull": [{ $toString: '$' + alias + '.' + field.Schema.LookupFields[i] }, ""] });
1920
- if (i < field.Schema.LookupFields.length - 1) {
1921
- searchConcatArry.push(" ");
1922
- }
1923
- }
1924
- ;
1925
- project[fldName + '_SearchValue'] = { $concat: searchConcatArry };
1926
- }
1927
- else {
1928
- project[fldName + '_SearchValue'] = '$' + alias + '.Value';
1929
- }
1930
- break;
1931
- case "multiselect":
1932
- alias = fldName + constants_1.default.LookupAlias;
1933
- project[fldName] = 1;
1934
- project[alias] = 1;
1935
- if (field.Schema.LookupObject) {
1936
- for (var i = 0; i < field.Schema.LookupFields.length; i++) {
1937
- searchConcatArry.push({ "$ifNull": ['$' + alias + '.' + field.Schema.LookupFields[i], [" "]] });
1938
- if (i < field.Schema.LookupFields.length - 1) {
1939
- searchConcatArry.push([" "]);
1940
- }
1941
- }
1942
- ;
1943
- project[fldName + '_SearchValue'] = { $concatArrays: searchConcatArry };
1944
- }
1945
- else {
1946
- searchConcatArry.push('$' + alias + '.Value');
1947
- project[fldName + '_SearchValue'] = { $concatArrays: searchConcatArry };
1948
- }
1949
- break;
1913
+ // case "dropdown":
1914
+ // alias = fldName + constants.LookupAlias;
1915
+ // project[fldName] = 1;
1916
+ // project[alias] = 1;
1917
+ // if (field.Schema.LookupObject) {
1918
+ // for (let i = 0; i < field.Schema.LookupFields.length; i++) {
1919
+ // //searchConcatArry.push({ "$ifNull": ['$' + alias + '.' + field.Schema.LookupFields[i], ""] });
1920
+ // // added by Mohan, make int to string and concat
1921
+ // searchConcatArry.push({ "$ifNull": [{$toString : '$' + alias + '.' + field.Schema.LookupFields[i]}, ""] });
1922
+ // if (i < field.Schema.LookupFields.length - 1) {
1923
+ // searchConcatArry.push(" ");
1924
+ // }
1925
+ // };
1926
+ // project[fldName + '_SearchValue'] = { $concat: searchConcatArry };
1927
+ // } else {
1928
+ // project[fldName + '_SearchValue'] = '$' + alias + '.Value';
1929
+ // }
1930
+ // break;
1931
+ // case "multiselect":
1932
+ // alias = fldName + constants.LookupAlias;
1933
+ // project[fldName] = 1;
1934
+ // project[alias] = 1;
1935
+ // if (field.Schema.LookupObject) {
1936
+ // for (let i = 0; i < field.Schema.LookupFields.length; i++) {
1937
+ // searchConcatArry.push({ "$ifNull": ['$' + alias + '.' + field.Schema.LookupFields[i], [" "] ] });
1938
+ // if (i < field.Schema.LookupFields.length - 1) {
1939
+ // searchConcatArry.push([" "]);
1940
+ // }
1941
+ // };
1942
+ // project[fldName + '_SearchValue'] = { $concatArrays: searchConcatArry };
1943
+ // } else {
1944
+ // searchConcatArry.push('$' + alias + '.Value');
1945
+ // project[fldName + '_SearchValue'] = { $concatArrays: searchConcatArry };
1946
+ // }
1947
+ // break;
1950
1948
  case "file":
1951
1949
  case "image":
1952
1950
  alias = fldName + constants_1.default.LookupAlias;
@@ -4578,6 +4576,9 @@ function ValidateUserInput(options) {
4578
4576
  }
4579
4577
  fieldName = pageField.Name;
4580
4578
  fieldData = inputFields[fieldName];
4579
+ if (pageField.IsDisplayOnly) {
4580
+ delete inputFields[pageField.Name];
4581
+ }
4581
4582
  field = schemaFields.find(function (x) { return x.Name == fieldName; });
4582
4583
  if (!field) return [3 /*break*/, 52];
4583
4584
  if (fieldData && IsStringValue(fieldData) && field.UIDataType != 'dropdown') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.296",
3
+ "version": "1.0.298",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {