@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/src/FiltersSharedLib.js
CHANGED
|
@@ -61,13 +61,12 @@ function validateFilterElement(
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function createFiltersRequest(
|
|
64
|
-
_izContext,
|
|
65
64
|
objType,
|
|
66
65
|
initialLogicalElementId,
|
|
67
66
|
logicalElements,
|
|
68
67
|
values,
|
|
69
68
|
) {
|
|
70
|
-
|
|
69
|
+
console.log('createFiltersRequest: ', {
|
|
71
70
|
objType,
|
|
72
71
|
initialLogicalElementId,
|
|
73
72
|
logicalElements,
|
|
@@ -84,12 +83,12 @@ function createFiltersRequest(
|
|
|
84
83
|
|
|
85
84
|
//* validate combine logicalStructure
|
|
86
85
|
let [validateObject, validateFilterMainId, validateFilterObject, validateErrorsObject, validateErrors] = validateCombinationStructure(
|
|
87
|
-
|
|
86
|
+
objType,
|
|
88
87
|
initialLogicalElementId,
|
|
89
88
|
logicalElements,
|
|
90
89
|
values
|
|
91
90
|
);
|
|
92
|
-
|
|
91
|
+
console.log('return validateCombinationStructure: ', {
|
|
93
92
|
validateObject,
|
|
94
93
|
validateFilterMainId,
|
|
95
94
|
validateFilterObject,
|
|
@@ -118,13 +117,12 @@ function createFiltersRequest(
|
|
|
118
117
|
operationErrorsObject,
|
|
119
118
|
operationErrors
|
|
120
119
|
] = filterLogicalElements(
|
|
121
|
-
_izContext,
|
|
122
120
|
objType,
|
|
123
121
|
initialLogicalElementId,
|
|
124
122
|
logicalElements,
|
|
125
123
|
values,
|
|
126
124
|
);
|
|
127
|
-
|
|
125
|
+
console.log('final return filterLogicalElements: ', {
|
|
128
126
|
filterMainId,
|
|
129
127
|
filterMainObject,
|
|
130
128
|
operation,
|
|
@@ -162,7 +160,7 @@ function createFiltersRequest(
|
|
|
162
160
|
filterMainId: filterMainId,
|
|
163
161
|
filterElements: filterElements
|
|
164
162
|
};
|
|
165
|
-
|
|
163
|
+
console.log('complexFilterRequest: ', complexFilterRequest);
|
|
166
164
|
|
|
167
165
|
// let validate = validateFilterElement(
|
|
168
166
|
// complexFilterRequest.filterElements,
|
|
@@ -186,12 +184,13 @@ function createFiltersRequest(
|
|
|
186
184
|
};
|
|
187
185
|
|
|
188
186
|
function validateCombinationStructure(
|
|
189
|
-
|
|
187
|
+
objType,
|
|
190
188
|
initialLogicalElementId,
|
|
191
189
|
logicalElements,
|
|
192
190
|
values
|
|
193
191
|
) {
|
|
194
|
-
|
|
192
|
+
console.log('validateCombinationStructure: ', {
|
|
193
|
+
objType,
|
|
195
194
|
initialLogicalElementId,
|
|
196
195
|
logicalElements,
|
|
197
196
|
values
|
|
@@ -208,12 +207,12 @@ function validateCombinationStructure(
|
|
|
208
207
|
let lastOperation = null;
|
|
209
208
|
|
|
210
209
|
for (const [logicalElementId, logicalElementObject] of Object.entries(logicalElements)) {
|
|
211
|
-
|
|
210
|
+
console.log('iterate logicalElements: ', { initialLogicalElementId, logicalElementId, logicalElementObject });
|
|
212
211
|
|
|
213
212
|
if (initialLogicalElementId !== logicalElementId) {
|
|
214
213
|
continue;
|
|
215
214
|
};
|
|
216
|
-
|
|
215
|
+
console.log('----------------- start logicalElement --------------');
|
|
217
216
|
|
|
218
217
|
if (!logicalElementObject.hasOwnProperty("logicalElementType")) {
|
|
219
218
|
errorsObject[logicalElementId] = `this logical structure is not set logicalElementType`;
|
|
@@ -231,14 +230,14 @@ function validateCombinationStructure(
|
|
|
231
230
|
let logicalElementType = logicalElementObject.logicalElementType;
|
|
232
231
|
|
|
233
232
|
if (logicalElementType === 'operation') {
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
console.log('----------------- operation --------------');
|
|
234
|
+
console.log('logicalElementObject: ', logicalElementObject);
|
|
236
235
|
|
|
237
236
|
lastOperation = logicalElementObject.operation;
|
|
238
|
-
|
|
237
|
+
console.log('lastOperation: ', lastOperation);
|
|
239
238
|
|
|
240
239
|
if (isEmpty(lastOperation)) {
|
|
241
|
-
|
|
240
|
+
console.log('no operation: ', logicalElementObject.operation);
|
|
242
241
|
errorsObject[logicalElementId] = `this logical structure is not set operation parameter`;
|
|
243
242
|
errorsFound.push(`this logical structure type: operation: ${logicalElementId} is not set operation parameter`);
|
|
244
243
|
break;
|
|
@@ -251,17 +250,17 @@ function validateCombinationStructure(
|
|
|
251
250
|
};
|
|
252
251
|
|
|
253
252
|
if (logicalElementType === 'openBracket') {
|
|
254
|
-
|
|
253
|
+
console.log('----------------- openBracket --------------');
|
|
255
254
|
|
|
256
255
|
let nextElementId = null;
|
|
257
256
|
|
|
258
257
|
[validateObject, currentFilterMainId, currentFilterObject, errorsObject, errorsFound, nextElementId] = validateCombinationStructure(
|
|
259
|
-
|
|
258
|
+
objType,
|
|
260
259
|
logicalElementObject.nextLogicalElementId,
|
|
261
260
|
logicalElements,
|
|
262
261
|
values
|
|
263
262
|
);
|
|
264
|
-
|
|
263
|
+
console.log('return validateCombinationStruce for openBracket: ', {
|
|
265
264
|
validateObject,
|
|
266
265
|
currentFilterMainId,
|
|
267
266
|
currentFilterObject,
|
|
@@ -275,7 +274,7 @@ function validateCombinationStructure(
|
|
|
275
274
|
};
|
|
276
275
|
|
|
277
276
|
} else if (logicalElementType === 'closeBracket') {
|
|
278
|
-
|
|
277
|
+
console.log('----------------- closeBracket --------------');
|
|
279
278
|
|
|
280
279
|
return [
|
|
281
280
|
true,
|
|
@@ -287,7 +286,7 @@ function validateCombinationStructure(
|
|
|
287
286
|
];
|
|
288
287
|
|
|
289
288
|
} else if (logicalElementType === 'logical') {
|
|
290
|
-
|
|
289
|
+
console.log('----------------- logical --------------');
|
|
291
290
|
if (!logicalElementObject.hasOwnProperty('objType')) {
|
|
292
291
|
errorsObject[logicalElementId] = `this logical structure is not set objType`;
|
|
293
292
|
errorsFound.push(`this logical structure logicalElementId: ${logicalElementId} is not set objType`);
|
|
@@ -313,7 +312,7 @@ function validateCombinationStructure(
|
|
|
313
312
|
};
|
|
314
313
|
|
|
315
314
|
} else if (logicalElementType === 'childComplexFilter') {
|
|
316
|
-
|
|
315
|
+
console.log('----------------- childComplexFilter --------------');
|
|
317
316
|
if (!logicalElementObject.hasOwnProperty('objType')) {
|
|
318
317
|
errorsObject[logicalElementId] = `this logical structure is not set objType`;
|
|
319
318
|
errorsFound.push(`this logical structure logicalElementId: ${logicalElementId} is not set objType`);
|
|
@@ -333,7 +332,7 @@ function validateCombinationStructure(
|
|
|
333
332
|
};
|
|
334
333
|
|
|
335
334
|
let parantObjType = logicalElementObject.objType;
|
|
336
|
-
|
|
335
|
+
console.log('check parantObjType: ', {
|
|
337
336
|
parantObjType
|
|
338
337
|
});
|
|
339
338
|
|
|
@@ -343,13 +342,13 @@ function validateCombinationStructure(
|
|
|
343
342
|
childElementObject,
|
|
344
343
|
childErrorsObject,
|
|
345
344
|
childErrorsFound
|
|
346
|
-
] =
|
|
347
|
-
|
|
345
|
+
] = validateCombinationStructure(
|
|
346
|
+
logicalElementObject.pathLinkType.objType,
|
|
348
347
|
logicalElementObject.childLogicalElementId,
|
|
349
348
|
logicalElements,
|
|
350
349
|
values
|
|
351
350
|
);
|
|
352
|
-
|
|
351
|
+
console.log('return validateCombinationStruce for childComplexFilter: ', {
|
|
353
352
|
childValidate,
|
|
354
353
|
childElementId,
|
|
355
354
|
childElementObject,
|
|
@@ -370,7 +369,7 @@ function validateCombinationStructure(
|
|
|
370
369
|
};
|
|
371
370
|
|
|
372
371
|
} else if (logicalElementType === 'translateIds') {
|
|
373
|
-
|
|
372
|
+
console.log("----------------- translateIds --------------", logicalElementObject);
|
|
374
373
|
|
|
375
374
|
if (!logicalElementObject.hasOwnProperty('objType')) {
|
|
376
375
|
errorsObject[logicalElementId] = `this logical structure is not set objType`;
|
|
@@ -401,7 +400,7 @@ function validateCombinationStructure(
|
|
|
401
400
|
};
|
|
402
401
|
|
|
403
402
|
} else if (logicalElementType === 'identifiers') {
|
|
404
|
-
|
|
403
|
+
console.log('----------------- identifiers --------------', logicalElementObject);
|
|
405
404
|
if (!logicalElementObject.hasOwnProperty('objType')) {
|
|
406
405
|
errorsObject[logicalElementId] = `this logical structure is not set objType`;
|
|
407
406
|
errorsFound.push(`this logical structure logicalElementId: ${logicalElementId} is not set objType`);
|
|
@@ -427,7 +426,7 @@ function validateCombinationStructure(
|
|
|
427
426
|
};
|
|
428
427
|
|
|
429
428
|
} else if (logicalElementType === 'traversal') {
|
|
430
|
-
|
|
429
|
+
console.log('----------------- traversal --------------', logicalElementObject);
|
|
431
430
|
if (!logicalElementObject.hasOwnProperty('objType')) {
|
|
432
431
|
errorsObject[logicalElementId] = `this logical structure is not set objType`;
|
|
433
432
|
errorsFound.push(`this logical structure logicalElementId: ${logicalElementId} is not set objType`);
|
|
@@ -453,15 +452,15 @@ function validateCombinationStructure(
|
|
|
453
452
|
runningFilterObject,
|
|
454
453
|
operationFilterObject,
|
|
455
454
|
operationErrorsFound
|
|
456
|
-
] =
|
|
457
|
-
|
|
455
|
+
] = validateOperation(
|
|
456
|
+
objType,
|
|
458
457
|
runningFilterMainId,
|
|
459
458
|
runningFilterObject,
|
|
460
459
|
lastOperation,
|
|
461
460
|
currentFilterMainId,
|
|
462
461
|
currentFilterObject
|
|
463
462
|
);
|
|
464
|
-
|
|
463
|
+
console.log('return validateOperation: ', {
|
|
465
464
|
runningFilterMainId,
|
|
466
465
|
runningFilterObject,
|
|
467
466
|
operationFilterObject,
|
|
@@ -490,117 +489,201 @@ function validateCombinationStructure(
|
|
|
490
489
|
|
|
491
490
|
}
|
|
492
491
|
|
|
493
|
-
function validateOperation(
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
) {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
492
|
+
// function validateOperation(
|
|
493
|
+
// // _izContext,
|
|
494
|
+
// runningFilterMainId,
|
|
495
|
+
// runningFilterObject,
|
|
496
|
+
// lastOperation,
|
|
497
|
+
// currentFilterMainId,
|
|
498
|
+
// currentFilterObject,
|
|
499
|
+
// ) {
|
|
500
|
+
// console.log('validateOperation: ', {
|
|
501
|
+
// runningFilterMainId,
|
|
502
|
+
// runningFilterObject,
|
|
503
|
+
// lastOperation,
|
|
504
|
+
// currentFilterMainId,
|
|
505
|
+
// currentFilterObject,
|
|
506
|
+
// });
|
|
508
507
|
|
|
509
|
-
|
|
510
|
-
|
|
508
|
+
// let errorsObject = {};
|
|
509
|
+
// let errorsFound = [];
|
|
511
510
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
511
|
+
// if (!currentFilterObject) {
|
|
512
|
+
// errorsObject[currentFilterMainId] = 'cannot found current filterElement object';
|
|
513
|
+
// errorsFound.push(`${currentFilterMainId}: cannot found current filterElement object`);
|
|
514
|
+
// return [null, null, errorsObject, errorsFound];
|
|
515
|
+
// };
|
|
517
516
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
517
|
+
// if (!runningFilterObject) {
|
|
518
|
+
// return [currentFilterMainId, currentFilterObject, errorsObject, errorsFound];
|
|
519
|
+
// };
|
|
521
520
|
|
|
522
|
-
|
|
521
|
+
// if (!lastOperation) {
|
|
523
522
|
|
|
524
|
-
|
|
525
|
-
|
|
523
|
+
// let returnNextElementId = null;
|
|
524
|
+
// let returnNextElementObject = null;
|
|
526
525
|
|
|
527
|
-
|
|
528
|
-
|
|
526
|
+
// if (runningFilterObject.logicalElementType === 'openBracket') {
|
|
527
|
+
// if (currentFilterObject.logicalElementType === 'closeBracket') {
|
|
529
528
|
|
|
530
|
-
|
|
531
|
-
|
|
529
|
+
// errorsObject[currentFilterMainId] = `this path has logicalElementType: ${runningFilterObject.logicalElementType} and ${currentFilterObject.logicalElementType} are error`;
|
|
530
|
+
// errorsFound.push(`${currentFilterMainId}: this path has logicalElementType: ${runningFilterObject.logicalElementType} and ${currentFilterObject.logicalElementType} are error`);
|
|
532
531
|
|
|
533
|
-
|
|
532
|
+
// } else {
|
|
534
533
|
|
|
535
|
-
|
|
536
|
-
|
|
534
|
+
// runningFilterObject.nextLogicalElementId = currentFilterMainId;
|
|
535
|
+
// currentFilterObject.previousLogicalElementId = runningFilterMainId;
|
|
537
536
|
|
|
538
|
-
|
|
537
|
+
// operations = Object.assign(runningFilterObject, currentFilterObject);
|
|
539
538
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
539
|
+
// _izContext.logger.debug('operations: ', operations);
|
|
540
|
+
// returnNextElementId = currentFilterMainId;
|
|
541
|
+
// returnNextElementObject = currentFilterObject;
|
|
543
542
|
|
|
544
|
-
|
|
543
|
+
// };
|
|
545
544
|
|
|
546
|
-
|
|
547
|
-
|
|
545
|
+
// } else if (runningFilterObject.logicalElementType === 'closeBracket') {
|
|
546
|
+
// if (currentFilterObject.logicalElementType === "closeBracket") {
|
|
548
547
|
|
|
549
|
-
|
|
550
|
-
|
|
548
|
+
// runningFilterObject.nextLogicalElementId = currentFilterMainId;
|
|
549
|
+
// currentFilterObject.previousLogicalElementId = runningFilterMainId;
|
|
551
550
|
|
|
552
|
-
|
|
553
|
-
|
|
551
|
+
// operations = Object.assign(runningFilterObject, currentFilterObject);
|
|
552
|
+
// _izContext.logger.debug('operations: ', operations);
|
|
554
553
|
|
|
555
|
-
|
|
556
|
-
|
|
554
|
+
// returnNextElementId = currentFilterMainId;
|
|
555
|
+
// returnNextElementObject = currentFilterObject;
|
|
557
556
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
557
|
+
// } else {
|
|
558
|
+
// errorsObject[currentFilterMainId] = `this path has logicalElementType: ${runningFilterObject.logicalElementType} and ${currentFilterObject.logicalElementType} are error`;
|
|
559
|
+
// errorsFound.push(`${currentFilterMainId}: this path has logicalElementType: ${runningFilterObject.logicalElementType} and ${currentFilterObject.logicalElementType} are error`);
|
|
560
|
+
// };
|
|
562
561
|
|
|
563
|
-
|
|
562
|
+
// } else {
|
|
564
563
|
|
|
565
|
-
|
|
564
|
+
// if (currentFilterObject.logicalElementType === 'closeBracket') {
|
|
566
565
|
|
|
567
|
-
|
|
568
|
-
|
|
566
|
+
// runningFilterObject.nextLogicalElementId = currentFilterMainId;
|
|
567
|
+
// currentFilterObject.previousLogicalElementId = runningFilterMainId;
|
|
569
568
|
|
|
570
|
-
|
|
571
|
-
|
|
569
|
+
// operations = Object.assign(runningFilterObject, currentFilterObject);
|
|
570
|
+
// _izContext.logger.debug('operations: ', operations);
|
|
572
571
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
572
|
+
// returnNextElementId = currentFilterMainId;
|
|
573
|
+
// returnNextElementObject = nextLogicalElementObject;
|
|
574
|
+
// } else {
|
|
575
|
+
// errorsObject[currentFilterMainId] = `this path has logicalElementType: ${runningFilterObject.logicalElementType} and ${currentFilterObject.logicalElementType} are error`;
|
|
576
|
+
// errorsFound.push(`${currentFilterMainId}: this path has logicalElementType: ${runningFilterObject.logicalElementType} and ${currentFilterObject.logicalElementType} are error`);
|
|
577
|
+
// };
|
|
578
|
+
// };
|
|
580
579
|
|
|
581
|
-
|
|
580
|
+
// return [returnNextElementId, returnNextElementObject, errorsObject, errorsFound];
|
|
582
581
|
|
|
583
|
-
|
|
582
|
+
// };
|
|
584
583
|
|
|
585
|
-
|
|
584
|
+
// if (runningFilterMainId && lastOperation && currentFilterMainId) {
|
|
586
585
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
586
|
+
// // let operationFilterObject = {
|
|
587
|
+
// // runningFilterMainId: runningFilterObject,
|
|
588
|
+
// // operation: lastOperation,
|
|
589
|
+
// // currentFilterMainId: currentFilterObject
|
|
590
|
+
// // };
|
|
591
|
+
// // // let operationFilterMainId = hash(operationFilterObject);
|
|
593
592
|
|
|
594
|
-
|
|
593
|
+
// return [currentFilterMainId, currentFilterObject, errorsObject, errorsFound];
|
|
595
594
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
};
|
|
595
|
+
// } else {
|
|
596
|
+
// errorsFound.push("found some error that not expect");
|
|
597
|
+
// return [null, null, errorsObject, errorsFound];
|
|
598
|
+
// };
|
|
599
|
+
// };
|
|
600
|
+
|
|
601
|
+
function validateOperation(
|
|
602
|
+
objType,
|
|
603
|
+
runningFilterMainId,
|
|
604
|
+
runningFilterObject,
|
|
605
|
+
lastLogicalOperator,
|
|
606
|
+
currentFilterMainId,
|
|
607
|
+
currentFilterObject,
|
|
608
|
+
) {
|
|
609
|
+
try {
|
|
610
|
+
|
|
611
|
+
console.log("[=============== Function - =============]", {
|
|
612
|
+
objType: objType,
|
|
613
|
+
runningFilterMainId: runningFilterMainId,
|
|
614
|
+
runningFilterObject: runningFilterObject,
|
|
615
|
+
lastLogicalOperator: lastLogicalOperator,
|
|
616
|
+
currentFilterMainId: currentFilterMainId,
|
|
617
|
+
currentFilterObject: currentFilterObject,
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
let errorsFound = []
|
|
621
|
+
|
|
622
|
+
// // if runningFilterMainId set we should always have runningFilterObject
|
|
623
|
+
// if (runningFilterMainId && !runningFilterObject) {
|
|
624
|
+
// _izContext.logger.debug("validateOperation expected runningFilterObject not found");
|
|
625
|
+
// errorsFound.push("validateOperation expected runningFilterObject not found");
|
|
626
|
+
// return currentFilterMainId;
|
|
627
|
+
// }
|
|
628
|
+
if (!currentFilterObject) {
|
|
629
|
+
console.log("validateOperation expected currentFilterObject not found");
|
|
630
|
+
errorsFound.push("validateOperation expected currentFilterObject not found");
|
|
631
|
+
return [currentFilterMainId, null, null, errorsFound];
|
|
632
|
+
}
|
|
633
|
+
// if runningFilterObject set we should always have lastLogicalOperator
|
|
634
|
+
if (runningFilterObject && !lastLogicalOperator) {
|
|
635
|
+
console.log("validateOperation expected lastLogicalOperator not found");
|
|
636
|
+
errorsFound.push("validateOperation expected lastLogicalOperator not found");
|
|
637
|
+
return [currentFilterMainId, currentFilterObject, null, errorsFound];
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// check if is an operation, if not simply return currentFilterMainId
|
|
641
|
+
if (!runningFilterObject || !lastLogicalOperator) {
|
|
642
|
+
console.log("+++ validate no operation, R E T U R N currentFilterMainId ++");
|
|
643
|
+
return [currentFilterMainId, currentFilterObject, null, errorsFound];
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
let filterElements = splitFilterElements(
|
|
647
|
+
runningFilterMainId,
|
|
648
|
+
runningFilterObject,
|
|
649
|
+
currentFilterMainId,
|
|
650
|
+
currentFilterObject
|
|
651
|
+
);
|
|
652
|
+
|
|
653
|
+
// create new operation FilterObject
|
|
654
|
+
let operationFilterObject = {
|
|
655
|
+
objType: objType,
|
|
656
|
+
filterElement: {
|
|
657
|
+
filterType: "operation",
|
|
658
|
+
filterElements: filterElements,
|
|
659
|
+
filterElementLeft: runningFilterMainId,
|
|
660
|
+
filterElementRight: currentFilterMainId,
|
|
661
|
+
operator: lastLogicalOperator
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
console.log("operationFilterObject", operationFilterObject);
|
|
665
|
+
|
|
666
|
+
let operationFilterMainId = hash(operationFilterObject);
|
|
667
|
+
console.log("==== validate operationFilterMainId After Hash =====", operationFilterMainId);
|
|
668
|
+
|
|
669
|
+
console.log("RETURN validate operationFilterMainId ==>", operationFilterMainId);
|
|
670
|
+
console.log("RETURN validate operationFilterObject ==>", operationFilterObject);
|
|
671
|
+
console.log("========= [validateOperation ::: End] =======");
|
|
672
|
+
|
|
673
|
+
let operation = {
|
|
674
|
+
filterMainIdA: runningFilterMainId,
|
|
675
|
+
operator: lastLogicalOperator,
|
|
676
|
+
filterMainIdB: currentFilterMainId,
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
return [operationFilterMainId, operationFilterObject, operation, errorsFound];
|
|
680
|
+
|
|
681
|
+
} catch (err) {
|
|
682
|
+
throw (err)
|
|
683
|
+
}
|
|
684
|
+
}
|
|
601
685
|
|
|
602
686
|
function filterLogicalElements(
|
|
603
|
-
_izContext,
|
|
604
687
|
objType,
|
|
605
688
|
initialLogicalElementId,
|
|
606
689
|
logicalElements,
|
|
@@ -612,7 +695,7 @@ function filterLogicalElements(
|
|
|
612
695
|
currentFilterMainId = null,
|
|
613
696
|
currentFilterObject = null
|
|
614
697
|
) {
|
|
615
|
-
|
|
698
|
+
console.log('filterLogicalElements: ', {
|
|
616
699
|
objType,
|
|
617
700
|
initialLogicalElementId,
|
|
618
701
|
logicalElements,
|
|
@@ -638,7 +721,7 @@ function filterLogicalElements(
|
|
|
638
721
|
}
|
|
639
722
|
|
|
640
723
|
let logicalElement = logicalElements[currentLogicalElementId];
|
|
641
|
-
|
|
724
|
+
console.log('logicalElement: ', logicalElement)
|
|
642
725
|
|
|
643
726
|
if (isEmpty(logicalElement)) {
|
|
644
727
|
errorsObject[currentLogicalElementId] = 'this logicalElement not found';
|
|
@@ -650,7 +733,7 @@ function filterLogicalElements(
|
|
|
650
733
|
};
|
|
651
734
|
|
|
652
735
|
let logicalElementType = logicalElement.logicalElementType;
|
|
653
|
-
|
|
736
|
+
console.log('logicalElementType: ', logicalElementType);
|
|
654
737
|
|
|
655
738
|
if (logicalElementType === "openBracket") {
|
|
656
739
|
|
|
@@ -664,14 +747,13 @@ function filterLogicalElements(
|
|
|
664
747
|
errorsFound,
|
|
665
748
|
nextElementId
|
|
666
749
|
] = filterLogicalElements(
|
|
667
|
-
_izContext,
|
|
668
750
|
objType,
|
|
669
751
|
initialLogicalElementId,
|
|
670
752
|
logicalElements,
|
|
671
753
|
values,
|
|
672
754
|
logicalElement.nextLogicalElementId
|
|
673
755
|
);
|
|
674
|
-
|
|
756
|
+
console.log('return filterLogicalElement for openBracket: ', {
|
|
675
757
|
currentFilterMainId,
|
|
676
758
|
currentFilterObject,
|
|
677
759
|
operation,
|
|
@@ -708,15 +790,15 @@ function filterLogicalElements(
|
|
|
708
790
|
|
|
709
791
|
}
|
|
710
792
|
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
793
|
+
console.log("check logicalElement: ", logicalElement);
|
|
794
|
+
console.log("check logicalElementType: ", logicalElementType);
|
|
795
|
+
console.log("check filter main id: ", {
|
|
714
796
|
runningFilterMainId,
|
|
715
797
|
lastLogicalOperator,
|
|
716
798
|
currentFilterMainId
|
|
717
799
|
});
|
|
718
800
|
|
|
719
|
-
|
|
801
|
+
console.log("check filter main id: ", {
|
|
720
802
|
runningFilterMainId,
|
|
721
803
|
runningFilterObject,
|
|
722
804
|
lastLogicalOperator,
|
|
@@ -726,7 +808,7 @@ function filterLogicalElements(
|
|
|
726
808
|
|
|
727
809
|
if (logicalElementType === "logical") {
|
|
728
810
|
|
|
729
|
-
|
|
811
|
+
console.log('------------------ logicalElementType: logical ----------------');
|
|
730
812
|
|
|
731
813
|
if (!logicalElement.hasOwnProperty('objType')) {
|
|
732
814
|
errorsObject[initialLogicalElementId] = `this logical structure is not set objType`;
|
|
@@ -750,7 +832,7 @@ function filterLogicalElements(
|
|
|
750
832
|
}
|
|
751
833
|
|
|
752
834
|
let value = values[logicalElement.value];
|
|
753
|
-
|
|
835
|
+
console.log('value: ', value);
|
|
754
836
|
|
|
755
837
|
if (isEmpty(value)) {
|
|
756
838
|
errorsObject[currentLogicalElementId] = `value is empty`;
|
|
@@ -789,17 +871,17 @@ function filterLogicalElements(
|
|
|
789
871
|
};
|
|
790
872
|
};
|
|
791
873
|
};
|
|
792
|
-
|
|
874
|
+
console.log('currentFilterObject: ', currentFilterObject);
|
|
793
875
|
|
|
794
876
|
currentFilterMainId = hash(currentFilterObject);
|
|
795
|
-
|
|
877
|
+
console.log('currentFilterMainId: ', currentFilterMainId);
|
|
796
878
|
|
|
797
879
|
if (logicalElement.nextLogicalElementId !== null) {
|
|
798
880
|
lastNextLogicalElementId = logicalElement.nextLogicalElementId;
|
|
799
881
|
}
|
|
800
882
|
|
|
801
883
|
} else if (logicalElementType === "childComplexFilter") {
|
|
802
|
-
|
|
884
|
+
console.log('------------------ logicalElementType: childComplexFilter ----------------');
|
|
803
885
|
|
|
804
886
|
if (!logicalElement.hasOwnProperty('objType')) {
|
|
805
887
|
errorsObject[currentLogicalElementId] = `this logical structure is not set objType`;
|
|
@@ -842,14 +924,13 @@ function filterLogicalElements(
|
|
|
842
924
|
childErrorsFound,
|
|
843
925
|
childNextLogicalElementId
|
|
844
926
|
] = filterLogicalElements(
|
|
845
|
-
_izContext,
|
|
846
927
|
logicalElement.pathLinkType.objType,
|
|
847
928
|
initialLogicalElementId,
|
|
848
929
|
logicalElements,
|
|
849
930
|
values,
|
|
850
931
|
logicalElement.childLogicalElementId
|
|
851
932
|
);
|
|
852
|
-
|
|
933
|
+
console.log('return child filterLogicalElement for child complexFilter: ', {
|
|
853
934
|
childFilterMainId,
|
|
854
935
|
childFilterObject,
|
|
855
936
|
operation,
|
|
@@ -863,18 +944,17 @@ function filterLogicalElements(
|
|
|
863
944
|
}
|
|
864
945
|
|
|
865
946
|
let filterElements = splitFilterElements(
|
|
866
|
-
_izContext,
|
|
867
947
|
childFilterMainId,
|
|
868
948
|
childFilterObject
|
|
869
949
|
);
|
|
870
|
-
|
|
950
|
+
console.log('filterElements: ', filterElements);
|
|
871
951
|
let setRequestProperties = {};
|
|
872
952
|
|
|
873
953
|
if (!isEmpty(logicalElement.requestProperties)) {
|
|
874
|
-
|
|
954
|
+
console.log('logicalElement: ', logicalElement);
|
|
875
955
|
|
|
876
956
|
for (const [tag, requestPropertyId] of Object.entries(logicalElement.requestProperties)) {
|
|
877
|
-
|
|
957
|
+
console.log('set requestProperties: ', { tag, requestPropertyId });
|
|
878
958
|
|
|
879
959
|
let requestPropertyObject = values[requestPropertyId];
|
|
880
960
|
|
|
@@ -899,10 +979,10 @@ function filterLogicalElements(
|
|
|
899
979
|
requestProperties: setRequestProperties ?? {}
|
|
900
980
|
}
|
|
901
981
|
};
|
|
902
|
-
|
|
982
|
+
console.log('currentFilterObject: ', currentFilterObject);
|
|
903
983
|
|
|
904
984
|
currentFilterMainId = hash(currentFilterObject);
|
|
905
|
-
|
|
985
|
+
console.log('currentFilterMainId: ', currentFilterMainId);
|
|
906
986
|
|
|
907
987
|
if (logicalElement.nextLogicalElementId !== null) {
|
|
908
988
|
lastNextLogicalElementId = logicalElement.nextLogicalElementId;
|
|
@@ -910,13 +990,13 @@ function filterLogicalElements(
|
|
|
910
990
|
|
|
911
991
|
} else if (logicalElementType === "traversal") {
|
|
912
992
|
|
|
913
|
-
|
|
993
|
+
console.log('logicalElementType: ', f);
|
|
914
994
|
} else if (logicalElementType === "translateIds") {
|
|
915
995
|
|
|
916
|
-
|
|
996
|
+
console.log('logicalElementType: ', g);
|
|
917
997
|
} else if (logicalElementType === "identifiers") {
|
|
918
998
|
|
|
919
|
-
|
|
999
|
+
console.log('logicalElementType: ', h);
|
|
920
1000
|
}
|
|
921
1001
|
|
|
922
1002
|
if (errorsFound.length > 0) {
|
|
@@ -925,8 +1005,8 @@ function filterLogicalElements(
|
|
|
925
1005
|
|
|
926
1006
|
if (lastNextLogicalElementId !== null) {
|
|
927
1007
|
|
|
928
|
-
[runningFilterMainId, runningFilterObject, operation, operationErrorsFound] = complexFilterShared.validateOperation(
|
|
929
|
-
|
|
1008
|
+
// [runningFilterMainId, runningFilterObject, operation, operationErrorsFound] = complexFilterShared.validateOperation(
|
|
1009
|
+
[runningFilterMainId, runningFilterObject, operation, operationErrorsFound] = validateOperation(
|
|
930
1010
|
objType,
|
|
931
1011
|
runningFilterMainId,
|
|
932
1012
|
runningFilterObject,
|
|
@@ -934,7 +1014,7 @@ function filterLogicalElements(
|
|
|
934
1014
|
currentFilterMainId,
|
|
935
1015
|
currentFilterObject
|
|
936
1016
|
);
|
|
937
|
-
|
|
1017
|
+
console.log('return validateOperation for lastNextLogicalElementId == null: ', {
|
|
938
1018
|
runningFilterMainId,
|
|
939
1019
|
runningFilterObject,
|
|
940
1020
|
operation,
|
|
@@ -953,7 +1033,6 @@ function filterLogicalElements(
|
|
|
953
1033
|
nextErrorFound,
|
|
954
1034
|
nextElementId
|
|
955
1035
|
] = filterLogicalElements(
|
|
956
|
-
_izContext,
|
|
957
1036
|
objType,
|
|
958
1037
|
initialLogicalElementId,
|
|
959
1038
|
logicalElements,
|
|
@@ -963,7 +1042,7 @@ function filterLogicalElements(
|
|
|
963
1042
|
runningFilterObject,
|
|
964
1043
|
lastLogicalOperator,
|
|
965
1044
|
);
|
|
966
|
-
|
|
1045
|
+
console.log('return validateOperation for lastNextLogicalElementId !== null: ', {
|
|
967
1046
|
nextFilterMainId,
|
|
968
1047
|
nextFilterObject,
|
|
969
1048
|
operations,
|
|
@@ -989,7 +1068,6 @@ function filterLogicalElements(
|
|
|
989
1068
|
filterErrorFound,
|
|
990
1069
|
nextElementId
|
|
991
1070
|
] = filterLogicalElements(
|
|
992
|
-
_izContext,
|
|
993
1071
|
objType,
|
|
994
1072
|
initialLogicalElementId,
|
|
995
1073
|
logicalElements,
|
|
@@ -999,7 +1077,7 @@ function filterLogicalElements(
|
|
|
999
1077
|
nextFilterObject,
|
|
1000
1078
|
lastLogicalOperator
|
|
1001
1079
|
);
|
|
1002
|
-
|
|
1080
|
+
console.log('return validateOperation for lastNextLogicalElementId !== null: ', {
|
|
1003
1081
|
runningFilterMainId,
|
|
1004
1082
|
runningFilterObject,
|
|
1005
1083
|
operation,
|
|
@@ -1028,8 +1106,7 @@ function filterLogicalElements(
|
|
|
1028
1106
|
|
|
1029
1107
|
} else {
|
|
1030
1108
|
|
|
1031
|
-
[runningFilterMainId, runningFilterObject, operation, operationErrorsFound] =
|
|
1032
|
-
_izContext,
|
|
1109
|
+
[runningFilterMainId, runningFilterObject, operation, operationErrorsFound] = validateOperation(
|
|
1033
1110
|
objType,
|
|
1034
1111
|
runningFilterMainId,
|
|
1035
1112
|
runningFilterObject,
|
|
@@ -1037,7 +1114,7 @@ function filterLogicalElements(
|
|
|
1037
1114
|
currentFilterMainId,
|
|
1038
1115
|
currentFilterObject
|
|
1039
1116
|
);
|
|
1040
|
-
|
|
1117
|
+
console.log('return validateOperation for lastNextLogicalElementId == null: ', {
|
|
1041
1118
|
runningFilterMainId,
|
|
1042
1119
|
runningFilterObject,
|
|
1043
1120
|
operation,
|
|
@@ -1057,12 +1134,11 @@ function filterLogicalElements(
|
|
|
1057
1134
|
|
|
1058
1135
|
|
|
1059
1136
|
function combineLogicalStructure(
|
|
1060
|
-
_izContext,
|
|
1061
1137
|
objType,
|
|
1062
1138
|
initialLogicalElementId,
|
|
1063
1139
|
logicalElements,
|
|
1064
1140
|
) {
|
|
1065
|
-
|
|
1141
|
+
console.log('combineLogicalStructure: ', {
|
|
1066
1142
|
objType,
|
|
1067
1143
|
initialLogicalElementId,
|
|
1068
1144
|
logicalElements,
|
|
@@ -1075,7 +1151,7 @@ function combineLogicalStructure(
|
|
|
1075
1151
|
} else {
|
|
1076
1152
|
returnInitialElementId = logicalElements[initialLogicalElementId].initialLogicalElementId;
|
|
1077
1153
|
};
|
|
1078
|
-
|
|
1154
|
+
console.log('returnInitialElementId', returnInitialElementId);
|
|
1079
1155
|
|
|
1080
1156
|
let previousLogicalElementId = null;
|
|
1081
1157
|
let previousLogicalElementObject = null;
|
|
@@ -1092,17 +1168,17 @@ function combineLogicalStructure(
|
|
|
1092
1168
|
let errorsFound = [];
|
|
1093
1169
|
|
|
1094
1170
|
for (const [logicalElementId, logicalElementObject] of Object.entries(logicalElements)) {
|
|
1095
|
-
|
|
1171
|
+
console.log('extract logicalELements: ', { initialLogicalElementId, logicalElementId, logicalElementObject });
|
|
1096
1172
|
|
|
1097
1173
|
if (initialLogicalElementId !== logicalElementId) {
|
|
1098
1174
|
continue;
|
|
1099
1175
|
};
|
|
1100
1176
|
|
|
1101
1177
|
let logicalElementType = logicalElementObject.logicalElementType;
|
|
1102
|
-
|
|
1178
|
+
console.log('logicalElementType: ', logicalElementType);
|
|
1103
1179
|
|
|
1104
1180
|
if (logicalElementType === 'openBracket') {
|
|
1105
|
-
|
|
1181
|
+
console.log('----------type: openBracket ----------');
|
|
1106
1182
|
if (!logicalElementObject.hasOwnProperty('previousLogicalElementId')) {
|
|
1107
1183
|
errorsObject[logicalElementId] = `this logical structure is not set previousLogicalElementId`;
|
|
1108
1184
|
errorsFound.push(`this logical structure logicalElementId: ${logicalElementId} is not set previousLogicalElementId`);
|
|
@@ -1117,7 +1193,7 @@ function combineLogicalStructure(
|
|
|
1117
1193
|
initialLogicalElementId = logicalElementObject.nextLogicalElementId;
|
|
1118
1194
|
|
|
1119
1195
|
} else if (logicalElementType === 'logicalStructure') {
|
|
1120
|
-
|
|
1196
|
+
console.log('----------type: logicalStructure ----------');
|
|
1121
1197
|
|
|
1122
1198
|
if (!logicalElementObject.hasOwnProperty('objType')) {
|
|
1123
1199
|
errorsObject[logicalElementId] = `this logical structure is not set objType`;
|
|
@@ -1148,7 +1224,7 @@ function combineLogicalStructure(
|
|
|
1148
1224
|
};
|
|
1149
1225
|
|
|
1150
1226
|
} else if (logicalElementType === 'operation') {
|
|
1151
|
-
|
|
1227
|
+
console.log('----------type: operation ----------');
|
|
1152
1228
|
if (!logicalElementObject.hasOwnProperty('previousLogicalElementId')) {
|
|
1153
1229
|
errorsObject[logicalElementId] = `this logical structure is not set previousLogicalElementId`;
|
|
1154
1230
|
errorsFound.push(`this logical structure logicalElementId: ${logicalElementId} is not set previousLogicalElementId`);
|
|
@@ -1168,7 +1244,7 @@ function combineLogicalStructure(
|
|
|
1168
1244
|
continue;
|
|
1169
1245
|
|
|
1170
1246
|
} else if (logicalElementType === 'closeBracket') {
|
|
1171
|
-
|
|
1247
|
+
console.log('----------type: closeBracket ----------');
|
|
1172
1248
|
if (!logicalElementObject.hasOwnProperty('previousLogicalElementId')) {
|
|
1173
1249
|
errorsObject[logicalElementId] = `this logical structure is not set previousLogicalElementId`;
|
|
1174
1250
|
errorsFound.push(`this logical structure logicalElementId: ${logicalElementId} is not set previousLogicalElementId`);
|
|
@@ -1203,7 +1279,6 @@ function combineLogicalStructure(
|
|
|
1203
1279
|
operationErrorObjects,
|
|
1204
1280
|
operationErrors
|
|
1205
1281
|
] = combineOperation(
|
|
1206
|
-
_izContext,
|
|
1207
1282
|
previousLogicalElementId,
|
|
1208
1283
|
previousLogicalElementObject,
|
|
1209
1284
|
operationLogicalElementId,
|
|
@@ -1211,7 +1286,7 @@ function combineLogicalStructure(
|
|
|
1211
1286
|
nextLogicalElementId,
|
|
1212
1287
|
nextLogicalElementObject
|
|
1213
1288
|
);
|
|
1214
|
-
|
|
1289
|
+
console.log('return combineOperation: ', {
|
|
1215
1290
|
previousLogicalElementId,
|
|
1216
1291
|
previousLogicalElementObject,
|
|
1217
1292
|
operations,
|
|
@@ -1232,7 +1307,7 @@ function combineLogicalStructure(
|
|
|
1232
1307
|
|
|
1233
1308
|
} //end iterate logicalElements
|
|
1234
1309
|
|
|
1235
|
-
|
|
1310
|
+
console.log('returnLogicalElements: ', { returnLogicalElements });
|
|
1236
1311
|
|
|
1237
1312
|
let returnComplexLogicalStructure = {
|
|
1238
1313
|
objType: objType,
|
|
@@ -1245,7 +1320,6 @@ function combineLogicalStructure(
|
|
|
1245
1320
|
};
|
|
1246
1321
|
|
|
1247
1322
|
function combineOperation(
|
|
1248
|
-
_izContext,
|
|
1249
1323
|
previousLogicalElementId,
|
|
1250
1324
|
previousLogicalElementObject,
|
|
1251
1325
|
operationLogicalElementId,
|
|
@@ -1253,7 +1327,7 @@ function combineOperation(
|
|
|
1253
1327
|
nextLogicalElementId,
|
|
1254
1328
|
nextLogicalElementObject
|
|
1255
1329
|
) {
|
|
1256
|
-
|
|
1330
|
+
console.log('combineOperation: ', {
|
|
1257
1331
|
previousLogicalElementId,
|
|
1258
1332
|
previousLogicalElementObject,
|
|
1259
1333
|
operationLogicalElementId,
|
|
@@ -1275,7 +1349,7 @@ function combineOperation(
|
|
|
1275
1349
|
};
|
|
1276
1350
|
|
|
1277
1351
|
if (!operationLogicalElementObject) {
|
|
1278
|
-
|
|
1352
|
+
console.log('------------ previous & current ------------', {
|
|
1279
1353
|
previousLogicalElementId,
|
|
1280
1354
|
previousLogicalElementObject,
|
|
1281
1355
|
operationLogicalElementId,
|
|
@@ -1305,17 +1379,17 @@ function combineOperation(
|
|
|
1305
1379
|
} else {
|
|
1306
1380
|
|
|
1307
1381
|
let checkNextLogicalElementId = previousLogicalElementObject[previousLogicalElementId].nextLogicalElementId;
|
|
1308
|
-
|
|
1382
|
+
console.log('checkNextLogicalElementId:', checkNextLogicalElementId);
|
|
1309
1383
|
|
|
1310
1384
|
for (let i = 0; i < Object.entries(previousLogicalElementObject).length; i++) {
|
|
1311
1385
|
let [logicalElementId, logicalObject] = Object.entries(previousLogicalElementObject)[i];
|
|
1312
|
-
|
|
1386
|
+
console.log('extract logical element: ', { logicalElementId, logicalObject });
|
|
1313
1387
|
|
|
1314
1388
|
if (logicalElementId !== checkNextLogicalElementId) {
|
|
1315
1389
|
continue;
|
|
1316
1390
|
};
|
|
1317
1391
|
|
|
1318
|
-
|
|
1392
|
+
console.log('------------- has next logicalElemet to continue -------------');
|
|
1319
1393
|
|
|
1320
1394
|
if (logicalObject.nextLogicalElementId !== null) {
|
|
1321
1395
|
checkNextLogicalElementId = logicalObject.nextLogicalElementId;
|
|
@@ -1329,7 +1403,7 @@ function combineOperation(
|
|
|
1329
1403
|
};
|
|
1330
1404
|
|
|
1331
1405
|
operations = Object.assign(previousLogicalElementObject, nextLogicalElementObject);
|
|
1332
|
-
|
|
1406
|
+
console.log('operations: ', operations);
|
|
1333
1407
|
|
|
1334
1408
|
returnnextElementId = nextLogicalElementId;
|
|
1335
1409
|
returnNextElementObject = nextLogicalElementObject;
|
|
@@ -1341,7 +1415,7 @@ function combineOperation(
|
|
|
1341
1415
|
|
|
1342
1416
|
operations = Object.assign(previousLogicalElementObject, nextLogicalElementObject);
|
|
1343
1417
|
|
|
1344
|
-
|
|
1418
|
+
console.log('operations: ', operations);
|
|
1345
1419
|
returnnextElementId = nextLogicalElementId;
|
|
1346
1420
|
returnNextElementObject = nextLogicalElementObject;
|
|
1347
1421
|
|
|
@@ -1355,7 +1429,7 @@ function combineOperation(
|
|
|
1355
1429
|
nextLogicalElementObject[nextLogicalElementId].previousLogicalElementId = previousLogicalElementId;
|
|
1356
1430
|
|
|
1357
1431
|
operations = Object.assign(previousLogicalElementObject, nextLogicalElementObject);
|
|
1358
|
-
|
|
1432
|
+
console.log('operations: ', operations);
|
|
1359
1433
|
|
|
1360
1434
|
returnnextElementId = nextLogicalElementId;
|
|
1361
1435
|
returnNextElementObject = nextLogicalElementObject;
|
|
@@ -1369,7 +1443,7 @@ function combineOperation(
|
|
|
1369
1443
|
|
|
1370
1444
|
if (nextLogicalElementObject[nextLogicalElementId].logicalElementType === 'closeBracket') {
|
|
1371
1445
|
|
|
1372
|
-
|
|
1446
|
+
console.log('previousLogicalElementObject: ', previousLogicalElementObject);
|
|
1373
1447
|
|
|
1374
1448
|
if (Object.entries(previousLogicalElementObject).length <= 2) {
|
|
1375
1449
|
|
|
@@ -1385,17 +1459,17 @@ function combineOperation(
|
|
|
1385
1459
|
} else {
|
|
1386
1460
|
|
|
1387
1461
|
let checkNextLogicalElementId = previousLogicalElementObject[previousLogicalElementId].nextLogicalElementId;
|
|
1388
|
-
|
|
1462
|
+
console.log('checkNextLogicalElementId:', checkNextLogicalElementId);
|
|
1389
1463
|
|
|
1390
1464
|
for (let i = 0; i < Object.entries(previousLogicalElementObject).length; i++) {
|
|
1391
1465
|
let [logicalElementId, logicalObject] = Object.entries(previousLogicalElementObject)[i];
|
|
1392
|
-
|
|
1466
|
+
console.log('extract logical element: ', { logicalElementId, logicalObject });
|
|
1393
1467
|
|
|
1394
1468
|
if (logicalElementId !== checkNextLogicalElementId) {
|
|
1395
1469
|
continue;
|
|
1396
1470
|
};
|
|
1397
1471
|
|
|
1398
|
-
|
|
1472
|
+
console.log('------------- has next logicalElemet to continue -------------');
|
|
1399
1473
|
|
|
1400
1474
|
if (logicalObject.nextLogicalElementId !== null) {
|
|
1401
1475
|
checkNextLogicalElementId = logicalObject.nextLogicalElementId;
|
|
@@ -1409,7 +1483,7 @@ function combineOperation(
|
|
|
1409
1483
|
};
|
|
1410
1484
|
|
|
1411
1485
|
operations = Object.assign(previousLogicalElementObject, nextLogicalElementObject);
|
|
1412
|
-
|
|
1486
|
+
console.log("operations: ", operations);
|
|
1413
1487
|
|
|
1414
1488
|
returnnextElementId = nextLogicalElementId;
|
|
1415
1489
|
returnNextElementObject = nextLogicalElementObject;
|
|
@@ -1423,7 +1497,7 @@ function combineOperation(
|
|
|
1423
1497
|
};
|
|
1424
1498
|
|
|
1425
1499
|
if (previousLogicalElementObject && operationLogicalElementObject && nextLogicalElementObject) {
|
|
1426
|
-
|
|
1500
|
+
console.log('------------ previous & operation & current ------------', {
|
|
1427
1501
|
previousLogicalElementId,
|
|
1428
1502
|
previousLogicalElementObject,
|
|
1429
1503
|
operationLogicalElementId,
|
|
@@ -1440,7 +1514,7 @@ function combineOperation(
|
|
|
1440
1514
|
operationLogicalElementObject.previousLogicalElementId = previousLogicalElementId;
|
|
1441
1515
|
operationLogicalElementObject.nextLogicalElementId = nextLogicalElementId;
|
|
1442
1516
|
|
|
1443
|
-
|
|
1517
|
+
console.log('after set previous and next: ', {
|
|
1444
1518
|
previousLogicalElementObject,
|
|
1445
1519
|
operationLogicalElementObject,
|
|
1446
1520
|
nextLogicalElementObject
|
|
@@ -1462,13 +1536,12 @@ function combineOperation(
|
|
|
1462
1536
|
};
|
|
1463
1537
|
|
|
1464
1538
|
function splitFilterElements(
|
|
1465
|
-
_izContext,
|
|
1466
1539
|
runningFilterMainId,
|
|
1467
1540
|
runningFilterObject,
|
|
1468
1541
|
currentFilterMainId = null,
|
|
1469
1542
|
currentFilterObject = null
|
|
1470
1543
|
) {
|
|
1471
|
-
|
|
1544
|
+
console.log('split FilterElements: ', {
|
|
1472
1545
|
runningFilterMainId,
|
|
1473
1546
|
runningFilterObject,
|
|
1474
1547
|
currentFilterMainId,
|
|
@@ -1484,42 +1557,42 @@ function splitFilterElements(
|
|
|
1484
1557
|
// ) {}
|
|
1485
1558
|
|
|
1486
1559
|
if (runningFilterObject.filterElement.filterType === 'operation') {
|
|
1487
|
-
|
|
1560
|
+
console.log('-------- operation ----------');
|
|
1488
1561
|
|
|
1489
1562
|
Object.assign(filterElements, runningFilterObject.filterElement.filterElements);
|
|
1490
1563
|
delete runningFilterObject.filterElement.filterElements;
|
|
1491
1564
|
filterElements[runningFilterMainId] = runningFilterObject;
|
|
1492
1565
|
|
|
1493
1566
|
} else if (runningFilterObject.filterElement.filterType === 'childComplexFilter') {
|
|
1494
|
-
|
|
1567
|
+
console.log('-------- childComplexFilter ----------');
|
|
1495
1568
|
|
|
1496
1569
|
Object.assign(filterElements, runningFilterObject.filterElement.filterElements);
|
|
1497
1570
|
delete runningFilterObject.filterElement.filterElements;
|
|
1498
1571
|
filterElements[runningFilterMainId] = runningFilterObject;
|
|
1499
1572
|
|
|
1500
1573
|
} else {
|
|
1501
|
-
|
|
1574
|
+
console.log(` -------- ${runningFilterObject.filterElement.filterType} ----------`);
|
|
1502
1575
|
//'logical'| 'identifiers'|'translateIds'|'traversal'
|
|
1503
1576
|
filterElements[runningFilterMainId] = runningFilterObject;
|
|
1504
1577
|
};
|
|
1505
1578
|
|
|
1506
1579
|
if (currentFilterObject !== null) {
|
|
1507
1580
|
if (currentFilterObject.filterElement.filterType === 'operation') {
|
|
1508
|
-
|
|
1581
|
+
console.log('-------- operation ----------');
|
|
1509
1582
|
|
|
1510
1583
|
Object.assign(filterElements, currentFilterObject.filterElement.filterElements);
|
|
1511
1584
|
delete currentFilterObject.filterElement.filterElements;
|
|
1512
1585
|
filterElements[currentFilterMainId] = currentFilterObject;
|
|
1513
1586
|
|
|
1514
1587
|
} else if (currentFilterObject.filterElement.filterType === 'childComplexFilter') {
|
|
1515
|
-
|
|
1588
|
+
console.log('-------- childComplexFilter ----------');
|
|
1516
1589
|
|
|
1517
1590
|
Object.assign(filterElements, currentFilterObject.filterElement.filterElements);
|
|
1518
1591
|
delete currentFilterObject.filterElement.filterElements;
|
|
1519
1592
|
filterElements[currentFilterMainId] = currentFilterObject;
|
|
1520
1593
|
|
|
1521
1594
|
} else {
|
|
1522
|
-
|
|
1595
|
+
console.log(` -------- ${currentFilterObject.filterElement.filterType} ----------`);
|
|
1523
1596
|
//'logical'| 'identifiers'|'translateIds'|'traversal'
|
|
1524
1597
|
filterElements[currentFilterMainId] = currentFilterObject;
|
|
1525
1598
|
};
|
|
@@ -1535,7 +1608,7 @@ export default {
|
|
|
1535
1608
|
createFiltersRequest,
|
|
1536
1609
|
validateCombinationStructure,
|
|
1537
1610
|
// validateOperation,
|
|
1538
|
-
|
|
1611
|
+
filterLogicalElements,
|
|
1539
1612
|
// splitFilterElements,
|
|
1540
1613
|
|
|
1541
1614
|
combineLogicalStructure,
|