@itwin/reports-config-widget-react 0.2.1 → 0.4.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 (343) hide show
  1. package/.rush/temp/operation/rebuild/all.log +9 -0
  2. package/.rush/temp/operation/rebuild/state.json +3 -0
  3. package/.rush/temp/package-deps_rebuild.json +48 -44
  4. package/.rush/temp/shrinkwrap-deps.json +228 -207
  5. package/CHANGELOG.json +44 -0
  6. package/CHANGELOG.md +24 -1
  7. package/coverage/clover.xml +562 -542
  8. package/coverage/coverage-final.json +24 -20
  9. package/coverage/lcov-report/index.html +51 -51
  10. package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +22 -22
  11. package/coverage/lcov-report/src/index.html +21 -21
  12. package/coverage/lcov-report/src/test/index.html +11 -11
  13. package/coverage/lcov-report/src/test/test-utils.tsx.html +20 -140
  14. package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +14 -35
  15. package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +26 -20
  16. package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +94 -109
  17. package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +55 -52
  18. package/coverage/lcov-report/src/widget/components/Constants.ts.html +1 -1
  19. package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +28 -46
  20. package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +1 -1
  21. package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +1 -1
  22. package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +1 -1
  23. package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +1 -1
  24. package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +1 -1
  25. package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
  26. package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +1 -1
  27. package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +1 -1
  28. package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +3 -3
  29. package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +8 -8
  30. package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +36 -81
  31. package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +38 -41
  32. package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +46 -46
  33. package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +127 -142
  34. package/coverage/lcov-report/src/widget/components/Reports.tsx.html +189 -312
  35. package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +370 -0
  36. package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +111 -33
  37. package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +166 -0
  38. package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +274 -0
  39. package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +22 -7
  40. package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +40 -94
  41. package/coverage/lcov-report/src/widget/components/index.html +142 -97
  42. package/coverage/lcov-report/src/widget/components/utils.tsx.html +22 -19
  43. package/coverage/lcov-report/src/widget/context/{ReportsApiConfigContext.tsx.html → BulkExtractorContext.tsx.html} +23 -26
  44. package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +202 -0
  45. package/coverage/lcov-report/src/widget/context/index.html +30 -15
  46. package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
  47. package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +11 -11
  48. package/coverage/lcov-report/src/widget/index.html +13 -13
  49. package/coverage/lcov.info +1036 -1034
  50. package/jest.config.js +1 -0
  51. package/lib/cjs/ReportsConfigWidget.js +1 -1
  52. package/lib/cjs/ReportsConfigWidget.js.map +1 -1
  53. package/lib/cjs/reports-config-widget-react.d.ts +5 -0
  54. package/lib/cjs/reports-config-widget-react.d.ts.map +1 -1
  55. package/lib/cjs/reports-config-widget-react.js +11 -0
  56. package/lib/cjs/reports-config-widget-react.js.map +1 -1
  57. package/lib/cjs/test/AddMappingModal.test.js +20 -34
  58. package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
  59. package/lib/cjs/test/BulkExtractor.test.js +13 -19
  60. package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
  61. package/lib/cjs/test/DeleteModal.test.d.ts.map +1 -1
  62. package/lib/cjs/test/DeleteModal.test.js +4 -62
  63. package/lib/cjs/test/DeleteModal.test.js.map +1 -1
  64. package/lib/cjs/test/ReportAction.test.js +14 -79
  65. package/lib/cjs/test/ReportAction.test.js.map +1 -1
  66. package/lib/cjs/test/ReportMappingHorizontalTile.test.js +20 -54
  67. package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
  68. package/lib/cjs/test/ReportMappings.test.d.ts.map +1 -1
  69. package/lib/cjs/test/ReportMappings.test.js +51 -106
  70. package/lib/cjs/test/ReportMappings.test.js.map +1 -1
  71. package/lib/cjs/test/Reports.test.js +41 -96
  72. package/lib/cjs/test/Reports.test.js.map +1 -1
  73. package/lib/cjs/test/WidgetHeader.test.js +9 -3
  74. package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
  75. package/lib/cjs/test/test-utils.d.ts +3 -8
  76. package/lib/cjs/test/test-utils.d.ts.map +1 -1
  77. package/lib/cjs/test/test-utils.js +6 -34
  78. package/lib/cjs/test/test-utils.js.map +1 -1
  79. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  80. package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +3 -3
  81. package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
  82. package/lib/cjs/widget/ReportsConfigUiProvider.js +5 -7
  83. package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
  84. package/lib/cjs/widget/components/ActionPanel.d.ts +3 -3
  85. package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
  86. package/lib/cjs/widget/components/ActionPanel.js +4 -4
  87. package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
  88. package/lib/cjs/widget/components/ActionPanel.scss +2 -3
  89. package/lib/cjs/widget/components/AddMappingsModal.d.ts +4 -4
  90. package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
  91. package/lib/cjs/widget/components/AddMappingsModal.js +39 -43
  92. package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
  93. package/lib/cjs/widget/components/AddMappingsModal.scss +1 -2
  94. package/lib/cjs/widget/components/BulkExtractor.d.ts +4 -4
  95. package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
  96. package/lib/cjs/widget/components/BulkExtractor.js +8 -8
  97. package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
  98. package/lib/cjs/widget/components/DeleteModal.d.ts +4 -5
  99. package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
  100. package/lib/cjs/widget/components/DeleteModal.js +11 -15
  101. package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
  102. package/lib/cjs/widget/components/DeleteModal.scss +2 -3
  103. package/lib/cjs/widget/components/ExtractionStatus.js +2 -2
  104. package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
  105. package/lib/cjs/widget/components/ExtractionStatus.scss +6 -7
  106. package/lib/cjs/widget/components/HorizontalTile.js +2 -2
  107. package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
  108. package/lib/cjs/widget/components/HorizontalTile.scss +11 -14
  109. package/lib/cjs/widget/components/LocalizedTablePaginator.js +2 -2
  110. package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
  111. package/lib/cjs/widget/components/ReportAction.d.ts +4 -5
  112. package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
  113. package/lib/cjs/widget/components/ReportAction.js +24 -26
  114. package/lib/cjs/widget/components/ReportAction.js.map +1 -1
  115. package/lib/cjs/widget/components/ReportAction.scss +1 -2
  116. package/lib/cjs/widget/components/ReportHorizontalTile.d.ts +4 -4
  117. package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
  118. package/lib/cjs/widget/components/ReportHorizontalTile.js +33 -20
  119. package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
  120. package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts +1 -1
  121. package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
  122. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +36 -21
  123. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
  124. package/lib/cjs/widget/components/ReportMappings.d.ts +4 -6
  125. package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
  126. package/lib/cjs/widget/components/ReportMappings.js +50 -63
  127. package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
  128. package/lib/cjs/widget/components/ReportMappings.scss +10 -11
  129. package/lib/cjs/widget/components/Reports.d.ts +6 -1
  130. package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
  131. package/lib/cjs/widget/components/Reports.js +53 -94
  132. package/lib/cjs/widget/components/Reports.js.map +1 -1
  133. package/lib/cjs/widget/components/Reports.scss +15 -15
  134. package/lib/cjs/widget/components/ReportsConfigContext.d.ts +18 -0
  135. package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -0
  136. package/lib/cjs/widget/components/ReportsConfigContext.js +79 -0
  137. package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -0
  138. package/lib/cjs/widget/components/ReportsContainer.d.ts +14 -0
  139. package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
  140. package/lib/cjs/widget/components/ReportsContainer.js +27 -16
  141. package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
  142. package/lib/cjs/widget/components/ReportsContainer.scss +1 -3
  143. package/lib/cjs/widget/components/ReportsHeader.d.ts +7 -0
  144. package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -0
  145. package/lib/cjs/widget/components/ReportsHeader.js +20 -0
  146. package/lib/cjs/widget/components/ReportsHeader.js.map +1 -0
  147. package/lib/cjs/widget/components/ReportsRouter.d.ts +8 -0
  148. package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -0
  149. package/lib/cjs/widget/components/ReportsRouter.js +51 -0
  150. package/lib/cjs/widget/components/ReportsRouter.js.map +1 -0
  151. package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
  152. package/lib/cjs/widget/components/SearchBar.js +4 -5
  153. package/lib/cjs/widget/components/SearchBar.js.map +1 -1
  154. package/lib/cjs/widget/components/SearchBar.scss +1 -2
  155. package/lib/cjs/widget/components/SelectIModel.d.ts +3 -3
  156. package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
  157. package/lib/cjs/widget/components/SelectIModel.js +10 -30
  158. package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
  159. package/lib/cjs/widget/components/SelectIModel.scss +2 -3
  160. package/lib/cjs/widget/components/utils.d.ts +1 -1
  161. package/lib/cjs/widget/components/utils.d.ts.map +1 -1
  162. package/lib/cjs/widget/components/utils.js +1 -1
  163. package/lib/cjs/widget/components/utils.js.map +1 -1
  164. package/lib/cjs/widget/components/utils.scss +16 -8
  165. package/lib/cjs/widget/context/BulkExtractorContext.d.ts +10 -0
  166. package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -0
  167. package/lib/cjs/widget/context/{ReportsApiConfigContext.js → BulkExtractorContext.js} +7 -10
  168. package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -0
  169. package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts +16 -0
  170. package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -0
  171. package/lib/cjs/widget/context/ReportsConfigApiContext.js +43 -0
  172. package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -0
  173. package/lib/cjs/widget/hooks/useValidator.js +1 -1
  174. package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
  175. package/lib/esm/ReportsConfigWidget.js +1 -1
  176. package/lib/esm/ReportsConfigWidget.js.map +1 -1
  177. package/lib/esm/reports-config-widget-react.d.ts +5 -0
  178. package/lib/esm/reports-config-widget-react.d.ts.map +1 -1
  179. package/lib/esm/reports-config-widget-react.js +5 -0
  180. package/lib/esm/reports-config-widget-react.js.map +1 -1
  181. package/lib/esm/test/AddMappingModal.test.js +17 -31
  182. package/lib/esm/test/AddMappingModal.test.js.map +1 -1
  183. package/lib/esm/test/BulkExtractor.test.js +14 -17
  184. package/lib/esm/test/BulkExtractor.test.js.map +1 -1
  185. package/lib/esm/test/DeleteModal.test.d.ts.map +1 -1
  186. package/lib/esm/test/DeleteModal.test.js +5 -44
  187. package/lib/esm/test/DeleteModal.test.js.map +1 -1
  188. package/lib/esm/test/ReportAction.test.js +14 -60
  189. package/lib/esm/test/ReportAction.test.js.map +1 -1
  190. package/lib/esm/test/ReportMappingHorizontalTile.test.js +4 -38
  191. package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
  192. package/lib/esm/test/ReportMappings.test.d.ts.map +1 -1
  193. package/lib/esm/test/ReportMappings.test.js +43 -98
  194. package/lib/esm/test/ReportMappings.test.js.map +1 -1
  195. package/lib/esm/test/Reports.test.js +24 -60
  196. package/lib/esm/test/Reports.test.js.map +1 -1
  197. package/lib/esm/test/WidgetHeader.test.js +8 -2
  198. package/lib/esm/test/WidgetHeader.test.js.map +1 -1
  199. package/lib/esm/test/test-utils.d.ts +3 -8
  200. package/lib/esm/test/test-utils.d.ts.map +1 -1
  201. package/lib/esm/test/test-utils.js +4 -31
  202. package/lib/esm/test/test-utils.js.map +1 -1
  203. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  204. package/lib/esm/widget/ReportsConfigUiProvider.d.ts +3 -3
  205. package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
  206. package/lib/esm/widget/ReportsConfigUiProvider.js +2 -4
  207. package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
  208. package/lib/esm/widget/components/ActionPanel.d.ts +3 -3
  209. package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
  210. package/lib/esm/widget/components/ActionPanel.js +4 -4
  211. package/lib/esm/widget/components/ActionPanel.js.map +1 -1
  212. package/lib/esm/widget/components/ActionPanel.scss +2 -3
  213. package/lib/esm/widget/components/AddMappingsModal.d.ts +4 -4
  214. package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
  215. package/lib/esm/widget/components/AddMappingsModal.js +35 -39
  216. package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
  217. package/lib/esm/widget/components/AddMappingsModal.scss +1 -2
  218. package/lib/esm/widget/components/BulkExtractor.d.ts +4 -4
  219. package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
  220. package/lib/esm/widget/components/BulkExtractor.js +7 -8
  221. package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
  222. package/lib/esm/widget/components/DeleteModal.d.ts +4 -5
  223. package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
  224. package/lib/esm/widget/components/DeleteModal.js +11 -15
  225. package/lib/esm/widget/components/DeleteModal.js.map +1 -1
  226. package/lib/esm/widget/components/DeleteModal.scss +2 -3
  227. package/lib/esm/widget/components/ExtractionStatus.scss +6 -7
  228. package/lib/esm/widget/components/HorizontalTile.scss +11 -14
  229. package/lib/esm/widget/components/ReportAction.d.ts +4 -5
  230. package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
  231. package/lib/esm/widget/components/ReportAction.js +17 -21
  232. package/lib/esm/widget/components/ReportAction.js.map +1 -1
  233. package/lib/esm/widget/components/ReportAction.scss +1 -2
  234. package/lib/esm/widget/components/ReportHorizontalTile.d.ts +4 -4
  235. package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
  236. package/lib/esm/widget/components/ReportHorizontalTile.js +6 -9
  237. package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
  238. package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts +1 -1
  239. package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
  240. package/lib/esm/widget/components/ReportMappingHorizontalTile.js +12 -13
  241. package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
  242. package/lib/esm/widget/components/ReportMappings.d.ts +4 -6
  243. package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
  244. package/lib/esm/widget/components/ReportMappings.js +43 -56
  245. package/lib/esm/widget/components/ReportMappings.js.map +1 -1
  246. package/lib/esm/widget/components/ReportMappings.scss +10 -11
  247. package/lib/esm/widget/components/Reports.d.ts +6 -1
  248. package/lib/esm/widget/components/Reports.d.ts.map +1 -1
  249. package/lib/esm/widget/components/Reports.js +46 -87
  250. package/lib/esm/widget/components/Reports.js.map +1 -1
  251. package/lib/esm/widget/components/Reports.scss +15 -15
  252. package/lib/esm/widget/components/ReportsConfigContext.d.ts +18 -0
  253. package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -0
  254. package/lib/esm/widget/components/ReportsConfigContext.js +56 -0
  255. package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -0
  256. package/lib/esm/widget/components/ReportsContainer.d.ts +14 -0
  257. package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
  258. package/lib/esm/widget/components/ReportsContainer.js +27 -17
  259. package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
  260. package/lib/esm/widget/components/ReportsContainer.scss +1 -3
  261. package/lib/esm/widget/components/ReportsHeader.d.ts +7 -0
  262. package/lib/esm/widget/components/ReportsHeader.d.ts.map +1 -0
  263. package/lib/esm/widget/components/ReportsHeader.js +13 -0
  264. package/lib/esm/widget/components/ReportsHeader.js.map +1 -0
  265. package/lib/esm/widget/components/ReportsRouter.d.ts +8 -0
  266. package/lib/esm/widget/components/ReportsRouter.d.ts.map +1 -0
  267. package/lib/esm/widget/components/ReportsRouter.js +44 -0
  268. package/lib/esm/widget/components/ReportsRouter.js.map +1 -0
  269. package/lib/esm/widget/components/SearchBar.d.ts.map +1 -1
  270. package/lib/esm/widget/components/SearchBar.js +2 -3
  271. package/lib/esm/widget/components/SearchBar.js.map +1 -1
  272. package/lib/esm/widget/components/SearchBar.scss +1 -2
  273. package/lib/esm/widget/components/SelectIModel.d.ts +3 -3
  274. package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -1
  275. package/lib/esm/widget/components/SelectIModel.js +7 -27
  276. package/lib/esm/widget/components/SelectIModel.js.map +1 -1
  277. package/lib/esm/widget/components/SelectIModel.scss +2 -3
  278. package/lib/esm/widget/components/utils.d.ts +1 -1
  279. package/lib/esm/widget/components/utils.d.ts.map +1 -1
  280. package/lib/esm/widget/components/utils.js +2 -2
  281. package/lib/esm/widget/components/utils.js.map +1 -1
  282. package/lib/esm/widget/components/utils.scss +16 -8
  283. package/lib/esm/widget/context/BulkExtractorContext.d.ts +10 -0
  284. package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -0
  285. package/lib/esm/widget/context/BulkExtractorContext.js +11 -0
  286. package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -0
  287. package/lib/esm/widget/context/ReportsConfigApiContext.d.ts +16 -0
  288. package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -0
  289. package/lib/esm/widget/context/ReportsConfigApiContext.js +20 -0
  290. package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -0
  291. package/lib/public/locales/en/ReportsConfigWidget.json +6 -1
  292. package/package.json +29 -29
  293. package/public/locales/en/ReportsConfigWidget.json +6 -1
  294. package/reports-config-widget-react.build.error.log +6 -6
  295. package/reports-config-widget-react.build.log +52 -49
  296. package/src/reports-config-widget-react.ts +6 -0
  297. package/src/test/AddMappingModal.test.tsx +20 -37
  298. package/src/test/BulkExtractor.test.ts +15 -17
  299. package/src/test/DeleteModal.test.tsx +4 -73
  300. package/src/test/ReportAction.test.tsx +17 -90
  301. package/src/test/ReportMappingHorizontalTile.test.tsx +3 -54
  302. package/src/test/ReportMappings.test.tsx +50 -135
  303. package/src/test/Reports.test.tsx +21 -80
  304. package/src/test/WidgetHeader.test.tsx +9 -2
  305. package/src/test/test-utils.tsx +9 -49
  306. package/src/widget/ReportsConfigUiProvider.tsx +7 -14
  307. package/src/widget/components/ActionPanel.scss +2 -3
  308. package/src/widget/components/ActionPanel.tsx +17 -15
  309. package/src/widget/components/AddMappingsModal.scss +1 -2
  310. package/src/widget/components/AddMappingsModal.tsx +55 -60
  311. package/src/widget/components/BulkExtractor.ts +11 -10
  312. package/src/widget/components/DeleteModal.scss +2 -3
  313. package/src/widget/components/DeleteModal.tsx +17 -23
  314. package/src/widget/components/ExtractionStatus.scss +6 -7
  315. package/src/widget/components/HorizontalTile.scss +11 -14
  316. package/src/widget/components/ReportAction.scss +1 -2
  317. package/src/widget/components/ReportAction.tsx +18 -33
  318. package/src/widget/components/ReportHorizontalTile.tsx +11 -12
  319. package/src/widget/components/ReportMappingHorizontalTile.tsx +30 -30
  320. package/src/widget/components/ReportMappings.scss +10 -11
  321. package/src/widget/components/ReportMappings.tsx +67 -72
  322. package/src/widget/components/Reports.scss +15 -15
  323. package/src/widget/components/Reports.tsx +140 -181
  324. package/src/widget/components/ReportsConfigContext.tsx +95 -0
  325. package/src/widget/components/ReportsContainer.scss +1 -3
  326. package/src/widget/components/ReportsContainer.tsx +47 -21
  327. package/src/widget/components/ReportsHeader.tsx +27 -0
  328. package/src/widget/components/ReportsRouter.tsx +63 -0
  329. package/src/widget/components/SearchBar.scss +1 -2
  330. package/src/widget/components/SearchBar.tsx +7 -2
  331. package/src/widget/components/SelectIModel.scss +2 -3
  332. package/src/widget/components/SelectIModel.tsx +11 -29
  333. package/src/widget/components/utils.scss +16 -8
  334. package/src/widget/components/utils.tsx +8 -7
  335. package/src/widget/context/{ReportsApiConfigContext.tsx → BulkExtractorContext.tsx} +9 -10
  336. package/src/widget/context/ReportsConfigApiContext.tsx +39 -0
  337. package/lib/cjs/widget/context/ReportsApiConfigContext.d.ts +0 -9
  338. package/lib/cjs/widget/context/ReportsApiConfigContext.d.ts.map +0 -1
  339. package/lib/cjs/widget/context/ReportsApiConfigContext.js.map +0 -1
  340. package/lib/esm/widget/context/ReportsApiConfigContext.d.ts +0 -9
  341. package/lib/esm/widget/context/ReportsApiConfigContext.d.ts.map +0 -1
  342. package/lib/esm/widget/context/ReportsApiConfigContext.js +0 -14
  343. package/lib/esm/widget/context/ReportsApiConfigContext.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,UAAU,EACV,cAAc,EACd,IAAI,EACJ,OAAO,GACR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAQhE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,QAAQ,GACU,EAAE,EAAE;IACtB,OAAO,CACL,6BAAK,SAAS,EAAC,6BAA6B;QACzC,QAAQ,IAAI,CACX,oBAAC,UAAU,IACT,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAC,YAAY;YAEtB,oBAAC,cAAc,OAAG,CACP,CACd;QACD,oBAAC,IAAI,IAAC,SAAS,EAAC,WAAW,EAAC,OAAO,EAAC,OAAO,IACxC,KAAK,CACD,CACH,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,WAAmB,EAAE,EAAE;IACjD,IAAI,YAAY,GAAG,GAAG,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACvE,yCAAyC,CAC1C,GAAG,CAAC;IACL,QAAQ,WAAW,EAAE;QACnB,KAAK,GAAG;YACN,YAAY,IAAI,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACjE,uCAAuC,CACxC,CAAC;YACF,MAAM;QACR,KAAK,GAAG;YACN,YAAY,IAAI,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACjE,uCAAuC,CACxC,CAAC;YACF,MAAM;QACR,KAAK,GAAG;YACN,YAAY,IAAI,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACjE,uCAAuC,CACxC,CAAC;YACF,MAAM;QACR,KAAK,GAAG;YACN,YAAY,IAAI,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACjE,uCAAuC,CACxC,CAAC;YACF,MAAM;QACR,KAAK,GAAG;YACN,YAAY,IAAI,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACjE,uCAAuC,CACxC,CAAC;YACF,MAAM;QACR,KAAK,GAAG;YACN,YAAY,IAAI,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACjE,uCAAuC,CACxC,CAAC;YACF,MAAM;QACR,KAAK,GAAG;YACN,YAAY,IAAI,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACjE,uCAAuC,CACxC,CAAC;YACF,MAAM;QACR,KAAK,GAAG;YACN,YAAY,IAAI,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACjE,uCAAuC,CACxC,CAAC;YACF,MAAM;QACR,KAAK,GAAG;YACN,YAAY,IAAI,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACjE,uCAAuC,CACxC,CAAC;YACF,MAAM;QACR;YACE,YAAY,IAAI,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACjE,sDAAsD,CACvD,CAAC;KACL;IACD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAClC,6BAAK,SAAS,EAAC,oBAAoB;IACjC,oBAAC,IAAI,QACF,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAClD,6BAA6B,CAC9B,CACI;IACP,oBAAC,cAAc,IAAC,aAAa,SAAG;IAChC,oBAAC,IAAI,QACF,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAClD,gCAAgC,CACjC,CACI,CACH,CACP,CAAC;AAIF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE;IAC9D,OAAO,6BAAK,SAAS,EAAC,oBAAoB,IAAE,QAAQ,CAAO,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,CAAsC,EACtC,MAAS,EACT,SAAkD,EAClD,EAAE;IACF,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;IAEjC,SAAS,CAAC;QACR,GAAG,MAAM;QACT,CAAC,IAAI,CAAC,EAAE,KAAK;KACd,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,CACL,6BACE,SAAS,EAAC,qBAAqB,iBACnB,4BAA4B;QAExC,oBAAC,cAAc,IAAC,IAAI,EAAC,OAAO,EAAC,aAAa,SAAG,CACzC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CACjC,6BAAK,SAAS,EAAC,iCAAiC,GAAG,CACpD,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,UAAkB,EAAE,EAAE;IACjE,OAAO,OAAO,CAAC,OAAO,CAAC,yBAAyB,EAAE,UAAU,CAAC,CAAC;AAChE,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 { SvgChevronLeft } from \"@itwin/itwinui-icons-react\";\nimport {\n IconButton,\n ProgressRadial,\n Text,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport \"./utils.scss\";\nimport React from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport interface WidgetHeaderProps {\n title: string;\n disabled?: boolean;\n returnFn?: () => Promise<void>;\n}\n\nexport const WidgetHeader = ({\n title,\n disabled = false,\n returnFn,\n}: WidgetHeaderProps) => {\n return (\n <div className=\"rcw-widget-header-container\">\n {returnFn && (\n <IconButton\n onClick={returnFn}\n disabled={disabled}\n styleType=\"borderless\"\n >\n <SvgChevronLeft />\n </IconButton>\n )}\n <Text className=\"rcw-title\" variant=\"title\">\n {title}\n </Text>\n </div>\n );\n};\n\nexport const handleError = (errorStatus: number) => {\n let errorMessage = `${ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.Error\"\n )} `;\n switch (errorStatus) {\n case 401:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.401\"\n );\n break;\n case 403:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.403\"\n );\n break;\n case 404:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.404\"\n );\n break;\n case 409:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.409\"\n );\n break;\n case 422:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.422\"\n );\n break;\n case 429:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.429\"\n );\n break;\n case 500:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.500\"\n );\n break;\n case 502:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.502\"\n );\n break;\n case 503:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.503\"\n );\n break;\n default:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.SomethingWentWrong\"\n );\n }\n toaster.negative(errorMessage);\n};\n\nexport const LoadingOverlay = () => (\n <div className=\"rcw-center-overlay\">\n <Text>\n {ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Loading\"\n )}\n </Text>\n <ProgressRadial indeterminate />\n <Text>\n {ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:PleaseWait\"\n )}\n </Text>\n </div>\n);\ninterface EmptyMessageProps {\n children?: React.ReactNode;\n}\nexport const EmptyMessage = ({ children }: EmptyMessageProps) => {\n return <div className=\"rcw-center-overlay\">{children}</div>;\n};\n\nexport const handleInputChange = <T,>(\n e: React.ChangeEvent<HTMLInputElement>,\n values: T,\n setValues: React.Dispatch<React.SetStateAction<T>>\n) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const LoadingSpinner = () => {\n return (\n <div\n className=\"rcw-loading-spinner\"\n data-testid=\"rcw-action-loading-spinner\"\n >\n <ProgressRadial size=\"small\" indeterminate />\n </div>\n );\n};\n\nexport const SkeletonBlock = () => (\n <div className=\"rcw-skeleton-block iui-skeleton\" />\n);\n\nexport const generateUrl = (baseUrl: string, newBaseUrl: string) => {\n return baseUrl.replace(\"https://api.bentley.com\", newBaseUrl);\n};\n\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"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","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 { SvgChevronLeft } from \"@itwin/itwinui-icons-react\";\nimport {\n Icon,\n ProgressRadial,\n Text,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport \"./utils.scss\";\nimport React from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport interface WidgetHeaderProps {\n title: string;\n disabled?: boolean;\n returnFn?: () => void;\n}\n\nexport const WidgetHeader = ({\n title,\n disabled = false,\n returnFn,\n}: WidgetHeaderProps) => {\n return (\n <div className=\"rcw-widget-header-container\">\n {returnFn && (\n <Icon\n className={`${disabled ? \"rcw-chevron-disabled\" : \"rcw-chevron\"}`}\n onClick={disabled ? undefined : returnFn}\n size=\"large\"\n title={ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Back\")}\n >\n <SvgChevronLeft />\n </Icon>\n )}\n <Text className=\"rcw-title\" variant=\"title\">\n {title}\n </Text>\n </div>\n );\n};\n\nexport const handleError = (errorStatus: number) => {\n let errorMessage = `${ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.Error\"\n )} `;\n switch (errorStatus) {\n case 401:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.401\"\n );\n break;\n case 403:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.403\"\n );\n break;\n case 404:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.404\"\n );\n break;\n case 409:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.409\"\n );\n break;\n case 422:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.422\"\n );\n break;\n case 429:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.429\"\n );\n break;\n case 500:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.500\"\n );\n break;\n case 502:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.502\"\n );\n break;\n case 503:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.503\"\n );\n break;\n default:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.SomethingWentWrong\"\n );\n }\n toaster.negative(errorMessage);\n};\n\nexport const LoadingOverlay = () => (\n <div className=\"rcw-center-overlay\">\n <Text>\n {ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Loading\"\n )}\n </Text>\n <ProgressRadial indeterminate />\n <Text>\n {ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:PleaseWait\"\n )}\n </Text>\n </div>\n);\ninterface EmptyMessageProps {\n children?: React.ReactNode;\n}\nexport const EmptyMessage = ({ children }: EmptyMessageProps) => {\n return <div className=\"rcw-center-overlay\">{children}</div>;\n};\n\nexport const handleInputChange = <T,>(\n e: React.ChangeEvent<HTMLInputElement>,\n values: T,\n setValues: React.Dispatch<React.SetStateAction<T>>\n) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const LoadingSpinner = () => {\n return (\n <div\n className=\"rcw-loading-spinner\"\n data-testid=\"rcw-action-loading-spinner\"\n >\n <ProgressRadial size=\"small\" indeterminate />\n </div>\n );\n};\n\nexport const SkeletonBlock = () => (\n <div className=\"rcw-skeleton-block iui-skeleton\" />\n);\n\nexport const generateUrl = (baseUrl: string, newBaseUrl: string) => {\n return baseUrl.replace(\"https://api.bentley.com\", newBaseUrl);\n};\n\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n"]}
