@itwin/reports-config-widget-react 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/.rush/temp/operation/rebuild/all.log +2 -2
  2. package/.rush/temp/operation/rebuild/state.json +1 -1
  3. package/.rush/temp/package-deps_rebuild.json +30 -30
  4. package/.rush/temp/shrinkwrap-deps.json +142 -175
  5. package/CHANGELOG.json +26 -0
  6. package/CHANGELOG.md +15 -1
  7. package/coverage/clover.xml +858 -0
  8. package/coverage/coverage-final.json +33 -0
  9. package/coverage/lcov-report/base.css +224 -0
  10. package/coverage/lcov-report/block-navigation.js +87 -0
  11. package/coverage/lcov-report/favicon.png +0 -0
  12. package/coverage/lcov-report/index.html +206 -0
  13. package/coverage/lcov-report/prettify.css +1 -0
  14. package/coverage/lcov-report/prettify.js +2 -0
  15. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  16. package/coverage/lcov-report/sorter.js +196 -0
  17. package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +193 -0
  18. package/coverage/lcov-report/src/index.html +116 -0
  19. package/coverage/lcov-report/src/test/index.html +116 -0
  20. package/coverage/lcov-report/src/test/test-utils.tsx.html +196 -0
  21. package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +265 -0
  22. package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +247 -0
  23. package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +589 -0
  24. package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +664 -0
  25. package/coverage/lcov-report/src/widget/components/Constants.ts.html +106 -0
  26. package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +367 -0
  27. package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +187 -0
  28. package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +145 -0
  29. package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +139 -0
  30. package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +151 -0
  31. package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +190 -0
  32. package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +176 -0
  33. package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +295 -0
  34. package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +208 -0
  35. package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +289 -0
  36. package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +262 -0
  37. package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +472 -0
  38. package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +472 -0
  39. package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +469 -0
  40. package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +1063 -0
  41. package/coverage/lcov-report/src/widget/components/Reports.tsx.html +754 -0
  42. package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +370 -0
  43. package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +301 -0
  44. package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +166 -0
  45. package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +274 -0
  46. package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +286 -0
  47. package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +337 -0
  48. package/coverage/lcov-report/src/widget/components/index.html +416 -0
  49. package/coverage/lcov-report/src/widget/components/utils.tsx.html +565 -0
  50. package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +163 -0
  51. package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +202 -0
  52. package/coverage/lcov-report/src/widget/context/index.html +131 -0
  53. package/coverage/lcov-report/src/widget/hooks/index.html +116 -0
  54. package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +295 -0
  55. package/coverage/lcov-report/src/widget/index.html +116 -0
  56. package/coverage/lcov.info +1596 -0
  57. package/jest.config.js +1 -0
  58. package/lib/cjs/ReportsConfigWidget.js +1 -1
  59. package/lib/cjs/ReportsConfigWidget.js.map +1 -1
  60. package/lib/cjs/test/AddMappingModal.test.js +6 -7
  61. package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
  62. package/lib/cjs/test/DeleteModal.test.js +2 -2
  63. package/lib/cjs/test/DeleteModal.test.js.map +1 -1
  64. package/lib/cjs/test/ReportAction.test.js +7 -7
  65. package/lib/cjs/test/ReportAction.test.js.map +1 -1
  66. package/lib/cjs/test/ReportMappingHorizontalTile.test.js +18 -19
  67. package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
  68. package/lib/cjs/test/ReportMappings.test.js +19 -21
  69. package/lib/cjs/test/ReportMappings.test.js.map +1 -1
  70. package/lib/cjs/test/Reports.test.js +27 -29
  71. package/lib/cjs/test/Reports.test.js.map +1 -1
  72. package/lib/cjs/test/WidgetHeader.test.js +9 -3
  73. package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
  74. package/lib/cjs/test/test-utils.js +2 -5
  75. package/lib/cjs/test/test-utils.js.map +1 -1
  76. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  77. package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +3 -3
  78. package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
  79. package/lib/cjs/widget/ReportsConfigUiProvider.js +5 -7
  80. package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
  81. package/lib/cjs/widget/components/ActionPanel.d.ts +2 -2
  82. package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
  83. package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
  84. package/lib/cjs/widget/components/ActionPanel.scss +2 -3
  85. package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
  86. package/lib/cjs/widget/components/AddMappingsModal.js +22 -27
  87. package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
  88. package/lib/cjs/widget/components/AddMappingsModal.scss +1 -2
  89. package/lib/cjs/widget/components/BulkExtractor.js +2 -2
  90. package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
  91. package/lib/cjs/widget/components/DeleteModal.js +3 -3
  92. package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
  93. package/lib/cjs/widget/components/DeleteModal.scss +2 -3
  94. package/lib/cjs/widget/components/ExtractionStatus.js +2 -2
  95. package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
  96. package/lib/cjs/widget/components/ExtractionStatus.scss +6 -7
  97. package/lib/cjs/widget/components/HorizontalTile.js +2 -2
  98. package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
  99. package/lib/cjs/widget/components/HorizontalTile.scss +10 -16
  100. package/lib/cjs/widget/components/LocalizedTablePaginator.js +2 -2
  101. package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
  102. package/lib/cjs/widget/components/ReportAction.js +14 -16
  103. package/lib/cjs/widget/components/ReportAction.js.map +1 -1
  104. package/lib/cjs/widget/components/ReportAction.scss +1 -2
  105. package/lib/cjs/widget/components/ReportHorizontalTile.js +9 -11
  106. package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
  107. package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
  108. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +17 -17
  109. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
  110. package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
  111. package/lib/cjs/widget/components/ReportMappings.js +23 -26
  112. package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
  113. package/lib/cjs/widget/components/ReportMappings.scss +9 -10
  114. package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
  115. package/lib/cjs/widget/components/Reports.js +21 -21
  116. package/lib/cjs/widget/components/Reports.js.map +1 -1
  117. package/lib/cjs/widget/components/Reports.scss +15 -15
  118. package/lib/cjs/widget/components/ReportsConfigContext.js +23 -31
  119. package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
  120. package/lib/cjs/widget/components/ReportsContainer.js +4 -5
  121. package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
  122. package/lib/cjs/widget/components/ReportsContainer.scss +1 -3
  123. package/lib/cjs/widget/components/ReportsRouter.js +1 -2
  124. package/lib/cjs/widget/components/ReportsRouter.js.map +1 -1
  125. package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
  126. package/lib/cjs/widget/components/SearchBar.js +4 -4
  127. package/lib/cjs/widget/components/SearchBar.js.map +1 -1
  128. package/lib/cjs/widget/components/SearchBar.scss +0 -1
  129. package/lib/cjs/widget/components/SelectIModel.js +5 -5
  130. package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
  131. package/lib/cjs/widget/components/SelectIModel.scss +2 -3
  132. package/lib/cjs/widget/components/utils.d.ts.map +1 -1
  133. package/lib/cjs/widget/components/utils.js +1 -1
  134. package/lib/cjs/widget/components/utils.js.map +1 -1
  135. package/lib/cjs/widget/components/utils.scss +16 -8
  136. package/lib/cjs/widget/context/BulkExtractorContext.js +1 -1
  137. package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
  138. package/lib/cjs/widget/context/ReportsConfigApiContext.js +1 -1
  139. package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
  140. package/lib/cjs/widget/hooks/useValidator.js +1 -1
  141. package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
  142. package/lib/esm/ReportsConfigWidget.js +1 -1
  143. package/lib/esm/ReportsConfigWidget.js.map +1 -1
  144. package/lib/esm/test/AddMappingModal.test.js +1 -2
  145. package/lib/esm/test/AddMappingModal.test.js.map +1 -1
  146. package/lib/esm/test/ReportMappingHorizontalTile.test.js +1 -2
  147. package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
  148. package/lib/esm/test/ReportMappings.test.js +6 -8
  149. package/lib/esm/test/ReportMappings.test.js.map +1 -1
  150. package/lib/esm/test/Reports.test.js +4 -6
  151. package/lib/esm/test/Reports.test.js.map +1 -1
  152. package/lib/esm/test/WidgetHeader.test.js +8 -2
  153. package/lib/esm/test/WidgetHeader.test.js.map +1 -1
  154. package/lib/esm/test/test-utils.js +1 -4
  155. package/lib/esm/test/test-utils.js.map +1 -1
  156. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  157. package/lib/esm/widget/ReportsConfigUiProvider.d.ts +3 -3
  158. package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
  159. package/lib/esm/widget/ReportsConfigUiProvider.js +2 -4
  160. package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
  161. package/lib/esm/widget/components/ActionPanel.d.ts +2 -2
  162. package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
  163. package/lib/esm/widget/components/ActionPanel.js.map +1 -1
  164. package/lib/esm/widget/components/ActionPanel.scss +2 -3
  165. package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
  166. package/lib/esm/widget/components/AddMappingsModal.js +10 -15
  167. package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
  168. package/lib/esm/widget/components/AddMappingsModal.scss +1 -2
  169. package/lib/esm/widget/components/DeleteModal.js +2 -2
  170. package/lib/esm/widget/components/DeleteModal.js.map +1 -1
  171. package/lib/esm/widget/components/DeleteModal.scss +2 -3
  172. package/lib/esm/widget/components/ExtractionStatus.scss +6 -7
  173. package/lib/esm/widget/components/HorizontalTile.scss +10 -16
  174. package/lib/esm/widget/components/ReportAction.js +7 -9
  175. package/lib/esm/widget/components/ReportAction.js.map +1 -1
  176. package/lib/esm/widget/components/ReportAction.scss +1 -2
  177. package/lib/esm/widget/components/ReportHorizontalTile.js +4 -6
  178. package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
  179. package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
  180. package/lib/esm/widget/components/ReportMappingHorizontalTile.js +11 -11
  181. package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
  182. package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
  183. package/lib/esm/widget/components/ReportMappings.js +7 -10
  184. package/lib/esm/widget/components/ReportMappings.js.map +1 -1
  185. package/lib/esm/widget/components/ReportMappings.scss +9 -10
  186. package/lib/esm/widget/components/Reports.d.ts.map +1 -1
  187. package/lib/esm/widget/components/Reports.js +9 -9
  188. package/lib/esm/widget/components/Reports.js.map +1 -1
  189. package/lib/esm/widget/components/Reports.scss +15 -15
  190. package/lib/esm/widget/components/ReportsConfigContext.js +19 -27
  191. package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
  192. package/lib/esm/widget/components/ReportsContainer.js +1 -2
  193. package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
  194. package/lib/esm/widget/components/ReportsContainer.scss +1 -3
  195. package/lib/esm/widget/components/ReportsRouter.js +1 -2
  196. package/lib/esm/widget/components/ReportsRouter.js.map +1 -1
  197. package/lib/esm/widget/components/SearchBar.d.ts.map +1 -1
  198. package/lib/esm/widget/components/SearchBar.js +2 -2
  199. package/lib/esm/widget/components/SearchBar.js.map +1 -1
  200. package/lib/esm/widget/components/SearchBar.scss +0 -1
  201. package/lib/esm/widget/components/SelectIModel.scss +2 -3
  202. package/lib/esm/widget/components/utils.d.ts.map +1 -1
  203. package/lib/esm/widget/components/utils.js +2 -2
  204. package/lib/esm/widget/components/utils.js.map +1 -1
  205. package/lib/esm/widget/components/utils.scss +16 -8
  206. package/lib/public/locales/en/ReportsConfigWidget.json +4 -0
  207. package/package.json +30 -30
  208. package/public/locales/en/ReportsConfigWidget.json +4 -0
  209. package/reports-config-widget-react.build.error.log +14 -1
  210. package/reports-config-widget-react.build.log +63 -2
  211. package/src/test/WidgetHeader.test.tsx +9 -2
  212. package/src/widget/ReportsConfigUiProvider.tsx +7 -14
  213. package/src/widget/components/ActionPanel.scss +2 -3
  214. package/src/widget/components/ActionPanel.tsx +1 -1
  215. package/src/widget/components/AddMappingsModal.scss +1 -2
  216. package/src/widget/components/AddMappingsModal.tsx +16 -21
  217. package/src/widget/components/DeleteModal.scss +2 -3
  218. package/src/widget/components/DeleteModal.tsx +3 -3
  219. package/src/widget/components/ExtractionStatus.scss +6 -7
  220. package/src/widget/components/HorizontalTile.scss +10 -16
  221. package/src/widget/components/ReportAction.scss +1 -2
  222. package/src/widget/components/ReportAction.tsx +3 -3
  223. package/src/widget/components/ReportHorizontalTile.tsx +1 -1
  224. package/src/widget/components/ReportMappingHorizontalTile.tsx +28 -27
  225. package/src/widget/components/ReportMappings.scss +9 -10
  226. package/src/widget/components/ReportMappings.tsx +2 -4
  227. package/src/widget/components/Reports.scss +15 -15
  228. package/src/widget/components/Reports.tsx +25 -22
  229. package/src/widget/components/ReportsContainer.scss +1 -3
  230. package/src/widget/components/SearchBar.scss +0 -1
  231. package/src/widget/components/SearchBar.tsx +6 -1
  232. package/src/widget/components/SelectIModel.scss +2 -3
  233. package/src/widget/components/utils.scss +16 -8
  234. package/src/widget/components/utils.tsx +7 -6
