@itwin/reports-config-widget-react 0.4.0 → 0.6.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 (393) hide show
  1. package/CHANGELOG.json +61 -0
  2. package/CHANGELOG.md +23 -2
  3. package/LICENSE.md +9 -9
  4. package/README.md +38 -38
  5. package/__mocks__/fileMock.js +4 -4
  6. package/api/reports-config-widget-react.api.md +130 -0
  7. package/api/reports-config-widget-react.exports.csv +14 -0
  8. package/api/temp/reports-config-widget-react.api.md +130 -0
  9. package/coverage/clover.xml +524 -514
  10. package/coverage/coverage-final.json +32 -32
  11. package/coverage/lcov-report/favicon.png +0 -0
  12. package/coverage/lcov-report/index.html +26 -26
  13. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  14. package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +15 -15
  15. package/coverage/lcov-report/src/index.html +1 -1
  16. package/coverage/lcov-report/src/test/index.html +15 -15
  17. package/coverage/lcov-report/src/test/test-utils.tsx.html +233 -20
  18. package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +22 -64
  19. package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +5 -38
  20. package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +23 -119
  21. package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +117 -90
  22. package/coverage/lcov-report/src/widget/components/Constants.ts.html +16 -10
  23. package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +16 -106
  24. package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +6 -21
  25. package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +6 -21
  26. package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +7 -22
  27. package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +7 -28
  28. package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +6 -21
  29. package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
  30. package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +20 -47
  31. package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +20 -11
  32. package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +16 -79
  33. package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +15 -108
  34. package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +36 -75
  35. package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +62 -92
  36. package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +104 -128
  37. package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +86 -299
  38. package/coverage/lcov-report/src/widget/components/Reports.tsx.html +64 -226
  39. package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +63 -45
  40. package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +10 -49
  41. package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +8 -47
  42. package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +6 -12
  43. package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +15 -27
  44. package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +12 -57
  45. package/coverage/lcov-report/src/widget/components/index.html +56 -56
  46. package/coverage/lcov-report/src/widget/components/utils.tsx.html +32 -176
  47. package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +9 -15
  48. package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +9 -15
  49. package/coverage/lcov-report/src/widget/context/index.html +1 -1
  50. package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
  51. package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +12 -54
  52. package/coverage/lcov-report/src/widget/index.html +1 -1
  53. package/coverage/lcov.info +959 -922
  54. package/jest.config.js +14 -17
  55. package/lib/cjs/ReportsConfigWidget.d.ts +4 -0
  56. package/lib/cjs/ReportsConfigWidget.d.ts.map +1 -1
  57. package/lib/cjs/ReportsConfigWidget.js +4 -0
  58. package/lib/cjs/ReportsConfigWidget.js.map +1 -1
  59. package/lib/cjs/reports-config-widget-react.js +8 -4
  60. package/lib/cjs/reports-config-widget-react.js.map +1 -1
  61. package/lib/cjs/test/AddMappingModal.test.js +24 -72
  62. package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
  63. package/lib/cjs/test/BulkExtractor.test.js +73 -44
  64. package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
  65. package/lib/cjs/test/DeleteModal.test.js +3 -3
  66. package/lib/cjs/test/DeleteModal.test.js.map +1 -1
  67. package/lib/cjs/test/ReportAction.test.js +6 -4
  68. package/lib/cjs/test/ReportAction.test.js.map +1 -1
  69. package/lib/cjs/test/ReportMappingHorizontalTile.test.js +76 -86
  70. package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
  71. package/lib/cjs/test/ReportMappings.test.js +53 -80
  72. package/lib/cjs/test/ReportMappings.test.js.map +1 -1
  73. package/lib/cjs/test/Reports.test.js +54 -50
  74. package/lib/cjs/test/Reports.test.js.map +1 -1
  75. package/lib/cjs/test/WidgetHeader.test.js +3 -3
  76. package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
  77. package/lib/cjs/test/test-utils.d.ts +38 -0
  78. package/lib/cjs/test/test-utils.d.ts.map +1 -1
  79. package/lib/cjs/test/test-utils.js +79 -5
  80. package/lib/cjs/test/test-utils.js.map +1 -1
  81. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  82. package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +7 -0
  83. package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
  84. package/lib/cjs/widget/ReportsConfigUiProvider.js +13 -4
  85. package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
  86. package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
  87. package/lib/cjs/widget/components/ActionPanel.js +5 -1
  88. package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
  89. package/lib/cjs/widget/components/AddMappingsModal.d.ts +1 -1
  90. package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
  91. package/lib/cjs/widget/components/AddMappingsModal.js +12 -8
  92. package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
  93. package/lib/cjs/widget/components/AddMappingsModal.scss +1 -1
  94. package/lib/cjs/widget/components/BulkExtractor.d.ts +7 -4
  95. package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
  96. package/lib/cjs/widget/components/BulkExtractor.js +52 -35
  97. package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
  98. package/lib/cjs/widget/components/Constants.d.ts +1 -0
  99. package/lib/cjs/widget/components/Constants.d.ts.map +1 -1
  100. package/lib/cjs/widget/components/Constants.js +5 -4
  101. package/lib/cjs/widget/components/Constants.js.map +1 -1
  102. package/lib/cjs/widget/components/DeleteModal.d.ts +1 -1
  103. package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
  104. package/lib/cjs/widget/components/DeleteModal.js +10 -6
  105. package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
  106. package/lib/cjs/widget/components/DeleteModal.scss +2 -2
  107. package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
  108. package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
  109. package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
  110. package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
  111. package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
  112. package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
  113. package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
  114. package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
  115. package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
  116. package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
  117. package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
  118. package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
  119. package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
  120. package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
  121. package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
  122. package/lib/cjs/widget/components/ExtractionStatus.d.ts +1 -1
  123. package/lib/cjs/widget/components/ExtractionStatus.d.ts.map +1 -1
  124. package/lib/cjs/widget/components/ExtractionStatus.js +14 -10
  125. package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
  126. package/lib/cjs/widget/components/ExtractionStatus.scss +1 -1
  127. package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -1
  128. package/lib/cjs/widget/components/ExtractionToast.js +3 -3
  129. package/lib/cjs/widget/components/ExtractionToast.js.map +1 -1
  130. package/lib/cjs/widget/components/HorizontalTile.d.ts.map +1 -1
  131. package/lib/cjs/widget/components/HorizontalTile.js +1 -2
  132. package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
  133. package/lib/cjs/widget/components/HorizontalTile.scss +1 -4
  134. package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
  135. package/lib/cjs/widget/components/LocalizedTablePaginator.js +6 -2
  136. package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
  137. package/lib/cjs/widget/components/ReportAction.d.ts +8 -0
  138. package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
  139. package/lib/cjs/widget/components/ReportAction.js +14 -8
  140. package/lib/cjs/widget/components/ReportAction.js.map +1 -1
  141. package/lib/cjs/widget/components/ReportAction.scss +1 -1
  142. package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
  143. package/lib/cjs/widget/components/ReportHorizontalTile.js +9 -5
  144. package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
  145. package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
  146. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +51 -46
  147. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
  148. package/lib/cjs/widget/components/ReportMappings.d.ts +8 -0
  149. package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
  150. package/lib/cjs/widget/components/ReportMappings.js +30 -12
  151. package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
  152. package/lib/cjs/widget/components/Reports.d.ts +9 -1
  153. package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
  154. package/lib/cjs/widget/components/Reports.js +12 -9
  155. package/lib/cjs/widget/components/Reports.js.map +1 -1
  156. package/lib/cjs/widget/components/Reports.scss +0 -1
  157. package/lib/cjs/widget/components/ReportsConfigContext.d.ts +8 -0
  158. package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
  159. package/lib/cjs/widget/components/ReportsConfigContext.js +20 -7
  160. package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
  161. package/lib/cjs/widget/components/ReportsContainer.d.ts +1 -1
  162. package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
  163. package/lib/cjs/widget/components/ReportsContainer.js +7 -5
  164. package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
  165. package/lib/cjs/widget/components/ReportsContainer.scss +1 -1
  166. package/lib/cjs/widget/components/ReportsHeader.d.ts +1 -1
  167. package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -1
  168. package/lib/cjs/widget/components/ReportsHeader.js +6 -7
  169. package/lib/cjs/widget/components/ReportsHeader.js.map +1 -1
  170. package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -1
  171. package/lib/cjs/widget/components/ReportsRouter.js +3 -3
  172. package/lib/cjs/widget/components/ReportsRouter.js.map +1 -1
  173. package/lib/cjs/widget/components/SearchBar.d.ts +1 -1
  174. package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
  175. package/lib/cjs/widget/components/SearchBar.js +9 -5
  176. package/lib/cjs/widget/components/SearchBar.js.map +1 -1
  177. package/lib/cjs/widget/components/SelectIModel.d.ts +1 -1
  178. package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
  179. package/lib/cjs/widget/components/SelectIModel.js +7 -3
  180. package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
  181. package/lib/cjs/widget/components/SelectIModel.scss +1 -1
  182. package/lib/cjs/widget/components/utils.d.ts +1 -1
  183. package/lib/cjs/widget/components/utils.d.ts.map +1 -1
  184. package/lib/cjs/widget/components/utils.js +5 -5
  185. package/lib/cjs/widget/components/utils.js.map +1 -1
  186. package/lib/cjs/widget/components/utils.scss +1 -1
  187. package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -1
  188. package/lib/cjs/widget/context/BulkExtractorContext.js +5 -1
  189. package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
  190. package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
  191. package/lib/cjs/widget/context/ReportsConfigApiContext.js +5 -1
  192. package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
  193. package/lib/cjs/widget/hooks/useValidator.d.ts +1 -4
  194. package/lib/cjs/widget/hooks/useValidator.d.ts.map +1 -1
  195. package/lib/cjs/widget/hooks/useValidator.js +3 -3
  196. package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
  197. package/lib/esm/ReportsConfigWidget.d.ts +4 -0
  198. package/lib/esm/ReportsConfigWidget.d.ts.map +1 -1
  199. package/lib/esm/ReportsConfigWidget.js +4 -0
  200. package/lib/esm/ReportsConfigWidget.js.map +1 -1
  201. package/lib/esm/reports-config-widget-react.js +3 -3
  202. package/lib/esm/reports-config-widget-react.js.map +1 -1
  203. package/lib/esm/test/AddMappingModal.test.js +12 -64
  204. package/lib/esm/test/AddMappingModal.test.js.map +1 -1
  205. package/lib/esm/test/BulkExtractor.test.js +69 -44
  206. package/lib/esm/test/BulkExtractor.test.js.map +1 -1
  207. package/lib/esm/test/DeleteModal.test.js +4 -4
  208. package/lib/esm/test/DeleteModal.test.js.map +1 -1
  209. package/lib/esm/test/ReportAction.test.js +7 -5
  210. package/lib/esm/test/ReportAction.test.js.map +1 -1
  211. package/lib/esm/test/ReportMappingHorizontalTile.test.js +66 -80
  212. package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
  213. package/lib/esm/test/ReportMappings.test.js +42 -73
  214. package/lib/esm/test/ReportMappings.test.js.map +1 -1
  215. package/lib/esm/test/Reports.test.js +32 -51
  216. package/lib/esm/test/Reports.test.js.map +1 -1
  217. package/lib/esm/test/WidgetHeader.test.js +3 -3
  218. package/lib/esm/test/WidgetHeader.test.js.map +1 -1
  219. package/lib/esm/test/test-utils.d.ts +38 -0
  220. package/lib/esm/test/test-utils.d.ts.map +1 -1
  221. package/lib/esm/test/test-utils.js +73 -3
  222. package/lib/esm/test/test-utils.js.map +1 -1
  223. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  224. package/lib/esm/widget/ReportsConfigUiProvider.d.ts +7 -0
  225. package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
  226. package/lib/esm/widget/ReportsConfigUiProvider.js +9 -4
  227. package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
  228. package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
  229. package/lib/esm/widget/components/ActionPanel.js.map +1 -1
  230. package/lib/esm/widget/components/AddMappingsModal.d.ts +1 -1
  231. package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
  232. package/lib/esm/widget/components/AddMappingsModal.js +7 -7
  233. package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
  234. package/lib/esm/widget/components/AddMappingsModal.scss +1 -1
  235. package/lib/esm/widget/components/BulkExtractor.d.ts +7 -4
  236. package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
  237. package/lib/esm/widget/components/BulkExtractor.js +53 -36
  238. package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
  239. package/lib/esm/widget/components/Constants.d.ts +1 -0
  240. package/lib/esm/widget/components/Constants.d.ts.map +1 -1
  241. package/lib/esm/widget/components/Constants.js +4 -3
  242. package/lib/esm/widget/components/Constants.js.map +1 -1
  243. package/lib/esm/widget/components/DeleteModal.d.ts +1 -1
  244. package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
  245. package/lib/esm/widget/components/DeleteModal.js +6 -6
  246. package/lib/esm/widget/components/DeleteModal.js.map +1 -1
  247. package/lib/esm/widget/components/DeleteModal.scss +2 -2
  248. package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
  249. package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
  250. package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
  251. package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
  252. package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
  253. package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
  254. package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
  255. package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
  256. package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
  257. package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
  258. package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
  259. package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
  260. package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
  261. package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
  262. package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
  263. package/lib/esm/widget/components/ExtractionStatus.d.ts +1 -1
  264. package/lib/esm/widget/components/ExtractionStatus.d.ts.map +1 -1
  265. package/lib/esm/widget/components/ExtractionStatus.js +9 -9
  266. package/lib/esm/widget/components/ExtractionStatus.js.map +1 -1
  267. package/lib/esm/widget/components/ExtractionStatus.scss +1 -1
  268. package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -1
  269. package/lib/esm/widget/components/ExtractionToast.js +3 -3
  270. package/lib/esm/widget/components/ExtractionToast.js.map +1 -1
  271. package/lib/esm/widget/components/HorizontalTile.d.ts.map +1 -1
  272. package/lib/esm/widget/components/HorizontalTile.js +1 -2
  273. package/lib/esm/widget/components/HorizontalTile.js.map +1 -1
  274. package/lib/esm/widget/components/HorizontalTile.scss +1 -4
  275. package/lib/esm/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
  276. package/lib/esm/widget/components/LocalizedTablePaginator.js +1 -1
  277. package/lib/esm/widget/components/LocalizedTablePaginator.js.map +1 -1
  278. package/lib/esm/widget/components/ReportAction.d.ts +8 -0
  279. package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
  280. package/lib/esm/widget/components/ReportAction.js +10 -8
  281. package/lib/esm/widget/components/ReportAction.js.map +1 -1
  282. package/lib/esm/widget/components/ReportAction.scss +1 -1
  283. package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
  284. package/lib/esm/widget/components/ReportHorizontalTile.js +6 -6
  285. package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
  286. package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
  287. package/lib/esm/widget/components/ReportMappingHorizontalTile.js +47 -46
  288. package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
  289. package/lib/esm/widget/components/ReportMappings.d.ts +8 -0
  290. package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
  291. package/lib/esm/widget/components/ReportMappings.js +28 -14
  292. package/lib/esm/widget/components/ReportMappings.js.map +1 -1
  293. package/lib/esm/widget/components/Reports.d.ts +9 -1
  294. package/lib/esm/widget/components/Reports.d.ts.map +1 -1
  295. package/lib/esm/widget/components/Reports.js +8 -9
  296. package/lib/esm/widget/components/Reports.js.map +1 -1
  297. package/lib/esm/widget/components/Reports.scss +0 -1
  298. package/lib/esm/widget/components/ReportsConfigContext.d.ts +8 -0
  299. package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
  300. package/lib/esm/widget/components/ReportsConfigContext.js +17 -8
  301. package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
  302. package/lib/esm/widget/components/ReportsContainer.d.ts +1 -1
  303. package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
  304. package/lib/esm/widget/components/ReportsContainer.js +2 -4
  305. package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
  306. package/lib/esm/widget/components/ReportsContainer.scss +1 -1
  307. package/lib/esm/widget/components/ReportsHeader.d.ts +1 -1
  308. package/lib/esm/widget/components/ReportsHeader.d.ts.map +1 -1
  309. package/lib/esm/widget/components/ReportsHeader.js +6 -7
  310. package/lib/esm/widget/components/ReportsHeader.js.map +1 -1
  311. package/lib/esm/widget/components/ReportsRouter.d.ts.map +1 -1
  312. package/lib/esm/widget/components/ReportsRouter.js +3 -3
  313. package/lib/esm/widget/components/ReportsRouter.js.map +1 -1
  314. package/lib/esm/widget/components/SearchBar.d.ts +1 -1
  315. package/lib/esm/widget/components/SearchBar.d.ts.map +1 -1
  316. package/lib/esm/widget/components/SearchBar.js +4 -4
  317. package/lib/esm/widget/components/SearchBar.js.map +1 -1
  318. package/lib/esm/widget/components/SelectIModel.d.ts +1 -1
  319. package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -1
  320. package/lib/esm/widget/components/SelectIModel.js +3 -3
  321. package/lib/esm/widget/components/SelectIModel.js.map +1 -1
  322. package/lib/esm/widget/components/SelectIModel.scss +1 -1
  323. package/lib/esm/widget/components/utils.d.ts +1 -1
  324. package/lib/esm/widget/components/utils.d.ts.map +1 -1
  325. package/lib/esm/widget/components/utils.js +6 -6
  326. package/lib/esm/widget/components/utils.js.map +1 -1
  327. package/lib/esm/widget/components/utils.scss +1 -1
  328. package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -1
  329. package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -1
  330. package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
  331. package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -1
  332. package/lib/esm/widget/hooks/useValidator.d.ts +1 -4
  333. package/lib/esm/widget/hooks/useValidator.d.ts.map +1 -1
  334. package/lib/esm/widget/hooks/useValidator.js +3 -3
  335. package/lib/esm/widget/hooks/useValidator.js.map +1 -1
  336. package/package.json +37 -31
  337. package/src/ReportsConfigWidget.ts +9 -9
  338. package/src/reports-config-widget-react.ts +3 -3
  339. package/src/test/AddMappingModal.test.tsx +47 -122
  340. package/src/test/BulkExtractor.test.ts +73 -118
  341. package/src/test/DeleteModal.test.tsx +6 -23
  342. package/src/test/ReportAction.test.tsx +20 -38
  343. package/src/test/ReportMappingHorizontalTile.test.tsx +140 -161
  344. package/src/test/ReportMappings.test.tsx +80 -146
  345. package/src/test/Reports.test.tsx +57 -169
  346. package/src/test/WidgetHeader.test.tsx +3 -3
  347. package/src/test/test-utils.tsx +80 -9
  348. package/src/widget/ReportsConfigUiProvider.tsx +16 -30
  349. package/src/widget/components/ActionPanel.tsx +3 -14
  350. package/src/widget/components/AddMappingsModal.scss +1 -1
  351. package/src/widget/components/AddMappingsModal.tsx +19 -51
  352. package/src/widget/components/BulkExtractor.ts +63 -54
  353. package/src/widget/components/Constants.ts +5 -3
  354. package/src/widget/components/DeleteModal.scss +2 -2
  355. package/src/widget/components/DeleteModal.tsx +11 -41
  356. package/src/widget/components/ExtractionStates/FailedExtractionState.tsx +4 -9
  357. package/src/widget/components/ExtractionStates/QueuedExtractionState.tsx +4 -9
  358. package/src/widget/components/ExtractionStates/RunningExtractionState.tsx +4 -9
  359. package/src/widget/components/ExtractionStates/StartingExtractionState.tsx +4 -11
  360. package/src/widget/components/ExtractionStates/SucceededExtractionState.tsx +4 -9
  361. package/src/widget/components/ExtractionStatus.scss +1 -1
  362. package/src/widget/components/ExtractionStatus.tsx +9 -18
  363. package/src/widget/components/ExtractionToast.tsx +12 -9
  364. package/src/widget/components/HorizontalTile.scss +1 -4
  365. package/src/widget/components/HorizontalTile.tsx +12 -33
  366. package/src/widget/components/LocalizedTablePaginator.tsx +13 -44
  367. package/src/widget/components/ReportAction.scss +1 -1
  368. package/src/widget/components/ReportAction.tsx +26 -39
  369. package/src/widget/components/ReportHorizontalTile.tsx +45 -55
  370. package/src/widget/components/ReportMappingHorizontalTile.tsx +70 -78
  371. package/src/widget/components/ReportMappings.tsx +59 -130
  372. package/src/widget/components/Reports.scss +0 -1
  373. package/src/widget/components/Reports.tsx +28 -82
  374. package/src/widget/components/ReportsConfigContext.tsx +32 -26
  375. package/src/widget/components/ReportsContainer.scss +1 -1
  376. package/src/widget/components/ReportsContainer.tsx +8 -21
  377. package/src/widget/components/ReportsHeader.tsx +6 -19
  378. package/src/widget/components/ReportsRouter.tsx +4 -6
  379. package/src/widget/components/SearchBar.tsx +9 -13
  380. package/src/widget/components/SelectIModel.scss +1 -1
  381. package/src/widget/components/SelectIModel.tsx +10 -25
  382. package/src/widget/components/utils.scss +1 -1
  383. package/src/widget/components/utils.tsx +21 -69
  384. package/src/widget/context/BulkExtractorContext.tsx +4 -6
  385. package/src/widget/context/ReportsConfigApiContext.tsx +4 -6
  386. package/src/widget/hooks/useValidator.ts +10 -24
  387. package/tsconfig.json +11 -11
  388. package/.rush/temp/operation/rebuild/all.log +0 -9
  389. package/.rush/temp/operation/rebuild/state.json +0 -3
  390. package/.rush/temp/package-deps_rebuild.json +0 -68
  391. package/.rush/temp/shrinkwrap-deps.json +0 -898
  392. package/reports-config-widget-react.build.error.log +0 -14
  393. package/reports-config-widget-react.build.log +0 -63