@@ -2,20 +2,28 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/itwinui-css/scss/variables";
6
- @import "~@itwin/itwinui-css/scss/icon/index";
7
- @import "~@itwin/itwinui-css/scss/button/index";
8
5
 
9
6
  .rcw-widget-header-container {
10
7
  display: flex;
11
- margin-bottom: $iui-baseline;
12
- align-items: center;
8
+ margin-bottom: calc(var(--iui-size-s) * 2);
9
+
10
+ .rcw-chevron {
11
+ cursor: pointer;
12
+ align-self: center;
13
+ margin-right: var(--iui-size-xs);
14
+ }
15
+
16
+ .rcw-chevron-disabled {
17
+ fill: var(--iui-color-icon-muted);
18
+ cursor: not-allowed;
19
+ align-self: center;
20
+ margin-right: var(--iui-size-xs);
21
+ }
13
22
 
14
23
  .rcw-title {
15
24
  overflow: hidden;
16
25
  white-space: nowrap;
17
26
  text-overflow: ellipsis;
18
- margin-bottom: 3px;
19
27
  }
20
28
  }
21
29
 
@@ -29,11 +37,11 @@
29
37
  justify-content: center;
30
38
  align-items: center;
31
39
  flex-direction: column;
32
- gap: $iui-baseline;
40
+ gap: var(--iui-size-s);
33
41
  height: 100%;