@@ -11,12 +11,11 @@ export var RouteStep;
11
11
  RouteStep[RouteStep["ReportMappings"] = 2] = "ReportMappings";
12
12
  })(RouteStep || (RouteStep = {}));
13
13
  const ReportsContainer = ({ getAccessToken, baseUrl, }) => {
14
- var _a, _b;
15
14
  const [routingHistory, setRoutingHistory] = useState([
16
15
  { step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} },
17
16
  ]);
18
17
  const currentRoute = routingHistory[routingHistory.length - 1];
19
- const iTwinId = (_b = (_a = useActiveIModelConnection()) === null || _a === void 0 ? void 0 : _a.iTwinId) !== null && _b !== void 0 ? _b : "";
18
+ const iTwinId = useActiveIModelConnection()?.iTwinId ?? "";
20
19
  const navigateTo = useCallback((toRoute) => {
21
20
  setRoutingHistory((r) => [...r, toRoute(r[r.length - 1])]);
22
21
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"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AW,CAAC,GAAG,EAAE;QAC9B,MAAM,cAAc,GAAG,CAAC,GAAG,cAAc,CAAC,CAAC;QAC3C,cAAc,CAAC,GAAG,EAAE,CAAC;QACrB,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,oBAAC,oBAAoB,IAAC,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;QACtF,6BAAK,SAAS,EAAC,uBAAuB;YACpC,oBAAC,aAAa,IACZ,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,GAC1B;YACF,oBAAC,aAAa,IACZ,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACd,CACE,CACe,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport React, { useCallback, useState } from \"react\";\nimport \"./ReportsContainer.scss\";\nimport type { Report } from \"@itwin/insights-client\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { ReportsHeader } from \"./ReportsHeader\";\nimport { ReportsRouter } from \"./ReportsRouter\";\nimport { ReportsConfigContext } from \"./ReportsConfigContext\";\n\ninterface ReportsContainerProps {\n getAccessToken?: () => Promise<AccessToken>;\n baseUrl: string;\n}\n\nexport enum RouteStep {\n ReportsList,\n ReportAction,\n ReportMappings\n}\n\nexport interface ReportsRouteFields {\n report?: Report;\n}\n\nexport interface Route {\n step: RouteStep;\n title: string;\n reportsRoutingFields: ReportsRouteFields;\n}\n\nconst ReportsContainer = ({\n getAccessToken,\n baseUrl,\n}: ReportsContainerProps) => {\n\n const [routingHistory, setRoutingHistory] = useState<Route[]>([\n { step: RouteStep.ReportsList, title: \"iTwin Reports\", reportsRoutingFields: {} },\n ]);\n const currentRoute = routingHistory[routingHistory.length - 1];\n const iTwinId = useActiveIModelConnection()?.iTwinId ?? \"\";\n const navigateTo = useCallback((toRoute: (prev: Route | undefined) => Route) => {\n setRoutingHistory((r) => [...r, toRoute(r[r.length - 1])]);\n }, []);\n\n const goBack = useCallback(() => {\n const updatedRouting = [...routingHistory];\n updatedRouting.pop();\n setRoutingHistory(updatedRouting);\n }, [routingHistory]);\n\n return (\n <ReportsConfigContext getAccessToken={getAccessToken} baseUrl={baseUrl} iTwinId={iTwinId}>\n <div className=\"rcw-reports-container\">\n <ReportsHeader\n goBack={goBack}\n currentRoute={currentRoute}\n />\n <ReportsRouter\n currentRoute={currentRoute}\n navigateTo={navigateTo}\n goBack={goBack}\n />\n </div>\n </ReportsConfigContext>\n );\n};\n\nexport default ReportsContainer;\n"]}
1
+ {"version":3,"file":"ReportsContainer.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsContainer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAO9D,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,uDAAW,CAAA;IACX,yDAAY,CAAA;IACZ,6DAAc,CAAA;AAChB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAYD,MAAM,gBAAgB,GAAG,CAAC,EACxB,cAAc,EACd,OAAO,GACe,EAAE,EAAE;IAE1B,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAU;QAC5D,EAAE,IAAI,EAAE,SAAS,CAAC,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,EAAE,EAAE;KAClF,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,yBAAyB,EAAE,EAAE,OAAO,IAAI,EAAE,CAAC;IAC3D,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,OAA2C,EAAE,EAAE;QAC7E,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,MAAM,cAAc,GAAG,CAAC,GAAG,cAAc,CAAC,CAAC;QAC3C,cAAc,CAAC,GAAG,EAAE,CAAC;QACrB,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,oBAAC,oBAAoB,IAAC,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;QACtF,6BAAK,SAAS,EAAC,uBAAuB;YACpC,oBAAC,aAAa,IACZ,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,GAC1B;YACF,oBAAC,aAAa,IACZ,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACd,CACE,CACe,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport React, { useCallback, useState } from \"react\";\nimport \"./ReportsContainer.scss\";\nimport type { Report } from \"@itwin/insights-client\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { ReportsHeader } from \"./ReportsHeader\";\nimport { ReportsRouter } from \"./ReportsRouter\";\nimport { ReportsConfigContext } from \"./ReportsConfigContext\";\n\ninterface ReportsContainerProps {\n getAccessToken?: () => Promise<AccessToken>;\n baseUrl: string;\n}\n\nexport enum RouteStep {\n ReportsList,\n ReportAction,\n ReportMappings\n}\n\nexport interface ReportsRouteFields {\n report?: Report;\n}\n\nexport interface Route {\n step: RouteStep;\n title: string;\n reportsRoutingFields: ReportsRouteFields;\n}\n\nconst ReportsContainer = ({\n getAccessToken,\n baseUrl,\n}: ReportsContainerProps) => {\n\n const [routingHistory, setRoutingHistory] = useState<Route[]>([\n { step: RouteStep.ReportsList, title: \"iTwin Reports\", reportsRoutingFields: {} },\n ]);\n const currentRoute = routingHistory[routingHistory.length - 1];\n const iTwinId = useActiveIModelConnection()?.iTwinId ?? \"\";\n const navigateTo = useCallback((toRoute: (prev: Route | undefined) => Route) => {\n setRoutingHistory((r) => [...r, toRoute(r[r.length - 1])]);\n }, []);\n\n const goBack = useCallback(() => {\n const updatedRouting = [...routingHistory];\n updatedRouting.pop();\n setRoutingHistory(updatedRouting);\n }, [routingHistory]);\n\n return (\n <ReportsConfigContext getAccessToken={getAccessToken} baseUrl={baseUrl} iTwinId={iTwinId}>\n <div className=\"rcw-reports-container\">\n <ReportsHeader\n goBack={goBack}\n currentRoute={currentRoute}\n />\n <ReportsRouter\n currentRoute={currentRoute}\n navigateTo={navigateTo}\n goBack={goBack}\n />\n </div>\n </ReportsConfigContext>\n );\n};\n\nexport default ReportsContainer;\n"]}
@@ -2,7 +2,6 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/itwinui-css/scss/variables";
6
5
 
