@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
|
@@ -0,0 +1,27 @@
|
|
|
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 type { Route } from "./ReportsContainer";
|
|
7
|
+
import { RouteStep } from "./ReportsContainer";
|
|
8
|
+
import { WidgetHeader } from "./utils";
|
|
9
|
+
|
|
10
|
+
export const ReportsHeader = ({
|
|
11
|
+
goBack,
|
|
12
|
+
currentRoute,
|
|
13
|
+
}: {
|
|
14
|
+
goBack: () => void;
|
|
15
|
+
currentRoute: Route;
|
|
16
|
+
}) => {
|
|
17
|
+
const shouldDisableReturnFn =
|
|
18
|
+
currentRoute.step === RouteStep.ReportsList ||
|
|
19
|
+
currentRoute.step === RouteStep.ReportAction;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<WidgetHeader
|
|
23
|
+
returnFn={shouldDisableReturnFn ? undefined : goBack}
|
|
24
|
+
title={currentRoute.title}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
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 type { Route } from "./ReportsContainer";
|
|
12
|
+
import { RouteStep } from "./ReportsContainer";
|
|
13
|
+
|
|
14
|
+
export const ReportsRouter = ({
|
|
15
|
+
currentRoute,
|
|
16
|
+
navigateTo,
|
|
17
|
+
goBack,
|
|
18
|
+
}: {
|
|
19
|
+
currentRoute: Route;
|
|
20
|
+
navigateTo: (toRoute: (prev: Route | undefined) => Route) => void;
|
|
21
|
+
goBack: () => void;
|
|
22
|
+
}) => {
|
|
23
|
+
const { report } = currentRoute.reportsRoutingFields;
|
|
24
|
+
const iModelId = useActiveIModelConnection()?.iModelId ?? "";
|
|
25
|
+
switch (currentRoute.step) {
|
|
26
|
+
case RouteStep.ReportsList:
|
|
27
|
+
return (
|
|
28
|
+
<Reports
|
|
29
|
+
onClickAddReport={() =>
|
|
30
|
+
navigateTo(() => ({
|
|
31
|
+
step: RouteStep.ReportAction,
|
|
32
|
+
title: ReportsConfigWidget.localization.getLocalizedString(
|
|
33
|
+
"ReportsConfigWidget:ITwinReports"
|
|
34
|
+
),
|
|
35
|
+
reportsRoutingFields: {},
|
|
36
|
+
}))
|
|
37
|
+
}
|
|
38
|
+
onClickReportTitle={(r) => {
|
|
39
|
+
navigateTo(() => ({
|
|
40
|
+
step: RouteStep.ReportMappings,
|
|
41
|
+
reportsRoutingFields: { report: r },
|
|
42
|
+
title: r.displayName,
|
|
43
|
+
}));
|
|
44
|
+
}}
|
|
45
|
+
onClickReportModify={(r) => {
|
|
46
|
+
navigateTo(() => ({
|
|
47
|
+
step: RouteStep.ReportAction,
|
|
48
|
+
reportsRoutingFields: { report: r },
|
|
49
|
+
title: r.displayName,
|
|
50
|
+
}));
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
case RouteStep.ReportAction:
|
|
56
|
+
return <ReportAction report={report} onClickCancel={goBack} onSaveSuccess={goBack} />;
|
|
57
|
+
case RouteStep.ReportMappings:
|
|
58
|
+
if (!report) return null;
|
|
59
|
+
return <ReportMappings report={report} onClickClose={goBack} defaultIModelId={iModelId} />;
|
|
60
|
+
default:
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -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
|
+
}
|
|
@@ -44,6 +44,7 @@ export const SearchBar = ({
|
|
|
44
44
|
<IconButton
|
|
45
45
|
onClick={() => setSearchBarClosing(true)}
|
|
46
46
|
styleType="borderless"
|
|
47
|
+
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ClearSearch")}
|
|
47
48
|
>
|
|
48
49
|
<SvgCloseSmall />
|
|
49
50
|
</IconButton>
|
|
@@ -52,10 +53,14 @@ export const SearchBar = ({
|
|
|
52
53
|
value={searchValue}
|
|
53
54
|
onChange={(e) => setSearchValue(e.target.value)}
|
|
54
55
|
disabled={disabled}
|
|
55
|
-
/>
|
|
56
|
+
/>
|
|
56
57
|
</div>
|
|
57
58
|
) : (
|
|
58
|
-
<IconButton
|
|
59
|
+
<IconButton
|
|
60
|
+
styleType="borderless"
|
|
61
|
+
data-testid="rcw-search-button"
|
|
62
|
+
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:SearchReport")}
|
|
63
|
+
onClick={() => setSearchBarOpened(true)}>
|
|
59
64
|
<SvgSearch />
|
|
60
65
|
</IconButton>
|
|
61
66
|
);
|
|
@@ -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
|
}
|
|
@@ -2,37 +2,29 @@
|
|
|
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 {
|
|
5
|
+
import type { AccessToken } from "@itwin/core-bentley";
|
|
6
6
|
import { AccessTokenAdapter } from "@itwin/imodels-access-frontend";
|
|
7
7
|
import type {
|
|
8
8
|
GetIModelListParams,
|
|
9
|
-
|
|
9
|
+
IModelsClient,
|
|
10
10
|
MinimalIModel,
|
|
11
11
|
} from "@itwin/imodels-client-management";
|
|
12
12
|
import {
|
|
13
|
-
Constants,
|
|
14
|
-
IModelsClient,
|
|
15
13
|
toArray,
|
|
16
14
|
} from "@itwin/imodels-client-management";
|
|
17
15
|
import { ComboBox, Label } from "@itwin/itwinui-react";
|
|
18
16
|
import React, { useEffect, useMemo, useState } from "react";
|
|
19
17
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
20
|
-
import
|
|
21
|
-
import { useReportsApiConfig } from "../context/ReportsApiConfigContext";
|
|
18
|
+
import { useReportsConfigApi } from "../context/ReportsConfigApiContext";
|
|
22
19
|
import "./SelectIModel.scss";
|
|
23
|
-
import { generateUrl } from "./utils";
|
|
24
20
|
|
|
25
21
|
const fetchIModels = async (
|
|
26
22
|
setiModels: React.Dispatch<React.SetStateAction<MinimalIModel[]>>,
|
|
27
23
|
iTwinId: string,
|
|
28
|
-
|
|
24
|
+
iModelsClient: IModelsClient,
|
|
25
|
+
getAccessToken: () => Promise<AccessToken>
|
|
29
26
|
) => {
|
|
30
|
-
const
|
|
31
|
-
api: { baseUrl: generateUrl(Constants.api.baseUrl, apiContext.baseUrl) },
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const iModelsClient: IModelsClient = new IModelsClient(iModelClientOptions);
|
|
35
|
-
const accessToken = await apiContext.getAccessToken();
|
|
27
|
+
const accessToken = await getAccessToken();
|
|
36
28
|
const authorization = AccessTokenAdapter.toAuthorizationCallback(accessToken);
|
|
37
29
|
const getiModelListParams: GetIModelListParams = {
|
|
38
30
|
urlParams: { projectId: iTwinId },
|
|
@@ -45,30 +37,20 @@ const fetchIModels = async (
|
|
|
45
37
|
};
|
|
46
38
|
|
|
47
39
|
interface SelectedIModelProps {
|
|
48
|
-
selectedIModelId
|
|
49
|
-
setSelectedIModelId:
|
|
40
|
+
selectedIModelId?: string;
|
|
41
|
+
setSelectedIModelId: (iModelId: string) => void;
|
|
50
42
|
}
|
|
51
43
|
|
|
52
44
|
export const SelectIModel = ({
|
|
53
45
|
selectedIModelId,
|
|
54
46
|
setSelectedIModelId,
|
|
55
47
|
}: SelectedIModelProps) => {
|
|
56
|
-
const
|
|
57
|
-
const iModelId = useActiveIModelConnection()?.iModelId ?? "";
|
|
58
|
-
const iTwinId = useActiveIModelConnection()?.iTwinId ?? "";
|
|
48
|
+
const { iTwinId, getAccessToken, iModelsClient } = useReportsConfigApi();
|
|
59
49
|
const [iModels, setIModels] = useState<MinimalIModel[]>([]);
|
|
60
50
|
|
|
61
51
|
useEffect(() => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
}, [apiConfig, setIModels, iModelId, iTwinId]);
|
|
66
|
-
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
if (iModelId && iModels.length > 0) {
|
|
69
|
-
setSelectedIModelId(iModelId);
|
|
70
|
-
}
|
|
71
|
-
}, [iModelId, iModels, setSelectedIModelId]);
|
|
52
|
+
void fetchIModels(setIModels, iTwinId, iModelsClient, getAccessToken);
|
|
53
|
+
}, [getAccessToken, iModelsClient, iTwinId, setIModels]);
|
|
72
54
|
|
|
73
55
|
const iModelOptions = useMemo(() => {
|
|
74
56
|
return iModels.map((iModel) => ({
|
|
@@ -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:
|
|
12
|
-
|
|
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:
|
|
40
|
+
gap: var(--iui-size-s);
|
|
33
41
|
height: 100%;
|
|
34
42
|
}
|
|
35
43
|
|
|
36
44
|
.rcw-skeleton-block {
|
|
37
|
-
height:
|
|
45
|
+
height: calc(var(--iui-size-s) * 3);
|
|
38
46
|
width: 100%;
|
|
39
47
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { SvgChevronLeft } from "@itwin/itwinui-icons-react";
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
Icon,
|
|
8
8
|
ProgressRadial,
|
|
9
9
|
Text,
|
|
10
10
|
toaster,
|
|
@@ -16,7 +16,7 @@ import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
|
16
16
|
export interface WidgetHeaderProps {
|
|
17
17
|
title: string;
|
|
18
18
|
disabled?: boolean;
|
|
19
|
-
returnFn?: () =>
|
|
19
|
+
returnFn?: () => void;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const WidgetHeader = ({
|
|
@@ -27,13 +27,14 @@ export const WidgetHeader = ({
|
|
|
27
27
|
return (
|
|
28
28
|
<div className="rcw-widget-header-container">
|
|
29
29
|
{returnFn && (
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
<Icon
|
|
31
|
+
className={`${disabled ? "rcw-chevron-disabled" : "rcw-chevron"}`}
|
|
32
|
+
onClick={disabled ? undefined : returnFn}
|
|
33
|
+
size="large"
|
|
34
|
+
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Back")}
|
|
34
35
|
>
|
|
35
36
|
<SvgChevronLeft />
|
|
36
|
-
</
|
|
37
|
+
</Icon>
|
|
37
38
|
)}
|
|
38
39
|
<Text className="rcw-title" variant="title">
|
|
39
40
|
{title}
|
|
@@ -5,22 +5,21 @@
|
|
|
5
5
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { createContext } from "react";
|
|
8
|
+
import type { BulkExtractor } from "../components/BulkExtractor";
|
|
8
9
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export type GetAccessTokenFn = () => Promise<AccessToken>;
|
|
11
|
+
|
|
12
|
+
export interface BulkExtractorContextProps {
|
|
13
|
+
bulkExtractor?: BulkExtractor;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
export const
|
|
15
|
-
getAccessToken: async () => "",
|
|
16
|
-
baseUrl: "",
|
|
17
|
-
});
|
|
16
|
+
export const BulkExtractorContext = createContext<BulkExtractorContextProps>({});
|
|
18
17
|
|
|
19
|
-
export const
|
|
20
|
-
const context = React.useContext(
|
|
18
|
+
export const useBulkExtractor = () => {
|
|
19
|
+
const context = React.useContext(BulkExtractorContext);
|
|
21
20
|
if (!context) {
|
|
22
21
|
throw new Error(
|
|
23
|
-
"
|
|
22
|
+
"useBulkExtractor should be used within a BulkExtractorContext provider"
|
|
24
23
|
);
|
|
25
24
|
}
|
|
26
25
|
return context;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 type { AccessToken } from "@itwin/core-bentley";
|
|
6
|
+
import { IModelsClient } from "@itwin/imodels-client-management";
|
|
7
|
+
import { MappingsClient, ReportsClient } from "@itwin/insights-client";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { createContext } from "react";
|
|
10
|
+
|
|
11
|
+
export type GetAccessTokenFn = () => Promise<AccessToken>;
|
|
12
|
+
|
|
13
|
+
export interface ReportsConfigApiProps {
|
|
14
|
+
getAccessToken: GetAccessTokenFn;
|
|
15
|
+
iTwinId: string;
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
reportsClient: ReportsClient;
|
|
18
|
+
mappingsClient: MappingsClient;
|
|
19
|
+
iModelsClient: IModelsClient;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const ReportsConfigApiContext = createContext<ReportsConfigApiProps>({
|
|
23
|
+
getAccessToken: async () => "",
|
|
24
|
+
iTwinId: "",
|
|
25
|
+
baseUrl: "",
|
|
26
|
+
reportsClient: new ReportsClient(),
|
|
27
|
+
mappingsClient: new MappingsClient(),
|
|
28
|
+
iModelsClient: new IModelsClient(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const useReportsConfigApi = () => {
|
|
32
|
+
const context = React.useContext(ReportsConfigApiContext);
|
|
33
|
+
if (!context) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
"useReportsConfigApi should be used within a ReportsConfigApiContext provider"
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return context;
|
|
39
|
+
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AccessToken } from "@itwin/core-bentley";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
export interface ReportsApiConfig {
|
|
4
|
-
getAccessToken: () => Promise<AccessToken>;
|
|
5
|
-
baseUrl: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const ReportsApiConfigContext: React.Context<ReportsApiConfig>;
|
|
8
|
-
export declare const useReportsApiConfig: () => ReportsApiConfig;
|
|
9
|
-
//# sourceMappingURL=ReportsApiConfigContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsApiConfigContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/ReportsApiConfigContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,uBAAuB,iCAGlC,CAAC;AAEH,eAAO,MAAM,mBAAmB,wBAQ/B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsApiConfigContext.js","sourceRoot":"","sources":["../../../../src/widget/context/ReportsApiConfigContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKA,6CAA+B;AAC/B,iCAAsC;AAOzB,QAAA,uBAAuB,GAAG,qBAAa,CAAmB;IACrE,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;IAC9B,OAAO,EAAE,EAAE;CACZ,CAAC,CAAC;AAEI,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,+BAAuB,CAAC,CAAC;IAC1D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,mBAAmB,uBAQ9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport * as React from \"react\";\nimport { createContext } from \"react\";\n\nexport interface ReportsApiConfig {\n getAccessToken: () => Promise<AccessToken>;\n baseUrl: string;\n}\n\nexport const ReportsApiConfigContext = createContext<ReportsApiConfig>({\n getAccessToken: async () => \"\",\n baseUrl: \"\",\n});\n\nexport const useReportsApiConfig = () => {\n const context = React.useContext(ReportsApiConfigContext);\n if (!context) {\n throw new Error(\n \"useApiConfig should be used within a ReportsApiConfigContext provider\"\n );\n }\n return context;\n};\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AccessToken } from "@itwin/core-bentley";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
export interface ReportsApiConfig {
|
|
4
|
-
getAccessToken: () => Promise<AccessToken>;
|
|
5
|
-
baseUrl: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const ReportsApiConfigContext: React.Context<ReportsApiConfig>;
|
|
8
|
-
export declare const useReportsApiConfig: () => ReportsApiConfig;
|
|
9
|
-
//# sourceMappingURL=ReportsApiConfigContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsApiConfigContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/ReportsApiConfigContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,uBAAuB,iCAGlC,CAAC;AAEH,eAAO,MAAM,mBAAmB,wBAQ/B,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { createContext } from "react";
|
|
3
|
-
export const ReportsApiConfigContext = createContext({
|
|
4
|
-
getAccessToken: async () => "",
|
|
5
|
-
baseUrl: "",
|
|
6
|
-
});
|
|
7
|
-
export const useReportsApiConfig = () => {
|
|
8
|
-
const context = React.useContext(ReportsApiConfigContext);
|
|
9
|
-
if (!context) {
|
|
10
|
-
throw new Error("useApiConfig should be used within a ReportsApiConfigContext provider");
|
|
11
|
-
}
|
|
12
|
-
return context;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=ReportsApiConfigContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsApiConfigContext.js","sourceRoot":"","sources":["../../../../src/widget/context/ReportsApiConfigContext.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAOtC,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAmB;IACrE,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;IAC9B,OAAO,EAAE,EAAE;CACZ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAC1D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport * as React from \"react\";\nimport { createContext } from \"react\";\n\nexport interface ReportsApiConfig {\n getAccessToken: () => Promise<AccessToken>;\n baseUrl: string;\n}\n\nexport const ReportsApiConfigContext = createContext<ReportsApiConfig>({\n getAccessToken: async () => \"\",\n baseUrl: \"\",\n});\n\nexport const useReportsApiConfig = () => {\n const context = React.useContext(ReportsApiConfigContext);\n if (!context) {\n throw new Error(\n \"useApiConfig should be used within a ReportsApiConfigContext provider\"\n );\n }\n return context;\n};\n"]}
|