@itwin/reports-config-widget-react 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/operation/rebuild/all.log +9 -0
- package/.rush/temp/operation/rebuild/state.json +3 -0
- package/.rush/temp/package-deps_rebuild.json +48 -44
- package/.rush/temp/shrinkwrap-deps.json +228 -207
- package/CHANGELOG.json +44 -0
- package/CHANGELOG.md +24 -1
- package/coverage/clover.xml +562 -542
- package/coverage/coverage-final.json +24 -20
- package/coverage/lcov-report/index.html +51 -51
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +22 -22
- package/coverage/lcov-report/src/index.html +21 -21
- package/coverage/lcov-report/src/test/index.html +11 -11
- package/coverage/lcov-report/src/test/test-utils.tsx.html +20 -140
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +14 -35
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +26 -20
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +94 -109
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +55 -52
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +1 -1
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +28 -46
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +3 -3
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +8 -8
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +36 -81
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +38 -41
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +46 -46
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +127 -142
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +189 -312
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +370 -0
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +111 -33
- package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +166 -0
- package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +274 -0
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +22 -7
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +40 -94
- package/coverage/lcov-report/src/widget/components/index.html +142 -97
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +22 -19
- package/coverage/lcov-report/src/widget/context/{ReportsApiConfigContext.tsx.html → BulkExtractorContext.tsx.html} +23 -26
- package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +202 -0
- package/coverage/lcov-report/src/widget/context/index.html +30 -15
- package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +11 -11
- package/coverage/lcov-report/src/widget/index.html +13 -13
- package/coverage/lcov.info +1036 -1034
- package/jest.config.js +1 -0
- package/lib/cjs/ReportsConfigWidget.js +1 -1
- package/lib/cjs/ReportsConfigWidget.js.map +1 -1
- package/lib/cjs/reports-config-widget-react.d.ts +5 -0
- package/lib/cjs/reports-config-widget-react.d.ts.map +1 -1
- package/lib/cjs/reports-config-widget-react.js +11 -0
- package/lib/cjs/reports-config-widget-react.js.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.js +20 -34
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
- package/lib/cjs/test/BulkExtractor.test.js +13 -19
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
- package/lib/cjs/test/DeleteModal.test.d.ts.map +1 -1
- package/lib/cjs/test/DeleteModal.test.js +4 -62
- package/lib/cjs/test/DeleteModal.test.js.map +1 -1
- package/lib/cjs/test/ReportAction.test.js +14 -79
- package/lib/cjs/test/ReportAction.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +20 -54
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/cjs/test/ReportMappings.test.d.ts.map +1 -1
- package/lib/cjs/test/ReportMappings.test.js +51 -106
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +41 -96
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +9 -3
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/test-utils.d.ts +3 -8
- package/lib/cjs/test/test-utils.d.ts.map +1 -1
- package/lib/cjs/test/test-utils.js +6 -34
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +3 -3
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +5 -7
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts +3 -3
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.js +4 -4
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.scss +2 -3
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +4 -4
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js +39 -43
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.scss +1 -2
- package/lib/cjs/widget/components/BulkExtractor.d.ts +4 -4
- package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.js +8 -8
- package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts +4 -5
- package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js +11 -15
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.scss +2 -3
- package/lib/cjs/widget/components/ExtractionStatus.js +2 -2
- package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.scss +6 -7
- package/lib/cjs/widget/components/HorizontalTile.js +2 -2
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.scss +11 -14
- package/lib/cjs/widget/components/LocalizedTablePaginator.js +2 -2
- package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.d.ts +4 -5
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js +24 -26
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.scss +1 -2
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts +4 -4
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js +33 -20
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +36 -21
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts +4 -6
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js +50 -63
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.scss +10 -11
- package/lib/cjs/widget/components/Reports.d.ts +6 -1
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js +53 -94
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/Reports.scss +15 -15
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts +18 -0
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportsConfigContext.js +79 -0
- package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -0
- package/lib/cjs/widget/components/ReportsContainer.d.ts +14 -0
- package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js +27 -16
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.scss +1 -3
- package/lib/cjs/widget/components/ReportsHeader.d.ts +7 -0
- package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportsHeader.js +20 -0
- package/lib/cjs/widget/components/ReportsHeader.js.map +1 -0
- package/lib/cjs/widget/components/ReportsRouter.d.ts +8 -0
- package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportsRouter.js +51 -0
- package/lib/cjs/widget/components/ReportsRouter.js.map +1 -0
- package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/cjs/widget/components/SearchBar.js +4 -5
- package/lib/cjs/widget/components/SearchBar.js.map +1 -1
- package/lib/cjs/widget/components/SearchBar.scss +1 -2
- package/lib/cjs/widget/components/SelectIModel.d.ts +3 -3
- package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +10 -30
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.scss +2 -3
- package/lib/cjs/widget/components/utils.d.ts +1 -1
- package/lib/cjs/widget/components/utils.d.ts.map +1 -1
- package/lib/cjs/widget/components/utils.js +1 -1
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +16 -8
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts +10 -0
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -0
- package/lib/cjs/widget/context/{ReportsApiConfigContext.js → BulkExtractorContext.js} +7 -10
- package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -0
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts +16 -0
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -0
- package/lib/cjs/widget/context/ReportsConfigApiContext.js +43 -0
- package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -0
- package/lib/cjs/widget/hooks/useValidator.js +1 -1
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
- package/lib/esm/ReportsConfigWidget.js +1 -1
- package/lib/esm/ReportsConfigWidget.js.map +1 -1
- package/lib/esm/reports-config-widget-react.d.ts +5 -0
- package/lib/esm/reports-config-widget-react.d.ts.map +1 -1
- package/lib/esm/reports-config-widget-react.js +5 -0
- package/lib/esm/reports-config-widget-react.js.map +1 -1
- package/lib/esm/test/AddMappingModal.test.js +17 -31
- package/lib/esm/test/AddMappingModal.test.js.map +1 -1
- package/lib/esm/test/BulkExtractor.test.js +14 -17
- package/lib/esm/test/BulkExtractor.test.js.map +1 -1
- package/lib/esm/test/DeleteModal.test.d.ts.map +1 -1
- package/lib/esm/test/DeleteModal.test.js +5 -44
- package/lib/esm/test/DeleteModal.test.js.map +1 -1
- package/lib/esm/test/ReportAction.test.js +14 -60
- package/lib/esm/test/ReportAction.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +4 -38
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/esm/test/ReportMappings.test.d.ts.map +1 -1
- package/lib/esm/test/ReportMappings.test.js +43 -98
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +24 -60
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +8 -2
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/test-utils.d.ts +3 -8
- package/lib/esm/test/test-utils.d.ts.map +1 -1
- package/lib/esm/test/test-utils.js +4 -31
- package/lib/esm/test/test-utils.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts +3 -3
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.js +2 -4
- package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/esm/widget/components/ActionPanel.d.ts +3 -3
- package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/esm/widget/components/ActionPanel.js +4 -4
- package/lib/esm/widget/components/ActionPanel.js.map +1 -1
- package/lib/esm/widget/components/ActionPanel.scss +2 -3
- package/lib/esm/widget/components/AddMappingsModal.d.ts +4 -4
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.js +35 -39
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.scss +1 -2
- package/lib/esm/widget/components/BulkExtractor.d.ts +4 -4
- package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.js +7 -8
- package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts +4 -5
- package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/esm/widget/components/DeleteModal.js +11 -15
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.scss +2 -3
- package/lib/esm/widget/components/ExtractionStatus.scss +6 -7
- package/lib/esm/widget/components/HorizontalTile.scss +11 -14
- package/lib/esm/widget/components/ReportAction.d.ts +4 -5
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.js +17 -21
- package/lib/esm/widget/components/ReportAction.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.scss +1 -2
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts +4 -4
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.js +6 -9
- package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js +12 -13
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.d.ts +4 -6
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js +43 -56
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.scss +10 -11
- package/lib/esm/widget/components/Reports.d.ts +6 -1
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js +46 -87
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/Reports.scss +15 -15
- package/lib/esm/widget/components/ReportsConfigContext.d.ts +18 -0
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportsConfigContext.js +56 -0
- package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -0
- package/lib/esm/widget/components/ReportsContainer.d.ts +14 -0
- package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.js +27 -17
- package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.scss +1 -3
- package/lib/esm/widget/components/ReportsHeader.d.ts +7 -0
- package/lib/esm/widget/components/ReportsHeader.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportsHeader.js +13 -0
- package/lib/esm/widget/components/ReportsHeader.js.map +1 -0
- package/lib/esm/widget/components/ReportsRouter.d.ts +8 -0
- package/lib/esm/widget/components/ReportsRouter.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportsRouter.js +44 -0
- package/lib/esm/widget/components/ReportsRouter.js.map +1 -0
- package/lib/esm/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/esm/widget/components/SearchBar.js +2 -3
- package/lib/esm/widget/components/SearchBar.js.map +1 -1
- package/lib/esm/widget/components/SearchBar.scss +1 -2
- package/lib/esm/widget/components/SelectIModel.d.ts +3 -3
- package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/esm/widget/components/SelectIModel.js +7 -27
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.scss +2 -3
- package/lib/esm/widget/components/utils.d.ts +1 -1
- package/lib/esm/widget/components/utils.d.ts.map +1 -1
- package/lib/esm/widget/components/utils.js +2 -2
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +16 -8
- package/lib/esm/widget/context/BulkExtractorContext.d.ts +10 -0
- package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -0
- package/lib/esm/widget/context/BulkExtractorContext.js +11 -0
- package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -0
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts +16 -0
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -0
- package/lib/esm/widget/context/ReportsConfigApiContext.js +20 -0
- package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -0
- package/lib/public/locales/en/ReportsConfigWidget.json +6 -1
- package/package.json +29 -29
- package/public/locales/en/ReportsConfigWidget.json +6 -1
- package/reports-config-widget-react.build.error.log +6 -6
- package/reports-config-widget-react.build.log +52 -49
- package/src/reports-config-widget-react.ts +6 -0
- package/src/test/AddMappingModal.test.tsx +20 -37
- package/src/test/BulkExtractor.test.ts +15 -17
- package/src/test/DeleteModal.test.tsx +4 -73
- package/src/test/ReportAction.test.tsx +17 -90
- package/src/test/ReportMappingHorizontalTile.test.tsx +3 -54
- package/src/test/ReportMappings.test.tsx +50 -135
- package/src/test/Reports.test.tsx +21 -80
- package/src/test/WidgetHeader.test.tsx +9 -2
- package/src/test/test-utils.tsx +9 -49
- package/src/widget/ReportsConfigUiProvider.tsx +7 -14
- package/src/widget/components/ActionPanel.scss +2 -3
- package/src/widget/components/ActionPanel.tsx +17 -15
- package/src/widget/components/AddMappingsModal.scss +1 -2
- package/src/widget/components/AddMappingsModal.tsx +55 -60
- package/src/widget/components/BulkExtractor.ts +11 -10
- package/src/widget/components/DeleteModal.scss +2 -3
- package/src/widget/components/DeleteModal.tsx +17 -23
- package/src/widget/components/ExtractionStatus.scss +6 -7
- package/src/widget/components/HorizontalTile.scss +11 -14
- package/src/widget/components/ReportAction.scss +1 -2
- package/src/widget/components/ReportAction.tsx +18 -33
- package/src/widget/components/ReportHorizontalTile.tsx +11 -12
- package/src/widget/components/ReportMappingHorizontalTile.tsx +30 -30
- package/src/widget/components/ReportMappings.scss +10 -11
- package/src/widget/components/ReportMappings.tsx +67 -72
- package/src/widget/components/Reports.scss +15 -15
- package/src/widget/components/Reports.tsx +140 -181
- package/src/widget/components/ReportsConfigContext.tsx +95 -0
- package/src/widget/components/ReportsContainer.scss +1 -3
- package/src/widget/components/ReportsContainer.tsx +47 -21
- package/src/widget/components/ReportsHeader.tsx +27 -0
- package/src/widget/components/ReportsRouter.tsx +63 -0
- package/src/widget/components/SearchBar.scss +1 -2
- package/src/widget/components/SearchBar.tsx +7 -2
- package/src/widget/components/SelectIModel.scss +2 -3
- package/src/widget/components/SelectIModel.tsx +11 -29
- package/src/widget/components/utils.scss +16 -8
- package/src/widget/components/utils.tsx +8 -7
- package/src/widget/context/{ReportsApiConfigContext.tsx → BulkExtractorContext.tsx} +9 -10
- package/src/widget/context/ReportsConfigApiContext.tsx +39 -0
- package/lib/cjs/widget/context/ReportsApiConfigContext.d.ts +0 -9
- package/lib/cjs/widget/context/ReportsApiConfigContext.d.ts.map +0 -1
- package/lib/cjs/widget/context/ReportsApiConfigContext.js.map +0 -1
- package/lib/esm/widget/context/ReportsApiConfigContext.d.ts +0 -9
- package/lib/esm/widget/context/ReportsApiConfigContext.d.ts.map +0 -1
- package/lib/esm/widget/context/ReportsApiConfigContext.js +0 -14
- package/lib/esm/widget/context/ReportsApiConfigContext.js.map +0 -1
|
@@ -2,39 +2,39 @@
|
|
|
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-list-container {
|
|
8
7
|
display: flex;
|
|
9
8
|
flex-direction: column;
|
|
10
9
|
flex-grow: 1;
|
|
11
|
-
padding: $iui-baseline $iui-m;
|
|
12
10
|
min-height: 0;
|
|
13
11
|
|
|
14
12
|
.rcw-toolbar {
|
|
15
13
|
display: flex;
|
|
16
14
|
justify-content: space-between;
|
|
17
|
-
gap:
|
|
18
|
-
border-bottom: 1px solid var(--iui-color-
|
|
19
|
-
padding-bottom:
|
|
15
|
+
gap: var(--iui-size-xs);
|
|
16
|
+
border-bottom: 1px solid var(--iui-color-border-subtle);
|
|
17
|
+
padding-bottom: var(--iui-size-s);
|
|
20
18
|
flex-wrap: wrap;
|
|
21
|
-
}
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
.rcw-search-bar-container {
|
|
21
|
+
flex-shrink: 1;
|
|
22
|
+
flex-grow: 0;
|
|
23
|
+
display: flex;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rcw-button-spacing {
|
|
27
|
+
display: flex;
|
|
28
|
+
gap: var(--iui-size-xs);
|
|
29
|
+
}
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
.rcw-reports-list {
|
|
30
33
|
display: flex;
|
|
31
34
|
flex-direction: column;
|
|
32
35
|
overflow-y: overlay;
|
|
33
|
-
gap:
|
|
34
|
-
margin-top:
|
|
36
|
+
gap: var(--iui-size-xs);
|
|
37
|
+
margin-top: var(--iui-size-xs);
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
.rcw-button-container {
|
|
39
|
-
display: flex;
|
|
40
|
-
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IModelsClient } from "@itwin/imodels-client-management";
|
|
2
|
+
import { ExtractionClient, MappingsClient, ReportsClient } from "@itwin/insights-client";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import type { GetAccessTokenFn } from "../context/ReportsConfigApiContext";
|
|
5
|
+
import { BulkExtractor } from "./BulkExtractor";
|
|
6
|
+
export interface ReportsConfigContextProps {
|
|
7
|
+
getAccessToken?: GetAccessTokenFn;
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
iTwinId: string;
|
|
10
|
+
bulkExtractor?: BulkExtractor;
|
|
11
|
+
reportsClient?: ReportsClient;
|
|
12
|
+
mappingsClient?: MappingsClient;
|
|
13
|
+
extractionClient?: ExtractionClient;
|
|
14
|
+
iModelsClient?: IModelsClient;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare const ReportsConfigContext: (props: ReportsConfigContextProps) => JSX.Element;
|
|
18
|
+
//# sourceMappingURL=ReportsConfigContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportsConfigContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsConfigContext.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAa,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAuB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE9G,OAAO,KAAoD,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,MAAM,WAAW,yBAAyB;IACxC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAKD,eAAO,MAAM,oBAAoB,UAAW,yBAAyB,gBA0DpE,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { IModelApp } from "@itwin/core-frontend";
|
|
6
|
+
import { Constants, IModelsClient } from "@itwin/imodels-client-management";
|
|
7
|
+
import { ExtractionClient, MappingsClient, REPORTING_BASE_PATH, ReportsClient } from "@itwin/insights-client";
|
|
8
|
+
import { toaster } from "@itwin/itwinui-react";
|
|
9
|
+
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
10
|
+
import { BulkExtractorContext } from "../context/BulkExtractorContext";
|
|
11
|
+
import { ReportsConfigApiContext } from "../context/ReportsConfigApiContext";
|
|
12
|
+
import { REPORTS_CONFIG_BASE_URL } from "../ReportsConfigUiProvider";
|
|
13
|
+
import { BulkExtractor } from "./BulkExtractor";
|
|
14
|
+
import { FailedExtractionToast, SuccessfulExtractionToast } from "./ExtractionToast";
|
|
15
|
+
import { generateUrl } from "./utils";
|
|
16
|
+
const authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? "";
|
|
17
|
+
export const ReportsConfigContext = (props) => {
|
|
18
|
+
const reportsBaseUrl = useCallback(() => generateUrl(REPORTING_BASE_PATH, props.baseUrl || REPORTS_CONFIG_BASE_URL), [props.baseUrl]);
|
|
19
|
+
const iModelClientOptions = useMemo(() => ({
|
|
20
|
+
api: { baseUrl: generateUrl(Constants.api.baseUrl, props.baseUrl ?? REPORTS_CONFIG_BASE_URL) },
|
|
21
|
+
}), [props.baseUrl]);
|
|
22
|
+
const [extractionClient, setExtractionClient] = useState(props.extractionClient ?? new ExtractionClient(reportsBaseUrl()));
|
|
23
|
+
const [apiConfig, setApiConfig] = useState({
|
|
24
|
+
getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,
|
|
25
|
+
baseUrl: reportsBaseUrl(),
|
|
26
|
+
iTwinId: props.iTwinId,
|
|
27
|
+
reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),
|
|
28
|
+
mappingsClient: props.mappingsClient ?? new MappingsClient(reportsBaseUrl()),
|
|
29
|
+
iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),
|
|
30
|
+
});
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!props.extractionClient) {
|
|
33
|
+
setExtractionClient(props.extractionClient ?? new ExtractionClient(reportsBaseUrl()));
|
|
34
|
+
}
|
|
35
|
+
}, [props.extractionClient, reportsBaseUrl]);
|
|
36
|
+
const successfulExtractionToast = (iModelName, odataFeedUrl) => {
|
|
37
|
+
toaster.positive(React.createElement(SuccessfulExtractionToast, { iModelName: iModelName, odataFeedUrl: odataFeedUrl }));
|
|
38
|
+
};
|
|
39
|
+
const failedExtractionToast = (iModelName) => {
|
|
40
|
+
toaster.negative(React.createElement(FailedExtractionToast, { iModelName: iModelName }));
|
|
41
|
+
};
|
|
42
|
+
const bulkExtractor = useMemo(() => ({ bulkExtractor: props.bulkExtractor ?? new BulkExtractor(apiConfig.reportsClient, extractionClient, apiConfig.getAccessToken, successfulExtractionToast, failedExtractionToast) }), [apiConfig.getAccessToken, apiConfig.reportsClient, extractionClient, props.bulkExtractor]);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setApiConfig(() => ({
|
|
45
|
+
getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,
|
|
46
|
+
baseUrl: props.baseUrl || REPORTS_CONFIG_BASE_URL,
|
|
47
|
+
iTwinId: props.iTwinId,
|
|
48
|
+
reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),
|
|
49
|
+
mappingsClient: props.mappingsClient ?? new MappingsClient(reportsBaseUrl()),
|
|
50
|
+
iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),
|
|
51
|
+
}));
|
|
52
|
+
}, [props.getAccessToken, props.baseUrl, props.iTwinId, props.reportsClient, props.mappingsClient, props.iModelsClient, reportsBaseUrl, iModelClientOptions]);
|
|
53
|
+
return (React.createElement(ReportsConfigApiContext.Provider, { value: apiConfig },
|
|
54
|
+
React.createElement(BulkExtractorContext.Provider, { value: bulkExtractor }, props.children)));
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=ReportsConfigContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportsConfigContext.js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,IAChD,KAAK,CAAC,QAAQ,CACe,CACC,CACpC,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 { IModelApp } from \"@itwin/core-frontend\";\nimport type { IModelsClientOptions } from \"@itwin/imodels-client-management\";\nimport { Constants, IModelsClient } from \"@itwin/imodels-client-management\";\nimport { ExtractionClient, MappingsClient, REPORTING_BASE_PATH, ReportsClient } from \"@itwin/insights-client\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { BulkExtractorContext } from \"../context/BulkExtractorContext\";\nimport type {\n GetAccessTokenFn,\n ReportsConfigApiProps,\n} from \"../context/ReportsConfigApiContext\";\nimport { ReportsConfigApiContext } from \"../context/ReportsConfigApiContext\";\nimport { REPORTS_CONFIG_BASE_URL } from \"../ReportsConfigUiProvider\";\nimport { BulkExtractor } from \"./BulkExtractor\";\nimport { FailedExtractionToast, SuccessfulExtractionToast } from \"./ExtractionToast\";\nimport { generateUrl } from \"./utils\";\n\nexport interface ReportsConfigContextProps {\n getAccessToken?: GetAccessTokenFn;\n baseUrl?: string;\n iTwinId: string;\n bulkExtractor?: BulkExtractor;\n reportsClient?: ReportsClient;\n mappingsClient?: MappingsClient;\n extractionClient?: ExtractionClient;\n iModelsClient?: IModelsClient;\n children?: React.ReactNode;\n}\n\nconst authorizationClientGetAccessToken = async () =>\n (await IModelApp.authorizationClient?.getAccessToken()) ?? \"\";\n\nexport const ReportsConfigContext = (props: ReportsConfigContextProps) => {\n const reportsBaseUrl = useCallback(() => generateUrl(\n REPORTING_BASE_PATH,\n props.baseUrl || REPORTS_CONFIG_BASE_URL\n ), [props.baseUrl]);\n const iModelClientOptions: IModelsClientOptions = useMemo(() => ({\n api: { baseUrl: generateUrl(Constants.api.baseUrl, props.baseUrl ?? REPORTS_CONFIG_BASE_URL) },\n }), [props.baseUrl]);\n const [extractionClient, setExtractionClient] = useState<ExtractionClient>(\n props.extractionClient ?? new ExtractionClient(reportsBaseUrl())\n );\n\n const [apiConfig, setApiConfig] = useState<ReportsConfigApiProps>({\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n baseUrl: reportsBaseUrl(),\n iTwinId: props.iTwinId,\n reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),\n mappingsClient: props.mappingsClient ?? new MappingsClient(reportsBaseUrl()),\n iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),\n });\n\n useEffect(() => {\n if (!props.extractionClient) {\n setExtractionClient(props.extractionClient ?? new ExtractionClient(reportsBaseUrl()));\n }\n }, [props.extractionClient, reportsBaseUrl]);\n\n const successfulExtractionToast = (iModelName: string, odataFeedUrl: string) => {\n toaster.positive(<SuccessfulExtractionToast iModelName={iModelName} odataFeedUrl={odataFeedUrl} />);\n };\n\n const failedExtractionToast = (iModelName: string) => {\n toaster.negative(<FailedExtractionToast iModelName={iModelName} />);\n };\n\n const bulkExtractor = useMemo(\n () => ({ bulkExtractor: props.bulkExtractor ?? new BulkExtractor(apiConfig.reportsClient, extractionClient, apiConfig.getAccessToken, successfulExtractionToast, failedExtractionToast) }),\n [apiConfig.getAccessToken, apiConfig.reportsClient, extractionClient, props.bulkExtractor]\n );\n\n useEffect(() => {\n setApiConfig(() => ({\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n baseUrl: props.baseUrl || REPORTS_CONFIG_BASE_URL,\n iTwinId: props.iTwinId,\n reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),\n mappingsClient: props.mappingsClient ?? new MappingsClient(reportsBaseUrl()),\n iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),\n }));\n }, [props.getAccessToken, props.baseUrl, props.iTwinId, props.reportsClient, props.mappingsClient, props.iModelsClient, reportsBaseUrl, iModelClientOptions]);\n\n return (\n <ReportsConfigApiContext.Provider value={apiConfig}>\n <BulkExtractorContext.Provider value={bulkExtractor}>\n {props.children}\n </BulkExtractorContext.Provider>\n </ReportsConfigApiContext.Provider>\n );\n};\n"]}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
3
3
|
import "./ReportsContainer.scss";
|
|
4
|
+
import type { Report } from "@itwin/insights-client";
|
|
4
5
|
interface ReportsContainerProps {
|
|
5
6
|
getAccessToken?: () => Promise<AccessToken>;
|
|
6
7
|
baseUrl: string;
|
|
7
8
|
}
|
|
9
|
+
export declare enum RouteStep {
|
|
10
|
+
ReportsList = 0,
|
|
11
|
+
ReportAction = 1,
|
|
12
|
+
ReportMappings = 2
|
|
13
|
+
}
|
|
14
|
+
export interface ReportsRouteFields {
|
|
15
|
+
report?: Report;
|
|
16
|
+
}
|
|
17
|
+
export interface Route {
|
|
18
|
+
step: RouteStep;
|
|
19
|
+
title: string;
|
|
20
|
+
reportsRoutingFields: ReportsRouteFields;
|
|
21
|
+
}
|
|
8
22
|
declare const ReportsContainer: ({ getAccessToken, baseUrl, }: ReportsContainerProps) => JSX.Element;
|
|
9
23
|
export default ReportsContainer;
|
|
10
24
|
//# sourceMappingURL=ReportsContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsContainer.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsContainer.tsx"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ReportsContainer.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsContainer.tsx"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAMrD,UAAU,qBAAqB;IAC7B,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oBAAY,SAAS;IACnB,WAAW,IAAA;IACX,YAAY,IAAA;IACZ,cAAc,IAAA;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB,EAAE,kBAAkB,CAAC;CAC1C;AAED,QAAA,MAAM,gBAAgB,iCAGnB,qBAAqB,gBAgCvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { useEffect, useState } from "react";
|
|
3
|
-
import { Reports } from "../components/Reports";
|
|
4
|
-
import { ReportsApiConfigContext } from "../context/ReportsApiConfigContext";
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
5
2
|
import "./ReportsContainer.scss";
|
|
6
|
-
|
|
3
|
+
import { useActiveIModelConnection } from "@itwin/appui-react";
|
|
4
|
+
import { ReportsHeader } from "./ReportsHeader";
|
|
5
|
+
import { ReportsRouter } from "./ReportsRouter";
|
|
6
|
+
import { ReportsConfigContext } from "./ReportsConfigContext";
|
|
7
|
+
export var RouteStep;
|
|
8
|
+
(function (RouteStep) {
|
|
9
|
+
RouteStep[RouteStep["ReportsList"] = 0] = "ReportsList";
|
|
10
|
+
RouteStep[RouteStep["ReportAction"] = 1] = "ReportAction";
|
|
11
|
+
RouteStep[RouteStep["ReportMappings"] = 2] = "ReportMappings";
|
|
12
|
+
})(RouteStep || (RouteStep = {}));
|
|
7
13
|
const ReportsContainer = ({ getAccessToken, baseUrl, }) => {
|
|
8
|
-
const [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const [routingHistory, setRoutingHistory] = useState([
|
|
15
|
+
{ step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} },
|
|
16
|
+
]);
|
|
17
|
+
const currentRoute = routingHistory[routingHistory.length - 1];
|
|
18
|
+
const iTwinId = useActiveIModelConnection()?.iTwinId ?? "";
|
|
19
|
+
const navigateTo = useCallback((toRoute) => {
|
|
20
|
+
setRoutingHistory((r) => [...r, toRoute(r[r.length - 1])]);
|
|
21
|
+
}, []);
|
|
22
|
+
const goBack = useCallback(() => {
|
|
23
|
+
const updatedRouting = [...routingHistory];
|
|
24
|
+
updatedRouting.pop();
|
|
25
|
+
setRoutingHistory(updatedRouting);
|
|
26
|
+
}, [routingHistory]);
|
|
27
|
+
return (React.createElement(ReportsConfigContext, { getAccessToken: getAccessToken, baseUrl: baseUrl, iTwinId: iTwinId },
|
|
19
28
|
React.createElement("div", { className: "rcw-reports-container" },
|
|
20
|
-
React.createElement(
|
|
29
|
+
React.createElement(ReportsHeader, { goBack: goBack, currentRoute: currentRoute }),
|
|
30
|
+
React.createElement(ReportsRouter, { currentRoute: currentRoute, navigateTo: navigateTo, goBack: goBack }))));
|
|
21
31
|
};
|
|
22
32
|
export default ReportsContainer;
|
|
23
33
|
//# sourceMappingURL=ReportsContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsContainer.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsContainer.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,
|
|
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,MAA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C,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:
|
|
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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportsHeader.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsHeader.tsx"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAIhD,eAAO,MAAM,aAAa;YAIhB,MAAM,IAAI;kBACJ,KAAK;iBAYpB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { RouteStep } from "./ReportsContainer";
|
|
7
|
+
import { WidgetHeader } from "./utils";
|
|
8
|
+
export const ReportsHeader = ({ goBack, currentRoute, }) => {
|
|
9
|
+
const shouldDisableReturnFn = currentRoute.step === RouteStep.ReportsList ||
|
|
10
|
+
currentRoute.step === RouteStep.ReportAction;
|
|
11
|
+
return (React.createElement(WidgetHeader, { returnFn: shouldDisableReturnFn ? undefined : goBack, title: currentRoute.title }));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=ReportsHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportsHeader.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsHeader.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,MAAM,EACN,YAAY,GAIb,EAAE,EAAE;IACH,MAAM,qBAAqB,GACzB,YAAY,CAAC,IAAI,KAAK,SAAS,CAAC,WAAW;QAC3C,YAAY,CAAC,IAAI,KAAK,SAAS,CAAC,YAAY,CAAC;IAE/C,OAAO,CACL,oBAAC,YAAY,IACX,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EACpD,KAAK,EAAE,YAAY,CAAC,KAAK,GACzB,CACH,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 React from \"react\";\nimport type { Route } from \"./ReportsContainer\";\nimport { RouteStep } from \"./ReportsContainer\";\nimport { WidgetHeader } from \"./utils\";\n\nexport const ReportsHeader = ({\n goBack,\n currentRoute,\n}: {\n goBack: () => void;\n currentRoute: Route;\n}) => {\n const shouldDisableReturnFn =\n currentRoute.step === RouteStep.ReportsList ||\n currentRoute.step === RouteStep.ReportAction;\n\n return (\n <WidgetHeader\n returnFn={shouldDisableReturnFn ? undefined : goBack}\n title={currentRoute.title}\n />\n );\n};\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Route } from "./ReportsContainer";
|
|
3
|
+
export declare const ReportsRouter: ({ currentRoute, navigateTo, goBack, }: {
|
|
4
|
+
currentRoute: Route;
|
|
5
|
+
navigateTo: (toRoute: (prev: Route | undefined) => Route) => void;
|
|
6
|
+
goBack: () => void;
|
|
7
|
+
}) => JSX.Element | null;
|
|
8
|
+
//# sourceMappingURL=ReportsRouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportsRouter.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsRouter.tsx"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGhD,eAAO,MAAM,aAAa;kBAKV,KAAK;iCACU,KAAK,GAAG,SAAS,KAAK,KAAK,KAAK,IAAI;YACzD,MAAM,IAAI;wBA0CnB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { useActiveIModelConnection } from "@itwin/appui-react";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
8
|
+
import { ReportAction } from "./ReportAction";
|
|
9
|
+
import { ReportMappings } from "./ReportMappings";
|
|
10
|
+
import { Reports } from "./Reports";
|
|
11
|
+
import { RouteStep } from "./ReportsContainer";
|
|
12
|
+
export const ReportsRouter = ({ currentRoute, navigateTo, goBack, }) => {
|
|
13
|
+
const { report } = currentRoute.reportsRoutingFields;
|
|
14
|
+
const iModelId = useActiveIModelConnection()?.iModelId ?? "";
|
|
15
|
+
switch (currentRoute.step) {
|
|
16
|
+
case RouteStep.ReportsList:
|
|
17
|
+
return (React.createElement(Reports, { onClickAddReport: () => navigateTo(() => ({
|
|
18
|
+
step: RouteStep.ReportAction,
|
|
19
|
+
title: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ITwinReports"),
|
|
20
|
+
reportsRoutingFields: {},
|
|
21
|
+
})), onClickReportTitle: (r) => {
|
|
22
|
+
navigateTo(() => ({
|
|
23
|
+
step: RouteStep.ReportMappings,
|
|
24
|
+
reportsRoutingFields: { report: r },
|
|
25
|
+
title: r.displayName,
|
|
26
|
+
}));
|
|
27
|
+
}, onClickReportModify: (r) => {
|
|
28
|
+
navigateTo(() => ({
|
|
29
|
+
step: RouteStep.ReportAction,
|
|
30
|
+
reportsRoutingFields: { report: r },
|
|
31
|
+
title: r.displayName,
|
|
32
|
+
}));
|
|
33
|
+
} }));
|
|
34
|
+
case RouteStep.ReportAction:
|
|
35
|
+
return React.createElement(ReportAction, { report: report, onClickCancel: goBack, onSaveSuccess: goBack });
|
|
36
|
+
case RouteStep.ReportMappings:
|
|
37
|
+
if (!report)
|
|
38
|
+
return null;
|
|
39
|
+
return React.createElement(ReportMappings, { report: report, onClickClose: goBack, defaultIModelId: iModelId });
|
|
40
|
+
default:
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=ReportsRouter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportsRouter.js","sourceRoot":"","sources":["../../../../src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,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,
|
|
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,9 +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 }),
|
|
24
|
-
" ")) : (React.createElement(IconButton, { styleType: "borderless", 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) },
|
|
25
24
|
React.createElement(SvgSearch, null)));
|
|
26
25
|
};
|
|
27
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,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MA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,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% {
|
|
@@ -30,4 +29,4 @@
|
|
|
30
29
|
|
|
31
30
|
.rcw-search-button {
|
|
32
31
|
float: right;
|
|
33
|
-
}
|
|
32
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import "./SelectIModel.scss";
|
|
3
3
|
interface SelectedIModelProps {
|
|
4
|
-
selectedIModelId
|
|
5
|
-
setSelectedIModelId:
|
|
4
|
+
selectedIModelId?: string;
|
|
5
|
+
setSelectedIModelId: (iModelId: string) => void;
|
|
6
6
|
}
|
|
7
7
|
export declare const SelectIModel: ({ selectedIModelId, setSelectedIModelId, }: SelectedIModelProps) => JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectIModel.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/SelectIModel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectIModel.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/SelectIModel.tsx"],"names":[],"mappings":";AAkBA,OAAO,qBAAqB,CAAC;AAoB7B,UAAU,mBAAmB;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD;AAED,eAAO,MAAM,YAAY,+CAGtB,mBAAmB,gBAqCrB,CAAC"}
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { useActiveIModelConnection } from "@itwin/appui-react";
|
|
6
1
|
import { AccessTokenAdapter } from "@itwin/imodels-access-frontend";
|
|
7
|
-
import {
|
|
2
|
+
import { toArray, } from "@itwin/imodels-client-management";
|
|
8
3
|
import { ComboBox, Label } from "@itwin/itwinui-react";
|
|
9
4
|
import React, { useEffect, useMemo, useState } from "react";
|
|
10
5
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
11
|
-
import {
|
|
6
|
+
import { useReportsConfigApi } from "../context/ReportsConfigApiContext";
|
|
12
7
|
import "./SelectIModel.scss";
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const iModelClientOptions = {
|
|
16
|
-
api: { baseUrl: generateUrl(Constants.api.baseUrl, apiContext.baseUrl) },
|
|
17
|
-
};
|
|
18
|
-
const iModelsClient = new IModelsClient(iModelClientOptions);
|
|
19
|
-
const accessToken = await apiContext.getAccessToken();
|
|
8
|
+
const fetchIModels = async (setiModels, iTwinId, iModelsClient, getAccessToken) => {
|
|
9
|
+
const accessToken = await getAccessToken();
|
|
20
10
|
const authorization = AccessTokenAdapter.toAuthorizationCallback(accessToken);
|
|
21
11
|
const getiModelListParams = {
|
|
22
12
|
urlParams: { projectId: iTwinId },
|
|
@@ -26,21 +16,11 @@ const fetchIModels = async (setiModels, iTwinId, apiContext) => {
|
|
|
26
16
|
setiModels(iModels);
|
|
27
17
|
};
|
|
28
18
|
export const SelectIModel = ({ selectedIModelId, setSelectedIModelId, }) => {
|
|
29
|
-
|
|
30
|
-
const apiConfig = useReportsApiConfig();
|
|
31
|
-
const iModelId = (_b = (_a = useActiveIModelConnection()) === null || _a === void 0 ? void 0 : _a.iModelId) !== null && _b !== void 0 ? _b : "";
|
|
32
|
-
const iTwinId = (_d = (_c = useActiveIModelConnection()) === null || _c === void 0 ? void 0 : _c.iTwinId) !== null && _d !== void 0 ? _d : "";
|
|
19
|
+
const { iTwinId, getAccessToken, iModelsClient } = useReportsConfigApi();
|
|
33
20
|
const [iModels, setIModels] = useState([]);
|
|
34
21
|
useEffect(() => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
}, [apiConfig, setIModels, iModelId, iTwinId]);
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (iModelId && iModels.length > 0) {
|
|
41
|
-
setSelectedIModelId(iModelId);
|
|
42
|
-
}
|
|
43
|
-
}, [iModelId, iModels, setSelectedIModelId]);
|
|
22
|
+
void fetchIModels(setIModels, iTwinId, iModelsClient, getAccessToken);
|
|
23
|
+
}, [getAccessToken, iModelsClient, iTwinId, setIModels]);
|
|
44
24
|
const iModelOptions = useMemo(() => {
|
|
45
25
|
return iModels.map((iModel) => ({
|
|
46
26
|
label: iModel.displayName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectIModel.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectIModel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectIModel.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectIModel.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAMpE,OAAO,EACL,OAAO,GACR,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,QAAQ,E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AO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC9B,KAAK,EAAE,MAAM,CAAC,WAAW;YACzB,KAAK,EAAE,MAAM,CAAC,EAAE;SACjB,CAAC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACL,6BAAK,SAAS,EAAC,mBAAmB;QAChC,oBAAC,KAAK,IAAC,OAAO,EAAC,aAAa,IACzB,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAClD,kCAAkC,CACnC,CACK;QACR,6BAAK,SAAS,EAAC,cAAc;YAC3B,oBAAC,QAAQ,IACP,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBAClB,mBAAmB,CAAC,KAAK,CAAC,CAAC;gBAC7B,CAAC,EACD,UAAU,EAAE;oBACV,EAAE,EAAE,aAAa;iBAClB,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GACzC,CACE,CACF,CACP,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 type { AccessToken } from \"@itwin/core-bentley\";\nimport { AccessTokenAdapter } from \"@itwin/imodels-access-frontend\";\nimport type {\n GetIModelListParams,\n IModelsClient,\n MinimalIModel,\n} from \"@itwin/imodels-client-management\";\nimport {\n toArray,\n} from \"@itwin/imodels-client-management\";\nimport { ComboBox, Label } from \"@itwin/itwinui-react\";\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\nimport { useReportsConfigApi } from \"../context/ReportsConfigApiContext\";\nimport \"./SelectIModel.scss\";\n\nconst fetchIModels = async (\n setiModels: React.Dispatch<React.SetStateAction<MinimalIModel[]>>,\n iTwinId: string,\n iModelsClient: IModelsClient,\n getAccessToken: () => Promise<AccessToken>\n) => {\n const accessToken = await getAccessToken();\n const authorization = AccessTokenAdapter.toAuthorizationCallback(accessToken);\n const getiModelListParams: GetIModelListParams = {\n urlParams: { projectId: iTwinId },\n authorization,\n };\n const iModels = await toArray(\n iModelsClient.iModels.getMinimalList(getiModelListParams)\n );\n setiModels(iModels);\n};\n\ninterface SelectedIModelProps {\n selectedIModelId?: string;\n setSelectedIModelId: (iModelId: string) => void;\n}\n\nexport const SelectIModel = ({\n selectedIModelId,\n setSelectedIModelId,\n}: SelectedIModelProps) => {\n const { iTwinId, getAccessToken, iModelsClient } = useReportsConfigApi();\n const [iModels, setIModels] = useState<MinimalIModel[]>([]);\n\n useEffect(() => {\n void fetchIModels(setIModels, iTwinId, iModelsClient, getAccessToken);\n }, [getAccessToken, iModelsClient, iTwinId, setIModels]);\n\n const iModelOptions = useMemo(() => {\n return iModels.map((iModel) => ({\n label: iModel.displayName,\n value: iModel.id,\n }));\n }, [iModels]);\n\n return (\n <div className=\"rcw-select-imodel\">\n <Label htmlFor=\"combo-input\">\n {ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:SelectIModel\"\n )}\n </Label>\n <div className=\"rcw-combobox\">\n <ComboBox<string>\n options={iModelOptions}\n value={selectedIModelId}\n onChange={(value) => {\n setSelectedIModelId(value);\n }}\n inputProps={{\n id: \"combo-input\",\n }}\n style={{ flexGrow: 1, maxWidth: \"395px\" }}\n />\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -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:
|
|
8
|
+
margin-bottom: calc(var(--iui-size-s) * 2);
|
|
10
9
|
|
|
11
10
|
.rcw-combobox {
|
|
12
11
|
display: flex;
|
|
13
|
-
gap:
|
|
12
|
+
gap: var(--iui-size-xs);
|
|
14
13
|
width: 100%;
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
export interface WidgetHeaderProps {
|
|
4
4
|
title: string;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
-
returnFn?: () =>
|
|
6
|
+
returnFn?: () => void;
|
|
7
7
|
}
|
|
8
8
|
export declare const WidgetHeader: ({ title, disabled, returnFn, }: WidgetHeaderProps) => JSX.Element;
|
|
9
9
|
export declare const handleError: (errorStatus: number) => void;
|
|
@@ -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,
|
|
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 {
|
|
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(
|
|
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
|
};
|