@itwin/grouping-mapping-widget 0.3.2 → 0.3.5

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 (199) hide show
  1. package/lib/cjs/formula/FormulaFunctionProvider.d.ts +18 -0
  2. package/lib/cjs/formula/FormulaFunctionProvider.js +136 -0
  3. package/lib/cjs/formula/FormulaFunctionProvider.js.map +1 -0
  4. package/lib/cjs/formula/FormulaOperatorsProvider.d.ts +34 -0
  5. package/lib/cjs/formula/FormulaOperatorsProvider.js +185 -0
  6. package/lib/cjs/formula/FormulaOperatorsProvider.js.map +1 -0
  7. package/lib/cjs/formula/FormulaSplitter.d.ts +2 -0
  8. package/lib/cjs/formula/FormulaSplitter.js +140 -0
  9. package/lib/cjs/formula/FormulaSplitter.js.map +1 -0
  10. package/lib/cjs/formula/FormulaTokensValidator.d.ts +5 -0
  11. package/lib/cjs/formula/FormulaTokensValidator.js +137 -0
  12. package/lib/cjs/formula/FormulaTokensValidator.js.map +1 -0
  13. package/lib/cjs/formula/FormulaValidator.d.ts +3 -0
  14. package/lib/cjs/formula/FormulaValidator.js +35 -0
  15. package/lib/cjs/formula/FormulaValidator.js.map +1 -0
  16. package/lib/cjs/formula/IResult.d.ts +5 -0
  17. package/lib/cjs/formula/IResult.js +3 -0
  18. package/lib/cjs/formula/IResult.js.map +1 -0
  19. package/lib/cjs/formula/InfixToPostfixConverter.d.ts +18 -0
  20. package/lib/cjs/formula/InfixToPostfixConverter.js +299 -0
  21. package/lib/cjs/formula/InfixToPostfixConverter.js.map +1 -0
  22. package/lib/cjs/formula/InputStream.d.ts +12 -0
  23. package/lib/cjs/formula/InputStream.js +36 -0
  24. package/lib/cjs/formula/InputStream.js.map +1 -0
  25. package/lib/cjs/formula/ParenthesisValidator.d.ts +7 -0
  26. package/lib/cjs/formula/ParenthesisValidator.js +34 -0
  27. package/lib/cjs/formula/ParenthesisValidator.js.map +1 -0
  28. package/lib/cjs/formula/Queue.d.ts +11 -0
  29. package/lib/cjs/formula/Queue.js +42 -0
  30. package/lib/cjs/formula/Queue.js.map +1 -0
  31. package/lib/cjs/formula/Stack.d.ts +14 -0
  32. package/lib/cjs/formula/Stack.js +71 -0
  33. package/lib/cjs/formula/Stack.js.map +1 -0
  34. package/lib/cjs/formula/StringBuilder.d.ts +9 -0
  35. package/lib/cjs/formula/StringBuilder.js +26 -0
  36. package/lib/cjs/formula/StringBuilder.js.map +1 -0
  37. package/lib/cjs/formula/Types.d.ts +8 -0
  38. package/lib/cjs/formula/Types.js +3 -0
  39. package/lib/cjs/formula/Types.js.map +1 -0
  40. package/lib/cjs/formula/Utils.d.ts +7 -0
  41. package/lib/cjs/formula/Utils.js +39 -0
  42. package/lib/cjs/formula/Utils.js.map +1 -0
  43. package/lib/cjs/widget/components/BlockingOverlay.d.ts +7 -0
  44. package/lib/cjs/widget/components/BlockingOverlay.js +21 -0
  45. package/lib/cjs/widget/components/BlockingOverlay.js.map +1 -0
  46. package/lib/cjs/widget/components/BlockingOverlay.scss +26 -0
  47. package/lib/cjs/widget/components/CalculatedPropertyAction.d.ts +1 -1
  48. package/lib/cjs/widget/components/CalculatedPropertyAction.js +4 -5
  49. package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
  50. package/lib/cjs/widget/components/CalculatedPropertyTable.d.ts +5 -2
  51. package/lib/cjs/widget/components/CalculatedPropertyTable.js +5 -29
  52. package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -1
  53. package/lib/cjs/widget/components/ConfirmMappingsImport.js +1 -2
  54. package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
  55. package/lib/cjs/widget/components/ConfirmMappingsImport.scss +4 -2
  56. package/lib/cjs/widget/components/CustomCalculationAction.d.ts +4 -2
  57. package/lib/cjs/widget/components/CustomCalculationAction.js +10 -6
  58. package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -1
  59. package/lib/cjs/widget/components/CustomCalculationTable.d.ts +5 -2
  60. package/lib/cjs/widget/components/CustomCalculationTable.js +5 -29
  61. package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -1
  62. package/lib/cjs/widget/components/GroupAction.js +3 -12
  63. package/lib/cjs/widget/components/GroupAction.js.map +1 -1
  64. package/lib/cjs/widget/components/GroupPropertyAction.d.ts +1 -1
  65. package/lib/cjs/widget/components/GroupPropertyAction.js +5 -6
  66. package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
  67. package/lib/cjs/widget/components/GroupPropertyTable.d.ts +5 -2
  68. package/lib/cjs/widget/components/GroupPropertyTable.js +5 -29
  69. package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -1
  70. package/lib/cjs/widget/components/Grouping.js +2 -3
  71. package/lib/cjs/widget/components/Grouping.js.map +1 -1
  72. package/lib/cjs/widget/components/Mapping.js +26 -5
  73. package/lib/cjs/widget/components/Mapping.js.map +1 -1
  74. package/lib/cjs/widget/components/MappingAction.js +10 -13
  75. package/lib/cjs/widget/components/MappingAction.js.map +1 -1
  76. package/lib/cjs/widget/components/MappingImportWizardModal.js +2 -2
  77. package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
  78. package/lib/cjs/widget/components/MappingImportWizardModal.scss +6 -2
  79. package/lib/cjs/widget/components/PropertyMenu.js +77 -21
  80. package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
  81. package/lib/cjs/widget/components/SelectIModel.scss +2 -1
  82. package/lib/cjs/widget/components/SelectMapping.scss +2 -1
  83. package/lib/cjs/widget/components/SelectMappings.js +1 -2
  84. package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
  85. package/lib/cjs/widget/components/SelectProject.js +9 -9
  86. package/lib/cjs/widget/components/SelectProject.js.map +1 -1
  87. package/lib/cjs/widget/components/SelectProject.scss +3 -8
  88. package/lib/cjs/widget/components/utils.d.ts +2 -0
  89. package/lib/cjs/widget/components/utils.js +13 -1
  90. package/lib/cjs/widget/components/utils.js.map +1 -1
  91. package/lib/cjs/widget/hooks/useFetchData.d.ts +9 -0
  92. package/lib/cjs/widget/hooks/useFetchData.js +41 -0
  93. package/lib/cjs/widget/hooks/useFetchData.js.map +1 -0
  94. package/lib/cjs/widget/hooks/useFormulaValidation.d.ts +6 -0
  95. package/lib/cjs/widget/hooks/useFormulaValidation.js +29 -0
  96. package/lib/cjs/widget/hooks/useFormulaValidation.js.map +1 -0
  97. package/lib/cjs/widget/utils.d.ts +1 -0
  98. package/lib/cjs/widget/utils.js +9 -0
  99. package/lib/cjs/widget/utils.js.map +1 -1
  100. package/lib/esm/formula/FormulaFunctionProvider.d.ts +18 -0
  101. package/lib/esm/formula/FormulaFunctionProvider.js +130 -0
  102. package/lib/esm/formula/FormulaFunctionProvider.js.map +1 -0
  103. package/lib/esm/formula/FormulaOperatorsProvider.d.ts +34 -0
  104. package/lib/esm/formula/FormulaOperatorsProvider.js +174 -0
  105. package/lib/esm/formula/FormulaOperatorsProvider.js.map +1 -0
  106. package/lib/esm/formula/FormulaSplitter.d.ts +2 -0
  107. package/lib/esm/formula/FormulaSplitter.js +136 -0
  108. package/lib/esm/formula/FormulaSplitter.js.map +1 -0
  109. package/lib/esm/formula/FormulaTokensValidator.d.ts +5 -0
  110. package/lib/esm/formula/FormulaTokensValidator.js +133 -0
  111. package/lib/esm/formula/FormulaTokensValidator.js.map +1 -0
  112. package/lib/esm/formula/FormulaValidator.d.ts +3 -0
  113. package/lib/esm/formula/FormulaValidator.js +31 -0
  114. package/lib/esm/formula/FormulaValidator.js.map +1 -0
  115. package/lib/esm/formula/IResult.d.ts +5 -0
  116. package/lib/esm/formula/IResult.js +2 -0
  117. package/lib/esm/formula/IResult.js.map +1 -0
  118. package/lib/esm/formula/InfixToPostfixConverter.d.ts +18 -0
  119. package/lib/esm/formula/InfixToPostfixConverter.js +295 -0
  120. package/lib/esm/formula/InfixToPostfixConverter.js.map +1 -0
  121. package/lib/esm/formula/InputStream.d.ts +12 -0
  122. package/lib/esm/formula/InputStream.js +32 -0
  123. package/lib/esm/formula/InputStream.js.map +1 -0
  124. package/lib/esm/formula/ParenthesisValidator.d.ts +7 -0
  125. package/lib/esm/formula/ParenthesisValidator.js +30 -0
  126. package/lib/esm/formula/ParenthesisValidator.js.map +1 -0
  127. package/lib/esm/formula/Queue.d.ts +11 -0
  128. package/lib/esm/formula/Queue.js +38 -0
  129. package/lib/esm/formula/Queue.js.map +1 -0
  130. package/lib/esm/formula/Stack.d.ts +14 -0
  131. package/lib/esm/formula/Stack.js +67 -0
  132. package/lib/esm/formula/Stack.js.map +1 -0
  133. package/lib/esm/formula/StringBuilder.d.ts +9 -0
  134. package/lib/esm/formula/StringBuilder.js +22 -0
  135. package/lib/esm/formula/StringBuilder.js.map +1 -0
  136. package/lib/esm/formula/Types.d.ts +8 -0
  137. package/lib/esm/formula/Types.js +2 -0
  138. package/lib/esm/formula/Types.js.map +1 -0
  139. package/lib/esm/formula/Utils.d.ts +7 -0
  140. package/lib/esm/formula/Utils.js +30 -0
  141. package/lib/esm/formula/Utils.js.map +1 -0
  142. package/lib/esm/widget/components/BlockingOverlay.d.ts +7 -0
  143. package/lib/esm/widget/components/BlockingOverlay.js +14 -0
  144. package/lib/esm/widget/components/BlockingOverlay.js.map +1 -0
  145. package/lib/esm/widget/components/BlockingOverlay.scss +26 -0
  146. package/lib/esm/widget/components/CalculatedPropertyAction.d.ts +1 -1
  147. package/lib/esm/widget/components/CalculatedPropertyAction.js +5 -6
  148. package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
  149. package/lib/esm/widget/components/CalculatedPropertyTable.d.ts +5 -2
  150. package/lib/esm/widget/components/CalculatedPropertyTable.js +6 -30
  151. package/lib/esm/widget/components/CalculatedPropertyTable.js.map +1 -1
  152. package/lib/esm/widget/components/ConfirmMappingsImport.js +2 -3
  153. package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
  154. package/lib/esm/widget/components/ConfirmMappingsImport.scss +4 -2
  155. package/lib/esm/widget/components/CustomCalculationAction.d.ts +4 -2
  156. package/lib/esm/widget/components/CustomCalculationAction.js +11 -7
  157. package/lib/esm/widget/components/CustomCalculationAction.js.map +1 -1
  158. package/lib/esm/widget/components/CustomCalculationTable.d.ts +5 -2
  159. package/lib/esm/widget/components/CustomCalculationTable.js +6 -30
  160. package/lib/esm/widget/components/CustomCalculationTable.js.map +1 -1
  161. package/lib/esm/widget/components/GroupAction.js +4 -13
  162. package/lib/esm/widget/components/GroupAction.js.map +1 -1
  163. package/lib/esm/widget/components/GroupPropertyAction.d.ts +1 -1
  164. package/lib/esm/widget/components/GroupPropertyAction.js +6 -7
  165. package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -1
  166. package/lib/esm/widget/components/GroupPropertyTable.d.ts +5 -2
  167. package/lib/esm/widget/components/GroupPropertyTable.js +6 -30
  168. package/lib/esm/widget/components/GroupPropertyTable.js.map +1 -1
  169. package/lib/esm/widget/components/Grouping.js +3 -4
  170. package/lib/esm/widget/components/Grouping.js.map +1 -1
  171. package/lib/esm/widget/components/Mapping.js +28 -7
  172. package/lib/esm/widget/components/Mapping.js.map +1 -1
  173. package/lib/esm/widget/components/MappingAction.js +12 -15
  174. package/lib/esm/widget/components/MappingAction.js.map +1 -1
  175. package/lib/esm/widget/components/MappingImportWizardModal.js +2 -2
  176. package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
  177. package/lib/esm/widget/components/MappingImportWizardModal.scss +6 -2
  178. package/lib/esm/widget/components/PropertyMenu.js +79 -23
  179. package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
  180. package/lib/esm/widget/components/SelectIModel.scss +2 -1
  181. package/lib/esm/widget/components/SelectMapping.scss +2 -1
  182. package/lib/esm/widget/components/SelectMappings.js +2 -3
  183. package/lib/esm/widget/components/SelectMappings.js.map +1 -1
  184. package/lib/esm/widget/components/SelectProject.js +9 -9
  185. package/lib/esm/widget/components/SelectProject.js.map +1 -1
  186. package/lib/esm/widget/components/SelectProject.scss +3 -8
  187. package/lib/esm/widget/components/utils.d.ts +2 -0
  188. package/lib/esm/widget/components/utils.js +11 -0
  189. package/lib/esm/widget/components/utils.js.map +1 -1
  190. package/lib/esm/widget/hooks/useFetchData.d.ts +9 -0
  191. package/lib/esm/widget/hooks/useFetchData.js +35 -0
  192. package/lib/esm/widget/hooks/useFetchData.js.map +1 -0
  193. package/lib/esm/widget/hooks/useFormulaValidation.d.ts +6 -0
  194. package/lib/esm/widget/hooks/useFormulaValidation.js +25 -0
  195. package/lib/esm/widget/hooks/useFormulaValidation.js.map +1 -0
  196. package/lib/esm/widget/utils.d.ts +1 -0
  197. package/lib/esm/widget/utils.js +7 -1
  198. package/lib/esm/widget/utils.js.map +1 -1
  199. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"GroupPropertyAction.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyAction.tsx"],"names":[],"mappings":"AAeA,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,GACV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACL,cAAc,EACd,YAAY,EACZ,SAAS,GACV,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,aAAa,EACb,KAAK,EACL,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,EAAE,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,4BAA4B,CAAC;AAE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,KAAK,YAAY,CAAC,MAAM,GAAG,CAAC;gCAE3C,oBAAC,cAAc,OAAG,CACP,CACT,CACF,CACP,CAAC;gBACJ,CAAC,CAAC,CACO,CACP;QAEN,oBAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,GAAI,CACxE,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,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 ContentDescriptorRequestOptions,\n Field,\n KeySet,\n NestedContentField,\n PropertiesField,\n Ruleset,\n RulesetVariable,\n StructFieldMemberDescription,\n} from \"@itwin/presentation-common\";\nimport {\n ContentSpecificationTypes,\n DefaultContentDisplayTypes,\n PropertyValueFormat,\n RelationshipMeaning,\n RuleTypes,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport {\n SvgChevronDown,\n SvgChevronUp,\n SvgRemove,\n} from \"@itwin/itwinui-icons-react\";\nimport type {\n SelectOption,\n} from \"@itwin/itwinui-react\";\nimport {\n Alert,\n ComboBox,\n Fieldset,\n IconButton,\n LabeledInput,\n LabeledSelect,\n Small,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useContext, useEffect, useMemo, useState } from \"react\";\n\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { handleError, WidgetHeader } from \"./utils\";\nimport \"./GroupPropertyAction.scss\";\nimport type { ECProperty, GroupPropertyCreate } from \"@itwin/insights-client\";\nimport { ReportingClient } from \"@itwin/insights-client\";\nimport { ApiContext } from \"./GroupingMapping\";\n\ninterface GroupPropertyActionProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n groupPropertyId?: string;\n groupPropertyName?: string;\n keySet: KeySet;\n returnFn: () => Promise<void>;\n}\n\nexport const quantityTypesSelectionOptions: SelectOption<string>[] = [\n { value: \"Area\", label: \"Area\" },\n { value: \"Distance\", label: \"Distance\" },\n { value: \"Force\", label: \"Force\" },\n { value: \"Mass\", label: \"Mass\" },\n { value: \"Monetary\", label: \"Monetary\" },\n { value: \"Time\", label: \"Time\" },\n { value: \"Volume\", label: \"Volume\" },\n { value: \"Undefined\", label: \"No Quantity Type\" },\n];\ninterface Property {\n name: string;\n label: string;\n type: string;\n}\n\ninterface NavigationProperty {\n navigationName: string;\n rootClassName: string;\n}\n\nconst extractPrimitive = (\n propertiesField: PropertiesField,\n classToPropertiesMapping: Map<string, Property[]>,\n navigation?: NavigationProperty\n) => {\n // There are rare cases which only happens in multiple selections where it returns more than one.\n // This also checks if this property comes from a navigation property\n const className =\n navigation?.rootClassName ??\n propertiesField.properties[0].property.classInfo.name;\n // Sometimes class names are not defined. Type error. Not guaranteed.\n if (!className) {\n return;\n }\n\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n // Gets property name. Appends path if from navigation.\n const propertyName = navigation\n ? `${navigation.navigationName}.${propertiesField.properties[0].property.name}`\n : propertiesField.properties[0].property.name;\n\n const label = navigation\n ? `${propertiesField.label} (${navigation?.navigationName})`\n : propertiesField.label;\n\n // Ignore hardcoded BisCore navigation properties\n if (propertiesField.type.typeName === \"navigation\") {\n return;\n } else {\n classToPropertiesMapping.get(className)?.push({\n name: propertyName,\n label,\n type: propertiesField.properties[0].property.type,\n });\n }\n};\n\nconst extractStructProperties = (\n name: string,\n className: string,\n classToPropertiesMapping: Map<string, Property[]>,\n members: StructFieldMemberDescription[]\n) => {\n for (const member of members) {\n if (member.type.valueFormat === PropertyValueFormat.Primitive) {\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n classToPropertiesMapping.get(className)?.push({\n name: `${name}.${member.name}`,\n label: member.label,\n type: member.type.typeName,\n });\n } else if (member.type.valueFormat === PropertyValueFormat.Struct) {\n extractStructProperties(\n `${name}.${member.name}`,\n className,\n classToPropertiesMapping,\n member.type.members\n );\n }\n }\n};\n\nconst extractProperties = (\n properties: Field[],\n classToPropertiesMapping: Map<string, Property[]>,\n navigation?: NavigationProperty\n) => {\n for (const property of properties) {\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n extractPrimitive(\n property as PropertiesField,\n classToPropertiesMapping,\n navigation\n );\n break;\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n break;\n }\n\n switch (nestedContentField.relationshipMeaning) {\n case RelationshipMeaning.SameInstance: {\n // Check for aspects. Ignore them if coming from navigation.\n if (\n !navigation &&\n (nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsUniqueAspect\" ||\n nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsMultiAspects\")\n ) {\n const className = nestedContentField.contentClassInfo.name;\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n extractProperties(\n nestedContentField.nestedFields,\n classToPropertiesMapping,\n navigation\n );\n }\n\n break;\n }\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n const className =\n nestedContentField.pathToPrimaryClass[0].targetClassInfo.name;\n extractProperties(\n nestedContentField.nestedFields,\n classToPropertiesMapping,\n {\n navigationName: \"TypeDefinition\",\n rootClassName: className,\n }\n );\n // Hardcoded BisCore navigation properties for the type definition.\n classToPropertiesMapping.get(className)?.push({\n name: \"TypeDefinition.Model.ModeledElement.UserLabel\",\n label: \"Model UserLabel (TypeDefinition)\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(className)?.push({\n name: \"TypeDefinition.Model.ModeledElement.CodeValue\",\n label: \"Model CodeValue (TypeDefinition)\",\n type: \"string\",\n });\n\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n const columnName = (property as PropertiesField).properties[0]\n .property.name;\n const className = (property as PropertiesField).properties[0]\n .property.classInfo.name;\n extractStructProperties(\n navigation\n ? `${navigation.navigationName}.${columnName}`\n : columnName,\n navigation ? navigation.rootClassName : className,\n classToPropertiesMapping,\n property.type.members\n );\n\n }\n }\n }\n }\n }\n }\n};\n\nconst GroupPropertyAction = ({\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupPropertyName,\n keySet,\n returnFn,\n}: GroupPropertyActionProps) => {\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const apiContext = useContext(ApiContext);\n const [propertyName, setPropertyName] = useState<string>(\"\");\n const [dataType, setDataType] = useState<string | undefined>();\n const [quantityType, setQuantityType] = useState<string>(\"Undefined\");\n const [classToPropertiesMapping, setClassToPropertiesMapping] =\n useState<Map<string, Property[]>>();\n const [ecProperties, setEcProperties] = useState<ECProperty[]>(\n []\n );\n const [validator, showValidationMessage] = useValidator();\n const [propertyAlert, setPropertyAlert] = useState<boolean>(false);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n useEffect(() => {\n const getContent = async () => {\n setIsLoading(true);\n const ruleSet: Ruleset = {\n id: \"element-properties\",\n rules: [\n {\n ruleType: RuleTypes.Content,\n specifications: [\n {\n specType: ContentSpecificationTypes.SelectedNodeInstances,\n },\n ],\n }],\n };\n const requestOptions: ContentDescriptorRequestOptions<\n IModelConnection,\n KeySet,\n RulesetVariable\n > = {\n imodel: iModelConnection,\n keys: keySet,\n rulesetOrId: ruleSet,\n displayType: DefaultContentDisplayTypes.PropertyPane,\n };\n const content = await Presentation.presentation.getContentDescriptor(\n requestOptions\n );\n\n // Only primitives and structs for now\n const properties =\n content?.fields.filter(\n (field) =>\n field.type.valueFormat === PropertyValueFormat.Primitive ||\n field.type.valueFormat === PropertyValueFormat.Struct\n ) ?? [];\n\n // Map properties to their classes\n const classToPropertiesMapping = new Map<string, Property[]>();\n\n extractProperties(properties, classToPropertiesMapping);\n\n const rootClassName = keySet.instanceKeys.keys().next().value;\n\n // Hardcoded BisCore navigation properties.\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Model.ModeledElement.UserLabel\",\n label: \"Model UserLabel\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Model.ModeledElement.CodeValue\",\n label: \"Model CodeValue\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Category.CodeValue\",\n label: \"Category CodeValue\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Category.UserLabel\",\n label: \"Category UserLabel\",\n type: \"string\",\n });\n\n setClassToPropertiesMapping(classToPropertiesMapping);\n\n let newEcProperties: ECProperty[];\n const reportingClientApi = new ReportingClient(apiContext.prefix);\n // Fetch already existing ec properties then add all classes from presentation\n if (groupPropertyId) {\n // TODO Error handling\n const response = await reportingClientApi.getGroupProperty(\n apiContext.accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId\n );\n newEcProperties = response.property?.ecProperties ?? [];\n\n let keys = Array.from(classToPropertiesMapping.keys()).reverse();\n for (const ecProperty of newEcProperties) {\n keys = keys.filter(\n (key) =>\n `${ecProperty.ecSchemaName}:${ecProperty.ecClassName}` !== key\n );\n }\n\n newEcProperties.push(\n ...keys.map((key) => ({\n ecSchemaName: key.split(\":\")[0],\n ecClassName: key.split(\":\")[1],\n // Placeholders for properties\n ecPropertyName: \"\",\n ecPropertyType: \"\",\n }))\n );\n\n setPropertyName(response.property?.propertyName ?? \"\");\n setDataType(response.property?.dataType ?? \"\");\n setQuantityType(response.property?.quantityType ?? \"\");\n } else {\n newEcProperties = Array.from(classToPropertiesMapping)\n .map(([key]) => ({\n ecSchemaName: key.split(\":\")[0],\n ecClassName: key.split(\":\")[1],\n // Placeholders for properties\n ecPropertyName: \"\",\n ecPropertyType: \"\",\n }))\n .reverse();\n }\n\n setEcProperties(newEcProperties);\n\n setIsLoading(false);\n };\n void getContent();\n }, [apiContext.accessToken, apiContext.prefix, groupId, groupPropertyId, iModelConnection, iModelId, keySet, mappingId]);\n\n const onSave = async () => {\n const filteredEcProperties = ecProperties.filter(\n (ecProperty) => ecProperty.ecPropertyName && ecProperty.ecPropertyType\n );\n if (!filteredEcProperties?.length || !validator.allValid()) {\n showValidationMessage(true);\n if (!filteredEcProperties?.length) {\n setPropertyAlert(true);\n }\n return;\n }\n try {\n setIsLoading(true);\n const groupProperty: GroupPropertyCreate = {\n propertyName,\n dataType,\n quantityType,\n ecProperties: filteredEcProperties,\n };\n const reportingClientApi = new ReportingClient(apiContext.prefix);\n groupPropertyId\n ? await reportingClientApi.updateGroupProperty(\n apiContext.accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupProperty\n )\n : await reportingClientApi.createGroupProperty(\n apiContext.accessToken,\n iModelId,\n mappingId,\n groupId,\n groupProperty\n );\n await returnFn();\n } catch (error: any) {\n handleError(error.status);\n setIsLoading(false);\n }\n };\n\n const onChange = useCallback((value: string, index: number) => {\n setPropertyAlert(false);\n const property = JSON.parse(value);\n setEcProperties((ecProperties) => {\n const updatedEcProperties = [...ecProperties];\n updatedEcProperties[index].ecPropertyName = property.name;\n\n // Unique types\n let type = \"\";\n switch (property.type) {\n case \"long\":\n type = \"integer\";\n break;\n default:\n type = property.type;\n }\n\n updatedEcProperties[index].ecPropertyType = type;\n return updatedEcProperties;\n });\n }, []);\n\n const propertyOptions = useMemo(() => {\n return ecProperties.map(\n (ecProperty: ECProperty) =>\n classToPropertiesMapping\n ?.get(`${ecProperty.ecSchemaName}:${ecProperty.ecClassName}`)\n ?.map((property) => ({\n value: JSON.stringify({\n name: property.name,\n type: property.type,\n }),\n label: property.label,\n })) ?? []\n );\n }, [classToPropertiesMapping, ecProperties]);\n\n const getValue = useCallback(\n (ecProperty: ECProperty, index: number) => {\n const property = classToPropertiesMapping\n ?.get(`${ecProperty.ecSchemaName}:${ecProperty.ecClassName}`)\n ?.find(\n (property) => property.name === ecProperties[index].ecPropertyName\n );\n const result = JSON.stringify({\n name: property?.name,\n type: property?.type,\n });\n return result;\n },\n [classToPropertiesMapping, ecProperties]\n );\n\n return (\n <>\n <WidgetHeader\n title={groupPropertyName ?? \"Add Property\"}\n returnFn={returnFn}\n />\n <div className='group-property-action-container'>\n <Fieldset className='property-options' legend='Property Details'>\n <Small className='field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='propertyName'\n label='Property Name'\n value={propertyName}\n required\n disabled={isLoading}\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"propertyName\");\n }}\n message={validator.message(\n \"propertyName\",\n propertyName,\n NAME_REQUIREMENTS\n )}\n status={\n validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"propertyName\");\n }}\n />\n <LabeledSelect<string>\n label={\"Data Type\"}\n id='dataType'\n disabled={isLoading}\n options={[\n { value: \"Boolean\", label: \"Boolean\" },\n { value: \"Number\", label: \"Number\" },\n { value: \"String\", label: \"String\" },\n ]}\n required\n value={dataType}\n onChange={(value) => {\n validator.showMessageFor(\"dataType\");\n setDataType(value);\n }}\n message={validator.message(\"dataType\", propertyName, \"required\")}\n status={\n validator.message(\"dataType\", propertyName, \"required\")\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"dataType\");\n }}\n onShow={() => { }}\n onHide={() => { }}\n />\n <LabeledSelect<string>\n label='Quantity Type'\n disabled={isLoading}\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => { }}\n onHide={() => { }}\n />\n </Fieldset>\n <Fieldset className='property-selection-container' legend='Properties'>\n {propertyAlert && (\n <Alert type={\"negative\"}>\n Please select at least one property.\n </Alert>\n )}\n {isLoading &&\n Array(3)\n .fill(null)\n .map((_, index) => (\n <Text key={index} variant='headline' isSkeleton>\n LOADING SKELETON\n </Text>\n ))}\n {ecProperties?.map((ecProperty, index) => {\n return (\n <div\n className='property-select-item'\n key={`${ecProperty.ecSchemaName}${ecProperty.ecClassName}`}\n >\n <Text variant='leading'>{ecProperty.ecClassName}</Text>\n <Text isMuted variant='small'>\n {ecProperty.ecSchemaName}\n </Text>\n\n <div className='selection-and-reorder'>\n <ComboBox<string>\n options={propertyOptions[index]}\n value={getValue(ecProperty, index)}\n onChange={(value) => onChange(value, index)}\n inputProps={{\n placeholder: \"<No Property Mapped>\",\n }}\n style={{ width: \"100%\" }}\n />\n <IconButton\n onClick={() => {\n const updatedEcPropertyList = [...ecProperties];\n updatedEcPropertyList[index] = {\n ...updatedEcPropertyList[index],\n ecPropertyName: \"\",\n ecPropertyType: \"\",\n };\n setEcProperties(updatedEcPropertyList);\n }}\n disabled={\n !ecProperty.ecPropertyName && !ecProperty.ecPropertyType\n }\n >\n <SvgRemove />\n </IconButton>\n <IconButton\n onClick={() => {\n const tab = [...ecProperties];\n const item = tab.splice(index, 1);\n tab.splice(index - 1, 0, item[0]);\n setEcProperties(tab);\n }}\n disabled={index === 0}\n >\n <SvgChevronUp />\n </IconButton>\n <IconButton\n onClick={() => {\n const tab = [...ecProperties];\n const item = tab.splice(index, 1);\n tab.splice(index + 1, 0, item[0]);\n setEcProperties(tab);\n }}\n disabled={index === ecProperties.length - 1}\n >\n <SvgChevronDown />\n </IconButton>\n </div>\n </div>\n );\n })}\n </Fieldset>\n </div>\n {/* TODO: Disable when no properties are selected. Will do when I rework property selection. */}\n <ActionPanel onSave={onSave} onCancel={returnFn} isLoading={isLoading} />\n </>\n );\n};\n\nexport default GroupPropertyAction;\n"]}