7
6
  .rcw-reports-container {
8
7
  position: absolute;
@@ -10,9 +9,8 @@
10
9
  left: 0;
11
10
  display: flex;
12
11
  flex-direction: column;
13
- padding: $iui-baseline $iui-m;
12
+ padding: var(--iui-size-s) var(--iui-size-m);
14
13
  box-sizing: border-box;
15
14
  height: 100%;
16
15
  overflow: auto;
17
- gap: $iui-baseline;
18
16
  }
@@ -10,9 +10,8 @@ import { ReportMappings } from "./ReportMappings";
10
10
  import { Reports } from "./Reports";
11
11
  import { RouteStep } from "./ReportsContainer";
12
12
  export const ReportsRouter = ({ currentRoute, navigateTo, goBack, }) => {
13
- var _a, _b;
14
13
  const { report } = currentRoute.reportsRoutingFields;
15
- const iModelId = (_b = (_a = useActiveIModelConnection()) === null || _a === void 0 ? void 0 : _a.iModelId) !== null && _b !== void 0 ? _b : "";
14
+ const iModelId = useActiveIModelConnection()?.iModelId ?? "";
16
15
  switch (currentRoute.step) {
17
16
  case RouteStep.ReportsList:
18
17
  return (React.createElement(Reports, { onClickAddReport: () => navigateTo(() => ({
@@ -1 +1 @@
1
- {"version":3,"file":"ReportsRouter.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsRouter.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,CAAC,MAAM,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AC,cAAc;YAC3B,IAAI,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAC;YACzB,OAAO,oBAAC,cAAc,IAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,GAAI,CAAC;QAC7F;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\nimport { ReportAction } from \"./ReportAction\";\nimport { ReportMappings } from \"./ReportMappings\";\nimport { Reports } from \"./Reports\";\nimport type { Route } from \"./ReportsContainer\";\nimport { RouteStep } from \"./ReportsContainer\";\n\nexport const ReportsRouter = ({\n currentRoute,\n navigateTo,\n goBack,\n}: {\n currentRoute: Route;\n navigateTo: (toRoute: (prev: Route | undefined) => Route) => void;\n goBack: () => void;\n}) => {\n const { report } = currentRoute.reportsRoutingFields;\n const iModelId = useActiveIModelConnection()?.iModelId ?? \"\";\n switch (currentRoute.step) {\n case RouteStep.ReportsList:\n return (\n <Reports\n onClickAddReport={() =>\n navigateTo(() => ({\n step: RouteStep.ReportAction,\n title: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ITwinReports\"\n ),\n reportsRoutingFields: {},\n }))\n }\n onClickReportTitle={(r) => {\n navigateTo(() => ({\n step: RouteStep.ReportMappings,\n reportsRoutingFields: { report: r },\n title: r.displayName,\n }));\n }}\n onClickReportModify={(r) => {\n navigateTo(() => ({\n step: RouteStep.ReportAction,\n reportsRoutingFields: { report: r },\n title: r.displayName,\n }));\n }}\n />\n );\n\n case RouteStep.ReportAction:\n return <ReportAction report={report} onClickCancel={goBack} onSaveSuccess={goBack} />;\n case RouteStep.ReportMappings:\n if (!report) return null;\n return <ReportMappings report={report} onClickClose={goBack} defaultIModelId={iModelId} />;\n default:\n return null;\n }\n};\n"]}
1
+ {"version":3,"file":"ReportsRouter.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsRouter.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,YAAY,EACZ,UAAU,EACV,MAAM,GAKP,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,oBAAoB,CAAC;IACrD,MAAM,QAAQ,GAAG,yBAAyB,EAAE,EAAE,QAAQ,IAAI,EAAE,CAAC;IAC7D,QAAQ,YAAY,CAAC,IAAI,EAAE;QACzB,KAAK,SAAS,CAAC,WAAW;YACxB,OAAO,CACL,oBAAC,OAAO,IACN,gBAAgB,EAAE,GAAG,EAAE,CACrB,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;oBAChB,IAAI,EAAE,SAAS,CAAC,YAAY;oBAC5B,KAAK,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CACxD,kCAAkC,CACnC;oBACD,oBAAoB,EAAE,EAAE;iBACzB,CAAC,CAAC,EAEL,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE;oBACxB,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;wBAChB,IAAI,EAAE,SAAS,CAAC,cAAc;wBAC9B,oBAAoB,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;wBACnC,KAAK,EAAE,CAAC,CAAC,WAAW;qBACrB,CAAC,CAAC,CAAC;gBACN,CAAC,EACD,mBAAmB,EAAE,CAAC,CAAC,EAAE,EAAE;oBACzB,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;wBAChB,IAAI,EAAE,SAAS,CAAC,YAAY;wBAC5B,oBAAoB,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;wBACnC,KAAK,EAAE,CAAC,CAAC,WAAW;qBACrB,CAAC,CAAC,CAAC;gBACN,CAAC,GACD,CACH,CAAC;QAEJ,KAAK,SAAS,CAAC,YAAY;YACzB,OAAO,oBAAC,YAAY,IAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAI,CAAC;QACxF,KAAK,SAAS,CAAC,cAAc;YAC3B,IAAI,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAC;YACzB,OAAO,oBAAC,cAAc,IAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,GAAI,CAAC;QAC7F;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\nimport { ReportAction } from \"./ReportAction\";\nimport { ReportMappings } from \"./ReportMappings\";\nimport { Reports } from \"./Reports\";\nimport type { Route } from \"./ReportsContainer\";\nimport { RouteStep } from \"./ReportsContainer\";\n\nexport const ReportsRouter = ({\n currentRoute,\n navigateTo,\n goBack,\n}: {\n currentRoute: Route;\n navigateTo: (toRoute: (prev: Route | undefined) => Route) => void;\n goBack: () => void;\n}) => {\n const { report } = currentRoute.reportsRoutingFields;\n const iModelId = useActiveIModelConnection()?.iModelId ?? \"\";\n switch (currentRoute.step) {\n case RouteStep.ReportsList:\n return (\n <Reports\n onClickAddReport={() =>\n navigateTo(() => ({\n step: RouteStep.ReportAction,\n title: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ITwinReports\"\n ),\n reportsRoutingFields: {},\n }))\n }\n onClickReportTitle={(r) => {\n navigateTo(() => ({\n step: RouteStep.ReportMappings,\n reportsRoutingFields: { report: r },\n title: r.displayName,\n }));\n }}\n onClickReportModify={(r) => {\n navigateTo(() => ({\n step: RouteStep.ReportAction,\n reportsRoutingFields: { report: r },\n title: r.displayName,\n }));\n }}\n />\n );\n\n case RouteStep.ReportAction:\n return <ReportAction report={report} onClickCancel={goBack} onSaveSuccess={goBack} />;\n case RouteStep.ReportMappings:\n if (!report) return null;\n return <ReportMappings report={report} onClickClose={goBack} defaultIModelId={iModelId} />;\n default:\n return null;\n }\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/SearchBar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,kBAAkB,CAAC;AAE1B,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,+CAInB,cAAc,gBAyChB,CAAC"}
1
+ {"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/SearchBar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,kBAAkB,CAAC;AAE1B,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,+CAInB,cAAc,gBA8ChB,CAAC"}
@@ -19,8 +19,8 @@ export const SearchBar = ({ searchValue, setSearchValue, disabled, }) => {
19
19
  setSearchValue("");
20
20
  }
21
21
  } },
22
- React.createElement(LabeledInput, { "aria-label": "search-textbox", placeholder: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Search"), svgIcon: React.createElement(IconButton, { onClick: () => setSearchBarClosing(true), styleType: "borderless" },
23
- React.createElement(SvgCloseSmall, null)), iconDisplayStyle: "inline", value: searchValue, onChange: (e) => setSearchValue(e.target.value), disabled: disabled }))) : (React.createElement(IconButton, { styleType: "borderless", "data-testid": "rcw-search-button", onClick: () => setSearchBarOpened(true) },
22
+ React.createElement(LabeledInput, { "aria-label": "search-textbox", placeholder: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Search"), svgIcon: React.createElement(IconButton, { onClick: () => setSearchBarClosing(true), styleType: "borderless", title: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ClearSearch") },
23
+ React.createElement(SvgCloseSmall, null)), iconDisplayStyle: "inline", value: searchValue, onChange: (e) => setSearchValue(e.target.value), disabled: disabled }))) : (React.createElement(IconButton, { styleType: "borderless", "data-testid": "rcw-search-button", title: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:SearchReport"), onClick: () => setSearchBarOpened(true) },
24
24
  React.createElement(SvgSearch, null)));
25
25
  };
