@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 +1 @@
1
- {"version":3,"file":"QueryBuilder.testdata.js","sourceRoot":"","sources":["../../../src/test/QueryBuilder.testdata.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,SAAS,GAAyB;IAC7C,SAAS,EAAE;QACT;YACE,IAAI,EAAE,6EAA6E;YACnF,cAAc,EAAE,2DAA2D;YAC3E,UAAU,EAAE;gBACV;oBACE,cAAc,EAAE,IAAI;oBACpB,aAAa,EAAE,aAAa;oBAC5B,cAAc,EAAE;wBACd,KAAK,EAAE;4BACL,WAAW,EAAE,CAAC;4BACd,KAAK,EAAE,CAAC;yBACT;wBACD,QAAQ,EAAE;4BACR,QAAQ,EAAE,eAAe;4BACzB,IAAI,EAAE,cAAc;4BACpB,YAAY,EAAE,sBAAsB;yBACrC;qBACF;oBACD,eAAe,EAAE;wBACf,UAAU,EAAE;4BACV;gCACE,QAAQ,EAAE;oCACR,IAAI,EAAE,cAAc;oCACpB,SAAS,EAAE;wCACT,IAAI,EAAE,KAAK;qCACZ;iCACF;6BACF;yBACF;wBACD,IAAI,EAAE;4BACJ,QAAQ,EAAE,QAAQ;yBACnB;wBACD,MAAM,EAAE;4BACN,kBAAkB,EAAE,EAAE;yBACvB;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,kGAAkG;YACxG,cAAc,EAAE,wSAAwS;YACxT,UAAU,EAAE;gBACV;oBACE,cAAc,EAAE,IAAI;oBACpB,aAAa,EAAE,aAAa;oBAC5B,cAAc,EAAE;wBACd,KAAK,EAAE;4BACL,WAAW,EAAE,CAAC;4BACd,KAAK,EAAE,YAAY;yBACpB;wBACD,QAAQ,EAAE;4BACR,QAAQ,EAAE,eAAe;4BACzB,IAAI,EAAE,cAAc;4BACpB,YAAY,EAAE,sBAAsB;yBACrC;qBACF;oBACD,eAAe,EAAE;wBACf,UAAU,EAAE;4BACV;gCACE,QAAQ,EAAE;oCACR,IAAI,EAAE,cAAc;oCACpB,SAAS,EAAE;wCACT,IAAI,EAAE,KAAK;qCACZ;iCACF;6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AChB;wBACD,MAAM,EAAE;4BACN,kBAAkB,EAAE,EAAE;yBACvB;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,2DAA2D;YACjE,cAAc,EAAE,uOAAuO;YACvP,UAAU,EAAE;gBACV;oBACE,cAAc,EAAE,IAAI;oBACpB,aAAa,EAAE,aAAa;oBAC5B,cAAc,EAAE;wBACd,KAAK,EAAE;4BACL,WAAW,EAAE,CAAC;4BACd,KAAK,EAAE,YAAY;4BACnB,YAAY,EAAE,oBAAoB;yBACnC;wBACD,QAAQ,EAAE;4BACR,QAAQ,EAAE,YAAY;4BACtB,IAAI,EAAE,cAAc;4BACpB,YAAY,EAAE,sBAAsB;yBACrC;qBACF;oBACD,eAAe,EAAE;wBACf,UAAU,EAAE;4BACV;gCACE,QAAQ,EAAE;oCACR,IAAI,EAAE,cAAc;oCACpB,SAAS,EAAE;wCACT,IAAI,EAAE,WAAW;qCAClB;oCACD,sBAAsB,EAAE;wCACtB,SAAS,EAAE;4CACT,IAAI,EAAE,wCAAwC;yCAC/C;qCACF;iCACF;6BACF;yBACF;wBACD,IAAI,EAAE;4BACJ,QAAQ,EAAE,QAAQ;yBACnB;wBACD,MAAM,EAAE;4BACN,kBAAkB,EAAE,EAAE;yBACvB;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { QueryBuilderTestData } from \"./QueryBuilderTestData\";\n\nexport const testCases: QueryBuilderTestData = {\n testCases: [\n {\n name: \"when non-relational property added, return query string with property value\",\n expectedResult: \"SELECT A.B.ECInstanceId FROM A.B WHERE A.B.somePropName=1\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: 1,\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"number\",\n },\n parent: {\n pathToPrimaryClass: [],\n },\n },\n },\n ],\n },\n {\n name: \"when relational property added, return query string with property value and relation chain to it\",\n 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\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n ],\n },\n {\n name: \"when non-relational property removed, return empty string\",\n expectedResult: \"\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n contentClassInfo: {\n name: \"sourceClassName\",\n },\n },\n },\n },\n {\n operationType: \"removeProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n contentClassInfo: {\n name: \"sourceClassName\",\n },\n },\n },\n },\n ],\n },\n {\n name: \"when relational property removed, return empty string\",\n expectedResult: \"\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n {\n operationType: \"removeProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n ],\n },\n {\n name: \"when non-relational property re-added after removing, return query string with property value\",\n expectedResult: \"SELECT A.B.ECInstanceId FROM A.B WHERE A.B.somePropName='someOtherString'\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n contentClassInfo: {\n name: \"sourceClassName\",\n },\n },\n },\n },\n {\n operationType: \"removeProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n contentClassInfo: {\n name: \"sourceClassName\",\n },\n },\n },\n },\n {\n operationType: \"addProperty\",\n expectedResult: true,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someOtherString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n contentClassInfo: {\n name: \"sourceClassName\",\n },\n },\n },\n },\n ],\n },\n {\n name: \"when relational property re-added after removing, return query string with property value and relation chain to it\",\n 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\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n {\n operationType: \"removeProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n {\n expectedResult: true,\n operationType: \"addProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someOtherString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n ],\n },\n {\n name: \"when no properties added, return empty string\",\n expectedResult: \"\",\n operations: [],\n },\n {\n name: \"when property is float, return query string with ROUND\",\n expectedResult: \"SELECT A.B.ECInstanceId FROM A.B WHERE ROUND(A.B.somePropName, 4)=3.1416\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: 3.14159,\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"number\",\n },\n parent: {\n pathToPrimaryClass: [],\n },\n },\n },\n ],\n },\n {\n name: \"when property needsQuotes, return query string with property value in quotes\",\n expectedResult: \"SELECT A.B.ECInstanceId FROM A.B WHERE A.B.somePropName='https://valueThatNeedsQuotes.com'\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"https://valueThatNeedsQuotes.com\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"uri\",\n },\n parent: {\n pathToPrimaryClass: [],\n },\n },\n },\n ],\n },\n {\n name: \"when property is category, return a category query string\",\n 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'))\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n displayValue: \"displayValueString\",\n },\n property: {\n typename: \"navigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"BisCore:B\",\n },\n navigationPropertyInfo: {\n classInfo: {\n name: \"BisCore:GeometricElement3dIsInCategory\",\n },\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n },\n },\n },\n ],\n },\n ],\n};\n"]}
1
+ {"version":3,"file":"QueryBuilder.testdata.js","sourceRoot":"","sources":["../../../src/test/QueryBuilder.testdata.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,MAAM,CAAC,MAAM,SAAS,GAAyB;IAC7C,SAAS,EAAE;QACT;YACE,IAAI,EAAE,6EAA6E;YACnF,cAAc,EAAE,4EAA4E;YAC5F,UAAU,EAAE;gBACV;oBACE,cAAc,EAAE,IAAI;oBACpB,aAAa,EAAE,aAAa;oBAC5B,mBAAmB,EAAE,mBAAmB,CAAC,UAAU;oBACnD,cAAc,EAAE;wBACd,KAAK,EAAE;4BACL,WAAW,EAAE,CAAC;4BACd,KAAK,EAAE,CAAC;yBACT;wBACD,QAAQ,EAAE;4BACR,QAAQ,EAAE,eAAe;4BACzB,IAAI,EAAE,cAAc;4BACpB,YAAY,EAAE,sBAAsB;yBACrC;qBACF;oBACD,eAAe,EAAE;wBACf,UAAU,EAAE;4BACV;gCACE,QAAQ,EAAE;oCACR,IAAI,EAAE,cAAc;oCACpB,SAAS,EAAE;wCACT,IAAI,EAAE,KAAK;qCACZ;iCACF;6BACF;yBACF;wBACD,IAAI,EAAE;4BACJ,QAAQ,EAAE,QAAQ;yBACnB;wBACD,MAAM,EAAE;4BACN,kBAAkB,EAAE,EAAE;yBACvB;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,kGAAkG;YACxG,cAAc,EAAE,iUAAiU;YACjV,UAAU,EAAE;gBACV;oBACE,cAAc,EA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E;wCACT,IAAI,EAAE,WAAW;qCAClB;oCACD,sBAAsB,EAAE;wCACtB,SAAS,EAAE;4CACT,IAAI,EAAE,wCAAwC;yCAC/C;qCACF;iCACF;6BACF;yBACF;wBACD,IAAI,EAAE;4BACJ,QAAQ,EAAE,QAAQ;yBACnB;wBACD,MAAM,EAAE;4BACN,kBAAkB,EAAE,EAAE;yBACvB;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,0IAA0I;YAChJ,cAAc,EAAE,sRAAsR;YACtS,UAAU,EAAE;gBACV;oBACE,cAAc,EAAE,IAAI;oBACpB,aAAa,EAAE,aAAa;oBAC5B,mBAAmB,EAAE,mBAAmB,CAAC,UAAU;oBACnD,cAAc,EAAE;wBACd,KAAK,EAAE;4BACL,WAAW,EAAE,CAAC;4BACd,KAAK,EAAE,YAAY;4BACnB,YAAY,EAAE,oBAAoB;yBACnC;wBACD,QAAQ,EAAE;4BACR,QAAQ,EAAE,YAAY;4BACtB,IAAI,EAAE,cAAc;4BACpB,YAAY,EAAE,sBAAsB;yBACrC;qBACF;oBACD,eAAe,EAAE;wBACf,UAAU,EAAE;4BACV;gCACE,QAAQ,EAAE;oCACR,IAAI,EAAE,cAAc;oCACpB,SAAS,EAAE;wCACT,IAAI,EAAE,WAAW;qCAClB;oCACD,sBAAsB,EAAE;wCACtB,SAAS,EAAE;4CACT,IAAI,EAAE,wCAAwC;yCAC/C;qCACF;iCACF;6BACF;yBACF;wBACD,IAAI,EAAE;4BACJ,QAAQ,EAAE,QAAQ;yBACnB;wBACD,MAAM,EAAE;4BACN,kBAAkB,EAAE,EAAE;yBACvB;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { FieldDescriptorType } from \"@itwin/presentation-common\";\nimport type { QueryBuilderTestData } from \"./QueryBuilderTestData\";\n\nexport const testCases: QueryBuilderTestData = {\n testCases: [\n {\n name: \"when non-relational property added, return query string with property value\",\n expectedResult: \"SELECT A.B.ECInstanceId, A.B.ECClassId FROM A.B WHERE A.B.somePropName = 1\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: 1,\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"number\",\n },\n parent: {\n pathToPrimaryClass: [],\n },\n },\n },\n ],\n },\n {\n name: \"when relational property added, return query string with property value and relation chain to it\",\n 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'\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n ],\n },\n {\n name: \"when multiple relational properties added, return query string with property values and relation chains to them\",\n 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'\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someOtherString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"otherPropertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"someOtherPropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"G:H\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"G:H\",\n },\n },\n },\n },\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n ],\n },\n {\n name: \"when relational property and non-relational property from one of relational chain classes added, return query string with property values and relation chain\",\n 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\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"somePropName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:C\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: 1,\n },\n property: {\n typename: \"notNavigation\",\n name: \"SomeOtherPropName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"SomeOtherPropName\",\n classInfo: {\n name: \"A:C\",\n },\n },\n },\n ],\n type: {\n typeName: \"number\",\n },\n parent: {\n pathToPrimaryClass: [],\n },\n },\n },\n ],\n },\n {\n name: \"when relational and non-relational property from the same class added, return query string with property values and relation chain\",\n 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\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: 1,\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName2\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"SomeOtherPropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"number\",\n },\n parent: {\n pathToPrimaryClass: [],\n },\n },\n },\n ],\n },\n {\n name: \"when non-relational property removed, return empty string\",\n expectedResult: \"\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n contentClassInfo: {\n name: \"sourceClassName\",\n },\n },\n },\n },\n {\n operationType: \"removeProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n contentClassInfo: {\n name: \"sourceClassName\",\n },\n },\n },\n },\n ],\n },\n {\n name: \"when relational property removed, return empty string\",\n expectedResult: \"\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n {\n operationType: \"removeProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n ],\n },\n {\n name: \"when non-relational property re-added after removing, return query string with property value\",\n expectedResult: \"SELECT A.B.ECInstanceId, A.B.ECClassId FROM A.B WHERE A.B.somePropName = 'someOtherString'\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n contentClassInfo: {\n name: \"sourceClassName\",\n },\n },\n },\n },\n {\n operationType: \"removeProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n contentClassInfo: {\n name: \"sourceClassName\",\n },\n },\n },\n },\n {\n operationType: \"addProperty\",\n expectedResult: true,\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someOtherString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n contentClassInfo: {\n name: \"sourceClassName\",\n },\n },\n },\n },\n ],\n },\n {\n name: \"when relational property re-added after removing, return query string with property value and relation chain to it\",\n 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'\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n {\n operationType: \"removeProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someOtherString\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [\n {\n sourceClassInfo: {\n id: \"id1\",\n name: \"A:B\",\n label: \"AB label\",\n },\n targetClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n isPolymorphicTargetClass: true,\n relationshipInfo: {\n id: \"id3\",\n name: \"Rel:BC\",\n label: \"Relationship BC label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: false,\n },\n {\n sourceClassInfo: {\n id: \"id2\",\n name: \"A:C\",\n label: \"AC label\",\n },\n targetClassInfo: {\n id: \"id4\",\n name: \"Z:X\",\n label: \"ZX label\",\n },\n isPolymorphicTargetClass: false,\n relationshipInfo: {\n id: \"id5\",\n name: \"Rel:CX\",\n label: \"Relationship CX label\",\n },\n isPolymorphicRelationship: true,\n isForwardRelationship: true,\n },\n ],\n contentClassInfo: {\n name: \"A:B\",\n },\n },\n },\n },\n ],\n },\n {\n name: \"when no properties added, return empty string\",\n expectedResult: \"\",\n operations: [],\n },\n {\n name: \"when property is float, return query string with ROUND\",\n expectedResult: \"SELECT A.B.ECInstanceId, A.B.ECClassId FROM A.B WHERE ROUND(A.B.somePropName, 4) = 3.1416\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: 3.14159,\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"number\",\n },\n parent: {\n pathToPrimaryClass: [],\n },\n },\n },\n ],\n },\n {\n name: \"when property needsQuotes, return query string with property value in quotes\",\n expectedResult: \"SELECT A.B.ECInstanceId, A.B.ECClassId FROM A.B WHERE A.B.somePropName = 'https://valueThatNeedsQuotes.com'\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"https://valueThatNeedsQuotes.com\",\n },\n property: {\n typename: \"notNavigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"A:B\",\n },\n },\n },\n ],\n type: {\n typeName: \"uri\",\n },\n parent: {\n pathToPrimaryClass: [],\n },\n },\n },\n ],\n },\n {\n name: \"when property is category, return a category query string\",\n 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'))\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n displayValue: \"displayValueString\",\n },\n property: {\n typename: \"navigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"BisCore:B\",\n },\n navigationPropertyInfo: {\n classInfo: {\n name: \"BisCore:GeometricElement3dIsInCategory\",\n },\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n },\n },\n },\n ],\n },\n {\n name: \"when category property and relational property added, return query string with property value, relational chain and with category joined\",\n 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'))\",\n operations: [\n {\n expectedResult: true,\n operationType: \"addProperty\",\n fieldDescriptorType: FieldDescriptorType.Properties,\n propertyRecord: {\n value: {\n valueFormat: 0,\n value: \"someString\",\n displayValue: \"displayValueString\",\n },\n property: {\n typename: \"navigation\",\n name: \"propertyName\",\n displayLabel: \"propertyDisplayLabel\",\n },\n },\n propertiesField: {\n properties: [\n {\n property: {\n name: \"somePropName\",\n classInfo: {\n name: \"BisCore:B\",\n },\n navigationPropertyInfo: {\n classInfo: {\n name: \"BisCore:GeometricElement3dIsInCategory\",\n },\n },\n },\n },\n ],\n type: {\n typeName: \"string\",\n },\n parent: {\n pathToPrimaryClass: [],\n },\n },\n },\n ],\n },\n ],\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { PropertyDescription, PropertyValue } from "@itwin/appui-abstract";
2
- import type { RelationshipPath } from "@itwin/presentation-common";
2
+ import type { FieldDescriptorType, RelationshipPath } from "@itwin/presentation-common";
3
3
  export interface ClassInfoTestData {
4
4
  name: string;
5
5
  }
@@ -36,6 +36,8 @@ export interface PropertyRecordTestData {
36
36
  export interface OperationTestData {
37
37
  expectedResult?: boolean;
38
38
  operationType: string;
39
+ fieldDescriptorType: FieldDescriptorType.Name | FieldDescriptorType.Properties;
40
+ fieldDescriptorName?: string;
39
41
  propertyRecord: PropertyRecordTestData;
40
42
  propertiesField: PropertiesFieldTestData;
41
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderTestData.js","sourceRoot":"","sources":["../../../src/test/QueryBuilderTestData.ts"],"names":[],"mappings":"","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { PropertyDescription, PropertyValue } from \"@itwin/appui-abstract\";\nimport type { RelationshipPath } from \"@itwin/presentation-common\";\n\nexport interface ClassInfoTestData {\n name: string;\n}\n\nexport interface NavigationPropertyInfoTestData {\n classInfo: ClassInfoTestData;\n}\n\nexport interface PropertyTestData {\n name: string;\n classInfo: ClassInfoTestData;\n navigationPropertyInfo?: NavigationPropertyInfoTestData;\n}\n\nexport interface PropertiesTestData {\n property: PropertyTestData;\n}\n\nexport interface ContentClassInfoTestData {\n name: string;\n}\n\nexport interface ParentTestData {\n pathToPrimaryClass: RelationshipPath;\n contentClassInfo?: ContentClassInfoTestData;\n}\n\nexport interface TypeTestData {\n typeName: string;\n}\n\nexport interface PropertiesFieldTestData {\n properties: PropertiesTestData[];\n type: TypeTestData;\n parent: ParentTestData;\n}\n\nexport interface PropertyRecordTestData {\n value: PropertyValue;\n property: PropertyDescription;\n}\n\nexport interface OperationTestData {\n expectedResult?: boolean;\n operationType: string;\n propertyRecord: PropertyRecordTestData;\n propertiesField: PropertiesFieldTestData;\n}\n\nexport interface TestCase {\n name: string;\n expectedResult: string;\n operations: OperationTestData[];\n}\n\nexport interface QueryBuilderTestData {\n testCases: TestCase[];\n}\n"]}
1
+ {"version":3,"file":"QueryBuilderTestData.js","sourceRoot":"","sources":["../../../src/test/QueryBuilderTestData.ts"],"names":[],"mappings":"","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { PropertyDescription, PropertyValue } from \"@itwin/appui-abstract\";\nimport type { FieldDescriptorType, RelationshipPath } from \"@itwin/presentation-common\";\n\nexport interface ClassInfoTestData {\n name: string;\n}\n\nexport interface NavigationPropertyInfoTestData {\n classInfo: ClassInfoTestData;\n}\n\nexport interface PropertyTestData {\n name: string;\n classInfo: ClassInfoTestData;\n navigationPropertyInfo?: NavigationPropertyInfoTestData;\n}\n\nexport interface PropertiesTestData {\n property: PropertyTestData;\n}\n\nexport interface ContentClassInfoTestData {\n name: string;\n}\n\nexport interface ParentTestData {\n pathToPrimaryClass: RelationshipPath;\n contentClassInfo?: ContentClassInfoTestData;\n}\n\nexport interface TypeTestData {\n typeName: string;\n}\n\nexport interface PropertiesFieldTestData {\n properties: PropertiesTestData[];\n type: TypeTestData;\n parent: ParentTestData;\n}\n\nexport interface PropertyRecordTestData {\n value: PropertyValue;\n property: PropertyDescription;\n}\n\nexport interface OperationTestData {\n expectedResult?: boolean;\n operationType: string;\n fieldDescriptorType: FieldDescriptorType.Name | FieldDescriptorType.Properties;\n fieldDescriptorName?: string;\n propertyRecord: PropertyRecordTestData;\n propertiesField: PropertiesFieldTestData;\n}\n\nexport interface TestCase {\n name: string;\n expectedResult: string;\n operations: OperationTestData[];\n}\n\nexport interface QueryBuilderTestData {\n testCases: TestCase[];\n}\n"]}
@@ -8,9 +8,7 @@ import "./GroupAction.scss";
8
8
  import ActionPanel from "./ActionPanel";
9
9
  import useValidator, { NAME_REQUIREMENTS } from "../hooks/useValidator";
10
10
  import { GroupQueryBuilderContainer } from "./GroupQueryBuilderContainer";
11
- import { QueryBuilder } from "./QueryBuilder";
12
11
  import { transparentOverriddenElements, visualizeElementsByQuery, zoomToElements, } from "./viewerUtils";
13
- import { GroupQueryBuilderContext } from "./context/GroupQueryBuilderContext";
14
12
  import { useGroupingMappingApiConfig } from "./context/GroupingApiConfigContext";
15
13
  import { useMappingClient } from "./context/MappingClientContext";
16
14
  import { useGroupingMappingCustomUI } from "./context/GroupingMappingCustomUIContext";
@@ -34,8 +32,6 @@ const GroupAction = (props) => {
34
32
  const [validator, showValidationMessage] = useValidator();
35
33
  const [isLoading, setIsLoading] = useState(false);
36
34
  const [isRendering, setIsRendering] = useState(false);
37
- const [currentPropertyList, setCurrentPropertyList] = useState([]);
38
- const [queryBuilder, setQueryBuilder] = useState(new QueryBuilder(undefined));
39
35
  const [queryGenerationType, setQueryGenerationType] = useState(props.queryGenerationType);
40
36
  const isUpdating = isLoading || isRendering;
41
37
  const changeGroupByType = async (event) => {
@@ -66,10 +62,6 @@ const GroupAction = (props) => {
66
62
  if (!query || query === "") {
67
63
  return;
68
64
  }
69
- if (queryGenerationType === "Selection" &&
70
- currentPropertyList.length === 0) {
71
- return;
72
- }
73
65
  setIsRendering(true);
74
66
  transparentOverriddenElements();
75
67
  const resolvedHiliteIds = await visualizeElementsByQuery(query, "red", iModelConnection);
@@ -83,7 +75,7 @@ const GroupAction = (props) => {
83
75
  }
84
76
  };
85
77
  void reemphasize();
86
- }, [iModelConnection, query, currentPropertyList, queryGenerationType]);
78
+ }, [iModelConnection, query]);
87
79
  useEffect(() => {
88
80
  Presentation.selection.clearSelection("GroupingMappingWidget", iModelConnection);
89
81
  }, [iModelConnection]);
@@ -124,18 +116,7 @@ const GroupAction = (props) => {
124
116
  const createQueryBuilderComponent = () => {
125
117
  switch (queryGenerationType) {
126
118
  case "Selection": {
127
- return (React.createElement(GroupQueryBuilderContext.Provider, { value: {
128
- currentPropertyList,
129
- setCurrentPropertyList,
130
- query,
131
- setQuery,
132
- queryBuilder,
133
- setQueryBuilder,
134
- isLoading,
135
- isRendering,
136
- resetView: props.resetView,
137
- } },
138
- React.createElement(GroupQueryBuilderContainer, null)));
119
+ return (React.createElement(GroupQueryBuilderContainer, { updateQuery: setQuery, isUpdating: isUpdating, resetView: props.resetView }));
139
120
  }
140
121
  case "Search": {
141
122
  return (React.createElement(SearchGroupingCustomUI, { updateQuery: setQuery, isUpdating: isUpdating, resetView: props.resetView }));
@@ -1 +1 @@
1
- {"version":3,"file":"GroupAction.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupAction.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAA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CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;oBAChD,CAAC,GACD,CACO;YACX,oBAAC,QAAQ,IAAC,MAAM,EAAC,UAAU,EAAC,SAAS,EAAC,6BAA6B;gBACjE,oBAAC,cAAc,IAAC,SAAS,EAAC,sBAAsB,EAAC,QAAQ,UACtD,QAAQ,CAAC,MAAM,KAAK,CAAC;oBACpB,CAAC,CAAC,CACA,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC1B,qBAAqB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,CACtD,CACF;oBACD,CAAC,CAAC,CACA,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WACnB,OAAA,qBAAqB,CAAC,MAAA,GAAG,CAAC,IAAI,mCAAI,oBAAC,MAAM,OAAG,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,CAAA,EAAA,CAC1E,CACF,CACY;gBAChB,mBAAmB,IAAI,2BAA2B,EAAE,CAC5C,CACP;QACN,oBAAC,WAAW,IACV,MAAM,EAAE,KAAK,IAAI,EAAE;gBACjB,MAAM,IAAI,EAAE,CAAC;YACf,CAAC,EACD,QAAQ,EAAE,KAAK,IAAI,EAAE;gBACnB,YAAY,CAAC,SAAS,CAAC,cAAc,CACnC,uBAAuB,EACvB,gBAAgB,CACjB,CAAC;gBACF,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC;YACvB,CAAC,EACD,gBAAgB,EAAE,iBAAiB,EACnC,SAAS,EAAE,SAAS,GACpB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type {\n ISelectionProvider,\n SelectionChangeEventArgs,\n} from \"@itwin/presentation-frontend\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport {\n Fieldset,\n LabeledInput,\n RadioTile,\n RadioTileGroup,\n Small,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport type { ReactElement } from \"react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport {\n EmptyMessage,\n handleError,\n handleInputChange,\n WidgetHeader,\n} from \"./utils\";\nimport type { IGroupTyped } from \"./Grouping\";\nimport { defaultUIMetadata } from \"./Grouping\";\nimport \"./GroupAction.scss\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { GroupQueryBuilderContainer } from \"./GroupQueryBuilderContainer\";\nimport { QueryBuilder } from \"./QueryBuilder\";\nimport {\n transparentOverriddenElements,\n visualizeElementsByQuery,\n zoomToElements,\n} from \"./viewerUtils\";\nimport { GroupQueryBuilderContext } from \"./context/GroupQueryBuilderContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingCustomUI } from \"./context/GroupingMappingCustomUIContext\";\nimport { SvgAdd } from \"@itwin/itwinui-icons-react\";\nimport SearchGroupingCustomUI from \"./customUI/SearchGroupingCustomUI\";\nimport ManualGroupingCustomUI from \"./customUI/ManualGroupingCustomUI\";\nimport type { GroupingCustomUI } from \"./customUI/GroupingMappingCustomUI\";\nimport { GroupingMappingCustomUIType } from \"./customUI/GroupingMappingCustomUI\";\n\ninterface GroupActionProps {\n iModelId: string;\n mappingId: string;\n group?: IGroupTyped;\n queryGenerationType?: string;\n goBack: () => Promise<void>;\n resetView: () => Promise<void>;\n}\n\nconst GroupAction = (props: GroupActionProps) => {\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const groupUIs: GroupingCustomUI[] = useGroupingMappingCustomUI()\n .filter((p) => p.type === GroupingMappingCustomUIType.Grouping) as GroupingCustomUI[];\n\n const [details, setDetails] = useState({\n groupName: props.group?.groupName ?? \"\",\n description: props.group?.description ?? \"\",\n });\n const [query, setQuery] = useState<string>(\"\");\n const [simpleSelectionQuery, setSimpleSelectionQuery] = useState<string>(\"\");\n const [validator, showValidationMessage] = useValidator();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [isRendering, setIsRendering] = useState<boolean>(false);\n const [currentPropertyList, setCurrentPropertyList] = useState<PropertyRecord[]>([]);\n const [queryBuilder, setQueryBuilder] = useState<QueryBuilder>(\n new QueryBuilder(undefined),\n );\n const [queryGenerationType, setQueryGenerationType] = useState(\n props.queryGenerationType,\n );\n\n const isUpdating = isLoading || isRendering;\n\n const changeGroupByType = async (\n event: React.ChangeEvent<HTMLInputElement>,\n ) => {\n const {\n target: { value },\n } = event;\n setQueryGenerationType(value);\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n setQuery(\"\");\n setSimpleSelectionQuery(\"\");\n await props.resetView();\n };\n\n useEffect(() => {\n const removeListener = Presentation.selection.selectionChange.addListener(\n async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider,\n ) => {\n if (queryGenerationType === \"Selection\") {\n const selection = selectionProvider.getSelection(\n evt.imodel,\n evt.level,\n );\n const query = selection.instanceKeys.size > 0\n ? `SELECT ECInstanceId FROM ${selection.instanceKeys.keys().next().value}`\n : \"\";\n setSimpleSelectionQuery(query);\n }\n },\n );\n return () => {\n removeListener();\n };\n }, [iModelConnection, queryGenerationType]);\n\n useEffect(() => {\n const reemphasize = async () => {\n try {\n if (!query || query === \"\") {\n return;\n }\n\n if (\n queryGenerationType === \"Selection\" &&\n currentPropertyList.length === 0\n ) {\n return;\n }\n\n setIsRendering(true);\n transparentOverriddenElements();\n const resolvedHiliteIds = await visualizeElementsByQuery(\n query,\n \"red\",\n iModelConnection,\n );\n await zoomToElements(resolvedHiliteIds);\n } catch {\n toaster.negative(\"Sorry, we have failed to generate a valid query. 😔\");\n } finally {\n setIsRendering(false);\n }\n };\n\n void reemphasize();\n }, [iModelConnection, query, currentPropertyList, queryGenerationType]);\n\n useEffect(() => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n }, [iModelConnection]);\n\n const save = useCallback(async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n try {\n setIsLoading(true);\n const currentQuery = query || simpleSelectionQuery;\n\n const accessToken = await getAccessToken();\n\n props.group\n ? await mappingClient.updateGroup(\n accessToken,\n props.iModelId,\n props.mappingId,\n props.group.id ?? \"\",\n { ...details, query: currentQuery },\n )\n : await mappingClient.createGroup(\n accessToken,\n props.iModelId,\n props.mappingId,\n {\n ...details,\n query: currentQuery,\n },\n );\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await props.goBack();\n } catch (error: any) {\n handleError(error.status);\n setIsLoading(false);\n }\n }, [\n validator,\n showValidationMessage,\n query,\n simpleSelectionQuery,\n getAccessToken,\n props,\n mappingClient,\n details,\n iModelConnection,\n ]);\n\n const createQueryBuilderComponent = () => {\n switch (queryGenerationType) {\n case \"Selection\": {\n return (\n <GroupQueryBuilderContext.Provider\n value={{\n currentPropertyList,\n setCurrentPropertyList,\n query,\n setQuery,\n queryBuilder,\n setQueryBuilder,\n isLoading,\n isRendering,\n resetView: props.resetView,\n }}\n >\n <GroupQueryBuilderContainer />\n </GroupQueryBuilderContext.Provider>\n );\n }\n case \"Search\": {\n return (\n <SearchGroupingCustomUI\n updateQuery={setQuery}\n isUpdating={isUpdating}\n resetView={props.resetView}\n />\n );\n }\n case \"Manual\": {\n return (\n <ManualGroupingCustomUI\n updateQuery={setQuery}\n isUpdating={isUpdating}\n resetView={props.resetView}\n />\n );\n }\n default: {\n if (queryGenerationType && queryGenerationType.length > 0) {\n const selectedCustomUI = groupUIs.find(\n (e) => e.name === queryGenerationType,\n );\n if (selectedCustomUI) {\n return React.createElement(selectedCustomUI.uiComponent, {\n updateQuery: setQuery,\n isUpdating,\n resetView: props.resetView,\n });\n }\n }\n return <EmptyMessage message='No query generation method selected. ' />;\n }\n }\n };\n\n const isBlockingActions = !(\n details.groupName &&\n (query || simpleSelectionQuery) &&\n !isRendering &&\n !isLoading\n );\n\n const getRadioTileComponent = (\n icon: ReactElement,\n value: string,\n label: string,\n ) => {\n return (\n <RadioTile\n name={\"groupby\"}\n icon={icon}\n key={value}\n onChange={changeGroupByType}\n value={value}\n label={label}\n disabled={isUpdating}\n checked={queryGenerationType === value}\n />\n );\n };\n\n return (\n <>\n <WidgetHeader\n title={props.group ? props.group.groupName ?? \"\" : \"Add Group\"}\n returnFn={async () => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await props.goBack();\n }}\n />\n <div className='gmw-group-add-modify-container'>\n <Fieldset legend='Group Details' className='gmw-group-details'>\n <Small className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='groupName'\n name='groupName'\n label='Name'\n value={details.groupName}\n required\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n message={validator.message(\n \"groupName\",\n details.groupName,\n NAME_REQUIREMENTS,\n )}\n status={\n validator.message(\n \"groupName\",\n details.groupName,\n NAME_REQUIREMENTS,\n )\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"groupName\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n />\n <LabeledInput\n id='description'\n name='description'\n label='Description'\n value={details.description}\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n }}\n />\n </Fieldset>\n <Fieldset legend='Group By' className='gmw-query-builder-container'>\n <RadioTileGroup className='gmw-radio-group-tile' required>\n {groupUIs.length === 0\n ? (\n defaultUIMetadata.map((p) =>\n getRadioTileComponent(p.icon, p.name, p.displayLabel)\n )\n )\n : (\n groupUIs.map((ext) =>\n getRadioTileComponent(ext.icon ?? <SvgAdd />, ext.name, ext.displayLabel),\n )\n )}\n </RadioTileGroup>\n {queryGenerationType && createQueryBuilderComponent()}\n </Fieldset>\n </div>\n <ActionPanel\n onSave={async () => {\n await save();\n }}\n onCancel={async () => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await props.goBack();\n }}\n isSavingDisabled={isBlockingActions}\n isLoading={isLoading}\n />\n </>\n );\n};\n\nexport default GroupAction;\n"]}
1
+ {"version":3,"file":"GroupAction.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupAction.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,cAAc,EACd,KAAK,EACL,OAAO,GACR,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EACL,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,YAAY,GACb,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,oBAAoB,CAAC;AAC5B,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,EAAE,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EA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EAAE,CAAC,KAAK,EAAE,EAAE;wBAClB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;oBAChD,CAAC,GACD,CACO;YACX,oBAAC,QAAQ,IAAC,MAAM,EAAC,UAAU,EAAC,SAAS,EAAC,6BAA6B;gBACjE,oBAAC,cAAc,IAAC,SAAS,EAAC,sBAAsB,EAAC,QAAQ,UACtD,QAAQ,CAAC,MAAM,KAAK,CAAC;oBACpB,CAAC,CAAC,CACA,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC1B,qBAAqB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,CACtD,CACF;oBACD,CAAC,CAAC,CACA,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WACnB,OAAA,qBAAqB,CAAC,MAAA,GAAG,CAAC,IAAI,mCAAI,oBAAC,MAAM,OAAG,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,CAAA,EAAA,CAC1E,CACF,CACY;gBAChB,mBAAmB,IAAI,2BAA2B,EAAE,CAC5C,CACP;QACN,oBAAC,WAAW,IACV,MAAM,EAAE,KAAK,IAAI,EAAE;gBACjB,MAAM,IAAI,EAAE,CAAC;YACf,CAAC,EACD,QAAQ,EAAE,KAAK,IAAI,EAAE;gBACnB,YAAY,CAAC,SAAS,CAAC,cAAc,CACnC,uBAAuB,EACvB,gBAAgB,CACjB,CAAC;gBACF,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC;YACvB,CAAC,EACD,gBAAgB,EAAE,iBAAiB,EACnC,SAAS,EAAE,SAAS,GACpB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type {\n ISelectionProvider,\n SelectionChangeEventArgs,\n} from \"@itwin/presentation-frontend\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport {\n Fieldset,\n LabeledInput,\n RadioTile,\n RadioTileGroup,\n Small,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport type { ReactElement } from \"react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport {\n EmptyMessage,\n handleError,\n handleInputChange,\n WidgetHeader,\n} from \"./utils\";\nimport type { IGroupTyped } from \"./Grouping\";\nimport { defaultUIMetadata } from \"./Grouping\";\nimport \"./GroupAction.scss\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { GroupQueryBuilderContainer } from \"./GroupQueryBuilderContainer\";\nimport {\n transparentOverriddenElements,\n visualizeElementsByQuery,\n zoomToElements,\n} from \"./viewerUtils\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingCustomUI } from \"./context/GroupingMappingCustomUIContext\";\nimport { SvgAdd } from \"@itwin/itwinui-icons-react\";\nimport SearchGroupingCustomUI from \"./customUI/SearchGroupingCustomUI\";\nimport ManualGroupingCustomUI from \"./customUI/ManualGroupingCustomUI\";\nimport type { GroupingCustomUI } from \"./customUI/GroupingMappingCustomUI\";\nimport { GroupingMappingCustomUIType } from \"./customUI/GroupingMappingCustomUI\";\n\ninterface GroupActionProps {\n iModelId: string;\n mappingId: string;\n group?: IGroupTyped;\n queryGenerationType?: string;\n goBack: () => Promise<void>;\n resetView: () => Promise<void>;\n}\n\nconst GroupAction = (props: GroupActionProps) => {\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const groupUIs: GroupingCustomUI[] = useGroupingMappingCustomUI()\n .filter((p) => p.type === GroupingMappingCustomUIType.Grouping) as GroupingCustomUI[];\n\n const [details, setDetails] = useState({\n groupName: props.group?.groupName ?? \"\",\n description: props.group?.description ?? \"\",\n });\n const [query, setQuery] = useState<string>(\"\");\n const [simpleSelectionQuery, setSimpleSelectionQuery] = useState<string>(\"\");\n const [validator, showValidationMessage] = useValidator();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [isRendering, setIsRendering] = useState<boolean>(false);\n const [queryGenerationType, setQueryGenerationType] = useState(\n props.queryGenerationType,\n );\n\n const isUpdating = isLoading || isRendering;\n\n const changeGroupByType = async (\n event: React.ChangeEvent<HTMLInputElement>,\n ) => {\n const {\n target: { value },\n } = event;\n setQueryGenerationType(value);\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n setQuery(\"\");\n setSimpleSelectionQuery(\"\");\n await props.resetView();\n };\n\n useEffect(() => {\n const removeListener = Presentation.selection.selectionChange.addListener(\n async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider,\n ) => {\n if (queryGenerationType === \"Selection\") {\n const selection = selectionProvider.getSelection(\n evt.imodel,\n evt.level,\n );\n const query = selection.instanceKeys.size > 0\n ? `SELECT ECInstanceId FROM ${selection.instanceKeys.keys().next().value}`\n : \"\";\n setSimpleSelectionQuery(query);\n }\n },\n );\n return () => {\n removeListener();\n };\n }, [iModelConnection, queryGenerationType]);\n\n useEffect(() => {\n const reemphasize = async () => {\n try {\n if (!query || query === \"\") {\n return;\n }\n\n setIsRendering(true);\n transparentOverriddenElements();\n const resolvedHiliteIds = await visualizeElementsByQuery(\n query,\n \"red\",\n iModelConnection,\n );\n await zoomToElements(resolvedHiliteIds);\n } catch {\n toaster.negative(\"Sorry, we have failed to generate a valid query. 😔\");\n } finally {\n setIsRendering(false);\n }\n };\n\n void reemphasize();\n }, [iModelConnection, query]);\n\n useEffect(() => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n }, [iModelConnection]);\n\n const save = useCallback(async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n try {\n setIsLoading(true);\n const currentQuery = query || simpleSelectionQuery;\n\n const accessToken = await getAccessToken();\n\n props.group\n ? await mappingClient.updateGroup(\n accessToken,\n props.iModelId,\n props.mappingId,\n props.group.id ?? \"\",\n { ...details, query: currentQuery },\n )\n : await mappingClient.createGroup(\n accessToken,\n props.iModelId,\n props.mappingId,\n {\n ...details,\n query: currentQuery,\n },\n );\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await props.goBack();\n } catch (error: any) {\n handleError(error.status);\n setIsLoading(false);\n }\n }, [\n validator,\n showValidationMessage,\n query,\n simpleSelectionQuery,\n getAccessToken,\n props,\n mappingClient,\n details,\n iModelConnection,\n ]);\n\n const createQueryBuilderComponent = () => {\n switch (queryGenerationType) {\n case \"Selection\": {\n return (\n <GroupQueryBuilderContainer\n updateQuery={setQuery}\n isUpdating={isUpdating}\n resetView={props.resetView}\n />\n );\n }\n case \"Search\": {\n return (\n <SearchGroupingCustomUI\n updateQuery={setQuery}\n isUpdating={isUpdating}\n resetView={props.resetView}\n />\n );\n }\n case \"Manual\": {\n return (\n <ManualGroupingCustomUI\n updateQuery={setQuery}\n isUpdating={isUpdating}\n resetView={props.resetView}\n />\n );\n }\n default: {\n if (queryGenerationType && queryGenerationType.length > 0) {\n const selectedCustomUI = groupUIs.find(\n (e) => e.name === queryGenerationType,\n );\n if (selectedCustomUI) {\n return React.createElement(selectedCustomUI.uiComponent, {\n updateQuery: setQuery,\n isUpdating,\n resetView: props.resetView,\n });\n }\n }\n return <EmptyMessage message='No query generation method selected. ' />;\n }\n }\n };\n\n const isBlockingActions = !(\n details.groupName &&\n (query || simpleSelectionQuery) &&\n !isRendering &&\n !isLoading\n );\n\n const getRadioTileComponent = (\n icon: ReactElement,\n value: string,\n label: string,\n ) => {\n return (\n <RadioTile\n name={\"groupby\"}\n icon={icon}\n key={value}\n onChange={changeGroupByType}\n value={value}\n label={label}\n disabled={isUpdating}\n checked={queryGenerationType === value}\n />\n );\n };\n\n return (\n <>\n <WidgetHeader\n title={props.group ? props.group.groupName ?? \"\" : \"Add Group\"}\n returnFn={async () => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await props.goBack();\n }}\n />\n <div className='gmw-group-add-modify-container'>\n <Fieldset legend='Group Details' className='gmw-group-details'>\n <Small className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='groupName'\n name='groupName'\n label='Name'\n value={details.groupName}\n required\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n message={validator.message(\n \"groupName\",\n details.groupName,\n NAME_REQUIREMENTS,\n )}\n status={\n validator.message(\n \"groupName\",\n details.groupName,\n NAME_REQUIREMENTS,\n )\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"groupName\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, details, setDetails);\n validator.showMessageFor(\"groupName\");\n }}\n />\n <LabeledInput\n id='description'\n name='description'\n label='Description'\n value={details.description}\n onChange={(event) => {\n handleInputChange(event, details, setDetails);\n }}\n />\n </Fieldset>\n <Fieldset legend='Group By' className='gmw-query-builder-container'>\n <RadioTileGroup className='gmw-radio-group-tile' required>\n {groupUIs.length === 0\n ? (\n defaultUIMetadata.map((p) =>\n getRadioTileComponent(p.icon, p.name, p.displayLabel)\n )\n )\n : (\n groupUIs.map((ext) =>\n getRadioTileComponent(ext.icon ?? <SvgAdd />, ext.name, ext.displayLabel),\n )\n )}\n </RadioTileGroup>\n {queryGenerationType && createQueryBuilderComponent()}\n </Fieldset>\n </div>\n <ActionPanel\n onSave={async () => {\n await save();\n }}\n onCancel={async () => {\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n await props.goBack();\n }}\n isSavingDisabled={isBlockingActions}\n isLoading={isLoading}\n />\n </>\n );\n};\n\nexport default GroupAction;\n"]}
@@ -1,4 +1,5 @@
1
- import React from "react";
1
+ /// <reference types="react" />
2
2
  import "./GroupQueryBuilder.scss";
