@izara_project/izara-shared-search-and-sort 1.0.4 → 1.0.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.
- package/index.js +3 -1
- package/package.json +3 -1
- package/src/DataFieldsSharedLib.js +1 -1
- package/src/FiltersSharedLib.js +0 -408
- package/src/LogicalStructureSharedLib.js +1152 -0
- package/src/SearchSortSharedLib.js +23 -13
|
@@ -23,10 +23,9 @@ import lodash from 'lodash';
|
|
|
23
23
|
const { isEmpty } = lodash;
|
|
24
24
|
import filtersSharedLib from './FiltersSharedLib.js'; //const filtersSharedLib = require('./FiltersSharedLib');
|
|
25
25
|
import dataFieldsSharedLib from './DataFieldsSharedLib.js';
|
|
26
|
-
import searchResultShared from '@izara_project/izara-core-library-search-result';
|
|
27
26
|
|
|
28
27
|
|
|
29
|
-
function createSearchRequest(
|
|
28
|
+
async function createSearchRequest(
|
|
30
29
|
objType,
|
|
31
30
|
initialLogicalElementId,
|
|
32
31
|
logicalElements,
|
|
@@ -54,6 +53,16 @@ function createSearchRequest(
|
|
|
54
53
|
let errorsObject = {};
|
|
55
54
|
let errorsFound = [];
|
|
56
55
|
|
|
56
|
+
let requiredDataPromise = dataFieldsSharedLib.createRequiredData(
|
|
57
|
+
objType,
|
|
58
|
+
requiredDataFields,
|
|
59
|
+
complexFilterCombinations,
|
|
60
|
+
perParentCombinations,
|
|
61
|
+
requiredDataLinkStepObjects,
|
|
62
|
+
requiredDataLinkSteps,
|
|
63
|
+
values,
|
|
64
|
+
);
|
|
65
|
+
|
|
57
66
|
//* create complexFilter normalize to send backend
|
|
58
67
|
let [
|
|
59
68
|
complexFilterRequest,
|
|
@@ -79,15 +88,16 @@ function createSearchRequest(
|
|
|
79
88
|
Object.assign(errorsObject, complexErrorsObject);
|
|
80
89
|
}
|
|
81
90
|
|
|
82
|
-
let requiredData = dataFieldsSharedLib.createRequiredData(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
);
|
|
91
|
+
// let requiredData = dataFieldsSharedLib.createRequiredData(
|
|
92
|
+
// objType,
|
|
93
|
+
// requiredDataFields,
|
|
94
|
+
// complexFilterCombinations,
|
|
95
|
+
// perParentCombinations,
|
|
96
|
+
// requiredDataLinkStepObjects,
|
|
97
|
+
// requiredDataLinkSteps,
|
|
98
|
+
// values,
|
|
99
|
+
// );
|
|
100
|
+
let requiredData = await requiredDataPromise;
|
|
91
101
|
console.log('return create requiredData: ', requiredData);
|
|
92
102
|
|
|
93
103
|
if (requiredData.status === 'invalid' || requiredData.errorsFound.length > 0) {
|
|
@@ -142,7 +152,7 @@ function createSearchRequest(
|
|
|
142
152
|
|
|
143
153
|
}
|
|
144
154
|
|
|
145
|
-
function createSortRequest(
|
|
155
|
+
async function createSortRequest(
|
|
146
156
|
objType,
|
|
147
157
|
initialLogicalElementId,
|
|
148
158
|
logicalElements,
|
|
@@ -198,7 +208,7 @@ function createSortRequest(
|
|
|
198
208
|
}
|
|
199
209
|
console.log("sortFieldMain: ", sortFieldMain)
|
|
200
210
|
|
|
201
|
-
let [searchResultRequest, status, errorsObject, errorsFound] = createSearchRequest(
|
|
211
|
+
let [searchResultRequest, status, errorsObject, errorsFound] = await createSearchRequest(
|
|
202
212
|
objType,
|
|
203
213
|
initialLogicalElementId,
|
|
204
214
|
logicalElements,
|