34
42
  }
35
43
 
36
44
  .rcw-skeleton-block {
37
- height: $iui-baseline * 3;
45
+ height: calc(var(--iui-size-s) * 3);
38
46
  width: 100%;
39
47
  }
@@ -0,0 +1,10 @@
1
+ import type { AccessToken } from "@itwin/core-bentley";
2
+ import * as React from "react";
3
+ import type { BulkExtractor } from "../components/BulkExtractor";
4
+ export declare type GetAccessTokenFn = () => Promise<AccessToken>;
5
+ export interface BulkExtractorContextProps {
6
+ bulkExtractor?: BulkExtractor;
7
+ }
8
+ export declare const BulkExtractorContext: React.Context<BulkExtractorContextProps>;
9
+ export declare const useBulkExtractor: () => BulkExtractorContextProps;
10
+ //# sourceMappingURL=BulkExtractorContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BulkExtractorContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/BulkExtractorContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,oBAAY,gBAAgB,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1D,MAAM,WAAW,yBAAyB;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,0CAA+C,CAAC;AAEjF,eAAO,MAAM,gBAAgB,iCAQ5B,CAAC"}
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { createContext } from "react";
3
+ export const BulkExtractorContext = createContext({});
4
+ export const useBulkExtractor = () => {
5
+ const context = React.useContext(BulkExtractorContext);
6
+ if (!context) {
7
+ throw new Error("useBulkExtractor should be used within a BulkExtractorContext provider");
8
+ }
9
+ return context;
10
+ };
11
+ //# sourceMappingURL=BulkExtractorContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BulkExtractorContext.js","sourceRoot":"","sources":["../../../../src/widget/context/BulkExtractorContext.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAStC,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAA4B,EAAE,CAAC,CAAC;AAEjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,wEAAwE,CACzE,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,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 { AccessToken } from \"@itwin/core-bentley\";\nimport * as React from \"react\";\nimport { createContext } from \"react\";\nimport type { BulkExtractor } from \"../components/BulkExtractor\";\n\nexport type GetAccessTokenFn = () => Promise<AccessToken>;\n\nexport interface BulkExtractorContextProps {\n bulkExtractor?: BulkExtractor;\n}\n\nexport const BulkExtractorContext = createContext<BulkExtractorContextProps>({});\n\nexport const useBulkExtractor = () => {\n const context = React.useContext(BulkExtractorContext);\n if (!context) {\n throw new Error(\n \"useBulkExtractor should be used within a BulkExtractorContext provider\"\n );\n }\n return context;\n};\n"]}
@@ -0,0 +1,16 @@
1
+ import type { AccessToken } from "@itwin/core-bentley";
2
+ import { IModelsClient } from "@itwin/imodels-client-management";
3
+ import { MappingsClient, ReportsClient } from "@itwin/insights-client";
4
+ import * as React from "react";
5
+ export declare type GetAccessTokenFn = () => Promise<AccessToken>;
6
+ export interface ReportsConfigApiProps {
7
+ getAccessToken: GetAccessTokenFn;
8
+ iTwinId: string;
9
+ baseUrl: string;
10
+ reportsClient: ReportsClient;
11
+ mappingsClient: MappingsClient;
12
+ iModelsClient: IModelsClient;
13
+ }
14
+ export declare const ReportsConfigApiContext: React.Context<ReportsConfigApiProps>;
15
+ export declare const useReportsConfigApi: () => ReportsConfigApiProps;
16
+ //# sourceMappingURL=ReportsConfigApiContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportsConfigApiContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/ReportsConfigApiContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,oBAAY,gBAAgB,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1D,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,gBAAgB,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,eAAO,MAAM,uBAAuB,sCAOlC,CAAC;AAEH,eAAO,MAAM,mBAAmB,6BAQ/B,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { IModelsClient } from "@itwin/imodels-client-management";
2
+ import { MappingsClient, ReportsClient } from "@itwin/insights-client";
3
+ import * as React from "react";
4
+ import { createContext } from "react";
5
+ export const ReportsConfigApiContext = createContext({
6
+ getAccessToken: async () => "",
7
+ iTwinId: "",
8
+ baseUrl: "",
9
+ reportsClient: new ReportsClient(),
10
+ mappingsClient: new MappingsClient(),
11
+ iModelsClient: new IModelsClient(),
12
+ });
13
+ export const useReportsConfigApi = () => {
14
+ const context = React.useContext(ReportsConfigApiContext);
15
+ if (!context) {
16
+ throw new Error("useReportsConfigApi should be used within a ReportsConfigApiContext provider");
17
+ }
18
+ return context;
19
+ };
20
+ //# sourceMappingURL=ReportsConfigApiContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportsConfigApiContext.js","sourceRoot":"","sources":["../../../../src/widget/context/ReportsConfigApiContext.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAatC,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAwB;IAC1E,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;IAC9B,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,IAAI,aAAa,EAAE;IAClC,cAAc,EAAE,IAAI,cAAc,EAAE;IACpC,aAAa,EAAE,IAAI,aAAa,EAAE;CACnC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAC1D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,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 { AccessToken } from \"@itwin/core-bentley\";\nimport { IModelsClient } from \"@itwin/imodels-client-management\";\nimport { MappingsClient, ReportsClient } from \"@itwin/insights-client\";\nimport * as React from \"react\";\nimport { createContext } from \"react\";\n\nexport type GetAccessTokenFn = () => Promise<AccessToken>;\n\nexport interface ReportsConfigApiProps {\n getAccessToken: GetAccessTokenFn;\n iTwinId: string;\n baseUrl: string;\n reportsClient: ReportsClient;\n mappingsClient: MappingsClient;\n iModelsClient: IModelsClient;\n}\n\nexport const ReportsConfigApiContext = createContext<ReportsConfigApiProps>({\n getAccessToken: async () => \"\",\n iTwinId: \"\",\n baseUrl: \"\",\n reportsClient: new ReportsClient(),\n mappingsClient: new MappingsClient(),\n iModelsClient: new IModelsClient(),\n});\n\nexport const useReportsConfigApi = () => {\n const context = React.useContext(ReportsConfigApiContext);\n if (!context) {\n throw new Error(\n \"useReportsConfigApi should be used within a ReportsConfigApiContext provider\"\n );\n }\n return context;\n};\n"]}
@@ -4,7 +4,9 @@
4
4
  "AddMappings": "Add Mappings",
