@izara_frontend/shared-complex-filter 1.0.2 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@izara_frontend/shared-complex-filter",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "./dist/complexFilter.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -12,27 +12,27 @@
12
12
  "publishConfig": {
13
13
  "access": "public"
14
14
  },
15
+ "peerDependencies": {
16
+ "react": "^18.3.1",
17
+ "react-dom": "^18.3.1",
18
+ "react-redux": "^9.2.0"
19
+ },
15
20
  "devDependencies": {
16
21
  "@babel/core": "^7.29.0",
17
- "@babel/plugin-proposal-class-properties": "^7.18.6",
18
- "@babel/plugin-transform-runtime": "^7.29.0",
19
22
  "@babel/preset-env": "^7.29.2",
20
23
  "@babel/preset-react": "^7.28.5",
21
- "@babel/preset-stage-0": "^7.8.3",
22
- "@babel/runtime": "^7.29.2",
23
24
  "babel-loader": "^8.2.2",
24
- "babel-preset-react": "^6.24.1",
25
- "path": "^0.12.7",
26
25
  "webpack": "^5.105.4",
27
26
  "webpack-cli": "^7.0.2"
28
27
  },
29
28
  "dependencies": {
29
+ "@babel/runtime": "^7.29.2",
30
30
  "@izara_project/izara-shared-search-and-sort": "^1.0.16",
31
+ "@izara_project/izara-shared-service-schemas": "^1.0.62",
31
32
  "@reduxjs/toolkit": "^2.11.2",
33
+ "lodash": "^4.17.21",
32
34
  "nanoid": "^5.1.11",
33
35
  "object-hash": "^3.0.0",
34
- "react": "^18.3.1",
35
- "react-redux": "^9.2.0",
36
36
  "use-immer": "^0.11.0"
37
37
  }
38
38
  }
@@ -7,7 +7,6 @@ import {
7
7
  createStyleTags,
8
8
  } from "@izaraFrontends/styles";
9
9
  import { useDispatch, useSelector } from "react-redux";
10
- // import { DataFieldsSharedLib } from "@izara_project/izara-shared-search-and-sort";
11
10
  import { DataFieldsSharedLib } from "@izara_project/izara-shared-search-and-sort";
12
11
  import { ModalLinkStepsComponent } from "../linkSteps/modalLinkStepsComponent.jsx";
13
12
  import { ModalComplexFilterComponent } from "./modalComplexFilterComponent.jsx";
@@ -16,16 +15,16 @@ import { utils as sharedSchemaUtils } from "@izara_project/izara-shared-service-
16
15
  var hash = require("object-hash");
17
16
 
18
17
  function createObjTypeConcat(objType) {
19
- console.log("objType:dfcvcbcxb ", objType);
18
+
20
19
 
21
20
  return `${objType.serviceTag}_${objType.objectType}`;
22
21
  }
23
22
  function createRelTypeConcat(relType) {
24
- console.log("objType:sdsadwsd ", relType);
23
+
25
24
  return `${relType?.serviceTag}_${relType?.relationshipTag}`;
26
25
  }