1
+ {"version":3,"file":"GroupPropertyAction.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyAction.tsx"],"names":[],"mappings":"AAeA,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,GACV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACL,cAAc,EACd,YAAY,EACZ,SAAS,GACV,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,aAAa,EACb,KAAK,EACL,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,EAAE,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAY/C,MAAM,CAAC,MAAM,6BAA6B,GAA2B;IACnE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;IAChC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACxC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;IAChC,EAAE,KAAK,EAAE,UAAU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EACD,QAAQ,EACN,CAAC,UAAU,CAAC,cAAc,IAAI,CAAC,UAAU,CAAC,cAAc;gCAG1D,oBAAC,SAAS,OAAG,CACF;4BACb,oBAAC,UAAU,IACT,OAAO,EAAE,GAAG,EAAE;oCACZ,MAAM,GAAG,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;oCAC9B,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;oCAClC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;oCAClC,eAAe,CAAC,GAAG,CAAC,CAAC;gCACvB,CAAC,EACD,QAAQ,EAAE,KAAK,KAAK,CAAC;gCAErB,oBAAC,YAAY,OAAG,CACL;4BACb,oBAAC,UAAU,IACT,OAAO,EAAE,GAAG,EAAE;oCACZ,MAAM,GAAG,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;oCAC9B,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;oCAClC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;oCAClC,eAAe,CAAC,GAAG,CAAC,CAAC;gCACvB,CAAC,EACD,QAAQ,EAAE,KAAK,KAAK,YAAY,CAAC,MAAM,GAAG,CAAC;gCAE3C,oBAAC,cAAc,OAAG,CACP,CACT,CACF,CACP,CAAC;gBACJ,CAAC,CAAC,CACO,CACP;QAEN,oBAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,SAAS,GAAI,CAC3F,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,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 ContentDescriptorRequestOptions,\n Field,\n KeySet,\n NestedContentField,\n PropertiesField,\n Ruleset,\n RulesetVariable,\n StructFieldMemberDescription,\n} from \"@itwin/presentation-common\";\nimport {\n ContentSpecificationTypes,\n DefaultContentDisplayTypes,\n PropertyValueFormat,\n RelationshipMeaning,\n RuleTypes,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport {\n SvgChevronDown,\n SvgChevronUp,\n SvgRemove,\n} from \"@itwin/itwinui-icons-react\";\nimport type {\n SelectOption,\n} from \"@itwin/itwinui-react\";\nimport {\n Alert,\n ComboBox,\n Fieldset,\n IconButton,\n LabeledInput,\n LabeledSelect,\n Small,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useContext, useEffect, useMemo, useState } from \"react\";\n\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { getReportingClient, handleError, WidgetHeader } from \"./utils\";\nimport \"./GroupPropertyAction.scss\";\nimport type { ECProperty, GroupPropertyCreate } from \"@itwin/insights-client\";\nimport { ApiContext } from \"./GroupingMapping\";\n\ninterface GroupPropertyActionProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n groupPropertyId?: string;\n groupPropertyName?: string;\n keySet: KeySet;\n returnFn: (modified: boolean) => Promise<void>;\n}\n\nexport const quantityTypesSelectionOptions: SelectOption<string>[] = [\n { value: \"Area\", label: \"Area\" },\n { value: \"Distance\", label: \"Distance\" },\n { value: \"Force\", label: \"Force\" },\n { value: \"Mass\", label: \"Mass\" },\n { value: \"Monetary\", label: \"Monetary\" },\n { value: \"Time\", label: \"Time\" },\n { value: \"Volume\", label: \"Volume\" },\n { value: \"Undefined\", label: \"No Quantity Type\" },\n];\ninterface Property {\n name: string;\n label: string;\n type: string;\n}\n\ninterface NavigationProperty {\n navigationName: string;\n rootClassName: string;\n}\n\nconst extractPrimitive = (\n propertiesField: PropertiesField,\n classToPropertiesMapping: Map<string, Property[]>,\n navigation?: NavigationProperty\n) => {\n // There are rare cases which only happens in multiple selections where it returns more than one.\n // This also checks if this property comes from a navigation property\n const className =\n navigation?.rootClassName ??\n propertiesField.properties[0].property.classInfo.name;\n // Sometimes class names are not defined. Type error. Not guaranteed.\n if (!className) {\n return;\n }\n\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n // Gets property name. Appends path if from navigation.\n const propertyName = navigation\n ? `${navigation.navigationName}.${propertiesField.properties[0].property.name}`\n : propertiesField.properties[0].property.name;\n\n const label = navigation\n ? `${propertiesField.label} (${navigation?.navigationName})`\n : propertiesField.label;\n\n // Ignore hardcoded BisCore navigation properties\n if (propertiesField.type.typeName === \"navigation\") {\n return;\n } else {\n classToPropertiesMapping.get(className)?.push({\n name: propertyName,\n label,\n type: propertiesField.properties[0].property.type,\n });\n }\n};\n\nconst extractStructProperties = (\n name: string,\n className: string,\n classToPropertiesMapping: Map<string, Property[]>,\n members: StructFieldMemberDescription[]\n) => {\n for (const member of members) {\n if (member.type.valueFormat === PropertyValueFormat.Primitive) {\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n classToPropertiesMapping.get(className)?.push({\n name: `${name}.${member.name}`,\n label: member.label,\n type: member.type.typeName,\n });\n } else if (member.type.valueFormat === PropertyValueFormat.Struct) {\n extractStructProperties(\n `${name}.${member.name}`,\n className,\n classToPropertiesMapping,\n member.type.members\n );\n }\n }\n};\n\nconst extractProperties = (\n properties: Field[],\n classToPropertiesMapping: Map<string, Property[]>,\n navigation?: NavigationProperty\n) => {\n for (const property of properties) {\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n extractPrimitive(\n property as PropertiesField,\n classToPropertiesMapping,\n navigation\n );\n break;\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n break;\n }\n\n switch (nestedContentField.relationshipMeaning) {\n case RelationshipMeaning.SameInstance: {\n // Check for aspects. Ignore them if coming from navigation.\n if (\n !navigation &&\n (nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsUniqueAspect\" ||\n nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsMultiAspects\")\n ) {\n const className = nestedContentField.contentClassInfo.name;\n if (!classToPropertiesMapping.has(className)) {\n classToPropertiesMapping.set(className, []);\n }\n\n extractProperties(\n nestedContentField.nestedFields,\n classToPropertiesMapping,\n navigation\n );\n }\n\n break;\n }\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n const className =\n nestedContentField.pathToPrimaryClass[0].targetClassInfo.name;\n extractProperties(\n nestedContentField.nestedFields,\n classToPropertiesMapping,\n {\n navigationName: \"TypeDefinition\",\n rootClassName: className,\n }\n );\n // Hardcoded BisCore navigation properties for the type definition.\n classToPropertiesMapping.get(className)?.push({\n name: \"TypeDefinition.Model.ModeledElement.UserLabel\",\n label: \"Model UserLabel (TypeDefinition)\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(className)?.push({\n name: \"TypeDefinition.Model.ModeledElement.CodeValue\",\n label: \"Model CodeValue (TypeDefinition)\",\n type: \"string\",\n });\n\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n const columnName = (property as PropertiesField).properties[0]\n .property.name;\n const className = (property as PropertiesField).properties[0]\n .property.classInfo.name;\n extractStructProperties(\n navigation\n ? `${navigation.navigationName}.${columnName}`\n : columnName,\n navigation ? navigation.rootClassName : className,\n classToPropertiesMapping,\n property.type.members\n );\n\n }\n }\n }\n }\n }\n }\n};\n\nconst GroupPropertyAction = ({\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupPropertyName,\n keySet,\n returnFn,\n}: GroupPropertyActionProps) => {\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const apiContext = useContext(ApiContext);\n const [propertyName, setPropertyName] = useState<string>(\"\");\n const [dataType, setDataType] = useState<string | undefined>();\n const [quantityType, setQuantityType] = useState<string>(\"Undefined\");\n const [classToPropertiesMapping, setClassToPropertiesMapping] =\n useState<Map<string, Property[]>>();\n const [ecProperties, setEcProperties] = useState<ECProperty[]>(\n []\n );\n const [validator, showValidationMessage] = useValidator();\n const [propertyAlert, setPropertyAlert] = useState<boolean>(false);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n useEffect(() => {\n const getContent = async () => {\n setIsLoading(true);\n const ruleSet: Ruleset = {\n id: \"element-properties\",\n rules: [\n {\n ruleType: RuleTypes.Content,\n specifications: [\n {\n specType: ContentSpecificationTypes.SelectedNodeInstances,\n },\n ],\n }],\n };\n const requestOptions: ContentDescriptorRequestOptions<\n IModelConnection,\n KeySet,\n RulesetVariable\n > = {\n imodel: iModelConnection,\n keys: keySet,\n rulesetOrId: ruleSet,\n displayType: DefaultContentDisplayTypes.PropertyPane,\n };\n const content = await Presentation.presentation.getContentDescriptor(\n requestOptions\n );\n\n // Only primitives and structs for now\n const properties =\n content?.fields.filter(\n (field) =>\n field.type.valueFormat === PropertyValueFormat.Primitive ||\n field.type.valueFormat === PropertyValueFormat.Struct\n ) ?? [];\n\n // Map properties to their classes\n const classToPropertiesMapping = new Map<string, Property[]>();\n\n extractProperties(properties, classToPropertiesMapping);\n\n const rootClassName = keySet.instanceKeys.keys().next().value;\n\n // Hardcoded BisCore navigation properties.\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Model.ModeledElement.UserLabel\",\n label: \"Model UserLabel\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Model.ModeledElement.CodeValue\",\n label: \"Model CodeValue\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Category.CodeValue\",\n label: \"Category CodeValue\",\n type: \"string\",\n });\n\n classToPropertiesMapping.get(rootClassName)?.push({\n name: \"Category.UserLabel\",\n label: \"Category UserLabel\",\n type: \"string\",\n });\n\n setClassToPropertiesMapping(classToPropertiesMapping);\n\n let newEcProperties: ECProperty[];\n const reportingClientApi = getReportingClient(apiContext.prefix);\n // Fetch already existing ec properties then add all classes from presentation\n if (groupPropertyId) {\n // TODO Error handling\n const response = await reportingClientApi.getGroupProperty(\n apiContext.accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId\n );\n newEcProperties = response.property?.ecProperties ?? [];\n\n let keys = Array.from(classToPropertiesMapping.keys()).reverse();\n for (const ecProperty of newEcProperties) {\n keys = keys.filter(\n (key) =>\n `${ecProperty.ecSchemaName}:${ecProperty.ecClassName}` !== key\n );\n }\n\n newEcProperties.push(\n ...keys.map((key) => ({\n ecSchemaName: key.split(\":\")[0],\n ecClassName: key.split(\":\")[1],\n // Placeholders for properties\n ecPropertyName: \"\",\n ecPropertyType: \"\",\n }))\n );\n\n setPropertyName(response.property?.propertyName ?? \"\");\n setDataType(response.property?.dataType ?? \"\");\n setQuantityType(response.property?.quantityType ?? \"\");\n } else {\n newEcProperties = Array.from(classToPropertiesMapping)\n .map(([key]) => ({\n ecSchemaName: key.split(\":\")[0],\n ecClassName: key.split(\":\")[1],\n // Placeholders for properties\n ecPropertyName: \"\",\n ecPropertyType: \"\",\n }))\n .reverse();\n }\n\n setEcProperties(newEcProperties);\n\n setIsLoading(false);\n };\n void getContent();\n }, [apiContext.accessToken, apiContext.prefix, groupId, groupPropertyId, iModelConnection, iModelId, keySet, mappingId]);\n\n const onSave = async () => {\n const filteredEcProperties = ecProperties.filter(\n (ecProperty) => ecProperty.ecPropertyName && ecProperty.ecPropertyType\n );\n if (!filteredEcProperties?.length || !validator.allValid()) {\n showValidationMessage(true);\n if (!filteredEcProperties?.length) {\n setPropertyAlert(true);\n }\n return;\n }\n try {\n setIsLoading(true);\n const groupProperty: GroupPropertyCreate = {\n propertyName,\n dataType,\n quantityType,\n ecProperties: filteredEcProperties,\n };\n const reportingClientApi = getReportingClient(apiContext.prefix);\n groupPropertyId\n ? await reportingClientApi.updateGroupProperty(\n apiContext.accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupProperty\n )\n : await reportingClientApi.createGroupProperty(\n apiContext.accessToken,\n iModelId,\n mappingId,\n groupId,\n groupProperty\n );\n await returnFn(true);\n } catch (error: any) {\n handleError(error.status);\n setIsLoading(false);\n }\n };\n\n const onChange = useCallback((value: string, index: number) => {\n setPropertyAlert(false);\n const property = JSON.parse(value);\n setEcProperties((ecProperties) => {\n const updatedEcProperties = [...ecProperties];\n updatedEcProperties[index].ecPropertyName = property.name;\n\n // Unique types\n let type = \"\";\n switch (property.type) {\n case \"long\":\n type = \"integer\";\n break;\n default:\n type = property.type;\n }\n\n updatedEcProperties[index].ecPropertyType = type;\n return updatedEcProperties;\n });\n }, []);\n\n const propertyOptions = useMemo(() => {\n return ecProperties.map(\n (ecProperty: ECProperty) =>\n classToPropertiesMapping\n ?.get(`${ecProperty.ecSchemaName}:${ecProperty.ecClassName}`)\n ?.map((property) => ({\n value: JSON.stringify({\n name: property.name,\n type: property.type,\n }),\n label: property.label,\n })) ?? []\n );\n }, [classToPropertiesMapping, ecProperties]);\n\n const getValue = useCallback(\n (ecProperty: ECProperty, index: number) => {\n const property = classToPropertiesMapping\n ?.get(`${ecProperty.ecSchemaName}:${ecProperty.ecClassName}`)\n ?.find(\n (property) => property.name === ecProperties[index].ecPropertyName\n );\n const result = JSON.stringify({\n name: property?.name,\n type: property?.type,\n });\n return result;\n },\n [classToPropertiesMapping, ecProperties]\n );\n\n return (\n <>\n <WidgetHeader\n title={groupPropertyName ?? \"Add Property\"}\n returnFn={async () => returnFn(false)}\n />\n <div className='group-property-action-container'>\n <Fieldset className='property-options' legend='Property Details'>\n <Small className='field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='propertyName'\n label='Property Name'\n value={propertyName}\n required\n disabled={isLoading}\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"propertyName\");\n }}\n message={validator.message(\n \"propertyName\",\n propertyName,\n NAME_REQUIREMENTS\n )}\n status={\n validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"propertyName\");\n }}\n />\n <LabeledSelect<string>\n label={\"Data Type\"}\n id='dataType'\n disabled={isLoading}\n options={[\n { value: \"Boolean\", label: \"Boolean\" },\n { value: \"Number\", label: \"Number\" },\n { value: \"String\", label: \"String\" },\n ]}\n required\n value={dataType}\n onChange={(value) => {\n validator.showMessageFor(\"dataType\");\n setDataType(value);\n }}\n message={validator.message(\"dataType\", propertyName, \"required\")}\n status={\n validator.message(\"dataType\", propertyName, \"required\")\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"dataType\");\n }}\n onShow={() => { }}\n onHide={() => { }}\n />\n <LabeledSelect<string>\n label='Quantity Type'\n disabled={isLoading}\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => { }}\n onHide={() => { }}\n />\n </Fieldset>\n <Fieldset className='property-selection-container' legend='Properties'>\n {propertyAlert && (\n <Alert type={\"negative\"}>\n Please select at least one property.\n </Alert>\n )}\n {isLoading &&\n Array(3)\n .fill(null)\n .map((_, index) => (\n <Text key={index} variant='headline' isSkeleton>\n LOADING SKELETON\n </Text>\n ))}\n {ecProperties?.map((ecProperty, index) => {\n return (\n <div\n className='property-select-item'\n key={`${ecProperty.ecSchemaName}${ecProperty.ecClassName}`}\n >\n <Text variant='leading'>{ecProperty.ecClassName}</Text>\n <Text isMuted variant='small'>\n {ecProperty.ecSchemaName}\n </Text>\n\n <div className='selection-and-reorder'>\n <ComboBox<string>\n options={propertyOptions[index]}\n value={getValue(ecProperty, index)}\n onChange={(value) => onChange(value, index)}\n inputProps={{\n placeholder: \"<No Property Mapped>\",\n }}\n style={{ width: \"100%\" }}\n />\n <IconButton\n onClick={() => {\n const updatedEcPropertyList = [...ecProperties];\n updatedEcPropertyList[index] = {\n ...updatedEcPropertyList[index],\n ecPropertyName: \"\",\n ecPropertyType: \"\",\n };\n setEcProperties(updatedEcPropertyList);\n }}\n disabled={\n !ecProperty.ecPropertyName && !ecProperty.ecPropertyType\n }\n >\n <SvgRemove />\n </IconButton>\n <IconButton\n onClick={() => {\n const tab = [...ecProperties];\n const item = tab.splice(index, 1);\n tab.splice(index - 1, 0, item[0]);\n setEcProperties(tab);\n }}\n disabled={index === 0}\n >\n <SvgChevronUp />\n </IconButton>\n <IconButton\n onClick={() => {\n const tab = [...ecProperties];\n const item = tab.splice(index, 1);\n tab.splice(index + 1, 0, item[0]);\n setEcProperties(tab);\n }}\n disabled={index === ecProperties.length - 1}\n >\n <SvgChevronDown />\n </IconButton>\n </div>\n </div>\n );\n })}\n </Fieldset>\n </div>\n {/* TODO: Disable when no properties are selected. Will do when I rework property selection. */}\n <ActionPanel onSave={onSave} onCancel={async () => returnFn(false)} isLoading={isLoading} />\n </>\n );\n};\n\nexport default GroupPropertyAction;\n"]}
@@ -8,11 +8,14 @@ interface GroupPropertyTableProps {
8
8
  iModelId: string;
9
9
  mappingId: string;
10
10
  groupId: string;
11
- setSelectedGroupProperty: React.Dispatch<React.SetStateAction<CreateTypeFromInterface<GroupProperty> | undefined>>;
11
+ setSelectedGroupProperty: React.Dispatch<React.SetStateAction<CreateTypeFromInterface<GroupPropertyType> | undefined>>;
12
12
  setGroupModifyView: React.Dispatch<React.SetStateAction<PropertyMenuView>>;
13
13
  onGroupPropertyModify: (value: CellProps<GroupPropertyType>) => void;
14
+ isLoadingGroupProperties: boolean;
15
+ groupProperties: GroupPropertyType[];
16
+ refreshGroupProperties: () => Promise<void>;
14
17
  selectedGroupProperty?: GroupPropertyType;
15
18
  }
