@itwin/reports-config-widget-react 0.5.0 → 0.7.0

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 (386) hide show
  1. package/CHANGELOG.json +76 -1
  2. package/CHANGELOG.md +27 -2
  3. package/LICENSE.md +9 -9
  4. package/README.md +38 -38
  5. package/__mocks__/fileMock.js +4 -4
  6. package/api/reports-config-widget-react.api.md +126 -0
  7. package/api/reports-config-widget-react.exports.csv +14 -0
  8. package/api/temp/reports-config-widget-react.api.md +126 -0
  9. package/coverage/clover.xml +521 -521
  10. package/coverage/coverage-final.json +32 -32
  11. package/coverage/lcov-report/index.html +31 -31
  12. package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +15 -15
  13. package/coverage/lcov-report/src/index.html +1 -1
  14. package/coverage/lcov-report/src/test/index.html +11 -11
  15. package/coverage/lcov-report/src/test/test-utils.tsx.html +46 -16
  16. package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +29 -86
  17. package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +5 -38
  18. package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +25 -121
  19. package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +120 -96
  20. package/coverage/lcov-report/src/widget/components/Constants.ts.html +5 -5
  21. package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +13 -103
  22. package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +6 -21
  23. package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +6 -21
  24. package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +7 -22
  25. package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +7 -28
  26. package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +6 -21
  27. package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
  28. package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +20 -47
  29. package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +20 -11
  30. package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +16 -79
  31. package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +15 -108
  32. package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +36 -75
  33. package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +62 -92
  34. package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +104 -128
  35. package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +88 -301
  36. package/coverage/lcov-report/src/widget/components/Reports.tsx.html +42 -204
  37. package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +164 -50
  38. package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +15 -63
  39. package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +8 -47
  40. package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +6 -12
  41. package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +13 -25
  42. package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +11 -56
  43. package/coverage/lcov-report/src/widget/components/index.html +50 -50
  44. package/coverage/lcov-report/src/widget/components/utils.tsx.html +25 -169
  45. package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +6 -12
  46. package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +10 -13
  47. package/coverage/lcov-report/src/widget/context/index.html +1 -1
  48. package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
  49. package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +12 -54
  50. package/coverage/lcov-report/src/widget/index.html +13 -13
  51. package/coverage/lcov.info +941 -919
  52. package/jest.config.js +14 -17
  53. package/lib/cjs/ReportsConfigWidget.d.ts +4 -0
  54. package/lib/cjs/ReportsConfigWidget.d.ts.map +1 -1
  55. package/lib/cjs/ReportsConfigWidget.js +4 -0
  56. package/lib/cjs/ReportsConfigWidget.js.map +1 -1
  57. package/lib/cjs/reports-config-widget-react.d.ts +1 -0
  58. package/lib/cjs/reports-config-widget-react.d.ts.map +1 -1
  59. package/lib/cjs/reports-config-widget-react.js +4 -3
  60. package/lib/cjs/reports-config-widget-react.js.map +1 -1
  61. package/lib/cjs/test/AddMappingModal.test.js +11 -10
  62. package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
  63. package/lib/cjs/test/BulkExtractor.test.js +68 -43
  64. package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
  65. package/lib/cjs/test/DeleteModal.test.js +3 -3
  66. package/lib/cjs/test/DeleteModal.test.js.map +1 -1
  67. package/lib/cjs/test/ReportAction.test.js +6 -4
  68. package/lib/cjs/test/ReportAction.test.js.map +1 -1
  69. package/lib/cjs/test/ReportMappingHorizontalTile.test.js +64 -25
  70. package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
  71. package/lib/cjs/test/ReportMappings.test.js +39 -18
  72. package/lib/cjs/test/ReportMappings.test.js.map +1 -1
  73. package/lib/cjs/test/Reports.test.js +3 -3
  74. package/lib/cjs/test/Reports.test.js.map +1 -1
  75. package/lib/cjs/test/WidgetHeader.test.js +3 -3
  76. package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
  77. package/lib/cjs/test/test-utils.d.ts +8 -0
  78. package/lib/cjs/test/test-utils.d.ts.map +1 -1
  79. package/lib/cjs/test/test-utils.js +16 -4
  80. package/lib/cjs/test/test-utils.js.map +1 -1
  81. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  82. package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +10 -4
  83. package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
  84. package/lib/cjs/widget/ReportsConfigUiProvider.js +11 -7
  85. package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
  86. package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
  87. package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
  88. package/lib/cjs/widget/components/AddMappingsModal.d.ts +1 -1
  89. package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
  90. package/lib/cjs/widget/components/AddMappingsModal.js +7 -7
  91. package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
  92. package/lib/cjs/widget/components/AddMappingsModal.scss +1 -1
  93. package/lib/cjs/widget/components/BulkExtractor.d.ts +8 -5
  94. package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
  95. package/lib/cjs/widget/components/BulkExtractor.js +52 -35
  96. package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
  97. package/lib/cjs/widget/components/Constants.d.ts.map +1 -1
  98. package/lib/cjs/widget/components/Constants.js +3 -3
  99. package/lib/cjs/widget/components/Constants.js.map +1 -1
  100. package/lib/cjs/widget/components/DeleteModal.d.ts +1 -1
  101. package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
  102. package/lib/cjs/widget/components/DeleteModal.js +5 -5
  103. package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
  104. package/lib/cjs/widget/components/DeleteModal.scss +2 -2
  105. package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
  106. package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
  107. package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
  108. package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
  109. package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
  110. package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
  111. package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
  112. package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
  113. package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
  114. package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
  115. package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
  116. package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
  117. package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
  118. package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
  119. package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
  120. package/lib/cjs/widget/components/ExtractionStatus.d.ts +1 -1
  121. package/lib/cjs/widget/components/ExtractionStatus.d.ts.map +1 -1
  122. package/lib/cjs/widget/components/ExtractionStatus.js +9 -9
  123. package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
  124. package/lib/cjs/widget/components/ExtractionStatus.scss +1 -1
  125. package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -1
  126. package/lib/cjs/widget/components/ExtractionToast.js +3 -3
  127. package/lib/cjs/widget/components/ExtractionToast.js.map +1 -1
  128. package/lib/cjs/widget/components/HorizontalTile.d.ts.map +1 -1
  129. package/lib/cjs/widget/components/HorizontalTile.js +1 -2
  130. package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
  131. package/lib/cjs/widget/components/HorizontalTile.scss +1 -4
  132. package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
  133. package/lib/cjs/widget/components/LocalizedTablePaginator.js +1 -1
  134. package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
  135. package/lib/cjs/widget/components/ReportAction.d.ts +8 -0
  136. package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
  137. package/lib/cjs/widget/components/ReportAction.js +9 -7
  138. package/lib/cjs/widget/components/ReportAction.js.map +1 -1
  139. package/lib/cjs/widget/components/ReportAction.scss +1 -1
  140. package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
  141. package/lib/cjs/widget/components/ReportHorizontalTile.js +4 -4
  142. package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
  143. package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
  144. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +46 -45
  145. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
  146. package/lib/cjs/widget/components/ReportMappings.d.ts +8 -0
  147. package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
  148. package/lib/cjs/widget/components/ReportMappings.js +25 -11
  149. package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
  150. package/lib/cjs/widget/components/Reports.d.ts +9 -1
  151. package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
  152. package/lib/cjs/widget/components/Reports.js +7 -8
  153. package/lib/cjs/widget/components/Reports.js.map +1 -1
  154. package/lib/cjs/widget/components/Reports.scss +0 -1
  155. package/lib/cjs/widget/components/ReportsConfigContext.d.ts +34 -4
  156. package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
  157. package/lib/cjs/widget/components/ReportsConfigContext.js +27 -9
  158. package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
  159. package/lib/cjs/widget/components/ReportsContainer.d.ts +3 -6
  160. package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
  161. package/lib/cjs/widget/components/ReportsContainer.js +7 -5
  162. package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
  163. package/lib/cjs/widget/components/ReportsContainer.scss +1 -1
  164. package/lib/cjs/widget/components/ReportsHeader.d.ts +1 -1
  165. package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -1
  166. package/lib/cjs/widget/components/ReportsHeader.js +6 -7
  167. package/lib/cjs/widget/components/ReportsHeader.js.map +1 -1
  168. package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -1
  169. package/lib/cjs/widget/components/ReportsRouter.js +3 -3
  170. package/lib/cjs/widget/components/ReportsRouter.js.map +1 -1
  171. package/lib/cjs/widget/components/SearchBar.d.ts +1 -1
  172. package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
  173. package/lib/cjs/widget/components/SearchBar.js +4 -4
  174. package/lib/cjs/widget/components/SearchBar.js.map +1 -1
  175. package/lib/cjs/widget/components/SelectIModel.d.ts +1 -1
  176. package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
  177. package/lib/cjs/widget/components/SelectIModel.js +1 -1
  178. package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
  179. package/lib/cjs/widget/components/SelectIModel.scss +1 -1
  180. package/lib/cjs/widget/components/utils.d.ts +1 -1
  181. package/lib/cjs/widget/components/utils.d.ts.map +1 -1
  182. package/lib/cjs/widget/components/utils.js +5 -5
  183. package/lib/cjs/widget/components/utils.js.map +1 -1
  184. package/lib/cjs/widget/components/utils.scss +1 -1
  185. package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -1
  186. package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
  187. package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts +3 -3
  188. package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
  189. package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
  190. package/lib/cjs/widget/hooks/useValidator.d.ts +1 -4
  191. package/lib/cjs/widget/hooks/useValidator.d.ts.map +1 -1
  192. package/lib/cjs/widget/hooks/useValidator.js +3 -3
  193. package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
  194. package/lib/esm/ReportsConfigWidget.d.ts +4 -0
  195. package/lib/esm/ReportsConfigWidget.d.ts.map +1 -1
  196. package/lib/esm/ReportsConfigWidget.js +4 -0
  197. package/lib/esm/ReportsConfigWidget.js.map +1 -1
  198. package/lib/esm/reports-config-widget-react.d.ts +1 -0
  199. package/lib/esm/reports-config-widget-react.d.ts.map +1 -1
  200. package/lib/esm/reports-config-widget-react.js +4 -3
  201. package/lib/esm/reports-config-widget-react.js.map +1 -1
  202. package/lib/esm/test/AddMappingModal.test.js +12 -11
  203. package/lib/esm/test/AddMappingModal.test.js.map +1 -1
  204. package/lib/esm/test/BulkExtractor.test.js +69 -44
  205. package/lib/esm/test/BulkExtractor.test.js.map +1 -1
  206. package/lib/esm/test/DeleteModal.test.js +4 -4
  207. package/lib/esm/test/DeleteModal.test.js.map +1 -1
  208. package/lib/esm/test/ReportAction.test.js +7 -5
  209. package/lib/esm/test/ReportAction.test.js.map +1 -1
  210. package/lib/esm/test/ReportMappingHorizontalTile.test.js +65 -26
  211. package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
  212. package/lib/esm/test/ReportMappings.test.js +41 -20
  213. package/lib/esm/test/ReportMappings.test.js.map +1 -1
  214. package/lib/esm/test/Reports.test.js +4 -4
  215. package/lib/esm/test/Reports.test.js.map +1 -1
  216. package/lib/esm/test/WidgetHeader.test.js +3 -3
  217. package/lib/esm/test/WidgetHeader.test.js.map +1 -1
  218. package/lib/esm/test/test-utils.d.ts +8 -0
  219. package/lib/esm/test/test-utils.d.ts.map +1 -1
  220. package/lib/esm/test/test-utils.js +15 -3
  221. package/lib/esm/test/test-utils.js.map +1 -1
  222. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  223. package/lib/esm/widget/ReportsConfigUiProvider.d.ts +10 -4
  224. package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
  225. package/lib/esm/widget/ReportsConfigUiProvider.js +12 -8
  226. package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
  227. package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
  228. package/lib/esm/widget/components/ActionPanel.js.map +1 -1
  229. package/lib/esm/widget/components/AddMappingsModal.d.ts +1 -1
  230. package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
  231. package/lib/esm/widget/components/AddMappingsModal.js +7 -7
  232. package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
  233. package/lib/esm/widget/components/AddMappingsModal.scss +1 -1
  234. package/lib/esm/widget/components/BulkExtractor.d.ts +8 -5
  235. package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
  236. package/lib/esm/widget/components/BulkExtractor.js +53 -36
  237. package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
  238. package/lib/esm/widget/components/Constants.d.ts.map +1 -1
  239. package/lib/esm/widget/components/Constants.js +3 -3
  240. package/lib/esm/widget/components/Constants.js.map +1 -1
  241. package/lib/esm/widget/components/DeleteModal.d.ts +1 -1
  242. package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
  243. package/lib/esm/widget/components/DeleteModal.js +6 -6
  244. package/lib/esm/widget/components/DeleteModal.js.map +1 -1
  245. package/lib/esm/widget/components/DeleteModal.scss +2 -2
  246. package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
  247. package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
  248. package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
  249. package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
  250. package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
  251. package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
  252. package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
  253. package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
  254. package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
  255. package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
  256. package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
  257. package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
  258. package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
  259. package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
  260. package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
  261. package/lib/esm/widget/components/ExtractionStatus.d.ts +1 -1
  262. package/lib/esm/widget/components/ExtractionStatus.d.ts.map +1 -1
  263. package/lib/esm/widget/components/ExtractionStatus.js +9 -9
  264. package/lib/esm/widget/components/ExtractionStatus.js.map +1 -1
  265. package/lib/esm/widget/components/ExtractionStatus.scss +1 -1
  266. package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -1
  267. package/lib/esm/widget/components/ExtractionToast.js +3 -3
  268. package/lib/esm/widget/components/ExtractionToast.js.map +1 -1
  269. package/lib/esm/widget/components/HorizontalTile.d.ts.map +1 -1
  270. package/lib/esm/widget/components/HorizontalTile.js +1 -2
  271. package/lib/esm/widget/components/HorizontalTile.js.map +1 -1
  272. package/lib/esm/widget/components/HorizontalTile.scss +1 -4
  273. package/lib/esm/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
  274. package/lib/esm/widget/components/LocalizedTablePaginator.js +1 -1
  275. package/lib/esm/widget/components/LocalizedTablePaginator.js.map +1 -1
  276. package/lib/esm/widget/components/ReportAction.d.ts +8 -0
  277. package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
  278. package/lib/esm/widget/components/ReportAction.js +10 -8
  279. package/lib/esm/widget/components/ReportAction.js.map +1 -1
  280. package/lib/esm/widget/components/ReportAction.scss +1 -1
  281. package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
  282. package/lib/esm/widget/components/ReportHorizontalTile.js +6 -6
  283. package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
  284. package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
  285. package/lib/esm/widget/components/ReportMappingHorizontalTile.js +47 -46
  286. package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
  287. package/lib/esm/widget/components/ReportMappings.d.ts +8 -0
  288. package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
  289. package/lib/esm/widget/components/ReportMappings.js +28 -14
  290. package/lib/esm/widget/components/ReportMappings.js.map +1 -1
  291. package/lib/esm/widget/components/Reports.d.ts +9 -1
  292. package/lib/esm/widget/components/Reports.d.ts.map +1 -1
  293. package/lib/esm/widget/components/Reports.js +8 -9
  294. package/lib/esm/widget/components/Reports.js.map +1 -1
  295. package/lib/esm/widget/components/Reports.scss +0 -1
  296. package/lib/esm/widget/components/ReportsConfigContext.d.ts +34 -4
  297. package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
  298. package/lib/esm/widget/components/ReportsConfigContext.js +28 -10
  299. package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
  300. package/lib/esm/widget/components/ReportsContainer.d.ts +3 -6
  301. package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
  302. package/lib/esm/widget/components/ReportsContainer.js +7 -5
  303. package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
  304. package/lib/esm/widget/components/ReportsContainer.scss +1 -1
  305. package/lib/esm/widget/components/ReportsHeader.d.ts +1 -1
  306. package/lib/esm/widget/components/ReportsHeader.d.ts.map +1 -1
  307. package/lib/esm/widget/components/ReportsHeader.js +6 -7
  308. package/lib/esm/widget/components/ReportsHeader.js.map +1 -1
  309. package/lib/esm/widget/components/ReportsRouter.d.ts.map +1 -1
  310. package/lib/esm/widget/components/ReportsRouter.js +3 -3
  311. package/lib/esm/widget/components/ReportsRouter.js.map +1 -1
  312. package/lib/esm/widget/components/SearchBar.d.ts +1 -1
  313. package/lib/esm/widget/components/SearchBar.d.ts.map +1 -1
  314. package/lib/esm/widget/components/SearchBar.js +4 -4
  315. package/lib/esm/widget/components/SearchBar.js.map +1 -1
  316. package/lib/esm/widget/components/SelectIModel.d.ts +1 -1
  317. package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -1
  318. package/lib/esm/widget/components/SelectIModel.js +2 -2
  319. package/lib/esm/widget/components/SelectIModel.js.map +1 -1
  320. package/lib/esm/widget/components/SelectIModel.scss +1 -1
  321. package/lib/esm/widget/components/utils.d.ts +1 -1
  322. package/lib/esm/widget/components/utils.d.ts.map +1 -1
  323. package/lib/esm/widget/components/utils.js +6 -6
  324. package/lib/esm/widget/components/utils.js.map +1 -1
  325. package/lib/esm/widget/components/utils.scss +1 -1
  326. package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -1
  327. package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -1
  328. package/lib/esm/widget/context/ReportsConfigApiContext.d.ts +3 -3
  329. package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
  330. package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -1
  331. package/lib/esm/widget/hooks/useValidator.d.ts +1 -4
  332. package/lib/esm/widget/hooks/useValidator.d.ts.map +1 -1
  333. package/lib/esm/widget/hooks/useValidator.js +3 -3
  334. package/lib/esm/widget/hooks/useValidator.js.map +1 -1
  335. package/package.json +9 -4
  336. package/src/ReportsConfigWidget.ts +9 -9
  337. package/src/reports-config-widget-react.ts +4 -3
  338. package/src/test/AddMappingModal.test.tsx +45 -70
  339. package/src/test/BulkExtractor.test.ts +73 -118
  340. package/src/test/DeleteModal.test.tsx +6 -23
  341. package/src/test/ReportAction.test.tsx +20 -38
  342. package/src/test/ReportMappingHorizontalTile.test.tsx +137 -106
  343. package/src/test/ReportMappings.test.tsx +73 -88
  344. package/src/test/Reports.test.tsx +30 -64
  345. package/src/test/WidgetHeader.test.tsx +3 -3
  346. package/src/test/test-utils.tsx +18 -8
  347. package/src/widget/ReportsConfigUiProvider.tsx +18 -37
  348. package/src/widget/components/ActionPanel.tsx +3 -14
  349. package/src/widget/components/AddMappingsModal.scss +1 -1
  350. package/src/widget/components/AddMappingsModal.tsx +21 -53
  351. package/src/widget/components/BulkExtractor.ts +67 -59
  352. package/src/widget/components/Constants.ts +4 -4
  353. package/src/widget/components/DeleteModal.scss +2 -2
  354. package/src/widget/components/DeleteModal.tsx +11 -41
  355. package/src/widget/components/ExtractionStates/FailedExtractionState.tsx +4 -9
  356. package/src/widget/components/ExtractionStates/QueuedExtractionState.tsx +4 -9
  357. package/src/widget/components/ExtractionStates/RunningExtractionState.tsx +4 -9
  358. package/src/widget/components/ExtractionStates/StartingExtractionState.tsx +4 -11
  359. package/src/widget/components/ExtractionStates/SucceededExtractionState.tsx +4 -9
  360. package/src/widget/components/ExtractionStatus.scss +1 -1
  361. package/src/widget/components/ExtractionStatus.tsx +9 -18
  362. package/src/widget/components/ExtractionToast.tsx +12 -9
  363. package/src/widget/components/HorizontalTile.scss +1 -4
  364. package/src/widget/components/HorizontalTile.tsx +12 -33
  365. package/src/widget/components/LocalizedTablePaginator.tsx +13 -44
  366. package/src/widget/components/ReportAction.scss +1 -1
  367. package/src/widget/components/ReportAction.tsx +26 -39
  368. package/src/widget/components/ReportHorizontalTile.tsx +45 -55
  369. package/src/widget/components/ReportMappingHorizontalTile.tsx +70 -78
  370. package/src/widget/components/ReportMappings.tsx +61 -132
  371. package/src/widget/components/Reports.scss +0 -1
  372. package/src/widget/components/Reports.tsx +30 -84
  373. package/src/widget/components/ReportsConfigContext.tsx +70 -32
  374. package/src/widget/components/ReportsContainer.scss +1 -1
  375. package/src/widget/components/ReportsContainer.tsx +12 -28
  376. package/src/widget/components/ReportsHeader.tsx +6 -19
  377. package/src/widget/components/ReportsRouter.tsx +4 -6
  378. package/src/widget/components/SearchBar.tsx +9 -13
  379. package/src/widget/components/SelectIModel.scss +1 -1
  380. package/src/widget/components/SelectIModel.tsx +9 -24
  381. package/src/widget/components/utils.scss +1 -1
  382. package/src/widget/components/utils.tsx +21 -69
  383. package/src/widget/context/BulkExtractorContext.tsx +4 -6
  384. package/src/widget/context/ReportsConfigApiContext.tsx +7 -8
  385. package/src/widget/hooks/useValidator.ts +10 -24
  386. package/tsconfig.json +11 -11
