@itwin/grouping-mapping-widget 0.9.1 → 0.9.3

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.
Files changed (83) hide show
  1. package/lib/cjs/grouping-mapping-widget.d.ts +2 -2
  2. package/lib/cjs/grouping-mapping-widget.js +7 -1
  3. package/lib/cjs/grouping-mapping-widget.js.map +1 -1
  4. package/lib/cjs/test/GroupingMappingCustomUI.test.js +44 -53
  5. package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
  6. package/lib/cjs/test/QueryBuilder.test.js +30 -2
  7. package/lib/cjs/test/QueryBuilder.test.js.map +1 -1
  8. package/lib/cjs/test/QueryBuilder.testdata.js +471 -7
  9. package/lib/cjs/test/QueryBuilder.testdata.js.map +1 -1
  10. package/lib/cjs/test/QueryBuilderTestData.d.ts +3 -1
  11. package/lib/cjs/test/QueryBuilderTestData.js.map +1 -1
  12. package/lib/cjs/widget/components/GroupAction.js +2 -21
  13. package/lib/cjs/widget/components/GroupAction.js.map +1 -1
  14. package/lib/cjs/widget/components/GroupQueryBuilderContainer.d.ts +3 -2
  15. package/lib/cjs/widget/components/GroupQueryBuilderContainer.js +38 -45
  16. package/lib/cjs/widget/components/GroupQueryBuilderContainer.js.map +1 -1
  17. package/lib/cjs/widget/components/Grouping.js +1 -1
  18. package/lib/cjs/widget/components/Grouping.js.map +1 -1
  19. package/lib/cjs/widget/components/Grouping.scss +1 -1
  20. package/lib/cjs/widget/components/QueryBuilder.d.ts +35 -21
  21. package/lib/cjs/widget/components/QueryBuilder.js +153 -181
  22. package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
  23. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.d.ts +15 -0
  24. package/lib/cjs/widget/components/context/{GroupQueryBuilderContext.js → PropertyGridWrapperContext.js} +13 -9
  25. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js.map +1 -0
  26. package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +1 -1
  27. package/lib/cjs/widget/components/property-grid/PropertyGrid.js +2 -2
  28. package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +1 -1
  29. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +10 -4
  30. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +18 -8
  31. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +1 -1
  32. package/lib/cjs/widget/components/property-grid/PropertyView.d.ts +1 -1
  33. package/lib/cjs/widget/components/property-grid/PropertyView.js +46 -60
  34. package/lib/cjs/widget/components/property-grid/PropertyView.js.map +1 -1
  35. package/lib/cjs/widget/components/viewerUtils.js +1 -3
  36. package/lib/cjs/widget/components/viewerUtils.js.map +1 -1
  37. package/lib/esm/grouping-mapping-widget.d.ts +2 -2
  38. package/lib/esm/grouping-mapping-widget.js +2 -1
  39. package/lib/esm/grouping-mapping-widget.js.map +1 -1
  40. package/lib/esm/test/GroupingMappingCustomUI.test.js +45 -54
  41. package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
  42. package/lib/esm/test/QueryBuilder.test.js +31 -3
  43. package/lib/esm/test/QueryBuilder.test.js.map +1 -1
  44. package/lib/esm/test/QueryBuilder.testdata.js +471 -7
  45. package/lib/esm/test/QueryBuilder.testdata.js.map +1 -1
  46. package/lib/esm/test/QueryBuilderTestData.d.ts +3 -1
  47. package/lib/esm/test/QueryBuilderTestData.js.map +1 -1
  48. package/lib/esm/widget/components/GroupAction.js +2 -21
  49. package/lib/esm/widget/components/GroupAction.js.map +1 -1
  50. package/lib/esm/widget/components/GroupQueryBuilderContainer.d.ts +3 -2
  51. package/lib/esm/widget/components/GroupQueryBuilderContainer.js +34 -25
  52. package/lib/esm/widget/components/GroupQueryBuilderContainer.js.map +1 -1
  53. package/lib/esm/widget/components/Grouping.js +1 -1
  54. package/lib/esm/widget/components/Grouping.js.map +1 -1
  55. package/lib/esm/widget/components/Grouping.scss +1 -1
  56. package/lib/esm/widget/components/QueryBuilder.d.ts +35 -21
  57. package/lib/esm/widget/components/QueryBuilder.js +153 -181
  58. package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
  59. package/lib/esm/widget/components/context/PropertyGridWrapperContext.d.ts +15 -0
  60. package/lib/esm/widget/components/context/{GroupQueryBuilderContext.js → PropertyGridWrapperContext.js} +11 -8
  61. package/lib/esm/widget/components/context/PropertyGridWrapperContext.js.map +1 -0
  62. package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +1 -1
  63. package/lib/esm/widget/components/property-grid/PropertyGrid.js +2 -2
  64. package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +1 -1
  65. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +10 -4
  66. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +16 -6
  67. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +1 -1
  68. package/lib/esm/widget/components/property-grid/PropertyView.d.ts +1 -1
  69. package/lib/esm/widget/components/property-grid/PropertyView.js +32 -30
  70. package/lib/esm/widget/components/property-grid/PropertyView.js.map +1 -1
  71. package/lib/esm/widget/components/viewerUtils.js +1 -3
  72. package/lib/esm/widget/components/viewerUtils.js.map +1 -1
  73. package/package.json +1 -1
  74. package/lib/cjs/api/GroupQueryBuilderApi.d.ts +0 -15
  75. package/lib/cjs/api/GroupQueryBuilderApi.js +0 -27
  76. package/lib/cjs/api/GroupQueryBuilderApi.js.map +0 -1
  77. package/lib/cjs/widget/components/context/GroupQueryBuilderContext.d.ts +0 -16
  78. package/lib/cjs/widget/components/context/GroupQueryBuilderContext.js.map +0 -1
  79. package/lib/esm/api/GroupQueryBuilderApi.d.ts +0 -15
  80. package/lib/esm/api/GroupQueryBuilderApi.js +0 -23
  81. package/lib/esm/api/GroupQueryBuilderApi.js.map +0 -1
  82. package/lib/esm/widget/components/context/GroupQueryBuilderContext.d.ts +0 -16
  83. package/lib/esm/widget/components/context/GroupQueryBuilderContext.js.map +0 -1
