@optimiser/common 1.0.296 → 1.0.297
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 +37 -39
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -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
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
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;
|