@@ -1,18 +1,16 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  import { IModelApp } from "@itwin/core-frontend";
6
6
  import type { IModelsClientOptions } from "@itwin/imodels-client-management";
7
7
  import { IModelsClient } from "@itwin/imodels-client-management";
8
- import { ExtractionClient, MappingsClient, REPORTING_BASE_PATH, ReportsClient } from "@itwin/insights-client";
8
+ import type { IExtractionClient, IMappingsClient, IReportsClient } from "@itwin/insights-client";
9
+ import { ExtractionClient, GROUPING_AND_MAPPING_BASE_PATH, MappingsClient, REPORTING_BASE_PATH, ReportsClient } from "@itwin/insights-client";
9
10
  import { toaster } from "@itwin/itwinui-react";
10
11
  import React, { useCallback, useEffect, useMemo, useState } from "react";
11
12
  import { BulkExtractorContext } from "../context/BulkExtractorContext";
12
- import type {
13
- GetAccessTokenFn,
14
- ReportsConfigApiProps,
15
- } from "../context/ReportsConfigApiContext";
13
+ import type { GetAccessTokenFn, ReportsConfigApiProps } from "../context/ReportsConfigApiContext";
16
14
  import { ReportsConfigApiContext } from "../context/ReportsConfigApiContext";
