@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,13 +1,14 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { BulkExtractor } from "../widget/components/BulkExtractor";
|
|
6
6
|
import { ExtractionStates } from "../widget/components/ExtractionStatus";
|
|
7
7
|
import { assert } from "chai";
|
|
8
8
|
import * as moq from "typemoq";
|
|
9
|
-
import { ExtractionClient,
|
|
9
|
+
import { ExtractionClient, ExtractionState, ReportsClient } from "@itwin/insights-client";
|
|
10
10
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
11
|
+
import type { ExtractionRequestDetails } from "@itwin/insights-client";
|
|
11
12
|
|
|
12
13
|
jest.mock("../widget/components/Constants.ts", () => ({
|
|
13
14
|
STATUS_CHECK_INTERVAL: -1,
|
|
@@ -18,9 +19,9 @@ jest.mock("../widget/components/ExtractionToast.tsx", () => ({
|
|
|
18
19
|
SuccessfulExtractionToast: jest.fn(),
|
|
19
20
|
}));
|
|
20
21
|
|
|
21
|
-
const mockRunExtraction = moq.Mock.ofType<(accessToken: AccessToken,
|
|
22
|
-
const mockGetStatus = moq.Mock.ofType<(accessToken: AccessToken, jobId: string) => Promise<{ state:
|
|
23
|
-
const mockGetReportMappings = moq.Mock.ofType<(accessToken: AccessToken, reportId: string) => Promise<{ imodelId: string }[]>>();
|
|
22
|
+
const mockRunExtraction = moq.Mock.ofType<(accessToken: AccessToken, extractionRequest: ExtractionRequestDetails) => Promise<{ id: string }>>();
|
|
23
|
+
const mockGetStatus = moq.Mock.ofType<(accessToken: AccessToken, jobId: string) => Promise<{ state: ExtractionState }>>();
|
|
24
|
+
const mockGetReportMappings = moq.Mock.ofType<(accessToken: AccessToken, reportId: string) => Promise<{ imodelId: string; mappingId: string }[]>>();
|
|
24
25
|
|
|
25
26
|
jest.mock("@itwin/insights-client", () => ({
|
|
26
27
|
...jest.requireActual("@itwin/insights-client"),
|
|
@@ -47,9 +48,18 @@ const mockIModelId1 = "mockIModelId1";
|
|
|
47
48
|
const mockReportId = "mockReportId";
|
|
48
49
|
const mockRunId = "mockRunId";
|
|
49
50
|
const mockRunId1 = "mockRunId1";
|
|
51
|
+
const mockMappingId = "mockMappingId";
|
|
52
|
+
const mockMappingId1 = "mockMappingId1";
|
|
53
|
+
const mockExtractionRequest = {
|
|
54
|
+
mappings: [{ id: mockMappingId }],
|
|
55
|
+
iModelId: mockIModelId,
|
|
56
|
+
};
|
|
57
|
+
const mockExtractionRequest1 = {
|
|
58
|
+
mappings: [{ id: mockMappingId1 }],
|
|
59
|
+
iModelId: mockIModelId1,
|
|
60
|
+
};
|
|
50
61
|
|
|
51
62
|
describe("BulkExtractor", () => {
|
|
52
|
-
|
|
53
63
|
it("should return status none for unknown iModel", async () => {
|
|
54
64
|
const sut = new BulkExtractor(new ReportsClient(), new ExtractionClient(), mockGetAccessToken, mockToastCallback, mockToastCallback);
|
|
55
65
|
const result = await sut.getIModelState(mockIModelId, "", "");
|
|
@@ -57,54 +67,38 @@ describe("BulkExtractor", () => {
|
|
|
57
67
|
});
|
|
58
68
|
|
|
59
69
|
it("should return running status for started extraction", async () => {
|
|
60
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
61
|
-
async () => ({ id: mockRunId })
|
|
62
|
-
);
|
|
70
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest)).returns(async () => ({ id: mockRunId }));
|
|
63
71
|
|
|
64
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
65
|
-
async () => ({ state: ExtractorState.Running })
|
|
66
|
-
);
|
|
72
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Running }));
|
|
67
73
|
|
|
68
74
|
const sut = new BulkExtractor(new ReportsClient(), new ExtractionClient(), mockGetAccessToken, mockToastCallback, mockToastCallback);
|
|
69
|
-
await sut.runIModelExtraction(
|
|
75
|
+
await sut.runIModelExtraction(mockExtractionRequest);
|
|
70
76
|
const result = await sut.getIModelState(mockIModelId, "", "");
|
|
71
77
|
assert.strictEqual(result, ExtractionStates.Running);
|
|
72
78
|
});
|
|
73
79
|
|
|
74
80
|
it("should return failed status for failed extraction", async () => {
|
|
75
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
76
|
-
async () => ({ id: mockRunId })
|
|
77
|
-
);
|
|
81
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest)).returns(async () => ({ id: mockRunId }));
|
|
78
82
|
|
|
79
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
80
|
-
async () => ({ state: ExtractorState.Failed })
|
|
81
|
-
);
|
|
83
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Failed }));
|
|
82
84
|
|
|
83
85
|
const sut = new BulkExtractor(new ReportsClient(), new ExtractionClient(), mockGetAccessToken, mockToastCallback, mockToastCallback);
|
|
84
|
-
await sut.runIModelExtraction(
|
|
86
|
+
await sut.runIModelExtraction(mockExtractionRequest);
|
|
85
87
|
const result = await sut.getIModelState(mockIModelId, "", "");
|
|
86
88
|
assert.strictEqual(result, ExtractionStates.Failed);
|
|
87
89
|
});
|
|
88
90
|
|
|
89
91
|
it("full status check cycle", async () => {
|
|
90
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
91
|
-
async () => ({ id: mockRunId })
|
|
92
|
-
);
|
|
92
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest)).returns(async () => ({ id: mockRunId }));
|
|
93
93
|
|
|
94
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
95
|
-
async () => ({ state: ExtractorState.Queued })
|
|
96
|
-
);
|
|
94
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Queued }));
|
|
97
95
|
|
|
98
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
99
|
-
async () => ({ state: ExtractorState.Running })
|
|
100
|
-
);
|
|
96
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Running }));
|
|
101
97
|
|
|
102
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
103
|
-
async () => ({ state: ExtractorState.Succeeded })
|
|
104
|
-
);
|
|
98
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Succeeded }));
|
|
105
99
|
|
|
106
100
|
const sut = new BulkExtractor(new ReportsClient(), new ExtractionClient(), mockGetAccessToken, mockToastCallback, mockToastCallback);
|
|
107
|
-
await sut.runIModelExtraction(
|
|
101
|
+
await sut.runIModelExtraction(mockExtractionRequest);
|
|
108
102
|
|
|
109
103
|
let result = await sut.getIModelState(mockIModelId, "", "");
|
|
110
104
|
assert.strictEqual(result, ExtractionStates.Queued);
|
|
@@ -117,27 +111,19 @@ describe("BulkExtractor", () => {
|
|
|
117
111
|
});
|
|
118
112
|
|
|
119
113
|
it("two started jobs should return status", async () => {
|
|
120
|
-
const
|
|
114
|
+
const mockExtractionRequests = [mockExtractionRequest, mockExtractionRequest1];
|
|
121
115
|
|
|
122
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
123
|
-
async () => ({ id: mockRunId })
|
|
124
|
-
);
|
|
116
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest)).returns(async () => ({ id: mockRunId }));
|
|
125
117
|
|
|
126
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
127
|
-
async () => ({ id: mockRunId1 })
|
|
128
|
-
);
|
|
118
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest1)).returns(async () => ({ id: mockRunId1 }));
|
|
129
119
|
|
|
130
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
131
|
-
async () => ({ state: ExtractorState.Queued })
|
|
132
|
-
);
|
|
120
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Queued }));
|
|
133
121
|
|
|
134
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId1)).returns(
|
|
135
|
-
async () => ({ state: ExtractorState.Queued })
|
|
136
|
-
);
|
|
122
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId1)).returns(async () => ({ state: ExtractionState.Queued }));
|
|
137
123
|
|
|
138
124
|
const sut = new BulkExtractor(new ReportsClient(), new ExtractionClient(), mockGetAccessToken, mockToastCallback, mockToastCallback);
|
|
139
125
|
|
|
140
|
-
await sut.runIModelExtractions(
|
|
126
|
+
await sut.runIModelExtractions(mockExtractionRequests);
|
|
141
127
|
|
|
142
128
|
const result1 = await sut.getIModelState(mockIModelId, "", "");
|
|
143
129
|
const result2 = await sut.getIModelState(mockIModelId1, "", "");
|
|
@@ -153,17 +139,11 @@ describe("BulkExtractor", () => {
|
|
|
153
139
|
});
|
|
154
140
|
|
|
155
141
|
it("should return status running for running report", async () => {
|
|
156
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
157
|
-
async () => ({ id: mockRunId })
|
|
158
|
-
);
|
|
142
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest)).returns(async () => ({ id: mockRunId }));
|
|
159
143
|
|
|
160
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
161
|
-
async () => ({ state: ExtractorState.Running })
|
|
162
|
-
);
|
|
144
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Running }));
|
|
163
145
|
|
|
164
|
-
mockGetReportMappings.setup(async (x) => x(moq.It.isAny(), mockReportId)).returns(
|
|
165
|
-
async () => ([{ imodelId: mockIModelId }])
|
|
166
|
-
);
|
|
146
|
+
mockGetReportMappings.setup(async (x) => x(moq.It.isAny(), mockReportId)).returns(async () => [{ imodelId: mockIModelId, mappingId: mockMappingId }]);
|
|
167
147
|
|
|
168
148
|
const sut = new BulkExtractor(new ReportsClient(), new ExtractionClient(), mockGetAccessToken, mockToastCallback, mockToastCallback);
|
|
169
149
|
|
|
@@ -174,25 +154,20 @@ describe("BulkExtractor", () => {
|
|
|
174
154
|
});
|
|
175
155
|
|
|
176
156
|
it("should return status running for both iModels in report", async () => {
|
|
177
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
178
|
-
async () => ({ id: mockRunId })
|
|
179
|
-
);
|
|
157
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest)).returns(async () => ({ id: mockRunId }));
|
|
180
158
|
|
|
181
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
182
|
-
async () => ({ id: mockRunId1 })
|
|
183
|
-
);
|
|
159
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest1)).returns(async () => ({ id: mockRunId1 }));
|
|
184
160
|
|
|
185
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
186
|
-
async () => ({ state: ExtractorState.Running })
|
|
187
|
-
);
|
|
161
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Running }));
|
|
188
162
|
|
|
189
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId1)).returns(
|
|
190
|
-
async () => ({ state: ExtractorState.Running })
|
|
191
|
-
);
|
|
163
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId1)).returns(async () => ({ state: ExtractionState.Running }));
|
|
192
164
|
|
|
193
|
-
mockGetReportMappings
|
|
194
|
-
async () => (
|
|
195
|
-
|
|
165
|
+
mockGetReportMappings
|
|
166
|
+
.setup(async (x) => x(moq.It.isAny(), mockReportId))
|
|
167
|
+
.returns(async () => [
|
|
168
|
+
{ imodelId: mockIModelId, mappingId: mockMappingId },
|
|
169
|
+
{ imodelId: mockIModelId1, mappingId: mockMappingId1 },
|
|
170
|
+
]);
|
|
196
171
|
|
|
197
172
|
const sut = new BulkExtractor(new ReportsClient(), new ExtractionClient(), mockGetAccessToken, mockToastCallback, mockToastCallback);
|
|
198
173
|
|
|
@@ -206,25 +181,20 @@ describe("BulkExtractor", () => {
|
|
|
206
181
|
});
|
|
207
182
|
|
|
208
183
|
it("should return lowest progress status for extractions in report", async () => {
|
|
209
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
210
|
-
async () => ({ id: mockRunId })
|
|
211
|
-
);
|
|
184
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest)).returns(async () => ({ id: mockRunId }));
|
|
212
185
|
|
|
213
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
214
|
-
async () => ({ id: mockRunId1 })
|
|
215
|
-
);
|
|
186
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest1)).returns(async () => ({ id: mockRunId1 }));
|
|
216
187
|
|
|
217
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
218
|
-
async () => ({ state: ExtractorState.Running })
|
|
219
|
-
);
|
|
188
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Running }));
|
|
220
189
|
|
|
221
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId1)).returns(
|
|
222
|
-
async () => ({ state: ExtractorState.Queued })
|
|
223
|
-
);
|
|
190
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId1)).returns(async () => ({ state: ExtractionState.Queued }));
|
|
224
191
|
|
|
225
|
-
mockGetReportMappings
|
|
226
|
-
async () => (
|
|
227
|
-
|
|
192
|
+
mockGetReportMappings
|
|
193
|
+
.setup(async (x) => x(moq.It.isAny(), mockReportId))
|
|
194
|
+
.returns(async () => [
|
|
195
|
+
{ imodelId: mockIModelId, mappingId: mockMappingId },
|
|
196
|
+
{ imodelId: mockIModelId1, mappingId: mockMappingId1 },
|
|
197
|
+
]);
|
|
228
198
|
|
|
229
199
|
const sut = new BulkExtractor(new ReportsClient(), new ExtractionClient(), mockGetAccessToken, mockToastCallback, mockToastCallback);
|
|
230
200
|
|
|
@@ -235,25 +205,20 @@ describe("BulkExtractor", () => {
|
|
|
235
205
|
});
|
|
236
206
|
|
|
237
207
|
it("should return status failed if one of the extractions in report failed", async () => {
|
|
238
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
239
|
-
async () => ({ id: mockRunId })
|
|
240
|
-
);
|
|
208
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest)).returns(async () => ({ id: mockRunId }));
|
|
241
209
|
|
|
242
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
243
|
-
async () => ({ id: mockRunId1 })
|
|
244
|
-
);
|
|
210
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest1)).returns(async () => ({ id: mockRunId1 }));
|
|
245
211
|
|
|
246
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
247
|
-
async () => ({ state: ExtractorState.Succeeded })
|
|
248
|
-
);
|
|
212
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Succeeded }));
|
|
249
213
|
|
|
250
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId1)).returns(
|
|
251
|
-
async () => ({ state: ExtractorState.Failed })
|
|
252
|
-
);
|
|
214
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId1)).returns(async () => ({ state: ExtractionState.Failed }));
|
|
253
215
|
|
|
254
|
-
mockGetReportMappings
|
|
255
|
-
async () => (
|
|
256
|
-
|
|
216
|
+
mockGetReportMappings
|
|
217
|
+
.setup(async (x) => x(moq.It.isAny(), mockReportId))
|
|
218
|
+
.returns(async () => [
|
|
219
|
+
{ imodelId: mockIModelId, mappingId: mockMappingId },
|
|
220
|
+
{ imodelId: mockIModelId1, mappingId: mockMappingId1 },
|
|
221
|
+
]);
|
|
257
222
|
|
|
258
223
|
const sut = new BulkExtractor(new ReportsClient(), new ExtractionClient(), mockGetAccessToken, mockToastCallback, mockToastCallback);
|
|
259
224
|
|
|
@@ -264,25 +229,15 @@ describe("BulkExtractor", () => {
|
|
|
264
229
|
});
|
|
265
230
|
|
|
266
231
|
it("full report extraction status check cycle", async () => {
|
|
267
|
-
mockRunExtraction.setup(async (x) => x(moq.It.isAny(),
|
|
268
|
-
async () => ({ id: mockRunId })
|
|
269
|
-
);
|
|
232
|
+
mockRunExtraction.setup(async (x) => x(moq.It.isAny(), mockExtractionRequest)).returns(async () => ({ id: mockRunId }));
|
|
270
233
|
|
|
271
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
272
|
-
async () => ({ state: ExtractorState.Queued })
|
|
273
|
-
);
|
|
234
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Queued }));
|
|
274
235
|
|
|
275
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
276
|
-
async () => ({ state: ExtractorState.Running })
|
|
277
|
-
);
|
|
236
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Running }));
|
|
278
237
|
|
|
279
|
-
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(
|
|
280
|
-
async () => ({ state: ExtractorState.Succeeded })
|
|
281
|
-
);
|
|
238
|
+
mockGetStatus.setup(async (x) => x(moq.It.isAny(), mockRunId)).returns(async () => ({ state: ExtractionState.Succeeded }));
|
|
282
239
|
|
|
283
|
-
mockGetReportMappings.setup(async (x) => x(moq.It.isAny(), mockReportId)).returns(
|
|
284
|
-
async () => ([{ imodelId: mockIModelId }])
|
|
285
|
-
);
|
|
240
|
+
mockGetReportMappings.setup(async (x) => x(moq.It.isAny(), mockReportId)).returns(async () => [{ imodelId: mockIModelId, mappingId: mockMappingId }]);
|
|
286
241
|
|
|
287
242
|
const sut = new BulkExtractor(new ReportsClient(), new ExtractionClient(), mockGetAccessToken, mockToastCallback, mockToastCallback);
|
|
288
243
|
await sut.runReportExtractions([mockReportId]);
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
6
|
import "@testing-library/jest-dom";
|
|
7
|
-
import {
|
|
8
|
-
render,
|
|
9
|
-
screen,
|
|
10
|
-
} from "./test-utils";
|
|
7
|
+
import { render, screen } from "./test-utils";
|
|
11
8
|
import DeleteModal from "../widget/components/DeleteModal";
|
|
12
9
|
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
13
10
|
import { EmptyLocalization } from "@itwin/core-common";
|
|
@@ -19,27 +16,13 @@ beforeAll(async () => {
|
|
|
19
16
|
|
|
20
17
|
describe("Delete modal", () => {
|
|
21
18
|
it("should render", () => {
|
|
22
|
-
const { container } = render(
|
|
23
|
-
<DeleteModal
|
|
24
|
-
entityName="test"
|
|
25
|
-
onDelete={jest.fn()}
|
|
26
|
-
refresh={jest.fn()}
|
|
27
|
-
onClose={jest.fn()}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
19
|
+
const { container } = render(<DeleteModal entityName="test" onDelete={jest.fn()} refresh={jest.fn()} onClose={jest.fn()} />);
|
|
30
20
|
expect(container).toBeTruthy();
|
|
31
21
|
});
|
|
32
22
|
|
|
33
23
|
it("should call onDelete when delete button is clicked", async () => {
|
|
34
24
|
const onDelete = jest.fn();
|
|
35
|
-
const { user } = render(
|
|
36
|
-
<DeleteModal
|
|
37
|
-
entityName="test"
|
|
38
|
-
onDelete={onDelete}
|
|
39
|
-
refresh={jest.fn()}
|
|
40
|
-
onClose={jest.fn()}
|
|
41
|
-
/>
|
|
42
|
-
);
|
|
25
|
+
const { user } = render(<DeleteModal entityName="test" onDelete={onDelete} refresh={jest.fn()} onClose={jest.fn()} />);
|
|
43
26
|
const deleteButton = screen.getByRole("button", {
|
|
44
27
|
name: /delete/i,
|
|
45
28
|
});
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
6
|
import faker from "@faker-js/faker";
|
|
7
7
|
import "@testing-library/jest-dom";
|
|
8
8
|
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
9
|
-
import {
|
|
10
|
-
render,
|
|
11
|
-
screen,
|
|
12
|
-
waitForElementToBeRemoved,
|
|
13
|
-
} from "./test-utils";
|
|
9
|
+
import { render, screen, waitForElementToBeRemoved } from "./test-utils";
|
|
14
10
|
import { ReportAction } from "../widget/components/ReportAction";
|
|
15
11
|
import userEvent from "@testing-library/user-event";
|
|
16
12
|
import { EmptyLocalization } from "@itwin/core-common";
|
|
@@ -55,12 +51,16 @@ describe("Reports Action", () => {
|
|
|
55
51
|
|
|
56
52
|
const reportsClient = new ReportsClient();
|
|
57
53
|
|
|
58
|
-
jest.spyOn(reportsClient, "createReport").mockImplementation(
|
|
59
|
-
|
|
54
|
+
jest.spyOn(reportsClient, "createReport").mockImplementation(
|
|
55
|
+
async () =>
|
|
56
|
+
new Promise((resolve) =>
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
resolve(mockReport);
|
|
59
|
+
}, 100),
|
|
60
|
+
),
|
|
60
61
|
);
|
|
61
62
|
|
|
62
|
-
const { user } = render(
|
|
63
|
-
<ReportAction onClickCancel={jest.fn()} onSaveSuccess={mockReturnFn} />, { reportsClient });
|
|
63
|
+
const { user } = render(<ReportAction onClickCancel={jest.fn()} onSaveSuccess={mockReturnFn} />, { reportsClient });
|
|
64
64
|
|
|
65
65
|
const addButton = screen.getByRole("button", {
|
|
66
66
|
name: /add/i,
|
|
@@ -86,9 +86,7 @@ describe("Reports Action", () => {
|
|
|
86
86
|
expect(cancelButton).toBeDisabled();
|
|
87
87
|
expect(nameInput).toBeDisabled();
|
|
88
88
|
|
|
89
|
-
await waitForElementToBeRemoved(() =>
|
|
90
|
-
screen.getByTestId(/loading\-spinner/i)
|
|
91
|
-
);
|
|
89
|
+
await waitForElementToBeRemoved(() => screen.getByTestId(/loading\-spinner/i));
|
|
92
90
|
|
|
93
91
|
expect(mockReturnFn).toHaveBeenCalledTimes(1);
|
|
94
92
|
});
|
|
@@ -96,9 +94,7 @@ describe("Reports Action", () => {
|
|
|
96
94
|
it("No duplicate underscores in the beginning of name", async () => {
|
|
97
95
|
const mockReturnFn = jest.fn();
|
|
98
96
|
|
|
99
|
-
const { user } = render(
|
|
100
|
-
<ReportAction onClickCancel={jest.fn()} onSaveSuccess={mockReturnFn} />
|
|
101
|
-
);
|
|
97
|
+
const { user } = render(<ReportAction onClickCancel={jest.fn()} onSaveSuccess={mockReturnFn} />);
|
|
102
98
|
|
|
103
99
|
const addButton = screen.getByRole("button", {
|
|
104
100
|
name: /add/i,
|
|
@@ -110,17 +106,13 @@ describe("Reports Action", () => {
|
|
|
110
106
|
|
|
111
107
|
await userEvent.type(nameInput, "__testName");
|
|
112
108
|
await user.click(addButton);
|
|
113
|
-
expect(
|
|
114
|
-
screen.getByText(/validators\.noduplicateunderscore/i)
|
|
115
|
-
).toBeInTheDocument();
|
|
109
|
+
expect(screen.getByText(/validators\.noduplicateunderscore/i)).toBeInTheDocument();
|
|
116
110
|
});
|
|
117
111
|
|
|
118
112
|
it("Only begin with letters or underscores of name", async () => {
|
|
119
113
|
const mockReturnFn = jest.fn();
|
|
120
114
|
|
|
121
|
-
const { user } = render(
|
|
122
|
-
<ReportAction onClickCancel={jest.fn()} onSaveSuccess={mockReturnFn} />
|
|
123
|
-
);
|
|
115
|
+
const { user } = render(<ReportAction onClickCancel={jest.fn()} onSaveSuccess={mockReturnFn} />);
|
|
124
116
|
|
|
125
117
|
const addButton = screen.getByRole("button", {
|
|
126
118
|
name: /add/i,
|
|
@@ -132,17 +124,13 @@ describe("Reports Action", () => {
|
|
|
132
124
|
|
|
133
125
|
await userEvent.type(nameInput, "$testName");
|
|
134
126
|
await user.click(addButton);
|
|
135
|
-
expect(
|
|
136
|
-
screen.getByText(/validators\.onlybeginswithletterorunderscore/i)
|
|
137
|
-
).toBeInTheDocument();
|
|
127
|
+
expect(screen.getByText(/validators\.onlybeginswithletterorunderscore/i)).toBeInTheDocument();
|
|
138
128
|
});
|
|
139
129
|
|
|
140
130
|
it("Only letters underscores and digits of name", async () => {
|
|
141
131
|
const mockReturnFn = jest.fn();
|
|
142
132
|
|
|
143
|
-
const { user } = render(
|
|
144
|
-
<ReportAction onClickCancel={jest.fn()} onSaveSuccess={mockReturnFn} />
|
|
145
|
-
);
|
|
133
|
+
const { user } = render(<ReportAction onClickCancel={jest.fn()} onSaveSuccess={mockReturnFn} />);
|
|
146
134
|
|
|
147
135
|
const addButton = screen.getByRole("button", {
|
|
148
136
|
name: /add/i,
|
|
@@ -154,19 +142,13 @@ describe("Reports Action", () => {
|
|
|
154
142
|
|
|
155
143
|
await userEvent.type(nameInput, "_# ");
|
|
156
144
|
await user.click(addButton);
|
|
157
|
-
expect(
|
|
158
|
-
screen.getByText(
|
|
159
|
-
/validators\.FollowedByLettersUnderscoresSpacesAndDigits/i
|
|
160
|
-
)
|
|
161
|
-
).toBeInTheDocument();
|
|
145
|
+
expect(screen.getByText(/validators\.FollowedByLettersUnderscoresSpacesAndDigits/i)).toBeInTheDocument();
|
|
162
146
|
});
|
|
163
147
|
|
|
164
148
|
it("check for character limits of name", async () => {
|
|
165
149
|
const mockReturnFn = jest.fn();
|
|
166
150
|
|
|
167
|
-
const { user } = render(
|
|
168
|
-
<ReportAction onClickCancel={jest.fn()} onSaveSuccess={mockReturnFn} />
|
|
169
|
-
);
|
|
151
|
+
const { user } = render(<ReportAction onClickCancel={jest.fn()} onSaveSuccess={mockReturnFn} />);
|
|
170
152
|
|
|
171
153
|
const addButton = screen.getByRole("button", {
|
|
172
154
|
name: /add/i,
|