5
5
  "AddReport": "Add Report",
6
6
  "AreYouSureYouWantToDelete": "Are you sure you want to delete",
7
+ "Back": "Back",
7
8
  "Cancel": "Cancel",
9
+ "ClearSearch": "Clear Search",
8
10
  "Close": "Close",
9
11
  "Checking": "Checking",
10
12
  "Confirm": "Confirm",
@@ -46,13 +48,16 @@
46
48
  "ODataFeedURL": "OData Feed URL",
47
49
  "PleaseWait": "Please wait...",
48
50
  "Queued": "Queued",
51
+ "Refresh": "Refresh",
49
52
  "Remove": "Remove",
50
53
  "ReportDetails": "Report Details",
51
54
  "ReportName": "Report Name",
52
55
  "ReportsConfig": "Reports Config",
56
+ "ReportOptions": "Report Options",
53
57
  "RunExtraction": "Run Extraction",
54
58
  "Running": "Running",
55
59
  "Search": "Search...",
60
+ "SearchReport": "Search",
56
61
  "SelectIModel": "Select an iModel",
57
62
  "Starting": "Starting",
58
63
  "Success": "Success",
@@ -79,4 +84,4 @@
79
84
  "CharLimit": "There is an 128 character limit.",
80
85
  "ThisFieldIsRequired": "This field is required"