17
15
  import { REPORTS_CONFIG_BASE_URL } from "../ReportsConfigUiProvider";
18
16
  import { BulkExtractor } from "./BulkExtractor";
@@ -20,47 +18,75 @@ import { IMODELS_BASE_URL } from "./Constants";
20
18
  import { FailedExtractionToast, SuccessfulExtractionToast } from "./ExtractionToast";
21
19
  import { generateUrl } from "./utils";
22
20
 
21
+ /**
22
+ * Props for the {@link ReportsConfigContext} component.
23
+ * @public
24
+ */
23
25
  export interface ReportsConfigContextProps {
26
+ /**
27
+ * A callback function that returns an access token for authenticating API requests.
28
+ * If not specified, it defaults to the authorizationClient of the IModelApp.
29
+ */
24
30
  getAccessToken?: GetAccessTokenFn;
31
+ /**
32
+ * The base URL for the API requests. Defaults to https://api.bentley.com.
33
+ */
25
34
  baseUrl?: string;
26
35
  iTwinId: string;
36
+ /**
37
+ * The bulk extractor instance to use for extracting data. Internal use only.
38
+ */
27
39
  bulkExtractor?: BulkExtractor;
28
- reportsClient?: ReportsClient;
29
- mappingsClient?: MappingsClient;
30
- extractionClient?: ExtractionClient;
40
+ /**
41
+ * A custom implementation of ReportsClient. If provided, baseUrl is ignored.
42
+ */
43
+ reportsClient?: IReportsClient;
44
+ /**
45
+ * A custom implementation of MappingsClient. If provided, baseUrl is ignored.
46
+ */
47
+ mappingsClient?: IMappingsClient;
48
+ /**
49
+ * A custom implementation of ExtractionClient. If provided, baseUrl is ignored.
50
+ */
51
+ extractionClient?: IExtractionClient;
52
+ /**
53
+ * A custom implementation of IModelsClient. If provided, baseUrl is ignored.
54
+ */
31
55
  iModelsClient?: IModelsClient;
32
56
  children?: React.ReactNode;
33
57
  }