26
26
  //# sourceMappingURL=SearchBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../../src/widget/components/SearchBar.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACtE,OA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,CAAC,EAC/C,QAAQ,EAAE,QAAQ,GAClB,CACE,CACP,CAAC,CAAC,CAAC,CACF,oBAAC,UAAU,IAAC,SAAS,EAAC,YAAY,iBAAa,mBAAmB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;QACxG,oBAAC,SAAS,OAAG,CACF,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { SvgCloseSmall, SvgSearch } from \"@itwin/itwinui-icons-react\";\nimport { IconButton, LabeledInput } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\nimport \"./SearchBar.scss\";\n\ninterface SearchBarProps {\n searchValue: string;\n setSearchValue: React.Dispatch<React.SetStateAction<string>>;\n disabled?: boolean;\n}\n\nexport const SearchBar = ({\n searchValue,\n setSearchValue,\n disabled,\n}: SearchBarProps) => {\n const [searchBarOpen, setSearchBarOpened] = useState<boolean>(false);\n const [searchBarClosing, setSearchBarClosing] = useState<boolean>(false);\n\n return searchBarOpen || searchValue ? (\n <div className=\"rcw-search-button\"\n style={{\n animation: searchBarClosing ? \"rcw-shrink .5s\" : \"rcw-expand .5s\",\n }}\n onAnimationEnd={() => {\n if (searchBarClosing) {\n setSearchBarClosing(false);\n setSearchBarOpened(false);\n setSearchValue(\"\");\n }\n }}\n >\n <LabeledInput\n aria-label=\"search-textbox\"\n placeholder={ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Search\"\n )}\n svgIcon={\n <IconButton\n onClick={() => setSearchBarClosing(true)}\n styleType=\"borderless\"\n >\n <SvgCloseSmall />\n </IconButton>\n }\n iconDisplayStyle=\"inline\"\n value={searchValue}\n onChange={(e) => setSearchValue(e.target.value)}\n disabled={disabled}\n />\n </div>\n ) : (\n <IconButton styleType=\"borderless\" data-testid=\"rcw-search-button\" onClick={() => setSearchBarOpened(true)}>\n <SvgSearch />\n </IconButton>\n );\n};\n"]}