81
86
  }
82
- }
87
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/reports-config-widget-react",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "description": "An iTwin.js 3D Viewer Widget that interfaces with the iTwin Reporting Platform.",
5
5
  "keywords": [
6
6
  "Bentley",
@@ -30,42 +30,42 @@
30
30
  "rules": {
31
31
  "no-duplicate-imports": "off",
32
32
  "@typescript-eslint/consistent-type-imports": "error",
33
- "deprecation/deprecation": "off",
33
+ "deprecation/deprecation": "error",
34
34
  "jsx-a11y/no-static-element-interactions": "off",
35
35
  "jsx-a11y/click-events-have-key-events": "off",
36
36
  "jsx-a11y/anchor-is-valid": "off"
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@itwin/imodels-access-frontend": "^1.0.1",
40
+ "@itwin/imodels-access-frontend": "^4.0.0",
41
41
  "@itwin/imodels-client-management": "^1.0.1",
42
42
  "@itwin/insights-client": "^0.4.0",
43
- "@itwin/itwinui-icons-color-react": "^1.0.1",
44
- "@itwin/itwinui-icons-react": "^1.7.0",
45
- "@itwin/itwinui-react": "^1.42.0",
43
+ "@itwin/itwinui-icons-color-react": "^2.1.0",
44
+ "@itwin/itwinui-icons-react": "^2.4.0",
45
+ "@itwin/itwinui-react": "^2.11.0",
46
46
  "classnames": "^2.3.1",
47
47
  "simple-react-validator": "^1.6.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@faker-js/faker": "6.2.0",
51
- "@itwin/appui-abstract": "^3.0.0",
52
- "@itwin/appui-layout-react": "^3.0.0",
53
- "@itwin/appui-react": "^3.0.0",
54
- "@itwin/build-tools": "^3.0.0",
55
- "@itwin/components-react": "^3.0.0",
56
- "@itwin/core-bentley": "^3.0.0",
57
- "@itwin/core-common": "^3.0.0",
58
- "@itwin/core-frontend": "^3.0.0",
59
- "@itwin/core-geometry": "^3.0.0",
60
- "@itwin/core-markup": "^3.0.0",
61
- "@itwin/core-orbitgt": "^3.0.0",
62
- "@itwin/core-quantity": "^3.0.0",
63
- "@itwin/core-react": "^3.0.0",
64
- "@itwin/eslint-plugin": "^3.0.0",
65
- "@itwin/imodel-components-react": "^3.0.0",
66
- "@itwin/presentation-common": "^3.0.0",
67
- "@itwin/presentation-frontend": "^3.0.0",
68
- "@itwin/webgl-compatibility": "^3.0.0",
51
+ "@itwin/appui-abstract": "^4.0.0",
52
+ "@itwin/appui-layout-react": "^4.0.0",
53
+ "@itwin/appui-react": "^4.0.0",
54
+ "@itwin/build-tools": "^4.0.0",
55
+ "@itwin/components-react": "^4.0.0",
56
+ "@itwin/core-bentley": "^4.0.0",
57
+ "@itwin/core-common": "^4.0.0",
58
+ "@itwin/core-frontend": "^4.0.0",
59
+ "@itwin/core-geometry": "^4.0.0",
60
+ "@itwin/core-markup": "^4.0.0",
61
+ "@itwin/core-orbitgt": "^4.0.0",
62
+ "@itwin/core-quantity": "^4.0.0",
63
+ "@itwin/core-react": "^4.0.0",
64
+ "@itwin/eslint-plugin": "^3.7.8",
65
+ "@itwin/imodel-components-react": "^4.0.0",
66
+ "@itwin/presentation-common": "^4.0.0",
67
+ "@itwin/presentation-frontend": "^4.0.0",
68
+ "@itwin/webgl-compatibility": "^4.0.0",
69
69
  "@testing-library/dom": "^8.12.0",
70
70
  "@testing-library/jest-dom": "^5.16.3",
71
71
  "@testing-library/react": "^12.1.4",
@@ -97,14 +97,14 @@
97
97
  "rimraf": "^3.0.2",
98
98
  "ts-jest": "^27.1.3",
99
99
  "typemoq": "^2.1.0",
100
- "typescript": "~4.3.0",
100
+ "typescript": "~4.5.0",
101
101
  "xmlhttprequest": "^1.8.0"
102
102
  },
103
103
  "peerDependencies": {
104
- "@itwin/appui-abstract": "^3.0.0",
105
- "@itwin/appui-react": "^3.0.0",
106
- "@itwin/core-bentley": "^3.0.0",
107
- "@itwin/core-frontend": "^3.0.0",
104
+ "@itwin/appui-abstract": "^4.0.0",
105
+ "@itwin/appui-react": "^4.0.0",
106
+ "@itwin/core-bentley": "^4.0.0",
107
+ "@itwin/core-frontend": "^4.0.0",
108
108
  "react": "^17.0.2",
109
109
  "react-dom": "^17.0.2",
110
110
  "react-redux": "^7.2.0"
@@ -4,7 +4,9 @@
4
4
  "AddMappings": "Add Mappings",
5
5
  "AddReport": "Add Report",
6
6
  "AreYouSureYouWantToDelete": "Are you sure you want to delete",
7
+ "Back": "Back",
7
8
  "Cancel": "Cancel",
9
+ "ClearSearch": "Clear Search",
8
10
  "Close": "Close",
9
11
  "Checking": "Checking",
10
12
  "Confirm": "Confirm",
@@ -46,13 +48,16 @@
46
48
  "ODataFeedURL": "OData Feed URL",
47
49
  "PleaseWait": "Please wait...",
48
50
  "Queued": "Queued",
51
+ "Refresh": "Refresh",
49
52
  "Remove": "Remove",
50
53
  "ReportDetails": "Report Details",
51
54
  "ReportName": "Report Name",
52
55
  "ReportsConfig": "Reports Config",
56
+ "ReportOptions": "Report Options",
53
57
  "RunExtraction": "Run Extraction",
54
58
  "Running": "Running",
55
59
  "Search": "Search...",
60
+ "SearchReport": "Search",
56
61
  "SelectIModel": "Select an iModel",
57
62
  "Starting": "Starting",
58
63
  "Success": "Success",
@@ -79,4 +84,4 @@
79
84
  "CharLimit": "There is an 128 character limit.",
80
85
  "ThisFieldIsRequired": "This field is required"
81
86
  }
82
- }
87
+ }
@@ -1,14 +1,14 @@
1
- PASS src/test/ReportMappings.test.tsx (9.915 s)
2
- PASS src/test/ReportMappingHorizontalTile.test.tsx
3
- PASS src/test/Reports.test.tsx (7.469 s)
1
+ PASS src/test/ReportMappingHorizontalTile.test.tsx (11.175 s)
2
+ PASS src/test/ReportMappings.test.tsx
4
3
  PASS src/test/BulkExtractor.test.ts
