@itwin/reports-config-widget-react 0.0.8 → 0.2.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 (317) hide show
  1. package/.rush/temp/package-deps_rebuild.json +46 -32
  2. package/.rush/temp/shrinkwrap-deps.json +14 -6
  3. package/CHANGELOG.json +27 -0
  4. package/CHANGELOG.md +16 -1
  5. package/coverage/clover.xml +648 -427
  6. package/coverage/coverage-final.json +28 -18
  7. package/coverage/lcov-report/index.html +34 -19
  8. package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +10 -10
  9. package/coverage/lcov-report/src/index.html +1 -1
  10. package/coverage/lcov-report/src/test/index.html +1 -1
  11. package/coverage/lcov-report/src/test/test-utils.tsx.html +22 -22
  12. package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +7 -7
  13. package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +29 -41
  14. package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +31 -37
  15. package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +661 -0
  16. package/coverage/lcov-report/src/widget/components/Constants.ts.html +106 -0
  17. package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +21 -21
  18. package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +187 -0
  19. package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +145 -0
  20. package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +139 -0
  21. package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +151 -0
  22. package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +190 -0
  23. package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +176 -0
  24. package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +295 -0
  25. package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +208 -0
  26. package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +77 -44
  27. package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +8 -8
  28. package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +14 -20
  29. package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +475 -0
  30. package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +469 -0
  31. package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +184 -250
  32. package/coverage/lcov-report/src/widget/components/Reports.tsx.html +180 -132
  33. package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +10 -10
  34. package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +11 -11
  35. package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +31 -31
  36. package/coverage/lcov-report/src/widget/components/index.html +134 -59
  37. package/coverage/lcov-report/src/widget/components/utils.tsx.html +32 -32
  38. package/coverage/lcov-report/src/widget/context/ReportsApiConfigContext.tsx.html +8 -8
  39. package/coverage/lcov-report/src/widget/context/index.html +1 -1
  40. package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
  41. package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +7 -7
  42. package/coverage/lcov-report/src/widget/index.html +1 -1
  43. package/coverage/lcov.info +1137 -738
  44. package/jest.config.js +7 -0
  45. package/lib/cjs/test/AddMappingModal.test.d.ts +2 -0
  46. package/lib/cjs/test/AddMappingModal.test.d.ts.map +1 -0
  47. package/lib/cjs/test/AddMappingModal.test.js +277 -0
  48. package/lib/cjs/test/AddMappingModal.test.js.map +1 -0
  49. package/lib/cjs/test/BulkExtractor.test.d.ts +2 -0
  50. package/lib/cjs/test/BulkExtractor.test.d.ts.map +1 -0
  51. package/lib/cjs/test/BulkExtractor.test.js +182 -0
  52. package/lib/cjs/test/BulkExtractor.test.js.map +1 -0
  53. package/lib/cjs/test/DeleteModal.test.d.ts +2 -0
  54. package/lib/cjs/test/DeleteModal.test.d.ts.map +1 -0
  55. package/lib/cjs/test/DeleteModal.test.js +93 -0
  56. package/lib/cjs/test/DeleteModal.test.js.map +1 -0
  57. package/lib/cjs/test/ReportAction.test.js +2 -3
  58. package/lib/cjs/test/ReportAction.test.js.map +1 -1
  59. package/lib/cjs/test/ReportMappingHorizontalTile.test.d.ts +2 -0
  60. package/lib/cjs/test/ReportMappingHorizontalTile.test.d.ts.map +1 -0
  61. package/lib/cjs/test/ReportMappingHorizontalTile.test.js +340 -0
  62. package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -0
  63. package/lib/cjs/test/ReportMappings.test.js +115 -267
  64. package/lib/cjs/test/ReportMappings.test.js.map +1 -1
  65. package/lib/cjs/test/Reports.test.js +1 -1
  66. package/lib/cjs/test/Reports.test.js.map +1 -1
  67. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  68. package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
  69. package/lib/cjs/widget/components/ActionPanel.js +4 -5
  70. package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
  71. package/lib/cjs/widget/components/AddMappingsModal.d.ts +2 -2
  72. package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
  73. package/lib/cjs/widget/components/AddMappingsModal.js +5 -4
  74. package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
  75. package/lib/cjs/widget/components/AddMappingsModal.scss +4 -3
  76. package/lib/cjs/widget/components/BulkExtractor.d.ts +37 -0
  77. package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -0
  78. package/lib/cjs/widget/components/BulkExtractor.js +155 -0
  79. package/lib/cjs/widget/components/BulkExtractor.js.map +1 -0
  80. package/lib/cjs/widget/components/Constants.d.ts +4 -0
  81. package/lib/cjs/widget/components/Constants.d.ts.map +1 -0
  82. package/lib/cjs/widget/components/Constants.js +11 -0
  83. package/lib/cjs/widget/components/Constants.js.map +1 -0
  84. package/lib/cjs/widget/components/DeleteModal.js +1 -1
  85. package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
  86. package/lib/cjs/widget/components/DeleteModal.scss +4 -3
  87. package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts +8 -0
  88. package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -0
  89. package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js +23 -0
  90. package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -0
  91. package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts +3 -0
  92. package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -0
  93. package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js +18 -0
  94. package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -0
  95. package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts +3 -0
  96. package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -0
  97. package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js +17 -0
  98. package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -0
  99. package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts +3 -0
  100. package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -0
  101. package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js +18 -0
  102. package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -0
  103. package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts +8 -0
  104. package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -0
  105. package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js +23 -0
  106. package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -0
  107. package/lib/cjs/widget/components/ExtractionStatus.d.ts +17 -0
  108. package/lib/cjs/widget/components/ExtractionStatus.d.ts.map +1 -0
  109. package/lib/cjs/widget/components/ExtractionStatus.js +76 -0
  110. package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -0
  111. package/lib/cjs/widget/components/{Extraction.scss → ExtractionStatus.scss} +17 -15
  112. package/lib/cjs/widget/components/ExtractionToast.d.ts +11 -0
  113. package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -0
  114. package/lib/cjs/widget/components/ExtractionToast.js +33 -0
  115. package/lib/cjs/widget/components/ExtractionToast.js.map +1 -0
  116. package/lib/cjs/widget/components/HorizontalTile.d.ts +8 -7
  117. package/lib/cjs/widget/components/HorizontalTile.d.ts.map +1 -1
  118. package/lib/cjs/widget/components/HorizontalTile.js +10 -6
  119. package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
  120. package/lib/cjs/widget/components/HorizontalTile.scss +42 -22
  121. package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
  122. package/lib/cjs/widget/components/ReportAction.js +3 -3
  123. package/lib/cjs/widget/components/ReportAction.js.map +1 -1
  124. package/lib/cjs/widget/components/ReportAction.scss +2 -2
  125. package/lib/cjs/widget/components/ReportHorizontalTile.d.ts +16 -0
  126. package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -0
  127. package/lib/cjs/widget/components/ReportHorizontalTile.js +71 -0
  128. package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -0
  129. package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts +13 -0
  130. package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -0
  131. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +82 -0
  132. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -0
  133. package/lib/cjs/widget/components/ReportMappings.d.ts +3 -1
  134. package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
  135. package/lib/cjs/widget/components/ReportMappings.js +39 -40
  136. package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
  137. package/lib/cjs/widget/components/ReportMappings.scss +7 -7
  138. package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
  139. package/lib/cjs/widget/components/Reports.js +43 -28
  140. package/lib/cjs/widget/components/Reports.js.map +1 -1
  141. package/lib/cjs/widget/components/Reports.scss +8 -4
  142. package/lib/cjs/widget/components/ReportsContainer.js +1 -1
  143. package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
  144. package/lib/cjs/widget/components/ReportsContainer.scss +2 -2
  145. package/lib/cjs/widget/components/SearchBar.js +1 -1
  146. package/lib/cjs/widget/components/SearchBar.js.map +1 -1
  147. package/lib/cjs/widget/components/SearchBar.scss +6 -0
  148. package/lib/cjs/widget/components/SelectIModel.js +2 -2
  149. package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
  150. package/lib/cjs/widget/components/SelectIModel.scss +4 -3
  151. package/lib/cjs/widget/components/utils.js +1 -1
  152. package/lib/cjs/widget/components/utils.js.map +1 -1
  153. package/lib/cjs/widget/components/utils.scss +2 -2
  154. package/lib/esm/test/AddMappingModal.test.d.ts +2 -0
  155. package/lib/esm/test/AddMappingModal.test.d.ts.map +1 -0
  156. package/lib/esm/test/AddMappingModal.test.js +253 -0
  157. package/lib/esm/test/AddMappingModal.test.js.map +1 -0
  158. package/lib/esm/test/BulkExtractor.test.d.ts +2 -0
  159. package/lib/esm/test/BulkExtractor.test.d.ts.map +1 -0
  160. package/lib/esm/test/BulkExtractor.test.js +158 -0
  161. package/lib/esm/test/BulkExtractor.test.js.map +1 -0
  162. package/lib/esm/test/DeleteModal.test.d.ts +2 -0
  163. package/lib/esm/test/DeleteModal.test.d.ts.map +1 -0
  164. package/lib/esm/test/DeleteModal.test.js +69 -0
  165. package/lib/esm/test/DeleteModal.test.js.map +1 -0
  166. package/lib/esm/test/ReportAction.test.js +2 -3
  167. package/lib/esm/test/ReportAction.test.js.map +1 -1
  168. package/lib/esm/test/ReportMappingHorizontalTile.test.d.ts +2 -0
  169. package/lib/esm/test/ReportMappingHorizontalTile.test.d.ts.map +1 -0
  170. package/lib/esm/test/ReportMappingHorizontalTile.test.js +316 -0
  171. package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -0
  172. package/lib/esm/test/ReportMappings.test.js +117 -269
  173. package/lib/esm/test/ReportMappings.test.js.map +1 -1
  174. package/lib/esm/test/Reports.test.js +1 -1
  175. package/lib/esm/test/Reports.test.js.map +1 -1
  176. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  177. package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
  178. package/lib/esm/widget/components/ActionPanel.js +4 -5
  179. package/lib/esm/widget/components/ActionPanel.js.map +1 -1
  180. package/lib/esm/widget/components/AddMappingsModal.d.ts +2 -2
  181. package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
  182. package/lib/esm/widget/components/AddMappingsModal.js +4 -5
  183. package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
  184. package/lib/esm/widget/components/AddMappingsModal.scss +4 -3
  185. package/lib/esm/widget/components/BulkExtractor.d.ts +37 -0
  186. package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -0
  187. package/lib/esm/widget/components/BulkExtractor.js +152 -0
  188. package/lib/esm/widget/components/BulkExtractor.js.map +1 -0
  189. package/lib/esm/widget/components/Constants.d.ts +4 -0
  190. package/lib/esm/widget/components/Constants.d.ts.map +1 -0
  191. package/lib/esm/widget/components/Constants.js +8 -0
  192. package/lib/esm/widget/components/Constants.js.map +1 -0
  193. package/lib/esm/widget/components/DeleteModal.js +1 -1
  194. package/lib/esm/widget/components/DeleteModal.js.map +1 -1
  195. package/lib/esm/widget/components/DeleteModal.scss +4 -3
  196. package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts +8 -0
  197. package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -0
  198. package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js +16 -0
  199. package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -0
  200. package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts +3 -0
  201. package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -0
  202. package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js +11 -0
  203. package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -0
  204. package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts +3 -0
  205. package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -0
  206. package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js +10 -0
  207. package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -0
  208. package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts +3 -0
  209. package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -0
  210. package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js +11 -0
  211. package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -0
  212. package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts +8 -0
  213. package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -0
  214. package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js +16 -0
  215. package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -0
  216. package/lib/esm/widget/components/ExtractionStatus.d.ts +17 -0
  217. package/lib/esm/widget/components/ExtractionStatus.d.ts.map +1 -0
  218. package/lib/esm/widget/components/ExtractionStatus.js +53 -0
  219. package/lib/esm/widget/components/ExtractionStatus.js.map +1 -0
  220. package/{src/widget/components/Extraction.scss → lib/esm/widget/components/ExtractionStatus.scss} +17 -15
  221. package/lib/esm/widget/components/ExtractionToast.d.ts +11 -0
  222. package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -0
  223. package/lib/esm/widget/components/ExtractionToast.js +25 -0
  224. package/lib/esm/widget/components/ExtractionToast.js.map +1 -0
  225. package/lib/esm/widget/components/HorizontalTile.d.ts +8 -7
  226. package/lib/esm/widget/components/HorizontalTile.d.ts.map +1 -1
  227. package/lib/esm/widget/components/HorizontalTile.js +10 -6
  228. package/lib/esm/widget/components/HorizontalTile.js.map +1 -1
  229. package/lib/esm/widget/components/HorizontalTile.scss +42 -22
  230. package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
  231. package/lib/esm/widget/components/ReportAction.js +3 -3
  232. package/lib/esm/widget/components/ReportAction.js.map +1 -1
  233. package/lib/esm/widget/components/ReportAction.scss +2 -2
  234. package/lib/esm/widget/components/ReportHorizontalTile.d.ts +16 -0
  235. package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -0
  236. package/lib/esm/widget/components/ReportHorizontalTile.js +64 -0
  237. package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -0
  238. package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts +13 -0
  239. package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -0
  240. package/lib/esm/widget/components/ReportMappingHorizontalTile.js +75 -0
  241. package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -0
  242. package/lib/esm/widget/components/ReportMappings.d.ts +3 -1
  243. package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
  244. package/lib/esm/widget/components/ReportMappings.js +40 -41
  245. package/lib/esm/widget/components/ReportMappings.js.map +1 -1
  246. package/lib/esm/widget/components/ReportMappings.scss +7 -7
  247. package/lib/esm/widget/components/Reports.d.ts.map +1 -1
  248. package/lib/esm/widget/components/Reports.js +45 -30
  249. package/lib/esm/widget/components/Reports.js.map +1 -1
  250. package/lib/esm/widget/components/Reports.scss +8 -4
  251. package/lib/esm/widget/components/ReportsContainer.js +1 -1
  252. package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
  253. package/lib/esm/widget/components/ReportsContainer.scss +2 -2
  254. package/lib/esm/widget/components/SearchBar.js +1 -1
  255. package/lib/esm/widget/components/SearchBar.js.map +1 -1
  256. package/lib/esm/widget/components/SearchBar.scss +6 -0
  257. package/lib/esm/widget/components/SelectIModel.js +2 -2
  258. package/lib/esm/widget/components/SelectIModel.js.map +1 -1
  259. package/lib/esm/widget/components/SelectIModel.scss +4 -3
  260. package/lib/esm/widget/components/utils.js +1 -1
  261. package/lib/esm/widget/components/utils.js.map +1 -1
  262. package/lib/esm/widget/components/utils.scss +2 -2
  263. package/lib/public/locales/en/ReportsConfigWidget.json +7 -1
  264. package/package.json +9 -3
  265. package/public/locales/en/ReportsConfigWidget.json +7 -1
  266. package/reports-config-widget-react.build.error.log +10 -6
  267. package/reports-config-widget-react.build.log +51 -36
  268. package/src/test/AddMappingModal.test.tsx +315 -0
  269. package/src/test/BulkExtractor.test.ts +301 -0
  270. package/src/test/DeleteModal.test.tsx +118 -0
  271. package/src/test/ReportAction.test.tsx +2 -4
  272. package/src/test/ReportMappingHorizontalTile.test.tsx +451 -0
  273. package/src/test/ReportMappings.test.tsx +154 -549
  274. package/src/test/Reports.test.tsx +1 -1
  275. package/src/widget/components/ActionPanel.tsx +19 -23
  276. package/src/widget/components/AddMappingsModal.scss +4 -3
  277. package/src/widget/components/AddMappingsModal.tsx +4 -6
  278. package/src/widget/components/BulkExtractor.ts +192 -0
  279. package/src/widget/components/Constants.ts +7 -0
  280. package/src/widget/components/DeleteModal.scss +4 -3
  281. package/src/widget/components/DeleteModal.tsx +1 -1
  282. package/src/widget/components/ExtractionStates/FailedExtractionState.tsx +34 -0
  283. package/src/widget/components/ExtractionStates/QueuedExtractionState.tsx +20 -0
  284. package/src/widget/components/ExtractionStates/RunningExtractionState.tsx +18 -0
  285. package/src/widget/components/ExtractionStates/StartingExtractionState.tsx +22 -0
  286. package/src/widget/components/ExtractionStates/SucceededExtractionState.tsx +35 -0
  287. package/{lib/esm/widget/components/Extraction.scss → src/widget/components/ExtractionStatus.scss} +17 -15
  288. package/src/widget/components/ExtractionStatus.tsx +70 -0
  289. package/src/widget/components/ExtractionToast.tsx +41 -0
  290. package/src/widget/components/HorizontalTile.scss +42 -22
  291. package/src/widget/components/HorizontalTile.tsx +45 -34
  292. package/src/widget/components/ReportAction.scss +2 -2
  293. package/src/widget/components/ReportAction.tsx +1 -3
  294. package/src/widget/components/ReportHorizontalTile.tsx +130 -0
  295. package/src/widget/components/ReportMappingHorizontalTile.tsx +128 -0
  296. package/src/widget/components/ReportMappings.scss +7 -7
  297. package/src/widget/components/ReportMappings.tsx +91 -113
  298. package/src/widget/components/Reports.scss +8 -4
  299. package/src/widget/components/Reports.tsx +78 -62
  300. package/src/widget/components/ReportsContainer.scss +2 -2
  301. package/src/widget/components/ReportsContainer.tsx +1 -1
  302. package/src/widget/components/SearchBar.scss +6 -0
  303. package/src/widget/components/SearchBar.tsx +1 -1
  304. package/src/widget/components/SelectIModel.scss +4 -3
  305. package/src/widget/components/SelectIModel.tsx +2 -2
  306. package/src/widget/components/utils.scss +2 -2
  307. package/src/widget/components/utils.tsx +1 -1
  308. package/coverage/lcov-report/src/widget/components/Extraction.tsx.html +0 -1030
  309. package/lib/cjs/widget/components/Extraction.d.ts +0 -28
  310. package/lib/cjs/widget/components/Extraction.d.ts.map +0 -1
  311. package/lib/cjs/widget/components/Extraction.js +0 -190
  312. package/lib/cjs/widget/components/Extraction.js.map +0 -1
  313. package/lib/esm/widget/components/Extraction.d.ts +0 -28
  314. package/lib/esm/widget/components/Extraction.d.ts.map +0 -1
  315. package/lib/esm/widget/components/Extraction.js +0 -166
  316. package/lib/esm/widget/components/Extraction.js.map +0 -1
  317. package/src/widget/components/Extraction.tsx +0 -315