34
58
 
35
- const authorizationClientGetAccessToken = async () =>
36
- (await IModelApp.authorizationClient?.getAccessToken()) ?? "";
59
+ const authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? "";
37
60
 
61
+ /**
62
+ * Reports Config context providers required for all components.
63
+ * @public
64
+ */
38
65
  export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
39
- const reportsBaseUrl = useCallback(() => generateUrl(
40
- REPORTING_BASE_PATH,
41
- props.baseUrl || REPORTS_CONFIG_BASE_URL
42
- ), [props.baseUrl]);
43
- const iModelClientOptions: IModelsClientOptions = useMemo(() => ({
44
- api: { baseUrl: generateUrl(IMODELS_BASE_URL, props.baseUrl ?? REPORTS_CONFIG_BASE_URL) },
45
- }), [props.baseUrl]);
46
- const [extractionClient, setExtractionClient] = useState<ExtractionClient>(
47
- props.extractionClient ?? new ExtractionClient(reportsBaseUrl())
66
+ const reportsBaseUrl = useCallback(() => generateUrl(REPORTING_BASE_PATH, props.baseUrl || REPORTS_CONFIG_BASE_URL), [props.baseUrl]);
67
+ const groupingMappingBaseUrl = useCallback(() => generateUrl(GROUPING_AND_MAPPING_BASE_PATH, props.baseUrl || REPORTS_CONFIG_BASE_URL), [props.baseUrl]);
68
+ const iModelClientOptions: IModelsClientOptions = useMemo(
69
+ () => ({
70
+ api: { baseUrl: generateUrl(IMODELS_BASE_URL, props.baseUrl ?? REPORTS_CONFIG_BASE_URL) },
71
+ }),
72
+ [props.baseUrl],
48
73
  );
74
+ const [extractionClient, setExtractionClient] = useState<IExtractionClient>(props.extractionClient ?? new ExtractionClient(reportsBaseUrl()));
49
75
 
50
76
  const [apiConfig, setApiConfig] = useState<ReportsConfigApiProps>({
51
77
  getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,
52
78
  baseUrl: reportsBaseUrl(),
53
79
  iTwinId: props.iTwinId,
54
80
  reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),
55
- mappingsClient: props.mappingsClient ?? new MappingsClient(reportsBaseUrl()),
81
+ mappingsClient: props.mappingsClient ?? new MappingsClient(undefined, groupingMappingBaseUrl()),
56
82
  iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),
57
83
  });