3
- export declare const GroupQueryBuilderContainer: React.FunctionComponent;
3
+ import type { GroupingCustomUIProps } from "./customUI/GroupingMappingCustomUI";
4
+ export declare const GroupQueryBuilderContainer: ({ isUpdating, resetView, updateQuery }: GroupingCustomUIProps) => JSX.Element;
4
5
  //# sourceMappingURL=GroupQueryBuilderContainer.d.ts.map
@@ -2,44 +2,53 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- import React, { useEffect } from "react";
5
+ import { useEffect, useState } from "react";
6
6
  import { useActiveIModelConnection } from "@itwin/appui-react";
7
+ import { Presentation } from "@itwin/presentation-frontend";
7
8
  import { KeySet } from "@itwin/presentation-common";
8
- import { GroupQueryBuilderApi } from "../../api/GroupQueryBuilderApi";
9
- import { PropertyGridWrapperApp } from "./property-grid/PropertyGridWrapper";
10
- import { GroupQueryBuilderContext } from "./context/GroupQueryBuilderContext";
9
+ import { PropertyGridWrapper } from "./property-grid/PropertyGridWrapper";
10
+ import { PropertyGridWrapperContext } from "./context/PropertyGridWrapperContext";
11
11
  import { Button } from "@itwin/itwinui-react";