@@ -291,7 +291,7 @@ describe("Reports View", () => {
291
291
 
292
292
  await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
293
293
 
294
- const searchButton = within(screen.getByTestId(/search-bar/i)).getByRole(
294
+ const searchButton = within(screen.getByTestId(/rcw-search-bar/i)).getByRole(
295
295
  "button"
296
296
  );
297
297
  await user.click(searchButton);
@@ -26,29 +26,25 @@ const ActionPanel = ({
26
26
  isLoading = false,
27
27
  }: ActionPanelProps): JSX.Element => {
28
28
  return (
29
- <div id="action">
30
- <div className="rcw-action-panel">
31
- {isLoading && <LoadingSpinner />}
32
- <Button
33
- disabled={isSavingDisabled || isLoading}
34
- styleType="high-visibility"
35
- id="save-app"
36
- onClick={onAction}
37
- >
38
- {actionLabel}
39
- </Button>
40
- <Button
41
- styleType="default"
42
- type="button"
43
- id="cancel"
44
- onClick={onCancel}
45
- disabled={isCancelDisabled || isLoading}
46
- >
47
- {ReportsConfigWidget.localization.getLocalizedString(
48
- "ReportsConfigWidget:Cancel"
49
- )}
50
- </Button>
51
- </div>
29
+ <div className="rcw-action-panel">
30
+ {isLoading && <LoadingSpinner />}
31
+ <Button
32
+ disabled={isSavingDisabled || isLoading}
33
+ styleType="high-visibility"
34
+ onClick={onAction}
35
+ >
36
+ {actionLabel}
37
+ </Button>
38
+ <Button
39
+ styleType="default"
40
+ type="button"
41
+ onClick={onCancel}
42
+ disabled={isCancelDisabled || isLoading}
43
+ >
44
+ {ReportsConfigWidget.localization.getLocalizedString(
45
+ "ReportsConfigWidget:Cancel"
46
+ )}
47
+ </Button>
52
48
  </div>
53
49
  );
54
50
  };
@@ -4,15 +4,16 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/itwinui-css/scss/variables";
6
6
 
7
- .add-mappings-container {
7
+ .rcw-add-mappings-container {
8
8
  display: flex;
9
9
  flex-direction: column;
10
10
  gap: $iui-baseline;
11
11
  width: 45vw;
12
12
  min-width: 100%;
13
13
  overflow: auto;
14
- .add-mappings-table {
14
+
15
+ .rcw-add-mappings-table {
15
16
  flex-grow: 1;
16
17
  overflow: auto;
17
18
  }
18
- }
19
+ }
@@ -50,13 +50,13 @@ interface AddMappingsModalProps {
50
50
  returnFn: () => Promise<void>;
51
51
  }
52
52
 
53
- const AddMappingsModal = ({
53
+ export const AddMappingsModal = ({
54
54
  reportId,
55
55
  existingMappings,
56
56
  show,
57
57
  returnFn,
58
58
  }: AddMappingsModalProps) => {
59
- const [isLoading, setIsLoading] = useState<boolean>(true);
59
+ const [isLoading, setIsLoading] = useState<boolean>(false);
60
60
  const [selectedMappings, setSelectedMappings] = useState<Mapping[]>([]);
61
61
  const [selectedIModelId, setSelectediModelId] = useState<string>("");
62
62
  const [mappings, setMappings] = useState<Mapping[]>([]);
@@ -135,7 +135,7 @@ const AddMappingsModal = ({
135
135
  }}
136
136
  style={{ display: "flex", flexDirection: "column", maxHeight: "77vh" }}
137
137
  >
138
- <div className="add-mappings-container">
138
+ <div className="rcw-add-mappings-container">
139
139
  <SelectIModel
140
140
  selectedIModelId={selectedIModelId}
141
141
  setSelectedIModelId={setSelectediModelId}
@@ -143,7 +143,7 @@ const AddMappingsModal = ({
143
143
  <Table<MappingType>
144
144
  data={isLoading ? [] : mappings}
145
145
  columns={mappingsColumns}
146
- className="add-mappings-table"
146
+ className="rcw-add-mappings-table"
147
147
  emptyTableContent={ReportsConfigWidget.localization.getLocalizedString(
148
148
  "ReportsConfigWidget:NoMappingsAvailable"
149
149
  )}
@@ -171,5 +171,3 @@ const AddMappingsModal = ({
171
171
  </Modal>
172
172
  );
173
173
  };
174
-
175
- export default AddMappingsModal;
@@ -0,0 +1,192 @@
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 { ExtractionClient, ExtractorState, REPORTING_BASE_PATH, ReportsClient } from "@itwin/insights-client";
6
+ import type { ReportMapping } from "@itwin/insights-client";
7
+ import { generateUrl, handleError } from "./utils";
8
+ import type { ReportsApiConfig } from "../context/ReportsApiConfigContext";
9
+ import { ExtractionStates } from "./ExtractionStatus";
10
+ import { STATUS_CHECK_INTERVAL } from "./Constants";
11
+
12
+ export type ReportMappingAndMapping = ReportMapping & {
13
+ mappingName: string;
14
+ mappingDescription: string;
15
+ iModelName: string;
16
+ };
17
+
18
+ export default class BulkExtractor {
19
+ private _reportsClientApi: ReportsClient;
20
+ private _extractionClientApi: ExtractionClient;
21
+ private _accessToken: () => Promise<string>;
22
+
23
+ private _reportIModels = new Map<string, string[]>(); // key: reportId, value: iModels
24
+ private _iModelStates = new Map<string, ExtractorState>(); // key: iModelId, value: state
25
+ private _timeFetched = new Date();
26
+ private _iModelRun = new Map<string, string>(); // key: iModelId, value: runId
27
+ private _iModelToast = new Set<string>();
28
+ private _successfulExtractionToast: (iModelName: string, odataFeedUrl: string) => void;
29
+ private _failedExtractionToast: (iModelName: string) => void;
30
+ private _setJobRunning: React.Dispatch<React.SetStateAction<boolean>> | undefined;
31
+ private _iModels: string[] = [];
32
+
33
+ constructor(
34
+ apiConfig: ReportsApiConfig,
35
+ successfulExtractionToast: (iModelName: string, odataFeedUrl: string) => void,
36
+ failedExtractionToast: (iModelName: string) => void,
37
+ ) {
38
+ const url = generateUrl(REPORTING_BASE_PATH, apiConfig.baseUrl);
39
+ this._reportsClientApi = new ReportsClient(url);
40
+ this._extractionClientApi = new ExtractionClient(url);
41
+ this._accessToken = apiConfig.getAccessToken;
42
+ this._successfulExtractionToast = successfulExtractionToast;
43
+ this._failedExtractionToast = failedExtractionToast;
44
+ }
45
+
46
+ private async fetchStates(): Promise<void> {
47
+ for (const [iModelId, runId] of this._iModelRun) {
48
+ const state = await this.getState(runId);
49
+ if (state === ExtractorState.Succeeded || state === ExtractorState.Failed) {
50
+ this._iModelRun.delete(iModelId);
51
+ }
52
+ this._iModelStates.set(iModelId, state);
53
+ }
54
+ }
55
+
56
+ public async getReportState(reportId: string): Promise<ExtractionStates> {
57
+ if ((new Date().getTime() - this._timeFetched.getTime()) > STATUS_CHECK_INTERVAL) {
58
+ this._timeFetched = new Date();
59
+ await this.fetchStates();
60
+ }
61
+
62
+ const iModels = this._reportIModels.get(reportId);
63
+ if (!iModels) return ExtractionStates.None;
64
+ const states: ExtractorState[] = [];
65
+ for (const iModelId of iModels) {
66
+ const state = this._iModelStates.get(iModelId);
67
+ if (!state) continue;
68
+ states.push(state);
69
+ }
70
+ return BulkExtractor.getFinalState(states);
71
+ }
72
+
73
+ public async getIModelState(iModelId: string, iModelName: string, odataFeedUrl: string): Promise<ExtractionStates> {
74
+ if ((new Date().getTime() - this._timeFetched.getTime()) > STATUS_CHECK_INTERVAL) {
75
+ this._timeFetched = new Date();
76
+ await this.fetchStates();
77
+ }
78
+
79
+ const state = this._iModelStates.get(iModelId);
80
+ if (!state) return ExtractionStates.None;
81
+ if (!this._iModelToast.has(iModelId)) {
82
+ if (state === ExtractorState.Succeeded) {
83
+ this._successfulExtractionToast(iModelName, odataFeedUrl);
84
+ this._iModelToast.add(iModelId);
85
+ this.checkRunning();
86
+ } else if (state === ExtractorState.Failed) {
87
+ this._failedExtractionToast(iModelName);
88
+ this._iModelToast.add(iModelId);
89
+ this.checkRunning();
90
+ }
91
+ }
92
+ return BulkExtractor.getFinalState([state]);
93
+ }
94
+
95
+ private static getFinalState(states: ExtractorState[]): ExtractionStates {
96
+ if (states.includes(ExtractorState.Failed))
97
+ return ExtractionStates.Failed;
98
+
99
+ if (states.includes(ExtractorState.Queued))
100
+ return ExtractionStates.Queued;
101
+
102
+ if (states.includes(ExtractorState.Running))
103
+ return ExtractionStates.Running;
104
+
105
+ if (states.includes(ExtractorState.Succeeded))
106
+ return ExtractionStates.Succeeded;
107
+
108
+ return ExtractionStates.Failed;
109
+ }
110
+
111
+ private async getState(runId: string): Promise<ExtractorState> {
112
+ try {
113
+ const accessToken = await this._accessToken();
114
+ const response = await this._extractionClientApi.getExtractionStatus(accessToken, runId);
115
+ return response.state;
116
+ } catch (error: any) {
117
+ handleError(error.status);
118
+ }
119
+ return ExtractorState.Failed;
120
+ }
121
+
122
+ private checkRunning(): void {
123
+ if (this._setJobRunning) {
124
+ let allFinished = true;
125
+ this._iModels.forEach((iModelId) => {
126
+ const state = this._iModelStates.get(iModelId);
127
+ if (state === ExtractorState.Queued || state === ExtractorState.Running) {
128
+ allFinished = false;
129
+ }
130
+ });
131
+
132
+ this._setJobRunning(!allFinished);
133
+ }
134
+ }
135
+
136
+ public async runReportExtractions(reportIds: string[]): Promise<void> {
137
+ const reportIModelIds = new Map<string, string[]>();
138
+ for (const reportId of reportIds) {
139
+ const reportIModels = await this.fetchReportIModels(reportId);
140
+ reportIModelIds.set(reportId, reportIModels);
141
+ this._reportIModels.set(reportId, reportIModels);
142
+ }
143
+ const iModels = new Set(Array.from(reportIModelIds.values()).flat());
144
+
145
+ for (const iModel of iModels) {
146
+ await this.runIModelExtractions([iModel]);
147
+ }
148
+ }
149
+
150
+ private async runExtraction(iModelId: string): Promise<string | undefined> {
151
+ try {
152
+ const response = await this._extractionClientApi.runExtraction(
153
+ await this._accessToken(),
154
+ iModelId
155
+ );
156
+ this._iModelToast.delete(iModelId);
157
+ return response.id;
158
+ } catch (error: any) {
159
+ handleError(error.status);
160
+ }
161
+ return undefined;
162
+ }
163
+
164
+ public async runIModelExtraction(iModelId: string): Promise<void> {
165
+ return this.runIModelExtractions([iModelId]);
166
+ }
167
+
168
+ public setHook(setJobRunning: React.Dispatch<React.SetStateAction<boolean>>, iModels: string[]): void {
169
+ this._setJobRunning = setJobRunning;
170
+ this._iModels = iModels;
171
+ this.checkRunning();
172
+ }
173
+
174
+ public async runIModelExtractions(iModels: string[]): Promise<void> {
175
+ for (const iModelId of iModels) {
176
+ const run = await this.runExtraction(iModelId);
177
+ if (run) {
178
+ this._iModelStates.set(iModelId, ExtractorState.Queued);
179
+ this._iModelRun.set(iModelId, run);
180
+ }
181
+ this.checkRunning();
182
+ }
183
+ }
184
+
185
+ private async fetchReportIModels(reportId: string): Promise<string[]> {
186
+ const reportMappings = await this._reportsClientApi.getReportMappings(
187
+ await this._accessToken(),
188
+ reportId
189
+ );
190
+ return reportMappings.map((x) => x.imodelId);
191
+ }
192
+ }
@@ -0,0 +1,7 @@
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
+ export const STATUS_CHECK_INTERVAL = 5000;
6
+ export const ANIMATION_DELAY = "5s";
7
+ export const ANIMATION_DURATION = "1s";
@@ -4,15 +4,16 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/itwinui-css/scss/variables";
6
6
 
7
- .delete-modal-body-text {
7
+ .rcw-delete-modal-body-text {
8
8
  display: flex;
9
9
  gap: $iui-xs;
10
10
  flex-wrap: wrap;
11
- > strong {
11
+
12
+ >strong {
12
13
  min-width: 0px;
13
14
  }
14
15
  }
15
16
 
16
17
  .rcw-loading-delete {
17
18
  margin-right: $iui-s;
18
- }
19
+ }
@@ -57,7 +57,7 @@ export const DeleteModal = ({
57
57
  }}
58
58
  >
59
59
  <ModalContent>
60
- <div className="delete-modal-body-text">
60
+ <div className="rcw-delete-modal-body-text">
61
61
  <Leading>
62
62
  {ReportsConfigWidget.localization.getLocalizedString(
63
63
  "ReportsConfigWidget:AreYouSureYouWantToDelete"
@@ -0,0 +1,34 @@
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 React from "react";
6
+ import { SvgStatusError } from "@itwin/itwinui-icons-color-react";
7
+ import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
8
+ import { ANIMATION_DELAY, ANIMATION_DURATION } from "../Constants";
9
+
10
+ interface ExtractionStateProps {
11
+ animation: boolean;
12
+ onAnimationEnd: () => void;
13
+ }
14
+
15
+ export const FailedExtractionState = ({ animation, onAnimationEnd }: ExtractionStateProps) => (
16
+ <div
17
+ title={ReportsConfigWidget.localization.getLocalizedString(
18
+ "ReportsConfigWidget:Failed"
19
+ )}
20
+ className="rcw-extraction-status"
21
+ >
22
+ <div
23
+ className={`rcw-status-icon`}
24
+ style={{
25
+ animationName: animation ? "rcw-fade-out" : "",
26
+ animationDelay: ANIMATION_DELAY,
27
+ animationDuration: ANIMATION_DURATION,
28
+ }}
29
+ onAnimationEnd={onAnimationEnd}
30
+ >
31
+ <SvgStatusError />
32
+ </div>
33
+ </div>
34
+ );
@@ -0,0 +1,20 @@
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 React from "react";
6
+ import { SvgStatusPending } from "@itwin/itwinui-icons-color-react";
7
+ import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
8
+
9
+ export const QueuedExtractionState = () => (
10
+ <div
11
+ title={ReportsConfigWidget.localization.getLocalizedString(
12
+ "ReportsConfigWidget:Queued"
13
+ )}
14
+ className="rcw-extraction-status"
15
+ >
16
+ <div className="rcw-status-icon">
17
+ <SvgStatusPending />
18
+ </div>
19
+ </div>
20
+ );
@@ -0,0 +1,18 @@
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 React from "react";
6
+ import { ProgressRadial } from "@itwin/itwinui-react";
7
+ import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
8
+
9
+ export const RunningExtractionState = () => (
10
+ <div
11
+ title={ReportsConfigWidget.localization.getLocalizedString(
12
+ "ReportsConfigWidget:Running"
13
+ )}
14
+ className="rcw-extraction-status-running"
15
+ >
16
+ <ProgressRadial size="x-small" indeterminate />
17
+ </div>
18
+ );
@@ -0,0 +1,22 @@
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 React from "react";
6
+ import { SvgStatusPendingHollow } from "@itwin/itwinui-icons-color-react";
7
+ import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
8
+
9
+ export const StartingExtractionState = () => (
10
+ <div
11
+ title={
12
+ ReportsConfigWidget.localization.getLocalizedString(
13
+ "ReportsConfigWidget:Starting"
14
+ )
15
+ }
16
+ className="rcw-extraction-status"
17
+ >
18
+ <div className="rcw-status-icon">
19
+ <SvgStatusPendingHollow />
20
+ </div>
21
+ </div>
22
+ );
@@ -0,0 +1,35 @@
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 React from "react";
6
+ import { SvgStatusSuccess } from "@itwin/itwinui-icons-color-react";
7
+ import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
8
+ import { ANIMATION_DELAY, ANIMATION_DURATION } from "../Constants";
9
+
10
+ interface ExtractionStateProps {
11
+ animation: boolean;
12
+ onAnimationEnd: () => void;
13
+ }
14
+
15
+ export const SucceededExtractionState = ({ animation, onAnimationEnd }: ExtractionStateProps) => (
16
+ <div
17
+ title={ReportsConfigWidget.localization.getLocalizedString(
18
+ "ReportsConfigWidget:Success"
19
+ )}
20
+ className="rcw-extraction-status"
21
+ >
22
+ <div
23
+ className={`rcw-status-icon`}
24
+ data-testid="rcw-success-animation"
25
+ style={{
26
+ animationName: animation ? "rcw-fade-out" : "",
27
+ animationDelay: ANIMATION_DELAY,
28
+ animationDuration: ANIMATION_DURATION,
29
+ }}
30
+ onAnimationEnd={onAnimationEnd}
31
+ >
32
+ <SvgStatusSuccess />
33
+ </div>
34
+ </div>
35
+ );
@@ -4,26 +4,27 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/itwinui-css/scss/variables";
6
6
 
7
- .extraction-container {
8
- display: flex;
9
- justify-content: space-between;
7
+ .rcw-extraction-status {
10
8
  align-items: center;
11
- gap: $iui-s;
12
- .extraction-combo-box {
13
- display: flex;
14
- flex-direction: column;
15
- flex-grow: 1;
16
- }
17
- .extraction-status-container {
9
+ height: 38px;
10
+ display: flex;
11
+
12
+ .rcw-status-icon {
13
+ width: $iui-icons-default;
14
+ height: $iui-icons-default;
15
+ align-items: center;
16
+ margin: auto $iui-xs * 3;
18
17
  display: flex;
19
18
  }
20
19
  }
21
20
 
22
- .extraction-status {
23
- display: flex;
21
+ .rcw-extraction-status-running {
24
22
  align-items: center;
25
- margin: 0 $iui-s;
26
- .status-icon {
23
+ height: 38px;
24
+ display: flex;
25
+ margin: auto $iui-xs * 3;
26
+
27
+ .rcw-status-icon {
27
28
  width: $iui-icons-default;
28
29
  height: $iui-icons-default;
29
30
  }
@@ -33,7 +34,8 @@
33
34
  0% {
34
35
  opacity: 1;
35
36
  }
37
+
36
38
  100% {
37
39
  opacity: 0;
38
40
  }
39
- }
41
+ }
@@ -0,0 +1,70 @@
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 * as React from "react";
6
+ import { useEffect, useState } from "react";
7
+ import "./ExtractionStatus.scss";
8
+ import { STATUS_CHECK_INTERVAL } from "./Constants";
9
+ import { StartingExtractionState } from "./ExtractionStates/StartingExtractionState";
10
+ import { RunningExtractionState } from "./ExtractionStates/RunningExtractionState";
11
+ import { FailedExtractionState } from "./ExtractionStates/FailedExtractionState";
12
+ import { QueuedExtractionState } from "./ExtractionStates/QueuedExtractionState";
13
+ import { SucceededExtractionState } from "./ExtractionStates/SucceededExtractionState";
14
+
15
+ export enum ExtractionStates {
16
+ None,
17
+ Starting,
18
+ Queued,
19
+ Running,
20
+ Succeeded,
21
+ Failed,
22
+ }
23
+
24
+ interface ExtractionStatusProps {
25
+ state: ExtractionStates;
26
+ clearExtractionState: () => void;
27
+ }
28
+
29
+ export const ExtractionStatus = ({
30
+ state,
31
+ clearExtractionState,
32
+ }: ExtractionStatusProps) => {
33
+ const [fadeOut, setFadeOut] = useState<boolean>(false);
34
+
35
+ const onAnimationEnd = () => {
36
+ clearExtractionState();
37
+ setFadeOut(false);
38
+ };
39
+
40
+ useEffect(() => {
41
+ let timer: number;
42
+ switch (state) {
43
+ case ExtractionStates.Succeeded:
44
+ case ExtractionStates.Failed:
45
+ timer = window.setTimeout(() => setFadeOut(true), STATUS_CHECK_INTERVAL);
46
+ }
47
+ return () => window.clearTimeout(timer);
48
+ }, [state]);
49
+
50
+ switch (state) {
51
+ case ExtractionStates.Starting:
52
+ return (<StartingExtractionState />);
53
+ case ExtractionStates.Queued:
54
+ return (<QueuedExtractionState />);
55
+ case ExtractionStates.Running:
56
+ return (<RunningExtractionState />);
57
+ case ExtractionStates.Succeeded:
58
+ return (<SucceededExtractionState
59
+ animation={fadeOut}
60
+ onAnimationEnd={onAnimationEnd}
61
+ />);
62
+ case ExtractionStates.Failed:
63
+ return (<FailedExtractionState
64
+ animation={fadeOut}
65
+ onAnimationEnd={onAnimationEnd}
66
+ />);
67
+ default:
68
+ return <></>;
69
+ }
70
+ };
@@ -0,0 +1,41 @@
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 React from "react";
6
+ import { Text } from "@itwin/itwinui-react";
7
+ import { ReportsConfigWidget } from "../../ReportsConfigWidget";
8
+
9
+ interface SuccessfulExtractionToastProps extends ExtractionToastProps {
10
+ odataFeedUrl: string;
11
+ }
12
+
13
+ interface ExtractionToastProps {
14
+ iModelName: string;
15
+ }
16
+
17
+ export const SuccessfulExtractionToast = ({ iModelName, odataFeedUrl }: SuccessfulExtractionToastProps) => {
18
+ const onClick = async (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
19
+ e.preventDefault();
20
+ await navigator.clipboard.writeText(odataFeedUrl);
21
+ };
22
+ return (
23
+ <div>
24
+ <Text>{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ExtractionSuccess")}{iModelName}</Text>
25
+ <a
26
+ href="#"
27
+ onClick={onClick}
28
+ >
29
+ {ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:CopyODataUrl")}
30
+ </a>
31
+ </div>
32
+ );
33
+ };
34
+
35
+ export const FailedExtractionToast = ({ iModelName }: ExtractionToastProps) => {
36
+ return (
37
+ <div>
38
+ <Text>{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ExtractionFailed")}{iModelName}</Text>
39
+ </div>
40
+ );
41
+ };