4
+ PASS src/test/Reports.test.tsx (10.973 s)
5
5
  PASS src/test/AddMappingModal.test.tsx
6
- PASS src/test/ReportAction.test.tsx
6
+ PASS src/test/ReportAction.test.tsx (6.602 s)
7
7
  PASS src/test/DeleteModal.test.tsx
8
8
  PASS src/test/WidgetHeader.test.tsx
9
9
 
10
10
  Test Suites: 8 passed, 8 total
11
- Tests: 41 passed, 41 total
11
+ Tests: 40 passed, 40 total
12
12
  Snapshots: 0 total
13
- Time: 29.593 s
13
+ Time: 47.701 s
14
14
  Ran all test suites.
@@ -1,60 +1,63 @@
1
1
  Invoking: npm test -- --coverage
2
2
 
3
+ > @itwin/reports-config-widget-react@0.3.0 test
4
+ > jest --coverage
3
5
 
4
- > @itwin/reports-config-widget-react@0.2.0 test /home/vsts/work/1/s/packages/itwin/reports-config-widget
5
- > jest "--coverage"
6
-
7
- PASS src/test/ReportMappings.test.tsx (9.915 s)
8
- PASS src/test/ReportMappingHorizontalTile.test.tsx
9
- PASS src/test/Reports.test.tsx (7.469 s)
6
+ PASS src/test/ReportMappingHorizontalTile.test.tsx (11.175 s)
7
+ PASS src/test/ReportMappings.test.tsx
10
8
  PASS src/test/BulkExtractor.test.ts