@@ -1 +1 @@
1
- {"version":3,"file":"useValidator.js","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,CAAC,MAAM,iBAAiB,GAC5B,uHAAuH,CAAC;AAE1H,MAAM,YAAY,GAAG,GAGnB,EAAE;IACF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,eAAe,GAAG;QACtB,qBAAqB,EAAE;YACrB,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAC1D,sDAAsD,CACvD;YACD,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC5B,CAAC;SACF;QACD,gCAAgC,EAAE;YAChC,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAC1D,iEAAiE,CAClE;YACD,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACjC,CAAC;SACF;QACD,2CAA2C,EAAE;YAC3C,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAC1D,4EAA4E,CAC7E;YACD,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACzC,CAAC;SACF;QACD,SAAS,EAAE;YACT,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAC1D,0CAA0C,CAC3C;YACD,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC;YAC3B,CAAC;SACF;KACF,CAAC;IAEF,MAAM,cAAc,GAAG;QACrB,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAC3D,oDAAoD,CACrD;KACF,CAAC;IAEF,MAAM,SAAS,GAAG,IAAI,oBAAoB,CAAC;QACzC,QAAQ,EAAE,cAAc;QACxB,UAAU,EAAE,eAAe;KAC5B,CAAC,CAAC;IAEH,IAAI,IAAI,EAAE;QACR,SAAS,CAAC,YAAY,EAAE,CAAC;KAC1B;IAED,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,eAAe,YAAY,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 { useState } from \"react\";\nimport SimpleReactValidator from \"simple-react-validator\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport const NAME_REQUIREMENTS =\n \"required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresSpacesAndDigits|CharLimit\";\n\nconst useValidator = (): [\n SimpleReactValidator,\n React.Dispatch<React.SetStateAction<boolean>>\n] => {\n const [show, setShow] = useState(false);\n const customValidator = {\n NoDuplicateUnderscore: {\n message: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Validators.NoDuplicateUnderscore\"\n ),\n rule: (val: string) => {\n return !val.match(/__+/i);\n },\n },\n OnlyBeginsWithLetterOrUnderscore: {\n message: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Validators.OnlyBeginsWithLetterOrUnderscore\"\n ),\n rule: (val: string) => {\n return !val.match(/^[\\W\\d]+/i);\n },\n },\n FollowedByLettersUnderscoresSpacesAndDigits: {\n message: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Validators.FollowedByLettersUnderscoresSpacesAndDigits\"\n ),\n rule: (val: string) => {\n return !val.match(/[^a-zA-Z0-9_\\s]+/i);\n },\n },\n CharLimit: {\n message: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Validators.CharLimit\"\n ),\n rule: (val: string) => {\n return val.length <= 128;\n },\n },\n };\n\n const customMessages = {\n required: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Validators.ThisFieldIsRequired\"\n ),\n };\n\n const validator = new SimpleReactValidator({\n messages: customMessages,\n validators: customValidator,\n });\n\n if (show) {\n validator.showMessages();\n }\n\n return [validator, setShow];\n};\n\nexport default useValidator;\n"]}
1
+ {"version":3,"file":"useValidator.js","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,CAAC,MAAM,iBAAiB,GAAG,uHAAuH,CAAC;AAEzJ,MAAM,YAAY,GAAG,GAA0E,EAAE;IAC/F,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,eAAe,GAAG;QACtB,qBAAqB,EAAE;YACrB,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,sDAAsD,CAAC;YACpH,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC5B,CAAC;SACF;QACD,gCAAgC,EAAE;YAChC,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,iEAAiE,CAAC;YAC/H,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACjC,CAAC;SACF;QACD,2CAA2C,EAAE;YAC3C,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,4EAA4E,CAAC;YAC1I,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACzC,CAAC;SACF;QACD,SAAS,EAAE;YACT,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,0CAA0C,CAAC;YACxG,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC;YAC3B,CAAC;SACF;KACF,CAAC;IAEF,MAAM,cAAc,GAAG;QACrB,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,oDAAoD,CAAC;KACpH,CAAC;IAEF,MAAM,SAAS,GAAG,IAAI,oBAAoB,CAAC;QACzC,QAAQ,EAAE,cAAc;QACxB,UAAU,EAAE,eAAe;KAC5B,CAAC,CAAC;IAEH,IAAI,IAAI,EAAE;QACR,SAAS,CAAC,YAAY,EAAE,CAAC;KAC1B;IAED,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,eAAe,YAAY,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 { useState } from \"react\";\nimport SimpleReactValidator from \"simple-react-validator\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport const NAME_REQUIREMENTS = \"required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresSpacesAndDigits|CharLimit\";\n\nconst useValidator = (): [SimpleReactValidator, React.Dispatch<React.SetStateAction<boolean>>] => {\n const [show, setShow] = useState(false);\n const customValidator = {\n NoDuplicateUnderscore: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.NoDuplicateUnderscore\"),\n rule: (val: string) => {\n return !val.match(/__+/i);\n },\n },\n OnlyBeginsWithLetterOrUnderscore: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.OnlyBeginsWithLetterOrUnderscore\"),\n rule: (val: string) => {\n return !val.match(/^[\\W\\d]+/i);\n },\n },\n FollowedByLettersUnderscoresSpacesAndDigits: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.FollowedByLettersUnderscoresSpacesAndDigits\"),\n rule: (val: string) => {\n return !val.match(/[^a-zA-Z0-9_\\s]+/i);\n },\n },\n CharLimit: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.CharLimit\"),\n rule: (val: string) => {\n return val.length <= 128;\n },\n },\n };\n\n const customMessages = {\n required: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.ThisFieldIsRequired\"),\n };\n\n const validator = new SimpleReactValidator({\n messages: customMessages,\n validators: customValidator,\n });\n\n if (show) {\n validator.showMessages();\n }\n\n return [validator, setShow];\n};\n\nexport default useValidator;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/reports-config-widget-react",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "An iTwin.js 3D Viewer Widget that interfaces with the iTwin Reporting Platform.",
5
5
  "keywords": [
6
6
  "Bentley",
@@ -22,11 +22,33 @@
22
22
  "main": "lib/cjs/reports-config-widget-react.js",
23
23
  "module": "lib/esm/reports-config-widget-react.js",
24
24
  "typings": "lib/cjs/reports-config-widget-react",
25
+ "scripts": {
26
+ "build": "npm run -s dual-build && npm run -s copy:assets",
27
+ "build:cjs": "tsc 1>&2 --outDir lib/cjs",
28
+ "build:esm": "tsc 1>&2 --module ES2020 --outDir lib/esm",
29
+ "clean": "rimraf lib",
30
+ "copy:assets": "npm run -s copy:public && npm run -s copy:cjs && npm run -s copy:esm",
31
+ "copy:cjs": "cpx \"./src/**/*.scss\" ./lib/cjs",
32
+ "copy:esm": "cpx \"./src/**/*.scss\" ./lib/esm",
33
+ "copy:public": "cpx \"./public/**/*\" ./lib/public",
34
+ "cover": "npm test -- --coverage",
35
+ "dual-build": "npm run -s build:cjs && npm run -s build:esm",
36
+ "extract-api": "betools extract-api --entry=reports-config-widget-react --apiReportFolder=./api --apiReportTempFolder=./api/temp --apiSummaryFolder=./api",
37
+ "lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
38
+ "lint:fix": "npm run lint -- --fix",
39
+ "pseudolocalize": "betools pseudolocalize --englishDir ./public/locales/en --out ./public/locales/en-PSEUDO",
40
+ "rebuild": "npm run clean && npm run build",
41
+ "test": "jest",
42
+ "test:watch": "jest --watch "
43
+ },
25
44
  "eslintConfig": {
26
45
  "plugins": [
27
46
  "@itwin"
28
47
  ],
29
- "extends": "plugin:@itwin/ui",
48
+ "extends": [
49
+ "plugin:@itwin/ui",
50
+ "prettier"
51
+ ],
30
52
  "rules": {
31
53
  "no-duplicate-imports": "off",
32
54
  "@typescript-eslint/consistent-type-imports": "error",
@@ -37,9 +59,10 @@
37
59
  }
38
60
  },
39
61
  "dependencies": {
40
- "@itwin/imodels-access-frontend": "^4.0.0",
41
- "@itwin/imodels-client-management": "^1.0.1",
42
- "@itwin/insights-client": "^0.4.0",
62
+ "@itwin/imodels-access-common": "^4.1.4",
63
+ "@itwin/imodels-access-frontend": "^4.1.4",
64
+ "@itwin/imodels-client-management": "^4.2.3",
65
+ "@itwin/insights-client": "^0.10.1",
43
66
  "@itwin/itwinui-icons-color-react": "^2.1.0",
44
67
  "@itwin/itwinui-icons-react": "^2.4.0",
45
68
  "@itwin/itwinui-react": "^2.11.0",
@@ -61,6 +84,8 @@
61
84
  "@itwin/core-orbitgt": "^4.0.0",
62
85
  "@itwin/core-quantity": "^4.0.0",
63
86
  "@itwin/core-react": "^4.0.0",
87
+ "@itwin/core-telemetry": "^4.0.0",
88
+ "@itwin/ecschema-metadata": "^4.0.0",
64
89
  "@itwin/eslint-plugin": "^3.7.8",
65
90
  "@itwin/imodel-components-react": "^4.0.0",
66
91
  "@itwin/presentation-common": "^4.0.0",
@@ -83,21 +108,21 @@
83
108
  "chai": "^4.2.0",
84
109
  "cpx2": "^3.0.0",
85
110
  "eslint": "^7.32.0",
111
+ "eslint-config-prettier": "^9.1.0",
86
112
  "eslint-plugin-node": "^11.1.0",
87
- "eslint-plugin-react": "^7.25.1",
113
+ "eslint-plugin-react": "^7.33.2",
88
114
  "eslint-plugin-react-hooks": "^4.2.0",
89
115
  "jest": "^27.5.1",
90
116
  "jest-cli": "^27.5.1",
91
117
  "jest-transform-stub": "^2.0.0",
92
- "msw": "^0.39.2",
93
118
  "react": "^17.0.2",
94
119
  "react-dom": "^17.0.2",
95
- "react-redux": "^7.2.0",
96
- "redux": "^4.0.4",
120
+ "react-redux": "^7.2.2",
121
+ "redux": "^4.1.0",
97
122
  "rimraf": "^3.0.2",
98
123
  "ts-jest": "^27.1.3",
99
124
  "typemoq": "^2.1.0",
100
- "typescript": "~4.5.0",
125
+ "typescript": "~4.6.0",
101
126
  "xmlhttprequest": "^1.8.0"
102
127
  },
103
128
  "peerDependencies": {
@@ -108,24 +133,5 @@
108
133
  "react": "^17.0.2",
109
134
  "react-dom": "^17.0.2",
110
135
  "react-redux": "^7.2.0"
111
- },
112
- "scripts": {
113
- "build": "npm run -s dual-build && npm run -s copy:assets",
114
- "build:cjs": "tsc 1>&2 --outDir lib/cjs",
115
- "build:esm": "tsc 1>&2 --module ES2020 --outDir lib/esm",
116
- "clean": "rimraf lib",
117
- "copy:assets": "npm run -s copy:public && npm run -s copy:cjs && npm run -s copy:esm",
118
- "copy:cjs": "cpx \"./src/**/*.scss\" ./lib/cjs",
119
- "copy:esm": "cpx \"./src/**/*.scss\" ./lib/esm",
120
- "copy:public": "cpx \"./public/**/*\" ./lib/public",
121
- "cover": "npm test -- --coverage",
122
- "dual-build": "npm run -s build:cjs && npm run -s build:esm",
123
- "lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
124
- "lint:fix": "npm run lint -- --fix",
125
- "pseudolocalize": "betools pseudolocalize --englishDir ./public/locales/en --out ./public/locales/en-PSEUDO",
126
- "rebuild": "npm run clean && npm run build",
127
- "test": "jest",
128
- "test:watch": "jest --watch "
129
- },
130
- "readme": "# @itwin/reports-config-widget-react\r\n\r\nCopyright © Bentley Systems, Incorporated. All rights reserved.\r\nThe Reports Config widget is a UI component for iTwin Viewer applications that simplifies how users (and developers) interface with the [Reporting Platform APIs](https://developer.bentley.com/apis/insights/overview/). This widget is one piece of the Reporting story that focuses on the configuration of Reports and the extraction thereof. It complements the [Grouping & Mapping Widget](https://www.npmjs.com/package/@itwin/grouping-mapping-widget).\r\nThe reports-config-widget-react package provides a UiProvider class - `ReportsConfigProvider` - which can be passed into the `uiProviders` prop of the iTwin Viewer's `<Viewer />` component.\r\n\r\n## Getting Started\r\n\r\nThis is not a standalone UI and requires a parent iTwin Viewer application to work as intended.\r\nA guide on how to create a basic iTwin Viewer application can be found here: <https://www.itwinjs.org/learning/tutorials/develop-web-viewer/>.\r\nThis package provides a viewer 'widget'. Documentation on how to add a widget to your application can be found here: <https://developer.bentley.com/tutorials/itwin-viewer-hello-world/#2-your-first-ui-widget>.\r\n\r\n## Permissions and Scopes\r\n\r\nThe SPA client used by your iTwin viewer must have these additional scopes:\r\n\r\n- `insights:read`\r\n- `insights:modify`\r\n- `projects:read`\r\n\r\nIn addition, users must have the `imodels_read` and `imodels_write` [permissions](https://developer.bentley.com/apis/insights/operations/create-mapping/#authorization) assigned at either the Project or iModel level. Further instruction on how to create roles and assign permissions can be found in the [iTwin Platform Projects API documentation](https://developer.bentley.com/apis/projects/tutorials/).\r\n\r\n## Sample usage\r\n\r\n### Call ReportsConfigWidget.initialize() **_before_** making use of the provider\r\n\r\n```ts\r\nimport { ReportsConfigProvider, ReportsConfigWidget } from '@itwin/reports-config-widget-react'\r\n\r\n...\r\n\r\nawait ReportsConfigWidget.initialize(IModelApp.localization);\r\n\r\n<Viewer\r\n ...\r\n uiProviders={[new ReportsConfigProvider()]}\r\n/>\r\n```\r\n"
131
- }
136
+ }
137
+ }
@@ -1,10 +1,14 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  import type { Localization } from "@itwin/core-common";
6
6
  import { IModelApp } from "@itwin/core-frontend";
