@itwin/reports-config-widget-react 0.5.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 +47 -1
- package/CHANGELOG.md +14 -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 +505 -504
- package/coverage/coverage-final.json +32 -32
- package/coverage/lcov-report/index.html +24 -24
- 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 +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 +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 +86 -299
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +40 -202
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +59 -44
- 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 +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 +6 -12
- 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 +917 -893
- 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 +3 -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 +7 -0
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +8 -3
- 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 +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.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 +8 -0
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.js +13 -5
- 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 +2 -4
- 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.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.js +3 -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 +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.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 +8 -0
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.js +14 -6
- 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 +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.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 +3 -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 +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 +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 +59 -130
- package/src/widget/components/Reports.scss +0 -1
- package/src/widget/components/Reports.tsx +28 -82
- package/src/widget/components/ReportsConfigContext.tsx +30 -25
- 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 +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 +4 -6
- package/src/widget/hooks/useValidator.ts +10 -24
- package/tsconfig.json +11 -11
|
@@ -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, { useCallback, useEffect, useRef, useState } from "react";
|
|
6
6
|
import type { BulkExtractor } from "./BulkExtractor";
|
|
7
7
|
import { ExtractionStates, ExtractionStatus } from "./ExtractionStatus";
|
|
@@ -9,12 +9,10 @@ import type { BeEvent } from "@itwin/core-bentley";
|
|
|
9
9
|
import { STATUS_CHECK_INTERVAL } from "./Constants";
|
|
10
10
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
11
11
|
import { IconButton } from "@itwin/itwinui-react";
|
|
12
|
-
import {
|
|
13
|
-
SvgDelete,
|
|
14
|
-
SvgPlay,
|
|
15
|
-
} from "@itwin/itwinui-icons-react";
|
|
12
|
+
import { SvgDelete, SvgPlay } from "@itwin/itwinui-icons-react";
|
|
16
13
|
import { HorizontalTile } from "./HorizontalTile";
|
|
17
14
|
import type { ReportMappingAndMapping } from "./ReportMappings";
|
|
15
|
+
import type { ExtractionRequestDetails } from "@itwin/insights-client";
|
|
18
16
|
|
|
19
17
|
export interface ReportMappingHorizontalTileProps {
|
|
20
18
|
jobStartEvent: BeEvent<(iModelId: string) => void>;
|
|
@@ -26,15 +24,12 @@ export interface ReportMappingHorizontalTileProps {
|
|
|
26
24
|
|
|
27
25
|
export const ReportMappingHorizontalTile = (props: ReportMappingHorizontalTileProps) => {
|
|
28
26
|
const [extractionState, setExtractionState] = useState<ExtractionStates>(ExtractionStates.None);
|
|
29
|
-
const [jobStarted, setJobStarted] = useState<boolean>(true);
|
|
30
27
|
const interval = useRef<number>();
|
|
31
|
-
const initialLoad = useRef<boolean>(true);
|
|
32
28
|
|
|
33
29
|
useEffect(() => {
|
|
34
30
|
const listener = (startedIModelId: string) => {
|
|
35
31
|
if (startedIModelId === props.mapping.imodelId) {
|
|
36
32
|
setExtractionState(ExtractionStates.Starting);
|
|
37
|
-
setJobStarted(true);
|
|
38
33
|
}
|
|
39
34
|
};
|
|
40
35
|
props.jobStartEvent.addListener(listener);
|
|
@@ -42,87 +37,84 @@ export const ReportMappingHorizontalTile = (props: ReportMappingHorizontalTilePr
|
|
|
42
37
|
return () => {
|
|
43
38
|
props.jobStartEvent.removeListener(listener);
|
|
44
39
|
};
|
|
45
|
-
}, [props.jobStartEvent, props.mapping]);
|
|
40
|
+
}, [props.jobStartEvent, props.mapping.imodelId]);
|
|
46
41
|
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
const updateExtractionState = useCallback(async () => {
|
|
43
|
+
try {
|
|
44
|
+
const state = await props.bulkExtractor.getIModelState(props.mapping.imodelId, props.mapping.iModelName, props.odataFeedUrl);
|
|
45
|
+
if (state === ExtractionStates.Failed || state === ExtractionStates.Succeeded) {
|
|
46
|
+
if (extractionState === ExtractionStates.Running) {
|
|
47
|
+
setExtractionState(state);
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
setExtractionState(state);
|
|
55
51
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
52
|
+
} catch (error) {
|
|
53
|
+
setExtractionState(ExtractionStates.Failed);
|
|
54
|
+
/* eslint-disable no-console */
|
|
55
|
+
console.error(error);
|
|
58
56
|
}
|
|
59
|
-
|
|
60
|
-
}, [props.mapping, props.bulkExtractor, props.odataFeedUrl]);
|
|
57
|
+
}, [props.bulkExtractor, props.mapping.imodelId, props.mapping.iModelName, props.odataFeedUrl, extractionState]);
|
|
61
58
|
|
|
62
59
|
useEffect(() => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
await getExtractionState();
|
|
73
|
-
}, STATUS_CHECK_INTERVAL);
|
|
74
|
-
}
|
|
60
|
+
void updateExtractionState();
|
|
61
|
+
}, [extractionState, updateExtractionState]);
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
window.clearInterval(interval.current);
|
|
65
|
+
if (extractionState === ExtractionStates.None) return;
|
|
66
|
+
interval.current = window.setInterval(async () => {
|
|
67
|
+
await updateExtractionState();
|
|
68
|
+
}, STATUS_CHECK_INTERVAL);
|
|
75
69
|
return () => window.clearInterval(interval.current);
|
|
76
|
-
}, [
|
|
70
|
+
}, [extractionState, updateExtractionState]);
|
|
71
|
+
|
|
72
|
+
const handleUpdateDataset = useCallback(async () => {
|
|
73
|
+
setExtractionState(ExtractionStates.Starting);
|
|
74
|
+
const extractionRequestDetails: ExtractionRequestDetails = {
|
|
75
|
+
iModelId: props.mapping.imodelId,
|
|
76
|
+
mappings: [{ id: props.mapping.mappingId }],
|
|
77
|
+
};
|
|
78
|
+
await props.bulkExtractor.runIModelExtraction(extractionRequestDetails);
|
|
79
|
+
props.jobStartEvent.raiseEvent(props.mapping.imodelId);
|
|
80
|
+
}, [props.bulkExtractor, props.jobStartEvent, props.mapping.imodelId, props.mapping.mappingId]);
|
|
77
81
|
|
|
78
82
|
return (
|
|
79
83
|
<HorizontalTile
|
|
80
84
|
title={props.mapping.mappingName}
|
|
81
85
|
subText={props.mapping.iModelName}
|
|
82
86
|
titleTooltip={props.mapping.mappingDescription}
|
|
83
|
-
actionGroup={
|
|
84
|
-
<div
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}}
|
|
100
|
-
disabled={jobStarted}
|
|
101
|
-
>
|
|
102
|
-
<SvgPlay />
|
|
103
|
-
</IconButton>
|
|
104
|
-
<IconButton
|
|
105
|
-
styleType="borderless"
|
|
106
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
107
|
-
"ReportsConfigWidget:Remove"
|
|
108
|
-
)}
|
|
109
|
-
onClick={() => {
|
|
110
|
-
props.onClickDelete();
|
|
111
|
-
}}
|
|
112
|
-
>
|
|
113
|
-
<SvgDelete />
|
|
114
|
-
</IconButton>
|
|
115
|
-
</>
|
|
116
|
-
) : (
|
|
117
|
-
<ExtractionStatus
|
|
118
|
-
state={extractionState}
|
|
119
|
-
clearExtractionState={() => {
|
|
120
|
-
setExtractionState(ExtractionStates.None);
|
|
87
|
+
actionGroup={
|
|
88
|
+
<div className="rcw-action-button" data-testid="tile-action-button">
|
|
89
|
+
{extractionState === ExtractionStates.None ? (
|
|
90
|
+
<>
|
|
91
|
+
<IconButton
|
|
92
|
+
styleType="borderless"
|
|
93
|
+
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:UpdateDataset")}
|
|
94
|
+
onClick={handleUpdateDataset}
|
|
95
|
+
>
|
|
96
|
+
<SvgPlay />
|
|
97
|
+
</IconButton>
|
|
98
|
+
<IconButton
|
|
99
|
+
styleType="borderless"
|
|
100
|
+
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Remove")}
|
|
101
|
+
onClick={() => {
|
|
102
|
+
props.onClickDelete();
|
|
121
103
|
}}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
104
|
+
>
|
|
105
|
+
<SvgDelete />
|
|
106
|
+
</IconButton>
|
|
107
|
+
</>
|
|
108
|
+
) : (
|
|
109
|
+
<ExtractionStatus
|
|
110
|
+
state={extractionState}
|
|
111
|
+
clearExtractionState={() => {
|
|
112
|
+
setExtractionState(ExtractionStates.None);
|
|
113
|
+
}}
|
|
114
|
+
></ExtractionStatus>
|
|
115
|
+
)}
|
|
116
|
+
</div>
|
|
117
|
+
}
|
|
126
118
|
/>
|
|
127
119
|
);
|
|
128
120
|
};
|
|
@@ -1,37 +1,18 @@
|
|
|
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
|
-
|
|
7
|
-
SvgCopy,
|
|
8
|
-
SvgRefresh,
|
|
9
|
-
} from "@itwin/itwinui-icons-react";
|
|
10
|
-
import {
|
|
11
|
-
Button,
|
|
12
|
-
IconButton,
|
|
13
|
-
LabeledInput,
|
|
14
|
-
Text,
|
|
15
|
-
toaster,
|
|
16
|
-
} 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 { SvgAdd, SvgCopy, SvgRefresh } from "@itwin/itwinui-icons-react";
|
|
6
|
+
import { Button, IconButton, LabeledInput, Text, toaster } from "@itwin/itwinui-react";
|
|
17
7
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
18
8
|
import type { CreateTypeFromInterface } from "./utils";
|
|
19
|
-
import {
|
|
20
|
-
EmptyMessage,
|
|
21
|
-
generateUrl,
|
|
22
|
-
handleError,
|
|
23
|
-
LoadingOverlay,
|
|
24
|
-
LoadingSpinner,
|
|
25
|
-
} from "./utils";
|
|
9
|
+
import { EmptyMessage, generateUrl, handleError, LoadingOverlay, LoadingSpinner } from "./utils";
|
|
26
10
|
import "./ReportMappings.scss";
|
|
27
11
|
import DeleteModal from "./DeleteModal";
|
|
28
|
-
import type { MappingsClient, Report, ReportMapping, ReportsClient } from "@itwin/insights-client";
|
|
12
|
+
import type { ExtractionRequestDetails, MappingsClient, Report, ReportMapping, ReportsClient } from "@itwin/insights-client";
|
|
29
13
|
import { REPORTING_BASE_PATH } from "@itwin/insights-client";
|
|
30
14
|
import { AddMappingsModal } from "./AddMappingsModal";
|
|
31
|
-
import type {
|
|
32
|
-
GetSingleIModelParams,
|
|
33
|
-
IModelsClient,
|
|
34
|
-
} from "@itwin/imodels-client-management";
|
|
15
|
+
import type { GetSingleIModelParams, IModelsClient } from "@itwin/imodels-client-management";
|
|
35
16
|
import { AccessTokenAdapter } from "@itwin/imodels-access-frontend";
|
|
36
17
|
import { SearchBar } from "./SearchBar";
|
|
37
18
|
import { useReportsConfigApi } from "../context/ReportsConfigApiContext";
|
|
@@ -40,7 +21,6 @@ import { ReportMappingHorizontalTile } from "./ReportMappingHorizontalTile";
|
|
|
40
21
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
41
22
|
import { BeEvent } from "@itwin/core-bentley";
|
|
42
23
|
import { useBulkExtractor } from "../context/BulkExtractorContext";
|
|
43
|
-
|
|
44
24
|
export type ReportMappingType = CreateTypeFromInterface<ReportMapping>;
|
|
45
25
|
|
|
46
26
|
export type ReportMappingAndMapping = ReportMappingType & {
|
|
@@ -56,28 +36,20 @@ const fetchReportMappings = async (
|
|
|
56
36
|
reportsClient: ReportsClient,
|
|
57
37
|
mappingsClient: MappingsClient,
|
|
58
38
|
iModelsClient: IModelsClient,
|
|
59
|
-
getAccessToken: () => Promise<AccessToken
|
|
39
|
+
getAccessToken: () => Promise<AccessToken>,
|
|
60
40
|
) => {
|
|
61
41
|
try {
|
|
62
42
|
setIsLoading(true);
|
|
63
43
|
const accessToken = await getAccessToken();
|
|
64
|
-
const reportMappings = await reportsClient.getReportMappings(
|
|
65
|
-
|
|
66
|
-
reportId
|
|
67
|
-
);
|
|
68
|
-
const authorization =
|
|
69
|
-
AccessTokenAdapter.toAuthorizationCallback(accessToken);
|
|
44
|
+
const reportMappings = await reportsClient.getReportMappings(accessToken, reportId);
|
|
45
|
+
const authorization = AccessTokenAdapter.toAuthorizationCallback(accessToken);
|
|
70
46
|
const iModelNames = new Map<string, string>();
|
|
71
47
|
|
|
72
48
|
const reportMappingsAndMappings = [];
|
|
73
49
|
for (const reportMapping of reportMappings) {
|
|
74
50
|
const iModelId = reportMapping.imodelId;
|
|
75
51
|
let iModelName = "";
|
|
76
|
-
const mapping = await mappingsClient.getMapping(
|
|
77
|
-
accessToken,
|
|
78
|
-
iModelId,
|
|
79
|
-
reportMapping.mappingId
|
|
80
|
-
);
|
|
52
|
+
const mapping = await mappingsClient.getMapping(accessToken, reportMapping.mappingId);
|
|
81
53
|
if (iModelNames.has(iModelId)) {
|
|
82
54
|
iModelName = iModelNames.get(iModelId) ?? "";
|
|
83
55
|
} else {
|
|
@@ -106,12 +78,20 @@ const fetchReportMappings = async (
|
|
|
106
78
|
}
|
|
107
79
|
};
|
|
108
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Props for the {@link ReportMappings} component.
|
|
83
|
+
* @public
|
|
84
|
+
*/
|
|
109
85
|
export interface ReportMappingsProps {
|
|
110
86
|
report: Report;
|
|
111
87
|
onClickClose: () => void;
|
|
112
88
|
defaultIModelId?: string;
|
|
113
89
|
}
|
|
114
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Component to display and manage report mappings.
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
115
95
|
export const ReportMappings = ({ report, onClickClose, defaultIModelId }: ReportMappingsProps) => {
|
|
116
96
|
const { getAccessToken, reportsClient, iModelsClient, mappingsClient, baseUrl } = useReportsConfigApi();
|
|
117
97
|
const [showDeleteModal, setShowDeleteModal] = useState<ReportMappingAndMapping | undefined>(undefined);
|
|
@@ -121,61 +101,39 @@ export const ReportMappings = ({ report, onClickClose, defaultIModelId }: Report
|
|
|
121
101
|
const [searchValue, setSearchValue] = useState<string>("");
|
|
122
102
|
const [reportMappings, setReportMappings] = useState<ReportMappingAndMapping[]>([]);
|
|
123
103
|
const [jobRunning, setJobRunning] = useState<boolean>(false);
|
|
124
|
-
const jobStartEvent = useMemo(
|
|
125
|
-
() => new BeEvent<(iModelId: string) => void>(),
|
|
126
|
-
[]
|
|
127
|
-
);
|
|
104
|
+
const jobStartEvent = useMemo(() => new BeEvent<(iModelId: string) => void>(), []);
|
|
128
105
|
|
|
129
106
|
useEffect(() => {
|
|
130
|
-
void fetchReportMappings(
|
|
131
|
-
setReportMappings,
|
|
132
|
-
report.id,
|
|
133
|
-
setIsLoading,
|
|
134
|
-
reportsClient,
|
|
135
|
-
mappingsClient,
|
|
136
|
-
iModelsClient,
|
|
137
|
-
getAccessToken
|
|
138
|
-
);
|
|
107
|
+
void fetchReportMappings(setReportMappings, report.id, setIsLoading, reportsClient, mappingsClient, iModelsClient, getAccessToken);
|
|
139
108
|
}, [getAccessToken, iModelsClient, mappingsClient, report.id, reportsClient, setIsLoading]);
|
|
140
109
|
|
|
141
110
|
useEffect(() => {
|
|
142
111
|
if (!bulkExtractor) return;
|
|
143
|
-
bulkExtractor.setHook(
|
|
112
|
+
bulkExtractor.setHook(
|
|
113
|
+
setJobRunning,
|
|
114
|
+
reportMappings.map((x) => x.imodelId),
|
|
115
|
+
);
|
|
144
116
|
}, [bulkExtractor, reportMappings]);
|
|
145
117
|
|
|
146
118
|
const refresh = useCallback(async () => {
|
|
147
|
-
await fetchReportMappings(
|
|
148
|
-
setReportMappings,
|
|
149
|
-
report.id,
|
|
150
|
-
setIsLoading,
|
|
151
|
-
reportsClient,
|
|
152
|
-
mappingsClient,
|
|
153
|
-
iModelsClient,
|
|
154
|
-
getAccessToken
|
|
155
|
-
);
|
|
119
|
+
await fetchReportMappings(setReportMappings, report.id, setIsLoading, reportsClient, mappingsClient, iModelsClient, getAccessToken);
|
|
156
120
|
}, [getAccessToken, iModelsClient, mappingsClient, report.id, reportsClient]);
|
|
157
121
|
|
|
158
|
-
const odataFeedUrl = `${generateUrl(
|
|
159
|
-
REPORTING_BASE_PATH,
|
|
160
|
-
baseUrl
|
|
161
|
-
)}/odata/${report.id}`;
|
|
122
|
+
const odataFeedUrl = `${generateUrl(REPORTING_BASE_PATH, baseUrl)}/odata/${report.id}`;
|
|
162
123
|
|
|
163
124
|
const addMapping = useCallback(() => {
|
|
164
125
|
setShowAddMapping(true);
|
|
165
126
|
}, []);
|
|
166
127
|
|
|
167
128
|
const filteredReportMappings = useMemo(
|
|
168
|
-
() =>
|
|
169
|
-
|
|
170
|
-
[x.iModelName, x.mappingName, x.mappingDescription]
|
|
171
|
-
.join(" ")
|
|
172
|
-
.toLowerCase()
|
|
173
|
-
.includes(searchValue.toLowerCase())
|
|
174
|
-
),
|
|
175
|
-
[reportMappings, searchValue]
|
|
129
|
+
() => reportMappings.filter((x) => [x.iModelName, x.mappingName, x.mappingDescription].join(" ").toLowerCase().includes(searchValue.toLowerCase())),
|
|
130
|
+
[reportMappings, searchValue],
|
|
176
131
|
);
|
|
177
132
|
|
|
178
|
-
const onAddMappingsModalClose = useCallback(async () => {
|
|
133
|
+
const onAddMappingsModalClose = useCallback(async () => {
|
|
134
|
+
await refresh();
|
|
135
|
+
setShowAddMapping(false);
|
|
136
|
+
}, [refresh]);
|
|
179
137
|
|
|
180
138
|
if (!bulkExtractor) return null;
|
|
181
139
|
|
|
@@ -183,24 +141,16 @@ export const ReportMappings = ({ report, onClickClose, defaultIModelId }: Report
|
|
|
183
141
|
<>
|
|
184
142
|
<div className="rcw-report-mappings-container">
|
|
185
143
|
<LabeledInput
|
|
186
|
-
label={ReportsConfigWidget.localization.getLocalizedString(
|
|
187
|
-
"ReportsConfigWidget:ODataFeedURL"
|
|
188
|
-
)}
|
|
144
|
+
label={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ODataFeedURL")}
|
|
189
145
|
className="rcw-odata-url-input"
|
|
190
146
|
readOnly={true}
|
|
191
147
|
value={odataFeedUrl}
|
|
192
148
|
svgIcon={
|
|
193
149
|
<IconButton
|
|
194
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
195
|
-
"ReportsConfigWidget:Copy"
|
|
196
|
-
)}
|
|
150
|
+
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Copy")}
|
|
197
151
|
onClick={async (_) => {
|
|
198
152
|
await navigator.clipboard.writeText(odataFeedUrl);
|
|
199
|
-
toaster.positive(
|
|
200
|
-
ReportsConfigWidget.localization.getLocalizedString(
|
|
201
|
-
"ReportsConfigWidget:CopiedToClipboard"
|
|
202
|
-
)
|
|
203
|
-
);
|
|
153
|
+
toaster.positive(ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:CopiedToClipboard"));
|
|
204
154
|
}}
|
|
205
155
|
>
|
|
206
156
|
<SvgCopy />
|
|
@@ -209,31 +159,19 @@ export const ReportMappings = ({ report, onClickClose, defaultIModelId }: Report
|
|
|
209
159
|
iconDisplayStyle="inline"
|
|
210
160
|
/>
|
|
211
161
|
<div className="rcw-toolbar">
|
|
212
|
-
<Button
|
|
213
|
-
|
|
214
|
-
onClick={() => addMapping()}
|
|
215
|
-
styleType="high-visibility"
|
|
216
|
-
>
|
|
217
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
218
|
-
"ReportsConfigWidget:AddMapping"
|
|
219
|
-
)}
|
|
162
|
+
<Button startIcon={<SvgAdd />} onClick={() => addMapping()} styleType="high-visibility">
|
|
163
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:AddMapping")}
|
|
220
164
|
</Button>
|
|
221
165
|
<div className="rcw-search-bar-container" data-testid="rcw-search-bar">
|
|
222
166
|
<IconButton
|
|
223
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
224
|
-
"ReportsConfigWidget:Refresh"
|
|
225
|
-
)}
|
|
167
|
+
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Refresh")}
|
|
226
168
|
onClick={refresh}
|
|
227
169
|
disabled={isLoading}
|
|
228
|
-
styleType=
|
|
170
|
+
styleType="borderless"
|
|
229
171
|
>
|
|
230
172
|
<SvgRefresh />
|
|
231
173
|
</IconButton>
|
|
232
|
-
<SearchBar
|
|
233
|
-
searchValue={searchValue}
|
|
234
|
-
setSearchValue={setSearchValue}
|
|
235
|
-
disabled={isLoading}
|
|
236
|
-
/>
|
|
174
|
+
<SearchBar searchValue={searchValue} setSearchValue={setSearchValue} disabled={isLoading} />
|
|
237
175
|
</div>
|
|
238
176
|
</div>
|
|
239
177
|
{isLoading ? (
|
|
@@ -241,16 +179,10 @@ export const ReportMappings = ({ report, onClickClose, defaultIModelId }: Report
|
|
|
241
179
|
) : reportMappings.length === 0 ? (
|
|
242
180
|
<EmptyMessage>
|
|
243
181
|
<>
|
|
244
|
-
<Text>
|
|
245
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
246
|
-
"ReportsConfigWidget:NoReportMappings"
|
|
247
|
-
)}
|
|
248
|
-
</Text>
|
|
182
|
+
<Text>{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:NoReportMappings")}</Text>
|
|
249
183
|
<div>
|
|
250
184
|
<Button onClick={addMapping} styleType="cta">
|
|
251
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
252
|
-
"ReportsConfigWidget:LetsAddSomeMappingsCTA"
|
|
253
|
-
)}
|
|
185
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:LetsAddSomeMappingsCTA")}
|
|
254
186
|
</Button>
|
|
255
187
|
</div>
|
|
256
188
|
</>
|
|
@@ -283,11 +215,7 @@ export const ReportMappings = ({ report, onClickClose, defaultIModelId }: Report
|
|
|
283
215
|
entityName={showDeleteModal?.mappingName ?? ""}
|
|
284
216
|
onDelete={async () => {
|
|
285
217
|
const accessToken = await getAccessToken();
|
|
286
|
-
await reportsClient.deleteReportMapping(
|
|
287
|
-
accessToken,
|
|
288
|
-
report.id,
|
|
289
|
-
showDeleteModal?.mappingId ?? ""
|
|
290
|
-
);
|
|
218
|
+
await reportsClient.deleteReportMapping(accessToken, report.id, showDeleteModal?.mappingId ?? "");
|
|
291
219
|
}}
|
|
292
220
|
refresh={refresh}
|
|
293
221
|
onClose={() => setShowDeleteModal(undefined)}
|
|
@@ -300,25 +228,26 @@ export const ReportMappings = ({ report, onClickClose, defaultIModelId }: Report
|
|
|
300
228
|
onClick={async () => {
|
|
301
229
|
setJobRunning(true);
|
|
302
230
|
const uniqueIModels = Array.from(new Set(reportMappings.map((x) => x.imodelId)));
|
|
303
|
-
|
|
231
|
+
const iModelsAndMappings: ExtractionRequestDetails[] = uniqueIModels.map((iModelId) => {
|
|
232
|
+
return {
|
|
233
|
+
iModelId,
|
|
234
|
+
mappings: reportMappings
|
|
235
|
+
.filter((reportMapping) => reportMapping.imodelId === iModelId)
|
|
236
|
+
.map((reportMappingForIModel) => ({
|
|
237
|
+
id: reportMappingForIModel.mappingId,
|
|
238
|
+
})),
|
|
239
|
+
};
|
|
240
|
+
});
|
|
241
|
+
await bulkExtractor.runIModelExtractions(iModelsAndMappings);
|
|
304
242
|
reportMappings.forEach((reportMapping) => {
|
|
305
243
|
jobStartEvent.raiseEvent(reportMapping.imodelId);
|
|
306
244
|
});
|
|
307
245
|
}}
|
|
308
246
|
>
|
|
309
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
310
|
-
"ReportsConfigWidget:UpdateAllDatasets"
|
|
311
|
-
)}
|
|
247
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:UpdateAllDatasets")}
|
|
312
248
|
</Button>
|
|
313
|
-
<Button
|
|
314
|
-
|
|
315
|
-
type="button"
|
|
316
|
-
onClick={onClickClose}
|
|
317
|
-
disabled={isLoading}
|
|
318
|
-
>
|
|
319
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
320
|
-
"ReportsConfigWidget:Close"
|
|
321
|
-
)}
|
|
249
|
+
<Button styleType="default" type="button" onClick={onClickClose} disabled={isLoading}>
|
|
250
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Close")}
|
|
322
251
|
</Button>
|
|
323
252
|
</div>
|
|
324
253
|
</>
|