58
84
 
59
85
  useEffect(() => {
60
86
  if (!props.extractionClient) {
61
- setExtractionClient(props.extractionClient ?? new ExtractionClient(reportsBaseUrl()));
87
+ setExtractionClient(props.extractionClient ?? new ExtractionClient(undefined, groupingMappingBaseUrl()));
62
88
  }
63
- }, [props.extractionClient, reportsBaseUrl]);
89
+ }, [groupingMappingBaseUrl, props.extractionClient]);
64
90
 
65
91
  const successfulExtractionToast = (iModelName: string, odataFeedUrl: string) => {
66
92
  toaster.positive(<SuccessfulExtractionToast iModelName={iModelName} odataFeedUrl={odataFeedUrl} />);
@@ -71,8 +97,12 @@ export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
71
97
  };
72
98
 
73
99
  const bulkExtractor = useMemo(
74
- () => ({ bulkExtractor: props.bulkExtractor ?? new BulkExtractor(apiConfig.reportsClient, extractionClient, apiConfig.getAccessToken, successfulExtractionToast, failedExtractionToast) }),
75
- [apiConfig.getAccessToken, apiConfig.reportsClient, extractionClient, props.bulkExtractor]
100
+ () => ({
101
+ bulkExtractor:
102
+ props.bulkExtractor ??
103
+ new BulkExtractor(apiConfig.reportsClient, extractionClient, apiConfig.getAccessToken, successfulExtractionToast, failedExtractionToast),
104
+ }),
105
+ [apiConfig.getAccessToken, apiConfig.reportsClient, extractionClient, props.bulkExtractor],
76
106
  );
77
107
 
78
108
  useEffect(() => {
@@ -81,16 +111,24 @@ export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
81
111
  baseUrl: props.baseUrl || REPORTS_CONFIG_BASE_URL,
82
112
  iTwinId: props.iTwinId,
83
113
  reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),
84
- mappingsClient: props.mappingsClient ?? new MappingsClient(reportsBaseUrl()),
114
+ mappingsClient: props.mappingsClient ?? new MappingsClient(undefined, groupingMappingBaseUrl()),
85
115
  iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),
86
116
  }));
87
- }, [props.getAccessToken, props.baseUrl, props.iTwinId, props.reportsClient, props.mappingsClient, props.iModelsClient, reportsBaseUrl, iModelClientOptions]);
117
+ }, [
118
+ props.getAccessToken,
119
+ props.baseUrl,
120
+ props.iTwinId,
121
+ props.reportsClient,
122
+ props.mappingsClient,
123
+ props.iModelsClient,
124
+ reportsBaseUrl,
125
+ iModelClientOptions,
126
+ groupingMappingBaseUrl,
127
+ ]);
88
128
 
89
129
  return (
90
130
  <ReportsConfigApiContext.Provider value={apiConfig}>
91
- <BulkExtractorContext.Provider value={bulkExtractor}>
92
- {props.children}
93
- </BulkExtractorContext.Provider>
131
+ <BulkExtractorContext.Provider value={bulkExtractor}>{props.children}</BulkExtractorContext.Provider>
94
132
  </ReportsConfigApiContext.Provider>
95
133
  );
96
134
  };
@@ -13,4 +13,4 @@
13
13
  box-sizing: border-box;
14
14
  height: 100%;