7
7
 
8
+ /**
9
+ * ReportsConfigWidget localization
10
+ * @public
11
+ */
8
12
  export class ReportsConfigWidget {
9
13
  private static _localizationNamespace: string;
10
14
  private static _localization: Localization;
@@ -21,16 +25,12 @@ export class ReportsConfigWidget {
21
25
  ReportsConfigWidget._localization = localization ?? IModelApp.localization;
22
26
  // Setup localization
23
27
  const ReportsConfigWidgetNamespace = "ReportsConfigWidget";
24
- await ReportsConfigWidget._localization.registerNamespace(
25
- ReportsConfigWidgetNamespace
26
- );
28
+ await ReportsConfigWidget._localization.registerNamespace(ReportsConfigWidgetNamespace);
27
29
 
28
30
  ReportsConfigWidget._localizationNamespace = ReportsConfigWidgetNamespace;
29
31
  }
30
32
 
31
33
  public static terminate() {
32
- ReportsConfigWidget._localization.unregisterNamespace(
33
- ReportsConfigWidget.localizationNamespace
34
- );
34
+ ReportsConfigWidget._localization.unregisterNamespace(ReportsConfigWidget.localizationNamespace);
35
35
  }
36
36
  }
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  /** UI Provider for iTwin Viewer Applications */
6
6
  export * from "./widget/ReportsConfigUiProvider";
