@itwin/reports-config-widget-react 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +76 -1
- package/CHANGELOG.md +27 -2
- package/LICENSE.md +9 -9
- package/README.md +38 -38
- package/__mocks__/fileMock.js +4 -4
- package/api/reports-config-widget-react.api.md +126 -0
- package/api/reports-config-widget-react.exports.csv +14 -0
- package/api/temp/reports-config-widget-react.api.md +126 -0
- package/coverage/clover.xml +521 -521
- package/coverage/coverage-final.json +32 -32
- package/coverage/lcov-report/index.html +31 -31
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +15 -15
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/test/index.html +11 -11
- package/coverage/lcov-report/src/test/test-utils.tsx.html +46 -16
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +29 -86
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +5 -38
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +25 -121
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +120 -96
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +5 -5
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +13 -103
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +7 -22
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +7 -28
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +20 -47
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +20 -11
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +16 -79
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +15 -108
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +36 -75
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +62 -92
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +104 -128
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +88 -301
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +42 -204
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +164 -50
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +15 -63
- package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +8 -47
- package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +6 -12
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +13 -25
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +11 -56
- package/coverage/lcov-report/src/widget/components/index.html +50 -50
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +25 -169
- package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +6 -12
- package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +10 -13
- package/coverage/lcov-report/src/widget/context/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +12 -54
- package/coverage/lcov-report/src/widget/index.html +13 -13
- package/coverage/lcov.info +941 -919
- package/jest.config.js +14 -17
- package/lib/cjs/ReportsConfigWidget.d.ts +4 -0
- package/lib/cjs/ReportsConfigWidget.d.ts.map +1 -1
- package/lib/cjs/ReportsConfigWidget.js +4 -0
- package/lib/cjs/ReportsConfigWidget.js.map +1 -1
- package/lib/cjs/reports-config-widget-react.d.ts +1 -0
- package/lib/cjs/reports-config-widget-react.d.ts.map +1 -1
- package/lib/cjs/reports-config-widget-react.js +4 -3
- package/lib/cjs/reports-config-widget-react.js.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.js +11 -10
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
- package/lib/cjs/test/BulkExtractor.test.js +68 -43
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
- package/lib/cjs/test/DeleteModal.test.js +3 -3
- package/lib/cjs/test/DeleteModal.test.js.map +1 -1
- package/lib/cjs/test/ReportAction.test.js +6 -4
- package/lib/cjs/test/ReportAction.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +64 -25
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/cjs/test/ReportMappings.test.js +39 -18
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +3 -3
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +3 -3
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/test-utils.d.ts +8 -0
- package/lib/cjs/test/test-utils.d.ts.map +1 -1
- package/lib/cjs/test/test-utils.js +16 -4
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +10 -4
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +11 -7
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js +7 -7
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.scss +1 -1
- package/lib/cjs/widget/components/BulkExtractor.d.ts +8 -5
- package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.js +52 -35
- package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
- package/lib/cjs/widget/components/Constants.d.ts.map +1 -1
- package/lib/cjs/widget/components/Constants.js +3 -3
- package/lib/cjs/widget/components/Constants.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js +5 -5
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.scss +2 -2
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.js +9 -9
- package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.scss +1 -1
- package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionToast.js +3 -3
- package/lib/cjs/widget/components/ExtractionToast.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.js +1 -2
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.scss +1 -4
- package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.d.ts +8 -0
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js +9 -7
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.scss +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js +4 -4
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +46 -45
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts +8 -0
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js +25 -11
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/Reports.d.ts +9 -1
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js +7 -8
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/Reports.scss +0 -1
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts +34 -4
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.js +27 -9
- package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.d.ts +3 -6
- package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js +7 -5
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.scss +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsHeader.js +6 -7
- package/lib/cjs/widget/components/ReportsHeader.js.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.js +3 -3
- package/lib/cjs/widget/components/ReportsRouter.js.map +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/cjs/widget/components/SearchBar.js +4 -4
- package/lib/cjs/widget/components/SearchBar.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +1 -1
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.scss +1 -1
- package/lib/cjs/widget/components/utils.d.ts +1 -1
- package/lib/cjs/widget/components/utils.d.ts.map +1 -1
- package/lib/cjs/widget/components/utils.js +5 -5
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts +3 -3
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.d.ts +1 -4
- package/lib/cjs/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.js +3 -3
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
- package/lib/esm/ReportsConfigWidget.d.ts +4 -0
- package/lib/esm/ReportsConfigWidget.d.ts.map +1 -1
- package/lib/esm/ReportsConfigWidget.js +4 -0
- package/lib/esm/ReportsConfigWidget.js.map +1 -1
- package/lib/esm/reports-config-widget-react.d.ts +1 -0
- package/lib/esm/reports-config-widget-react.d.ts.map +1 -1
- package/lib/esm/reports-config-widget-react.js +4 -3
- package/lib/esm/reports-config-widget-react.js.map +1 -1
- package/lib/esm/test/AddMappingModal.test.js +12 -11
- package/lib/esm/test/AddMappingModal.test.js.map +1 -1
- package/lib/esm/test/BulkExtractor.test.js +69 -44
- package/lib/esm/test/BulkExtractor.test.js.map +1 -1
- package/lib/esm/test/DeleteModal.test.js +4 -4
- package/lib/esm/test/DeleteModal.test.js.map +1 -1
- package/lib/esm/test/ReportAction.test.js +7 -5
- package/lib/esm/test/ReportAction.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +65 -26
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/esm/test/ReportMappings.test.js +41 -20
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +4 -4
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +3 -3
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/test-utils.d.ts +8 -0
- package/lib/esm/test/test-utils.d.ts.map +1 -1
- package/lib/esm/test/test-utils.js +15 -3
- package/lib/esm/test/test-utils.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts +10 -4
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.js +12 -8
- package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/esm/widget/components/ActionPanel.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.js +7 -7
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.scss +1 -1
- package/lib/esm/widget/components/BulkExtractor.d.ts +8 -5
- package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.js +53 -36
- package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
- package/lib/esm/widget/components/Constants.d.ts.map +1 -1
- package/lib/esm/widget/components/Constants.js +3 -3
- package/lib/esm/widget/components/Constants.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/esm/widget/components/DeleteModal.js +6 -6
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.scss +2 -2
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.js +9 -9
- package/lib/esm/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.scss +1 -1
- package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionToast.js +3 -3
- package/lib/esm/widget/components/ExtractionToast.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.js +1 -2
- package/lib/esm/widget/components/HorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.scss +1 -4
- package/lib/esm/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.d.ts +8 -0
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.js +10 -8
- package/lib/esm/widget/components/ReportAction.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.scss +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.js +6 -6
- package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js +47 -46
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.d.ts +8 -0
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js +28 -14
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/Reports.d.ts +9 -1
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js +8 -9
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/Reports.scss +0 -1
- package/lib/esm/widget/components/ReportsConfigContext.d.ts +34 -4
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.js +28 -10
- package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.d.ts +3 -6
- package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.js +7 -5
- package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.scss +1 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts +1 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsHeader.js +6 -7
- package/lib/esm/widget/components/ReportsHeader.js.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.js +3 -3
- package/lib/esm/widget/components/ReportsRouter.js.map +1 -1
- package/lib/esm/widget/components/SearchBar.d.ts +1 -1
- package/lib/esm/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/esm/widget/components/SearchBar.js +4 -4
- package/lib/esm/widget/components/SearchBar.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.d.ts +1 -1
- package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/esm/widget/components/SelectIModel.js +2 -2
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.scss +1 -1
- package/lib/esm/widget/components/utils.d.ts +1 -1
- package/lib/esm/widget/components/utils.d.ts.map +1 -1
- package/lib/esm/widget/components/utils.js +6 -6
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts +3 -3
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/esm/widget/hooks/useValidator.d.ts +1 -4
- package/lib/esm/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/esm/widget/hooks/useValidator.js +3 -3
- package/lib/esm/widget/hooks/useValidator.js.map +1 -1
- package/package.json +9 -4
- package/src/ReportsConfigWidget.ts +9 -9
- package/src/reports-config-widget-react.ts +4 -3
- package/src/test/AddMappingModal.test.tsx +45 -70
- package/src/test/BulkExtractor.test.ts +73 -118
- package/src/test/DeleteModal.test.tsx +6 -23
- package/src/test/ReportAction.test.tsx +20 -38
- package/src/test/ReportMappingHorizontalTile.test.tsx +137 -106
- package/src/test/ReportMappings.test.tsx +73 -88
- package/src/test/Reports.test.tsx +30 -64
- package/src/test/WidgetHeader.test.tsx +3 -3
- package/src/test/test-utils.tsx +18 -8
- package/src/widget/ReportsConfigUiProvider.tsx +18 -37
- package/src/widget/components/ActionPanel.tsx +3 -14
- package/src/widget/components/AddMappingsModal.scss +1 -1
- package/src/widget/components/AddMappingsModal.tsx +21 -53
- package/src/widget/components/BulkExtractor.ts +67 -59
- package/src/widget/components/Constants.ts +4 -4
- package/src/widget/components/DeleteModal.scss +2 -2
- package/src/widget/components/DeleteModal.tsx +11 -41
- package/src/widget/components/ExtractionStates/FailedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/QueuedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/RunningExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/StartingExtractionState.tsx +4 -11
- package/src/widget/components/ExtractionStates/SucceededExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStatus.scss +1 -1
- package/src/widget/components/ExtractionStatus.tsx +9 -18
- package/src/widget/components/ExtractionToast.tsx +12 -9
- package/src/widget/components/HorizontalTile.scss +1 -4
- package/src/widget/components/HorizontalTile.tsx +12 -33
- package/src/widget/components/LocalizedTablePaginator.tsx +13 -44
- package/src/widget/components/ReportAction.scss +1 -1
- package/src/widget/components/ReportAction.tsx +26 -39
- package/src/widget/components/ReportHorizontalTile.tsx +45 -55
- package/src/widget/components/ReportMappingHorizontalTile.tsx +70 -78
- package/src/widget/components/ReportMappings.tsx +61 -132
- package/src/widget/components/Reports.scss +0 -1
- package/src/widget/components/Reports.tsx +30 -84
- package/src/widget/components/ReportsConfigContext.tsx +70 -32
- package/src/widget/components/ReportsContainer.scss +1 -1
- package/src/widget/components/ReportsContainer.tsx +12 -28
- package/src/widget/components/ReportsHeader.tsx +6 -19
- package/src/widget/components/ReportsRouter.tsx +4 -6
- package/src/widget/components/SearchBar.tsx +9 -13
- package/src/widget/components/SelectIModel.scss +1 -1
- package/src/widget/components/SelectIModel.tsx +9 -24
- package/src/widget/components/utils.scss +1 -1
- package/src/widget/components/utils.tsx +21 -69
- package/src/widget/context/BulkExtractorContext.tsx +4 -6
- package/src/widget/context/ReportsConfigApiContext.tsx +7 -8
- package/src/widget/hooks/useValidator.ts +10 -24
- package/tsconfig.json +11 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import type { ReactNode } from "react";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { Text } from "@itwin/itwinui-react";
|
|
@@ -19,48 +19,27 @@ export interface HorizontalTileProps extends React.ComponentPropsWithoutRef<"div
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const HorizontalTile = (props: HorizontalTileProps) => {
|
|
22
|
-
const {
|
|
23
|
-
title,
|
|
24
|
-
titleTooltip,
|
|
25
|
-
subText,
|
|
26
|
-
subtextToolTip,
|
|
27
|
-
actionGroup,
|
|
28
|
-
selected,
|
|
29
|
-
className,
|
|
30
|
-
onClickTitle,
|
|
31
|
-
...rest
|
|
32
|
-
} = props;
|
|
22
|
+
const { title, titleTooltip, subText, subtextToolTip, actionGroup, selected, className, onClickTitle, ...rest } = props;
|
|
33
23
|
|
|
34
24
|
return (
|
|
35
25
|
<div
|
|
36
|
-
className={classNames(
|
|
37
|
-
"rcw-horizontal-tile-container",
|
|
38
|
-
{ "rcw-horizontal-tile-selected": selected },
|
|
39
|
-
className
|
|
40
|
-
)}
|
|
26
|
+
className={classNames("rcw-horizontal-tile-container", { "rcw-horizontal-tile-selected": selected }, className)}
|
|
41
27
|
onClick={rest.onClick}
|
|
42
28
|
data-testid="horizontal-tile"
|
|
43
29
|
>
|
|
44
30
|
<div className="rcw-body-container">
|
|
45
31
|
<div className="rcw-body">
|
|
46
|
-
<Text className={classNames("rcw-body-text", { "iui-anchor": !!onClickTitle })}
|
|
47
|
-
|
|
48
|
-
variant="body"
|
|
49
|
-
title={titleTooltip}>{title}
|
|
32
|
+
<Text className={classNames("rcw-body-text", { "iui-anchor": !!onClickTitle })} onClick={onClickTitle} variant="body" title={titleTooltip}>
|
|
33
|
+
{title}
|
|
50
34
|
</Text>
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
isMuted={true}
|
|
55
|
-
title={subtextToolTip}
|
|
56
|
-
variant="small">{subText}
|
|
35
|
+
{subText && (
|
|
36
|
+
<Text className="rcw-body-text" isMuted={true} title={subtextToolTip} variant="small">
|
|
37
|
+
{subText}
|
|
57
38
|
</Text>
|
|
58
|
-
}
|
|
39
|
+
)}
|
|
59
40
|
</div>
|
|
60
41
|
</div>
|
|
61
|
-
<div
|
|
62
|
-
className="rcw-action-button"
|
|
63
|
-
data-testid="tile-action-button">
|
|
42
|
+
<div className="rcw-action-button" data-testid="tile-action-button">
|
|
64
43
|
{actionGroup}
|
|
65
44
|
</div>
|
|
66
45
|
</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 type { TablePaginatorRendererProps } from "@itwin/itwinui-react";
|
|
6
6
|
import { TablePaginator } from "@itwin/itwinui-react";
|
|
7
7
|
import React, { useMemo } from "react";
|
|
@@ -11,49 +11,18 @@ export const LocalizedTablePaginator = (props: TablePaginatorRendererProps) => {
|
|
|
11
11
|
const pageSizeList = useMemo(() => [10, 25, 50], []);
|
|
12
12
|
const paginationLocalization = useMemo(
|
|
13
13
|
() => ({
|
|
14
|
-
pageSizeLabel: (size: number) =>
|
|
15
|
-
|
|
16
|
-
"ReportsConfigWidget:Table.SizePerPage",
|
|
17
|
-
{ size }
|
|
18
|
-
),
|
|
19
|
-
rangeLabel: (
|
|
20
|
-
startIndex: number,
|
|
21
|
-
endIndex: number,
|
|
22
|
-
totalRows: number,
|
|
23
|
-
isLoading: boolean
|
|
24
|
-
) =>
|
|
14
|
+
pageSizeLabel: (size: number) => ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Table.SizePerPage", { size }),
|
|
15
|
+
rangeLabel: (startIndex: number, endIndex: number, totalRows: number, isLoading: boolean) =>
|
|
25
16
|
isLoading
|
|
26
|
-
? ReportsConfigWidget.localization.getLocalizedString(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{ startIndex, endIndex, totalRows }
|
|
33
|
-
),
|
|
34
|
-
previousPage: ReportsConfigWidget.localization.getLocalizedString(
|
|
35
|
-
"ReportsConfigWidget:Table.PreviousPage"
|
|
36
|
-
),
|
|
37
|
-
nextPage: ReportsConfigWidget.localization.getLocalizedString(
|
|
38
|
-
"ReportsConfigWidget:Table.NextPage"
|
|
39
|
-
),
|
|
40
|
-
goToPageLabel: (page: number) =>
|
|
41
|
-
ReportsConfigWidget.localization.getLocalizedString(
|
|
42
|
-
"ReportsConfigWidget:Table.GoToPage",
|
|
43
|
-
{ page }
|
|
44
|
-
),
|
|
45
|
-
rowsPerPageLabel: ReportsConfigWidget.localization.getLocalizedString(
|
|
46
|
-
"ReportsConfigWidget:Table.RowsPerPage"
|
|
47
|
-
),
|
|
17
|
+
? ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Table.StartIndexEndIndex", { startIndex, endIndex })
|
|
18
|
+
: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Table.StartIndexEndIndexOf", { startIndex, endIndex, totalRows }),
|
|
19
|
+
previousPage: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Table.PreviousPage"),
|
|
20
|
+
nextPage: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Table.NextPage"),
|
|
21
|
+
goToPageLabel: (page: number) => ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Table.GoToPage", { page }),
|
|
22
|
+
rowsPerPageLabel: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Table.RowsPerPage"),
|
|
48
23
|
}),
|
|
49
|
-
[]
|
|
24
|
+
[],
|
|
50
25
|
);
|
|
51
26
|
|
|
52
|
-
return
|
|
53
|
-
<TablePaginator
|
|
54
|
-
{...props}
|
|
55
|
-
pageSizeList={pageSizeList}
|
|
56
|
-
localization={paginationLocalization}
|
|
57
|
-
/>
|
|
58
|
-
);
|
|
27
|
+
return <TablePaginator {...props} pageSizeList={pageSizeList} localization={paginationLocalization} />;
|
|
59
28
|
};
|
|
@@ -1,26 +1,31 @@
|
|
|
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 { Fieldset, LabeledInput, Text } from "@itwin/itwinui-react";
|
|
6
6
|
import React, { useState } from "react";
|
|
7
7
|
import ActionPanel from "./ActionPanel";
|
|
8
8
|
import useValidator, { NAME_REQUIREMENTS } from "../hooks/useValidator";
|
|
9
|
-
import {
|
|
10
|
-
handleError,
|
|
11
|
-
handleInputChange,
|
|
12
|
-
} from "./utils";
|
|
9
|
+
import { handleError, handleInputChange } from "./utils";
|
|
13
10
|
import "./ReportAction.scss";
|
|
14
11
|
import type { Report } from "@itwin/insights-client";
|
|
15
12
|
import { useReportsConfigApi } from "../context/ReportsConfigApiContext";
|
|
16
13
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
17
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Props for the {@link ReportAction} component.
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
18
19
|
export interface ReportActionProps {
|
|
19
20
|
report?: Report;
|
|
20
21
|
onSaveSuccess: () => void;
|
|
21
22
|
onClickCancel?: () => void;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Component to create or update a report.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
24
29
|
export const ReportAction = ({ report, onSaveSuccess, onClickCancel }: ReportActionProps) => {
|
|
25
30
|
const { iTwinId, getAccessToken, reportsClient } = useReportsConfigApi();
|
|
26
31
|
const [values, setValues] = useState({
|
|
@@ -40,14 +45,14 @@ export const ReportAction = ({ report, onSaveSuccess, onClickCancel }: ReportAct
|
|
|
40
45
|
const accessToken = await getAccessToken();
|
|
41
46
|
report
|
|
42
47
|
? await reportsClient.updateReport(accessToken, report.id ?? "", {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
displayName: values.name,
|
|
49
|
+
description: values.description,
|
|
50
|
+
})
|
|
46
51
|
: await reportsClient.createReport(accessToken, {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
displayName: values.name,
|
|
53
|
+
description: values.description,
|
|
54
|
+
projectId: iTwinId,
|
|
55
|
+
});
|
|
51
56
|
onSaveSuccess();
|
|
52
57
|
setValues({
|
|
53
58
|
name: report?.displayName ?? "",
|
|
@@ -64,22 +69,13 @@ export const ReportAction = ({ report, onSaveSuccess, onClickCancel }: ReportAct
|
|
|
64
69
|
return (
|
|
65
70
|
<>
|
|
66
71
|
<div className="rcw-details-form-container">
|
|
67
|
-
<Fieldset
|
|
68
|
-
legend
|
|
69
|
-
"ReportsConfigWidget:
|
|
70
|
-
)}
|
|
71
|
-
className="rcw-details-form"
|
|
72
|
-
>
|
|
73
|
-
<Text variant='small' className="field-legend">
|
|
74
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
75
|
-
"ReportsConfigWidget:MandatoryFields"
|
|
76
|
-
)}
|
|
72
|
+
<Fieldset legend={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ReportDetails")} className="rcw-details-form">
|
|
73
|
+
<Text variant="small" className="field-legend">
|
|
74
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:MandatoryFields")}
|
|
77
75
|
</Text>
|
|
78
76
|
<LabeledInput
|
|
79
77
|
name="name"
|
|
80
|
-
label={ReportsConfigWidget.localization.getLocalizedString(
|
|
81
|
-
"ReportsConfigWidget:Name"
|
|
82
|
-
)}
|
|
78
|
+
label={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Name")}
|
|
83
79
|
value={values.name}
|
|
84
80
|
required
|
|
85
81
|
disabled={isLoading}
|
|
@@ -88,11 +84,7 @@ export const ReportAction = ({ report, onSaveSuccess, onClickCancel }: ReportAct
|
|
|
88
84
|
validator.showMessageFor("name");
|
|
89
85
|
}}
|
|
90
86
|
message={validator.message("name", values.name, NAME_REQUIREMENTS)}
|
|
91
|
-
status={
|
|
92
|
-
validator.message("name", values.name, NAME_REQUIREMENTS)
|
|
93
|
-
? "negative"
|
|
94
|
-
: undefined
|
|
95
|
-
}
|
|
87
|
+
status={validator.message("name", values.name, NAME_REQUIREMENTS) ? "negative" : undefined}
|
|
96
88
|
onBlur={() => {
|
|
97
89
|
validator.showMessageFor("name");
|
|
98
90
|
}}
|
|
@@ -103,9 +95,7 @@ export const ReportAction = ({ report, onSaveSuccess, onClickCancel }: ReportAct
|
|
|
103
95
|
/>
|
|
104
96
|
<LabeledInput
|
|
105
97
|
name="description"
|
|
106
|
-
label={ReportsConfigWidget.localization.getLocalizedString(
|
|
107
|
-
"ReportsConfigWidget:Description"
|
|
108
|
-
)}
|
|
98
|
+
label={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Description")}
|
|
109
99
|
value={values.description}
|
|
110
100
|
onChange={(event) => {
|
|
111
101
|
handleInputChange(event, values, setValues);
|
|
@@ -115,9 +105,7 @@ export const ReportAction = ({ report, onSaveSuccess, onClickCancel }: ReportAct
|
|
|
115
105
|
</Fieldset>
|
|
116
106
|
</div>
|
|
117
107
|
<ActionPanel
|
|
118
|
-
actionLabel={ReportsConfigWidget.localization.getLocalizedString(
|
|
119
|
-
"ReportsConfigWidget:Add"
|
|
120
|
-
)}
|
|
108
|
+
actionLabel={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Add")}
|
|
121
109
|
onAction={onSave}
|
|
122
110
|
onCancel={onClickCancel}
|
|
123
111
|
isSavingDisabled={!values.name}
|
|
@@ -126,4 +114,3 @@ export const ReportAction = ({ report, onSaveSuccess, onClickCancel }: ReportAct
|
|
|
126
114
|
</>
|
|
127
115
|
);
|
|
128
116
|
};
|
|
129
|
-
|
|
@@ -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, { useEffect, useRef, useState } from "react";
|
|
6
6
|
import type { BulkExtractor } from "./BulkExtractor";
|
|
7
7
|
import { ExtractionStates, ExtractionStatus } from "./ExtractionStatus";
|
|
@@ -9,16 +9,8 @@ import type { BeEvent } from "@itwin/core-bentley";
|
|
|
9
9
|
import { STATUS_CHECK_INTERVAL } from "./Constants";
|
|
10
10
|
import type { Report } from "@itwin/insights-client";
|
|
11
11
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
IconButton,
|
|
15
|
-
MenuItem,
|
|
16
|
-
} from "@itwin/itwinui-react";
|
|
17
|
-
import {
|
|
18
|
-
SvgDelete,
|
|
19
|
-
SvgEdit,
|
|
20
|
-
SvgMore,
|
|
21
|
-
} from "@itwin/itwinui-icons-react";
|
|
12
|
+
import { DropdownMenu, IconButton, MenuItem } from "@itwin/itwinui-react";
|
|
13
|
+
import { SvgDelete, SvgEdit, SvgMore } from "@itwin/itwinui-icons-react";
|
|
22
14
|
import { HorizontalTile } from "./HorizontalTile";
|
|
23
15
|
|
|
24
16
|
export interface ReportHorizontalTileProps {
|
|
@@ -82,48 +74,46 @@ export const ReportHorizontalTile = (props: ReportHorizontalTileProps) => {
|
|
|
82
74
|
onClick={onClickTile}
|
|
83
75
|
onClickTitle={() => props.onClickTitle?.(props.report)}
|
|
84
76
|
selected={props.selected}
|
|
85
|
-
actionGroup={
|
|
86
|
-
|
|
87
|
-
className="rcw-action-button"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
></ExtractionStatus>
|
|
126
|
-
)}
|
|
77
|
+
actionGroup={
|
|
78
|
+
extractionState === ExtractionStates.None ? (
|
|
79
|
+
<div className="rcw-action-button" data-testid="tile-action-button">
|
|
80
|
+
<DropdownMenu
|
|
81
|
+
menuItems={(close: () => void) =>
|
|
82
|
+
[
|
|
83
|
+
props.onClickModify ? (
|
|
84
|
+
<MenuItem key={0} onClick={() => props.onClickModify?.(props.report)} icon={<SvgEdit />}>
|
|
85
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Modify")}
|
|
86
|
+
</MenuItem>
|
|
87
|
+
) : (
|
|
88
|
+
[]
|
|
89
|
+
),
|
|
90
|
+
<MenuItem
|
|
91
|
+
key={1}
|
|
92
|
+
onClick={() => {
|
|
93
|
+
props.onClickDelete();
|
|
94
|
+
close();
|
|
95
|
+
}}
|
|
96
|
+
icon={<SvgDelete />}
|
|
97
|
+
>
|
|
98
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Remove")}
|
|
99
|
+
</MenuItem>,
|
|
100
|
+
].flat()
|
|
101
|
+
}
|
|
102
|
+
>
|
|
103
|
+
<IconButton styleType="borderless" title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ReportOptions")}>
|
|
104
|
+
<SvgMore />
|
|
105
|
+
</IconButton>
|
|
106
|
+
</DropdownMenu>
|
|
107
|
+
</div>
|
|
108
|
+
) : (
|
|
109
|
+
<ExtractionStatus
|
|
110
|
+
state={extractionState}
|
|
111
|
+
clearExtractionState={() => {
|
|
112
|
+
setExtractionState(ExtractionStates.None);
|
|
113
|
+
}}
|
|
114
|
+
></ExtractionStatus>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
127
117
|
></HorizontalTile>
|
|
128
118
|
);
|
|
129
119
|
};
|
|
@@ -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
|
};
|