16
- declare const GroupPropertyTable: ({ iModelId, mappingId, groupId, selectedGroupProperty, onGroupPropertyModify, setSelectedGroupProperty, setGroupModifyView, }: GroupPropertyTableProps) => JSX.Element;
19
+ declare const GroupPropertyTable: ({ iModelId, mappingId, groupId, selectedGroupProperty, onGroupPropertyModify, setSelectedGroupProperty, isLoadingGroupProperties, groupProperties, refreshGroupProperties, setGroupModifyView, }: GroupPropertyTableProps) => JSX.Element;
17
20
  export default GroupPropertyTable;
18
21
  //# sourceMappingURL=GroupPropertyTable.d.ts.map
@@ -4,39 +4,15 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import { SvgAdd, SvgDelete, SvgEdit, SvgMore, } from "@itwin/itwinui-icons-react";
6
6
  import { Button, DropdownMenu, IconButton, MenuItem, Table, } from "@itwin/itwinui-react";
7
- import React, { useCallback, useContext, useEffect, useMemo, useState } from "react";
7
+ import React, { useContext, useMemo, useState } from "react";
8
8
  import DeleteModal from "./DeleteModal";
9
9
  import { PropertyMenuView } from "./PropertyMenu";
10
- import { handleError } from "./utils";
11
- import { ReportingClient } from "@itwin/insights-client";
12
10
  import { ApiContext } from "./GroupingMapping";