7
7
  export * from "./ReportsConfigWidget";
@@ -1,84 +1,19 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  import React from "react";
6
6
  import faker from "@faker-js/faker";
7
7
  import "@testing-library/jest-dom";
8
8
  import { ReportsConfigWidget } from "../ReportsConfigWidget";
9
- import {
10
- render,
11
- screen,
12
- waitFor,
13
- within,
14
- } from "./test-utils";
9
+ import { mockIModelId1, mockIModelId2, mockIModelsResponse, mockITwinId, mockReportId, render, screen, waitFor, within } from "./test-utils";
15
10
  import * as moq from "typemoq";
16
- import type {
17
- MappingsClient,
18
- MappingSingle,
19
- ReportMappingCollection,
20
- ReportsClient,
21
- } from "@itwin/insights-client";
11
+ import type { MappingContainer, MappingsClient, ReportMappingCollection, ReportsClient } from "@itwin/insights-client";
22
12
  import type { ReportMappingAndMapping } from "../widget/components/ReportMappings";
23
- import type { GetSingleIModelParams, IModelOperations, IModelsClient, OperationOptions } from "@itwin/imodels-client-management";
24
- import { IModelState } from "@itwin/imodels-client-management";
13
+ import type { GetSingleIModelParams, IModelsClient } from "@itwin/imodels-client-management";
25
14
  import { AddMappingsModal } from "../widget/components/AddMappingsModal";
