@itwin/reports-config-widget-react 0.4.0 → 0.6.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 +61 -0
- package/CHANGELOG.md +23 -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 +130 -0
- package/api/reports-config-widget-react.exports.csv +14 -0
- package/api/temp/reports-config-widget-react.api.md +130 -0
- package/coverage/clover.xml +524 -514
- package/coverage/coverage-final.json +32 -32
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +26 -26
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- 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 +15 -15
- package/coverage/lcov-report/src/test/test-utils.tsx.html +233 -20
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +22 -64
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +5 -38
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +23 -119
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +117 -90
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +16 -10
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +16 -106
- 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 +86 -299
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +64 -226
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +63 -45
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +10 -49
- 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 +15 -27
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +12 -57
- package/coverage/lcov-report/src/widget/components/index.html +56 -56
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +32 -176
- package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +9 -15
- package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +9 -15
- 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 +1 -1
- package/coverage/lcov.info +959 -922
- 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.js +8 -4
- package/lib/cjs/reports-config-widget-react.js.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.js +24 -72
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
- package/lib/cjs/test/BulkExtractor.test.js +73 -44
- 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 +76 -86
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/cjs/test/ReportMappings.test.js +53 -80
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +54 -50
- 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 +38 -0
- package/lib/cjs/test/test-utils.d.ts.map +1 -1
- package/lib/cjs/test/test-utils.js +79 -5
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +7 -0
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +13 -4
- 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 +5 -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 +12 -8
- 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 +7 -4
- 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 +1 -0
- package/lib/cjs/widget/components/Constants.d.ts.map +1 -1
- package/lib/cjs/widget/components/Constants.js +5 -4
- 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 +10 -6
- 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 +14 -10
- 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 +6 -2
- 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 +14 -8
- 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 +9 -5
- 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 +51 -46
- 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 +30 -12
- 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 +12 -9
- 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 +8 -0
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.js +20 -7
- package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.d.ts +1 -1
- 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 +9 -5
- 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 +7 -3
- 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 +5 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js +5 -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.js +3 -3
- package/lib/esm/reports-config-widget-react.js.map +1 -1
- package/lib/esm/test/AddMappingModal.test.js +12 -64
- 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 +66 -80
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/esm/test/ReportMappings.test.js +42 -73
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +32 -51
- 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 +38 -0
- package/lib/esm/test/test-utils.d.ts.map +1 -1
- package/lib/esm/test/test-utils.js +73 -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 +7 -0
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.js +9 -4
- 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 +7 -4
- 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 +1 -0
- package/lib/esm/widget/components/Constants.d.ts.map +1 -1
- package/lib/esm/widget/components/Constants.js +4 -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 +8 -0
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.js +17 -8
- package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.d.ts +1 -1
- package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.js +2 -4
- 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 +3 -3
- 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.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 +37 -31
- package/src/ReportsConfigWidget.ts +9 -9
- package/src/reports-config-widget-react.ts +3 -3
- package/src/test/AddMappingModal.test.tsx +47 -122
- 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 +140 -161
- package/src/test/ReportMappings.test.tsx +80 -146
- package/src/test/Reports.test.tsx +57 -169
- package/src/test/WidgetHeader.test.tsx +3 -3
- package/src/test/test-utils.tsx +80 -9
- package/src/widget/ReportsConfigUiProvider.tsx +16 -30
- package/src/widget/components/ActionPanel.tsx +3 -14
- package/src/widget/components/AddMappingsModal.scss +1 -1
- package/src/widget/components/AddMappingsModal.tsx +19 -51
- package/src/widget/components/BulkExtractor.ts +63 -54
- package/src/widget/components/Constants.ts +5 -3
- 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 +59 -130
- package/src/widget/components/Reports.scss +0 -1
- package/src/widget/components/Reports.tsx +28 -82
- package/src/widget/components/ReportsConfigContext.tsx +32 -26
- package/src/widget/components/ReportsContainer.scss +1 -1
- package/src/widget/components/ReportsContainer.tsx +8 -21
- 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 +10 -25
- 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 +4 -6
- package/src/widget/hooks/useValidator.ts +10 -24
- package/tsconfig.json +11 -11
- package/.rush/temp/operation/rebuild/all.log +0 -9
- package/.rush/temp/operation/rebuild/state.json +0 -3
- package/.rush/temp/package-deps_rebuild.json +0 -68
- package/.rush/temp/shrinkwrap-deps.json +0 -898
- package/reports-config-widget-react.build.error.log +0 -14
- package/reports-config-widget-react.build.log +0 -63
|
@@ -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 { Modal, Table, tableFilters } from "@itwin/itwinui-react";
|
|
6
6
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import type { Mapping, MappingsClient } from "@itwin/insights-client";
|
|
@@ -24,16 +24,13 @@ const fetchMappings = async (
|
|
|
24
24
|
iModelId: string,
|
|
25
25
|
setIsLoading: (isLoading: boolean) => void,
|
|
26
26
|
mappingsClient: MappingsClient,
|
|
27
|
-
getAccessToken: () => Promise<AccessToken
|
|
27
|
+
getAccessToken: () => Promise<AccessToken>,
|
|
28
28
|
) => {
|
|
29
29
|
try {
|
|
30
30
|
setIsLoading(true);
|
|
31
31
|
const accessToken = await getAccessToken();
|
|
32
|
-
const mappings = await mappingsClient.getMappings(
|
|
33
|
-
|
|
34
|
-
iModelId
|
|
35
|
-
);
|
|
36
|
-
setMappings(mappings);
|
|
32
|
+
const mappings = await mappingsClient.getMappings(accessToken, iModelId);
|
|
33
|
+
setMappings(mappings.mappings);
|
|
37
34
|
} catch (error: any) {
|
|
38
35
|
handleError(error.status);
|
|
39
36
|
} finally {
|
|
@@ -49,13 +46,7 @@ export interface AddMappingsModalProps {
|
|
|
49
46
|
defaultIModelId?: string;
|
|
50
47
|
}
|
|
51
48
|
|
|
52
|
-
export const AddMappingsModal = ({
|
|
53
|
-
reportId,
|
|
54
|
-
existingMappings,
|
|
55
|
-
show,
|
|
56
|
-
onClose,
|
|
57
|
-
defaultIModelId,
|
|
58
|
-
}: AddMappingsModalProps) => {
|
|
49
|
+
export const AddMappingsModal = ({ reportId, existingMappings, show, onClose, defaultIModelId }: AddMappingsModalProps) => {
|
|
59
50
|
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
60
51
|
const selectedMappings = useRef<Mapping[]>([]);
|
|
61
52
|
const [selectedIModelId, setSelectediModelId] = useState<string | undefined>(defaultIModelId);
|
|
@@ -64,13 +55,7 @@ export const AddMappingsModal = ({
|
|
|
64
55
|
|
|
65
56
|
useEffect(() => {
|
|
66
57
|
if (selectedIModelId) {
|
|
67
|
-
void fetchMappings(
|
|
68
|
-
setMappings,
|
|
69
|
-
selectedIModelId,
|
|
70
|
-
setIsLoading,
|
|
71
|
-
mappingsClient,
|
|
72
|
-
getAccessToken
|
|
73
|
-
);
|
|
58
|
+
void fetchMappings(setMappings, selectedIModelId, setIsLoading, mappingsClient, getAccessToken);
|
|
74
59
|
}
|
|
75
60
|
}, [getAccessToken, mappingsClient, selectedIModelId, setIsLoading]);
|
|
76
61
|
|
|
@@ -78,21 +63,18 @@ export const AddMappingsModal = ({
|
|
|
78
63
|
(): Column<CreateTypeFromInterface<Mapping>>[] => [
|
|
79
64
|
{
|
|
80
65
|
id: "mappingName",
|
|
81
|
-
Header: ReportsConfigWidget.localization.getLocalizedString(
|
|
82
|
-
"ReportsConfigWidget:MappingName"
|
|
83
|
-
),
|
|
66
|
+
Header: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:MappingName"),
|
|
84
67
|
accessor: "mappingName",
|
|
85
68
|
Filter: tableFilters.TextFilter(),
|
|
86
69
|
},
|
|
87
70
|
{
|
|
88
71
|
id: "description",
|
|
89
|
-
Header: ReportsConfigWidget.localization.getLocalizedString(
|
|
90
|
-
"ReportsConfigWidget:Description"
|
|
91
|
-
),
|
|
72
|
+
Header: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Description"),
|
|
92
73
|
accessor: "description",
|
|
93
74
|
Filter: tableFilters.TextFilter(),
|
|
94
|
-
}
|
|
95
|
-
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
[],
|
|
96
78
|
);
|
|
97
79
|
|
|
98
80
|
const onSave = async () => {
|
|
@@ -119,15 +101,12 @@ export const AddMappingsModal = ({
|
|
|
119
101
|
if (selectData) selectedMappings.current = selectData;
|
|
120
102
|
}, []);
|
|
121
103
|
|
|
122
|
-
const tableData = useMemo(() => isLoading ? [] : mappings, [isLoading, mappings]);
|
|
123
|
-
const isRowDisabled = useCallback((rowData: MappingType) =>
|
|
124
|
-
existingMappings.some((v) => v.mappingId === rowData.id), [existingMappings]);
|
|
104
|
+
const tableData = useMemo(() => (isLoading ? [] : mappings), [isLoading, mappings]);
|
|
105
|
+
const isRowDisabled = useCallback((rowData: MappingType) => existingMappings.some((v) => v.mappingId === rowData.id), [existingMappings]);
|
|
125
106
|
|
|
126
107
|
return (
|
|
127
108
|
<Modal
|
|
128
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
129
|
-
"ReportsConfigWidget:AddMappings"
|
|
130
|
-
)}
|
|
109
|
+
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:AddMappings")}
|
|
131
110
|
isOpen={show}
|
|
132
111
|
isDismissible={!isLoading}
|
|
133
112
|
onClose={async () => {
|
|
@@ -136,17 +115,12 @@ export const AddMappingsModal = ({
|
|
|
136
115
|
style={{ display: "flex", flexDirection: "column", maxHeight: "77vh" }}
|
|
137
116
|
>
|
|
138
117
|
<div className="rcw-add-mappings-container">
|
|
139
|
-
<SelectIModel
|
|
140
|
-
selectedIModelId={selectedIModelId}
|
|
141
|
-
setSelectedIModelId={setSelectediModelId}
|
|
142
|
-
/>
|
|
118
|
+
<SelectIModel selectedIModelId={selectedIModelId} setSelectedIModelId={setSelectediModelId} />
|
|
143
119
|
<Table<MappingType>
|
|
144
120
|
data={tableData}
|
|
145
121
|
columns={mappingsColumns}
|
|
146
122
|
className="rcw-add-mappings-table"
|
|
147
|
-
emptyTableContent={ReportsConfigWidget.localization.getLocalizedString(
|
|
148
|
-
"ReportsConfigWidget:NoMappingsAvailable"
|
|
149
|
-
)}
|
|
123
|
+
emptyTableContent={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:NoMappingsAvailable")}
|
|
150
124
|
isSortable
|
|
151
125
|
isSelectable
|
|
152
126
|
isLoading={isLoading}
|
|
@@ -156,13 +130,7 @@ export const AddMappingsModal = ({
|
|
|
156
130
|
/>
|
|
157
131
|
</div>
|
|
158
132
|
{/* Add button permanently enabled as a workaround to the warning stating that the table and parent component are being rendered at the same time. */}
|
|
159
|
-
<ActionPanel
|
|
160
|
-
actionLabel={ReportsConfigWidget.localization.getLocalizedString(
|
|
161
|
-
"ReportsConfigWidget:Add"
|
|
162
|
-
)}
|
|
163
|
-
onAction={onSave}
|
|
164
|
-
isLoading={isLoading}
|
|
165
|
-
/>
|
|
133
|
+
<ActionPanel actionLabel={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Add")} onAction={onSave} isLoading={isLoading} />
|
|
166
134
|
</Modal>
|
|
167
135
|
);
|
|
168
136
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
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 {
|
|
6
|
-
import type { ExtractionClient, ReportMapping, ReportsClient } from "@itwin/insights-client";
|
|
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 { ExtractionState } from "@itwin/insights-client";
|
|
7
6
|
import { handleError } from "./utils";
|
|
8
7
|
import { ExtractionStates } from "./ExtractionStatus";
|
|
9
8
|
import { STATUS_CHECK_INTERVAL } from "./Constants";
|
|
9
|
+
import type { ExtractionClient, ExtractionMapping, ExtractionRequestDetails, ReportMapping, ReportsClient } from "@itwin/insights-client";
|
|
10
10
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
11
11
|
|
|
12
12
|
export type ReportMappingAndMapping = ReportMapping & {
|
|
@@ -15,13 +15,16 @@ export type ReportMappingAndMapping = ReportMapping & {
|
|
|
15
15
|
iModelName: string;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
18
21
|
export class BulkExtractor {
|
|
19
22
|
private _reportsClientApi: ReportsClient;
|
|
20
23
|
private _extractionClientApi: ExtractionClient;
|
|
21
24
|
private _accessToken: () => Promise<string>;
|
|
22
25
|
|
|
23
26
|
private _reportIModels = new Map<string, string[]>(); // key: reportId, value: iModels
|
|
24
|
-
private _iModelStates = new Map<string,
|
|
27
|
+
private _iModelStates = new Map<string, ExtractionState>(); // key: iModelId, value: state
|
|
25
28
|
private _timeFetched = new Date();
|
|
26
29
|
private _iModelRun = new Map<string, string>(); // key: iModelId, value: runId
|
|
27
30
|
private _iModelToast = new Set<string>();
|
|
@@ -47,7 +50,7 @@ export class BulkExtractor {
|
|
|
47
50
|
private async fetchStates(): Promise<void> {
|
|
48
51
|
for (const [iModelId, runId] of this._iModelRun) {
|
|
49
52
|
const state = await this.getState(runId);
|
|
50
|
-
if (state ===
|
|
53
|
+
if (state === ExtractionState.Succeeded || state === ExtractionState.Failed) {
|
|
51
54
|
this._iModelRun.delete(iModelId);
|
|
52
55
|
}
|
|
53
56
|
this._iModelStates.set(iModelId, state);
|
|
@@ -55,14 +58,14 @@ export class BulkExtractor {
|
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
public async getReportState(reportId: string): Promise<ExtractionStates> {
|
|
58
|
-
if (
|
|
61
|
+
if (new Date().getTime() - this._timeFetched.getTime() > STATUS_CHECK_INTERVAL) {
|
|
59
62
|
this._timeFetched = new Date();
|
|
60
63
|
await this.fetchStates();
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
const iModels = this._reportIModels.get(reportId);
|
|
64
67
|
if (!iModels) return ExtractionStates.None;
|
|
65
|
-
const states:
|
|
68
|
+
const states: ExtractionState[] = [];
|
|
66
69
|
for (const iModelId of iModels) {
|
|
67
70
|
const state = this._iModelStates.get(iModelId);
|
|
68
71
|
if (!state) continue;
|
|
@@ -72,7 +75,7 @@ export class BulkExtractor {
|
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
public async getIModelState(iModelId: string, iModelName: string, odataFeedUrl: string): Promise<ExtractionStates> {
|
|
75
|
-
if (
|
|
78
|
+
if (new Date().getTime() - this._timeFetched.getTime() > STATUS_CHECK_INTERVAL) {
|
|
76
79
|
this._timeFetched = new Date();
|
|
77
80
|
await this.fetchStates();
|
|
78
81
|
}
|
|
@@ -80,11 +83,11 @@ export class BulkExtractor {
|
|
|
80
83
|
const state = this._iModelStates.get(iModelId);
|
|
81
84
|
if (!state) return ExtractionStates.None;
|
|
82
85
|
if (!this._iModelToast.has(iModelId)) {
|
|
83
|
-
if (state ===
|
|
86
|
+
if (state === ExtractionState.Succeeded) {
|
|
84
87
|
this._successfulExtractionToast(iModelName, odataFeedUrl);
|
|
85
88
|
this._iModelToast.add(iModelId);
|
|
86
89
|
this.checkRunning();
|
|
87
|
-
} else if (state ===
|
|
90
|
+
} else if (state === ExtractionState.Failed) {
|
|
88
91
|
this._failedExtractionToast(iModelName);
|
|
89
92
|
this._iModelToast.add(iModelId);
|
|
90
93
|
this.checkRunning();
|
|
@@ -93,23 +96,19 @@ export class BulkExtractor {
|
|
|
93
96
|
return BulkExtractor.getFinalState([state]);
|
|
94
97
|
}
|
|
95
98
|
|
|
96
|
-
private static getFinalState(states:
|
|
97
|
-
if (states.includes(
|
|
98
|
-
return ExtractionStates.Failed;
|
|
99
|
+
private static getFinalState(states: ExtractionState[]): ExtractionStates {
|
|
100
|
+
if (states.includes(ExtractionState.Failed)) return ExtractionStates.Failed;
|
|
99
101
|
|
|
100
|
-
if (states.includes(
|
|
101
|
-
return ExtractionStates.Queued;
|
|
102
|
+
if (states.includes(ExtractionState.Queued)) return ExtractionStates.Queued;
|
|
102
103
|
|
|
103
|
-
if (states.includes(
|
|
104
|
-
return ExtractionStates.Running;
|
|
104
|
+
if (states.includes(ExtractionState.Running)) return ExtractionStates.Running;
|
|
105
105
|
|
|
106
|
-
if (states.includes(
|
|
107
|
-
return ExtractionStates.Succeeded;
|
|
106
|
+
if (states.includes(ExtractionState.Succeeded)) return ExtractionStates.Succeeded;
|
|
108
107
|
|
|
109
108
|
return ExtractionStates.Failed;
|
|
110
109
|
}
|
|
111
110
|
|
|
112
|
-
private async getState(runId: string): Promise<
|
|
111
|
+
private async getState(runId: string): Promise<ExtractionState> {
|
|
113
112
|
try {
|
|
114
113
|
const accessToken = await this._accessToken();
|
|
115
114
|
const response = await this._extractionClientApi.getExtractionStatus(accessToken, runId);
|
|
@@ -117,7 +116,7 @@ export class BulkExtractor {
|
|
|
117
116
|
} catch (error: any) {
|
|
118
117
|
handleError(error.status);
|
|
119
118
|
}
|
|
120
|
-
return
|
|
119
|
+
return ExtractionState.Failed;
|
|
121
120
|
}
|
|
122
121
|
|
|
123
122
|
private checkRunning(): void {
|
|
@@ -125,7 +124,7 @@ export class BulkExtractor {
|
|
|
125
124
|
let allFinished = true;
|
|
126
125
|
this._iModels.forEach((iModelId) => {
|
|
127
126
|
const state = this._iModelStates.get(iModelId);
|
|
128
|
-
if (state ===
|
|
127
|
+
if (state === ExtractionState.Queued || state === ExtractionState.Running) {
|
|
129
128
|
allFinished = false;
|
|
130
129
|
}
|
|
131
130
|
});
|
|
@@ -135,26 +134,31 @@ export class BulkExtractor {
|
|
|
135
134
|
}
|
|
136
135
|
|
|
137
136
|
public async runReportExtractions(reportIds: string[]): Promise<void> {
|
|
138
|
-
const
|
|
137
|
+
const extractionDetailsIModelIdMap = new Map<string, ExtractionMapping[]>();
|
|
139
138
|
for (const reportId of reportIds) {
|
|
140
|
-
const
|
|
141
|
-
|
|
139
|
+
const reportExtractionDetails = await this.fetchReportExtractionRequestDetails(reportId);
|
|
140
|
+
const reportIModels = reportExtractionDetails.map((reportExtractionDetail) => reportExtractionDetail.iModelId);
|
|
142
141
|
this._reportIModels.set(reportId, reportIModels);
|
|
142
|
+
reportExtractionDetails.forEach((extractionDetail) => {
|
|
143
|
+
const existingMappings = extractionDetailsIModelIdMap.get(extractionDetail.iModelId) || [];
|
|
144
|
+
extractionDetailsIModelIdMap.set(extractionDetail.iModelId, [...existingMappings, ...extractionDetail.mappings]);
|
|
145
|
+
});
|
|
143
146
|
}
|
|
144
|
-
const iModels = new Set(Array.from(reportIModelIds.values()).flat());
|
|
145
147
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
const extractionDetails: ExtractionRequestDetails[] = Array.from(extractionDetailsIModelIdMap.entries()).map(([iModelId, mappings]) => {
|
|
149
|
+
const mappingSetArray: ExtractionMapping[] = Array.from(new Set(mappings.map((m) => m.id))).map((id) => ({ id }));
|
|
150
|
+
return {
|
|
151
|
+
iModelId,
|
|
152
|
+
mappings: mappingSetArray,
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
await this.runIModelExtractions(extractionDetails);
|
|
149
156
|
}
|
|
150
157
|
|
|
151
|
-
private async runExtraction(
|
|
158
|
+
private async runExtraction(extractionRequestDetails: ExtractionRequestDetails): Promise<string | undefined> {
|
|
152
159
|
try {
|
|
153
|
-
const response = await this._extractionClientApi.runExtraction(
|
|
154
|
-
|
|
155
|
-
iModelId
|
|
156
|
-
);
|
|
157
|
-
this._iModelToast.delete(iModelId);
|
|
160
|
+
const response = await this._extractionClientApi.runExtraction(await this._accessToken(), extractionRequestDetails);
|
|
161
|
+
this._iModelToast.delete(extractionRequestDetails.iModelId);
|
|
158
162
|
return response.id;
|
|
159
163
|
} catch (error: any) {
|
|
160
164
|
handleError(error.status);
|
|
@@ -162,8 +166,8 @@ export class BulkExtractor {
|
|
|
162
166
|
return undefined;
|
|
163
167
|
}
|
|
164
168
|
|
|
165
|
-
public async runIModelExtraction(
|
|
166
|
-
return this.runIModelExtractions([
|
|
169
|
+
public async runIModelExtraction(extractionRequestDetails: ExtractionRequestDetails): Promise<void> {
|
|
170
|
+
return this.runIModelExtractions([extractionRequestDetails]);
|
|
167
171
|
}
|
|
168
172
|
|
|
169
173
|
public setHook(setJobRunning: React.Dispatch<React.SetStateAction<boolean>>, iModels: string[]): void {
|
|
@@ -172,22 +176,27 @@ export class BulkExtractor {
|
|
|
172
176
|
this.checkRunning();
|
|
173
177
|
}
|
|
174
178
|
|
|
175
|
-
public async runIModelExtractions(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
public async runIModelExtractions(extractionRequestsDetails: ExtractionRequestDetails[]): Promise<void> {
|
|
180
|
+
await Promise.all(
|
|
181
|
+
extractionRequestsDetails.map(async (details) => {
|
|
182
|
+
const run = await this.runExtraction(details);
|
|
183
|
+
if (run) {
|
|
184
|
+
this._iModelStates.set(details.iModelId, ExtractionState.Queued);
|
|
185
|
+
this._iModelRun.set(details.iModelId, run);
|
|
186
|
+
}
|
|
187
|
+
}),
|
|
188
|
+
);
|
|
189
|
+
this.checkRunning();
|
|
184
190
|
}
|
|
185
191
|
|
|
186
|
-
private async
|
|
187
|
-
const reportMappings = await this._reportsClientApi.getReportMappings(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
+
private async fetchReportExtractionRequestDetails(reportId: string): Promise<ExtractionRequestDetails[]> {
|
|
193
|
+
const reportMappings = await this._reportsClientApi.getReportMappings(await this._accessToken(), reportId);
|
|
194
|
+
const extractionRequestDetails: ExtractionRequestDetails[] = reportMappings.map((reportMapping) => {
|
|
195
|
+
return {
|
|
196
|
+
iModelId: reportMapping.imodelId,
|
|
197
|
+
mappings: [{ id: reportMapping.mappingId }],
|
|
198
|
+
};
|
|
199
|
+
});
|
|
200
|
+
return extractionRequestDetails;
|
|
192
201
|
}
|
|
193
202
|
}
|
|
@@ -1,7 +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
|
export const STATUS_CHECK_INTERVAL = 5000;
|
|
6
6
|
export const ANIMATION_DELAY = "5s";
|
|
7
7
|
export const ANIMATION_DURATION = "1s";
|
|
8
|
+
|
|
9
|
+
export const IMODELS_BASE_URL = "https://api.bentley.com/imodels";
|
|
@@ -1,15 +1,8 @@
|
|
|
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 {
|
|
6
|
-
Button,
|
|
7
|
-
MiddleTextTruncation,
|
|
8
|
-
Modal,
|
|
9
|
-
ModalButtonBar,
|
|
10
|
-
ModalContent,
|
|
11
|
-
Text,
|
|
12
|
-
} from "@itwin/itwinui-react";
|
|
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 { Button, MiddleTextTruncation, Modal, ModalButtonBar, ModalContent, Text } from "@itwin/itwinui-react";
|
|
13
6
|
import React, { useState } from "react";
|
|
14
7
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
15
8
|
import "./DeleteModal.scss";
|
|
@@ -22,12 +15,7 @@ export interface DeleteModalProps {
|
|
|
22
15
|
refresh: () => Promise<void>;
|
|
23
16
|
}
|
|
24
17
|
|
|
25
|
-
export const DeleteModal = ({
|
|
26
|
-
entityName,
|
|
27
|
-
onClose,
|
|
28
|
-
onDelete,
|
|
29
|
-
refresh,
|
|
30
|
-
}: DeleteModalProps) => {
|
|
18
|
+
export const DeleteModal = ({ entityName, onClose, onDelete, refresh }: DeleteModalProps) => {
|
|
31
19
|
const [isDeleting, setIsDeleting] = useState<boolean>(false);
|
|
32
20
|
|
|
33
21
|
const deleteCallback = async () => {
|
|
@@ -45,20 +33,14 @@ export const DeleteModal = ({
|
|
|
45
33
|
|
|
46
34
|
return (
|
|
47
35
|
<Modal
|
|
48
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
49
|
-
"ReportsConfigWidget:Confirm"
|
|
50
|
-
)}
|
|
36
|
+
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Confirm")}
|
|
51
37
|
isOpen={!!entityName}
|
|
52
38
|
isDismissible={!isDeleting}
|
|
53
39
|
onClose={onClose}
|
|
54
40
|
>
|
|
55
41
|
<ModalContent>
|
|
56
42
|
<div className="rcw-delete-modal-body-text">
|
|
57
|
-
<Text variant=
|
|
58
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
59
|
-
"ReportsConfigWidget:AreYouSureYouWantToDelete"
|
|
60
|
-
)}
|
|
61
|
-
</Text>
|
|
43
|
+
<Text variant="leading">{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:AreYouSureYouWantToDelete")}</Text>
|
|
62
44
|
<strong>{<MiddleTextTruncation text={`${entityName}?`} />}</strong>
|
|
63
45
|
</div>
|
|
64
46
|
</ModalContent>
|
|
@@ -68,23 +50,11 @@ export const DeleteModal = ({
|
|
|
68
50
|
<LoadingSpinner />
|
|
69
51
|
</div>
|
|
70
52
|
)}
|
|
71
|
-
<Button
|
|
72
|
-
|
|
73
|
-
onClick={deleteCallback}
|
|
74
|
-
disabled={isDeleting}
|
|
75
|
-
>
|
|
76
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
77
|
-
"ReportsConfigWidget:Delete"
|
|
78
|
-
)}
|
|
53
|
+
<Button styleType="high-visibility" onClick={deleteCallback} disabled={isDeleting}>
|
|
54
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Delete")}
|
|
79
55
|
</Button>
|
|
80
|
-
<Button
|
|
81
|
-
|
|
82
|
-
onClick={onClose}
|
|
83
|
-
disabled={isDeleting}
|
|
84
|
-
>
|
|
85
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
86
|
-
"ReportsConfigWidget:Cancel"
|
|
87
|
-
)}
|
|
56
|
+
<Button styleType="default" onClick={onClose} disabled={isDeleting}>
|
|
57
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Cancel")}
|
|
88
58
|
</Button>
|
|
89
59
|
</ModalButtonBar>
|
|
90
60
|
</Modal>
|
|
@@ -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 React from "react";
|
|
6
6
|
import { SvgStatusError } from "@itwin/itwinui-icons-color-react";
|
|
7
7
|
import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
|
|
@@ -13,12 +13,7 @@ interface ExtractionStateProps {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const FailedExtractionState = ({ animation, onAnimationEnd }: ExtractionStateProps) => (
|
|
16
|
-
<div
|
|
17
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
18
|
-
"ReportsConfigWidget:Failed"
|
|
19
|
-
)}
|
|
20
|
-
className="rcw-extraction-status"
|
|
21
|
-
>
|
|
16
|
+
<div title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Failed")} className="rcw-extraction-status">
|
|
22
17
|
<div
|
|
23
18
|
className={`rcw-status-icon`}
|
|
24
19
|
style={{
|
|
@@ -1,18 +1,13 @@
|
|
|
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 { SvgStatusPending } from "@itwin/itwinui-icons-color-react";
|
|
7
7
|
import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
|
|
8
8
|
|
|
9
9
|
export const QueuedExtractionState = () => (
|
|
10
|
-
<div
|
|
11
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
12
|
-
"ReportsConfigWidget:Queued"
|
|
13
|
-
)}
|
|
14
|
-
className="rcw-extraction-status"
|
|
15
|
-
>
|
|
10
|
+
<div title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Queued")} className="rcw-extraction-status">
|
|
16
11
|
<div className="rcw-status-icon">
|
|
17
12
|
<SvgStatusPending />
|
|
18
13
|
</div>
|
|
@@ -1,18 +1,13 @@
|
|
|
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 { ProgressRadial } from "@itwin/itwinui-react";
|
|
7
7
|
import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
|
|
8
8
|
|
|
9
9
|
export const RunningExtractionState = () => (
|
|
10
|
-
<div
|
|
11
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
12
|
-
"ReportsConfigWidget:Running"
|
|
13
|
-
)}
|
|
14
|
-
className="rcw-extraction-status-running"
|
|
15
|
-
>
|
|
10
|
+
<div title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Running")} className="rcw-extraction-status-running">
|
|
16
11
|
<ProgressRadial size="x-small" indeterminate />
|
|
17
12
|
</div>
|
|
18
13
|
);
|
|
@@ -1,20 +1,13 @@
|
|
|
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 { SvgStatusPendingHollow } from "@itwin/itwinui-icons-color-react";
|
|
7
7
|
import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
|
|
8
8
|
|
|
9
9
|
export const StartingExtractionState = () => (
|
|
10
|
-
<div
|
|
11
|
-
title={
|
|
12
|
-
ReportsConfigWidget.localization.getLocalizedString(
|
|
13
|
-
"ReportsConfigWidget:Starting"
|
|
14
|
-
)
|
|
15
|
-
}
|
|
16
|
-
className="rcw-extraction-status"
|
|
17
|
-
>
|
|
10
|
+
<div title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Starting")} className="rcw-extraction-status">
|
|
18
11
|
<div className="rcw-status-icon">
|
|
19
12
|
<SvgStatusPendingHollow />
|
|
20
13
|
</div>
|
|
@@ -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 React from "react";
|
|
6
6
|
import { SvgStatusSuccess } from "@itwin/itwinui-icons-color-react";
|
|
7
7
|
import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
|
|
@@ -13,12 +13,7 @@ interface ExtractionStateProps {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const SucceededExtractionState = ({ animation, onAnimationEnd }: ExtractionStateProps) => (
|
|
16
|
-
<div
|
|
17
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
18
|
-
"ReportsConfigWidget:Success"
|
|
19
|
-
)}
|
|
20
|
-
className="rcw-extraction-status"
|
|
21
|
-
>
|
|
16
|
+
<div title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Success")} className="rcw-extraction-status">
|
|
22
17
|
<div
|
|
23
18
|
className={`rcw-status-icon`}
|
|
24
19
|
data-testid="rcw-success-animation"
|