13
- const fetchGroupProperties = async (setGroupProperties, iModelId, mappingId, groupId, setIsLoading, apiContext) => {
14
- try {
15
- setIsLoading(true);
16
- const reportingClientApi = new ReportingClient(apiContext.prefix);
17
- const groupProperties = await reportingClientApi.getGroupProperties(apiContext.accessToken, iModelId, mappingId, groupId);
18
- setGroupProperties(groupProperties);
19
- }
20
- catch (error) {
21
- handleError(error.status);
22
- }
23
- finally {
24
- setIsLoading(false);
25
- }
26
- };
27
- const GroupPropertyTable = ({ iModelId, mappingId, groupId, selectedGroupProperty, onGroupPropertyModify, setSelectedGroupProperty, setGroupModifyView, }) => {
11
+ import { getReportingClient } from "./utils";
12
+ const GroupPropertyTable = ({ iModelId, mappingId, groupId, selectedGroupProperty, onGroupPropertyModify, setSelectedGroupProperty, isLoadingGroupProperties, groupProperties, refreshGroupProperties, setGroupModifyView, }) => {
28
13
  var _a;
29
14
  const apiContext = useContext(ApiContext);
30
- const [isLoading, setIsLoading] = useState(true);
31
15
  const [showGroupPropertyDeleteModal, setShowGroupPropertyDeleteModal] = useState(false);
32
- const [groupProperties, setGroupProperties] = useState([]);
33
- useEffect(() => {
34
- void fetchGroupProperties(setGroupProperties, iModelId, mappingId, groupId, setIsLoading, apiContext);
35
- }, [apiContext, groupId, iModelId, mappingId, setIsLoading]);
36
- const refresh = useCallback(async () => {
37
- setGroupProperties([]);
38
- await fetchGroupProperties(setGroupProperties, iModelId, mappingId, groupId, setIsLoading, apiContext);
39
- }, [apiContext, groupId, iModelId, mappingId, setGroupProperties]);
40
16
  const groupPropertiesColumns = useMemo(() => [
41
17
  {
42
18
  Header: "Table",
@@ -74,12 +50,12 @@ const GroupPropertyTable = ({ iModelId, mappingId, groupId, selectedGroupPropert
74
50
  React.createElement(Button, { startIcon: React.createElement(SvgAdd, null), styleType: 'high-visibility', onClick: () => {
75
51
  setGroupModifyView(PropertyMenuView.ADD_GROUP_PROPERTY);
76
52
  } }, "Add Property"),
77
- React.createElement(Table, { data: groupProperties, density: 'extra-condensed', columns: groupPropertiesColumns, emptyTableContent: 'No Group Properties', isSortable: true, isLoading: isLoading }),
53
+ React.createElement(Table, { data: groupProperties, density: 'extra-condensed', columns: groupPropertiesColumns, emptyTableContent: 'No Group Properties', isSortable: true, isLoading: isLoadingGroupProperties }),
78
54
  React.createElement(DeleteModal, { entityName: (_a = selectedGroupProperty === null || selectedGroupProperty === void 0 ? void 0 : selectedGroupProperty.propertyName) !== null && _a !== void 0 ? _a : "", show: showGroupPropertyDeleteModal, setShow: setShowGroupPropertyDeleteModal, onDelete: async () => {
79
55
  var _a;
80
- const reportingClientApi = new ReportingClient(apiContext.prefix);
56
+ const reportingClientApi = getReportingClient(apiContext.prefix);
81
57
  await reportingClientApi.deleteGroupProperty(apiContext.accessToken, iModelId, mappingId, groupId, (_a = selectedGroupProperty === null || selectedGroupProperty === void 0 ? void 0 : selectedGroupProperty.id) !== null && _a !== void 0 ? _a : "");
82
- }, refresh: refresh })));
58
+ }, refresh: refreshGroupProperties })));
83
59
  };