27
26
  function objTypeFromObjTypeConcat(objTypeConcat) {
28
- console.log("objTypeConcat:aeaeaeww ", objTypeConcat);
27
+
29
28
  let result = objTypeConcat.split("_");
30
29
 
31
30
  if (result.length !== 2) {
@@ -46,28 +45,18 @@ export const MainCaseUseConditionAndMultipleIdentifersComponent = ({
46
45
  nameReducer,
47
46
  parentOutputId,
48
47
  valueUserTags,
49
- // valueUserTags, not sure
50
48
  successFunc,
51
49
  collectObjectLinksWithRequestProperties,
52
50
  collectObjectSchemaWithHierarchy,
53
- //useCase--------------------------------
51
+
54
52
  nameObjectLinkStepEdit,
55
53
  keyElement,
56
54
  LastStepsComponentUseCase,
57
55
  }) => {
58
- //-----------------------state---------------------------------------
59
- // const [nameObjectLinkStep, setNameObjectLinkStep] = useState(
60
- // nameObjectLinkStepEdit,
61
- // );
62
-
63
- //--------------------------------------------------------------
64
56
 
65
- //-----------------------Shared function-----------------------------------
66
-
67
- //-----------------------End Shared function-----------------------------------
68
57
  const dispatch = useDispatch();
69
58
 
70
- console.log("objTypeMain:xczczxvv ", objTypeMain);
59
+
71
60
  function submitLinkSteps() {}
72
61
 
73
62
  function validateRequestProperties() {
@@ -82,16 +71,8 @@ export const MainCaseUseConditionAndMultipleIdentifersComponent = ({
82
71
  return true;
83
72
  }
84
73
 
85
- //----------------------func prop---------------------------------
86
-
87
- // function handleInputNameLinkStep(e) {
88
- // setNameObjectLinkStep(e.target.value);
89
- // }
90
-
91
- //----------------------func prop---------------------------------
92
-
93
- console.log("nameReducer:sdxcvzxvcxv ", nameReducer);
94
- console.log("component ssswxvcxz");
74
+
75
+
95
76
  return (
96
77
  <>
97
78
  <ModalLinkStepsComponent
@@ -106,16 +87,11 @@ export const MainCaseUseConditionAndMultipleIdentifersComponent = ({
106
87
  collectObjectLinksWithRequestProperties
107
88
  }
108
89
  collectObjectSchemaWithHierarchy={collectObjectSchemaWithHierarchy}
109
- //---------------use case----------------------------
110
90
  keyElement={keyElement}
111
- // nameObjectLinkStep={nameObjectLinkStep}
112
- //------------------------------------------
113
- // funcUseCase={{ handleInputNameLinkStep, validateRequestProperties }}
114
91
  ComponentUseCase={ConditionLinkStepAndMultipleIdentifersComponent}
115
92
  LastStepsComponentUseCase={LastStepsComponentUseCase}
116
93
  valueUserTags={valueUserTags}
117
94
  nameObjectLinkStepEdit={nameObjectLinkStepEdit}
118
- // keyObjectUseCase
119
95
  />
120
96
  </>
121
97
  );
@@ -183,7 +159,7 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
183
159
  linkSteps[indexLinkStep - 1].requestProperties[keyRequestProperties]
184
160
  ].hasOwnProperty("complexFilterCombinationId")
185
161
  ) {
186
- (console.log("dhawdshffaf"), linkSteps);
162
+ ( linkSteps);
187
163
  conditions.applyCombinations = true;
188
164
  }
189
165
  }
@@ -266,7 +242,6 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
266
242
  }
267
243
 
268
244
  function handleConditionLinkSteps(type, value) {
269
- // let value = e.target.value;
270
245
 
271
246
  setLinkSteps((linkSteps) => {
272
247
  if (value === "none") {
@@ -277,14 +252,7 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
277
252
  } else {
278
253
  if (type === "comparisonSortField") {
279
254
  let dataType;
280
- console.log(
281
- "sadawdsd",
282
- resultFieldName[
283
- createObjTypeConcat(
284
- linkSteps[linkStepsOutput.active].pathLinkType.objType,
285
- )
286
- ].fieldNames[value],
287
- );
255
+
288
256
  switch (
289
257
  resultFieldName[
290
258
  createObjTypeConcat(
@@ -303,8 +271,6 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
303
271
  dataType = "string";
304
272
  break;
305
273
 
306
- // default:
307
- // dataType = "string";
308
274
  }
309
275
 
310
276
  linkSteps[linkStepsOutput.active].comparisonDataType = dataType;
@@ -348,7 +314,6 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
348
314
  "izaraSyntax",
349
315
  ];
350
316
 
351
- // valueUserTags not sure if need to be here
352
317
  function handleValueSelect(e, key) {
353
318
  let value = e.target.value;
354
319
 
@@ -368,7 +333,6 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
368
333
  delete newUserTags[key];
369
334
  });
370
335
  }
371
- // setNewUserTags({});
372
336
  }
373
337
 
374
338
  function handleRequestPropertiesSelect(e, key) {
@@ -417,12 +381,6 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
417
381
  newUserTags[key].name;
418
382
  });
419
383
 
420
- // setValueDataUserTags((valueDataUserTags) => {
421
- // valueDataUserTags[newUserTags[key].name] = {
422
- // defaultValue: newUserTags[key].obj.defaultValue,
423
- // };
424
- // });
425
-
426
384
  setNewUserTags((newUserTags) => {
427
385
  delete newUserTags[key];
428
386
  });
@@ -469,7 +427,7 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
469
427
  valueDataUserTagsNew,
470
428
  keyUseCase,
471
429
  ) {
472
- console.log("newUserTags:dfgxvxvx ", newUserTags, keyUseCase);
430
+
473
431
  let objComplexFilterCombination = {};
474
432
 
475
433
  objComplexFilterCombination = {
@@ -479,29 +437,6 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
479
437
  };
480
438
 
481
439
  let hashComplexFilterCombination = hash(objComplexFilterCombination);
482
-
483
- console.log(
484
- "objComplexFilterCombination: fdfcgrtgd",
485
- objComplexFilterCombination,
486
- );
487
-
488
- // setComplexFilterCombinations((complexFilterCombinations) => {
489
- // delete complexFilterCombinations[
490
- // valueDataUserTags[
491
- // requiredDataLinkStep[requiredDataOutput.active].requestProperties[
492
- // keyUseCase
493
- // ]
494
- // ]?.complexFilterCombinationId
495
- // ];
496
- // complexFilterCombinations[hashComplexFilterCombination] =
497
- // objComplexFilterCombination;
498
- // });
499
-
500
- // setRequiredDataLinkStep((requiredDataLinkStep) => {
501
- // requiredDataLinkStep[requiredDataOutput.active].requestProperties[
502
- // keyUseCase
503
- // ] = newUserTags[keyUseCase].name;
504
- // });
505
440
  }
506
441
 
507
442
  let testAA = [];
@@ -516,7 +451,7 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
516
451
  nameLinkSteps,
517
452
  dataType,
518
453
  ) {
519
- console.log("sortObj:sdccvxxcv ", sortLinkSteps);
454
+
520
455
  let linkStepsArr = [];
521
456
  for (const index in sortLinkSteps) {
522
457
  let linkStepObj = sortLinkSteps[index];
@@ -534,7 +469,7 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
534
469
  });
535
470
  }
536
471
 
537
- console.log(modalSortField, "modalSortField:widixcaeews");
472
+
538
473
  return (
539
474
  <>
540
475
  {allObjTypesLinkConfigs[
@@ -601,7 +536,6 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
601
536
  linkSteps[linkStepsOutput.active]
602
537
  .sortFields[idSortField].dataType
603
538
  }
604
- // value={currentStep.lastFieldname}
605
539
  >
606
540
  <option value="string">string</option>
607
541
  <option value="number">number</option>
@@ -1115,37 +1049,12 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
1115
1049
  "defaultValue" in val,
1116
1050
  ),
1117
1051
  )}