26
15
  import { EmptyLocalization } from "@itwin/core-common";
27
-
28
- const mockITwinId = faker.datatype.uuid();
29
- const mockIModelId1 = faker.datatype.uuid();
30
- const mockIModelId2 = faker.datatype.uuid();
31
-
32
- const mockReportId = faker.datatype.uuid();
33
-
34
- const mockIModelsResponse = [
35
- {
36
- iModel: {
37
- id: mockIModelId1,
38
- displayName: "rAnDoMdIsPlAynAmE1",
39
- name: "rAnDomName1",
40
- description: "rAnDoMDeScRiPtIoN1",
41
- createdDateTime: "2021-10-04T22:13:50.397Z",
42
- state: IModelState.Initialized,
43
- projectId: mockITwinId,
44
- extent: null,
45
- _links: {
46
- creator: {
47
- href: "",
48
- },
49
- namedVersions: {
50
- href: "",
51
- },
52
- changesets: {
53
- href: "",
54
- },
55
- },
56
- },
57
- },
58
- {
59
- iModel: {
60
- id: mockIModelId2,
61
- displayName: "rAnDoMdIsPlAynAmE2",
62
- name: "rAnDomName2",
63
- description: "rAnDoMDeScRiPtIoN2",
64
- createdDateTime: "2021-10-04T22:13:50.397Z",
65
- state: IModelState.Initialized,
66
- projectId: mockITwinId,
67
- extent: null,
68
- _links: {
69
- creator: {
70
- href: "",
71
- },
72
- namedVersions: {
73
- href: "",
74
- },
75
- changesets: {
76
- href: "",
77
- },
78
- },
79
- },
80
- },
81
- ];
16
+ import type { IModelOperations, OperationOptions } from "@itwin/imodels-client-management/lib/operations";
82
17
 