84
60
  export default GroupPropertyTable;
85
61
  //# sourceMappingURL=GroupPropertyTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GroupPropertyTable.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyTable.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EACL,MAAM,EACN,SAAS,EACT,OAAO,EACP,OAAO,GACR,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,KAAK,GACN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGrF,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,MAAM,oBAAoB,GAAG,KAAK,EAChC,kBAA6E,EAC7E,QAAgB,EAChB,SAAiB,EACjB,OAAe,EACf,YAA2D,EAC3D,UAAe,EACf,EAAE;IACF,IAAI;QACF,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,kBAAkB,GAAG,IAAI,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAClE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,CAAC;iBACF;aACF;SACF;KACF,EACD,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,CAClD,CAAC;IAEF,OAAO,CACL;QACE,oBAAC,MAAM,IACL,SAAS,EAAE,oBAAC,MAAM,OAAG,EACrB,SAAS,EAAC,iBAAiB,EAC3B,OAAO,EAAE,GAAG,EAAE;gBACZ,kBAAkB,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;YAC1D,CAAC,mBAGM;QACT,oBAAC,KAAK,IACJ,IAAI,EAAE,eAAe,EACrB,OAAO,EAAC,iBAAiB,EACzB,OAAO,EAAE,sBAAsB,EAC/B,iBAAiB,EAAC,qBAAqB,EACvC,UAAU,QACV,SAAS,EAAE,SAAS,GACpB;QACF,oBAAC,WAAW,IACV,UAAU,EAAE,MAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,YAAY,mCAAI,EAAE,EACrD,IAAI,EAAE,4BAA4B,EAClC,OAAO,EAAE,+BAA+B,EACxC,QAAQ,EAAE,KAAK,IAAI,EAAE;;gBACnB,MAAM,kBAAkB,GAAG,IAAI,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;gBAClE,MAAM,kBAAkB,CAAC,mBAAmB,CAC1C,UAAU,CAAC,WAAW,EACtB,QAAQ,EACR,SAAS,EACT,OAAO,EACP,MAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,EAAE,mCAAI,EAAE,CAChC,CAAC;YACJ,CAAC,EACD,OAAO,EAAE,OAAO,GAChB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,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 {\n SvgAdd,\n SvgDelete,\n SvgEdit,\n SvgMore,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n Button,\n DropdownMenu,\n IconButton,\n MenuItem,\n Table,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useContext, useEffect, useMemo, useState } from \"react\";\nimport type { CreateTypeFromInterface } from \"../utils\";\nimport type { CellProps } from \"react-table\";\nimport DeleteModal from \"./DeleteModal\";\nimport { PropertyMenuView } from \"./PropertyMenu\";\nimport { handleError } from \"./utils\";\nimport type { GroupProperty } from \"@itwin/insights-client\";\nimport { ReportingClient } from \"@itwin/insights-client\";\nimport type { Api } from \"./GroupingMapping\";\nimport { ApiContext } from \"./GroupingMapping\";\n\nexport type GroupPropertyType = CreateTypeFromInterface<GroupProperty>;\n\nconst fetchGroupProperties = async (\n setGroupProperties: React.Dispatch<React.SetStateAction<GroupPropertyType[]>>,\n iModelId: string,\n mappingId: string,\n groupId: string,\n setIsLoading: React.Dispatch<React.SetStateAction<boolean>>,\n apiContext: Api\n) => {\n try {\n setIsLoading(true);\n const reportingClientApi = new ReportingClient(apiContext.prefix);\n const groupProperties = await reportingClientApi.getGroupProperties(\n apiContext.accessToken,\n iModelId,\n mappingId,\n groupId,\n );\n setGroupProperties(groupProperties);\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n};\n\ninterface GroupPropertyTableProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n\n setSelectedGroupProperty: React.Dispatch<\n React.SetStateAction<\n CreateTypeFromInterface<GroupProperty> | undefined\n >\n >;\n setGroupModifyView: React.Dispatch<React.SetStateAction<PropertyMenuView>>;\n onGroupPropertyModify: (value: CellProps<GroupPropertyType>) => void;\n selectedGroupProperty?: GroupPropertyType;\n}\n\nconst GroupPropertyTable = ({\n iModelId,\n mappingId,\n groupId,\n selectedGroupProperty,\n onGroupPropertyModify,\n setSelectedGroupProperty,\n setGroupModifyView,\n}: GroupPropertyTableProps) => {\n const apiContext = useContext(ApiContext);\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [showGroupPropertyDeleteModal, setShowGroupPropertyDeleteModal] =\n useState<boolean>(false);\n const [groupProperties, setGroupProperties] = useState<GroupPropertyType[]>([]);\n\n useEffect(() => {\n void fetchGroupProperties(\n setGroupProperties,\n iModelId,\n mappingId,\n groupId,\n setIsLoading,\n apiContext\n );\n }, [apiContext, groupId, iModelId, mappingId, setIsLoading]);\n\n const refresh = useCallback(async () => {\n setGroupProperties([]);\n await fetchGroupProperties(\n setGroupProperties,\n iModelId,\n mappingId,\n groupId,\n setIsLoading,\n apiContext\n );\n }, [apiContext, groupId, iModelId, mappingId, setGroupProperties]);\n\n const groupPropertiesColumns = useMemo(\n () => [\n {\n Header: \"Table\",\n columns: [\n {\n id: \"propertyName\",\n Header: \"Property\",\n accessor: \"propertyName\",\n Cell: (value: CellProps<GroupPropertyType>) => (\n <div\n className='iui-anchor'\n onClick={() => onGroupPropertyModify(value)}\n >\n {value.row.original.propertyName}\n </div>\n ),\n },\n {\n id: \"dropdown\",\n Header: \"\",\n width: 80,\n Cell: (value: CellProps<GroupPropertyType>) => {\n return (\n <DropdownMenu\n menuItems={(close: () => void) => [\n <MenuItem\n key={0}\n onClick={() => onGroupPropertyModify(value)}\n icon={<SvgEdit />}\n >\n Modify\n </MenuItem>,\n <MenuItem\n key={1}\n onClick={() => {\n setSelectedGroupProperty(value.row.original);\n setShowGroupPropertyDeleteModal(true);\n close();\n }}\n icon={<SvgDelete />}\n >\n Remove\n </MenuItem>,\n ]}\n >\n <IconButton styleType='borderless'>\n <SvgMore\n style={{\n width: \"16px\",\n height: \"16px\",\n }}\n />\n </IconButton>\n </DropdownMenu>\n );\n },\n },\n ],\n },\n ],\n [onGroupPropertyModify, setSelectedGroupProperty],\n );\n\n return (\n <>\n <Button\n startIcon={<SvgAdd />}\n styleType='high-visibility'\n onClick={() => {\n setGroupModifyView(PropertyMenuView.ADD_GROUP_PROPERTY);\n }}\n >\n Add Property\n </Button>\n <Table<GroupPropertyType>\n data={groupProperties}\n density='extra-condensed'\n columns={groupPropertiesColumns}\n emptyTableContent='No Group Properties'\n isSortable\n isLoading={isLoading}\n />\n <DeleteModal\n entityName={selectedGroupProperty?.propertyName ?? \"\"}\n show={showGroupPropertyDeleteModal}\n setShow={setShowGroupPropertyDeleteModal}\n onDelete={async () => {\n const reportingClientApi = new ReportingClient(apiContext.prefix);\n await reportingClientApi.deleteGroupProperty(\n apiContext.accessToken,\n iModelId,\n mappingId,\n groupId,\n selectedGroupProperty?.id ?? \"\",\n );\n }}\n refresh={refresh}\n />\n </>\n );\n};\n\nexport default GroupPropertyTable;\n"]}
