@itwin/reports-config-widget-react 0.5.0 → 0.7.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/CHANGELOG.json +76 -1
- package/CHANGELOG.md +27 -2
- package/LICENSE.md +9 -9
- package/README.md +38 -38
- package/__mocks__/fileMock.js +4 -4
- package/api/reports-config-widget-react.api.md +126 -0
- package/api/reports-config-widget-react.exports.csv +14 -0
- package/api/temp/reports-config-widget-react.api.md +126 -0
- package/coverage/clover.xml +521 -521
- package/coverage/coverage-final.json +32 -32
- package/coverage/lcov-report/index.html +31 -31
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +15 -15
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/test/index.html +11 -11
- package/coverage/lcov-report/src/test/test-utils.tsx.html +46 -16
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +29 -86
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +5 -38
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +25 -121
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +120 -96
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +5 -5
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +13 -103
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +7 -22
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +7 -28
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +20 -47
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +20 -11
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +16 -79
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +15 -108
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +36 -75
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +62 -92
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +104 -128
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +88 -301
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +42 -204
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +164 -50
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +15 -63
- package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +8 -47
- package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +6 -12
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +13 -25
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +11 -56
- package/coverage/lcov-report/src/widget/components/index.html +50 -50
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +25 -169
- package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +6 -12
- package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +10 -13
- package/coverage/lcov-report/src/widget/context/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +12 -54
- package/coverage/lcov-report/src/widget/index.html +13 -13
- package/coverage/lcov.info +941 -919
- package/jest.config.js +14 -17
- package/lib/cjs/ReportsConfigWidget.d.ts +4 -0
- package/lib/cjs/ReportsConfigWidget.d.ts.map +1 -1
- package/lib/cjs/ReportsConfigWidget.js +4 -0
- package/lib/cjs/ReportsConfigWidget.js.map +1 -1
- package/lib/cjs/reports-config-widget-react.d.ts +1 -0
- package/lib/cjs/reports-config-widget-react.d.ts.map +1 -1
- package/lib/cjs/reports-config-widget-react.js +4 -3
- package/lib/cjs/reports-config-widget-react.js.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.js +11 -10
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
- package/lib/cjs/test/BulkExtractor.test.js +68 -43
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
- package/lib/cjs/test/DeleteModal.test.js +3 -3
- package/lib/cjs/test/DeleteModal.test.js.map +1 -1
- package/lib/cjs/test/ReportAction.test.js +6 -4
- package/lib/cjs/test/ReportAction.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +64 -25
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/cjs/test/ReportMappings.test.js +39 -18
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +3 -3
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +3 -3
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/test-utils.d.ts +8 -0
- package/lib/cjs/test/test-utils.d.ts.map +1 -1
- package/lib/cjs/test/test-utils.js +16 -4
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +10 -4
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +11 -7
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js +7 -7
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.scss +1 -1
- package/lib/cjs/widget/components/BulkExtractor.d.ts +8 -5
- package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.js +52 -35
- package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
- package/lib/cjs/widget/components/Constants.d.ts.map +1 -1
- package/lib/cjs/widget/components/Constants.js +3 -3
- package/lib/cjs/widget/components/Constants.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js +5 -5
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.scss +2 -2
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.js +9 -9
- package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.scss +1 -1
- package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionToast.js +3 -3
- package/lib/cjs/widget/components/ExtractionToast.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.js +1 -2
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.scss +1 -4
- package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.d.ts +8 -0
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js +9 -7
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.scss +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js +4 -4
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +46 -45
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts +8 -0
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js +25 -11
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/Reports.d.ts +9 -1
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js +7 -8
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/Reports.scss +0 -1
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts +34 -4
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.js +27 -9
- package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.d.ts +3 -6
- package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js +7 -5
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.scss +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsHeader.js +6 -7
- package/lib/cjs/widget/components/ReportsHeader.js.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.js +3 -3
- package/lib/cjs/widget/components/ReportsRouter.js.map +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/cjs/widget/components/SearchBar.js +4 -4
- package/lib/cjs/widget/components/SearchBar.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +1 -1
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.scss +1 -1
- 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 +5 -5
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts +3 -3
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.d.ts +1 -4
- package/lib/cjs/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.js +3 -3
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
- package/lib/esm/ReportsConfigWidget.d.ts +4 -0
- package/lib/esm/ReportsConfigWidget.d.ts.map +1 -1
- package/lib/esm/ReportsConfigWidget.js +4 -0
- package/lib/esm/ReportsConfigWidget.js.map +1 -1
- package/lib/esm/reports-config-widget-react.d.ts +1 -0
- package/lib/esm/reports-config-widget-react.d.ts.map +1 -1
- package/lib/esm/reports-config-widget-react.js +4 -3
- package/lib/esm/reports-config-widget-react.js.map +1 -1
- package/lib/esm/test/AddMappingModal.test.js +12 -11
- package/lib/esm/test/AddMappingModal.test.js.map +1 -1
- package/lib/esm/test/BulkExtractor.test.js +69 -44
- package/lib/esm/test/BulkExtractor.test.js.map +1 -1
- package/lib/esm/test/DeleteModal.test.js +4 -4
- package/lib/esm/test/DeleteModal.test.js.map +1 -1
- package/lib/esm/test/ReportAction.test.js +7 -5
- package/lib/esm/test/ReportAction.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +65 -26
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/esm/test/ReportMappings.test.js +41 -20
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +4 -4
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +3 -3
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/test-utils.d.ts +8 -0
- package/lib/esm/test/test-utils.d.ts.map +1 -1
- package/lib/esm/test/test-utils.js +15 -3
- package/lib/esm/test/test-utils.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts +10 -4
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.js +12 -8
- package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/esm/widget/components/ActionPanel.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.js +7 -7
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.scss +1 -1
- package/lib/esm/widget/components/BulkExtractor.d.ts +8 -5
- package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.js +53 -36
- package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
- package/lib/esm/widget/components/Constants.d.ts.map +1 -1
- package/lib/esm/widget/components/Constants.js +3 -3
- package/lib/esm/widget/components/Constants.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/esm/widget/components/DeleteModal.js +6 -6
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.scss +2 -2
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.js +9 -9
- package/lib/esm/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.scss +1 -1
- package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionToast.js +3 -3
- package/lib/esm/widget/components/ExtractionToast.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.js +1 -2
- package/lib/esm/widget/components/HorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.scss +1 -4
- package/lib/esm/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.d.ts +8 -0
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.js +10 -8
- package/lib/esm/widget/components/ReportAction.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.scss +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.js +6 -6
- package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js +47 -46
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.d.ts +8 -0
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js +28 -14
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/Reports.d.ts +9 -1
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js +8 -9
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/Reports.scss +0 -1
- package/lib/esm/widget/components/ReportsConfigContext.d.ts +34 -4
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.js +28 -10
- package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.d.ts +3 -6
- package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.js +7 -5
- package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.scss +1 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts +1 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsHeader.js +6 -7
- package/lib/esm/widget/components/ReportsHeader.js.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.js +3 -3
- package/lib/esm/widget/components/ReportsRouter.js.map +1 -1
- package/lib/esm/widget/components/SearchBar.d.ts +1 -1
- package/lib/esm/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/esm/widget/components/SearchBar.js +4 -4
- package/lib/esm/widget/components/SearchBar.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.d.ts +1 -1
- package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/esm/widget/components/SelectIModel.js +2 -2
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.scss +1 -1
- 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 +6 -6
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts +3 -3
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/esm/widget/hooks/useValidator.d.ts +1 -4
- package/lib/esm/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/esm/widget/hooks/useValidator.js +3 -3
- package/lib/esm/widget/hooks/useValidator.js.map +1 -1
- package/package.json +9 -4
- package/src/ReportsConfigWidget.ts +9 -9
- package/src/reports-config-widget-react.ts +4 -3
- package/src/test/AddMappingModal.test.tsx +45 -70
- package/src/test/BulkExtractor.test.ts +73 -118
- package/src/test/DeleteModal.test.tsx +6 -23
- package/src/test/ReportAction.test.tsx +20 -38
- package/src/test/ReportMappingHorizontalTile.test.tsx +137 -106
- package/src/test/ReportMappings.test.tsx +73 -88
- package/src/test/Reports.test.tsx +30 -64
- package/src/test/WidgetHeader.test.tsx +3 -3
- package/src/test/test-utils.tsx +18 -8
- package/src/widget/ReportsConfigUiProvider.tsx +18 -37
- package/src/widget/components/ActionPanel.tsx +3 -14
- package/src/widget/components/AddMappingsModal.scss +1 -1
- package/src/widget/components/AddMappingsModal.tsx +21 -53
- package/src/widget/components/BulkExtractor.ts +67 -59
- package/src/widget/components/Constants.ts +4 -4
- package/src/widget/components/DeleteModal.scss +2 -2
- package/src/widget/components/DeleteModal.tsx +11 -41
- package/src/widget/components/ExtractionStates/FailedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/QueuedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/RunningExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/StartingExtractionState.tsx +4 -11
- package/src/widget/components/ExtractionStates/SucceededExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStatus.scss +1 -1
- package/src/widget/components/ExtractionStatus.tsx +9 -18
- package/src/widget/components/ExtractionToast.tsx +12 -9
- package/src/widget/components/HorizontalTile.scss +1 -4
- package/src/widget/components/HorizontalTile.tsx +12 -33
- package/src/widget/components/LocalizedTablePaginator.tsx +13 -44
- package/src/widget/components/ReportAction.scss +1 -1
- package/src/widget/components/ReportAction.tsx +26 -39
- package/src/widget/components/ReportHorizontalTile.tsx +45 -55
- package/src/widget/components/ReportMappingHorizontalTile.tsx +70 -78
- package/src/widget/components/ReportMappings.tsx +61 -132
- package/src/widget/components/Reports.scss +0 -1
- package/src/widget/components/Reports.tsx +30 -84
- package/src/widget/components/ReportsConfigContext.tsx +70 -32
- package/src/widget/components/ReportsContainer.scss +1 -1
- package/src/widget/components/ReportsContainer.tsx +12 -28
- package/src/widget/components/ReportsHeader.tsx +6 -19
- package/src/widget/components/ReportsRouter.tsx +4 -6
- package/src/widget/components/SearchBar.tsx +9 -13
- package/src/widget/components/SelectIModel.scss +1 -1
- package/src/widget/components/SelectIModel.tsx +9 -24
- package/src/widget/components/utils.scss +1 -1
- package/src/widget/components/utils.tsx +21 -69
- package/src/widget/context/BulkExtractorContext.tsx +4 -6
- package/src/widget/context/ReportsConfigApiContext.tsx +7 -8
- package/src/widget/hooks/useValidator.ts +10 -24
- package/tsconfig.json +11 -11
|
@@ -1,18 +1,48 @@
|
|
|
1
1
|
import { IModelsClient } from "@itwin/imodels-client-management";
|
|
2
|
-
import {
|
|
2
|
+
import type { IExtractionClient, IMappingsClient, IReportsClient } from "@itwin/insights-client";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import type { GetAccessTokenFn } from "../context/ReportsConfigApiContext";
|
|
5
5
|
import { BulkExtractor } from "./BulkExtractor";
|
|
6
|
+
/**
|
|
7
|
+
* Props for the {@link ReportsConfigContext} component.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
6
10
|
export interface ReportsConfigContextProps {
|
|
11
|
+
/**
|
|
12
|
+
* A callback function that returns an access token for authenticating API requests.
|
|
13
|
+
* If not specified, it defaults to the authorizationClient of the IModelApp.
|
|
14
|
+
*/
|
|
7
15
|
getAccessToken?: GetAccessTokenFn;
|
|
16
|
+
/**
|
|
17
|
+
* The base URL for the API requests. Defaults to https://api.bentley.com.
|
|
18
|
+
*/
|
|
8
19
|
baseUrl?: string;
|
|
9
20
|
iTwinId: string;
|
|
21
|
+
/**
|
|
22
|
+
* The bulk extractor instance to use for extracting data. Internal use only.
|
|
23
|
+
*/
|
|
10
24
|
bulkExtractor?: BulkExtractor;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
25
|
+
/**
|
|
26
|
+
* A custom implementation of ReportsClient. If provided, baseUrl is ignored.
|
|
27
|
+
*/
|
|
28
|
+
reportsClient?: IReportsClient;
|
|
29
|
+
/**
|
|
30
|
+
* A custom implementation of MappingsClient. If provided, baseUrl is ignored.
|
|
31
|
+
*/
|
|
32
|
+
mappingsClient?: IMappingsClient;
|
|
33
|
+
/**
|
|
34
|
+
* A custom implementation of ExtractionClient. If provided, baseUrl is ignored.
|
|
35
|
+
*/
|
|
36
|
+
extractionClient?: IExtractionClient;
|
|
37
|
+
/**
|
|
38
|
+
* A custom implementation of IModelsClient. If provided, baseUrl is ignored.
|
|
39
|
+
*/
|
|
14
40
|
iModelsClient?: IModelsClient;
|
|
15
41
|
children?: React.ReactNode;
|
|
16
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Reports Config context providers required for all components.
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
17
47
|
export declare const ReportsConfigContext: (props: ReportsConfigContextProps) => JSX.Element;
|
|
18
48
|
//# sourceMappingURL=ReportsConfigContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsConfigContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsConfigContext.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ReportsConfigContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsConfigContext.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGjG,OAAO,KAAoD,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,gBAAgB,EAAyB,MAAM,oCAAoC,CAAC;AAGlG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;OAEG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B;;OAEG;IACH,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC;;OAEG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAID;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAAW,yBAAyB,gBAqEpE,CAAC"}
|
|
@@ -25,9 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ReportsConfigContext = void 0;
|
|
27
27
|
/*---------------------------------------------------------------------------------------------
|
|
28
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
-
*--------------------------------------------------------------------------------------------*/
|
|
28
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
+
*--------------------------------------------------------------------------------------------*/
|
|
31
31
|
const core_frontend_1 = require("@itwin/core-frontend");
|
|
32
32
|
const imodels_client_management_1 = require("@itwin/imodels-client-management");
|
|
33
33
|
const insights_client_1 = require("@itwin/insights-client");
|
|
@@ -41,8 +41,13 @@ const Constants_1 = require("./Constants");
|
|
|
41
41
|
const ExtractionToast_1 = require("./ExtractionToast");
|
|
42
42
|
const utils_1 = require("./utils");
|
|
43
43
|
const authorizationClientGetAccessToken = async () => (await core_frontend_1.IModelApp.authorizationClient?.getAccessToken()) ?? "";
|
|
44
|
+
/**
|
|
45
|
+
* Reports Config context providers required for all components.
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
44
48
|
const ReportsConfigContext = (props) => {
|
|
45
49
|
const reportsBaseUrl = (0, react_1.useCallback)(() => (0, utils_1.generateUrl)(insights_client_1.REPORTING_BASE_PATH, props.baseUrl || ReportsConfigUiProvider_1.REPORTS_CONFIG_BASE_URL), [props.baseUrl]);
|
|
50
|
+
const groupingMappingBaseUrl = (0, react_1.useCallback)(() => (0, utils_1.generateUrl)(insights_client_1.GROUPING_AND_MAPPING_BASE_PATH, props.baseUrl || ReportsConfigUiProvider_1.REPORTS_CONFIG_BASE_URL), [props.baseUrl]);
|
|
46
51
|
const iModelClientOptions = (0, react_1.useMemo)(() => ({
|
|
47
52
|
api: { baseUrl: (0, utils_1.generateUrl)(Constants_1.IMODELS_BASE_URL, props.baseUrl ?? ReportsConfigUiProvider_1.REPORTS_CONFIG_BASE_URL) },
|
|
48
53
|
}), [props.baseUrl]);
|
|
@@ -52,31 +57,44 @@ const ReportsConfigContext = (props) => {
|
|
|
52
57
|
baseUrl: reportsBaseUrl(),
|
|
53
58
|
iTwinId: props.iTwinId,
|
|
54
59
|
reportsClient: props.reportsClient ?? new insights_client_1.ReportsClient(reportsBaseUrl()),
|
|
55
|
-
mappingsClient: props.mappingsClient ?? new insights_client_1.MappingsClient(
|
|
60
|
+
mappingsClient: props.mappingsClient ?? new insights_client_1.MappingsClient(undefined, groupingMappingBaseUrl()),
|
|
56
61
|
iModelsClient: props.iModelsClient ?? new imodels_client_management_1.IModelsClient(iModelClientOptions),
|
|
57
62
|
});
|
|
58
63
|
(0, react_1.useEffect)(() => {
|
|
59
64
|
if (!props.extractionClient) {
|
|
60
|
-
setExtractionClient(props.extractionClient ?? new insights_client_1.ExtractionClient(
|
|
65
|
+
setExtractionClient(props.extractionClient ?? new insights_client_1.ExtractionClient(undefined, groupingMappingBaseUrl()));
|
|
61
66
|
}
|
|
62
|
-
}, [props.extractionClient
|
|
67
|
+
}, [groupingMappingBaseUrl, props.extractionClient]);
|
|
63
68
|
const successfulExtractionToast = (iModelName, odataFeedUrl) => {
|
|
64
69
|
itwinui_react_1.toaster.positive(react_1.default.createElement(ExtractionToast_1.SuccessfulExtractionToast, { iModelName: iModelName, odataFeedUrl: odataFeedUrl }));
|
|
65
70
|
};
|
|
66
71
|
const failedExtractionToast = (iModelName) => {
|
|
67
72
|
itwinui_react_1.toaster.negative(react_1.default.createElement(ExtractionToast_1.FailedExtractionToast, { iModelName: iModelName }));
|
|
68
73
|
};
|
|
69
|
-
const bulkExtractor = (0, react_1.useMemo)(() => ({
|
|
74
|
+
const bulkExtractor = (0, react_1.useMemo)(() => ({
|
|
75
|
+
bulkExtractor: props.bulkExtractor ??
|
|
76
|
+
new BulkExtractor_1.BulkExtractor(apiConfig.reportsClient, extractionClient, apiConfig.getAccessToken, successfulExtractionToast, failedExtractionToast),
|
|
77
|
+
}), [apiConfig.getAccessToken, apiConfig.reportsClient, extractionClient, props.bulkExtractor]);
|
|
70
78
|
(0, react_1.useEffect)(() => {
|
|
71
79
|
setApiConfig(() => ({
|
|
72
80
|
getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,
|
|
73
81
|
baseUrl: props.baseUrl || ReportsConfigUiProvider_1.REPORTS_CONFIG_BASE_URL,
|
|
74
82
|
iTwinId: props.iTwinId,
|
|
75
83
|
reportsClient: props.reportsClient ?? new insights_client_1.ReportsClient(reportsBaseUrl()),
|
|
76
|
-
mappingsClient: props.mappingsClient ?? new insights_client_1.MappingsClient(
|
|
84
|
+
mappingsClient: props.mappingsClient ?? new insights_client_1.MappingsClient(undefined, groupingMappingBaseUrl()),
|
|
77
85
|
iModelsClient: props.iModelsClient ?? new imodels_client_management_1.IModelsClient(iModelClientOptions),
|
|
78
86
|
}));
|
|
79
|
-
}, [
|
|
87
|
+
}, [
|
|
88
|
+
props.getAccessToken,
|
|
89
|
+
props.baseUrl,
|
|
90
|
+
props.iTwinId,
|
|
91
|
+
props.reportsClient,
|
|
92
|
+
props.mappingsClient,
|
|
93
|
+
props.iModelsClient,
|
|
94
|
+
reportsBaseUrl,
|
|
95
|
+
iModelClientOptions,
|
|
96
|
+
groupingMappingBaseUrl,
|
|
97
|
+
]);
|
|
80
98
|
return (react_1.default.createElement(ReportsConfigApiContext_1.ReportsConfigApiContext.Provider, { value: apiConfig },
|
|
81
99
|
react_1.default.createElement(BulkExtractorContext_1.BulkExtractorContext.Provider, { value: bulkExtractor }, props.children)));
|
|
82
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsConfigContext.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsConfigContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"ReportsConfigContext.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsConfigContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAiD;AAEjD,gFAAiE;AAEjE,4DAA8I;AAC9I,wDAA+C;AAC/C,+CAAyE;AACzE,0EAAuE;AAEvE,gFAA6E;AAC7E,wEAAqE;AACrE,mDAAgD;AAChD,2CAA+C;AAC/C,uDAAqF;AACrF,mCAAsC;AAwCtC,MAAM,iCAAiC,GAAG,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,yBAAS,CAAC,mBAAmB,EAAE,cAAc,EAAE,CAAC,IAAI,EAAE,CAAC;AAEpH;;;GAGG;AACI,MAAM,oBAAoB,GAAG,CAAC,KAAgC,EAAE,EAAE;IACvE,MAAM,cAAc,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE,CAAC,IAAA,mBAAW,EAAC,qCAAmB,EAAE,KAAK,CAAC,OAAO,IAAI,iDAAuB,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACtI,MAAM,sBAAsB,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE,CAAC,IAAA,mBAAW,EAAC,gDAA8B,EAAE,KAAK,CAAC,OAAO,IAAI,iDAAuB,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACzJ,MAAM,mBAAmB,GAAyB,IAAA,eAAO,EACvD,GAAG,EAAE,CAAC,CAAC;QACL,GAAG,EAAE,EAAE,OAAO,EAAE,IAAA,mBAAW,EAAC,4BAAgB,EAAE,KAAK,CAAC,OAAO,IAAI,iDAAuB,CAAC,EAAE;KAC1F,CAAC,EACF,CAAC,KAAK,CAAC,OAAO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CAAiC,CACpE,CACpC,CAAC;AACJ,CAAC,CAAC;AArEW,QAAA,oBAAoB,wBAqE/B","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 { IModelsClient } from \"@itwin/imodels-client-management\";\nimport type { IExtractionClient, IMappingsClient, IReportsClient } from \"@itwin/insights-client\";\nimport { ExtractionClient, GROUPING_AND_MAPPING_BASE_PATH, 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 { GetAccessTokenFn, ReportsConfigApiProps } from \"../context/ReportsConfigApiContext\";\nimport { ReportsConfigApiContext } from \"../context/ReportsConfigApiContext\";\nimport { REPORTS_CONFIG_BASE_URL } from \"../ReportsConfigUiProvider\";\nimport { BulkExtractor } from \"./BulkExtractor\";\nimport { IMODELS_BASE_URL } from \"./Constants\";\nimport { FailedExtractionToast, SuccessfulExtractionToast } from \"./ExtractionToast\";\nimport { generateUrl } from \"./utils\";\n\n/**\n * Props for the {@link ReportsConfigContext} component.\n * @public\n */\nexport interface ReportsConfigContextProps {\n /**\n * A callback function that returns an access token for authenticating API requests.\n * If not specified, it defaults to the authorizationClient of the IModelApp.\n */\n getAccessToken?: GetAccessTokenFn;\n /**\n * The base URL for the API requests. Defaults to https://api.bentley.com.\n */\n baseUrl?: string;\n iTwinId: string;\n /**\n * The bulk extractor instance to use for extracting data. Internal use only.\n */\n bulkExtractor?: BulkExtractor;\n /**\n * A custom implementation of ReportsClient. If provided, baseUrl is ignored.\n */\n reportsClient?: IReportsClient;\n /**\n * A custom implementation of MappingsClient. If provided, baseUrl is ignored.\n */\n mappingsClient?: IMappingsClient;\n /**\n * A custom implementation of ExtractionClient. If provided, baseUrl is ignored.\n */\n extractionClient?: IExtractionClient;\n /**\n * A custom implementation of IModelsClient. If provided, baseUrl is ignored.\n */\n iModelsClient?: IModelsClient;\n children?: React.ReactNode;\n}\n\nconst authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? \"\";\n\n/**\n * Reports Config context providers required for all components.\n * @public\n */\nexport const ReportsConfigContext = (props: ReportsConfigContextProps) => {\n const reportsBaseUrl = useCallback(() => generateUrl(REPORTING_BASE_PATH, props.baseUrl || REPORTS_CONFIG_BASE_URL), [props.baseUrl]);\n const groupingMappingBaseUrl = useCallback(() => generateUrl(GROUPING_AND_MAPPING_BASE_PATH, props.baseUrl || REPORTS_CONFIG_BASE_URL), [props.baseUrl]);\n const iModelClientOptions: IModelsClientOptions = useMemo(\n () => ({\n api: { baseUrl: generateUrl(IMODELS_BASE_URL, props.baseUrl ?? REPORTS_CONFIG_BASE_URL) },\n }),\n [props.baseUrl],\n );\n const [extractionClient, setExtractionClient] = useState<IExtractionClient>(props.extractionClient ?? new ExtractionClient(reportsBaseUrl()));\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(undefined, groupingMappingBaseUrl()),\n iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),\n });\n\n useEffect(() => {\n if (!props.extractionClient) {\n setExtractionClient(props.extractionClient ?? new ExtractionClient(undefined, groupingMappingBaseUrl()));\n }\n }, [groupingMappingBaseUrl, props.extractionClient]);\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 () => ({\n bulkExtractor:\n props.bulkExtractor ??\n new BulkExtractor(apiConfig.reportsClient, extractionClient, apiConfig.getAccessToken, successfulExtractionToast, failedExtractionToast),\n }),\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(undefined, groupingMappingBaseUrl()),\n iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),\n }));\n }, [\n props.getAccessToken,\n props.baseUrl,\n props.iTwinId,\n props.reportsClient,\n props.mappingsClient,\n props.iModelsClient,\n reportsBaseUrl,\n iModelClientOptions,\n groupingMappingBaseUrl,\n ]);\n\n return (\n <ReportsConfigApiContext.Provider value={apiConfig}>\n <BulkExtractorContext.Provider value={bulkExtractor}>{props.children}</BulkExtractorContext.Provider>\n </ReportsConfigApiContext.Provider>\n );\n};\n"]}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { AccessToken } from "@itwin/core-bentley";
|
|
3
2
|
import "./ReportsContainer.scss";
|
|
4
3
|
import type { Report } from "@itwin/insights-client";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
baseUrl: string;
|
|
8
|
-
}
|
|
4
|
+
import type { ReportsConfigContextProps } from "./ReportsConfigContext";
|
|
5
|
+
export declare type ReportsContainerProps = Omit<ReportsConfigContextProps, "iTwinId" | "children">;
|
|
9
6
|
export declare enum RouteStep {
|
|
10
7
|
ReportsList = 0,
|
|
11
8
|
ReportAction = 1,
|
|
@@ -19,6 +16,6 @@ export interface Route {
|
|
|
19
16
|
title: string;
|
|
20
17
|
reportsRoutingFields: ReportsRouteFields;
|
|
21
18
|
}
|
|
22
|
-
declare const ReportsContainer: (
|
|
19
|
+
declare const ReportsContainer: (props: ReportsContainerProps) => JSX.Element;
|
|
23
20
|
export default ReportsContainer;
|
|
24
21
|
//# sourceMappingURL=ReportsContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsContainer.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsContainer.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ReportsContainer.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsContainer.tsx"],"names":[],"mappings":";AAKA,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAIrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGxE,oBAAY,qBAAqB,GAAG,IAAI,CAAC,yBAAyB,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;AAE5F,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,UAAW,qBAAqB,gBAsBrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -24,6 +24,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.RouteStep = void 0;
|
|
27
|
+
/*---------------------------------------------------------------------------------------------
|
|
28
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
+
*--------------------------------------------------------------------------------------------*/
|
|
27
31
|
const react_1 = __importStar(require("react"));
|
|
28
32
|
require("./ReportsContainer.scss");
|
|
29
33
|
const appui_react_1 = require("@itwin/appui-react");
|
|
@@ -36,10 +40,8 @@ var RouteStep;
|
|
|
36
40
|
RouteStep[RouteStep["ReportAction"] = 1] = "ReportAction";
|
|
37
41
|
RouteStep[RouteStep["ReportMappings"] = 2] = "ReportMappings";
|
|
38
42
|
})(RouteStep = exports.RouteStep || (exports.RouteStep = {}));
|
|
39
|
-
const ReportsContainer = (
|
|
40
|
-
const [routingHistory, setRoutingHistory] = (0, react_1.useState)([
|
|
41
|
-
{ step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} },
|
|
42
|
-
]);
|
|
43
|
+
const ReportsContainer = (props) => {
|
|
44
|
+
const [routingHistory, setRoutingHistory] = (0, react_1.useState)([{ step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} }]);
|
|
43
45
|
const currentRoute = routingHistory[routingHistory.length - 1];
|
|
44
46
|
const iTwinId = (0, appui_react_1.useActiveIModelConnection)()?.iTwinId ?? "";
|
|
45
47
|
const navigateTo = (0, react_1.useCallback)((toRoute) => {
|
|
@@ -50,7 +52,7 @@ const ReportsContainer = ({ getAccessToken, baseUrl, }) => {
|
|
|
50
52
|
updatedRouting.pop();
|
|
51
53
|
setRoutingHistory(updatedRouting);
|
|
52
54
|
}, [routingHistory]);
|
|
53
|
-
return (react_1.default.createElement(ReportsConfigContext_1.ReportsConfigContext, {
|
|
55
|
+
return (react_1.default.createElement(ReportsConfigContext_1.ReportsConfigContext, { ...props, iTwinId: iTwinId },
|
|
54
56
|
react_1.default.createElement("div", { className: "rcw-reports-container" },
|
|
55
57
|
react_1.default.createElement(ReportsHeader_1.ReportsHeader, { goBack: goBack, currentRoute: currentRoute }),
|
|
56
58
|
react_1.default.createElement(ReportsRouter_1.ReportsRouter, { currentRoute: currentRoute, navigateTo: navigateTo, goBack: goBack }))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsContainer.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ReportsContainer.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,+CAAqD;AACrD,mCAAiC;AAEjC,oDAA+D;AAC/D,mDAAgD;AAChD,mDAAgD;AAEhD,iEAA6D;AAI7D,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,uDAAW,CAAA;IACX,yDAAY,CAAA;IACZ,6DAAc,CAAA;AAChB,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AAYD,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAE,EAAE;IACxD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,IAAA,gBAAQ,EAAU,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACnJ,MAAM,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,IAAA,uCAAyB,GAAE,EAAE,OAAO,IAAI,EAAE,CAAC;IAC3D,MAAM,UAAU,GAAG,IAAA,mBAAW,EAAC,CAAC,OAA2C,EAAE,EAAE;QAC7E,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,MAAM,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC9B,MAAM,cAAc,GAAG,CAAC,GAAG,cAAc,CAAC,CAAC;QAC3C,cAAc,CAAC,GAAG,EAAE,CAAC;QACrB,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,8BAAC,2CAAoB,OAAK,KAAK,EAAE,OAAO,EAAE,OAAO;QAC/C,uCAAK,SAAS,EAAC,uBAAuB;YACpC,8BAAC,6BAAa,IAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAI;YAC7D,8BAAC,6BAAa,IAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAI,CACjF,CACe,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,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 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 type { ReportsConfigContextProps } from \"./ReportsConfigContext\";\nimport { ReportsConfigContext } from \"./ReportsConfigContext\"\n\nexport type ReportsContainerProps = Omit<ReportsConfigContextProps, \"iTwinId\" | \"children\">;\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 = (props: ReportsContainerProps) => {\n const [routingHistory, setRoutingHistory] = useState<Route[]>([{ step: RouteStep.ReportsList, title: \"iTwin Reports\", reportsRoutingFields: {} }]);\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 {...props} iTwinId={iTwinId}>\n <div className=\"rcw-reports-container\">\n <ReportsHeader goBack={goBack} currentRoute={currentRoute} />\n <ReportsRouter currentRoute={currentRoute} navigateTo={navigateTo} goBack={goBack} />\n </div>\n </ReportsConfigContext>\n );\n};\n\nexport default ReportsContainer;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Route } from "./ReportsContainer";
|
|
3
|
-
export declare const ReportsHeader: ({ goBack, currentRoute
|
|
3
|
+
export declare const ReportsHeader: ({ goBack, currentRoute }: {
|
|
4
4
|
goBack: () => void;
|
|
5
5
|
currentRoute: Route;
|
|
6
6
|
}) => JSX.Element;
|
|
@@ -1 +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;
|
|
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;YAAwC,MAAM,IAAI;kBAAgB,KAAK;iBAIhG,CAAC"}
|
|
@@ -5,16 +5,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ReportsHeader = void 0;
|
|
7
7
|
/*---------------------------------------------------------------------------------------------
|
|
8
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
11
|
const react_1 = __importDefault(require("react"));
|
|
12
12
|
const ReportsContainer_1 = require("./ReportsContainer");
|
|
13
13
|
const utils_1 = require("./utils");
|
|
14
|
-
const ReportsHeader = ({ goBack, currentRoute
|
|
15
|
-
const shouldDisableReturnFn = currentRoute.step === ReportsContainer_1.RouteStep.ReportsList ||
|
|
16
|
-
|
|
17
|
-
return (react_1.default.createElement(utils_1.WidgetHeader, { returnFn: shouldDisableReturnFn ? undefined : goBack, title: currentRoute.title }));
|
|
14
|
+
const ReportsHeader = ({ goBack, currentRoute }) => {
|
|
15
|
+
const shouldDisableReturnFn = currentRoute.step === ReportsContainer_1.RouteStep.ReportsList || currentRoute.step === ReportsContainer_1.RouteStep.ReportAction;
|
|
16
|
+
return react_1.default.createElement(utils_1.WidgetHeader, { returnFn: shouldDisableReturnFn ? undefined : goBack, title: currentRoute.title });
|
|
18
17
|
};
|
|
19
18
|
exports.ReportsHeader = ReportsHeader;
|
|
20
19
|
//# sourceMappingURL=ReportsHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsHeader.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsHeader.tsx"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"ReportsHeader.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsHeader.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAE1B,yDAA+C;AAC/C,mCAAuC;AAEhC,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAE,YAAY,EAA+C,EAAE,EAAE;IACrG,MAAM,qBAAqB,GAAG,YAAY,CAAC,IAAI,KAAK,4BAAS,CAAC,WAAW,IAAI,YAAY,CAAC,IAAI,KAAK,4BAAS,CAAC,YAAY,CAAC;IAE1H,OAAO,8BAAC,oBAAY,IAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,GAAI,CAAC;AAC3G,CAAC,CAAC;AAJW,QAAA,aAAa,iBAIxB","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 = ({ goBack, currentRoute }: { goBack: () => void; currentRoute: Route }) => {\n const shouldDisableReturnFn = currentRoute.step === RouteStep.ReportsList || currentRoute.step === RouteStep.ReportAction;\n\n return <WidgetHeader returnFn={shouldDisableReturnFn ? undefined : goBack} title={currentRoute.title} />;\n};\n"]}
|
|
@@ -1 +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;
|
|
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;wBAwCnB,CAAC"}
|
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ReportsRouter = void 0;
|
|
7
7
|
/*---------------------------------------------------------------------------------------------
|
|
8
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
11
|
const appui_react_1 = require("@itwin/appui-react");
|
|
12
12
|
const react_1 = __importDefault(require("react"));
|
|
13
13
|
const ReportsConfigWidget_1 = require("../../ReportsConfigWidget");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsRouter.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsRouter.tsx"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"ReportsRouter.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsRouter.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,oDAA+D;AAC/D,kDAA0B;AAC1B,mEAAgE;AAChE,iDAA8C;AAC9C,qDAAkD;AAClD,uCAAoC;AAEpC,yDAA+C;AAExC,MAAM,aAAa,GAAG,CAAC,EAC5B,YAAY,EACZ,UAAU,EACV,MAAM,GAKP,EAAE,EAAE;I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,8BAAC,+BAAc,IAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,GAAI,CAAC;QAC7F;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC;AA/CW,QAAA,aAAa,iBA+CxB","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(\"ReportsConfigWidget:ITwinReports\"),\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"]}
|
|
@@ -5,6 +5,6 @@ interface SearchBarProps {
|
|
|
5
5
|
setSearchValue: React.Dispatch<React.SetStateAction<string>>;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const SearchBar: ({ searchValue, setSearchValue, disabled
|
|
8
|
+
export declare const SearchBar: ({ searchValue, setSearchValue, disabled }: SearchBarProps) => JSX.Element;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=SearchBar.d.ts.map
|
|
@@ -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
|
|
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,8CAA+C,cAAc,gBA8ClF,CAAC"}
|
|
@@ -25,15 +25,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.SearchBar = void 0;
|
|
27
27
|
/*---------------------------------------------------------------------------------------------
|
|
28
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
-
*--------------------------------------------------------------------------------------------*/
|
|
28
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
+
*--------------------------------------------------------------------------------------------*/
|
|
31
31
|
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
32
32
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
33
33
|
const react_1 = __importStar(require("react"));
|
|
34
34
|
const ReportsConfigWidget_1 = require("../../ReportsConfigWidget");
|
|
35
35
|
require("./SearchBar.scss");
|
|
36
|
-
const SearchBar = ({ searchValue, setSearchValue, disabled
|
|
36
|
+
const SearchBar = ({ searchValue, setSearchValue, disabled }) => {
|
|
37
37
|
const [searchBarOpen, setSearchBarOpened] = (0, react_1.useState)(false);
|
|
38
38
|
const [searchBarClosing, setSearchBarClosing] = (0, react_1.useState)(false);
|
|
39
39
|
return searchBarOpen || searchValue ? (react_1.default.createElement("div", { className: "rcw-search-button", style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../../src/widget/components/SearchBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../../src/widget/components/SearchBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,oEAAsE;AACtE,wDAAgE;AAChE,+CAAwC;AACxC,mEAAgE;AAChE,4BAA0B;AAQnB,MAAM,SAAS,GAAG,CAAC,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAkB,EAAE,EAAE;IACrF,MAAM,CAAC,aAA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AG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;QAEvC,8BAAC,+BAAS,OAAG,CACF,CACd,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,SAAS,aA8CpB","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 = ({ searchValue, setSearchValue, disabled }: SearchBarProps) => {\n const [searchBarOpen, setSearchBarOpened] = useState<boolean>(false);\n const [searchBarClosing, setSearchBarClosing] = useState<boolean>(false);\n\n return searchBarOpen || searchValue ? (\n <div\n 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(\"ReportsConfigWidget:Search\")}\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 >\n <SvgSearch />\n </IconButton>\n );\n};\n"]}
|
|
@@ -4,6 +4,6 @@ interface SelectedIModelProps {
|
|
|
4
4
|
selectedIModelId?: string;
|
|
5
5
|
setSelectedIModelId: (iModelId: string) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare const SelectIModel: ({ selectedIModelId, setSelectedIModelId
|
|
7
|
+
export declare const SelectIModel: ({ selectedIModelId, setSelectedIModelId }: SelectedIModelProps) => JSX.Element;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=SelectIModel.d.ts.map
|
|
@@ -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":";AAYA,OAAO,qBAAqB,CAAC;AAkB7B,UAAU,mBAAmB;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD;AAED,eAAO,MAAM,YAAY,8CAA+C,mBAAmB,gBAiC1F,CAAC"}
|
|
@@ -41,7 +41,7 @@ const fetchIModels = async (setiModels, iTwinId, iModelsClient, getAccessToken)
|
|
|
41
41
|
const iModels = await (0, imodels_client_management_1.toArray)(iModelsClient.iModels.getMinimalList(getiModelListParams));
|
|
42
42
|
setiModels(iModels);
|
|
43
43
|
};
|
|
44
|
-
const SelectIModel = ({ selectedIModelId, setSelectedIModelId
|
|
44
|
+
const SelectIModel = ({ selectedIModelId, setSelectedIModelId }) => {
|
|
45
45
|
const { iTwinId, getAccessToken, iModelsClient } = (0, ReportsConfigApiContext_1.useReportsConfigApi)();
|
|
46
46
|
const [iModels, setIModels] = (0, react_1.useState)([]);
|
|
47
47
|
(0, react_1.useEffect)(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectIModel.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectIModel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,4EAAoE;
|
|
1
|
+
{"version":3,"file":"SelectIModel.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectIModel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,4EAAoE;AAEpE,gFAA2D;AAC3D,wDAAuD;AACvD,+CAA4D;AAC5D,mEAAgE;AAChE,gFAAyE;AACzE,+BAA6B;AAE7B,MAAM,YAAY,GAAG,KAAK,EACxB,UAAiE,EACjE,OAAe,EACf,aAA4B,EAC5B,cAA0C,EAC1C,EAAE;IACF,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;IAC3C,MAAM,aAAa,GAAG,4CAAkB,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAC9E,MAAM,mBAAmB,GAAwB;QAC/C,SAAS,EAAE,EAAE,OAAO,EAAE;QACtB,aAAa;KACd,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,IAAA,mCAAO,EAAC,aAAa,CAAC,OAAO,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACzF,UAAU,CAAC,OAAO,CAAC,CAAC;AACtB,CAAC,CAAC;AAOK,MAAM,YAAY,GAAG,CAAC,EAAE,gBAAgB,EAAE,mBAAmB,EAAuB,EAAE,EAAE;IAC7F,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,IAAA,6CAAmB,GAAE,CAAC;IACzE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAkB,EAAE,CAAC,CAAC;IAE5D,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,KAAK,YAAY,CAAC,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;IACxE,CAAC,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;IAEzD,MAAM,aAAa,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACjC,OAAO,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,uCAAK,SAAS,EAAC,mBAAmB;QAChC,8BAAC,qBAAK,IAAC,OAAO,EAAC,aAAa,IAAE,yCAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAS;QAC9H,uCAAK,SAAS,EAAC,cAAc;YAC3B,8BAAC,wBAAQ,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;AAjCW,QAAA,YAAY,gBAiCvB","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 { GetIModelListParams, IModelsClient, MinimalIModel } from \"@itwin/imodels-client-management\";\nimport { toArray } 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: { iTwinId },\n authorization,\n };\n const iModels = await toArray(iModelsClient.iModels.getMinimalList(getiModelListParams));\n setiModels(iModels);\n};\n\ninterface SelectedIModelProps {\n selectedIModelId?: string;\n setSelectedIModelId: (iModelId: string) => void;\n}\n\nexport const SelectIModel = ({ selectedIModelId, setSelectedIModelId }: 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\">{ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:SelectIModel\")}</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"]}
|
|
@@ -5,7 +5,7 @@ export interface WidgetHeaderProps {
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
returnFn?: () => void;
|
|
7
7
|
}
|
|
8
|
-
export declare const WidgetHeader: ({ title, disabled, returnFn
|
|
8
|
+
export declare const WidgetHeader: ({ title, disabled, returnFn }: WidgetHeaderProps) => JSX.Element;
|
|
9
9
|
export declare const handleError: (errorStatus: number) => void;
|
|
10
10
|
export declare const LoadingOverlay: () => JSX.Element;
|
|
11
11
|
interface EmptyMessageProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"AAMA,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,kCAA2C,iBAAiB,gBAkBpF,CAAC;AAEF,eAAO,MAAM,WAAW,gBAAiB,MAAM,SAkC9C,CAAC;AAEF,eAAO,MAAM,cAAc,mBAM1B,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,SAAW,MAAM,WAAW,CAAC,gBAAgB,CAAC,wEAO3E,CAAC;AAEF,eAAO,MAAM,cAAc,mBAM1B,CAAC;AAEF,eAAO,MAAM,aAAa,mBAA4D,CAAC;AAEvF,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"}
|
|
@@ -5,15 +5,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.generateUrl = exports.SkeletonBlock = exports.LoadingSpinner = exports.handleInputChange = exports.EmptyMessage = exports.LoadingOverlay = exports.handleError = exports.WidgetHeader = void 0;
|
|
7
7
|
/*---------------------------------------------------------------------------------------------
|
|
8
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
11
|
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
12
12
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
13
13
|
require("./utils.scss");
|
|
14
14
|
const react_1 = __importDefault(require("react"));
|
|
15
15
|
const ReportsConfigWidget_1 = require("../../ReportsConfigWidget");
|
|
16
|
-
const WidgetHeader = ({ title, disabled = false, returnFn
|
|
16
|
+
const WidgetHeader = ({ title, disabled = false, returnFn }) => {
|
|
17
17
|
return (react_1.default.createElement("div", { className: "rcw-widget-header-container" },
|
|
18
18
|
returnFn && (react_1.default.createElement(itwinui_react_1.Icon, { className: `${disabled ? "rcw-chevron-disabled" : "rcw-chevron"}`, onClick: disabled ? undefined : returnFn, size: "large", title: ReportsConfigWidget_1.ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Back") },
|
|
19
19
|
react_1.default.createElement(itwinui_icons_react_1.SvgChevronLeft, null))),
|
|
@@ -78,7 +78,7 @@ const LoadingSpinner = () => {
|
|
|
78
78
|
react_1.default.createElement(itwinui_react_1.ProgressRadial, { size: "small", indeterminate: true })));
|
|
79
79
|
};
|
|
80
80
|
exports.LoadingSpinner = LoadingSpinner;
|
|
81
|
-
const SkeletonBlock = () =>
|
|
81
|
+
const SkeletonBlock = () => react_1.default.createElement("div", { className: "rcw-skeleton-block iui-skeleton" });
|
|
82
82
|
exports.SkeletonBlock = SkeletonBlock;
|
|
83
83
|
const generateUrl = (baseUrl, newBaseUrl) => {
|
|
84
84
|
return baseUrl.replace("https://api.bentley.com", newBaseUrl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,oEAA4D;AAC5D,wDAA2E;AAC3E,wBAAsB;AACtB,kDAA0B;AAC1B,mEAAgE;AAQzD,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,EAAqB,EAAE,EAAE;IACvF,OAAO,CACL,uCAAK,SAAS,EAAC,6BAA6B;QACzC,QAAQ,IAAI,CACX,8BAAC,oBAAI,IACH,SAAS,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,aAAa,EAAE,EACjE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EACxC,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,yCAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,0BAA0B,CAAC;YAEtF,8BAAC,oCAAc,OAAG,CACb,CACR;QACD,8BAAC,oBAAI,IAAC,SAAS,EAAC,WAAW,EAAC,OAAO,EAAC,OAAO,IACxC,KAAK,CACD,CACH,CACP,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,YAAY,gBAkBvB;AAEK,MAAM,WAAW,GAAG,CAAC,WAAmB,EAAE,EAAE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EAAE;IACjE,OAAO,OAAO,CAAC,OAAO,CAAC,yBAAyB,EAAE,UAAU,CAAC,CAAC;AAChE,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { SvgChevronLeft } from \"@itwin/itwinui-icons-react\";\nimport { Icon, ProgressRadial, Text, toaster } from \"@itwin/itwinui-react\";\nimport \"./utils.scss\";\nimport React from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport interface WidgetHeaderProps {\n title: string;\n disabled?: boolean;\n returnFn?: () => void;\n}\n\nexport const WidgetHeader = ({ title, disabled = false, returnFn }: WidgetHeaderProps) => {\n return (\n <div className=\"rcw-widget-header-container\">\n {returnFn && (\n <Icon\n className={`${disabled ? \"rcw-chevron-disabled\" : \"rcw-chevron\"}`}\n onClick={disabled ? undefined : returnFn}\n size=\"large\"\n title={ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Back\")}\n >\n <SvgChevronLeft />\n </Icon>\n )}\n <Text className=\"rcw-title\" variant=\"title\">\n {title}\n </Text>\n </div>\n );\n};\n\nexport const handleError = (errorStatus: number) => {\n let errorMessage = `${ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.Error\")} `;\n switch (errorStatus) {\n case 401:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.401\");\n break;\n case 403:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.403\");\n break;\n case 404:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.404\");\n break;\n case 409:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.409\");\n break;\n case 422:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.422\");\n break;\n case 429:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.429\");\n break;\n case 500:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.500\");\n break;\n case 502:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.502\");\n break;\n case 503:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.503\");\n break;\n default:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.SomethingWentWrong\");\n }\n toaster.negative(errorMessage);\n};\n\nexport const LoadingOverlay = () => (\n <div className=\"rcw-center-overlay\">\n <Text>{ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Loading\")}</Text>\n <ProgressRadial indeterminate />\n <Text>{ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:PleaseWait\")}</Text>\n </div>\n);\ninterface EmptyMessageProps {\n children?: React.ReactNode;\n}\nexport const EmptyMessage = ({ children }: EmptyMessageProps) => {\n return <div className=\"rcw-center-overlay\">{children}</div>;\n};\n\nexport const handleInputChange = <T,>(e: React.ChangeEvent<HTMLInputElement>, values: T, setValues: React.Dispatch<React.SetStateAction<T>>) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const LoadingSpinner = () => {\n return (\n <div className=\"rcw-loading-spinner\" data-testid=\"rcw-action-loading-spinner\">\n <ProgressRadial size=\"small\" indeterminate />\n </div>\n );\n};\n\nexport const SkeletonBlock = () => <div className=\"rcw-skeleton-block iui-skeleton\" />;\n\nexport const generateUrl = (baseUrl: string, newBaseUrl: string) => {\n return baseUrl.replace(\"https://api.bentley.com\", newBaseUrl);\n};\n\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n"]}
|