1118
- // objConfigUseCase={
1119
- // complexFilterCombinations[
1120
- // valueUserTags[
1121
- // linkSteps[
1122
- // linkStepsOutput.active
1123
- // ].requestProperties[
1124
- // keyRequestProperties
1125
- // ]
1126
- // ]?.complexFilterCombinationId
1127
- // ]
1128
- // }
1129
1052
  collectObjectLinksWithRequestProperties={
1130
1053
  collectObjectLinksWithRequestProperties
1131
1054
  }
1132
1055
  collectObjectSchemaWithHierarchy={
1133
1056
  collectObjectSchemaWithHierarchy
1134
1057
  }
1135
- // editLogicalElementObj={
1136
- // complexFilterCombinations[
1137
- // valueUserTags[
1138
- // linkSteps[
1139
- // linkStepsOutput
1140
- // .active
1141
- // ]
1142
- // .requestProperties[
1143
- // keyRequestProperties
1144
- // ]
1145
- // ]
1146
- // ?.complexFilterCombinationId
1147
- // ]
1148
- // }
1149
1058
  />
1150
1059
  </>
1151
1060
  )}
@@ -1207,20 +1116,6 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
1207
1116
  collectObjectSchemaWithHierarchy={
1208
1117
  collectObjectSchemaWithHierarchy
1209
1118
  }