1
+ {"version":3,"file":"GroupPropertyTable.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyTable.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EACL,MAAM,EACN,SAAS,EACT,OAAO,EACP,OAAO,GACR,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,KAAK,GACN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG7D,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAqB7C,MAAM,kBAAkB,GAAG,CAAC,EAC1B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,GACM,EAAE,EAAE;;IAC5B,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IAC1C,MAAM,CAAC,4BAA4B,EAAE,+BAA+B,CAAC,GACnE,QAAQ,CAAU,KAAK,CAAC,CAAC;IAE3B,MAAM,sBAAsB,GAAG,OAAO,CAC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OAAO,CACL;QACE,oBAAC,MAAM,IACL,SAAS,EAAE,oBAAC,MAAM,OAAG,EACrB,SAAS,EAAC,iBAAiB,EAC3B,OAAO,EAAE,GAAG,EAAE;gBACZ,kBAAkB,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;YAC1D,CAAC,mBAGM;QACT,oBAAC,KAAK,IACJ,IAAI,EAAE,eAAe,EACrB,OAAO,EAAC,iBAAiB,EACzB,OAAO,EAAE,sBAAsB,EAC/B,iBAAiB,EAAC,qBAAqB,EACvC,UAAU,QACV,SAAS,EAAE,wBAAwB,GACnC;QACF,oBAAC,WAAW,IACV,UAAU,EAAE,MAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,YAAY,mCAAI,EAAE,EACrD,IAAI,EAAE,4BAA4B,EAClC,OAAO,EAAE,+BAA+B,EACxC,QAAQ,EAAE,KAAK,IAAI,EAAE;;gBACnB,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;gBACjE,MAAM,kBAAkB,CAAC,mBAAmB,CAC1C,UAAU,CAAC,WAAW,EACtB,QAAQ,EACR,SAAS,EACT,OAAO,EACP,MAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,EAAE,mCAAI,EAAE,CAChC,CAAC;YACJ,CAAC,EACD,OAAO,EAAE,sBAAsB,GAC/B,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,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 {\n SvgAdd,\n SvgDelete,\n SvgEdit,\n SvgMore,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n Button,\n DropdownMenu,\n IconButton,\n MenuItem,\n Table,\n} from \"@itwin/itwinui-react\";\nimport React, { useContext, useMemo, useState } from \"react\";\nimport type { CreateTypeFromInterface } from \"../utils\";\nimport type { CellProps } from \"react-table\";\nimport DeleteModal from \"./DeleteModal\";\nimport { PropertyMenuView } from \"./PropertyMenu\";\nimport type { GroupProperty } from \"@itwin/insights-client\";\nimport { ApiContext } from \"./GroupingMapping\";\nimport { getReportingClient } from \"./utils\";\n\nexport type GroupPropertyType = CreateTypeFromInterface<GroupProperty>;\n\ninterface GroupPropertyTableProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n setSelectedGroupProperty: React.Dispatch<\n React.SetStateAction<\n CreateTypeFromInterface<GroupPropertyType> | undefined\n >\n >;\n setGroupModifyView: React.Dispatch<React.SetStateAction<PropertyMenuView>>;\n onGroupPropertyModify: (value: CellProps<GroupPropertyType>) => void;\n isLoadingGroupProperties: boolean;\n groupProperties: GroupPropertyType[];\n refreshGroupProperties: () => Promise<void>;\n selectedGroupProperty?: GroupPropertyType;\n}\n\nconst GroupPropertyTable = ({\n iModelId,\n mappingId,\n groupId,\n selectedGroupProperty,\n onGroupPropertyModify,\n setSelectedGroupProperty,\n isLoadingGroupProperties,\n groupProperties,\n refreshGroupProperties,\n setGroupModifyView,\n}: GroupPropertyTableProps) => {\n const apiContext = useContext(ApiContext);\n const [showGroupPropertyDeleteModal, setShowGroupPropertyDeleteModal] =\n useState<boolean>(false);\n\n const groupPropertiesColumns = useMemo(\n () => [\n {\n Header: \"Table\",\n columns: [\n {\n id: \"propertyName\",\n Header: \"Property\",\n accessor: \"propertyName\",\n Cell: (value: CellProps<GroupPropertyType>) => (\n <div\n className='iui-anchor'\n onClick={() => onGroupPropertyModify(value)}\n >\n {value.row.original.propertyName}\n </div>\n ),\n },\n {\n id: \"dropdown\",\n Header: \"\",\n width: 80,\n Cell: (value: CellProps<GroupPropertyType>) => {\n return (\n <DropdownMenu\n menuItems={(close: () => void) => [\n <MenuItem\n key={0}\n onClick={() => onGroupPropertyModify(value)}\n icon={<SvgEdit />}\n >\n Modify\n </MenuItem>,\n <MenuItem\n key={1}\n onClick={() => {\n setSelectedGroupProperty(value.row.original);\n setShowGroupPropertyDeleteModal(true);\n close();\n }}\n icon={<SvgDelete />}\n >\n Remove\n </MenuItem>,\n ]}\n >\n <IconButton styleType='borderless'>\n <SvgMore\n style={{\n width: \"16px\",\n height: \"16px\",\n }}\n />\n </IconButton>\n </DropdownMenu>\n );\n },\n },\n ],\n },\n ],\n [onGroupPropertyModify, setSelectedGroupProperty],\n );\n\n return (\n <>\n <Button\n startIcon={<SvgAdd />}\n styleType='high-visibility'\n onClick={() => {\n setGroupModifyView(PropertyMenuView.ADD_GROUP_PROPERTY);\n }}\n >\n Add Property\n </Button>\n <Table<GroupPropertyType>\n data={groupProperties}\n density='extra-condensed'\n columns={groupPropertiesColumns}\n emptyTableContent='No Group Properties'\n isSortable\n isLoading={isLoadingGroupProperties}\n />\n <DeleteModal\n entityName={selectedGroupProperty?.propertyName ?? \"\"}\n show={showGroupPropertyDeleteModal}\n setShow={setShowGroupPropertyDeleteModal}\n onDelete={async () => {\n const reportingClientApi = getReportingClient(apiContext.prefix);\n await reportingClientApi.deleteGroupProperty(\n apiContext.accessToken,\n iModelId,\n mappingId,\n groupId,\n selectedGroupProperty?.id ?? \"\",\n );\n }}\n refresh={refreshGroupProperties}\n />\n </>\n );\n};\n\nexport default GroupPropertyTable;\n"]}
@@ -7,9 +7,8 @@ import DeleteModal from "./DeleteModal";
7
7
  import "./Grouping.scss";
8
8
  import { PropertyMenu } from "./PropertyMenu";
9
9
  import { clearEmphasizedElements, visualizeElements, visualizeElementsById, zoomToElements, } from "./viewerUtils";
10
- import { fetchIdsFromQuery, handleError, WidgetHeader } from "./utils";
10
+ import { fetchIdsFromQuery, getReportingClient, handleError, WidgetHeader } from "./utils";
11
11
  import GroupAction from "./GroupAction";
12
- import { ReportingClient } from "@itwin/insights-client";
13
12
  import { ApiContext } from "./GroupingMapping";
14
13
  var GroupsView;