@@ -1,15 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.testCases = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ const presentation_common_1 = require("@itwin/presentation-common");
4
9
  exports.testCases = {
5
10
  testCases: [
6
11
  {
7
12
  name: "when non-relational property added, return query string with property value",
8
- expectedResult: "SELECT A.B.ECInstanceId FROM A.B WHERE A.B.somePropName=1",
13
+ expectedResult: "SELECT A.B.ECInstanceId, A.B.ECClassId FROM A.B WHERE A.B.somePropName = 1",
9
14
  operations: [
10
15
  {
11
16
  expectedResult: true,
12
17
  operationType: "addProperty",
18
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
13
19
  propertyRecord: {
14
20
  value: {
15
21
  valueFormat: 0,
@@ -44,11 +50,12 @@ exports.testCases = {
44
50
  },
45
51
  {
46
52
  name: "when relational property added, return query string with property value and relation chain to it",
47
- expectedResult: "SELECT Z.X.ECInstanceId FROM Z.X JOIN Rel.CX ON Rel.CX.SourceECInstanceId=A.C.ECInstanceId JOIN A.C ON A.C.ECInstanceId=Rel.BC.SourceECInstanceId JOIN Rel.BC ON Rel.BC.TargetECInstanceId=A.B.ECInstanceId JOIN A.B ON A.B.somePropName='someString' WHERE Z.X.ECInstanceId=Rel.CX.TargetECInstanceId",
53
+ expectedResult: "SELECT Z.X.ECInstanceId, Z.X.ECClassId FROM Z.X JOIN Rel.CX ON Z.X.ECInstanceId = Rel.CX.TargetECInstanceId JOIN A.C ON Rel.CX.SourceECInstanceId = A.C.ECInstanceId JOIN Rel.BC ON A.C.ECInstanceId = Rel.BC.SourceECInstanceId JOIN A.B ON Rel.BC.TargetECInstanceId = A.B.ECInstanceId WHERE A.B.somePropName = 'someString'",
48
54
  operations: [
49
55
  {
50
56
  expectedResult: true,
51
57
  operationType: "addProperty",
58
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
52
59
  propertyRecord: {
53
60
  value: {
54
61
  valueFormat: 0,
@@ -125,6 +132,404 @@ exports.testCases = {
125
132
  },
126
133
  ],
127
134
  },
135
+ {
136
+ name: "when multiple relational properties added, return query string with property values and relation chains to them",
137
+ expectedResult: "SELECT Z.X.ECInstanceId, Z.X.ECClassId FROM Z.X JOIN Rel.CX ON Z.X.ECInstanceId = Rel.CX.TargetECInstanceId JOIN A.C ON Rel.CX.SourceECInstanceId = A.C.ECInstanceId JOIN Rel.BC ON A.C.ECInstanceId = Rel.BC.SourceECInstanceId JOIN G.H ON Rel.BC.TargetECInstanceId = G.H.ECInstanceId JOIN A.B ON Rel.BC.TargetECInstanceId = A.B.ECInstanceId WHERE G.H.someOtherPropName = 'someOtherString' AND A.B.somePropName = 'someString'",
138
+ operations: [
139
+ {
140
+ expectedResult: true,
141
+ operationType: "addProperty",
142
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
143
+ propertyRecord: {
144
+ value: {
145
+ valueFormat: 0,
146
+ value: "someOtherString",
147
+ },
148
+ property: {
149
+ typename: "notNavigation",
150
+ name: "otherPropertyName",
151
+ displayLabel: "propertyDisplayLabel",
152
+ },
153
+ },
154
+ propertiesField: {
155
+ properties: [
156
+ {
157
+ property: {
158
+ name: "someOtherPropName",
159
+ classInfo: {
160
+ name: "A:B",
161
+ },
162
+ },
163
+ },
164
+ ],
165
+ type: {
166
+ typeName: "string",
167
+ },
168
+ parent: {
169
+ pathToPrimaryClass: [
170
+ {
171
+ sourceClassInfo: {
172
+ id: "id1",
173
+ name: "G:H",
174
+ label: "AB label",
175
+ },
176
+ targetClassInfo: {
177
+ id: "id2",
178
+ name: "A:C",
179
+ label: "AC label",
180
+ },
181
+ isPolymorphicTargetClass: true,
182
+ relationshipInfo: {
183
+ id: "id3",
184
+ name: "Rel:BC",
185
+ label: "Relationship BC label",
186
+ },
187
+ isPolymorphicRelationship: true,
188
+ isForwardRelationship: false,
189
+ },
190
+ {
191
+ sourceClassInfo: {
192
+ id: "id2",
193
+ name: "A:C",
194
+ label: "AC label",
195
+ },
196
+ targetClassInfo: {
197
+ id: "id4",
198
+ name: "Z:X",
199
+ label: "ZX label",
200
+ },
201
+ isPolymorphicTargetClass: false,
202
+ relationshipInfo: {
203
+ id: "id5",
204
+ name: "Rel:CX",
205
+ label: "Relationship CX label",
206
+ },
207
+ isPolymorphicRelationship: true,
208
+ isForwardRelationship: true,
209
+ },
210
+ ],
211
+ contentClassInfo: {
212
+ name: "G:H",
213
+ },
214
+ },
215
+ },
216
+ },
217
+ {
218
+ expectedResult: true,
219
+ operationType: "addProperty",
220
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
221
+ propertyRecord: {
222
+ value: {
223
+ valueFormat: 0,
224
+ value: "someString",
225
+ },
226
+ property: {
227
+ typename: "notNavigation",
228
+ name: "propertyName",
229
+ displayLabel: "propertyDisplayLabel",
230
+ },
231
+ },
232
+ propertiesField: {
233
+ properties: [
234
+ {
235
+ property: {
236
+ name: "somePropName",
237
+ classInfo: {
238
+ name: "A:B",
239
+ },
240
+ },
241
+ },
242
+ ],
243
+ type: {
244
+ typeName: "string",
245
+ },
246
+ parent: {
247
+ pathToPrimaryClass: [
248
+ {
249
+ sourceClassInfo: {
250
+ id: "id1",
251
+ name: "A:B",
252
+ label: "AB label",
253
+ },
254
+ targetClassInfo: {
255
+ id: "id2",
256
+ name: "A:C",
257
+ label: "AC label",
258
+ },
259
+ isPolymorphicTargetClass: true,
260
+ relationshipInfo: {
261
+ id: "id3",
262
+ name: "Rel:BC",
263
+ label: "Relationship BC label",
264
+ },
265
+ isPolymorphicRelationship: true,
266
+ isForwardRelationship: false,
267
+ },
268
+ {
269
+ sourceClassInfo: {
270
+ id: "id2",
271
+ name: "A:C",
272
+ label: "AC label",
273
+ },
274
+ targetClassInfo: {
275
+ id: "id4",
276
+ name: "Z:X",
277
+ label: "ZX label",
278
+ },
279
+ isPolymorphicTargetClass: false,
280
+ relationshipInfo: {
281
+ id: "id5",
282
+ name: "Rel:CX",
283
+ label: "Relationship CX label",
284
+ },
285
+ isPolymorphicRelationship: true,
286
+ isForwardRelationship: true,
287
+ },
288
+ ],
289
+ contentClassInfo: {
290
+ name: "A:B",
291
+ },
292
+ },
293
+ },
294
+ },
295
+ ],
296
+ },
297
+ {
298
+ name: "when relational property and non-relational property from one of relational chain classes added, return query string with property values and relation chain",
299
+ expectedResult: "SELECT Z.X.ECInstanceId, Z.X.ECClassId FROM Z.X JOIN Rel.CX ON Z.X.ECInstanceId = Rel.CX.TargetECInstanceId JOIN A.C ON Rel.CX.SourceECInstanceId = A.C.ECInstanceId JOIN Rel.BC ON A.C.ECInstanceId = Rel.BC.SourceECInstanceId JOIN A.B ON Rel.BC.TargetECInstanceId = A.B.ECInstanceId WHERE A.B.somePropName = 'someString' AND A.C.SomeOtherPropName = 1",
300
+ operations: [
301
+ {
302
+ expectedResult: true,
303
+ operationType: "addProperty",
304
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
305
+ propertyRecord: {
306
+ value: {
307
+ valueFormat: 0,
308
+ value: "someString",
309
+ },
310
+ property: {
311
+ typename: "notNavigation",
312
+ name: "somePropName",
313
+ displayLabel: "propertyDisplayLabel",
314
+ },
315
+ },
316
+ propertiesField: {
317
+ properties: [
318
+ {
319
+ property: {
320
+ name: "somePropName",
321
+ classInfo: {
322
+ name: "A:C",
323
+ },
324
+ },
325
+ },
326
+ ],
327
+ type: {
328
+ typeName: "string",
329
+ },
330
+ parent: {
331
+ pathToPrimaryClass: [
332
+ {
333
+ sourceClassInfo: {
334
+ id: "id1",
335
+ name: "A:B",
336
+ label: "AB label",
337
+ },
338
+ targetClassInfo: {
339
+ id: "id2",
340
+ name: "A:C",
341
+ label: "AC label",
342
+ },
343
+ isPolymorphicTargetClass: true,
344
+ relationshipInfo: {
345
+ id: "id3",
346
+ name: "Rel:BC",
347
+ label: "Relationship BC label",
348
+ },
349
+ isPolymorphicRelationship: true,
350
+ isForwardRelationship: false,
351
+ },
352
+ {
353
+ sourceClassInfo: {
354
+ id: "id2",
355
+ name: "A:C",
356
+ label: "AC label",
357
+ },
358
+ targetClassInfo: {
359
+ id: "id4",
360
+ name: "Z:X",
361
+ label: "ZX label",
362
+ },
363
+ isPolymorphicTargetClass: false,
364
+ relationshipInfo: {
365
+ id: "id5",
366
+ name: "Rel:CX",
367
+ label: "Relationship CX label",
368
+ },
369
+ isPolymorphicRelationship: true,
370
+ isForwardRelationship: true,
371
+ },
372
+ ],
373
+ contentClassInfo: {
374
+ name: "A:B",
375
+ },
376
+ },
377
+ },
378
+ },
379
+ {
380
+ expectedResult: true,
381
+ operationType: "addProperty",
382
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
383
+ propertyRecord: {
384
+ value: {
385
+ valueFormat: 0,
386
+ value: 1,
387
+ },
388
+ property: {
389
+ typename: "notNavigation",
390
+ name: "SomeOtherPropName",
391
+ displayLabel: "propertyDisplayLabel",
392
+ },
393
+ },
394
+ propertiesField: {
395
+ properties: [
396
+ {
397
+ property: {
398
+ name: "SomeOtherPropName",
399
+ classInfo: {
400
+ name: "A:C",
401
+ },
402
+ },
403
+ },
404
+ ],
405
+ type: {
406
+ typeName: "number",
407
+ },
408
+ parent: {
409
+ pathToPrimaryClass: [],
410
+ },
411
+ },
412
+ },
413
+ ],
414
+ },
415
+ {
416
+ name: "when relational and non-relational property from the same class added, return query string with property values and relation chain",
417
+ expectedResult: "SELECT Z.X.ECInstanceId, Z.X.ECClassId FROM Z.X JOIN Rel.CX ON Z.X.ECInstanceId = Rel.CX.TargetECInstanceId JOIN A.C ON Rel.CX.SourceECInstanceId = A.C.ECInstanceId JOIN Rel.BC ON A.C.ECInstanceId = Rel.BC.SourceECInstanceId JOIN A.B ON Rel.BC.TargetECInstanceId = A.B.ECInstanceId WHERE A.B.somePropName = 'someString' AND A.B.SomeOtherPropName = 1",
418
+ operations: [
419
+ {
420
+ expectedResult: true,
421
+ operationType: "addProperty",
422
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
423
+ propertyRecord: {
424
+ value: {
425
+ valueFormat: 0,
426
+ value: "someString",
427
+ },
428
+ property: {
429
+ typename: "notNavigation",
430
+ name: "propertyName",
431
+ displayLabel: "propertyDisplayLabel",
432
+ },
433
+ },
434
+ propertiesField: {
435
+ properties: [
436
+ {
437
+ property: {
438
+ name: "somePropName",
439
+ classInfo: {
440
+ name: "A:B",
441
+ },
442
+ },
443
+ },
444
+ ],
445
+ type: {
446
+ typeName: "string",
447
+ },
448
+ parent: {
449
+ pathToPrimaryClass: [
450
+ {
451
+ sourceClassInfo: {
452
+ id: "id1",
453
+ name: "A:B",
454
+ label: "AB label",
455
+ },
456
+ targetClassInfo: {
457
+ id: "id2",
458
+ name: "A:C",
459
+ label: "AC label",
460
+ },
461
+ isPolymorphicTargetClass: true,
462
+ relationshipInfo: {
463
+ id: "id3",
464
+ name: "Rel:BC",
465
+ label: "Relationship BC label",
466
+ },
467
+ isPolymorphicRelationship: true,
468
+ isForwardRelationship: false,
469
+ },
470
+ {
471
+ sourceClassInfo: {
472
+ id: "id2",
473
+ name: "A:C",
474
+ label: "AC label",
475
+ },
476
+ targetClassInfo: {
477
+ id: "id4",
478
+ name: "Z:X",
479
+ label: "ZX label",
480
+ },
481
+ isPolymorphicTargetClass: false,
482
+ relationshipInfo: {
483
+ id: "id5",
484
+ name: "Rel:CX",
485
+ label: "Relationship CX label",
486
+ },
487
+ isPolymorphicRelationship: true,
488
+ isForwardRelationship: true,
489
+ },
490
+ ],
491
+ contentClassInfo: {
492
+ name: "A:B",
493
+ },
494
+ },
495
+ },
496
+ },
497
+ {
498
+ expectedResult: true,
499
+ operationType: "addProperty",
500
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
501
+ propertyRecord: {
502
+ value: {
503
+ valueFormat: 0,
504
+ value: 1,
505
+ },
506
+ property: {
507
+ typename: "notNavigation",
508
+ name: "propertyName2",
509
+ displayLabel: "propertyDisplayLabel",
510
+ },
511
+ },
512
+ propertiesField: {
513
+ properties: [
514
+ {
515
+ property: {
516
+ name: "SomeOtherPropName",
517
+ classInfo: {
518
+ name: "A:B",
519
+ },
520
+ },
521
+ },
522
+ ],
523
+ type: {
524
+ typeName: "number",
525
+ },
526
+ parent: {
527
+ pathToPrimaryClass: [],
528
+ },
529
+ },
530
+ },
531
+ ],
532
+ },
128
533
  {
129
534
  name: "when non-relational property removed, return empty string",
130
535
  expectedResult: "",
@@ -132,6 +537,7 @@ exports.testCases = {
132
537
  {
133
538
  expectedResult: true,
134
539
  operationType: "addProperty",
540
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
135
541
  propertyRecord: {
136
542
  value: {
137
543
  valueFormat: 0,
@@ -167,6 +573,7 @@ exports.testCases = {
167
573
  },
168
574
  {
169
575
  operationType: "removeProperty",
576
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
170
577
  propertyRecord: {
171
578
  value: {
172
579
  valueFormat: 0,
@@ -209,6 +616,7 @@ exports.testCases = {
209
616
  {
210
617
  expectedResult: true,
211
618
  operationType: "addProperty",
619
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
212
620
  propertyRecord: {
213
621
  value: {
214
622
  valueFormat: 0,
@@ -285,6 +693,7 @@ exports.testCases = {
285
693
  },
286
694
  {
287
695
  operationType: "removeProperty",
696
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
288
697
  propertyRecord: {
289
698
  value: {
290
699
  valueFormat: 0,
@@ -363,11 +772,12 @@ exports.testCases = {
363
772
  },
364
773
  {
365
774
  name: "when non-relational property re-added after removing, return query string with property value",
366
- expectedResult: "SELECT A.B.ECInstanceId FROM A.B WHERE A.B.somePropName='someOtherString'",
775
+ expectedResult: "SELECT A.B.ECInstanceId, A.B.ECClassId FROM A.B WHERE A.B.somePropName = 'someOtherString'",
367
776
  operations: [
368
777
  {
369
778
  expectedResult: true,
370
779
  operationType: "addProperty",
780
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
371
781
  propertyRecord: {
372
782
  value: {
373
783
  valueFormat: 0,
@@ -403,6 +813,7 @@ exports.testCases = {
403
813
  },
404
814
  {
405
815
  operationType: "removeProperty",
816
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
406
817
  propertyRecord: {
407
818
  value: {
408
819
  valueFormat: 0,
@@ -439,6 +850,7 @@ exports.testCases = {
439
850
  {
440
851
  operationType: "addProperty",
441
852
  expectedResult: true,
853
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
442
854
  propertyRecord: {
443
855
  value: {
444
856
  valueFormat: 0,
@@ -476,11 +888,12 @@ exports.testCases = {
476
888
  },
477
889
  {
478
890
  name: "when relational property re-added after removing, return query string with property value and relation chain to it",
479
- expectedResult: "SELECT Z.X.ECInstanceId FROM Z.X JOIN Rel.CX ON Rel.CX.SourceECInstanceId=A.C.ECInstanceId JOIN A.C ON A.C.ECInstanceId=Rel.BC.SourceECInstanceId JOIN Rel.BC ON Rel.BC.TargetECInstanceId=A.B.ECInstanceId JOIN A.B ON A.B.somePropName='someOtherString' WHERE Z.X.ECInstanceId=Rel.CX.TargetECInstanceId",
891
+ expectedResult: "SELECT Z.X.ECInstanceId, Z.X.ECClassId FROM Z.X JOIN Rel.CX ON Z.X.ECInstanceId = Rel.CX.TargetECInstanceId JOIN A.C ON Rel.CX.SourceECInstanceId = A.C.ECInstanceId JOIN Rel.BC ON A.C.ECInstanceId = Rel.BC.SourceECInstanceId JOIN A.B ON Rel.BC.TargetECInstanceId = A.B.ECInstanceId WHERE A.B.somePropName = 'someOtherString'",
480
892
  operations: [
481
893
  {
482
894
  expectedResult: true,
483
895
  operationType: "addProperty",
896
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
484
897
  propertyRecord: {
485
898
  value: {
486
899
  valueFormat: 0,
@@ -557,6 +970,7 @@ exports.testCases = {
557
970
  },
558
971
  {
559
972
  operationType: "removeProperty",
973
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
560
974
  propertyRecord: {
561
975
  value: {
562
976
  valueFormat: 0,
@@ -634,6 +1048,7 @@ exports.testCases = {
634
1048
  {
635
1049
  expectedResult: true,
636
1050
  operationType: "addProperty",
1051
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
637
1052
  propertyRecord: {
638
1053
  value: {
639
1054
  valueFormat: 0,
@@ -717,11 +1132,12 @@ exports.testCases = {
717
1132
  },
718
1133
  {
719
1134
  name: "when property is float, return query string with ROUND",
720
- expectedResult: "SELECT A.B.ECInstanceId FROM A.B WHERE ROUND(A.B.somePropName, 4)=3.1416",
1135
+ expectedResult: "SELECT A.B.ECInstanceId, A.B.ECClassId FROM A.B WHERE ROUND(A.B.somePropName, 4) = 3.1416",
721
1136
  operations: [
722
1137
  {
723
1138
  expectedResult: true,
724
1139
  operationType: "addProperty",
1140
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
725
1141
  propertyRecord: {
726
1142
  value: {
727
1143
  valueFormat: 0,
@@ -756,11 +1172,12 @@ exports.testCases = {
756
1172
  },
757
1173
  {
758
1174
  name: "when property needsQuotes, return query string with property value in quotes",
759
- expectedResult: "SELECT A.B.ECInstanceId FROM A.B WHERE A.B.somePropName='https://valueThatNeedsQuotes.com'",
1175
+ expectedResult: "SELECT A.B.ECInstanceId, A.B.ECClassId FROM A.B WHERE A.B.somePropName = 'https://valueThatNeedsQuotes.com'",
760
1176
  operations: [
761
1177
  {
762
1178
  expectedResult: true,
763
1179
  operationType: "addProperty",
1180
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
764
1181
  propertyRecord: {
765
1182
  value: {
766
1183
  valueFormat: 0,
@@ -795,11 +1212,58 @@ exports.testCases = {
795
1212
  },
796
1213
  {
797
1214
  name: "when property is category, return a category query string",
798
- expectedResult: "SELECT BisCore.B.ECInstanceId FROM BisCore.B JOIN bis.Category ON bis.Category.ECInstanceId = bis.GeometricElement3d.category.id AND ((bis.Category.CodeValue='displayValueString') OR (bis.Category.UserLabel='displayValueString'))",
1215
+ expectedResult: "SELECT BisCore.B.ECInstanceId, BisCore.B.ECClassId FROM BisCore.B JOIN BisCore.Category ON BisCore.Category.ECInstanceId = BisCore.GeometricElement3d.category.id WHERE ((BisCore.Category.CodeValue = 'displayValueString') OR (BisCore.Category.UserLabel = 'displayValueString'))",
1216
+ operations: [
1217
+ {
1218
+ expectedResult: true,
1219
+ operationType: "addProperty",
1220
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
1221
+ propertyRecord: {
1222
+ value: {
1223
+ valueFormat: 0,
1224
+ value: "someString",
1225
+ displayValue: "displayValueString",
1226
+ },
1227
+ property: {
1228
+ typename: "navigation",
1229
+ name: "propertyName",
1230
+ displayLabel: "propertyDisplayLabel",
1231
+ },
1232
+ },
1233
+ propertiesField: {
1234
+ properties: [
1235
+ {
1236
+ property: {
1237
+ name: "somePropName",
1238
+ classInfo: {
1239
+ name: "BisCore:B",
1240
+ },
1241
+ navigationPropertyInfo: {
1242
+ classInfo: {
1243
+ name: "BisCore:GeometricElement3dIsInCategory",
1244
+ },
1245
+ },
1246
+ },
1247
+ },
1248
+ ],
1249
+ type: {
1250
+ typeName: "string",
1251
+ },
1252
+ parent: {
1253
+ pathToPrimaryClass: [],
1254
+ },
1255
+ },
1256
+ },
1257
+ ],
1258
+ },
1259
+ {
1260
+ name: "when category property and relational property added, return query string with property value, relational chain and with category joined",
1261
+ expectedResult: "SELECT BisCore.B.ECInstanceId, BisCore.B.ECClassId FROM BisCore.B JOIN BisCore.Category ON BisCore.Category.ECInstanceId = BisCore.GeometricElement3d.category.id WHERE ((BisCore.Category.CodeValue = 'displayValueString') OR (BisCore.Category.UserLabel = 'displayValueString'))",
799
1262
  operations: [
800
1263
  {
801
1264
  expectedResult: true,
802
1265
  operationType: "addProperty",
1266
+ fieldDescriptorType: presentation_common_1.FieldDescriptorType.Properties,
803
1267
  propertyRecord: {
804
1268
  value: {
805
1269
  valueFormat: 0,