12
12
  import "./GroupQueryBuilder.scss";
13
- export const GroupQueryBuilderContainer = () => {
13
+ import React from "react";
14
+ export const GroupQueryBuilderContainer = ({ isUpdating, resetView, updateQuery }) => {
14
15
  const iModelConnection = useActiveIModelConnection();
15
- const context = React.useContext(GroupQueryBuilderContext);
16
- const [keysState, setKeysState] = React.useState(new KeySet());
17
- const [selected, SetSelected] = React.useState(false);
16
+ const [keysState, setKeysState] = useState(new KeySet());
17
+ const [selected, setSelected] = useState(false);
18
+ const [queryBuilder, setQueryBuilder] = useState();
19
+ const [currentPropertyList, setCurrentPropertyList] = useState([]);
18
20
  useEffect(() => {
19
21
  const _onSelectionChanged = async (evt, selectionProvider) => {
20
- SetSelected(true);
21
- context.setCurrentPropertyList([]);
22
+ setSelected(true);
23
+ setCurrentPropertyList([]);
22
24
  const selection = selectionProvider.getSelection(evt.imodel, evt.level);
23
25
  const keys = new KeySet(selection);
24
26
  setKeysState(keys);
25
27
  };
26
- if (iModelConnection) {
27
- GroupQueryBuilderApi.addSelectionListener(_onSelectionChanged);
28
- }
29
- return () => {
30
- GroupQueryBuilderApi.removeSelectionListener();
31
- };
32
- }, [iModelConnection, context]);
33
- const _onClickResetButton = () => {
34
- context.setQuery("");
35
- context.queryBuilder.query = undefined;
36
- context.setCurrentPropertyList([]);
37
- context.resetView().catch((e) =>
38
- /* eslint-disable no-console */
39
- console.error(e));
28
+ return iModelConnection
29
+ ? Presentation.selection.selectionChange.addListener(_onSelectionChanged) :
30
+ () => { };
31
+ }, [iModelConnection]);
32
+ const _onClickResetButton = async () => {
33
+ updateQuery("");
34
+ queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.resetQuery();
35
+ setCurrentPropertyList([]);
36
+ if (resetView)
37
+ await resetView().catch((e) =>
38
+ /* eslint-disable no-console */
39
+ console.error(e));
40
40
  };
41
41
  return (React.createElement("div", { className: "gmw-find-similar-container" },
42
- React.createElement(PropertyGridWrapperApp, { keys: keysState, imodel: iModelConnection }),
42
+ React.createElement(PropertyGridWrapperContext.Provider, { value: {
43
+ currentPropertyList,
44
+ setCurrentPropertyList,
45
+ queryBuilder,
46
+ setQueryBuilder,
47
+ resetView: resetView !== null && resetView !== void 0 ? resetView : (async () => { }),
48
+ setQuery: updateQuery,
49
+ isUpdating: isUpdating !== null && isUpdating !== void 0 ? isUpdating : false,
50
+ } },
51
+ React.createElement(PropertyGridWrapper, { keys: keysState, imodel: iModelConnection })),
43
52
  selected && (React.createElement("div", { className: "gmw-button-container" },
44
53
  React.createElement(Button, { styleType: "default", size: "small", className: "gmw-reset-button", onClick: _onClickResetButton }, "Reset")))));
45
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"GroupQueryBuilderContainer.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupQueryBuilderContainer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAK/D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,0BAA0B,CAAC;AAElC,MAAM,CAAC,MAAM,0BAA0B,GAA4B,GAAG,EAAE;IACtE,MAAM,gBAAgB,GAAG,yBAAyB,EAAE,CAAC;IACrD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;IAE3D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,IAAI,MAAM,EAAE,CAAC,CAAC;IACvE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAE/D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,mBAAmB,GAAG,KAAK,EAC/B,GAA6B,EAC7B,iBAAqC,EACrC,EAAE;YACF,WAAW,CAAC,IAAI,CAAC,CAAC;YAClB,OAAO,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;YAEnC,MAAM,SAAS,GAAG,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;YACxE,MAAM,IAAI,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC;YACnC,YAAY,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC,CAAC;QAEF,IAAI,gBAAgB,EAAE;YACpB,oBAAoB,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;SAChE;QACD,OAAO,GAAG,EAAE;YACV,oBAAoB,CAAC,uBAAuB,EAAE,CAAC;QACjD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC;IAEhC,MAAM,mBAAmB,GAAG,GAAG,EAAE;QAC/B,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACrB,OAAO,CAAC,YAAY,CAAC,KAAK,GAAG,SAAS,CAAC;QACvC,OAAO,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QAC9B,+BAA+B;QAC/B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CACjB,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,4BAA4B;QACzC,oBAAC,sBAAsB,IAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,GAAI;QACpE,QAAQ,IAAI,CACX,6BAAK,SAAS,EAAC,sBAAsB;YACnC,oBAAC,MAAM,IACL,SAAS,EAAC,SAAS,EACnB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,kBAAkB,EAC5B,OAAO,EAAE,mBAAmB,YAGrB,CACL,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React, { useEffect } from \"react\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport type {\n ISelectionProvider,\n SelectionChangeEventArgs,\n} from \"@itwin/presentation-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { GroupQueryBuilderApi } from \"../../api/GroupQueryBuilderApi\";\nimport { PropertyGridWrapperApp } from \"./property-grid/PropertyGridWrapper\";\nimport { GroupQueryBuilderContext } from \"./context/GroupQueryBuilderContext\";\nimport { Button } from \"@itwin/itwinui-react\";\nimport \"./GroupQueryBuilder.scss\";\n\nexport const GroupQueryBuilderContainer: React.FunctionComponent = () => {\n const iModelConnection = useActiveIModelConnection();\n const context = React.useContext(GroupQueryBuilderContext);\n\n const [keysState, setKeysState] = React.useState<KeySet>(new KeySet());\n const [selected, SetSelected] = React.useState<boolean>(false);\n\n useEffect(() => {\n const _onSelectionChanged = async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider\n ) => {\n SetSelected(true);\n context.setCurrentPropertyList([]);\n\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const keys = new KeySet(selection);\n setKeysState(keys);\n };\n\n if (iModelConnection) {\n GroupQueryBuilderApi.addSelectionListener(_onSelectionChanged);\n }\n return () => {\n GroupQueryBuilderApi.removeSelectionListener();\n };\n }, [iModelConnection, context]);\n\n const _onClickResetButton = () => {\n context.setQuery(\"\");\n context.queryBuilder.query = undefined;\n context.setCurrentPropertyList([]);\n context.resetView().catch((e) =>\n /* eslint-disable no-console */\n console.error(e)\n );\n };\n\n return (\n <div className=\"gmw-find-similar-container\">\n <PropertyGridWrapperApp keys={keysState} imodel={iModelConnection} />\n {selected && (\n <div className=\"gmw-button-container\">\n <Button\n styleType=\"default\"\n size=\"small\"\n className=\"gmw-reset-button\"\n onClick={_onClickResetButton}\n >\n Reset\n </Button>\n </div>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"GroupQueryBuilderContainer.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupQueryBuilderContainer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+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EAAE,mBAAmB,YAGrB,CACL,CACP,CAEE,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { useEffect, useState } from \"react\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport type { ISelectionProvider, SelectionChangeEventArgs } from \"@itwin/presentation-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { PropertyGridWrapper } from \"./property-grid/PropertyGridWrapper\";\nimport { PropertyGridWrapperContext } from \"./context/PropertyGridWrapperContext\";\nimport { Button } from \"@itwin/itwinui-react\";\nimport \"./GroupQueryBuilder.scss\";\nimport type { QueryBuilder } from \"./QueryBuilder\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { GroupingCustomUIProps } from \"./customUI/GroupingMappingCustomUI\";\nimport React from \"react\";\n\nexport const GroupQueryBuilderContainer = ({ isUpdating, resetView, updateQuery }: GroupingCustomUIProps) => {\n const iModelConnection = useActiveIModelConnection();\n\n const [keysState, setKeysState] = useState<KeySet>(new KeySet());\n const [selected, setSelected] = useState<boolean>(false);\n\n const [queryBuilder, setQueryBuilder] = useState<QueryBuilder | undefined>();\n const [currentPropertyList, setCurrentPropertyList] = useState<PropertyRecord[]>([]);\n\n useEffect(() => {\n const _onSelectionChanged = async (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider\n ) => {\n setSelected(true);\n setCurrentPropertyList([]);\n\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n const keys = new KeySet(selection);\n setKeysState(keys);\n };\n\n return iModelConnection\n ? Presentation.selection.selectionChange.addListener(_onSelectionChanged) :\n () => { };\n }, [iModelConnection]);\n\n const _onClickResetButton = async () => {\n updateQuery(\"\");\n queryBuilder?.resetQuery();\n setCurrentPropertyList([]);\n if (resetView)\n await resetView().catch((e) =>\n /* eslint-disable no-console */\n console.error(e)\n );\n };\n\n return (\n <div className=\"gmw-find-similar-container\">\n <PropertyGridWrapperContext.Provider\n value={{\n currentPropertyList,\n setCurrentPropertyList,\n queryBuilder,\n setQueryBuilder,\n resetView: resetView ?? (async () => { }),\n setQuery: updateQuery,\n isUpdating: isUpdating ?? false,\n }}>\n <PropertyGridWrapper keys={keysState} imodel={iModelConnection} />\n </PropertyGridWrapperContext.Provider>\n {\n selected && (\n <div className=\"gmw-button-container\">\n <Button\n styleType=\"default\"\n size=\"small\"\n className=\"gmw-reset-button\"\n onClick={_onClickResetButton}\n >\n Reset\n </Button>\n </div>\n )\n }\n </div >\n );\n};\n"]}
@@ -84,7 +84,7 @@ export const Groupings = ({ mapping, goBack }) => {
84
84
  const [selectedContextCustomUI, setSelectedContextCustomUI] = useState(undefined);
85
85
  useEffect(() => {
86
86
  void fetchGroups(setGroups, iModelId, mapping.id, setIsLoading, getAccessToken, mappingClient);
87
- }, [getAccessToken, mappingClient, iModelId, mapping.id, setIsLoading]);
87
+ }, [getAccessToken, mappingClient, iModelId, mapping.id]);
88
88
  const getGroupColor = function (index) {
89
89
  return `hsl(${index * goldenAngle + 60}, 100%, 50%)`;
90
90
  };