15
14
  (function (GroupsView) {
@@ -21,7 +20,7 @@ var GroupsView;
21
20
  const fetchGroups = async (setGroups, iModelId, mappingId, setIsLoading, apiContext) => {
22
21
  try {
23
22
  setIsLoading(true);
24
- const reportingClientApi = new ReportingClient(apiContext.prefix);
23
+ const reportingClientApi = getReportingClient(apiContext.prefix);
25
24
  const groups = await reportingClientApi.getGroups(apiContext.accessToken, iModelId, mappingId);
26
25
  setGroups(groups);
27
26
  }
@@ -237,7 +236,7 @@ export const Groupings = ({ mapping, goBack }) => {
237
236
  React.createElement(Table, { data: groups, density: 'extra-condensed', columns: groupsColumns, emptyTableContent: 'No Groups available.', isSortable: true, isSelectable: true, onSelect: onSelect, isLoading: isLoading, isRowDisabled: () => isLoadingQuery, stateReducer: tableStateReducer, useControlledState: controlledState })),
238
237
  React.createElement(DeleteModal, { entityName: (_f = selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.groupName) !== null && _f !== void 0 ? _f : "", show: showDeleteModal, setShow: setShowDeleteModal, onDelete: async () => {
239
238
  var _a, _b;
240
- const reportingClientApi = new ReportingClient(apiContext.prefix);
239
+ const reportingClientApi = getReportingClient(apiContext.prefix);
241
240
  await reportingClientApi.deleteGroup(apiContext.accessToken, iModelId, (_a = mapping.id) !== null && _a !== void 0 ? _a : "", (_b = selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.id) !== null && _b !== void 0 ? _b : "");
242
241
  }, refresh: refresh })));
243
242
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Grouping.js","sourceRoot":"","sources":["../../../../src/widget/components/Grouping.tsx"],"names":[],"mappings":"AAUA,OAAO,EACL,OAAO,GACR,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,cAAc,EACd,KAAK,EACL,OAAO,GAC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,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,SAAS,mCAAI,EAAE,EAC1C,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,KAAK,IAAI,EAAE;;wBACnB,MAAM,kBAAkB,GAAG,IAAI,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;wBAClE,MAAM,kBAAkB,CAAC,WAAW,CAClC,UAAU,CAAC,WAAW,EACtB,QAAQ,EACR,MAAA,OAAO,CAAC,EAAE,mCAAI,EAAE,EAChB,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,EAAE,mCAAI,EAAE,CACxB,CAAC;oBACJ,CAAC,EACD,OAAO,EAAE,OAAO,GAChB,CACD,CACJ,CAAC;KACL;AACH,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 type {\n ActionType,\n CellProps,\n TableInstance,\n TableState,\n} from \"react-table\";\nimport {\n actions,\n} from \"react-table\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React, {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { CreateTypeFromInterface } from \"../utils\";\nimport {\n Button,\n DropdownMenu,\n IconButton,\n MenuItem,\n ProgressRadial,\n Table,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport {\n SvgAdd,\n SvgDelete,\n SvgEdit,\n SvgList,\n SvgMore,\n} from \"@itwin/itwinui-icons-react\";\nimport DeleteModal from \"./DeleteModal\";\nimport \"./Grouping.scss\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { PropertyMenu } from \"./PropertyMenu\";\nimport {\n clearEmphasizedElements,\n visualizeElements,\n visualizeElementsById,\n zoomToElements,\n} from \"./viewerUtils\";\nimport { fetchIdsFromQuery, handleError, WidgetHeader } from \"./utils\";\nimport GroupAction from \"./GroupAction\";\nimport type { Group, Mapping } from \"@itwin/insights-client\";\nimport { ReportingClient } from \"@itwin/insights-client\";\nimport type { Api } from \"./GroupingMapping\";\nimport { ApiContext } from \"./GroupingMapping\";\n\nexport type GroupType = CreateTypeFromInterface<Group>;\n\nenum GroupsView {\n GROUPS = \"groups\",\n MODIFYING = \"modifying\",\n ADD = \"ADD\",\n PROPERTIES = \"properties\",\n}\n\ninterface GroupsTreeProps {\n mapping: Mapping;\n goBack: () => Promise<void>;\n}\n\nconst fetchGroups = async (\n setGroups: React.Dispatch<React.SetStateAction<GroupType[]>>,\n iModelId: string,\n mappingId: string,\n setIsLoading: React.Dispatch<React.SetStateAction<boolean>>,\n apiContext: Api\n) => {\n try {\n setIsLoading(true);\n const reportingClientApi = new ReportingClient(apiContext.prefix);\n const groups = await reportingClientApi.getGroups(apiContext.accessToken, iModelId, mappingId);\n setGroups(groups);\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n};\n\nexport const Groupings = ({ mapping, goBack }: GroupsTreeProps) => {\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const apiContext = useContext(ApiContext);\n const iModelId = useActiveIModelConnection()?.iModelId as string;\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [groupsView, setGroupsView] = useState<GroupsView>(GroupsView.GROUPS);\n const [selectedGroup, setSelectedGroup] = useState<GroupType | undefined>(\n undefined,\n );\n const hilitedElements = useRef<Map<string, string[]>>(new Map());\n const [selectedRows, setSelectedRows] = useState<Record<string, boolean>>({});\n const [isLoadingQuery, setLoadingQuery] = useState<boolean>(false);\n const [groups, setGroups] = useState<Group[]>([]);\n\n useEffect(() => {\n void fetchGroups(setGroups, iModelId, mapping.id ?? \"\", setIsLoading, apiContext);\n }, [apiContext, iModelId, mapping.id, setIsLoading]);\n\n const refresh = useCallback(async () => {\n setGroupsView(GroupsView.GROUPS);\n setSelectedGroup(undefined);\n setGroups([]);\n await fetchGroups(setGroups, iModelId, mapping.id ?? \"\", setIsLoading, apiContext);\n }, [apiContext, iModelId, mapping.id, setGroups]);\n\n const addGroup = () => {\n // TODO Retain selection in view without emphasizes. Goal is to make it so we can distinguish\n // hilited elements from regular elements without emphasis due to it blocking selection. For now clearing\n // selection.\n clearEmphasizedElements();\n setGroupsView(GroupsView.ADD);\n };\n\n const onModify = useCallback((value) => {\n clearEmphasizedElements();\n setSelectedGroup(value.row.original);\n setGroupsView(GroupsView.MODIFYING);\n }, []);\n\n const openProperties = useCallback((value) => {\n clearEmphasizedElements();\n setSelectedGroup(value.row.original);\n setGroupsView(GroupsView.PROPERTIES);\n }, []);\n\n const groupsColumns = useMemo(\n () => [\n {\n Header: \"Table\",\n columns: [\n {\n id: \"groupName\",\n Header: \"Group\",\n accessor: \"groupName\",\n Cell: (value: CellProps<GroupType>) => (\n <>\n {isLoadingQuery ? (\n value.row.original.groupName\n ) : (\n <div\n className='iui-anchor'\n onClick={(e) => {\n e.stopPropagation();\n openProperties(value);\n }}\n >\n {value.row.original.groupName}\n </div>\n )}\n </>\n ),\n },\n {\n id: \"description\",\n Header: \"Description\",\n accessor: \"description\",\n },\n {\n id: \"dropdown\",\n Header: \"\",\n width: 80,\n Cell: (value: CellProps<GroupType>) => {\n return (\n <div onClick={(e) => e.stopPropagation()}>\n <DropdownMenu\n disabled={isLoadingQuery}\n menuItems={(close: () => void) => [\n <MenuItem\n key={0}\n onClick={() => onModify(value)}\n icon={<SvgEdit />}\n >\n Modify\n </MenuItem>,\n <MenuItem\n key={1}\n onClick={() => openProperties(value)}\n icon={<SvgList />}\n >\n Properties\n </MenuItem>,\n <MenuItem\n key={2}\n onClick={() => {\n setSelectedGroup(value.row.original);\n setShowDeleteModal(true);\n close();\n }}\n icon={<SvgDelete />}\n >\n Remove\n </MenuItem>,\n ]}\n >\n <IconButton\n disabled={isLoadingQuery}\n styleType='borderless'\n >\n <SvgMore\n style={{\n width: \"16px\",\n height: \"16px\",\n }}\n />\n </IconButton>\n </DropdownMenu>\n </div>\n );\n },\n },\n ],\n },\n ],\n [isLoadingQuery, onModify, openProperties],\n );\n\n // Temp\n const stringToColor = function (str: string) {\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n hash = str.charCodeAt(i) + ((hash << 5) - hash);\n }\n let colour = \"#\";\n for (let i = 0; i < 3; i++) {\n const value = (hash >> (i * 8)) & 0xff;\n colour += (`00${value.toString(16)}`).substr(-2);\n }\n return colour;\n };\n\n const onSelect = useCallback(\n async (selectedData: GroupType[] | undefined) => {\n clearEmphasizedElements();\n if (selectedData && selectedData.length > 0) {\n setLoadingQuery(true);\n let allIds: string[] = [];\n for (const row of selectedData) {\n const query = row.query ?? \"\";\n if (hilitedElements.current.has(query)) {\n const hilitedIds = hilitedElements.current.get(query) ?? [];\n visualizeElements(hilitedIds, stringToColor(row.id ?? \"\"));\n allIds = allIds.concat(hilitedIds);\n } else {\n try {\n const ids: string[] = await fetchIdsFromQuery(\n query,\n iModelConnection,\n );\n if (ids.length === 0) {\n toaster.warning(`${row.groupName}'s query is valid but produced no results.`);\n }\n const hiliteIds = await visualizeElementsById(\n ids,\n stringToColor(row.id ?? \"\"),\n iModelConnection,\n );\n hilitedElements.current.set(query, hiliteIds);\n\n allIds = allIds.concat(ids);\n } catch {\n const index = groups.findIndex((group) => group.id === row.id);\n setSelectedRows((rowIds) => {\n const selectedRowIds = { ...rowIds };\n delete selectedRowIds[index];\n return selectedRowIds;\n });\n toaster.negative(`Could not load ${row.groupName}. Query could not be resolved.`);\n\n }\n }\n }\n await zoomToElements(allIds);\n setLoadingQuery(false);\n }\n },\n [iModelConnection, groups],\n );\n\n const controlledState = useCallback(\n (state) => {\n return {\n ...state,\n selectedRowIds: { ...selectedRows },\n };\n },\n [selectedRows],\n );\n\n const propertyMenuGoBack = useCallback(async () => {\n clearEmphasizedElements();\n setGroupsView(GroupsView.GROUPS);\n await refresh();\n }, [refresh]);\n\n const tableStateReducer = (\n newState: TableState,\n action: ActionType,\n _previousState: TableState,\n instance?: TableInstance,\n ): TableState => {\n switch (action.type) {\n case actions.toggleRowSelected: {\n const newSelectedRows = {\n ...selectedRows,\n };\n if (action.value) {\n newSelectedRows[action.id] = true;\n } else {\n delete newSelectedRows[action.id];\n }\n setSelectedRows(newSelectedRows);\n newState.selectedRowIds = newSelectedRows;\n break;\n }\n case actions.toggleAllRowsSelected: {\n if (!instance?.rowsById) {\n break;\n }\n const newSelectedRows = {} as Record<string, boolean>;\n if (action.value) {\n Object.keys(instance.rowsById).forEach(\n (id) => (newSelectedRows[id] = true),\n );\n }\n setSelectedRows(newSelectedRows);\n newState.selectedRowIds = newSelectedRows;\n break;\n }\n default:\n break;\n }\n return newState;\n };\n\n switch (groupsView) {\n case GroupsView.ADD:\n return (\n <GroupAction\n iModelId={iModelId}\n mappingId={mapping.id ?? \"\"}\n goBack={async () => {\n clearEmphasizedElements();\n setGroupsView(GroupsView.GROUPS);\n await refresh();\n }}\n />\n );\n case GroupsView.MODIFYING:\n return selectedGroup ? (\n <GroupAction\n iModelId={iModelId}\n mappingId={mapping.id ?? \"\"}\n group={selectedGroup}\n goBack={async () => {\n clearEmphasizedElements();\n setGroupsView(GroupsView.GROUPS);\n await refresh();\n }}\n />\n ) : null;\n case GroupsView.PROPERTIES:\n return selectedGroup ? (\n <PropertyMenu\n iModelId={iModelId}\n mappingId={mapping.id ?? \"\"}\n group={selectedGroup}\n goBack={propertyMenuGoBack}\n />\n ) : null;\n default:\n return (\n <>\n <WidgetHeader\n title={mapping.mappingName ?? \"\"}\n disabled={isLoading || isLoadingQuery}\n returnFn={async () => {\n clearEmphasizedElements();\n await goBack();\n }}\n />\n <div className='groups-container'>\n <Button\n startIcon={\n isLoadingQuery ? <ProgressRadial size=\"small\" indeterminate /> : <SvgAdd />\n }\n styleType='high-visibility'\n disabled={isLoadingQuery}\n onClick={() => addGroup()}\n >\n {isLoadingQuery ? \"Loading Group(s)\" : \"Add Group\"}\n </Button>\n <Table<GroupType>\n data={groups}\n density='extra-condensed'\n columns={groupsColumns}\n emptyTableContent='No Groups available.'\n isSortable\n isSelectable\n onSelect={onSelect}\n isLoading={isLoading}\n isRowDisabled={() => isLoadingQuery}\n stateReducer={tableStateReducer}\n useControlledState={controlledState}\n />\n </div>\n <DeleteModal\n entityName={selectedGroup?.groupName ?? \"\"}\n show={showDeleteModal}\n setShow={setShowDeleteModal}\n onDelete={async () => {\n const reportingClientApi = new ReportingClient(apiContext.prefix);\n await reportingClientApi.deleteGroup(\n apiContext.accessToken,\n iModelId,\n mapping.id ?? \"\",\n selectedGroup?.id ?? \"\",\n );\n }}\n refresh={refresh}\n />\n </>\n );\n }\n};\n"]}
1
+ {"version":3,"file":"Grouping.js","sourceRoot":"","sources":["../../../../src/widget/components/Grouping.tsx"],"names":[],"mappings":"AAUA,OAAO,EACL,OAAO,GACR,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,cAAc,EACd,KAAK,EACL,OAAO,GACR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,MAAM,EACN,SAAS,EACT,OAAO,EACP,OAAO,EACP,OAAO,GACR,MAAM,4BAA4B,CAAC;AACpC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,iBAAiB,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,S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AC,EACD,OAAO,EAAE,OAAO,GAChB,CACD,CACJ,CAAC;KACL;AACH,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 type {\n ActionType,\n CellProps,\n TableInstance,\n TableState,\n} from \"react-table\";\nimport {\n actions,\n} from \"react-table\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React, {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { CreateTypeFromInterface } from \"../utils\";\nimport {\n Button,\n DropdownMenu,\n IconButton,\n MenuItem,\n ProgressRadial,\n Table,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport {\n SvgAdd,\n SvgDelete,\n SvgEdit,\n SvgList,\n SvgMore,\n} from \"@itwin/itwinui-icons-react\";\nimport DeleteModal from \"./DeleteModal\";\nimport \"./Grouping.scss\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { PropertyMenu } from \"./PropertyMenu\";\nimport {\n clearEmphasizedElements,\n visualizeElements,\n visualizeElementsById,\n zoomToElements,\n} from \"./viewerUtils\";\nimport { fetchIdsFromQuery, getReportingClient, handleError, WidgetHeader } from \"./utils\";\nimport GroupAction from \"./GroupAction\";\nimport type { Group, Mapping } from \"@itwin/insights-client\";\nimport type { Api } from \"./GroupingMapping\";\nimport { ApiContext } from \"./GroupingMapping\";\n\nexport type GroupType = CreateTypeFromInterface<Group>;\n\nenum GroupsView {\n GROUPS = \"groups\",\n MODIFYING = \"modifying\",\n ADD = \"ADD\",\n PROPERTIES = \"properties\",\n}\n\ninterface GroupsTreeProps {\n mapping: Mapping;\n goBack: () => Promise<void>;\n}\n\nconst fetchGroups = async (\n setGroups: React.Dispatch<React.SetStateAction<GroupType[]>>,\n iModelId: string,\n mappingId: string,\n setIsLoading: React.Dispatch<React.SetStateAction<boolean>>,\n apiContext: Api\n) => {\n try {\n setIsLoading(true);\n const reportingClientApi = getReportingClient(apiContext.prefix);\n const groups = await reportingClientApi.getGroups(apiContext.accessToken, iModelId, mappingId);\n setGroups(groups);\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n};\n\nexport const Groupings = ({ mapping, goBack }: GroupsTreeProps) => {\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const apiContext = useContext(ApiContext);\n const iModelId = useActiveIModelConnection()?.iModelId as string;\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [groupsView, setGroupsView] = useState<GroupsView>(GroupsView.GROUPS);\n const [selectedGroup, setSelectedGroup] = useState<GroupType | undefined>(\n undefined,\n );\n const hilitedElements = useRef<Map<string, string[]>>(new Map());\n const [selectedRows, setSelectedRows] = useState<Record<string, boolean>>({});\n const [isLoadingQuery, setLoadingQuery] = useState<boolean>(false);\n const [groups, setGroups] = useState<Group[]>([]);\n\n useEffect(() => {\n void fetchGroups(setGroups, iModelId, mapping.id ?? \"\", setIsLoading, apiContext);\n }, [apiContext, iModelId, mapping.id, setIsLoading]);\n\n const refresh = useCallback(async () => {\n setGroupsView(GroupsView.GROUPS);\n setSelectedGroup(undefined);\n setGroups([]);\n await fetchGroups(setGroups, iModelId, mapping.id ?? \"\", setIsLoading, apiContext);\n }, [apiContext, iModelId, mapping.id, setGroups]);\n\n const addGroup = () => {\n // TODO Retain selection in view without emphasizes. Goal is to make it so we can distinguish\n // hilited elements from regular elements without emphasis due to it blocking selection. For now clearing\n // selection.\n clearEmphasizedElements();\n setGroupsView(GroupsView.ADD);\n };\n\n const onModify = useCallback((value) => {\n clearEmphasizedElements();\n setSelectedGroup(value.row.original);\n setGroupsView(GroupsView.MODIFYING);\n }, []);\n\n const openProperties = useCallback((value) => {\n clearEmphasizedElements();\n setSelectedGroup(value.row.original);\n setGroupsView(GroupsView.PROPERTIES);\n }, []);\n\n const groupsColumns = useMemo(\n () => [\n {\n Header: \"Table\",\n columns: [\n {\n id: \"groupName\",\n Header: \"Group\",\n accessor: \"groupName\",\n Cell: (value: CellProps<GroupType>) => (\n <>\n {isLoadingQuery ? (\n value.row.original.groupName\n ) : (\n <div\n className='iui-anchor'\n onClick={(e) => {\n e.stopPropagation();\n openProperties(value);\n }}\n >\n {value.row.original.groupName}\n </div>\n )}\n </>\n ),\n },\n {\n id: \"description\",\n Header: \"Description\",\n accessor: \"description\",\n },\n {\n id: \"dropdown\",\n Header: \"\",\n width: 80,\n Cell: (value: CellProps<GroupType>) => {\n return (\n <div onClick={(e) => e.stopPropagation()}>\n <DropdownMenu\n disabled={isLoadingQuery}\n menuItems={(close: () => void) => [\n <MenuItem\n key={0}\n onClick={() => onModify(value)}\n icon={<SvgEdit />}\n >\n Modify\n </MenuItem>,\n <MenuItem\n key={1}\n onClick={() => openProperties(value)}\n icon={<SvgList />}\n >\n Properties\n </MenuItem>,\n <MenuItem\n key={2}\n onClick={() => {\n setSelectedGroup(value.row.original);\n setShowDeleteModal(true);\n close();\n }}\n icon={<SvgDelete />}\n >\n Remove\n </MenuItem>,\n ]}\n >\n <IconButton\n disabled={isLoadingQuery}\n styleType='borderless'\n >\n <SvgMore\n style={{\n width: \"16px\",\n height: \"16px\",\n }}\n />\n </IconButton>\n </DropdownMenu>\n </div>\n );\n },\n },\n ],\n },\n ],\n [isLoadingQuery, onModify, openProperties],\n );\n\n // Temp\n const stringToColor = function (str: string) {\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n hash = str.charCodeAt(i) + ((hash << 5) - hash);\n }\n let colour = \"#\";\n for (let i = 0; i < 3; i++) {\n const value = (hash >> (i * 8)) & 0xff;\n colour += (`00${value.toString(16)}`).substr(-2);\n }\n return colour;\n };\n\n const onSelect = useCallback(\n async (selectedData: GroupType[] | undefined) => {\n clearEmphasizedElements();\n if (selectedData && selectedData.length > 0) {\n setLoadingQuery(true);\n let allIds: string[] = [];\n for (const row of selectedData) {\n const query = row.query ?? \"\";\n if (hilitedElements.current.has(query)) {\n const hilitedIds = hilitedElements.current.get(query) ?? [];\n visualizeElements(hilitedIds, stringToColor(row.id ?? \"\"));\n allIds = allIds.concat(hilitedIds);\n } else {\n try {\n const ids: string[] = await fetchIdsFromQuery(\n query,\n iModelConnection,\n );\n if (ids.length === 0) {\n toaster.warning(`${row.groupName}'s query is valid but produced no results.`);\n }\n const hiliteIds = await visualizeElementsById(\n ids,\n stringToColor(row.id ?? \"\"),\n iModelConnection,\n );\n hilitedElements.current.set(query, hiliteIds);\n\n allIds = allIds.concat(ids);\n } catch {\n const index = groups.findIndex((group) => group.id === row.id);\n setSelectedRows((rowIds) => {\n const selectedRowIds = { ...rowIds };\n delete selectedRowIds[index];\n return selectedRowIds;\n });\n toaster.negative(`Could not load ${row.groupName}. Query could not be resolved.`);\n\n }\n }\n }\n await zoomToElements(allIds);\n setLoadingQuery(false);\n }\n },\n [iModelConnection, groups],\n );\n\n const controlledState = useCallback(\n (state) => {\n return {\n ...state,\n selectedRowIds: { ...selectedRows },\n };\n },\n [selectedRows],\n );\n\n const propertyMenuGoBack = useCallback(async () => {\n clearEmphasizedElements();\n setGroupsView(GroupsView.GROUPS);\n await refresh();\n }, [refresh]);\n\n const tableStateReducer = (\n newState: TableState,\n action: ActionType,\n _previousState: TableState,\n instance?: TableInstance,\n ): TableState => {\n switch (action.type) {\n case actions.toggleRowSelected: {\n const newSelectedRows = {\n ...selectedRows,\n };\n if (action.value) {\n newSelectedRows[action.id] = true;\n } else {\n delete newSelectedRows[action.id];\n }\n setSelectedRows(newSelectedRows);\n newState.selectedRowIds = newSelectedRows;\n break;\n }\n case actions.toggleAllRowsSelected: {\n if (!instance?.rowsById) {\n break;\n }\n const newSelectedRows = {} as Record<string, boolean>;\n if (action.value) {\n Object.keys(instance.rowsById).forEach(\n (id) => (newSelectedRows[id] = true),\n );\n }\n setSelectedRows(newSelectedRows);\n newState.selectedRowIds = newSelectedRows;\n break;\n }\n default:\n break;\n }\n return newState;\n };\n\n switch (groupsView) {\n case GroupsView.ADD:\n return (\n <GroupAction\n iModelId={iModelId}\n mappingId={mapping.id ?? \"\"}\n goBack={async () => {\n clearEmphasizedElements();\n setGroupsView(GroupsView.GROUPS);\n await refresh();\n }}\n />\n );\n case GroupsView.MODIFYING:\n return selectedGroup ? (\n <GroupAction\n iModelId={iModelId}\n mappingId={mapping.id ?? \"\"}\n group={selectedGroup}\n goBack={async () => {\n clearEmphasizedElements();\n setGroupsView(GroupsView.GROUPS);\n await refresh();\n }}\n />\n ) : null;\n case GroupsView.PROPERTIES:\n return selectedGroup ? (\n <PropertyMenu\n iModelId={iModelId}\n mappingId={mapping.id ?? \"\"}\n group={selectedGroup}\n goBack={propertyMenuGoBack}\n />\n ) : null;\n default:\n return (\n <>\n <WidgetHeader\n title={mapping.mappingName ?? \"\"}\n disabled={isLoading || isLoadingQuery}\n returnFn={async () => {\n clearEmphasizedElements();\n await goBack();\n }}\n />\n <div className='groups-container'>\n <Button\n startIcon={\n isLoadingQuery ? <ProgressRadial size=\"small\" indeterminate /> : <SvgAdd />\n }\n styleType='high-visibility'\n disabled={isLoadingQuery}\n onClick={() => addGroup()}\n >\n {isLoadingQuery ? \"Loading Group(s)\" : \"Add Group\"}\n </Button>\n <Table<GroupType>\n data={groups}\n density='extra-condensed'\n columns={groupsColumns}\n emptyTableContent='No Groups available.'\n isSortable\n isSelectable\n onSelect={onSelect}\n isLoading={isLoading}\n isRowDisabled={() => isLoadingQuery}\n stateReducer={tableStateReducer}\n useControlledState={controlledState}\n />\n </div>\n <DeleteModal\n entityName={selectedGroup?.groupName ?? \"\"}\n show={showDeleteModal}\n setShow={setShowDeleteModal}\n onDelete={async () => {\n const reportingClientApi = getReportingClient(apiContext.prefix);\n await reportingClientApi.deleteGroup(\n apiContext.accessToken,\n iModelId,\n mapping.id ?? \"\",\n selectedGroup?.id ?? \"\",\n );\n }}\n refresh={refresh}\n />\n </>\n );\n }\n};\n"]}
@@ -4,17 +4,17 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import { Presentation } from "@itwin/presentation-frontend";
6
6
  import { useActiveIModelConnection } from "@itwin/appui-react";
