@izara_project/izara-shared-search-and-sort 1.0.3 → 1.0.4
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/package.json +1 -1
- package/src/DataFieldsSharedLib.js +118 -91
- package/src/FiltersSharedLib.js +257 -184
- package/src/SearchSortSharedLib.js +23 -27
package/package.json
CHANGED
|
@@ -28,7 +28,6 @@ const { isEmpty } = lodash;
|
|
|
28
28
|
import filtersSharedLib from './FiltersSharedLib.js'; //const filtersSharedLib = require('./FiltersSharedLib');
|
|
29
29
|
|
|
30
30
|
async function createRequiredData(
|
|
31
|
-
_izContext,
|
|
32
31
|
objType,
|
|
33
32
|
requiredDataFields,
|
|
34
33
|
complexFilterCombinations,
|
|
@@ -37,7 +36,7 @@ async function createRequiredData(
|
|
|
37
36
|
requiredDataLinkSteps,
|
|
38
37
|
values,
|
|
39
38
|
) {
|
|
40
|
-
|
|
39
|
+
console.log('createRequiredData: ', {
|
|
41
40
|
objType,
|
|
42
41
|
requiredDataFields,
|
|
43
42
|
complexFilterCombinations,
|
|
@@ -57,18 +56,17 @@ async function createRequiredData(
|
|
|
57
56
|
let setComplexFilterCombinations = {};
|
|
58
57
|
let setFilterElementsLink = {}
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
console.log('--------------- start requiredData fields ---------------')
|
|
61
60
|
for (const requiredDataFieldId of requiredDataFields) {
|
|
62
|
-
|
|
61
|
+
console.log('extract requiredDataFields: ', requiredDataFieldId);
|
|
63
62
|
|
|
64
63
|
let requiredDataLinkObject = requiredDataLinkStepObjects[requiredDataFieldId];
|
|
65
|
-
|
|
64
|
+
console.log('requiredDataLinkObject: ', requiredDataLinkObject);
|
|
66
65
|
|
|
67
66
|
let linkSteps = requiredDataLinkObject.linkSteps;
|
|
68
|
-
|
|
67
|
+
console.log('initial data: ', { linkSteps });
|
|
69
68
|
|
|
70
69
|
let [fieldName, returnValue, linkPathErrorObject, linkPathErrorsFound] = await createLinkPath(
|
|
71
|
-
_izContext,
|
|
72
70
|
linkSteps,
|
|
73
71
|
requiredDataLinkStepObjects,
|
|
74
72
|
requiredDataLinkSteps,
|
|
@@ -78,7 +76,7 @@ async function createRequiredData(
|
|
|
78
76
|
errorsObject,
|
|
79
77
|
errorsFound
|
|
80
78
|
);
|
|
81
|
-
|
|
79
|
+
console.log('return createLinkPath: ', {
|
|
82
80
|
fieldName,
|
|
83
81
|
returnValue,
|
|
84
82
|
linkPathErrorObject,
|
|
@@ -120,10 +118,10 @@ async function createRequiredData(
|
|
|
120
118
|
initialObjType: objType,
|
|
121
119
|
linkSteps: returnValue.linkSteps
|
|
122
120
|
};
|
|
123
|
-
|
|
121
|
+
console.log('pathObject: ', pathObject);
|
|
124
122
|
|
|
125
123
|
let pathId = hash(pathObject);
|
|
126
|
-
|
|
124
|
+
console.log('pathId: ', pathId);
|
|
127
125
|
|
|
128
126
|
let setObject = {
|
|
129
127
|
fieldName: fieldName,
|
|
@@ -159,10 +157,10 @@ async function createRequiredData(
|
|
|
159
157
|
requiredFieldNameObject.filterElements = returnValue.filterElements;
|
|
160
158
|
Object.assign(setFilterElementsLink, returnValue.filterElements);
|
|
161
159
|
};
|
|
162
|
-
|
|
160
|
+
console.log('requiredFieldNameObject: ', requiredFieldNameObject);
|
|
163
161
|
|
|
164
162
|
let requiredDataFieldNameId = hash(requiredFieldNameObject);
|
|
165
|
-
|
|
163
|
+
console.log('requiredDataFieldNameId: ', requiredDataFieldNameId);
|
|
166
164
|
|
|
167
165
|
if (isEmpty(requiredDataObject)) {
|
|
168
166
|
requiredDataObject = {
|
|
@@ -174,15 +172,15 @@ async function createRequiredData(
|
|
|
174
172
|
};
|
|
175
173
|
|
|
176
174
|
} else {
|
|
177
|
-
|
|
175
|
+
console.log("------- requiredData has only fieldName ---------");
|
|
178
176
|
|
|
179
177
|
let requiredFieldNameObject = {
|
|
180
178
|
fieldName: fieldName
|
|
181
179
|
};
|
|
182
|
-
|
|
180
|
+
console.log("requiredFieldNameObject: ", requiredFieldNameObject);
|
|
183
181
|
|
|
184
182
|
let requiredDataFieldNameId = hash(requiredFieldNameObject);
|
|
185
|
-
|
|
183
|
+
console.log("requiredDataFieldNameId: ", requiredDataFieldNameId);
|
|
186
184
|
|
|
187
185
|
if (isEmpty(requiredDataObject)) {
|
|
188
186
|
|
|
@@ -194,7 +192,7 @@ async function createRequiredData(
|
|
|
194
192
|
requiredDataObject[requiredDataFieldNameId] = requiredFieldNameObject;
|
|
195
193
|
};
|
|
196
194
|
}
|
|
197
|
-
|
|
195
|
+
console.log("before return linkPath: ", { requiredDataObject, linkPathObjects, linkPathSteps });
|
|
198
196
|
}
|
|
199
197
|
|
|
200
198
|
let requiredObject = {};
|
|
@@ -220,11 +218,11 @@ async function createRequiredData(
|
|
|
220
218
|
if (!isEmpty(setFilterElementsLink)) {
|
|
221
219
|
requiredObject.filterElements = setFilterElementsLink;
|
|
222
220
|
};
|
|
223
|
-
|
|
221
|
+
console.log('requiredObject: ', requiredObject);
|
|
224
222
|
|
|
225
223
|
if (!isEmpty(requiredObject)) {
|
|
226
224
|
requiredDataHash = hash(requiredObject);
|
|
227
|
-
|
|
225
|
+
console.log('requiredDataHash: ', requiredDataHash);
|
|
228
226
|
}
|
|
229
227
|
|
|
230
228
|
let status = 'valid"';
|
|
@@ -232,7 +230,7 @@ async function createRequiredData(
|
|
|
232
230
|
status = 'invalid';
|
|
233
231
|
};
|
|
234
232
|
|
|
235
|
-
|
|
233
|
+
console.log('return : ', {
|
|
236
234
|
requiredDataHash: requiredDataHash,
|
|
237
235
|
requiredDataObjects: requiredDataObject,
|
|
238
236
|
linkPathObjects: linkPathObjects,
|
|
@@ -262,7 +260,6 @@ async function createRequiredData(
|
|
|
262
260
|
|
|
263
261
|
|
|
264
262
|
async function createLinkPath(
|
|
265
|
-
_izContext,
|
|
266
263
|
linkSteps,
|
|
267
264
|
requiredDataLinkStepObjects,
|
|
268
265
|
requiredDataLinkSteps,
|
|
@@ -275,7 +272,7 @@ async function createLinkPath(
|
|
|
275
272
|
previousLinkId = null,
|
|
276
273
|
previousLink = null
|
|
277
274
|
) {
|
|
278
|
-
|
|
275
|
+
console.log('create LinkPath: ', {
|
|
279
276
|
linkSteps,
|
|
280
277
|
requiredDataLinkStepObjects,
|
|
281
278
|
requiredDataLinkSteps,
|
|
@@ -303,24 +300,23 @@ async function createLinkPath(
|
|
|
303
300
|
// let childLinkErrors = []
|
|
304
301
|
|
|
305
302
|
let linkStepId = linkSteps[index];
|
|
306
|
-
|
|
303
|
+
console.log('linkStepId: ', linkStepId);
|
|
307
304
|
|
|
308
305
|
let linkStep = requiredDataLinkSteps[linkStepId];
|
|
309
|
-
|
|
306
|
+
console.log('linkStep: ', linkStep);
|
|
310
307
|
|
|
311
308
|
if (index + 1 === linkSteps.length) {
|
|
312
309
|
// last link that has only fieldName
|
|
313
|
-
|
|
310
|
+
console.log('---------- is final link ----------', { index, linkStep });
|
|
314
311
|
|
|
315
312
|
return [linkStep.fieldName, returnValue, errorsObject, errorsFound]
|
|
316
313
|
|
|
317
314
|
} else {
|
|
318
315
|
// has nextLink
|
|
319
|
-
|
|
316
|
+
console.log('---------- is next link ----------', { index, linkStep });
|
|
320
317
|
|
|
321
318
|
let conditionsPromise = checkConditionsLink(
|
|
322
319
|
// let [conditions, conditionErrObject, conditionErrFound] = await this.checkConditionsLink(
|
|
323
|
-
_izContext,
|
|
324
320
|
linkStep.pathLinkType.objType,
|
|
325
321
|
linkStep,
|
|
326
322
|
perParentCombinations,
|
|
@@ -334,7 +330,6 @@ async function createLinkPath(
|
|
|
334
330
|
);
|
|
335
331
|
|
|
336
332
|
[fieldName, returnValue, errorsObject, errorsFound] = await createLinkPath(
|
|
337
|
-
_izContext,
|
|
338
333
|
linkSteps,
|
|
339
334
|
requiredDataLinkStepObjects,
|
|
340
335
|
requiredDataLinkSteps,
|
|
@@ -345,7 +340,7 @@ async function createLinkPath(
|
|
|
345
340
|
errorsFound,
|
|
346
341
|
index + 1
|
|
347
342
|
)
|
|
348
|
-
|
|
343
|
+
console.log('createLinkPath in link', {
|
|
349
344
|
fieldName,
|
|
350
345
|
returnValue,
|
|
351
346
|
errorsObject,
|
|
@@ -353,7 +348,7 @@ async function createLinkPath(
|
|
|
353
348
|
index
|
|
354
349
|
});
|
|
355
350
|
|
|
356
|
-
|
|
351
|
+
console.log('linkStep', linkStep);
|
|
357
352
|
|
|
358
353
|
let [conditions, conditionErrObject, conditionErrFound] = await conditionsPromise;
|
|
359
354
|
|
|
@@ -363,7 +358,7 @@ async function createLinkPath(
|
|
|
363
358
|
};
|
|
364
359
|
|
|
365
360
|
if (!isEmpty(returnValue)) {
|
|
366
|
-
|
|
361
|
+
console.log('----------------- has returnValue ---------------------', { index, fieldName, returnValue, conditions })
|
|
367
362
|
|
|
368
363
|
let linkStepObject = {
|
|
369
364
|
pathLinkType: linkStep.pathLinkType
|
|
@@ -422,7 +417,7 @@ async function createLinkPath(
|
|
|
422
417
|
};
|
|
423
418
|
}
|
|
424
419
|
|
|
425
|
-
|
|
420
|
+
console.log('returnValue', returnValue);
|
|
426
421
|
|
|
427
422
|
} else {
|
|
428
423
|
//* error
|
|
@@ -457,16 +452,16 @@ async function createLinkPath(
|
|
|
457
452
|
};
|
|
458
453
|
};
|
|
459
454
|
|
|
460
|
-
|
|
455
|
+
console.log('linkStepObject', linkStepObject);
|
|
461
456
|
let linkStepId = hash(linkStepObject);
|
|
462
|
-
|
|
457
|
+
console.log('linkStepId', linkStepId);
|
|
463
458
|
|
|
464
459
|
returnValue['linkSteps'].unshift(linkStepId);
|
|
465
460
|
returnValue['linkStepObjects'] = Object.assign({ [linkStepId]: linkStepObject }, returnValue['linkStepObjects']);
|
|
466
|
-
|
|
461
|
+
console.log('returnValue', returnValue);
|
|
467
462
|
|
|
468
463
|
} else {
|
|
469
|
-
|
|
464
|
+
console.log('----------------- no returnValue ---------------------', { index, fieldName, conditions })
|
|
470
465
|
//returnValue: { linkSteps, linkStepsObjects, perParent, combinations, sortFieldLinkStepObjects }
|
|
471
466
|
//sortFieldLinkStepObjects from in sortField in link
|
|
472
467
|
|
|
@@ -557,15 +552,15 @@ async function createLinkPath(
|
|
|
557
552
|
};
|
|
558
553
|
};
|
|
559
554
|
|
|
560
|
-
|
|
555
|
+
console.log('linkStepObject', linkStepObject);
|
|
561
556
|
let linkStepId = hash(linkStepObject);
|
|
562
|
-
|
|
557
|
+
console.log('linkStepId', linkStepId);
|
|
563
558
|
|
|
564
559
|
returnValue.linkSteps = [linkStepId];
|
|
565
560
|
returnValue.linkStepObjects = {
|
|
566
561
|
[linkStepId]: linkStepObject
|
|
567
562
|
};
|
|
568
|
-
|
|
563
|
+
console.log('returnValue', returnValue);
|
|
569
564
|
}
|
|
570
565
|
}
|
|
571
566
|
return [fieldName, returnValue, errorsObject, errorsFound]
|
|
@@ -573,7 +568,6 @@ async function createLinkPath(
|
|
|
573
568
|
|
|
574
569
|
|
|
575
570
|
async function checkConditionsLink(
|
|
576
|
-
_izContext,
|
|
577
571
|
objType,
|
|
578
572
|
linkStepObject,
|
|
579
573
|
perParentCombinations,
|
|
@@ -585,7 +579,7 @@ async function checkConditionsLink(
|
|
|
585
579
|
errorsObject,
|
|
586
580
|
errorsFound
|
|
587
581
|
) {
|
|
588
|
-
|
|
582
|
+
console.log('checkConditionsLink:', {
|
|
589
583
|
objType,
|
|
590
584
|
linkStepObject,
|
|
591
585
|
perParentCombinations,
|
|
@@ -602,16 +596,15 @@ async function checkConditionsLink(
|
|
|
602
596
|
let conditionLinkObject = {}
|
|
603
597
|
|
|
604
598
|
if (linkStepObject.hasOwnProperty('filterElements')) {
|
|
605
|
-
|
|
599
|
+
console.log('------------ has filterElements ------------');
|
|
606
600
|
|
|
607
|
-
let [complexFilterRequest, status, filterErrorsObject, filterErrorsFound] = filtersSharedLib.
|
|
608
|
-
_izContext,
|
|
601
|
+
let [complexFilterRequest, status, filterErrorsObject, filterErrorsFound] = filtersSharedLib.createFiltersRequest(
|
|
609
602
|
linkStepObject.filterElements.objType,
|
|
610
603
|
linkStepObject.filterElements.initialLogicalElementId,
|
|
611
604
|
linkStepObject.filterElements.logicalElements,
|
|
612
605
|
values
|
|
613
606
|
);
|
|
614
|
-
|
|
607
|
+
console.log('return complexFilter for filterElements: ', {
|
|
615
608
|
complexFilterRequest,
|
|
616
609
|
status,
|
|
617
610
|
filterErrorsObject,
|
|
@@ -623,11 +616,11 @@ async function checkConditionsLink(
|
|
|
623
616
|
errorsFound = errorsFound.concat(filterErrorsFound)
|
|
624
617
|
};
|
|
625
618
|
conditionLinkObject.filterElements = complexFilterRequest.filterElements;
|
|
626
|
-
|
|
619
|
+
console.log('conditionLinkObject in condition link: ', conditionLinkObject);
|
|
627
620
|
}
|
|
628
621
|
|
|
629
622
|
if (linkStepObject.hasOwnProperty('aggregate')) {
|
|
630
|
-
|
|
623
|
+
console.log('------------ has aggregate ------------');
|
|
631
624
|
if (!linkStepObject.hasOwnProperty('sortFields')) {
|
|
632
625
|
errorsFound.push('if has aggregate need to has sortFields, too');
|
|
633
626
|
};
|
|
@@ -649,19 +642,18 @@ async function checkConditionsLink(
|
|
|
649
642
|
let setPerParentCombinations = {};
|
|
650
643
|
let setFilterElements = {};
|
|
651
644
|
|
|
652
|
-
|
|
645
|
+
console.log('linkStepObject.sortFields', linkStepObject.sortFields);
|
|
653
646
|
|
|
654
647
|
for (const sortField of linkStepObject.sortFields) {
|
|
655
|
-
|
|
656
|
-
|
|
648
|
+
console.log('sortField: ', sortField);
|
|
649
|
+
console.log('requiredDataLinkSteps: ', requiredDataLinkSteps);
|
|
657
650
|
let requiredDataLinkStepSortField = requiredDataLinkStepObjects[sortField.requiredDataLinkStepObjectId];
|
|
658
|
-
|
|
651
|
+
console.log('requiredDataLinkStepSortField: ', requiredDataLinkStepSortField);
|
|
659
652
|
|
|
660
|
-
|
|
653
|
+
console.log(' requiredDataLinkStepSortField.linkSteps: ', requiredDataLinkStepSortField.linkSteps);
|
|
661
654
|
|
|
662
655
|
//* make all linkPath in here and send out to combine allLinkPath
|
|
663
656
|
let [fieldName, childLinkStep, linkErrorsObject, linkErrorsFound] = await createLinkPath(
|
|
664
|
-
_izContext,
|
|
665
657
|
requiredDataLinkStepSortField.linkSteps,
|
|
666
658
|
requiredDataLinkStepObjects,
|
|
667
659
|
requiredDataLinkSteps,
|
|
@@ -671,7 +663,7 @@ async function checkConditionsLink(
|
|
|
671
663
|
errorsObject,
|
|
672
664
|
errorsFound
|
|
673
665
|
);
|
|
674
|
-
|
|
666
|
+
console.log(' cratelinkPath in checkCondition for sortField: ', {
|
|
675
667
|
fieldName,
|
|
676
668
|
childLinkStep,
|
|
677
669
|
linkErrorsObject,
|
|
@@ -685,12 +677,12 @@ async function checkConditionsLink(
|
|
|
685
677
|
initialObjType: objType,
|
|
686
678
|
linkSteps: childLinkStep.linkSteps
|
|
687
679
|
};
|
|
688
|
-
|
|
680
|
+
console.log('pathObject: ', pathObject);
|
|
689
681
|
|
|
690
682
|
let pathId = hash(pathObject);
|
|
691
|
-
|
|
683
|
+
console.log('pathId: ', pathId);
|
|
692
684
|
|
|
693
|
-
|
|
685
|
+
console.log('linkPathObjects xxxxxx: ', linkPathObjects);
|
|
694
686
|
|
|
695
687
|
Object.assign(linkPathObjects, { [pathId]: pathObject });
|
|
696
688
|
|
|
@@ -736,7 +728,7 @@ async function checkConditionsLink(
|
|
|
736
728
|
fieldName: fieldName,
|
|
737
729
|
dataType: sortField.dataType
|
|
738
730
|
});
|
|
739
|
-
|
|
731
|
+
console.log('sortFieldObjects: ', sortFieldObjects);
|
|
740
732
|
|
|
741
733
|
};
|
|
742
734
|
|
|
@@ -759,7 +751,7 @@ async function checkConditionsLink(
|
|
|
759
751
|
};
|
|
760
752
|
};
|
|
761
753
|
|
|
762
|
-
|
|
754
|
+
console.log('conditionLinkObject: ', conditionLinkObject);
|
|
763
755
|
|
|
764
756
|
} else {
|
|
765
757
|
if (linkStepObject.hasOwnProperty('combine')) {
|
|
@@ -768,7 +760,7 @@ async function checkConditionsLink(
|
|
|
768
760
|
};
|
|
769
761
|
|
|
770
762
|
if (linkStepObject.hasOwnProperty('requestProperties')) {
|
|
771
|
-
|
|
763
|
+
console.log('------------ link has requestProperties ------------');
|
|
772
764
|
|
|
773
765
|
let perParentCombinationIds = [];
|
|
774
766
|
let perParentCombinationObjects = {}
|
|
@@ -776,27 +768,26 @@ async function checkConditionsLink(
|
|
|
776
768
|
let applyCombinations = [];
|
|
777
769
|
|
|
778
770
|
for (const [tag, requestPropertyId] of Object.entries(linkStepObject.requestProperties)) {
|
|
779
|
-
|
|
771
|
+
console.log('extract requestProperties', { tag, requestPropertyId });
|
|
780
772
|
let requestPropertyObject = values[requestPropertyId];
|
|
781
|
-
|
|
773
|
+
console.log('extract requestProperties', requestPropertyObject);
|
|
782
774
|
|
|
783
775
|
|
|
784
776
|
if (requestPropertyObject.hasOwnProperty('valueSource')) {
|
|
785
777
|
|
|
786
778
|
if (requestPropertyObject.valueSource === 'perParentCombination') {
|
|
787
|
-
|
|
779
|
+
console.log('------------- perParentCombinations -------------');
|
|
788
780
|
|
|
789
781
|
let perParentCombinationObject = perParentCombinations[requestPropertyObject.perParentCombinationId];
|
|
790
|
-
|
|
782
|
+
console.log('perParentCombinationObject', perParentCombinationObject);
|
|
791
783
|
|
|
792
|
-
let [complexFilterRequest, status, perParentErrorsObject, perParentErrorsFound] = filtersSharedLib.
|
|
793
|
-
_izContext,
|
|
784
|
+
let [complexFilterRequest, status, perParentErrorsObject, perParentErrorsFound] = filtersSharedLib.createFiltersRequest(
|
|
794
785
|
perParentCombinationObject.objType,
|
|
795
786
|
perParentCombinationObject.initialLogicalElementId,
|
|
796
787
|
perParentCombinationObject.logicalElements,
|
|
797
788
|
values,
|
|
798
789
|
);
|
|
799
|
-
|
|
790
|
+
console.log('return complexFilter for perParentCombinations: ', {
|
|
800
791
|
complexFilterRequest,
|
|
801
792
|
status,
|
|
802
793
|
perParentErrorsObject,
|
|
@@ -820,25 +811,24 @@ async function checkConditionsLink(
|
|
|
820
811
|
filterElements: complexFilterRequest.filterElements
|
|
821
812
|
}
|
|
822
813
|
});
|
|
823
|
-
|
|
814
|
+
console.log('set perParentCombinations: ', { perParentCombinationIds, perParentCombinationObjects });
|
|
824
815
|
|
|
825
816
|
} else if (requestPropertyObject.valueSource === 'complexFilterCombination') {
|
|
826
|
-
|
|
817
|
+
console.log('------------- complexFilterCombination will set applyCombinations -------------', complexFilterCombinations);
|
|
827
818
|
|
|
828
819
|
let complexFilterCombinationId = requestPropertyObject.complexFilterCombinationId;
|
|
829
|
-
|
|
820
|
+
console.log('complexFilterCombinationId: ', complexFilterCombinationId);
|
|
830
821
|
|
|
831
822
|
let complexFilterCombinationObject = complexFilterCombinations[complexFilterCombinationId];
|
|
832
|
-
|
|
823
|
+
console.log('complexFilterCombinationObject: ', complexFilterCombinationObject);
|
|
833
824
|
|
|
834
|
-
let [complexFilterRequest, status, complexFilterErrorsObject, complexFilterErrorsFound] = filtersSharedLib.
|
|
835
|
-
_izContext,
|
|
825
|
+
let [complexFilterRequest, status, complexFilterErrorsObject, complexFilterErrorsFound] = filtersSharedLib.createFiltersRequest(
|
|
836
826
|
complexFilterCombinationObject.objType,
|
|
837
827
|
complexFilterCombinationObject.initialLogicalElementId,
|
|
838
828
|
complexFilterCombinationObject.logicalElements,
|
|
839
829
|
values
|
|
840
830
|
);
|
|
841
|
-
|
|
831
|
+
console.log('return complexFilter for complexFilterCombinations: ', {
|
|
842
832
|
complexFilterRequest,
|
|
843
833
|
status,
|
|
844
834
|
complexFilterErrorsObject,
|
|
@@ -858,7 +848,7 @@ async function checkConditionsLink(
|
|
|
858
848
|
filterMainId: complexFilterRequest.filterMainId,
|
|
859
849
|
// identifiersFieldName: requestPropertyObject.identifierFieldName
|
|
860
850
|
});
|
|
861
|
-
|
|
851
|
+
console.log('applyCombinations: ', applyCombinations);
|
|
862
852
|
|
|
863
853
|
Object.assign(complexFilterCombinationObjects, {
|
|
864
854
|
[complexFilterRequest.filterMainId]: {
|
|
@@ -890,7 +880,7 @@ async function checkConditionsLink(
|
|
|
890
880
|
};
|
|
891
881
|
};
|
|
892
882
|
|
|
893
|
-
|
|
883
|
+
console.log('perParentCombinations: ', {
|
|
894
884
|
perParentCombinationIds,
|
|
895
885
|
perParentCombinationObjects,
|
|
896
886
|
applyCombinations
|
|
@@ -905,15 +895,14 @@ async function checkConditionsLink(
|
|
|
905
895
|
conditionLinkObject.applyCombinations = applyCombinations
|
|
906
896
|
conditionLinkObject.complexFilterCombinationObjects = complexFilterCombinationObjects;
|
|
907
897
|
};
|
|
908
|
-
|
|
898
|
+
console.log('conditionLinkObject: ', conditionLinkObject);
|
|
909
899
|
}
|
|
910
|
-
|
|
900
|
+
console.log('conditionLinkObject', conditionLinkObject);
|
|
911
901
|
return [conditionLinkObject, errorsObject, errorsFound];
|
|
912
902
|
}
|
|
913
903
|
|
|
914
904
|
|
|
915
905
|
function checkConditionsLinkStep(
|
|
916
|
-
_izContext,
|
|
917
906
|
multipleIdentifiers,
|
|
918
907
|
linkConfig,
|
|
919
908
|
combine
|
|
@@ -935,7 +924,7 @@ function checkConditionsLinkStep(
|
|
|
935
924
|
}
|
|
936
925
|
|
|
937
926
|
let requestProperties = false;
|
|
938
|
-
if (linkConfig.hasOwnProperty('requestProperties')) {
|
|
927
|
+
if (linkConfig.hasOwnProperty('requestProperties') && !isEmpty(linkConfig.requestProperties)) {
|
|
939
928
|
requestProperties = true;
|
|
940
929
|
}
|
|
941
930
|
if (multipleIdentifiers) {
|
|
@@ -984,44 +973,82 @@ function checkConditionsLinkStep(
|
|
|
984
973
|
|
|
985
974
|
|
|
986
975
|
function checkMultipleIdentifers(
|
|
987
|
-
_izContext,
|
|
988
976
|
linkConfig = {},
|
|
989
|
-
|
|
990
|
-
comparison = false,
|
|
991
|
-
combine = false,
|
|
992
|
-
applyCombinations = false,
|
|
977
|
+
conditions = {},
|
|
993
978
|
multipleIdentifiers = false,
|
|
979
|
+
//
|
|
994
980
|
) {
|
|
981
|
+
// conditions: {
|
|
982
|
+
// aggregate ,
|
|
983
|
+
// comparison,
|
|
984
|
+
// combine ,
|
|
985
|
+
// applyCombinations ,
|
|
986
|
+
// multipleIdentifiers,
|
|
987
|
+
// }
|
|
988
|
+
|
|
995
989
|
let manyIdentifiers = null;
|
|
990
|
+
|
|
996
991
|
if (!isEmpty(linkConfig)) {
|
|
992
|
+
|
|
997
993
|
let toMany = false;
|
|
998
994
|
if (linkConfig.other.linkType === 'many') {
|
|
999
995
|
toMany = true;
|
|
1000
996
|
};
|
|
1001
997
|
|
|
1002
998
|
if (multipleIdentifiers) {
|
|
999
|
+
|
|
1003
1000
|
if (toMany || !toMany) {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
if (aggregate) {
|
|
1008
|
-
|
|
1001
|
+
|
|
1002
|
+
if (conditions.hasOwnProperty("combine") && conditions.combine === true) {
|
|
1003
|
+
|
|
1004
|
+
if (conditions.hasOwnProperty("aggregate")) {
|
|
1005
|
+
if (conditions.aggregate === true) {
|
|
1006
|
+
manyIdentifiers = false;
|
|
1007
|
+
}
|
|
1009
1008
|
}
|
|
1009
|
+
|
|
1010
|
+
} else {
|
|
1011
|
+
manyIdentifiers = true;
|
|
1010
1012
|
}
|
|
1011
1013
|
}
|
|
1014
|
+
|
|
1012
1015
|
} else {
|
|
1016
|
+
|
|
1013
1017
|
if (toMany) {
|
|
1014
|
-
|
|
1018
|
+
|
|
1019
|
+
if (conditions.hasOwnProperty("aggregate") && conditions.aggregate === true) {
|
|
1015
1020
|
manyIdentifiers = false;
|
|
1016
1021
|
} else {
|
|
1017
1022
|
manyIdentifiers = true;
|
|
1018
1023
|
}
|
|
1024
|
+
|
|
1019
1025
|
} else {
|
|
1020
|
-
|
|
1026
|
+
|
|
1027
|
+
if (isEmpty(conditions)) {
|
|
1028
|
+
|
|
1021
1029
|
manyIdentifiers = false;
|
|
1030
|
+
|
|
1031
|
+
} else {
|
|
1032
|
+
|
|
1033
|
+
if (conditions.hasOwnProperty("applyCombinations") && conditions.applyCombinations === true) {
|
|
1034
|
+
manyIdentifiers = true;
|
|
1035
|
+
} else {
|
|
1036
|
+
|
|
1037
|
+
if ((conditions.hasOwnProperty("aggregate") && conditions.aggregate === true)
|
|
1038
|
+
|| (conditions.hasOwnProperty("combine") && conditions.combine === true)
|
|
1039
|
+
|| (conditions.hasOwnProperty("comparison") && conditions.comparison === true)
|
|
1040
|
+
) {
|
|
1041
|
+
manyIdentifiers = null;
|
|
1042
|
+
} else {
|
|
1043
|
+
manyIdentifiers = false;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1022
1046
|
}
|
|
1023
1047
|
}
|
|
1024
1048
|
}
|
|
1049
|
+
|
|
1050
|
+
} else {
|
|
1051
|
+
manyIdentifiers = false
|
|
1025
1052
|
}
|
|
1026
1053
|
return manyIdentifiers
|
|
1027
1054
|
}
|