9
+ PASS src/test/Reports.test.tsx (10.973 s)
11
10
  PASS src/test/AddMappingModal.test.tsx
12
- PASS src/test/ReportAction.test.tsx
11
+ PASS src/test/ReportAction.test.tsx (6.602 s)
13
12
  PASS src/test/DeleteModal.test.tsx
14
13
  PASS src/test/WidgetHeader.test.tsx
15
- ----------------------------------------|---------|----------|---------|---------|-------------------------------------
16
- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
17
- ----------------------------------------|---------|----------|---------|---------|-------------------------------------
18
- All files | 86.69 | 65.94 | 79.76 | 86.79 |
19
- src | 100 | 75 | 100 | 100 |
20
- ReportsConfigWidget.ts | 100 | 75 | 100 | 100 | 21
21
- src/test | 100 | 66.66 | 100 | 100 |
22
- test-utils.tsx | 100 | 66.66 | 100 | 100 | 56
23
- src/widget | 40 | 0 | 0 | 40 |
24
- ReportsConfigUiProvider.tsx | 40 | 0 | 0 | 40 | 23-65
25
- src/widget/components | 86.37 | 67.81 | 79.72 | 86.64 |
26
- ActionPanel.tsx | 100 | 77.77 | 100 | 100 | 25-26
27
- AddMappingsModal.tsx | 91.66 | 83.33 | 88.88 | 93.33 | 40,120,134
28
- BulkExtractor.ts | 85 | 76.19 | 86.66 | 85.41 | 108,117-119,124-132,159-161,169-171
29
- Constants.ts | 100 | 100 | 100 | 100 |
30
- DeleteModal.tsx | 90 | 100 | 75 | 89.47 | 42,56
31
- ExtractionStatus.tsx | 94.28 | 90 | 83.33 | 96.87 | 63
32
- ExtractionToast.tsx | 58.33 | 100 | 0 | 50 | 18-22,36
33
- HorizontalTile.tsx | 100 | 100 | 100 | 100 |
34
- LocalizedTablePaginator.tsx | 100 | 50 | 100 | 100 | 25
35
- ReportAction.tsx | 94.28 | 81.48 | 100 | 94.28 | 59-60
36
- ReportHorizontalTile.tsx | 72.5 | 56 | 72.72 | 71.05 | 43-45,57-63,124
37
- ReportMappingHorizontalTile.tsx | 93.87 | 100 | 91.66 | 93.61 | 66-69
38
- ReportMappings.tsx | 92.13 | 56.75 | 85 | 91.86 | 97,251,267-292
39
- Reports.tsx | 90.21 | 78.84 | 76 | 93.18 | 73,77,134,141-143
40
- ReportsContainer.tsx | 57.14 | 0 | 0 | 61.53 | 19,25-37
41
- SearchBar.tsx | 70.58 | 71.42 | 60 | 68.75 | 31-45
42
- SelectIModel.tsx | 97.05 | 81.81 | 85.71 | 96.87 | 92
43
- utils.tsx | 62.74 | 30.76 | 87.5 | 55.81 | 51-94,150
44
- src/widget/components/ExtractionStates | 96.87 | 25 | 80 | 96.29 |
45
- FailedExtractionState.tsx | 85.71 | 0 | 0 | 83.33 | 16
46
- QueuedExtractionState.tsx | 100 | 100 | 100 | 100 |
47
- RunningExtractionState.tsx | 100 | 100 | 100 | 100 |
48
- StartingExtractionState.tsx | 100 | 100 | 100 | 100 |
49
- SucceededExtractionState.tsx | 100 | 50 | 100 | 100 | 26
50
- src/widget/context | 80 | 0 | 50 | 77.77 |
51
- ReportsApiConfigContext.tsx | 80 | 0 | 50 | 77.77 | 15,22
52
- src/widget/hooks | 100 | 100 | 100 | 100 |
53
- useValidator.ts | 100 | 100 | 100 | 100 |
54
- ----------------------------------------|---------|----------|---------|---------|-------------------------------------
14
+ ----------------------------------------|---------|----------|---------|---------|-------------------------
15
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
16
+ ----------------------------------------|---------|----------|---------|---------|-------------------------
17
+ All files | 84.8 | 66.66 | 76.83 | 85.44 |
18
+ src | 77.77 | 50 | 50 | 77.77 |
19
+ ReportsConfigWidget.ts | 77.77 | 50 | 50 | 77.77 | 13,32
20
+ src/test | 100 | 100 | 100 | 100 |
21
+ test-utils.tsx | 100 | 100 | 100 | 100 |
22
+ src/widget | 42.85 | 0 | 0 | 42.85 |
23
+ ReportsConfigUiProvider.tsx | 42.85 | 0 | 0 | 42.85 | 23-58
24
+ src/widget/components | 84.5 | 69.3 | 77.41 | 85.42 |
25
+ ActionPanel.tsx | 100 | 90.9 | 100 | 100 | 26
26
+ AddMappingsModal.tsx | 92 | 80 | 90 | 93.33 | 38,112,134
27
+ BulkExtractor.ts | 92.92 | 90.47 | 100 | 93.68 | 109,118-120,129,160-162
28
+ Constants.ts | 100 | 100 | 100 | 100 |
29
+ DeleteModal.tsx | 94.44 | 100 | 100 | 94.11 | 40
30
+ ExtractionStatus.tsx | 94.28 | 90 | 83.33 | 96.87 | 63
31
+ ExtractionToast.tsx | 58.33 | 100 | 0 | 50 | 18-22,36
32
+ HorizontalTile.tsx | 100 | 100 | 100 | 100 |
33
+ LocalizedTablePaginator.tsx | 100 | 50 | 100 | 100 | 25
34
+ ReportAction.tsx | 94.11 | 80 | 100 | 93.93 | 57-58
35
+ ReportHorizontalTile.tsx | 73.17 | 40 | 76.92 | 71.79 | 42-44,56-62,123
36
+ ReportMappingHorizontalTile.tsx | 93.75 | 100 | 91.66 | 93.47 | 65-68
37
+ ReportMappings.tsx | 91.76 | 61.9 | 85 | 93.58 | 82,266-293
38
+ Reports.tsx | 84.12 | 66.66 | 77.77 | 91.07 | 108,114-117
39
+ ReportsConfigContext.tsx | 91.17 | 87.09 | 70 | 90 | 35,65,69
40
+ ReportsContainer.tsx | 52.17 | 50 | 20 | 54.54 | 40-55
41
+ ReportsHeader.tsx | 71.42 | 0 | 0 | 66.66 | 18-21
42
+ ReportsRouter.tsx | 37.5 | 0 | 0 | 42.1 | 23-61
43
+ SearchBar.tsx | 70.58 | 71.42 | 60 | 68.75 | 31-45
44
+ SelectIModel.tsx | 95.83 | 100 | 83.33 | 95.45 | 74
45
+ utils.tsx | 62.74 | 35.29 | 87.5 | 55.81 | 52-95,151
46
+ src/widget/components/ExtractionStates | 96.87 | 25 | 80 | 96.29 |
47
+ FailedExtractionState.tsx | 85.71 | 0 | 0 | 83.33 | 16
48
+ QueuedExtractionState.tsx | 100 | 100 | 100 | 100 |
49
+ RunningExtractionState.tsx | 100 | 100 | 100 | 100 |
50
+ StartingExtractionState.tsx | 100 | 100 | 100 | 100 |
51
+ SucceededExtractionState.tsx | 100 | 50 | 100 | 100 | 26
52
+ src/widget/context | 85.71 | 0 | 66.66 | 84.21 |
53
+ BulkExtractorContext.tsx | 88.88 | 0 | 100 | 87.5 | 21
54
+ ReportsConfigApiContext.tsx | 83.33 | 0 | 50 | 81.81 | 23,34
55
+ src/widget/hooks | 100 | 100 | 100 | 100 |
56
+ useValidator.ts | 100 | 100 | 100 | 100 |
57
+ ----------------------------------------|---------|----------|---------|---------|-------------------------
55
58
 