7
- import { SvgAdd, SvgDelete, SvgEdit, SvgImport, SvgMore, } from "@itwin/itwinui-icons-react";
7
+ import { SvgAdd, SvgDelete, SvgEdit, SvgImport, SvgMore, SvgProcess, } from "@itwin/itwinui-icons-react";
8
8
  import { Button, ButtonGroup, DropdownMenu, IconButton, MenuItem, Table, } from "@itwin/itwinui-react";
9
9
  import React, { useCallback, useContext, useEffect, useMemo, useState } from "react";
10
- import { handleError, onSelectionChanged, WidgetHeader } from "./utils";
10
+ import { getReportingClient, handleError, onSelectionChanged, WidgetHeader } from "./utils";
11
11
  import "./Mapping.scss";
12
12
  import DeleteModal from "./DeleteModal";
13
13
  import { Groupings } from "./Grouping";
14
14
  import MappingAction from "./MappingAction";
15
15
  import { MappingImportWizardModal } from "./MappingImportWizardModal";
16
16
  import { ApiContext } from "./GroupingMapping";
17
- import { ReportingClient } from "@itwin/insights-client";
17
+ import { BlockingOverlay } from "./BlockingOverlay";
18
18
  var MappingView;
19
19
  (function (MappingView) {
20
20
  MappingView["MAPPINGS"] = "mappings";
@@ -26,7 +26,7 @@ var MappingView;
26
26
  const fetchMappings = async (setMappings, iModelId, setIsLoading, apiContext) => {
27
27
  try {
28
28
  setIsLoading(true);
29
- const reportingClientApi = new ReportingClient(apiContext.prefix);
29
+ const reportingClientApi = getReportingClient(apiContext.prefix);
30
30
  const mappings = await reportingClientApi.getMappings(apiContext.accessToken, iModelId);
31
31
  setMappings(mappings);
32
32
  }
@@ -37,12 +37,24 @@ const fetchMappings = async (setMappings, iModelId, setIsLoading, apiContext) =>
37
37
  setIsLoading(false);
38
38
  }
39
39
  };
40
+ const toggleExtraction = async (apiContext, iModelId, mapping) => {
41
+ var _a;
42
+ try {
43
+ const newState = !(mapping === null || mapping === void 0 ? void 0 : mapping.extractionEnabled);
44
+ const reportingClient = getReportingClient(apiContext.prefix);
45
+ await reportingClient.updateMapping(apiContext.accessToken, iModelId, (_a = mapping === null || mapping === void 0 ? void 0 : mapping.id) !== null && _a !== void 0 ? _a : "", { extractionEnabled: newState });
46
+ }
47
+ catch (error) {
48
+ handleError(error.status);
49
+ }
50
+ };
40
51
  export const Mappings = () => {
41
52
  var _a, _b;
42
53
  const apiContext = useContext(ApiContext);
43
54
  const iModelId = (_a = useActiveIModelConnection()) === null || _a === void 0 ? void 0 : _a.iModelId;
44
55
  const [showDeleteModal, setShowDeleteModal] = useState(false);
45
56
  const [showImportModal, setShowImportModal] = useState(false);
57
+ const [showBlockingOverlay, setShowBlockingOverlay] = useState(false);
46
58
  const [mappingView, setMappingView] = useState(MappingView.MAPPINGS);
47
59
  const [selectedMapping, setSelectedMapping] = useState(undefined);
48
60
  const [isLoading, setIsLoading] = useState(true);
@@ -93,7 +105,15 @@ export const Mappings = () => {
93
105
  setSelectedMapping(value.row.original);
94
106
  setMappingView(MappingView.MODIFYING);
95
107
  }, icon: React.createElement(SvgEdit, null) }, "Modify"),
96
- React.createElement(MenuItem, { key: 1, onClick: () => {
108
+ React.createElement(MenuItem, { key: 1, onClick: async () => {
109
+ setSelectedMapping(value.row.original);
110
+ setShowBlockingOverlay(true);
111
+ close();
112
+ await toggleExtraction(apiContext, iModelId, value.row.original);
113
+ await refresh();
114
+ setShowBlockingOverlay(false);
115
+ }, icon: React.createElement(SvgProcess, null) }, value.row.original.extractionEnabled ? "Disable extraction" : "Enable extraction"),
116
+ React.createElement(MenuItem, { key: 2, onClick: () => {
97
117
  setSelectedMapping(value.row.original);
98
118
  setShowDeleteModal(true);
99
119
  close();
@@ -108,7 +128,7 @@ export const Mappings = () => {
108
128
  },
109
129
  ],
110
130
  },
111
- ], []);
131
+ ], [apiContext, iModelId, refresh]);
112
132
  switch (mappingView) {
113
133
  case MappingView.ADDING:
114
134
  return React.createElement(MappingAction, { iModelId: iModelId, returnFn: refresh });
@@ -118,6 +138,7 @@ export const Mappings = () => {
118
138
  return (React.createElement(Groupings, { mapping: selectedMapping, goBack: refresh }));
119
139
  default:
120
140
  return (React.createElement(React.Fragment, null,
141
+ React.createElement(BlockingOverlay, { isVisible: showBlockingOverlay }),
121
142
  React.createElement(WidgetHeader, { title: "Mappings" }),
122
143
  React.createElement("div", { className: "mappings-container" },
123
144
  React.createElement("div", { className: "table-toolbar" },
@@ -128,7 +149,7 @@ export const Mappings = () => {
128
149
  React.createElement(Table, { data: mappings, density: "extra-condensed", columns: mappingsColumns, emptyTableContent: "No Mappings available.", isSortable: true, isLoading: isLoading })),
129
150
  React.createElement(DeleteModal, { entityName: (_b = selectedMapping === null || selectedMapping === void 0 ? void 0 : selectedMapping.mappingName) !== null && _b !== void 0 ? _b : "", show: showDeleteModal, setShow: setShowDeleteModal, onDelete: async () => {
130
151
  var _a;
131
- const reportingClientApi = new ReportingClient(apiContext.prefix);
152
+ const reportingClientApi = getReportingClient(apiContext.prefix);
132
153
  await reportingClientApi.deleteMapping(apiContext.accessToken, iModelId, (_a = selectedMapping === null || selectedMapping === void 0 ? void 0 : selectedMapping.id) !== null && _a !== void 0 ? _a : "");
133
154
  }, refresh: refresh }),
134
155
  React.createElement(MappingImportWizardModal, { show: showImportModal, setShow: setShowImportModal, onFinish: refresh })));