@izara_frontend/shared-complex-filter 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/dist/complexFilter.js +2638 -143
- package/dist/complexFilter.js.LICENSE.txt +1 -0
- package/dist/complexFilter.js.map +1 -0
- package/package.json +4 -7
- package/src/complexFilterMain/mainCaseUseConditionAndMultipleIdentifersComponent.jsx +12 -145
- package/src/complexFilterMain/modalComplexFilterComponent.jsx +46 -205
- package/src/complexFilterMain/modalLogicalElement.jsx +35 -144
- package/src/function/createActionLibCreateLinkStepAndComplexFilter.js +1 -21
- package/src/function/valueUserTagFunction.js +0 -76
- package/src/index.js +1 -0
- package/src/linkSteps/modalLinkStepsComponent.jsx +13 -96
- package/src/valueUserTags/fieldNameComponent.jsx +0 -6
- package/src/valueUserTags/valueUserTagsComponent.jsx +0 -1
- package/webpack.config.js +26 -83
|
@@ -13,33 +13,20 @@ import {
|
|
|
13
13
|
} from "@izaraFrontends/styles";
|
|
14
14
|
import { useImmer } from "use-immer";
|
|
15
15
|
|
|
16
|
-
// import {
|
|
17
|
-
// getObjectSchema,
|
|
18
|
-
// reformatObjectSchema,
|
|
19
|
-
// } from "@izara_project/izara-shared-service-schemas";
|
|
20
|
-
|
|
21
|
-
// import { get_objectLinksSchema } from "../../../../izara-frontend-lib-core-page-output-config_rut/configPageOutputSection/getSchemaNewLibrary/getObjectSchemaQuery";
|
|
22
|
-
// import {
|
|
23
|
-
// collectObjectLinksWithRequestProperties,
|
|
24
|
-
// collectObjectSchemaWithHierarchy,
|
|
25
|
-
// } from "@izara_frontend/service-schemas";
|
|
26
|
-
|
|
27
16
|
import { useDispatch, useSelector } from "react-redux";
|
|
28
17
|
import { nanoid } from "nanoid";
|
|
29
18
|
import { ModalRequiredData } from "./modalRequiredData";
|
|
30
|
-
// import _, { flatMap, last } from "lodash";
|
|
31
|
-
// var hash = require("object-hash");
|
|
32
19
|
|
|
33
20
|
function createObjTypeConcat(objType) {
|
|
34
|
-
|
|
21
|
+
|
|
35
22
|
return `${objType?.serviceTag}_${objType?.objectType}`;
|
|
36
23
|
}
|
|
37
24
|
function createRelTypeConcat(relType) {
|
|
38
|
-
|
|
25
|
+
|
|
39
26
|
return `${relType?.serviceTag}_${relType?.relationshipTag}`;
|
|
40
27
|
}
|
|
41
28
|
function objTypeFromObjTypeConcat(objTypeConcat) {
|
|
42
|
-
|
|
29
|
+
|
|
43
30
|
let result = objTypeConcat.split("_");
|
|
44
31
|
|
|
45
32
|
if (result.length !== 2) {
|
|
@@ -54,8 +41,8 @@ function objTypeFromObjTypeConcat(objTypeConcat) {
|
|
|
54
41
|
|
|
55
42
|
export function findLogicalRoot(activeId, logicalElementObj) {
|
|
56
43
|
const prevId = logicalElementObj[activeId]?.previousLogicalElementId;
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
|
|
45
|
+
|
|
59
46
|
|
|
60
47
|
if (prevId) {
|
|
61
48
|
if (
|
|
@@ -82,22 +69,6 @@ export const OutputListLogicalElement = ({
|
|
|
82
69
|
handleAddLogicalElement,
|
|
83
70
|
hadleActiveLogicalElement,
|
|
84
71
|
}) => {
|
|
85
|
-
console.log("logicalElementId:dfdfsdgffdgfd ", logicalElementId);
|
|
86
|
-
// function loopFindLastLogicalElement(nextLogicalElementId) {
|
|
87
|
-
// console.log(
|
|
88
|
-
// "logicalElementObj[nextLogicalElementId]:asdsfcxvdsf ",
|
|
89
|
-
// logicalElementObj[nextLogicalElementId]
|
|
90
|
-
// );
|
|
91
|
-
|
|
92
|
-
// if (logicalElementObj[nextLogicalElementId].nextLogicalElementId === null) {
|
|
93
|
-
// console.log("nextLogicalElementId:xxczxvcxvcxb ", nextLogicalElementId);
|
|
94
|
-
// return nextLogicalElementId;
|
|
95
|
-
// } else {
|
|
96
|
-
// return loopFindLastLogicalElement(
|
|
97
|
-
// logicalElementObj[nextLogicalElementId].nextLogicalElementId
|
|
98
|
-
// );
|
|
99
|
-
// }
|
|
100
|
-
// }
|
|
101
72
|
function handelRemoveLogical(startKey) {
|
|
102
73
|
const toDelete = new Set();
|
|
103
74
|
|
|
@@ -124,7 +95,7 @@ export const OutputListLogicalElement = ({
|
|
|
124
95
|
});
|
|
125
96
|
|
|
126
97
|
setLogicalElementObj((logicalElementObj) => {
|
|
127
|
-
|
|
98
|
+
|
|
128
99
|
for (const keyDelete of toDelete) {
|
|
129
100
|
logicalElementObj[
|
|
130
101
|
logicalElementObj[keyDelete].previousLogicalElementId
|
|
@@ -150,7 +121,6 @@ export const OutputListLogicalElement = ({
|
|
|
150
121
|
<>{logicalElementObj[logicalElementId].operation}</>
|
|
151
122
|
) : (
|
|
152
123
|
<>{logicalElementId}</>
|
|
153
|
-
// <>{logicalElementObj[logicalElementId].logicalElementType}</>
|
|
154
124
|
)}
|
|
155
125
|
</button>
|
|
156
126
|
|
|
@@ -199,13 +169,12 @@ export const ModalLogicalElement = ({
|
|
|
199
169
|
collectObjectSchemaWithHierarchy,
|
|
200
170
|
objConfigUseCase,
|
|
201
171
|
}) => {
|
|
202
|
-
// console.log("keyUseCase:dfecvxvd ", keyUseCase);
|
|
203
172
|
if (!objTypeMain) {
|
|
204
173
|
objTypeMain = objConfigUseCase.objType;
|
|
205
174
|
}
|
|
206
175
|
|
|
207
|
-
|
|
208
|
-
|
|
176
|
+
|
|
177
|
+
|
|
209
178
|
|
|
210
179
|
if (!valueUserTag) {
|
|
211
180
|
if (objConfigUseCase?.valueUserTags) {
|
|
@@ -222,7 +191,7 @@ export const ModalLogicalElement = ({
|
|
|
222
191
|
),
|
|
223
192
|
);
|
|
224
193
|
|
|
225
|
-
|
|
194
|
+
|
|
226
195
|
|
|
227
196
|
const dispatch = useDispatch();
|
|
228
197
|
const [modalSettingRequiredData, setModalSettingRequiredData] =
|
|
@@ -233,13 +202,9 @@ export const ModalLogicalElement = ({
|
|
|
233
202
|
const [resultFieldName, getObjSchemaHieFn, collectLinksOpt2] =
|
|
234
203
|
collectObjectSchemaWithHierarchy();
|
|
235
204
|
|
|
236
|
-
|
|
205
|
+
|
|
237
206
|
|
|
238
|
-
|
|
239
|
-
"dataRelationship:wsxzx data ",
|
|
240
|
-
allObjTypesLinkConfigs,
|
|
241
|
-
resultFieldName,
|
|
242
|
-
);
|
|
207
|
+
|
|
243
208
|
const [initialLogicalElementId, setInitialLogicalElementId] = useState(
|
|
244
209
|
objConfigUseCase ? objConfigUseCase.initialLogicalElementId : "",
|
|
245
210
|
);
|
|
@@ -257,19 +222,14 @@ export const ModalLogicalElement = ({
|
|
|
257
222
|
const [newUserTagsRequestProperties, setNewUserTagsRequestProperties] =
|
|
258
223
|
useImmer({});
|
|
259
224
|
|
|
260
|
-
|
|
261
|
-
"logicalElementOutput: awscxzzvbm",
|
|
262
|
-
initialLogicalElementId,
|
|
263
|
-
logicalElementOutput,
|
|
264
|
-
logicalElementObj,
|
|
265
|
-
);
|
|
225
|
+
|
|
266
226
|
|
|
267
227
|
useEffect(() => {
|
|
268
228
|
collectRequireLinksFn(objTypeMain);
|
|
269
229
|
getObjSchemaHieFn(objTypeMain);
|
|
270
230
|
}, []);
|
|
271
231
|
|
|
272
|
-
|
|
232
|
+
|
|
273
233
|
function createArrObjTypeLogical(activeId, logicalElementObj) {
|
|
274
234
|
const result = {
|
|
275
235
|
arrOutput: [],
|
|
@@ -277,22 +237,17 @@ export const ModalLogicalElement = ({
|
|
|
277
237
|
};
|
|
278
238
|
|
|
279
239
|
function loopLogical(id) {
|
|
280
|
-
|
|
240
|
+
|
|
281
241
|
const currentLogical = logicalElementObj[id];
|
|
282
|
-
|
|
242
|
+
|
|
283
243
|
|
|
284
244
|
if (!currentLogical) return;
|
|
285
245
|
if (currentLogical.previousLogicalElementId !== null) {
|
|
286
|
-
|
|
246
|
+
|
|
287
247
|
|
|
288
248
|
loopLogical(currentLogical.previousLogicalElementId);
|
|
289
249
|
}
|
|
290
|
-
|
|
291
|
-
"createArrObjTypeLogical",
|
|
292
|
-
id,
|
|
293
|
-
logicalElementObj[currentLogical.previousLogicalElementId]
|
|
294
|
-
?.childLogicalElementId,
|
|
295
|
-
);
|
|
250
|
+
|
|
296
251
|
if (
|
|
297
252
|
id ===
|
|
298
253
|
logicalElementObj[currentLogical.previousLogicalElementId]
|
|
@@ -307,7 +262,7 @@ export const ModalLogicalElement = ({
|
|
|
307
262
|
.pathLinkType.objType,
|
|
308
263
|
);
|
|
309
264
|
}
|
|
310
|
-
|
|
265
|
+
|
|
311
266
|
|
|
312
267
|
result.lastObjtype = objTypeOutput;
|
|
313
268
|
result.arrOutput.push({ [objTypeOutput]: id });
|
|
@@ -316,7 +271,7 @@ export const ModalLogicalElement = ({
|
|
|
316
271
|
|
|
317
272
|
loopLogical(activeId);
|
|
318
273
|
|
|
319
|
-
|
|
274
|
+
|
|
320
275
|
return result;
|
|
321
276
|
}
|
|
322
277
|
|
|
@@ -324,22 +279,21 @@ export const ModalLogicalElement = ({
|
|
|
324
279
|
let result = null;
|
|
325
280
|
|
|
326
281
|
function loop(id) {
|
|
327
|
-
|
|
282
|
+
|
|
328
283
|
const current = logicalElementObj[id];
|
|
329
|
-
|
|
284
|
+
|
|
330
285
|
if (!current) return;
|
|
331
286
|
|
|
332
287
|
if (
|
|
333
288
|
current.logicalElementType === "childComplexFilter" ||
|
|
334
289
|
current.logicalElementType === "logical"
|
|
335
|
-
// !current.previousLogicalElementId
|
|
336
290
|
) {
|
|
337
291
|
result = current.objType || null;
|
|
338
292
|
return;
|
|
339
293
|
}
|
|
340
294
|
|
|
341
295
|
const prevId = current.previousLogicalElementId;
|
|
342
|
-
|
|
296
|
+
|
|
343
297
|
|
|
344
298
|
if (!prevId) {
|
|
345
299
|
if (current.objType) {
|
|
@@ -351,7 +305,6 @@ export const ModalLogicalElement = ({
|
|
|
351
305
|
const prev = logicalElementObj[prevId];
|
|
352
306
|
if (!prev) return;
|
|
353
307
|
|
|
354
|
-
// ถ้า previous มี childLogicalElementId === currentId แสดงว่า current เป็น child ของ prev หยุด (ไม่ข้ามขึ้น)
|
|
355
308
|
if (prev.childLogicalElementId === id) {
|
|
356
309
|
// แต่ถ้ามี objType ของตัวเอง ใช้ตัวเอง
|
|
357
310
|
if (current.objType) {
|
|
@@ -379,28 +332,8 @@ export const ModalLogicalElement = ({
|
|
|
379
332
|
let result = null;
|
|
380
333
|
|
|
381
334
|
function loop(id) {
|
|
382
|
-
console.log("id:wdsfdfdf ", id);
|
|
383
335
|
const current = logicalElementObj[id];
|
|
384
|
-
// console.log("current:sadfdf ", current);
|
|
385
|
-
// if (!current) {
|
|
386
|
-
// result = null;
|
|
387
|
-
// return;
|
|
388
|
-
// } else {
|
|
389
|
-
// result = current.objType;
|
|
390
|
-
// return;
|
|
391
|
-
// }
|
|
392
|
-
|
|
393
|
-
// if (
|
|
394
|
-
// current.logicalElementType === "childComplexFilter" ||
|
|
395
|
-
// current.logicalElementType === "logical"
|
|
396
|
-
// // !current.previousLogicalElementId
|
|
397
|
-
// ) {
|
|
398
|
-
// result = current.objType || null;
|
|
399
|
-
// return;
|
|
400
|
-
// }
|
|
401
|
-
|
|
402
336
|
const prevId = current.previousLogicalElementId;
|
|
403
|
-
console.log("prevId:findObjTypeStep ", prevId);
|
|
404
337
|
|
|
405
338
|
if (!prevId) {
|
|
406
339
|
if (current.objType) {
|
|
@@ -412,7 +345,6 @@ export const ModalLogicalElement = ({
|
|
|
412
345
|
const prev = logicalElementObj[prevId];
|
|
413
346
|
if (!prev) return;
|
|
414
347
|
|
|
415
|
-
// ถ้า previous มี childLogicalElementId === currentId แสดงว่า current เป็น child ของ prev หยุด (ไม่ข้ามขึ้น)
|
|
416
348
|
if (prev.childLogicalElementId === id) {
|
|
417
349
|
// แต่ถ้ามี objType ของตัวเอง ใช้ตัวเอง
|
|
418
350
|
if (current.objType) {
|
|
@@ -444,7 +376,7 @@ export const ModalLogicalElement = ({
|
|
|
444
376
|
logicalElementObj[logicalElementOutput.active].nextLogicalElementId,
|
|
445
377
|
);
|
|
446
378
|
let logicalObj = {};
|
|
447
|
-
|
|
379
|
+
|
|
448
380
|
|
|
449
381
|
setLogicalElementOutput((logicalElementOutput) => {
|
|
450
382
|
logicalElementOutput.status = false;
|
|
@@ -492,9 +424,6 @@ export const ModalLogicalElement = ({
|
|
|
492
424
|
logicalObj = {
|
|
493
425
|
...mainLoigcalObj,
|
|
494
426
|
objType: objType,
|
|
495
|
-
// fieldName: "",
|
|
496
|
-
// comparison: "",
|
|
497
|
-
// valueUserTag: "",
|
|
498
427
|
};
|
|
499
428
|
}
|
|
500
429
|
|
|
@@ -575,7 +504,7 @@ export const ModalLogicalElement = ({
|
|
|
575
504
|
function handleAddLogicalElement(action) {
|
|
576
505
|
const uuid = nanoid(10);
|
|
577
506
|
|
|
578
|
-
|
|
507
|
+
|
|
579
508
|
if (action === "addChild") {
|
|
580
509
|
collectRequireLinksFn(
|
|
581
510
|
logicalElementObj[logicalElementOutput.active].pathLinkType.objType,
|
|
@@ -647,16 +576,13 @@ export const ModalLogicalElement = ({
|
|
|
647
576
|
}
|
|
648
577
|
|
|
649
578
|
function hadelActiveTopParent(objType) {
|
|
650
|
-
|
|
579
|
+
|
|
651
580
|
setLogicalElementOutput((logicalElementOutput) => {
|
|
652
581
|
logicalElementOutput.active = Object.values(objType)[0];
|
|
653
582
|
});
|
|
654
583
|
}
|
|
655
584
|
|
|
656
|
-
|
|
657
|
-
"afsofiud",
|
|
658
|
-
createArrObjTypeLogical(logicalElementOutput.active, logicalElementObj),
|
|
659
|
-
);
|
|
585
|
+
|
|
660
586
|
|
|
661
587
|
function handleSelectFieldName(e, type) {
|
|
662
588
|
let value = e.target.value;
|
|
@@ -695,7 +621,7 @@ export const ModalLogicalElement = ({
|
|
|
695
621
|
}
|
|
696
622
|
|
|
697
623
|
function handleUpdateNewValue(e, type) {
|
|
698
|
-
|
|
624
|
+
|
|
699
625
|
|
|
700
626
|
setNewUserTags((newUserTags) => {
|
|
701
627
|
newUserTags.obj[type] = e.target.value;
|
|
@@ -714,7 +640,7 @@ export const ModalLogicalElement = ({
|
|
|
714
640
|
|
|
715
641
|
function handleSelectCreateNewValue(e) {
|
|
716
642
|
let type = e.target.value;
|
|
717
|
-
|
|
643
|
+
|
|
718
644
|
|
|
719
645
|
setNewUserTags((newUserTags) => {
|
|
720
646
|
if (type === "valueUserTag") {
|
|
@@ -737,14 +663,9 @@ export const ModalLogicalElement = ({
|
|
|
737
663
|
}
|
|
738
664
|
});
|
|
739
665
|
|
|
740
|
-
// setNewUserTags({});
|
|
741
666
|
}
|
|
742
667
|
|
|
743
|
-
|
|
744
|
-
"newUserTags:sadsxczvbbvb ",
|
|
745
|
-
newUserTagsRequestProperties,
|
|
746
|
-
valueDataUserTags,
|
|
747
|
-
);
|
|
668
|
+
|
|
748
669
|
|
|
749
670
|
function handleCreateNewValue(e) {
|
|
750
671
|
setLogicalElementObj((logicalElementObj) => {
|
|
@@ -787,7 +708,7 @@ export const ModalLogicalElement = ({
|
|
|
787
708
|
});
|
|
788
709
|
}
|
|
789
710
|
|
|
790
|
-
|
|
711
|
+
|
|
791
712
|
const logicalElementType = [
|
|
792
713
|
"openBracket",
|
|
793
714
|
"closeBracket",
|
|
@@ -823,7 +744,6 @@ export const ModalLogicalElement = ({
|
|
|
823
744
|
dispatch(
|
|
824
745
|
successFunction({
|
|
825
746
|
parentOutputId: parentOutputId,
|
|
826
|
-
// keyElement,
|
|
827
747
|
initialLogicalElementId: initialLogicalElementId,
|
|
828
748
|
logicalElements: logicalElementObj,
|
|
829
749
|
valueDataUserTags: valueDataUserTags,
|
|
@@ -866,10 +786,10 @@ export const ModalLogicalElement = ({
|
|
|
866
786
|
dispatch();
|
|
867
787
|
}
|
|
868
788
|
|
|
869
|
-
|
|
870
|
-
|
|
789
|
+
|
|
790
|
+
|
|
871
791
|
|
|
872
|
-
|
|
792
|
+
|
|
873
793
|
|
|
874
794
|
return (
|
|
875
795
|
<div>
|
|
@@ -1001,22 +921,7 @@ export const ModalLogicalElement = ({
|
|
|
1001
921
|
{key}
|
|
1002
922
|
</option>
|
|
1003
923
|
))}
|
|
1004
|
-
{/* {
|
|
1005
|
-
resultFieldName[
|
|
1006
|
-
logicalElementObj[logicalElementOutput.active]
|
|
1007
|
-
.previousLogicalElementId === null
|
|
1008
|
-
? createObjTypeConcat(objTypeMain)
|
|
1009
|
-
: createArrObjTypeLogical(
|
|
1010
|
-
logicalElementOutput.active,
|
|
1011
|
-
logicalElementObj,
|
|
1012
|
-
).lastObjtype
|
|
1013
|
-
]?.identifiers,
|
|
1014
|
-
createArrObjTypeLogical(
|
|
1015
|
-
logicalElementOutput.active,
|
|
1016
|
-
logicalElementObj,
|
|
1017
|
-
).lastObjtype,
|
|
1018
|
-
"ssdawdafafff",
|
|
1019
|
-
)} */}
|
|
924
|
+
{/* {} */}
|
|
1020
925
|
{resultFieldName && (
|
|
1021
926
|
<>
|
|
1022
927
|
{resultFieldName[
|
|
@@ -1053,10 +958,7 @@ export const ModalLogicalElement = ({
|
|
|
1053
958
|
"div",
|
|
1054
959
|
)}
|
|
1055
960
|
>
|
|
1056
|
-
{
|
|
1057
|
-
allObjTypesLinkConfigs,
|
|
1058
|
-
"foopesofods",
|
|
1059
|
-
)}
|
|
961
|
+
{}
|
|
1060
962
|
|
|
1061
963
|
{!allObjTypesLinkConfigs[
|
|
1062
964
|
logicalElementObj[logicalElementOutput.active]
|
|
@@ -1904,25 +1806,14 @@ export const ModalLogicalElement = ({
|
|
|
1904
1806
|
statusModalSettingRequiredData
|
|
1905
1807
|
}
|
|
1906
1808
|
objConfigUseCase={objConfigUseCase}
|
|
1907
|
-
// objTypeMain={objConfig.pageOutputMainConfigUseCase.objType}
|
|
1908
1809
|
nameReducer={nameReducer}
|
|
1909
1810
|
parentOutputId={parentOutputId}
|
|
1910
|
-
// userTags={objConfig.pageOutputMainConfigUseCase.values}
|
|
1911
|
-
// sortFieldStatus={"fromSortField"}
|
|
1912
|
-
// successRequiredDataConfig={
|
|
1913
|
-
// successRequiredDataConfig
|
|
1914
|
-
// }
|
|
1915
1811
|
collectObjectLinksWithRequestProperties={
|
|
1916
1812
|
collectObjectLinksWithRequestProperties
|
|
1917
1813
|
}
|
|
1918
1814
|
collectObjectSchemaWithHierarchy={
|
|
1919
1815
|
collectObjectSchemaWithHierarchy
|
|
1920
1816
|
}
|
|
1921
|
-
// keyRequiredData={
|
|
1922
|
-
// modalSettingRequiredData === true
|
|
1923
|
-
// ? ""
|
|
1924
|
-
// : modalSettingRequiredData
|
|
1925
|
-
// }
|
|
1926
1817
|
/>
|
|
1927
1818
|
)}
|
|
1928
1819
|
<fieldset></fieldset>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { current, createEntityAdapter, createAction } from "@reduxjs/toolkit";
|
|
2
2
|
|
|
3
|
-
//--------------------------valueUserTag----------------------------------------
|
|
4
3
|
import {
|
|
5
4
|
valueUserTagCreate,
|
|
6
5
|
validateValueUserTagNotUsed,
|
|
@@ -14,34 +13,15 @@ export const validateValueUserTagNotUsedConfig = createAction(
|
|
|
14
13
|
"validateValueUserTagNotUsedConfig",
|
|
15
14
|
);
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
successTraversal,
|
|
21
|
-
// successFilterElement,
|
|
22
|
-
} from "./complexFilterFunction";
|
|
16
|
+
import { successTraversal } from "./complexFilterFunction";
|
|
23
17
|
|
|
24
18
|
export const successTraversalConfig = createAction("successTraversalConfig");
|
|
25
|
-
// export const successFilterElementConfig = createAction(
|
|
26
|
-
// "successFilterElementConfig",
|
|
27
|
-
// );
|
|
28
|
-
|
|
29
|
-
//--------------------------------linkStepFunctionAndUseCase-----------------------------------
|
|
30
|
-
// import { successRequiredData } from "./linkStepFunction";
|
|
31
|
-
|
|
32
|
-
// export const successRequiredDataConfig = createAction(
|
|
33
|
-
// "successRequiredDataConfig",
|
|
34
|
-
// );
|
|
35
19
|
|
|
36
20
|
export const sendExtraReducerLibCreateLinkStepAndComplexFilter = (builder) => {
|
|
37
|
-
//----------------------------valueUserTag---------------------------------------
|
|
38
21
|
builder.addCase(valueUserTagCreateConfig, valueUserTagCreate);
|
|
39
22
|
builder.addCase(
|
|
40
23
|
validateValueUserTagNotUsedConfig,
|
|
41
24
|
validateValueUserTagNotUsed,
|
|
42
25
|
);
|
|
43
|
-
//----------------------------------complexFilterFunction----------------------------
|
|
44
26
|
builder.addCase(successTraversalConfig, successTraversal);
|
|
45
|
-
// builder.addCase(successFilterElementConfig, successFilterElement);
|
|
46
|
-
// builder.addCase(successRequiredDataConfig, successRequiredData);
|
|
47
27
|
};
|
|
@@ -3,78 +3,18 @@ import { current, createEntityAdapter, createAction } from "@reduxjs/toolkit";
|
|
|
3
3
|
export const valueUserTagCreate = (state, action) => {
|
|
4
4
|
const { parentOutputId, objCreateValueUserTag } = action.payload;
|
|
5
5
|
|
|
6
|
-
console.log(
|
|
7
|
-
"objCreateValueUserTag:rdfsdgfhfb ",
|
|
8
|
-
parentOutputId,
|
|
9
|
-
objCreateValueUserTag,
|
|
10
|
-
);
|
|
11
6
|
state[parentOutputId].currentValues.pageOutputMainConfigUseCase.valueUserTags[
|
|
12
7
|
objCreateValueUserTag.keyName
|
|
13
8
|
] = { defaultValue: objCreateValueUserTag.defaultValue };
|
|
14
9
|
};
|
|
15
10
|
|
|
16
11
|
export const validateValueUserTagNotUsed = (state, action) => {
|
|
17
|
-
//linkstep
|
|
18
12
|
for (const linkStepId in state[parentOutputId].currentValues
|
|
19
13
|
.pageOutputMainConfigUseCase.linkSteps) {
|
|
20
|
-
console.log("linkStepId: ", linkStepId);
|
|
21
14
|
}
|
|
22
15
|
};
|
|
23
16
|
|
|
24
|
-
// function scanLogicalElements(set, logicalElements) {
|
|
25
|
-
// if (!logicalElements) return;
|
|
26
|
-
|
|
27
|
-
// Object.values(logicalElements).forEach((el) => {
|
|
28
|
-
// addTagsFromObjectValues(set, el.partitionKeyValueUserTags);
|
|
29
|
-
// addTagsFromObjectValues(set, el.sortKeyValueUserTags);
|
|
30
|
-
|
|
31
|
-
// if (el.conditionalFieldValues) {
|
|
32
|
-
// el.conditionalFieldValues.forEach((cond) => {
|
|
33
|
-
// addTags(set, cond.includeValueUserTags);
|
|
34
|
-
// addTags(set, cond.excludeValueUserTags);
|
|
35
|
-
// });
|
|
36
|
-
// }
|
|
37
|
-
|
|
38
|
-
// addTagsFromObjectValues(set, el.requestProperties);
|
|
39
|
-
// });
|
|
40
|
-
// }
|
|
41
|
-
|
|
42
|
-
// function scanTraversalSteps(set, traversalSteps) {
|
|
43
|
-
// if (!traversalSteps) return;
|
|
44
|
-
|
|
45
|
-
// Object.values(traversalSteps).forEach((step) => {
|
|
46
|
-
// if (step.fieldValueUserTags) {
|
|
47
|
-
// step.fieldValueUserTags.forEach((obj) => {
|
|
48
|
-
// addTagsFromObjectValues(set, obj);
|
|
49
|
-
// });
|
|
50
|
-
// }
|
|
51
|
-
// });
|
|
52
|
-
// }
|
|
53
|
-
|
|
54
|
-
// function scanSortFields(set, sortFields) {
|
|
55
|
-
// if (!sortFields) return;
|
|
56
|
-
|
|
57
|
-
// sortFields.forEach((sf) => {
|
|
58
|
-
// addTags(set, sf.sortByValueUserTags);
|
|
59
|
-
// });
|
|
60
|
-
// }
|
|
61
|
-
|
|
62
|
-
// function scanCombinations(set, combinations) {
|
|
63
|
-
// if (!combinations) return;
|
|
64
|
-
|
|
65
|
-
// Object.values(combinations).forEach((c) => {
|
|
66
|
-
// scanLogicalElements(set, c.logicalElements);
|
|
67
|
-
// });
|
|
68
|
-
// }
|
|
69
|
-
|
|
70
|
-
//------------------------
|
|
71
17
|
const addTags = (usedSet, tagKeys, arr) => {
|
|
72
|
-
console.log(
|
|
73
|
-
"usedSet, tagKeys, arr:addTags:xzxzxawffbbc ",
|
|
74
|
-
usedSet,
|
|
75
|
-
tagKeys,
|
|
76
|
-
arr,
|
|
77
|
-
);
|
|
78
18
|
if (!Array.isArray(arr)) return;
|
|
79
19
|
|
|
80
20
|
for (const v of arr) {
|
|
@@ -91,12 +31,6 @@ const addTagsFromObjectValues = (usedSet, tagKeys, obj) => {
|
|
|
91
31
|
};
|
|
92
32
|
|
|
93
33
|
function scanLogicalElements(usedSet, tagKeys, logicalElements) {
|
|
94
|
-
console.log(
|
|
95
|
-
"logicalElements:dxczxcvasrfdwaefasdf ",
|
|
96
|
-
usedSet,
|
|
97
|
-
tagKeys,
|
|
98
|
-
logicalElements,
|
|
99
|
-
);
|
|
100
34
|
if (!logicalElements) return;
|
|
101
35
|
|
|
102
36
|
for (const el of Object.values(logicalElements)) {
|
|
@@ -104,14 +38,6 @@ function scanLogicalElements(usedSet, tagKeys, logicalElements) {
|
|
|
104
38
|
|
|
105
39
|
addTagsFromObjectValues(usedSet, tagKeys, el.sortKeyValueUserTags);
|
|
106
40
|
|
|
107
|
-
// if (el.conditionalFieldValues) {
|
|
108
|
-
// for (const cond of el.conditionalFieldValues) {
|
|
109
|
-
// addTags(usedSet, tagKeys, cond.includeValueUserTags);
|
|
110
|
-
|
|
111
|
-
// addTags(usedSet, tagKeys, cond.excludeValueUserTags);
|
|
112
|
-
// }
|
|
113
|
-
// }
|
|
114
|
-
|
|
115
41
|
addTagsFromObjectValues(usedSet, tagKeys, el.requestProperties);
|
|
116
42
|
}
|
|
117
43
|
}
|
|
@@ -133,7 +59,6 @@ function scanRequiredDataLinkSteps(usedSet, tagKeys, steps) {
|
|
|
133
59
|
|
|
134
60
|
for (const step of Object.values(steps)) {
|
|
135
61
|
addTagsFromObjectValues(usedSet, tagKeys, step.requestProperties);
|
|
136
|
-
console.log("step: dfcvxbcxb", step);
|
|
137
62
|
if (step.filterElements) {
|
|
138
63
|
scanLogicalElements(
|
|
139
64
|
usedSet,
|
|
@@ -183,6 +108,5 @@ export function findUsedUserTagsFast(param) {
|
|
|
183
108
|
|
|
184
109
|
scanCombinations(used, tagKeys, param.perParentCombinations);
|
|
185
110
|
|
|
186
|
-
console.log("used:wsdxcvzvxcv ", used, tagKeys);
|
|
187
111
|
return used;
|
|
188
112
|
}
|
package/src/index.js
CHANGED
|
@@ -7,3 +7,4 @@ export { FieldNameComponent } from "./valueUserTags/fieldNameComponent.jsx";
|
|
|
7
7
|
export { sendExtraReducerLibCreateLinkStepAndComplexFilter } from "./function/createActionLibCreateLinkStepAndComplexFilter";
|
|
8
8
|
export { successFilterElement } from "./function/complexFilterFunction";
|
|
9
9
|
export { successRequiredData } from "./function/linkStepFunction";
|
|
10
|
+
export { findUsedUserTagsFast } from "./function/valueUserTagFunction";
|