15
15
  overflow: auto;
16
- }
16
+ }
@@ -1,25 +1,22 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- import type { AccessToken } from "@itwin/core-bentley";
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
6
5
  import React, { useCallback, useState } from "react";
7
6
  import "./ReportsContainer.scss";
8
7
  import type { Report } from "@itwin/insights-client";
9
8
  import { useActiveIModelConnection } from "@itwin/appui-react";
10
9
  import { ReportsHeader } from "./ReportsHeader";
11
10
  import { ReportsRouter } from "./ReportsRouter";
12
- import { ReportsConfigContext } from "./ReportsConfigContext";
11
+ import type { ReportsConfigContextProps } from "./ReportsConfigContext";
12
+ import { ReportsConfigContext } from "./ReportsConfigContext"
13
13
 
14
- interface ReportsContainerProps {
15
- getAccessToken?: () => Promise<AccessToken>;
16
- baseUrl: string;
17
- }
14
+ export type ReportsContainerProps = Omit<ReportsConfigContextProps, "iTwinId" | "children">;
18
15
 
19
16
  export enum RouteStep {
20
17
  ReportsList,
21
18
  ReportAction,
22
- ReportMappings
19
+ ReportMappings,
23
20
  }
24
21
 
25
22
  export interface ReportsRouteFields {
@@ -32,14 +29,8 @@ export interface Route {
32
29
  reportsRoutingFields: ReportsRouteFields;
33
30
  }
34
31
 
35
- const ReportsContainer = ({
36
- getAccessToken,
37
- baseUrl,
38
- }: ReportsContainerProps) => {
39
-
40
- const [routingHistory, setRoutingHistory] = useState<Route[]>([
41
- { step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} },
42
- ]);
32
+ const ReportsContainer = (props: ReportsContainerProps) => {
33
+ const [routingHistory, setRoutingHistory] = useState<Route[]>([{ step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} }]);
43
34
  const currentRoute = routingHistory[routingHistory.length - 1];
44
35
  const iTwinId = useActiveIModelConnection()?.iTwinId ?? "";
45
36
  const navigateTo = useCallback((toRoute: (prev: Route | undefined) => Route) => {
@@ -53,17 +44,10 @@ const ReportsContainer = ({
53
44
  }, [routingHistory]);
54
45
 
55
46
  return (
56
- <ReportsConfigContext getAccessToken={getAccessToken} baseUrl={baseUrl} iTwinId={iTwinId}>
47
+ <ReportsConfigContext {...props} iTwinId={iTwinId}>
57
48
  <div className="rcw-reports-container">
58
- <ReportsHeader
59
- goBack={goBack}
60
- currentRoute={currentRoute}
61
- />
62
- <ReportsRouter
63
- currentRoute={currentRoute}
64
- navigateTo={navigateTo}
65
- goBack={goBack}
66
- />
49
+ <ReportsHeader goBack={goBack} currentRoute={currentRoute} />
50
+ <ReportsRouter currentRoute={currentRoute} navigateTo={navigateTo} goBack={goBack} />
67
51
  </div>
68
52
  </ReportsConfigContext>
69
53
  );
@@ -1,27 +1,14 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  import React from "react";
6
6
  import type { Route } from "./ReportsContainer";
7
7
  import { RouteStep } from "./ReportsContainer";
8
8
  import { WidgetHeader } from "./utils";
9
9
 
10
- export const ReportsHeader = ({
11
- goBack,
12
- currentRoute,
13
- }: {
14
- goBack: () => void;
15
- currentRoute: Route;
16
- }) => {
17
- const shouldDisableReturnFn =
18
- currentRoute.step === RouteStep.ReportsList ||
19
- currentRoute.step === RouteStep.ReportAction;
10
+ export const ReportsHeader = ({ goBack, currentRoute }: { goBack: () => void; currentRoute: Route }) => {
11
+ const shouldDisableReturnFn = currentRoute.step === RouteStep.ReportsList || currentRoute.step === RouteStep.ReportAction;
20
12
 
21
- return (
22
- <WidgetHeader
23
- returnFn={shouldDisableReturnFn ? undefined : goBack}
24
- title={currentRoute.title}
25
- />
26
- );
13
+ return <WidgetHeader returnFn={shouldDisableReturnFn ? undefined : goBack} title={currentRoute.title} />;
27
14
  };
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  import { useActiveIModelConnection } from "@itwin/appui-react";
6
6
  import React from "react";
7
7
  import { ReportsConfigWidget } from "../../ReportsConfigWidget";
@@ -29,9 +29,7 @@ export const ReportsRouter = ({
29
29
  onClickAddReport={() =>
30
30
  navigateTo(() => ({
31
31
  step: RouteStep.ReportAction,
32
- title: ReportsConfigWidget.localization.getLocalizedString(
33
- "ReportsConfigWidget:ITwinReports"
34
- ),
32
+ title: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ITwinReports"),
35
33
  reportsRoutingFields: {},
36
34
  }))
37
35
  }
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  import { SvgCloseSmall, SvgSearch } from "@itwin/itwinui-icons-react";
6
6
  import { IconButton, LabeledInput } from "@itwin/itwinui-react";
7
7
  import React, { useState } from "react";
@@ -14,16 +14,13 @@ interface SearchBarProps {
14
14
  disabled?: boolean;
15
15
  }
16
16
 
17
- export const SearchBar = ({
18
- searchValue,
19
- setSearchValue,
20
- disabled,
21
- }: SearchBarProps) => {
17
+ export const SearchBar = ({ searchValue, setSearchValue, disabled }: SearchBarProps) => {
22
18
  const [searchBarOpen, setSearchBarOpened] = useState<boolean>(false);
23
19
  const [searchBarClosing, setSearchBarClosing] = useState<boolean>(false);
24
20
 
25
21
  return searchBarOpen || searchValue ? (
26
- <div className="rcw-search-button"
22
+ <div
23
+ className="rcw-search-button"
27
24
  style={{
28
25
  animation: searchBarClosing ? "rcw-shrink .5s" : "rcw-expand .5s",
29
26
  }}
@@ -37,9 +34,7 @@ export const SearchBar = ({
37
34
  >
38
35
  <LabeledInput
39
36
  aria-label="search-textbox"
40
- placeholder={ReportsConfigWidget.localization.getLocalizedString(
41
- "ReportsConfigWidget:Search"
42
- )}
37
+ placeholder={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Search")}
43
38
  svgIcon={
44
39
  <IconButton
45
40
  onClick={() => setSearchBarClosing(true)}
@@ -60,7 +55,8 @@ export const SearchBar = ({
60
55
  styleType="borderless"
61
56
  data-testid="rcw-search-button"
62
57
  title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:SearchReport")}
63
- onClick={() => setSearchBarOpened(true)}>
58
+ onClick={() => setSearchBarOpened(true)}
59
+ >
64
60
  <SvgSearch />
65
61
  </IconButton>
66
62
  );
@@ -12,4 +12,4 @@
12
12
  gap: var(--iui-size-xs);
13
13
  width: 100%;
14
14
  }
15
- }
15
+ }
@@ -1,17 +1,11 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  import type { AccessToken } from "@itwin/core-bentley";
6
6
  import { AccessTokenAdapter } from "@itwin/imodels-access-frontend";
7
- import type {
8
- GetIModelListParams,
9
- IModelsClient,
10
- MinimalIModel,
11
- } from "@itwin/imodels-client-management";
12
- import {
13
- toArray,
14
- } from "@itwin/imodels-client-management";
7
+ import type { GetIModelListParams, IModelsClient, MinimalIModel } from "@itwin/imodels-client-management";
8
+ import { toArray } from "@itwin/imodels-client-management";
15
9
  import { ComboBox, Label } from "@itwin/itwinui-react";
16
10
  import React, { useEffect, useMemo, useState } from "react";
17
11
  import { ReportsConfigWidget } from "../../ReportsConfigWidget";
@@ -22,7 +16,7 @@ const fetchIModels = async (
22
16
  setiModels: React.Dispatch<React.SetStateAction<MinimalIModel[]>>,
23
17
  iTwinId: string,
24
18
  iModelsClient: IModelsClient,
25
- getAccessToken: () => Promise<AccessToken>
19
+ getAccessToken: () => Promise<AccessToken>,
26
20
  ) => {
27
21
  const accessToken = await getAccessToken();
28
22
  const authorization = AccessTokenAdapter.toAuthorizationCallback(accessToken);
@@ -30,9 +24,7 @@ const fetchIModels = async (
30
24
  urlParams: { iTwinId },
31
25
  authorization,
32
26
  };
33
- const iModels = await toArray(
34
- iModelsClient.iModels.getMinimalList(getiModelListParams)
35
- );
27
+ const iModels = await toArray(iModelsClient.iModels.getMinimalList(getiModelListParams));
36
28
  setiModels(iModels);
37
29
  };
38
30
 
@@ -41,10 +33,7 @@ interface SelectedIModelProps {
41
33
  setSelectedIModelId: (iModelId: string) => void;
42
34
  }
43
35
 
44
- export const SelectIModel = ({
45
- selectedIModelId,
46
- setSelectedIModelId,
47
- }: SelectedIModelProps) => {
36
+ export const SelectIModel = ({ selectedIModelId, setSelectedIModelId }: SelectedIModelProps) => {
48
37
  const { iTwinId, getAccessToken, iModelsClient } = useReportsConfigApi();
49
38
  const [iModels, setIModels] = useState<MinimalIModel[]>([]);
50
39
 
@@ -61,11 +50,7 @@ export const SelectIModel = ({
61
50
 
62
51
  return (
63
52
  <div className="rcw-select-imodel">
64
- <Label htmlFor="combo-input">
65
- {ReportsConfigWidget.localization.getLocalizedString(
66
- "ReportsConfigWidget:SelectIModel"
67
- )}
68
- </Label>
53
+ <Label htmlFor="combo-input">{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:SelectIModel")}</Label>
69
54
  <div className="rcw-combobox">
70
55
  <ComboBox<string>
71
56
  options={iModelOptions}
@@ -44,4 +44,4 @@
44
44
  .rcw-skeleton-block {
45
45
  height: calc(var(--iui-size-s) * 3);
46
46
  width: 100%;
47
- }
47
+ }
@@ -1,14 +1,9 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  import { SvgChevronLeft } from "@itwin/itwinui-icons-react";
6
- import {
7
- Icon,
8
- ProgressRadial,
9
- Text,
10
- toaster,
11
- } from "@itwin/itwinui-react";
6
+ import { Icon, ProgressRadial, Text, toaster } from "@itwin/itwinui-react";
12
7
  import "./utils.scss";
13
8
  import React from "react";
14
9
  import { ReportsConfigWidget } from "../../ReportsConfigWidget";
@@ -19,11 +14,7 @@ export interface WidgetHeaderProps {
19
14
  returnFn?: () => void;
20
15
  }
21
16
 
22
- export const WidgetHeader = ({
23
- title,
24
- disabled = false,
25
- returnFn,
26
- }: WidgetHeaderProps) => {
17
+ export const WidgetHeader = ({ title, disabled = false, returnFn }: WidgetHeaderProps) => {
27
18
  return (
28
19
  <div className="rcw-widget-header-container">
29
20
  {returnFn && (
@@ -44,76 +35,46 @@ export const WidgetHeader = ({
44
35
  };
45
36
 
46
37
  export const handleError = (errorStatus: number) => {
47
- let errorMessage = `${ReportsConfigWidget.localization.getLocalizedString(
48
- "ReportsConfigWidget:ErrorMessages.Error"
49
- )} `;
38
+ let errorMessage = `${ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.Error")} `;
50
39
  switch (errorStatus) {
51
40
  case 401:
52
- errorMessage += ReportsConfigWidget.localization.getLocalizedString(
53
- "ReportsConfigWidget:ErrorMessages.401"
54
- );
41
+ errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.401");
55
42
  break;
56
43
  case 403:
57
- errorMessage += ReportsConfigWidget.localization.getLocalizedString(
58
- "ReportsConfigWidget:ErrorMessages.403"
59
- );
44
+ errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.403");
60
45
  break;
61
46
  case 404:
62
- errorMessage += ReportsConfigWidget.localization.getLocalizedString(
63
- "ReportsConfigWidget:ErrorMessages.404"
64
- );
47
+ errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.404");
65
48
  break;
66
49
  case 409:
67
- errorMessage += ReportsConfigWidget.localization.getLocalizedString(
68
- "ReportsConfigWidget:ErrorMessages.409"
69
- );
50
+ errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.409");
70
51
  break;
71
52
  case 422:
72
- errorMessage += ReportsConfigWidget.localization.getLocalizedString(
73
- "ReportsConfigWidget:ErrorMessages.422"
74
- );
53
+ errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.422");
75
54
  break;
76
55
  case 429:
77
- errorMessage += ReportsConfigWidget.localization.getLocalizedString(
78
- "ReportsConfigWidget:ErrorMessages.429"
79
- );
56
+ errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.429");
80
57
  break;
81
58
  case 500:
82
- errorMessage += ReportsConfigWidget.localization.getLocalizedString(
83
- "ReportsConfigWidget:ErrorMessages.500"
84
- );
59
+ errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.500");
85
60
  break;
86
61
  case 502:
87
- errorMessage += ReportsConfigWidget.localization.getLocalizedString(
88
- "ReportsConfigWidget:ErrorMessages.502"
89
- );
62
+ errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.502");
90
63
  break;
91
64
  case 503:
92
- errorMessage += ReportsConfigWidget.localization.getLocalizedString(
93
- "ReportsConfigWidget:ErrorMessages.503"
94
- );
65
+ errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.503");
95
66
  break;
96
67
  default:
97
- errorMessage += ReportsConfigWidget.localization.getLocalizedString(
98
- "ReportsConfigWidget:ErrorMessages.SomethingWentWrong"
99
- );
68
+ errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.SomethingWentWrong");
100
69
  }
101
70
  toaster.negative(errorMessage);
102
71
  };
103
72
 
104
73
  export const LoadingOverlay = () => (
105
74
  <div className="rcw-center-overlay">
106
- <Text>
107
- {ReportsConfigWidget.localization.getLocalizedString(
108
- "ReportsConfigWidget:Loading"
109
- )}
110
- </Text>
75
+ <Text>{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Loading")}</Text>
111
76
  <ProgressRadial indeterminate />
112
- <Text>
113
- {ReportsConfigWidget.localization.getLocalizedString(
114
- "ReportsConfigWidget:PleaseWait"
115
- )}
116
- </Text>
77
+ <Text>{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:PleaseWait")}</Text>
117
78
  </div>
118
79
  );
119
80
  interface EmptyMessageProps {
@@ -123,11 +84,7 @@ export const EmptyMessage = ({ children }: EmptyMessageProps) => {
123
84
  return <div className="rcw-center-overlay">{children}</div>;
124
85
  };
125
86
 
126
- export const handleInputChange = <T,>(
127
- e: React.ChangeEvent<HTMLInputElement>,
128
- values: T,
129
- setValues: React.Dispatch<React.SetStateAction<T>>
130
- ) => {
87
+ export const handleInputChange = <T,>(e: React.ChangeEvent<HTMLInputElement>, values: T, setValues: React.Dispatch<React.SetStateAction<T>>) => {
131
88
  const { name, value } = e.target;
132
89
 
133
90
  setValues({
@@ -138,18 +95,13 @@ export const handleInputChange = <T,>(
138
95
 
139
96
  export const LoadingSpinner = () => {
140
97
  return (
141
- <div
142
- className="rcw-loading-spinner"
143
- data-testid="rcw-action-loading-spinner"
144
- >
98
+ <div className="rcw-loading-spinner" data-testid="rcw-action-loading-spinner">
145
99
  <ProgressRadial size="small" indeterminate />
146
100
  </div>
147
101
  );
148
102
  };
149
103
 
150
- export const SkeletonBlock = () => (
151
- <div className="rcw-skeleton-block iui-skeleton" />
152
- );
104
+ export const SkeletonBlock = () => <div className="rcw-skeleton-block iui-skeleton" />;
153
105
 
154
106
  export const generateUrl = (baseUrl: string, newBaseUrl: string) => {
155
107
  return baseUrl.replace("https://api.bentley.com", newBaseUrl);
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  import type { AccessToken } from "@itwin/core-bentley";
6
6
  import * as React from "react";
7
7
  import { createContext } from "react";
@@ -18,9 +18,7 @@ export const BulkExtractorContext = createContext<BulkExtractorContextProps>({})
18
18
  export const useBulkExtractor = () => {
19
19
  const context = React.useContext(BulkExtractorContext);
20
20
  if (!context) {
21
- throw new Error(
22
- "useBulkExtractor should be used within a BulkExtractorContext provider"
23
- );
21
+ throw new Error("useBulkExtractor should be used within a BulkExtractorContext provider");
24
22
  }
25
23
  return context;
26
24
  };
@@ -1,9 +1,10 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  import type { AccessToken } from "@itwin/core-bentley";
6
6
  import { IModelsClient } from "@itwin/imodels-client-management";
7
+ import type { IMappingsClient, IReportsClient } from "@itwin/insights-client";
7
8
  import { MappingsClient, ReportsClient } from "@itwin/insights-client";
8
9
  import * as React from "react";
9
10
  import { createContext } from "react";
@@ -14,8 +15,8 @@ export interface ReportsConfigApiProps {
14
15
  getAccessToken: GetAccessTokenFn;
15
16
  iTwinId: string;
16
17
  baseUrl: string;
17
- reportsClient: ReportsClient;
18
- mappingsClient: MappingsClient;
18
+ reportsClient: IReportsClient;
19
+ mappingsClient: IMappingsClient;
19
20
  iModelsClient: IModelsClient;
20
21
  }
21
22
 
@@ -31,9 +32,7 @@ export const ReportsConfigApiContext = createContext<ReportsConfigApiProps>({
31
32
  export const useReportsConfigApi = () => {
32
33
  const context = React.useContext(ReportsConfigApiContext);
33
34
  if (!context) {
34
- throw new Error(
35
- "useReportsConfigApi should be used within a ReportsConfigApiContext provider"
36
- );
35
+ throw new Error("useReportsConfigApi should be used within a ReportsConfigApiContext provider");
37
36
  }
38
37
  return context;
39
38
  };