1
+ {"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../../src/widget/components/SearchBar.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,kBAAkB,CAAC;AAQ1B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,WAAW,EACX,cAAc,EACd,QAAQ,GACO,EAAE,EAAE;IACnB,MAAM,CAAC,aAAa,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IACrE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAEzE,OAAO,aAAa,IAAI,WAAW,CAAC,CAAC,CAAC,CACpC,6BAAK,SAAS,EAAC,mBAAmB,EAChC,KAAK,EAAE;YACL,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,gBAAgB;SAClE,EACD,cAAc,EAAE,GAAG,EAAE;YACnB,IAAI,gBAAgB,EAAE;gBACpB,mBAAmB,CAAC,KAAK,CAAC,CAAC;gBAC3B,kBAAkB,CAAC,KAAK,CAAC,CAAC;gBAC1B,cAAc,CAAC,EAAE,CAAC,CAAC;aACpB;QACH,CAAC;QAED,oBAAC,YAAY,kBACA,gBAAgB,EAC3B,WAAW,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAC9D,4BAA4B,CAC7B,EACD,OAAO,EACL,oBAAC,UAAU,IACT,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,EACxC,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,iCAAiC,CAAC;gBAE7F,oBAAC,aAAa,OAAG,CACN,EAEf,gBAAgB,EAAC,QAAQ,EACzB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC/C,QAAQ,EAAE,QAAQ,GAClB,CACE,CACP,CAAC,CAAC,CAAC,CACF,oBAAC,UAAU,IACT,SAAS,EAAC,YAAY,iBACV,mBAAmB,EAC/B,KAAK,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,EAC9F,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;QACvC,oBAAC,SAAS,OAAG,CACF,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { SvgCloseSmall, SvgSearch } from \"@itwin/itwinui-icons-react\";\nimport { IconButton, LabeledInput } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\nimport \"./SearchBar.scss\";\n\ninterface SearchBarProps {\n searchValue: string;\n setSearchValue: React.Dispatch<React.SetStateAction<string>>;\n disabled?: boolean;\n}\n\nexport const SearchBar = ({\n searchValue,\n setSearchValue,\n disabled,\n}: SearchBarProps) => {\n const [searchBarOpen, setSearchBarOpened] = useState<boolean>(false);\n const [searchBarClosing, setSearchBarClosing] = useState<boolean>(false);\n\n return searchBarOpen || searchValue ? (\n <div className=\"rcw-search-button\"\n style={{\n animation: searchBarClosing ? \"rcw-shrink .5s\" : \"rcw-expand .5s\",\n }}\n onAnimationEnd={() => {\n if (searchBarClosing) {\n setSearchBarClosing(false);\n setSearchBarOpened(false);\n setSearchValue(\"\");\n }\n }}\n >\n <LabeledInput\n aria-label=\"search-textbox\"\n placeholder={ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Search\"\n )}\n svgIcon={\n <IconButton\n onClick={() => setSearchBarClosing(true)}\n styleType=\"borderless\"\n title={ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ClearSearch\")}\n >\n <SvgCloseSmall />\n </IconButton>\n }\n iconDisplayStyle=\"inline\"\n value={searchValue}\n onChange={(e) => setSearchValue(e.target.value)}\n disabled={disabled}\n />\n </div>\n ) : (\n <IconButton\n styleType=\"borderless\"\n data-testid=\"rcw-search-button\"\n title={ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:SearchReport\")}\n onClick={() => setSearchBarOpened(true)}>\n <SvgSearch />\n </IconButton>\n );\n};\n"]}
@@ -2,7 +2,6 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/itwinui-css/scss/variables";
6
5
 
