@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,16 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { IModelApp } from "@itwin/core-frontend";
|
|
6
6
|
import type { IModelsClientOptions } from "@itwin/imodels-client-management";
|
|
7
7
|
import { IModelsClient } from "@itwin/imodels-client-management";
|
|
8
|
-
import {
|
|
8
|
+
import type { IExtractionClient, IMappingsClient, IReportsClient } from "@itwin/insights-client";
|
|
9
|
+
import { ExtractionClient, GROUPING_AND_MAPPING_BASE_PATH, MappingsClient, REPORTING_BASE_PATH, ReportsClient } from "@itwin/insights-client";
|
|
9
10
|
import { toaster } from "@itwin/itwinui-react";
|
|
10
11
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
11
12
|
import { BulkExtractorContext } from "../context/BulkExtractorContext";
|
|
12
|
-
import type {
|
|
13
|
-
GetAccessTokenFn,
|
|
14
|
-
ReportsConfigApiProps,
|
|
15
|
-
} from "../context/ReportsConfigApiContext";
|
|
13
|
+
import type { GetAccessTokenFn, ReportsConfigApiProps } from "../context/ReportsConfigApiContext";
|
|
16
14
|
import { ReportsConfigApiContext } from "../context/ReportsConfigApiContext";
|
|
17
15
|
import { REPORTS_CONFIG_BASE_URL } from "../ReportsConfigUiProvider";
|
|
18
16
|
import { BulkExtractor } from "./BulkExtractor";
|
|
@@ -20,47 +18,75 @@ import { IMODELS_BASE_URL } from "./Constants";
|
|
|
20
18
|
import { FailedExtractionToast, SuccessfulExtractionToast } from "./ExtractionToast";
|
|
21
19
|
import { generateUrl } from "./utils";
|
|
22
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Props for the {@link ReportsConfigContext} component.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
23
25
|
export interface ReportsConfigContextProps {
|
|
26
|
+
/**
|
|
27
|
+
* A callback function that returns an access token for authenticating API requests.
|
|
28
|
+
* If not specified, it defaults to the authorizationClient of the IModelApp.
|
|
29
|
+
*/
|
|
24
30
|
getAccessToken?: GetAccessTokenFn;
|
|
31
|
+
/**
|
|
32
|
+
* The base URL for the API requests. Defaults to https://api.bentley.com.
|
|
33
|
+
*/
|
|
25
34
|
baseUrl?: string;
|
|
26
35
|
iTwinId: string;
|
|
36
|
+
/**
|
|
37
|
+
* The bulk extractor instance to use for extracting data. Internal use only.
|
|
38
|
+
*/
|
|
27
39
|
bulkExtractor?: BulkExtractor;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
/**
|
|
41
|
+
* A custom implementation of ReportsClient. If provided, baseUrl is ignored.
|
|
42
|
+
*/
|
|
43
|
+
reportsClient?: IReportsClient;
|
|
44
|
+
/**
|
|
45
|
+
* A custom implementation of MappingsClient. If provided, baseUrl is ignored.
|
|
46
|
+
*/
|
|
47
|
+
mappingsClient?: IMappingsClient;
|
|
48
|
+
/**
|
|
49
|
+
* A custom implementation of ExtractionClient. If provided, baseUrl is ignored.
|
|
50
|
+
*/
|
|
51
|
+
extractionClient?: IExtractionClient;
|
|
52
|
+
/**
|
|
53
|
+
* A custom implementation of IModelsClient. If provided, baseUrl is ignored.
|
|
54
|
+
*/
|
|
31
55
|
iModelsClient?: IModelsClient;
|
|
32
56
|
children?: React.ReactNode;
|
|
33
57
|
}
|
|
34
58
|
|
|
35
|
-
const authorizationClientGetAccessToken = async () =>
|
|
36
|
-
(await IModelApp.authorizationClient?.getAccessToken()) ?? "";
|
|
59
|
+
const authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? "";
|
|
37
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Reports Config context providers required for all components.
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
38
65
|
export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
|
|
39
|
-
const reportsBaseUrl = useCallback(() => generateUrl(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const [extractionClient, setExtractionClient] = useState<ExtractionClient>(
|
|
47
|
-
props.extractionClient ?? new ExtractionClient(reportsBaseUrl())
|
|
66
|
+
const reportsBaseUrl = useCallback(() => generateUrl(REPORTING_BASE_PATH, props.baseUrl || REPORTS_CONFIG_BASE_URL), [props.baseUrl]);
|
|
67
|
+
const groupingMappingBaseUrl = useCallback(() => generateUrl(GROUPING_AND_MAPPING_BASE_PATH, props.baseUrl || REPORTS_CONFIG_BASE_URL), [props.baseUrl]);
|
|
68
|
+
const iModelClientOptions: IModelsClientOptions = useMemo(
|
|
69
|
+
() => ({
|
|
70
|
+
api: { baseUrl: generateUrl(IMODELS_BASE_URL, props.baseUrl ?? REPORTS_CONFIG_BASE_URL) },
|
|
71
|
+
}),
|
|
72
|
+
[props.baseUrl],
|
|
48
73
|
);
|
|
74
|
+
const [extractionClient, setExtractionClient] = useState<IExtractionClient>(props.extractionClient ?? new ExtractionClient(reportsBaseUrl()));
|
|
49
75
|
|
|
50
76
|
const [apiConfig, setApiConfig] = useState<ReportsConfigApiProps>({
|
|
51
77
|
getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,
|
|
52
78
|
baseUrl: reportsBaseUrl(),
|
|
53
79
|
iTwinId: props.iTwinId,
|
|
54
80
|
reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),
|
|
55
|
-
mappingsClient: props.mappingsClient ?? new MappingsClient(
|
|
81
|
+
mappingsClient: props.mappingsClient ?? new MappingsClient(undefined, groupingMappingBaseUrl()),
|
|
56
82
|
iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),
|
|
57
83
|
});
|
|
58
84
|
|
|
59
85
|
useEffect(() => {
|
|
60
86
|
if (!props.extractionClient) {
|
|
61
|
-
setExtractionClient(props.extractionClient ?? new ExtractionClient(
|
|
87
|
+
setExtractionClient(props.extractionClient ?? new ExtractionClient(undefined, groupingMappingBaseUrl()));
|
|
62
88
|
}
|
|
63
|
-
}, [props.extractionClient
|
|
89
|
+
}, [groupingMappingBaseUrl, props.extractionClient]);
|
|
64
90
|
|
|
65
91
|
const successfulExtractionToast = (iModelName: string, odataFeedUrl: string) => {
|
|
66
92
|
toaster.positive(<SuccessfulExtractionToast iModelName={iModelName} odataFeedUrl={odataFeedUrl} />);
|
|
@@ -71,8 +97,12 @@ export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
|
|
|
71
97
|
};
|
|
72
98
|
|
|
73
99
|
const bulkExtractor = useMemo(
|
|
74
|
-
() => ({
|
|
75
|
-
|
|
100
|
+
() => ({
|
|
101
|
+
bulkExtractor:
|
|
102
|
+
props.bulkExtractor ??
|
|
103
|
+
new BulkExtractor(apiConfig.reportsClient, extractionClient, apiConfig.getAccessToken, successfulExtractionToast, failedExtractionToast),
|
|
104
|
+
}),
|
|
105
|
+
[apiConfig.getAccessToken, apiConfig.reportsClient, extractionClient, props.bulkExtractor],
|
|
76
106
|
);
|
|
77
107
|
|
|
78
108
|
useEffect(() => {
|
|
@@ -81,16 +111,24 @@ export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
|
|
|
81
111
|
baseUrl: props.baseUrl || REPORTS_CONFIG_BASE_URL,
|
|
82
112
|
iTwinId: props.iTwinId,
|
|
83
113
|
reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),
|
|
84
|
-
mappingsClient: props.mappingsClient ?? new MappingsClient(
|
|
114
|
+
mappingsClient: props.mappingsClient ?? new MappingsClient(undefined, groupingMappingBaseUrl()),
|
|
85
115
|
iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),
|
|
86
116
|
}));
|
|
87
|
-
}, [
|
|
117
|
+
}, [
|
|
118
|
+
props.getAccessToken,
|
|
119
|
+
props.baseUrl,
|
|
120
|
+
props.iTwinId,
|
|
121
|
+
props.reportsClient,
|
|
122
|
+
props.mappingsClient,
|
|
123
|
+
props.iModelsClient,
|
|
124
|
+
reportsBaseUrl,
|
|
125
|
+
iModelClientOptions,
|
|
126
|
+
groupingMappingBaseUrl,
|
|
127
|
+
]);
|
|
88
128
|
|
|
89
129
|
return (
|
|
90
130
|
<ReportsConfigApiContext.Provider value={apiConfig}>
|
|
91
|
-
<BulkExtractorContext.Provider value={bulkExtractor}>
|
|
92
|
-
{props.children}
|
|
93
|
-
</BulkExtractorContext.Provider>
|
|
131
|
+
<BulkExtractorContext.Provider value={bulkExtractor}>{props.children}</BulkExtractorContext.Provider>
|
|
94
132
|
</ReportsConfigApiContext.Provider>
|
|
95
133
|
);
|
|
96
134
|
};
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import type { AccessToken } from "@itwin/core-bentley";
|
|
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
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
5
|
import React, { useCallback, useState } from "react";
|
|
7
6
|
import "./ReportsContainer.scss";
|
|
8
7
|
import type { Report } from "@itwin/insights-client";
|
|
9
8
|
import { useActiveIModelConnection } from "@itwin/appui-react";
|
|
10
9
|
import { ReportsHeader } from "./ReportsHeader";
|
|
11
10
|
import { ReportsRouter } from "./ReportsRouter";
|
|
12
|
-
import {
|
|
11
|
+
import type { ReportsConfigContextProps } from "./ReportsConfigContext";
|
|
12
|
+
import { ReportsConfigContext } from "./ReportsConfigContext"
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
getAccessToken?: () => Promise<AccessToken>;
|
|
16
|
-
baseUrl: string;
|
|
17
|
-
}
|
|
14
|
+
export type ReportsContainerProps = Omit<ReportsConfigContextProps, "iTwinId" | "children">;
|
|
18
15
|
|
|
19
16
|
export enum RouteStep {
|
|
20
17
|
ReportsList,
|
|
21
18
|
ReportAction,
|
|
22
|
-
ReportMappings
|
|
19
|
+
ReportMappings,
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
export interface ReportsRouteFields {
|
|
@@ -32,14 +29,8 @@ export interface Route {
|
|
|
32
29
|
reportsRoutingFields: ReportsRouteFields;
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
const ReportsContainer = ({
|
|
36
|
-
|
|
37
|
-
baseUrl,
|
|
38
|
-
}: ReportsContainerProps) => {
|
|
39
|
-
|
|
40
|
-
const [routingHistory, setRoutingHistory] = useState<Route[]>([
|
|
41
|
-
{ step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} },
|
|
42
|
-
]);
|
|
32
|
+
const ReportsContainer = (props: ReportsContainerProps) => {
|
|
33
|
+
const [routingHistory, setRoutingHistory] = useState<Route[]>([{ step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} }]);
|
|
43
34
|
const currentRoute = routingHistory[routingHistory.length - 1];
|
|
44
35
|
const iTwinId = useActiveIModelConnection()?.iTwinId ?? "";
|
|
45
36
|
const navigateTo = useCallback((toRoute: (prev: Route | undefined) => Route) => {
|
|
@@ -53,17 +44,10 @@ const ReportsContainer = ({
|
|
|
53
44
|
}, [routingHistory]);
|
|
54
45
|
|
|
55
46
|
return (
|
|
56
|
-
<ReportsConfigContext
|
|
47
|
+
<ReportsConfigContext {...props} iTwinId={iTwinId}>
|
|
57
48
|
<div className="rcw-reports-container">
|
|
58
|
-
<ReportsHeader
|
|
59
|
-
|
|
60
|
-
currentRoute={currentRoute}
|
|
61
|
-
/>
|
|
62
|
-
<ReportsRouter
|
|
63
|
-
currentRoute={currentRoute}
|
|
64
|
-
navigateTo={navigateTo}
|
|
65
|
-
goBack={goBack}
|
|
66
|
-
/>
|
|
49
|
+
<ReportsHeader goBack={goBack} currentRoute={currentRoute} />
|
|
50
|
+
<ReportsRouter currentRoute={currentRoute} navigateTo={navigateTo} goBack={goBack} />
|
|
67
51
|
</div>
|
|
68
52
|
</ReportsConfigContext>
|
|
69
53
|
);
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
6
|
import type { Route } from "./ReportsContainer";
|
|
7
7
|
import { RouteStep } from "./ReportsContainer";
|
|
8
8
|
import { WidgetHeader } from "./utils";
|
|
9
9
|
|
|
10
|
-
export const ReportsHeader = ({
|
|
11
|
-
|
|
12
|
-
currentRoute,
|
|
13
|
-
}: {
|
|
14
|
-
goBack: () => void;
|
|
15
|
-
currentRoute: Route;
|
|
16
|
-
}) => {
|
|
17
|
-
const shouldDisableReturnFn =
|
|
18
|
-
currentRoute.step === RouteStep.ReportsList ||
|
|
19
|
-
currentRoute.step === RouteStep.ReportAction;
|
|
10
|
+
export const ReportsHeader = ({ goBack, currentRoute }: { goBack: () => void; currentRoute: Route }) => {
|
|
11
|
+
const shouldDisableReturnFn = currentRoute.step === RouteStep.ReportsList || currentRoute.step === RouteStep.ReportAction;
|
|
20
12
|
|
|
21
|
-
return
|
|
22
|
-
<WidgetHeader
|
|
23
|
-
returnFn={shouldDisableReturnFn ? undefined : goBack}
|
|
24
|
-
title={currentRoute.title}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
13
|
+
return <WidgetHeader returnFn={shouldDisableReturnFn ? undefined : goBack} title={currentRoute.title} />;
|
|
27
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { useActiveIModelConnection } from "@itwin/appui-react";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
@@ -29,9 +29,7 @@ export const ReportsRouter = ({
|
|
|
29
29
|
onClickAddReport={() =>
|
|
30
30
|
navigateTo(() => ({
|
|
31
31
|
step: RouteStep.ReportAction,
|
|
32
|
-
title: ReportsConfigWidget.localization.getLocalizedString(
|
|
33
|
-
"ReportsConfigWidget:ITwinReports"
|
|
34
|
-
),
|
|
32
|
+
title: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ITwinReports"),
|
|
35
33
|
reportsRoutingFields: {},
|
|
36
34
|
}))
|
|
37
35
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { SvgCloseSmall, SvgSearch } from "@itwin/itwinui-icons-react";
|
|
6
6
|
import { IconButton, LabeledInput } from "@itwin/itwinui-react";
|
|
7
7
|
import React, { useState } from "react";
|
|
@@ -14,16 +14,13 @@ interface SearchBarProps {
|
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export const SearchBar = ({
|
|
18
|
-
searchValue,
|
|
19
|
-
setSearchValue,
|
|
20
|
-
disabled,
|
|
21
|
-
}: SearchBarProps) => {
|
|
17
|
+
export const SearchBar = ({ searchValue, setSearchValue, disabled }: SearchBarProps) => {
|
|
22
18
|
const [searchBarOpen, setSearchBarOpened] = useState<boolean>(false);
|
|
23
19
|
const [searchBarClosing, setSearchBarClosing] = useState<boolean>(false);
|
|
24
20
|
|
|
25
21
|
return searchBarOpen || searchValue ? (
|
|
26
|
-
<div
|
|
22
|
+
<div
|
|
23
|
+
className="rcw-search-button"
|
|
27
24
|
style={{
|
|
28
25
|
animation: searchBarClosing ? "rcw-shrink .5s" : "rcw-expand .5s",
|
|
29
26
|
}}
|
|
@@ -37,9 +34,7 @@ export const SearchBar = ({
|
|
|
37
34
|
>
|
|
38
35
|
<LabeledInput
|
|
39
36
|
aria-label="search-textbox"
|
|
40
|
-
placeholder={ReportsConfigWidget.localization.getLocalizedString(
|
|
41
|
-
"ReportsConfigWidget:Search"
|
|
42
|
-
)}
|
|
37
|
+
placeholder={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Search")}
|
|
43
38
|
svgIcon={
|
|
44
39
|
<IconButton
|
|
45
40
|
onClick={() => setSearchBarClosing(true)}
|
|
@@ -60,7 +55,8 @@ export const SearchBar = ({
|
|
|
60
55
|
styleType="borderless"
|
|
61
56
|
data-testid="rcw-search-button"
|
|
62
57
|
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:SearchReport")}
|
|
63
|
-
onClick={() => setSearchBarOpened(true)}
|
|
58
|
+
onClick={() => setSearchBarOpened(true)}
|
|
59
|
+
>
|
|
64
60
|
<SvgSearch />
|
|
65
61
|
</IconButton>
|
|
66
62
|
);
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
6
6
|
import { AccessTokenAdapter } from "@itwin/imodels-access-frontend";
|
|
7
|
-
import type {
|
|
8
|
-
|
|
9
|
-
IModelsClient,
|
|
10
|
-
MinimalIModel,
|
|
11
|
-
} from "@itwin/imodels-client-management";
|
|
12
|
-
import {
|
|
13
|
-
toArray,
|
|
14
|
-
} from "@itwin/imodels-client-management";
|
|
7
|
+
import type { GetIModelListParams, IModelsClient, MinimalIModel } from "@itwin/imodels-client-management";
|
|
8
|
+
import { toArray } from "@itwin/imodels-client-management";
|
|
15
9
|
import { ComboBox, Label } from "@itwin/itwinui-react";
|
|
16
10
|
import React, { useEffect, useMemo, useState } from "react";
|
|
17
11
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
@@ -22,7 +16,7 @@ const fetchIModels = async (
|
|
|
22
16
|
setiModels: React.Dispatch<React.SetStateAction<MinimalIModel[]>>,
|
|
23
17
|
iTwinId: string,
|
|
24
18
|
iModelsClient: IModelsClient,
|
|
25
|
-
getAccessToken: () => Promise<AccessToken
|
|
19
|
+
getAccessToken: () => Promise<AccessToken>,
|
|
26
20
|
) => {
|
|
27
21
|
const accessToken = await getAccessToken();
|
|
28
22
|
const authorization = AccessTokenAdapter.toAuthorizationCallback(accessToken);
|
|
@@ -30,9 +24,7 @@ const fetchIModels = async (
|
|
|
30
24
|
urlParams: { iTwinId },
|
|
31
25
|
authorization,
|
|
32
26
|
};
|
|
33
|
-
const iModels = await toArray(
|
|
34
|
-
iModelsClient.iModels.getMinimalList(getiModelListParams)
|
|
35
|
-
);
|
|
27
|
+
const iModels = await toArray(iModelsClient.iModels.getMinimalList(getiModelListParams));
|
|
36
28
|
setiModels(iModels);
|
|
37
29
|
};
|
|
38
30
|
|
|
@@ -41,10 +33,7 @@ interface SelectedIModelProps {
|
|
|
41
33
|
setSelectedIModelId: (iModelId: string) => void;
|
|
42
34
|
}
|
|
43
35
|
|
|
44
|
-
export const SelectIModel = ({
|
|
45
|
-
selectedIModelId,
|
|
46
|
-
setSelectedIModelId,
|
|
47
|
-
}: SelectedIModelProps) => {
|
|
36
|
+
export const SelectIModel = ({ selectedIModelId, setSelectedIModelId }: SelectedIModelProps) => {
|
|
48
37
|
const { iTwinId, getAccessToken, iModelsClient } = useReportsConfigApi();
|
|
49
38
|
const [iModels, setIModels] = useState<MinimalIModel[]>([]);
|
|
50
39
|
|
|
@@ -61,11 +50,7 @@ export const SelectIModel = ({
|
|
|
61
50
|
|
|
62
51
|
return (
|
|
63
52
|
<div className="rcw-select-imodel">
|
|
64
|
-
<Label htmlFor="combo-input">
|
|
65
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
66
|
-
"ReportsConfigWidget:SelectIModel"
|
|
67
|
-
)}
|
|
68
|
-
</Label>
|
|
53
|
+
<Label htmlFor="combo-input">{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:SelectIModel")}</Label>
|
|
69
54
|
<div className="rcw-combobox">
|
|
70
55
|
<ComboBox<string>
|
|
71
56
|
options={iModelOptions}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { SvgChevronLeft } from "@itwin/itwinui-icons-react";
|
|
6
|
-
import {
|
|
7
|
-
Icon,
|
|
8
|
-
ProgressRadial,
|
|
9
|
-
Text,
|
|
10
|
-
toaster,
|
|
11
|
-
} from "@itwin/itwinui-react";
|
|
6
|
+
import { Icon, ProgressRadial, Text, toaster } from "@itwin/itwinui-react";
|
|
12
7
|
import "./utils.scss";
|
|
13
8
|
import React from "react";
|
|
14
9
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
@@ -19,11 +14,7 @@ export interface WidgetHeaderProps {
|
|
|
19
14
|
returnFn?: () => void;
|
|
20
15
|
}
|
|
21
16
|
|
|
22
|
-
export const WidgetHeader = ({
|
|
23
|
-
title,
|
|
24
|
-
disabled = false,
|
|
25
|
-
returnFn,
|
|
26
|
-
}: WidgetHeaderProps) => {
|
|
17
|
+
export const WidgetHeader = ({ title, disabled = false, returnFn }: WidgetHeaderProps) => {
|
|
27
18
|
return (
|
|
28
19
|
<div className="rcw-widget-header-container">
|
|
29
20
|
{returnFn && (
|
|
@@ -44,76 +35,46 @@ export const WidgetHeader = ({
|
|
|
44
35
|
};
|
|
45
36
|
|
|
46
37
|
export const handleError = (errorStatus: number) => {
|
|
47
|
-
let errorMessage = `${ReportsConfigWidget.localization.getLocalizedString(
|
|
48
|
-
"ReportsConfigWidget:ErrorMessages.Error"
|
|
49
|
-
)} `;
|
|
38
|
+
let errorMessage = `${ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.Error")} `;
|
|
50
39
|
switch (errorStatus) {
|
|
51
40
|
case 401:
|
|
52
|
-
errorMessage += ReportsConfigWidget.localization.getLocalizedString(
|
|
53
|
-
"ReportsConfigWidget:ErrorMessages.401"
|
|
54
|
-
);
|
|
41
|
+
errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.401");
|
|
55
42
|
break;
|
|
56
43
|
case 403:
|
|
57
|
-
errorMessage += ReportsConfigWidget.localization.getLocalizedString(
|
|
58
|
-
"ReportsConfigWidget:ErrorMessages.403"
|
|
59
|
-
);
|
|
44
|
+
errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.403");
|
|
60
45
|
break;
|
|
61
46
|
case 404:
|
|
62
|
-
errorMessage += ReportsConfigWidget.localization.getLocalizedString(
|
|
63
|
-
"ReportsConfigWidget:ErrorMessages.404"
|
|
64
|
-
);
|
|
47
|
+
errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.404");
|
|
65
48
|
break;
|
|
66
49
|
case 409:
|
|
67
|
-
errorMessage += ReportsConfigWidget.localization.getLocalizedString(
|
|
68
|
-
"ReportsConfigWidget:ErrorMessages.409"
|
|
69
|
-
);
|
|
50
|
+
errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.409");
|
|
70
51
|
break;
|
|
71
52
|
case 422:
|
|
72
|
-
errorMessage += ReportsConfigWidget.localization.getLocalizedString(
|
|
73
|
-
"ReportsConfigWidget:ErrorMessages.422"
|
|
74
|
-
);
|
|
53
|
+
errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.422");
|
|
75
54
|
break;
|
|
76
55
|
case 429:
|
|
77
|
-
errorMessage += ReportsConfigWidget.localization.getLocalizedString(
|
|
78
|
-
"ReportsConfigWidget:ErrorMessages.429"
|
|
79
|
-
);
|
|
56
|
+
errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.429");
|
|
80
57
|
break;
|
|
81
58
|
case 500:
|
|
82
|
-
errorMessage += ReportsConfigWidget.localization.getLocalizedString(
|
|
83
|
-
"ReportsConfigWidget:ErrorMessages.500"
|
|
84
|
-
);
|
|
59
|
+
errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.500");
|
|
85
60
|
break;
|
|
86
61
|
case 502:
|
|
87
|
-
errorMessage += ReportsConfigWidget.localization.getLocalizedString(
|
|
88
|
-
"ReportsConfigWidget:ErrorMessages.502"
|
|
89
|
-
);
|
|
62
|
+
errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.502");
|
|
90
63
|
break;
|
|
91
64
|
case 503:
|
|
92
|
-
errorMessage += ReportsConfigWidget.localization.getLocalizedString(
|
|
93
|
-
"ReportsConfigWidget:ErrorMessages.503"
|
|
94
|
-
);
|
|
65
|
+
errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.503");
|
|
95
66
|
break;
|
|
96
67
|
default:
|
|
97
|
-
errorMessage += ReportsConfigWidget.localization.getLocalizedString(
|
|
98
|
-
"ReportsConfigWidget:ErrorMessages.SomethingWentWrong"
|
|
99
|
-
);
|
|
68
|
+
errorMessage += ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ErrorMessages.SomethingWentWrong");
|
|
100
69
|
}
|
|
101
70
|
toaster.negative(errorMessage);
|
|
102
71
|
};
|
|
103
72
|
|
|
104
73
|
export const LoadingOverlay = () => (
|
|
105
74
|
<div className="rcw-center-overlay">
|
|
106
|
-
<Text>
|
|
107
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
108
|
-
"ReportsConfigWidget:Loading"
|
|
109
|
-
)}
|
|
110
|
-
</Text>
|
|
75
|
+
<Text>{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Loading")}</Text>
|
|
111
76
|
<ProgressRadial indeterminate />
|
|
112
|
-
<Text>
|
|
113
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
114
|
-
"ReportsConfigWidget:PleaseWait"
|
|
115
|
-
)}
|
|
116
|
-
</Text>
|
|
77
|
+
<Text>{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:PleaseWait")}</Text>
|
|
117
78
|
</div>
|
|
118
79
|
);
|
|
119
80
|
interface EmptyMessageProps {
|
|
@@ -123,11 +84,7 @@ export const EmptyMessage = ({ children }: EmptyMessageProps) => {
|
|
|
123
84
|
return <div className="rcw-center-overlay">{children}</div>;
|
|
124
85
|
};
|
|
125
86
|
|
|
126
|
-
export const handleInputChange = <T,>(
|
|
127
|
-
e: React.ChangeEvent<HTMLInputElement>,
|
|
128
|
-
values: T,
|
|
129
|
-
setValues: React.Dispatch<React.SetStateAction<T>>
|
|
130
|
-
) => {
|
|
87
|
+
export const handleInputChange = <T,>(e: React.ChangeEvent<HTMLInputElement>, values: T, setValues: React.Dispatch<React.SetStateAction<T>>) => {
|
|
131
88
|
const { name, value } = e.target;
|
|
132
89
|
|
|
133
90
|
setValues({
|
|
@@ -138,18 +95,13 @@ export const handleInputChange = <T,>(
|
|
|
138
95
|
|
|
139
96
|
export const LoadingSpinner = () => {
|
|
140
97
|
return (
|
|
141
|
-
<div
|
|
142
|
-
className="rcw-loading-spinner"
|
|
143
|
-
data-testid="rcw-action-loading-spinner"
|
|
144
|
-
>
|
|
98
|
+
<div className="rcw-loading-spinner" data-testid="rcw-action-loading-spinner">
|
|
145
99
|
<ProgressRadial size="small" indeterminate />
|
|
146
100
|
</div>
|
|
147
101
|
);
|
|
148
102
|
};
|
|
149
103
|
|
|
150
|
-
export const SkeletonBlock = () =>
|
|
151
|
-
<div className="rcw-skeleton-block iui-skeleton" />
|
|
152
|
-
);
|
|
104
|
+
export const SkeletonBlock = () => <div className="rcw-skeleton-block iui-skeleton" />;
|
|
153
105
|
|
|
154
106
|
export const generateUrl = (baseUrl: string, newBaseUrl: string) => {
|
|
155
107
|
return baseUrl.replace("https://api.bentley.com", newBaseUrl);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { createContext } from "react";
|
|
@@ -18,9 +18,7 @@ export const BulkExtractorContext = createContext<BulkExtractorContextProps>({})
|
|
|
18
18
|
export const useBulkExtractor = () => {
|
|
19
19
|
const context = React.useContext(BulkExtractorContext);
|
|
20
20
|
if (!context) {
|
|
21
|
-
throw new Error(
|
|
22
|
-
"useBulkExtractor should be used within a BulkExtractorContext provider"
|
|
23
|
-
);
|
|
21
|
+
throw new Error("useBulkExtractor should be used within a BulkExtractorContext provider");
|
|
24
22
|
}
|
|
25
23
|
return context;
|
|
26
24
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
6
6
|
import { IModelsClient } from "@itwin/imodels-client-management";
|
|
7
|
+
import type { IMappingsClient, IReportsClient } from "@itwin/insights-client";
|
|
7
8
|
import { MappingsClient, ReportsClient } from "@itwin/insights-client";
|
|
8
9
|
import * as React from "react";
|
|
9
10
|
import { createContext } from "react";
|
|
@@ -14,8 +15,8 @@ export interface ReportsConfigApiProps {
|
|
|
14
15
|
getAccessToken: GetAccessTokenFn;
|
|
15
16
|
iTwinId: string;
|
|
16
17
|
baseUrl: string;
|
|
17
|
-
reportsClient:
|
|
18
|
-
mappingsClient:
|
|
18
|
+
reportsClient: IReportsClient;
|
|
19
|
+
mappingsClient: IMappingsClient;
|
|
19
20
|
iModelsClient: IModelsClient;
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -31,9 +32,7 @@ export const ReportsConfigApiContext = createContext<ReportsConfigApiProps>({
|
|
|
31
32
|
export const useReportsConfigApi = () => {
|
|
32
33
|
const context = React.useContext(ReportsConfigApiContext);
|
|
33
34
|
if (!context) {
|
|
34
|
-
throw new Error(
|
|
35
|
-
"useReportsConfigApi should be used within a ReportsConfigApiContext provider"
|
|
36
|
-
);
|
|
35
|
+
throw new Error("useReportsConfigApi should be used within a ReportsConfigApiContext provider");
|
|
37
36
|
}
|
|
38
37
|
return context;
|
|
39
38
|
};
|