56
59
  Test Suites: 8 passed, 8 total
57
- Tests: 41 passed, 41 total
60
+ Tests: 40 passed, 40 total
58
61
  Snapshots: 0 total
59
- Time: 29.593 s
62
+ Time: 47.701 s
60
63
  Ran all test suites.
@@ -5,3 +5,9 @@
5
5
  /** UI Provider for iTwin Viewer Applications */
6
6
  export * from "./widget/ReportsConfigUiProvider";
7
7
  export * from "./ReportsConfigWidget";
8
+
9
+ export { Reports, ReportsProps } from "./widget/components/Reports";
10
+ export { ReportMappings, ReportMappingsProps } from "./widget/components/ReportMappings";
11
+ export { ReportsConfigContext, ReportsConfigContextProps } from "./widget/components/ReportsConfigContext";
12
+ export { ReportAction, ReportActionProps } from "./widget/components/ReportAction";
13
+ export { BulkExtractor } from "./widget/components/BulkExtractor";
@@ -5,25 +5,22 @@
5
5
  import React from "react";
6
6
  import faker from "@faker-js/faker";
7
7
  import "@testing-library/jest-dom";
8
- import type {
9
- IModelConnection,
10
- } from "@itwin/core-frontend";
11
- import { NoRenderApp } from "@itwin/core-frontend";
12
8
  import { ReportsConfigWidget } from "../ReportsConfigWidget";
13
9
  import {
14
10
  render,
15
11
  screen,
16
- TestUtils,
17
12
  waitFor,
18
13
  within,
19
14
  } from "./test-utils";
20
15
  import * as moq from "typemoq";
21
16
  import type {
17
+ MappingsClient,
22
18
  MappingSingle,
23
19
  ReportMappingCollection,
20
+ ReportsClient,
24
21
  } from "@itwin/insights-client";
25
22
  import type { ReportMappingAndMapping } from "../widget/components/ReportMappings";
26
- import type { IModelOperations, OperationOptions } from "@itwin/imodels-client-management";
23
+ import type { GetSingleIModelParams, IModelOperations, IModelsClient, OperationOptions } from "@itwin/imodels-client-management";
27
24
  import { IModelState } from "@itwin/imodels-client-management";
28
25
  import { AddMappingsModal } from "../widget/components/AddMappingsModal";
29
26
  import { EmptyLocalization } from "@itwin/core-common";
@@ -207,19 +204,8 @@ const mockReportMappingsAndMappingsFactory = (mockMappings: MappingSingle[], rep
207
204
  return reportMappingsAndMapping;
208
205
  };
209
206
 
210
- const connectionMock = moq.Mock.ofType<IModelConnection>();
211
- const mockIModelsClient = moq.Mock.ofType<IModelOperations<OperationOptions>>();
212
-
213
- jest.mock("@itwin/appui-react", () => ({
214
- ...jest.requireActual("@itwin/appui-react"),
215
- useActiveIModelConnection: () => connectionMock.object,
216
- }));
217
-
218
207
  jest.mock("@itwin/imodels-client-management", () => ({
219
208
  ...jest.requireActual("@itwin/imodels-client-management"),
220
- IModelsClient: jest.fn().mockImplementation(() => ({
221
- iModels: mockIModelsClient.object,
222
- })),
223
209
  toArray: jest.fn().mockImplementation(async () => {
224
210
  return mockProjectIModels.iModels;
225
211
  }),
@@ -228,24 +214,22 @@ jest.mock("@itwin/imodels-client-management", () => ({
228
214
  const mockGetMappings = jest.fn();
229
215
  const mockCreateReportMapping = jest.fn();
230
216
 
231
- jest.mock("@itwin/insights-client", () => ({
232
- ...jest.requireActual("@itwin/insights-client"),
233
- MappingsClient: jest.fn().mockImplementation(() => ({
234
- getMappings: mockGetMappings,
235
- })),
236
- ReportsClient: jest.fn().mockImplementation(() => ({
237
- createReportMapping: mockCreateReportMapping,
238
- })),
239
- }));
217
+ const mockIModelsClient = moq.Mock.ofType<IModelsClient>();
218
+ const mockIModelsClientOperations = moq.Mock.ofType<IModelOperations<OperationOptions>>();
219
+ const mockReportsClient = moq.Mock.ofType<ReportsClient>();
220
+ const mockMappingsClient = moq.Mock.ofType<MappingsClient>();
240
221
 
241
222
  beforeAll(async () => {
242
- await NoRenderApp.startup({localization: new EmptyLocalization()});
243
- connectionMock.setup((x) => x.iModelId).returns(() => mockIModelId1);
244
- await ReportsConfigWidget.initialize();
245
- });
246
-
247
- afterAll(() => {
248
- TestUtils.terminateUiFramework();
223
+ const localization = new EmptyLocalization();
224
+ await ReportsConfigWidget.initialize(localization);
225
+ mockIModelsClientOperations.setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId1 })))
226
+ .returns(async () => mockIModelsResponse[0].iModel);
227
+ mockIModelsClientOperations.setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId2 })))
228
+ .returns(async () => mockIModelsResponse[1].iModel);
229
+ mockIModelsClient.setup((x) => x.iModels)
230
+ .returns(() => mockIModelsClientOperations.object);
231
+ mockReportsClient.setup(async (x) => x.createReportMapping(moq.It.isAny(), moq.It.isAny(), moq.It.isAny())).returns(mockCreateReportMapping);
232
+ mockMappingsClient.setup(async (x) => x.getMappings(moq.It.isAny(), moq.It.isAny())).returns(mockGetMappings);
249
233
  });
250
234
 
251
235
  afterEach(() => {
@@ -266,8 +250,9 @@ describe("Add Mapping Modal", () => {
266
250
  show={true}
267
251
  reportId={mockReportId}
268
252
  existingMappings={mockReportMappingsAndMappings}
269
- returnFn={jest.fn()}
270
- />
253
+ onClose={jest.fn()}
254
+ defaultIModelId={mockIModelId1}
255
+ />, { iTwinId: mockITwinId, reportsClient: mockReportsClient.object, mappingsClient: mockMappingsClient.object, iModelsClient: mockIModelsClient.object }
271
256
  );
272
257
 
273
258
  expect(screen.getByRole("dialog")).toBeInTheDocument();
@@ -278,8 +263,6 @@ describe("Add Mapping Modal", () => {
278
263
  const addButton = withinModal.getByRole("button", {
279
264
  name: /add/i,
280
265
  });
281
- // Add button should be disabled
282
- expect(addButton).toBeDisabled();
283
266
 
284
267
  await waitFor(() => screen.getByRole("row"));
285
268