83
18
  const mockProjectIModels = {
84
19
  iModels: mockIModelsResponse.map((iModel) => ({
@@ -139,29 +74,25 @@ const mockReportMappingsFactory = (): ReportMappingCollection => {
139
74
  };
140
75
  };
141
76
 
142
- const mockMappingsFactory = (
143
- mockReportMappings: ReportMappingCollection
144
- ): MappingSingle[] => {
145
- const mockMappings: MappingSingle[] = mockReportMappings.mappings.map(
146
- (mapping, index) => ({
147
- mapping: {
148
- id: mapping.mappingId,
149
- mappingName: `mOcKMaPpIngNaMe${index}`,
150
- description: `mOcKmApPInGDeScRiPtIoN${index}`,
151
- extractionEnabled: false,
152
- createdOn: "",
153
- createdBy: "",
154
- modifiedOn: "",
155
- modifiedBy: "",
156
- _links: {
157
- imodel: {
158
- // Tie the mapping to to the iModel Id
159
- href: mapping.imodelId,
160
- },
77
+ const mockMappingsFactory = (mockReportMappings: ReportMappingCollection): MappingContainer[] => {
78
+ const mockMappings: MappingContainer[] = mockReportMappings.mappings.map((mapping, index) => ({
79
+ mapping: {
80
+ id: mapping.mappingId,
81
+ mappingName: `mOcKMaPpIngNaMe${index}`,
82
+ description: `mOcKmApPInGDeScRiPtIoN${index}`,
83
+ extractionEnabled: false,
84
+ createdOn: "",
85
+ createdBy: "",
86
+ modifiedOn: "",
87
+ modifiedBy: "",
88
+ _links: {
89
+ iModel: {
90
+ // Tie the mapping to to the iModel Id
91
+ href: mapping.imodelId,
161
92
  },
162
93
  },
163
- })
164
- );
94
+ },
95
+ }));
165
96
 
166
97
  const extraMappingId = faker.datatype.uuid();
167
98
  const extraMappingName = "mOcKNaMeExTrA";
@@ -178,7 +109,7 @@ const mockMappingsFactory = (
178
109
  modifiedOn: "",
179
110
  modifiedBy: "",
180
111
  _links: {
181
- imodel: {
112
+ iModel: {
182
113
  href: "",
183
114
  },
184
115
  },
@@ -188,19 +119,18 @@ const mockMappingsFactory = (
188
119
  return mockMappings;
189
120
  };
190
121
 
191
- const mockReportMappingsAndMappingsFactory = (mockMappings: MappingSingle[], reportMappings: ReportMappingCollection): ReportMappingAndMapping[] => {
192
- const reportMappingsAndMapping =
193
- reportMappings.mappings.map((reportMapping) => {
194
- const mapping = mockMappings.find((x) => x.mapping.id === reportMapping.mappingId)!.mapping;
195
- const iModelName = mockProjectIModels.iModels.find((x) => x.id === reportMapping.imodelId)!.displayName;
196
- const reportMappingAndMapping: ReportMappingAndMapping = {
197
- ...reportMapping,
198
- iModelName,
199
- mappingName: mapping.mappingName,
200
- mappingDescription: mapping.description ?? "",
201
- };
202
- return reportMappingAndMapping;
203
- });
122
+ const mockReportMappingsAndMappingsFactory = (mockMappings: MappingContainer[], reportMappings: ReportMappingCollection): ReportMappingAndMapping[] => {
123
+ const reportMappingsAndMapping = reportMappings.mappings.map((reportMapping) => {
124
+ const mapping = mockMappings.find((x) => x.mapping.id === reportMapping.mappingId)!.mapping;
125
+ const iModelName = mockProjectIModels.iModels.find((x) => x.id === reportMapping.imodelId)!.displayName;
126
+ const reportMappingAndMapping: ReportMappingAndMapping = {
127
+ ...reportMapping,
128
+ iModelName,
129
+ mappingName: mapping.mappingName,
130
+ mappingDescription: mapping.description ?? "",
131
+ };
132
+ return reportMappingAndMapping;
133
+ });
204
134
  return reportMappingsAndMapping;
205
135
  };
206
136
 
@@ -222,12 +152,13 @@ const mockMappingsClient = moq.Mock.ofType<MappingsClient>();
222
152
  beforeAll(async () => {
223
153
  const localization = new EmptyLocalization();
224
154
  await ReportsConfigWidget.initialize(localization);
225
- mockIModelsClientOperations.setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId1 })))
155
+ mockIModelsClientOperations
156
+ .setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId1 })))
226
157
  .returns(async () => mockIModelsResponse[0].iModel);
227
- mockIModelsClientOperations.setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId2 })))
158
+ mockIModelsClientOperations
159
+ .setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId2 })))
228
160
  .returns(async () => mockIModelsResponse[1].iModel);