7
6
  @keyframes rcw-expand {
8
7
  0% {
@@ -2,15 +2,14 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/itwinui-css/scss/variables";
6
5
 
7
6
  .rcw-select-imodel {
8
7
  position: relative;
9
- margin-bottom: $iui-baseline * 2;
8
+ margin-bottom: calc(var(--iui-size-s) * 2);
10
9
 
11
10
  .rcw-combobox {
12
11
  display: flex;
13
- gap: $iui-s;
12
+ gap: var(--iui-size-xs);
14
13
  width: 100%;
15
14
  }
16
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"AAWA,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,mCAItB,iBAAiB,gBAiBnB,CAAC;AAEF,eAAO,MAAM,WAAW,gBAAiB,MAAM,SAwD9C,CAAC;AAEF,eAAO,MAAM,cAAc,mBAc1B,CAAC;AACF,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AACD,eAAO,MAAM,YAAY,iBAAkB,iBAAiB,gBAE3D,CAAC;AAEF,eAAO,MAAM,iBAAiB,SACzB,MAAM,WAAW,CAAC,gBAAgB,CAAC,wEAUvC,CAAC;AAEF,eAAO,MAAM,cAAc,mBAS1B,CAAC;AAEF,eAAO,MAAM,aAAa,mBAEzB,CAAC;AAEF,eAAO,MAAM,WAAW,YAAa,MAAM,cAAc,MAAM,WAE9D,CAAC;AAEF,oBAAY,uBAAuB,CAAC,SAAS,IAAI;KAC9C,QAAQ,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC;CACnD,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"AAWA,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,mCAItB,iBAAiB,gBAkBnB,CAAC;AAEF,eAAO,MAAM,WAAW,gBAAiB,MAAM,SAwD9C,CAAC;AAEF,eAAO,MAAM,cAAc,mBAc1B,CAAC;AACF,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AACD,eAAO,MAAM,YAAY,iBAAkB,iBAAiB,gBAE3D,CAAC;AAEF,eAAO,MAAM,iBAAiB,SACzB,MAAM,WAAW,CAAC,gBAAgB,CAAC,wEAUvC,CAAC;AAEF,eAAO,MAAM,cAAc,mBAS1B,CAAC;AAEF,eAAO,MAAM,aAAa,mBAEzB,CAAC;AAEF,eAAO,MAAM,WAAW,YAAa,MAAM,cAAc,MAAM,WAE9D,CAAC;AAEF,oBAAY,uBAAuB,CAAC,SAAS,IAAI;KAC9C,QAAQ,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC;CACnD,CAAC"}
@@ -3,13 +3,13 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import { SvgChevronLeft } from "@itwin/itwinui-icons-react";
6
- import { IconButton, ProgressRadial, Text, toaster, } from "@itwin/itwinui-react";
6
+ import { Icon, ProgressRadial, Text, toaster, } from "@itwin/itwinui-react";
7
7
  import "./utils.scss";
8
8
  import React from "react";
9
9
  import { ReportsConfigWidget } from "../../ReportsConfigWidget";
10
10
  export const WidgetHeader = ({ title, disabled = false, returnFn, }) => {
11
11
  return (React.createElement("div", { className: "rcw-widget-header-container" },
12
- returnFn && (React.createElement(IconButton, { onClick: returnFn, disabled: disabled, styleType: "borderless" },
12
+ returnFn && (React.createElement(Icon, { className: `${disabled ? "rcw-chevron-disabled" : "rcw-chevron"}`, onClick: disabled ? undefined : returnFn, size: "large", title: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Back") },
13
13
  React.createElement(SvgChevronLeft, null))),
14
14
  React.createElement(Text, { className: "rcw-title", variant: "title" }, title)));
15
15
  };
@@ -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K,SAAS,EAAC,oBAAoB,IAAE,QAAQ,CAAO,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,CAAsC,EACtC,MAAS,EACT,SAAkD,EAClD,EAAE;IACF,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;IAEjC,SAAS,CAAC;QACR,GAAG,MAAM;QACT,CAAC,IAAI,CAAC,EAAE,KAAK;KACd,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,CACL,6BACE,SAAS,EAAC,qBAAqB,iBACnB,4BAA4B;QAExC,oBAAC,cAAc,IAAC,IAAI,EAAC,OAAO,EAAC,aAAa,SAAG,CACzC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CACjC,6BAAK,SAAS,EAAC,iCAAiC,GAAG,CACpD,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,UAAkB,EAAE,EAAE;IACjE,OAAO,OAAO,CAAC,OAAO,CAAC,yBAAyB,EAAE,UAAU,CAAC,CAAC;AAChE,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { SvgChevronLeft } from \"@itwin/itwinui-icons-react\";\nimport {\n IconButton,\n ProgressRadial,\n Text,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport \"./utils.scss\";\nimport React from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport interface WidgetHeaderProps {\n title: string;\n disabled?: boolean;\n returnFn?: () => void;\n}\n\nexport const WidgetHeader = ({\n title,\n disabled = false,\n returnFn,\n}: WidgetHeaderProps) => {\n return (\n <div className=\"rcw-widget-header-container\">\n {returnFn && (\n <IconButton\n onClick={returnFn}\n disabled={disabled}\n styleType=\"borderless\"\n >\n <SvgChevronLeft />\n </IconButton>\n )}\n <Text className=\"rcw-title\" variant=\"title\">\n {title}\n </Text>\n </div>\n );\n};\n\nexport const handleError = (errorStatus: number) => {\n let errorMessage = `${ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.Error\"\n )} `;\n switch (errorStatus) {\n case 401:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.401\"\n );\n break;\n case 403:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.403\"\n );\n break;\n case 404:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.404\"\n );\n break;\n case 409:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.409\"\n );\n break;\n case 422:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.422\"\n );\n break;\n case 429:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.429\"\n );\n break;\n case 500:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.500\"\n );\n break;\n case 502:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.502\"\n );\n break;\n case 503:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.503\"\n );\n break;\n default:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.SomethingWentWrong\"\n );\n }\n toaster.negative(errorMessage);\n};\n\nexport const LoadingOverlay = () => (\n <div className=\"rcw-center-overlay\">\n <Text>\n {ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Loading\"\n )}\n </Text>\n <ProgressRadial indeterminate />\n <Text>\n {ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:PleaseWait\"\n )}\n </Text>\n </div>\n);\ninterface EmptyMessageProps {\n children?: React.ReactNode;\n}\nexport const EmptyMessage = ({ children }: EmptyMessageProps) => {\n return <div className=\"rcw-center-overlay\">{children}</div>;\n};\n\nexport const handleInputChange = <T,>(\n e: React.ChangeEvent<HTMLInputElement>,\n values: T,\n setValues: React.Dispatch<React.SetStateAction<T>>\n) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const LoadingSpinner = () => {\n return (\n <div\n className=\"rcw-loading-spinner\"\n data-testid=\"rcw-action-loading-spinner\"\n >\n <ProgressRadial size=\"small\" indeterminate />\n </div>\n );\n};\n\nexport const SkeletonBlock = () => (\n <div className=\"rcw-skeleton-block iui-skeleton\" />\n);\n\nexport const generateUrl = (baseUrl: string, newBaseUrl: string) => {\n return baseUrl.replace(\"https://api.bentley.com\", newBaseUrl);\n};\n\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,IAAI,EACJ,cAAc,EACd,IAAI,EACJ,OAAO,GACR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAQhE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,QAAQ,GACU,EAAE,EAAE;IACtB,OAAO,CACL,6BAAK,SAAS,EAAC,6BAA6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,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,CACL,6BACE,SAAS,EAAC,qBAAqB,iBACnB,4BAA4B;QAExC,oBAAC,cAAc,IAAC,IAAI,EAAC,OAAO,EAAC,aAAa,SAAG,CACzC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CACjC,6BAAK,SAAS,EAAC,iCAAiC,GAAG,CACpD,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,UAAkB,EAAE,EAAE;IACjE,OAAO,OAAO,CAAC,OAAO,CAAC,yBAAyB,EAAE,UAAU,CAAC,CAAC;AAChE,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { SvgChevronLeft } from \"@itwin/itwinui-icons-react\";\nimport {\n Icon,\n ProgressRadial,\n Text,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport \"./utils.scss\";\nimport React from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport interface WidgetHeaderProps {\n title: string;\n disabled?: boolean;\n returnFn?: () => void;\n}\n\nexport const WidgetHeader = ({\n title,\n disabled = false,\n returnFn,\n}: WidgetHeaderProps) => {\n return (\n <div className=\"rcw-widget-header-container\">\n {returnFn && (\n <Icon\n className={`${disabled ? \"rcw-chevron-disabled\" : \"rcw-chevron\"}`}\n onClick={disabled ? undefined : returnFn}\n size=\"large\"\n title={ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Back\")}\n >\n <SvgChevronLeft />\n </Icon>\n )}\n <Text className=\"rcw-title\" variant=\"title\">\n {title}\n </Text>\n </div>\n );\n};\n\nexport const handleError = (errorStatus: number) => {\n let errorMessage = `${ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.Error\"\n )} `;\n switch (errorStatus) {\n case 401:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.401\"\n );\n break;\n case 403:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.403\"\n );\n break;\n case 404:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.404\"\n );\n break;\n case 409:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.409\"\n );\n break;\n case 422:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.422\"\n );\n break;\n case 429:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.429\"\n );\n break;\n case 500:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.500\"\n );\n break;\n case 502:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.502\"\n );\n break;\n case 503:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.503\"\n );\n break;\n default:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.SomethingWentWrong\"\n );\n }\n toaster.negative(errorMessage);\n};\n\nexport const LoadingOverlay = () => (\n <div className=\"rcw-center-overlay\">\n <Text>\n {ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Loading\"\n )}\n </Text>\n <ProgressRadial indeterminate />\n <Text>\n {ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:PleaseWait\"\n )}\n </Text>\n </div>\n);\ninterface EmptyMessageProps {\n children?: React.ReactNode;\n}\nexport const EmptyMessage = ({ children }: EmptyMessageProps) => {\n return <div className=\"rcw-center-overlay\">{children}</div>;\n};\n\nexport const handleInputChange = <T,>(\n e: React.ChangeEvent<HTMLInputElement>,\n values: T,\n setValues: React.Dispatch<React.SetStateAction<T>>\n) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const LoadingSpinner = () => {\n return (\n <div\n className=\"rcw-loading-spinner\"\n data-testid=\"rcw-action-loading-spinner\"\n >\n <ProgressRadial size=\"small\" indeterminate />\n </div>\n );\n};\n\nexport const SkeletonBlock = () => (\n <div className=\"rcw-skeleton-block iui-skeleton\" />\n);\n\nexport const generateUrl = (baseUrl: string, newBaseUrl: string) => {\n return baseUrl.replace(\"https://api.bentley.com\", newBaseUrl);\n};\n\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n"]}
@@ -2,20 +2,28 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/itwinui-css/scss/variables";
6
- @import "~@itwin/itwinui-css/scss/icon/index";
7
- @import "~@itwin/itwinui-css/scss/button/index";
8
5
 
9
6
  .rcw-widget-header-container {
10
7
  display: flex;
11
- margin-bottom: $iui-baseline;
12
- align-items: center;
8
+ margin-bottom: calc(var(--iui-size-s) * 2);
9
+
10
+ .rcw-chevron {
11
+ cursor: pointer;
12
+ align-self: center;
13
+ margin-right: var(--iui-size-xs);
14
+ }
15
+
16
+ .rcw-chevron-disabled {
17
+ fill: var(--iui-color-icon-muted);
18
+ cursor: not-allowed;
19
+ align-self: center;
20
+ margin-right: var(--iui-size-xs);
21
+ }
13
22
 
14
23
  .rcw-title {
15
24
  overflow: hidden;
16
25
  white-space: nowrap;
17
26
  text-overflow: ellipsis;
18
- margin-bottom: 3px;
19
27
  }
20
28
  }
21
29
 
@@ -29,11 +37,11 @@
29
37
  justify-content: center;
30
38
  align-items: center;
31
39
  flex-direction: column;
32
- gap: $iui-baseline;
40
+ gap: var(--iui-size-s);
33
41
  height: 100%;
34
42
  }
35
43
 
36
44
  .rcw-skeleton-block {
37
- height: $iui-baseline * 3;
45
+ height: calc(var(--iui-size-s) * 3);
38
46
  width: 100%;
39
47
  }
@@ -4,7 +4,9 @@
4
4
  "AddMappings": "Add Mappings",
5
5
  "AddReport": "Add Report",
6
6
  "AreYouSureYouWantToDelete": "Are you sure you want to delete",
7
+ "Back": "Back",
7
8
  "Cancel": "Cancel",
9
+ "ClearSearch": "Clear Search",
8
10
  "Close": "Close",
9
11
  "Checking": "Checking",
10
12
  "Confirm": "Confirm",
@@ -51,9 +53,11 @@
51
53
  "ReportDetails": "Report Details",
52
54
  "ReportName": "Report Name",
53
55
  "ReportsConfig": "Reports Config",
56
+ "ReportOptions": "Report Options",
54
57
  "RunExtraction": "Run Extraction",
55
58
  "Running": "Running",
56
59
  "Search": "Search...",
60
+ "SearchReport": "Search",
57
61
  "SelectIModel": "Select an iModel",
58
62
  "Starting": "Starting",
59
63
  "Success": "Success",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/reports-config-widget-react",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "An iTwin.js 3D Viewer Widget that interfaces with the iTwin Reporting Platform.",
5
5
  "keywords": [
6
6
  "Bentley",
@@ -30,42 +30,42 @@
30
30
  "rules": {
31
31
  "no-duplicate-imports": "off",
32
32
  "@typescript-eslint/consistent-type-imports": "error",
33
- "deprecation/deprecation": "off",
33
+ "deprecation/deprecation": "error",
34
34
  "jsx-a11y/no-static-element-interactions": "off",
35
35
  "jsx-a11y/click-events-have-key-events": "off",
36
36
  "jsx-a11y/anchor-is-valid": "off"
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@itwin/imodels-access-frontend": "^1.0.1",
40
+ "@itwin/imodels-access-frontend": "^4.0.0",
41
41
  "@itwin/imodels-client-management": "^1.0.1",
42
42
  "@itwin/insights-client": "^0.4.0",
43
- "@itwin/itwinui-icons-color-react": "^1.0.1",
44
- "@itwin/itwinui-icons-react": "^1.7.0",
45
- "@itwin/itwinui-react": "^1.42.0",
43
+ "@itwin/itwinui-icons-color-react": "^2.1.0",
44
+ "@itwin/itwinui-icons-react": "^2.4.0",
45
+ "@itwin/itwinui-react": "^2.11.0",
46
46
  "classnames": "^2.3.1",
47
47
  "simple-react-validator": "^1.6.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@faker-js/faker": "6.2.0",
51
- "@itwin/appui-abstract": "^3.0.0",
52
- "@itwin/appui-layout-react": "^3.0.0",
53
- "@itwin/appui-react": "^3.0.0",
54
- "@itwin/build-tools": "^3.0.0",
55
- "@itwin/components-react": "^3.0.0",
56
- "@itwin/core-bentley": "^3.0.0",
57
- "@itwin/core-common": "^3.0.0",
58
- "@itwin/core-frontend": "^3.0.0",
59
- "@itwin/core-geometry": "^3.0.0",
60
- "@itwin/core-markup": "^3.0.0",
61
- "@itwin/core-orbitgt": "^3.0.0",
62
- "@itwin/core-quantity": "^3.0.0",
63
- "@itwin/core-react": "^3.0.0",
64
- "@itwin/eslint-plugin": "^3.0.0",
65
- "@itwin/imodel-components-react": "^3.0.0",
66
- "@itwin/presentation-common": "^3.0.0",
67
- "@itwin/presentation-frontend": "^3.0.0",
68
- "@itwin/webgl-compatibility": "^3.0.0",
51
+ "@itwin/appui-abstract": "^4.0.0",
52
+ "@itwin/appui-layout-react": "^4.0.0",
53
+ "@itwin/appui-react": "^4.0.0",
54
+ "@itwin/build-tools": "^4.0.0",
55
+ "@itwin/components-react": "^4.0.0",
56
+ "@itwin/core-bentley": "^4.0.0",
57
+ "@itwin/core-common": "^4.0.0",
58
+ "@itwin/core-frontend": "^4.0.0",
59
+ "@itwin/core-geometry": "^4.0.0",
60
+ "@itwin/core-markup": "^4.0.0",
61
+ "@itwin/core-orbitgt": "^4.0.0",
62
+ "@itwin/core-quantity": "^4.0.0",
63
+ "@itwin/core-react": "^4.0.0",
64
+ "@itwin/eslint-plugin": "^3.7.8",
65
+ "@itwin/imodel-components-react": "^4.0.0",
66
+ "@itwin/presentation-common": "^4.0.0",
67
+ "@itwin/presentation-frontend": "^4.0.0",
68
+ "@itwin/webgl-compatibility": "^4.0.0",
69
69
  "@testing-library/dom": "^8.12.0",
70
70
  "@testing-library/jest-dom": "^5.16.3",
71
71
  "@testing-library/react": "^12.1.4",
@@ -97,14 +97,14 @@
97
97
  "rimraf": "^3.0.2",
98
98
  "ts-jest": "^27.1.3",
99
99
  "typemoq": "^2.1.0",
100
- "typescript": "~4.3.0",
100
+ "typescript": "~4.5.0",
101
101
  "xmlhttprequest": "^1.8.0"
102
102
  },
103
103
  "peerDependencies": {
104
- "@itwin/appui-abstract": "^3.0.0",
105
- "@itwin/appui-react": "^3.0.0",
106
- "@itwin/core-bentley": "^3.0.0",
107
- "@itwin/core-frontend": "^3.0.0",
104
+ "@itwin/appui-abstract": "^4.0.0",
105
+ "@itwin/appui-react": "^4.0.0",
106
+ "@itwin/core-bentley": "^4.0.0",
107
+ "@itwin/core-frontend": "^4.0.0",
108
108
  "react": "^17.0.2",
109
109
  "react-dom": "^17.0.2",
110
110
  "react-redux": "^7.2.0"
@@ -118,7 +118,7 @@
118
118
  "copy:cjs": "cpx \"./src/**/*.scss\" ./lib/cjs",
119
119
  "copy:esm": "cpx \"./src/**/*.scss\" ./lib/esm",
120
120
  "copy:public": "cpx \"./public/**/*\" ./lib/public",
121
- "//cover": "npm test -- --coverage",
121
+ "cover": "npm test -- --coverage",
122
122
  "dual-build": "npm run -s build:cjs && npm run -s build:esm",
123
123
  "lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
124
124
  "lint:fix": "npm run lint -- --fix",
@@ -4,7 +4,9 @@
4
4
  "AddMappings": "Add Mappings",
5
5
  "AddReport": "Add Report",
6
6
  "AreYouSureYouWantToDelete": "Are you sure you want to delete",
7
+ "Back": "Back",
7
8
  "Cancel": "Cancel",
9
+ "ClearSearch": "Clear Search",
8
10
  "Close": "Close",
9
11
  "Checking": "Checking",
10
12
  "Confirm": "Confirm",
@@ -51,9 +53,11 @@
51
53
  "ReportDetails": "Report Details",
52
54
  "ReportName": "Report Name",
53
55
  "ReportsConfig": "Reports Config",
56
+ "ReportOptions": "Report Options",
54
57
  "RunExtraction": "Run Extraction",
55
58
  "Running": "Running",
56
59
  "Search": "Search...",
60
+ "SearchReport": "Search",
57
61
  "SelectIModel": "Select an iModel",
58
62
  "Starting": "Starting",
59
63
  "Success": "Success",
@@ -1 +1,14 @@
1
- no problems
1
+ PASS src/test/ReportMappingHorizontalTile.test.tsx (11.175 s)
2
+ PASS src/test/ReportMappings.test.tsx
3
+ PASS src/test/BulkExtractor.test.ts
4
+ PASS src/test/Reports.test.tsx (10.973 s)
5
+ PASS src/test/AddMappingModal.test.tsx
6
+ PASS src/test/ReportAction.test.tsx (6.602 s)
7
+ PASS src/test/DeleteModal.test.tsx
8
+ PASS src/test/WidgetHeader.test.tsx
9
+
10
+ Test Suites: 8 passed, 8 total
11
+ Tests: 40 passed, 40 total
12
+ Snapshots: 0 total
13
+ Time: 47.701 s
14
+ Ran all test suites.
@@ -1,2 +1,63 @@
1
- Invoking: eslint -f visualstudio "./src/**/*.{ts,tsx}" 1>&2
2
- no problems
1
+ Invoking: npm test -- --coverage
2
+
3
+ > @itwin/reports-config-widget-react@0.3.0 test
4
+ > jest --coverage
5
+
6
+ PASS src/test/ReportMappingHorizontalTile.test.tsx (11.175 s)
7
+ PASS src/test/ReportMappings.test.tsx
8
+ PASS src/test/BulkExtractor.test.ts
9
+ PASS src/test/Reports.test.tsx (10.973 s)
10
+ PASS src/test/AddMappingModal.test.tsx
11
+ PASS src/test/ReportAction.test.tsx (6.602 s)
12
+ PASS src/test/DeleteModal.test.tsx
13
+ PASS src/test/WidgetHeader.test.tsx
14
+ ----------------------------------------|---------|----------|---------|---------|-------------------------
15
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
16
+ ----------------------------------------|---------|----------|---------|---------|-------------------------
17
+ All files | 84.8 | 66.66 | 76.83 | 85.44 |
18
+ src | 77.77 | 50 | 50 | 77.77 |
19
+ ReportsConfigWidget.ts | 77.77 | 50 | 50 | 77.77 | 13,32
20
+ src/test | 100 | 100 | 100 | 100 |
21
+ test-utils.tsx | 100 | 100 | 100 | 100 |
22
+ src/widget | 42.85 | 0 | 0 | 42.85 |
23
+ ReportsConfigUiProvider.tsx | 42.85 | 0 | 0 | 42.85 | 23-58
24
+ src/widget/components | 84.5 | 69.3 | 77.41 | 85.42 |
25
+ ActionPanel.tsx | 100 | 90.9 | 100 | 100 | 26
26
+ AddMappingsModal.tsx | 92 | 80 | 90 | 93.33 | 38,112,134
27
+ BulkExtractor.ts | 92.92 | 90.47 | 100 | 93.68 | 109,118-120,129,160-162
28
+ Constants.ts | 100 | 100 | 100 | 100 |
29
+ DeleteModal.tsx | 94.44 | 100 | 100 | 94.11 | 40
30
+ ExtractionStatus.tsx | 94.28 | 90 | 83.33 | 96.87 | 63
31
+ ExtractionToast.tsx | 58.33 | 100 | 0 | 50 | 18-22,36
32
+ HorizontalTile.tsx | 100 | 100 | 100 | 100 |
33
+ LocalizedTablePaginator.tsx | 100 | 50 | 100 | 100 | 25
34
+ ReportAction.tsx | 94.11 | 80 | 100 | 93.93 | 57-58
35
+ ReportHorizontalTile.tsx | 73.17 | 40 | 76.92 | 71.79 | 42-44,56-62,123
36
+ ReportMappingHorizontalTile.tsx | 93.75 | 100 | 91.66 | 93.47 | 65-68
37
+ ReportMappings.tsx | 91.76 | 61.9 | 85 | 93.58 | 82,266-293
38
+ Reports.tsx | 84.12 | 66.66 | 77.77 | 91.07 | 108,114-117
39
+ ReportsConfigContext.tsx | 91.17 | 87.09 | 70 | 90 | 35,65,69
40
+ ReportsContainer.tsx | 52.17 | 50 | 20 | 54.54 | 40-55
41
+ ReportsHeader.tsx | 71.42 | 0 | 0 | 66.66 | 18-21
42
+ ReportsRouter.tsx | 37.5 | 0 | 0 | 42.1 | 23-61
43
+ SearchBar.tsx | 70.58 | 71.42 | 60 | 68.75 | 31-45
44
+ SelectIModel.tsx | 95.83 | 100 | 83.33 | 95.45 | 74
45
+ utils.tsx | 62.74 | 35.29 | 87.5 | 55.81 | 52-95,151
46
+ src/widget/components/ExtractionStates | 96.87 | 25 | 80 | 96.29 |
47
+ FailedExtractionState.tsx | 85.71 | 0 | 0 | 83.33 | 16
48
+ QueuedExtractionState.tsx | 100 | 100 | 100 | 100 |
49
+ RunningExtractionState.tsx | 100 | 100 | 100 | 100 |
50
+ StartingExtractionState.tsx | 100 | 100 | 100 | 100 |
51
+ SucceededExtractionState.tsx | 100 | 50 | 100 | 100 | 26
52
+ src/widget/context | 85.71 | 0 | 66.66 | 84.21 |
53
+ BulkExtractorContext.tsx | 88.88 | 0 | 100 | 87.5 | 21
54
+ ReportsConfigApiContext.tsx | 83.33 | 0 | 50 | 81.81 | 23,34
55
+ src/widget/hooks | 100 | 100 | 100 | 100 |
56
+ useValidator.ts | 100 | 100 | 100 | 100 |
57
+ ----------------------------------------|---------|----------|---------|---------|-------------------------
58
+
59
+ Test Suites: 8 passed, 8 total
60
+ Tests: 40 passed, 40 total
61
+ Snapshots: 0 total
62
+ Time: 47.701 s
63
+ Ran all test suites.
@@ -7,8 +7,15 @@ import "@testing-library/jest-dom";
7
7
  import { render, screen } from "../test/test-utils";
8
8
  import { WidgetHeader } from "../widget/components/utils";
9
9
  import { faker } from "@faker-js/faker";
10
+ import { EmptyLocalization } from "@itwin/core-common";
11
+ import { ReportsConfigWidget } from "../ReportsConfigWidget";
10
12
 
11
13
  describe("Widget Header Component", () => {
14
+ beforeAll(async () => {
15
+ const localization = new EmptyLocalization();
16
+ await ReportsConfigWidget.initialize(localization);
17
+ });
18
+
12
19
  it("title renders", async () => {
13
20
  const fakeTitle = faker.word.interjection();
14
21
  render(<WidgetHeader title={fakeTitle} />);
@@ -20,9 +27,9 @@ describe("Widget Header Component", () => {
20
27
 
21
28
  it("header allows return callback", async () => {
22
29
  const mockReturnFn = jest.fn();
23
- const { user } = render(<WidgetHeader title="" returnFn={mockReturnFn} />);
30
+ const { user, container } = render(<WidgetHeader title="" returnFn={mockReturnFn} />);
24
31
 
25
- const returnBtn = screen.getByRole("button");
32
+ const returnBtn = container.getElementsByClassName("rcw-chevron")[0];
26
33
  await user.click(returnBtn);
27
34
  expect(mockReturnFn).toHaveBeenCalledTimes(1);
28
35
  });
@@ -3,14 +3,14 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import type {
6
- AbstractWidgetProps,
7
6
  UiItemsProvider,
8
- } from "@itwin/appui-abstract";
7
+ Widget,
8
+ } from "@itwin/appui-react";
9
9
  import {
10
10
  StagePanelLocation,
11
11
  StagePanelSection,
12
12
  StageUsage,
13
- } from "@itwin/appui-abstract";
13
+ } from "@itwin/appui-react";
14
14
  import type { AccessToken } from "@itwin/core-bentley";
15
15
 
16
16
  import * as React from "react";
@@ -37,26 +37,19 @@ export class ReportsConfigProvider implements UiItemsProvider {
37
37
  stageUsage: string,
38
38
  location: StagePanelLocation,
39
39
  section?: StagePanelSection
40
- ): ReadonlyArray<AbstractWidgetProps> {
41
- const widgets: AbstractWidgetProps[] = [];
40
+ ): ReadonlyArray<Widget> {
41
+ const widgets: Widget[] = [];
42
42
  if (
43
43
  location === StagePanelLocation.Left &&
44
44
  section === StagePanelSection.Start &&
45
45
  stageUsage === StageUsage.General
46
46
  ) {
47
- const ReportsWidget: AbstractWidgetProps = {
47
+ const ReportsWidget: Widget = {
48
48
  id: "reports-config-widget",
49
49
  label: ReportsConfigWidget.localization.getLocalizedString(
50
50
  "ReportsConfigWidget:ReportsConfig"
51
51
  ),
52
- getWidgetContent: () => {
53
- return (
54
- <ReportsContainer
55
- getAccessToken={this._getAccessToken}
56
- baseUrl={this._baseUrl}
57
- />
58
- );
59
- },
52
+ content: <ReportsContainer getAccessToken={this._getAccessToken} baseUrl={this._baseUrl} />,
60
53
  };
61
54
 
62
55
  widgets.push(ReportsWidget);
@@ -2,11 +2,10 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/itwinui-css/scss/variables";
6
5
 
7
6
  .rcw-action-panel {
8
7
  display: flex;
9
8
  justify-content: right;
10
- padding: $iui-baseline * 2 $iui-m $iui-baseline;
11
- gap: $iui-s;
9
+ padding: calc(var(--iui-size-s) * 2) var(--iui-size-m) var(--iui-size-s);
10
+ gap: var(--iui-size-xs);
12
11
  }
@@ -24,7 +24,7 @@ const ActionPanel = ({
24
24
  isCancelDisabled = false,
25
25
  isSavingDisabled = false,
26
26
  isLoading = false,
27
- }: ActionPanelProps): JSX.Element => {
27
+ }: ActionPanelProps): React.ReactElement => {
28
28
  return (
29
29
  <div className="rcw-action-panel">
30
30
  {isLoading && <LoadingSpinner />}