1210
- // editLogicalElementObj={
1211
- // perParentCombinations[
1212
- // valueUserTags[
1213
- // linkSteps[
1214
- // linkStepsOutput
1215
- // .active
1216
- // ]
1217
- // .requestProperties[
1218
- // keyRequestProperties
1219
- // ]
1220
- // ]
1221
- // ?.perParentCombinationId
1222
- // ]
1223
- // }
1224
1119
  />
1225
1120
  </>
1226
1121
  )}
@@ -1241,16 +1136,11 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
1241
1136
  <ModalComplexFilterComponent
1242
1137
  titleModel={"complexFilter"}
1243
1138
  statusModal={statusModalComplexFilter}
1244
- // objTypeMain={{
1245
- // serviceTag: "SellOfferPlan",
1246
- // objectType: "sellOfferPlan",
1247
- // }}
1248
1139
  objTypeMain={
1249
1140
  linkSteps[linkStepsOutput.active].pathLinkType.objType
1250
1141
  }
1251
1142
  nameReducer={nameReducer}
1252
1143
  parentOutputId={parentOutputId}
1253
- // objConfigUseCase={objConfigUseCase}
1254
1144
  createFilterElement={createFilterElement}
1255
1145
  collectObjectLinksWithRequestProperties={
1256
1146
  collectObjectLinksWithRequestProperties
@@ -1259,7 +1149,6 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
1259
1149
  collectObjectSchemaWithHierarchy
1260
1150
  }
1261
1151
  valueUserTags={valueUserTags}
1262
- // successTraversal={successTraversal}
1263
1152
  />
1264
1153
  )}
1265
1154
  {/* {modalSortField && (
@@ -1282,23 +1171,9 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
1282
1171
  nameObjectLinkStepEdit={
1283
1172
  modalSortField === true ? "" : modalSortField
1284
1173
  }
1285
- //----------------------------------
1286
1174
  LastStepsComponentUseCase={LastStepsComponentUseCase}
1287
1175
  valueUserTags={valueUserTags}
1288
1176
 
1289
- //useLink
1290
- // nameFiledNameLastLinkStep={"fieldName"}
1291
-
1292
- // sortFieldStatus={true}
1293
-
1294
- // complexFilterCombinationsObj={
1295
- // objConfig.pageOutputMainConfigUseCase.complexFilterCombinations
1296
- // }
1297
- // perParentCombinationsObj={
1298
- // objConfig.pageOutputMainConfigUseCase.perParentCombinations
1299
- // }
1300
- // createSortFieldFunc={""}
1301
- // keyElement={keyElement}
1302
1177
  />
1303
1178
  )} */}
1304
1179
  {modalSortField && (
@@ -1309,7 +1184,6 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
1309
1184
  objTypeMain={objTypeMain}
1310
1185
  nameReducer={nameReducer}
1311
1186
  parentOutputId={parentOutputId}
1312
- // successFunc={successFuncCreateSortField}
1313
1187
  successFuncUseCase={successFuncCreateSortField}
1314
1188
  collectObjectLinksWithRequestProperties={
1315
1189
  collectObjectLinksWithRequestProperties
@@ -1317,18 +1191,12 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
1317
1191
  collectObjectSchemaWithHierarchy={
1318
1192
  collectObjectSchemaWithHierarchy
1319
1193
  }
1320
- //---------------use case----------------------------
1321
- // keyElement={keyElement}
1322
- // nameObjectLinkStep={nameObjectLinkStep}
1323
- //------------------------------------------
1324
- // funcUseCase={{ handleInputNameLinkStep, validateRequestProperties }}
1325
1194
  ComponentUseCase={
1326
1195
  ConditionLinkStepAndMultipleIdentifersComponent
1327
1196
  }
1328
1197
  LastStepsComponentUseCase={LastStepsComponentUseCase}
1329
1198
  valueUserTags={valueUserTags}
1330
1199
  nameObjectLinkStepEdit={""}
1331
- // keyObjectUseCase
1332
1200
  />
1333
1201
  )}
1334
1202
  </>
@@ -1338,4 +1206,3 @@ export const ConditionLinkStepAndMultipleIdentifersComponent = ({
1338
1206
  </>
1339
1207
  );
1340
1208
  };
1341
- //----------------------------- use Lib -----------------------------------------------