229
- mockIModelsClient.setup((x) => x.iModels)
230
- .returns(() => mockIModelsClientOperations.object);
161
+ mockIModelsClient.setup((x) => x.iModels).returns(() => mockIModelsClientOperations.object);
231
162
  mockReportsClient.setup(async (x) => x.createReportMapping(moq.It.isAny(), moq.It.isAny(), moq.It.isAny())).returns(mockCreateReportMapping);
232
163
  mockMappingsClient.setup(async (x) => x.getMappings(moq.It.isAny(), moq.It.isAny())).returns(mockGetMappings);
233
164
  });
@@ -243,7 +174,7 @@ describe("Add Mapping Modal", () => {
243
174
  const mockMappings = mockMappingsFactory(mockReportMappings);
244
175
  const mockReportMappingsAndMappings = mockReportMappingsAndMappingsFactory(mockMappings, mockReportMappings);
245
176
 
246
- mockGetMappings.mockReturnValueOnce(mockMappings.map((m: MappingSingle) => m.mapping));
177
+ mockGetMappings.mockReturnValueOnce({ mappings: mockMappings.map((m: MappingContainer) => m.mapping) });
247
178
 
248
179
  const { user } = render(
249
180
  <AddMappingsModal
@@ -252,7 +183,8 @@ describe("Add Mapping Modal", () => {
252
183
  existingMappings={mockReportMappingsAndMappings}
253
184
  onClose={jest.fn()}
254
185
  defaultIModelId={mockIModelId1}
255
- />, { iTwinId: mockITwinId, reportsClient: mockReportsClient.object, mappingsClient: mockMappingsClient.object, iModelsClient: mockIModelsClient.object }
186
+ />,
187
+ { iTwinId: mockITwinId, reportsClient: mockReportsClient.object, mappingsClient: mockMappingsClient.object, iModelsClient: mockIModelsClient.object },
256
188
  );
257
189
 
258
190
  expect(screen.getByRole("dialog")).toBeInTheDocument();
@@ -269,10 +201,7 @@ describe("Add Mapping Modal", () => {
269
201
  // Already mapped mappings are disabled
270
202
  for (let i = 0; i < mockMappings.length - 1; i++) {
271
203
  const row = screen.getByRole("row", {
272
- name: new RegExp(
273
- `${mockMappings[i].mapping.mappingName} ${mockMappings[i].mapping.description}`,
274
- "i"
275
- ),
204
+ name: new RegExp(`${mockMappings[i].mapping.mappingName} ${mockMappings[i].mapping.description}`, "i"),
276
205
  });
277
206
 
278
207
  const checkbox = within(row).getByRole("checkbox");
@@ -281,11 +210,7 @@ describe("Add Mapping Modal", () => {
281
210
 
282
211
  // Click on checkbox on new mapping
283
212
  const unmappedRow = screen.getByRole("row", {
284
- name: new RegExp(
285
- `${mockMappings[mockMappings.length - 1].mapping.mappingName
286
- } ${mockMappings[mockMappings.length - 1].mapping.description}`,
287
- "i"
288
- ),
213
+ name: new RegExp(`${mockMappings[mockMappings.length - 1].mapping.mappingName} ${mockMappings[mockMappings.length - 1].mapping.description}`, "i"),
289
214
  });
290
215
 
291
216
  const enabledCheckbox = within(unmappedRow).getByRole("checkbox");