@itwin/reports-config-widget-react 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +61 -0
- package/CHANGELOG.md +23 -2
- package/LICENSE.md +9 -9
- package/README.md +38 -38
- package/__mocks__/fileMock.js +4 -4
- package/api/reports-config-widget-react.api.md +130 -0
- package/api/reports-config-widget-react.exports.csv +14 -0
- package/api/temp/reports-config-widget-react.api.md +130 -0
- package/coverage/clover.xml +524 -514
- package/coverage/coverage-final.json +32 -32
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +26 -26
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +15 -15
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/test/index.html +15 -15
- package/coverage/lcov-report/src/test/test-utils.tsx.html +233 -20
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +22 -64
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +5 -38
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +23 -119
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +117 -90
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +16 -10
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +16 -106
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +7 -22
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +7 -28
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +20 -47
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +20 -11
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +16 -79
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +15 -108
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +36 -75
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +62 -92
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +104 -128
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +86 -299
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +64 -226
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +63 -45
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +10 -49
- package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +8 -47
- package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +6 -12
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +15 -27
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +12 -57
- package/coverage/lcov-report/src/widget/components/index.html +56 -56
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +32 -176
- package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +9 -15
- package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +9 -15
- package/coverage/lcov-report/src/widget/context/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +12 -54
- package/coverage/lcov-report/src/widget/index.html +1 -1
- package/coverage/lcov.info +959 -922
- package/jest.config.js +14 -17
- package/lib/cjs/ReportsConfigWidget.d.ts +4 -0
- package/lib/cjs/ReportsConfigWidget.d.ts.map +1 -1
- package/lib/cjs/ReportsConfigWidget.js +4 -0
- package/lib/cjs/ReportsConfigWidget.js.map +1 -1
- package/lib/cjs/reports-config-widget-react.js +8 -4
- package/lib/cjs/reports-config-widget-react.js.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.js +24 -72
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
- package/lib/cjs/test/BulkExtractor.test.js +73 -44
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
- package/lib/cjs/test/DeleteModal.test.js +3 -3
- package/lib/cjs/test/DeleteModal.test.js.map +1 -1
- package/lib/cjs/test/ReportAction.test.js +6 -4
- package/lib/cjs/test/ReportAction.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +76 -86
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/cjs/test/ReportMappings.test.js +53 -80
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +54 -50
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +3 -3
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/test-utils.d.ts +38 -0
- package/lib/cjs/test/test-utils.d.ts.map +1 -1
- package/lib/cjs/test/test-utils.js +79 -5
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +7 -0
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +13 -4
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.js +5 -1
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js +12 -8
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.scss +1 -1
- package/lib/cjs/widget/components/BulkExtractor.d.ts +7 -4
- package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.js +52 -35
- package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
- package/lib/cjs/widget/components/Constants.d.ts +1 -0
- package/lib/cjs/widget/components/Constants.d.ts.map +1 -1
- package/lib/cjs/widget/components/Constants.js +5 -4
- package/lib/cjs/widget/components/Constants.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js +10 -6
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.scss +2 -2
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.js +14 -10
- package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.scss +1 -1
- package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionToast.js +3 -3
- package/lib/cjs/widget/components/ExtractionToast.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.js +1 -2
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.scss +1 -4
- package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js +6 -2
- package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.d.ts +8 -0
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js +14 -8
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.scss +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js +9 -5
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +51 -46
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts +8 -0
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js +30 -12
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/Reports.d.ts +9 -1
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js +12 -9
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/Reports.scss +0 -1
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts +8 -0
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.js +20 -7
- package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.d.ts +1 -1
- package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js +7 -5
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.scss +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsHeader.js +6 -7
- package/lib/cjs/widget/components/ReportsHeader.js.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.js +3 -3
- package/lib/cjs/widget/components/ReportsRouter.js.map +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/cjs/widget/components/SearchBar.js +9 -5
- package/lib/cjs/widget/components/SearchBar.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +7 -3
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.scss +1 -1
- package/lib/cjs/widget/components/utils.d.ts +1 -1
- package/lib/cjs/widget/components/utils.d.ts.map +1 -1
- package/lib/cjs/widget/components/utils.js +5 -5
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js +5 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js +5 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.d.ts +1 -4
- package/lib/cjs/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.js +3 -3
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
- package/lib/esm/ReportsConfigWidget.d.ts +4 -0
- package/lib/esm/ReportsConfigWidget.d.ts.map +1 -1
- package/lib/esm/ReportsConfigWidget.js +4 -0
- package/lib/esm/ReportsConfigWidget.js.map +1 -1
- package/lib/esm/reports-config-widget-react.js +3 -3
- package/lib/esm/reports-config-widget-react.js.map +1 -1
- package/lib/esm/test/AddMappingModal.test.js +12 -64
- package/lib/esm/test/AddMappingModal.test.js.map +1 -1
- package/lib/esm/test/BulkExtractor.test.js +69 -44
- package/lib/esm/test/BulkExtractor.test.js.map +1 -1
- package/lib/esm/test/DeleteModal.test.js +4 -4
- package/lib/esm/test/DeleteModal.test.js.map +1 -1
- package/lib/esm/test/ReportAction.test.js +7 -5
- package/lib/esm/test/ReportAction.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +66 -80
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/esm/test/ReportMappings.test.js +42 -73
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +32 -51
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +3 -3
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/test-utils.d.ts +38 -0
- package/lib/esm/test/test-utils.d.ts.map +1 -1
- package/lib/esm/test/test-utils.js +73 -3
- package/lib/esm/test/test-utils.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts +7 -0
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.js +9 -4
- package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/esm/widget/components/ActionPanel.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.js +7 -7
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.scss +1 -1
- package/lib/esm/widget/components/BulkExtractor.d.ts +7 -4
- package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.js +53 -36
- package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
- package/lib/esm/widget/components/Constants.d.ts +1 -0
- package/lib/esm/widget/components/Constants.d.ts.map +1 -1
- package/lib/esm/widget/components/Constants.js +4 -3
- package/lib/esm/widget/components/Constants.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/esm/widget/components/DeleteModal.js +6 -6
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.scss +2 -2
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.js +9 -9
- package/lib/esm/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.scss +1 -1
- package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionToast.js +3 -3
- package/lib/esm/widget/components/ExtractionToast.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.js +1 -2
- package/lib/esm/widget/components/HorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.scss +1 -4
- package/lib/esm/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.d.ts +8 -0
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.js +10 -8
- package/lib/esm/widget/components/ReportAction.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.scss +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.js +6 -6
- package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js +47 -46
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.d.ts +8 -0
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js +28 -14
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/Reports.d.ts +9 -1
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js +8 -9
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/Reports.scss +0 -1
- package/lib/esm/widget/components/ReportsConfigContext.d.ts +8 -0
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.js +17 -8
- package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.d.ts +1 -1
- package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.js +2 -4
- package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.scss +1 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts +1 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsHeader.js +6 -7
- package/lib/esm/widget/components/ReportsHeader.js.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.js +3 -3
- package/lib/esm/widget/components/ReportsRouter.js.map +1 -1
- package/lib/esm/widget/components/SearchBar.d.ts +1 -1
- package/lib/esm/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/esm/widget/components/SearchBar.js +4 -4
- package/lib/esm/widget/components/SearchBar.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.d.ts +1 -1
- package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/esm/widget/components/SelectIModel.js +3 -3
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.scss +1 -1
- package/lib/esm/widget/components/utils.d.ts +1 -1
- package/lib/esm/widget/components/utils.d.ts.map +1 -1
- package/lib/esm/widget/components/utils.js +6 -6
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/esm/widget/hooks/useValidator.d.ts +1 -4
- package/lib/esm/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/esm/widget/hooks/useValidator.js +3 -3
- package/lib/esm/widget/hooks/useValidator.js.map +1 -1
- package/package.json +37 -31
- package/src/ReportsConfigWidget.ts +9 -9
- package/src/reports-config-widget-react.ts +3 -3
- package/src/test/AddMappingModal.test.tsx +47 -122
- package/src/test/BulkExtractor.test.ts +73 -118
- package/src/test/DeleteModal.test.tsx +6 -23
- package/src/test/ReportAction.test.tsx +20 -38
- package/src/test/ReportMappingHorizontalTile.test.tsx +140 -161
- package/src/test/ReportMappings.test.tsx +80 -146
- package/src/test/Reports.test.tsx +57 -169
- package/src/test/WidgetHeader.test.tsx +3 -3
- package/src/test/test-utils.tsx +80 -9
- package/src/widget/ReportsConfigUiProvider.tsx +16 -30
- package/src/widget/components/ActionPanel.tsx +3 -14
- package/src/widget/components/AddMappingsModal.scss +1 -1
- package/src/widget/components/AddMappingsModal.tsx +19 -51
- package/src/widget/components/BulkExtractor.ts +63 -54
- package/src/widget/components/Constants.ts +5 -3
- package/src/widget/components/DeleteModal.scss +2 -2
- package/src/widget/components/DeleteModal.tsx +11 -41
- package/src/widget/components/ExtractionStates/FailedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/QueuedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/RunningExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/StartingExtractionState.tsx +4 -11
- package/src/widget/components/ExtractionStates/SucceededExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStatus.scss +1 -1
- package/src/widget/components/ExtractionStatus.tsx +9 -18
- package/src/widget/components/ExtractionToast.tsx +12 -9
- package/src/widget/components/HorizontalTile.scss +1 -4
- package/src/widget/components/HorizontalTile.tsx +12 -33
- package/src/widget/components/LocalizedTablePaginator.tsx +13 -44
- package/src/widget/components/ReportAction.scss +1 -1
- package/src/widget/components/ReportAction.tsx +26 -39
- package/src/widget/components/ReportHorizontalTile.tsx +45 -55
- package/src/widget/components/ReportMappingHorizontalTile.tsx +70 -78
- package/src/widget/components/ReportMappings.tsx +59 -130
- package/src/widget/components/Reports.scss +0 -1
- package/src/widget/components/Reports.tsx +28 -82
- package/src/widget/components/ReportsConfigContext.tsx +32 -26
- package/src/widget/components/ReportsContainer.scss +1 -1
- package/src/widget/components/ReportsContainer.tsx +8 -21
- package/src/widget/components/ReportsHeader.tsx +6 -19
- package/src/widget/components/ReportsRouter.tsx +4 -6
- package/src/widget/components/SearchBar.tsx +9 -13
- package/src/widget/components/SelectIModel.scss +1 -1
- package/src/widget/components/SelectIModel.tsx +10 -25
- package/src/widget/components/utils.scss +1 -1
- package/src/widget/components/utils.tsx +21 -69
- package/src/widget/context/BulkExtractorContext.tsx +4 -6
- package/src/widget/context/ReportsConfigApiContext.tsx +4 -6
- package/src/widget/hooks/useValidator.ts +10 -24
- package/tsconfig.json +11 -11
- package/.rush/temp/operation/rebuild/all.log +0 -9
- package/.rush/temp/operation/rebuild/state.json +0 -3
- package/.rush/temp/package-deps_rebuild.json +0 -68
- package/.rush/temp/shrinkwrap-deps.json +0 -898
- package/reports-config-widget-react.build.error.log +0 -14
- package/reports-config-widget-react.build.log +0 -63
|
@@ -1,40 +1,30 @@
|
|
|
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
|
-
waitForElementToBeRemoved,
|
|
11
|
-
within,
|
|
12
|
-
} from "../test/test-utils";
|
|
7
|
+
import { render, screen, waitForElementToBeRemoved, within } from "../test/test-utils";
|
|
13
8
|
import { Reports } from "../widget/components/Reports";
|
|
14
9
|
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
15
|
-
import { rest } from "msw";
|
|
16
|
-
import { setupServer } from "msw/node";
|
|
17
10
|
import faker from "@faker-js/faker";
|
|
18
|
-
import type { ReportCollection } from "@itwin/insights-client";
|
|
11
|
+
import type { ReportCollection, ReportsClient } from "@itwin/insights-client";
|
|
19
12
|
import userEvent from "@testing-library/user-event";
|
|
20
|
-
import { REPORTS_CONFIG_BASE_URL } from "../widget/ReportsConfigUiProvider";
|
|
21
13
|
import { EmptyLocalization } from "@itwin/core-common";
|
|
14
|
+
import * as moq from "typemoq";
|
|
22
15
|
|
|
23
16
|
const reportsFactory = (): ReportCollection => ({
|
|
24
|
-
reports: Array.from(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
project: {
|
|
33
|
-
href: "",
|
|
34
|
-
},
|
|
17
|
+
reports: Array.from({ length: faker.datatype.number({ min: 3, max: 5 }) }, (_, index) => ({
|
|
18
|
+
id: `${faker.datatype.uuid()}`,
|
|
19
|
+
displayName: `mOcKRePoRT${index}`,
|
|
20
|
+
description: `mOcKRePoRTDeScRiPtIoN${index}`,
|
|
21
|
+
deleted: false,
|
|
22
|
+
_links: {
|
|
23
|
+
project: {
|
|
24
|
+
href: "",
|
|
35
25
|
},
|
|
36
|
-
}
|
|
37
|
-
),
|
|
26
|
+
},
|
|
27
|
+
})),
|
|
38
28
|
_links: {
|
|
39
29
|
next: undefined,
|
|
40
30
|
self: {
|
|
@@ -43,38 +33,30 @@ const reportsFactory = (): ReportCollection => ({
|
|
|
43
33
|
},
|
|
44
34
|
});
|
|
45
35
|
|
|
46
|
-
const
|
|
36
|
+
const mockGetReports = jest.fn();
|
|
37
|
+
const mockDeleteReport = jest.fn();
|
|
38
|
+
|
|
39
|
+
const mockReportsClient = moq.Mock.ofType<ReportsClient>();
|
|
47
40
|
|
|
48
41
|
beforeAll(async () => {
|
|
49
42
|
const localization = new EmptyLocalization();
|
|
50
43
|
await ReportsConfigWidget.initialize(localization);
|
|
51
|
-
server.listen();
|
|
52
|
-
});
|
|
53
44
|
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
mockReportsClient.setup(async (x) => x.getReports(moq.It.isAny(), moq.It.isAny())).returns(mockGetReports);
|
|
46
|
+
mockReportsClient.setup(async (x) => x.deleteReport(moq.It.isAny(), moq.It.isAny())).returns(mockDeleteReport);
|
|
56
47
|
});
|
|
57
48
|
|
|
58
|
-
afterEach(() =>
|
|
49
|
+
afterEach(() => {
|
|
50
|
+
mockGetReports.mockReset();
|
|
51
|
+
mockDeleteReport.mockReset();
|
|
52
|
+
});
|
|
59
53
|
|
|
60
54
|
describe("Reports View", () => {
|
|
61
55
|
it("call to action button should be clickable with no reports", async () => {
|
|
62
|
-
|
|
63
|
-
rest.get(
|
|
64
|
-
`${REPORTS_CONFIG_BASE_URL}/insights/reporting/reports`,
|
|
65
|
-
async (_req, res, ctx) => {
|
|
66
|
-
return res(
|
|
67
|
-
ctx.delay(500),
|
|
68
|
-
ctx.status(200),
|
|
69
|
-
ctx.json({ reports: [] })
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
)
|
|
73
|
-
);
|
|
74
|
-
|
|
56
|
+
mockGetReports.mockReturnValueOnce([]);
|
|
75
57
|
const onClickAddMock = jest.fn();
|
|
76
58
|
|
|
77
|
-
const { user } = render(<Reports onClickAddReport={onClickAddMock}
|
|
59
|
+
const { user } = render(<Reports onClickAddReport={onClickAddMock} />, { reportsClient: mockReportsClient.object });
|
|
78
60
|
|
|
79
61
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
80
62
|
const ctaButton = screen.getByRole("button", {
|
|
@@ -85,21 +67,10 @@ describe("Reports View", () => {
|
|
|
85
67
|
});
|
|
86
68
|
|
|
87
69
|
it("be able to add new report", async () => {
|
|
88
|
-
|
|
89
|
-
rest.get(
|
|
90
|
-
`${REPORTS_CONFIG_BASE_URL}/insights/reporting/reports`,
|
|
91
|
-
async (_req, res, ctx) => {
|
|
92
|
-
return res(
|
|
93
|
-
ctx.delay(500),
|
|
94
|
-
ctx.status(200),
|
|
95
|
-
ctx.json({ reports: [] })
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
);
|
|
70
|
+
mockGetReports.mockReturnValueOnce([]);
|
|
100
71
|
|
|
101
72
|
const onClickAddMock = jest.fn();
|
|
102
|
-
const { user } = render(<Reports onClickAddReport={onClickAddMock}
|
|
73
|
+
const { user } = render(<Reports onClickAddReport={onClickAddMock} />, { reportsClient: mockReportsClient.object });
|
|
103
74
|
|
|
104
75
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
105
76
|
const newButton = screen.getByRole("button", {
|
|
@@ -111,16 +82,9 @@ describe("Reports View", () => {
|
|
|
111
82
|
|
|
112
83
|
it("list all reports", async () => {
|
|
113
84
|
const mockedReports: ReportCollection = reportsFactory();
|
|
114
|
-
|
|
115
|
-
rest.get(
|
|
116
|
-
`${REPORTS_CONFIG_BASE_URL}/insights/reporting/reports`,
|
|
117
|
-
async (_req, res, ctx) => {
|
|
118
|
-
return res(ctx.delay(500), ctx.status(200), ctx.json(mockedReports));
|
|
119
|
-
}
|
|
120
|
-
)
|
|
121
|
-
);
|
|
85
|
+
mockGetReports.mockReturnValueOnce(mockedReports.reports);
|
|
122
86
|
|
|
123
|
-
render(<Reports
|
|
87
|
+
render(<Reports />, { reportsClient: mockReportsClient.object });
|
|
124
88
|
|
|
125
89
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
126
90
|
const horizontalTiles = screen.getAllByTestId("horizontal-tile");
|
|
@@ -129,37 +93,20 @@ describe("Reports View", () => {
|
|
|
129
93
|
|
|
130
94
|
for (const [index, horizontalTile] of horizontalTiles.entries()) {
|
|
131
95
|
const reportMappingTile = within(horizontalTile);
|
|
132
|
-
expect(
|
|
133
|
-
|
|
134
|
-
mockedReports?.reports[index].displayName ?? ""
|
|
135
|
-
)
|
|
136
|
-
).toBeInTheDocument();
|
|
137
|
-
expect(
|
|
138
|
-
reportMappingTile.getByTitle(
|
|
139
|
-
mockedReports?.reports[index].description ?? ""
|
|
140
|
-
)
|
|
141
|
-
).toBeInTheDocument();
|
|
96
|
+
expect(reportMappingTile.getByText(mockedReports?.reports[index].displayName ?? "")).toBeInTheDocument();
|
|
97
|
+
expect(reportMappingTile.getByTitle(mockedReports?.reports[index].description ?? "")).toBeInTheDocument();
|
|
142
98
|
}
|
|
143
99
|
});
|
|
144
100
|
|
|
145
101
|
it("able to modify a report", async () => {
|
|
146
102
|
const mockedReports: ReportCollection = reportsFactory();
|
|
147
|
-
|
|
148
|
-
rest.get(
|
|
149
|
-
`${REPORTS_CONFIG_BASE_URL}/insights/reporting/reports`,
|
|
150
|
-
async (_req, res, ctx) => {
|
|
151
|
-
return res(ctx.delay(500), ctx.status(200), ctx.json(mockedReports));
|
|
152
|
-
}
|
|
153
|
-
)
|
|
154
|
-
);
|
|
103
|
+
mockGetReports.mockReturnValueOnce(mockedReports.reports);
|
|
155
104
|
const onClickModifyMock = jest.fn();
|
|
156
|
-
const { user } = render(<Reports onClickReportModify={onClickModifyMock}
|
|
105
|
+
const { user } = render(<Reports onClickReportModify={onClickModifyMock} />, { reportsClient: mockReportsClient.object });
|
|
157
106
|
|
|
158
107
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
159
108
|
|
|
160
|
-
const firstMenuDropdown = within(
|
|
161
|
-
screen.getAllByTestId(/tile-action-button/i)[0]
|
|
162
|
-
).getByRole("button");
|
|
109
|
+
const firstMenuDropdown = within(screen.getAllByTestId(/tile-action-button/i)[0]).getByRole("button");
|
|
163
110
|
await user.click(firstMenuDropdown);
|
|
164
111
|
const modifyButton = screen.getByRole("menuitem", { name: /modify/i });
|
|
165
112
|
await user.click(modifyButton);
|
|
@@ -169,33 +116,14 @@ describe("Reports View", () => {
|
|
|
169
116
|
|
|
170
117
|
it("remove a report", async () => {
|
|
171
118
|
const mockedReports: ReportCollection = reportsFactory();
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
async (_req, res, ctx) => {
|
|
177
|
-
return res(ctx.delay(200), ctx.status(200), ctx.json(mockedReports));
|
|
178
|
-
}
|
|
179
|
-
),
|
|
180
|
-
rest.delete(
|
|
181
|
-
`${REPORTS_CONFIG_BASE_URL}/insights/reporting/reports/${mockedReports.reports[0].id
|
|
182
|
-
}`,
|
|
183
|
-
async (_req, res, ctx) => {
|
|
184
|
-
mockedReports.reports = mockedReports.reports.filter(
|
|
185
|
-
(report) => report.id !== mockedReports.reports[0].id
|
|
186
|
-
);
|
|
187
|
-
return res(ctx.delay(100), ctx.status(204));
|
|
188
|
-
}
|
|
189
|
-
)
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
const { user } = render(<Reports />);
|
|
119
|
+
|
|
120
|
+
mockGetReports.mockReturnValue(mockedReports.reports);
|
|
121
|
+
|
|
122
|
+
const { user } = render(<Reports />, { reportsClient: mockReportsClient.object });
|
|
193
123
|
|
|
194
124
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
195
125
|
|
|
196
|
-
const firstMenuDropdown = within(
|
|
197
|
-
screen.getAllByTestId(/tile-action-button/i)[0]
|
|
198
|
-
).getByRole("button");
|
|
126
|
+
const firstMenuDropdown = within(screen.getAllByTestId(/tile-action-button/i)[0]).getByRole("button");
|
|
199
127
|
await user.click(firstMenuDropdown);
|
|
200
128
|
const removeButton = screen.getByRole("menuitem", { name: /remove/i });
|
|
201
129
|
await user.click(removeButton);
|
|
@@ -208,29 +136,17 @@ describe("Reports View", () => {
|
|
|
208
136
|
|
|
209
137
|
await user.click(deleteButton);
|
|
210
138
|
|
|
211
|
-
await waitForElementToBeRemoved(() =>
|
|
212
|
-
screen.getByTestId(/rcw-loading-delete/i)
|
|
213
|
-
);
|
|
214
139
|
await waitForElementToBeRemoved(() => screen.getByRole("dialog"));
|
|
215
140
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
);
|
|
141
|
+
expect(mockDeleteReport).toBeCalled();
|
|
142
|
+
// Two calls, when it is first rendered and when it is refreshed.
|
|
143
|
+
expect(mockGetReports).toBeCalledTimes(2);
|
|
220
144
|
});
|
|
221
145
|
|
|
222
146
|
it("search for a report", async () => {
|
|
223
147
|
const mockedReports: ReportCollection = reportsFactory();
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
`${REPORTS_CONFIG_BASE_URL}/insights/reporting/reports`,
|
|
227
|
-
async (_req, res, ctx) => {
|
|
228
|
-
return res(ctx.delay(200), ctx.status(200), ctx.json(mockedReports));
|
|
229
|
-
}
|
|
230
|
-
)
|
|
231
|
-
);
|
|
232
|
-
|
|
233
|
-
const { user } = render(<Reports />);
|
|
148
|
+
mockGetReports.mockReturnValueOnce(mockedReports.reports);
|
|
149
|
+
const { user } = render(<Reports />, { reportsClient: mockReportsClient.object });
|
|
234
150
|
|
|
235
151
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
236
152
|
|
|
@@ -242,45 +158,26 @@ describe("Reports View", () => {
|
|
|
242
158
|
});
|
|
243
159
|
|
|
244
160
|
// Be an exact match on display name.
|
|
245
|
-
await userEvent.type(
|
|
246
|
-
searchInput,
|
|
247
|
-
mockedReports.reports[0].displayName
|
|
248
|
-
);
|
|
161
|
+
await userEvent.type(searchInput, mockedReports.reports[0].displayName);
|
|
249
162
|
expect(screen.getAllByTestId("horizontal-tile")).toHaveLength(1);
|
|
250
|
-
expect(
|
|
251
|
-
screen.getByText(mockedReports.reports[0].displayName)
|
|
252
|
-
).toBeInTheDocument();
|
|
163
|
+
expect(screen.getByText(mockedReports.reports[0].displayName)).toBeInTheDocument();
|
|
253
164
|
|
|
254
165
|
// Be an exact match on description.
|
|
255
166
|
await userEvent.clear(searchInput);
|
|
256
|
-
await userEvent.type(
|
|
257
|
-
searchInput,
|
|
258
|
-
mockedReports.reports[0].description ?? ""
|
|
259
|
-
);
|
|
167
|
+
await userEvent.type(searchInput, mockedReports.reports[0].description ?? "");
|
|
260
168
|
expect(screen.getAllByTestId("horizontal-tile")).toHaveLength(1);
|
|
261
|
-
expect(
|
|
262
|
-
screen.getByText(mockedReports.reports[0].displayName)
|
|
263
|
-
).toBeInTheDocument();
|
|
169
|
+
expect(screen.getByText(mockedReports.reports[0].displayName)).toBeInTheDocument();
|
|
264
170
|
});
|
|
265
171
|
|
|
266
172
|
it("modify a report", async () => {
|
|
267
173
|
const mockedReports: ReportCollection = reportsFactory();
|
|
268
|
-
|
|
269
|
-
rest.get(
|
|
270
|
-
`${REPORTS_CONFIG_BASE_URL}/insights/reporting/reports`,
|
|
271
|
-
async (_req, res, ctx) => {
|
|
272
|
-
return res(ctx.delay(200), ctx.status(200), ctx.json(mockedReports));
|
|
273
|
-
}
|
|
274
|
-
)
|
|
275
|
-
);
|
|
174
|
+
mockGetReports.mockReturnValueOnce(mockedReports.reports);
|
|
276
175
|
const onClickModifyMock = jest.fn();
|
|
277
|
-
const { user } = render(<Reports onClickReportModify={onClickModifyMock}
|
|
176
|
+
const { user } = render(<Reports onClickReportModify={onClickModifyMock} />, { reportsClient: mockReportsClient.object });
|
|
278
177
|
|
|
279
178
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
280
179
|
|
|
281
|
-
const firstMenuDropdown = within(
|
|
282
|
-
screen.getAllByTestId(/tile-action-button/i)[0]
|
|
283
|
-
).getByRole("button");
|
|
180
|
+
const firstMenuDropdown = within(screen.getAllByTestId(/tile-action-button/i)[0]).getByRole("button");
|
|
284
181
|
await user.click(firstMenuDropdown);
|
|
285
182
|
const modifyButton = screen.getByRole("menuitem", { name: /modify/i });
|
|
286
183
|
await user.click(modifyButton);
|
|
@@ -289,22 +186,13 @@ describe("Reports View", () => {
|
|
|
289
186
|
|
|
290
187
|
it("click a report", async () => {
|
|
291
188
|
const mockedReports: ReportCollection = reportsFactory();
|
|
292
|
-
|
|
293
|
-
rest.get(
|
|
294
|
-
`${REPORTS_CONFIG_BASE_URL}/insights/reporting/reports`,
|
|
295
|
-
async (_req, res, ctx) => {
|
|
296
|
-
return res(ctx.delay(200), ctx.status(200), ctx.json(mockedReports));
|
|
297
|
-
}
|
|
298
|
-
)
|
|
299
|
-
);
|
|
189
|
+
mockGetReports.mockReturnValueOnce(mockedReports.reports);
|
|
300
190
|
const onClickTitleMock = jest.fn();
|
|
301
|
-
const { user } = render(<Reports onClickReportTitle={onClickTitleMock}
|
|
191
|
+
const { user } = render(<Reports onClickReportTitle={onClickTitleMock} />, { reportsClient: mockReportsClient.object });
|
|
302
192
|
|
|
303
193
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
304
194
|
|
|
305
|
-
const reportName = screen.getByText(
|
|
306
|
-
mockedReports.reports[0].displayName
|
|
307
|
-
);
|
|
195
|
+
const reportName = screen.getByText(mockedReports.reports[0].displayName);
|
|
308
196
|
await user.click(reportName);
|
|
309
197
|
expect(onClickTitleMock).toBeCalled();
|
|
310
198
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
6
|
import "@testing-library/jest-dom";
|
|
7
7
|
import { render, screen } from "../test/test-utils";
|
package/src/test/test-utils.tsx
CHANGED
|
@@ -1,27 +1,98 @@
|
|
|
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 * as React from "react";
|
|
6
6
|
import { render as rtlRender } from "@testing-library/react";
|
|
7
7
|
import userEvent from "@testing-library/user-event";
|
|
8
8
|
import type { ReportsConfigContextProps } from "../widget/components/ReportsConfigContext";
|
|
9
9
|
import { ReportsConfigContext } from "../widget/components/ReportsConfigContext";
|
|
10
|
+
import { IModelState } from "@itwin/imodels-client-management";
|
|
10
11
|
|
|
11
12
|
export const mockAccessToken = async () => "Bearer eyJhbGci";
|
|
12
13
|
|
|
14
|
+
export const mockIModelId1 = "mockIModelId1";
|
|
15
|
+
export const mockIModelId2 = "mockIModelId2";
|
|
16
|
+
|
|
17
|
+
export const mockMappingId1 = "mockMappingId1";
|
|
18
|
+
export const mockMappingId2 = "mockMappingId2";
|
|
19
|
+
|
|
20
|
+
export const mockReportId = "mockReportId";
|
|
21
|
+
export const mockITwinId: string = "mockiTwinId";
|
|
22
|
+
|
|
23
|
+
export const mockIModelsResponse = [
|
|
24
|
+
{
|
|
25
|
+
iModel: {
|
|
26
|
+
id: mockIModelId1,
|
|
27
|
+
displayName: "rAnDoMdIsPlAynAmE1",
|
|
28
|
+
name: "rAnDomName1",
|
|
29
|
+
description: "rAnDoMDeScRiPtIoN1",
|
|
30
|
+
createdDateTime: "2021-10-04T22:13:50.397Z",
|
|
31
|
+
state: IModelState.Initialized,
|
|
32
|
+
iTwinId: mockITwinId,
|
|
33
|
+
extent: null,
|
|
34
|
+
getCreator: async () => undefined,
|
|
35
|
+
_links: {
|
|
36
|
+
creator: {
|
|
37
|
+
href: "",
|
|
38
|
+
},
|
|
39
|
+
namedVersions: {
|
|
40
|
+
href: "",
|
|
41
|
+
},
|
|
42
|
+
changesets: {
|
|
43
|
+
href: "",
|
|
44
|
+
},
|
|
45
|
+
upload: undefined,
|
|
46
|
+
complete: undefined,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
iModel: {
|
|
52
|
+
id: mockIModelId2,
|
|
53
|
+
displayName: "rAnDoMdIsPlAynAmE2",
|
|
54
|
+
name: "rAnDomName2",
|
|
55
|
+
description: "rAnDoMDeScRiPtIoN2",
|
|
56
|
+
createdDateTime: "2021-10-04T22:13:50.397Z",
|
|
57
|
+
state: IModelState.Initialized,
|
|
58
|
+
iTwinId: mockITwinId,
|
|
59
|
+
extent: null,
|
|
60
|
+
getCreator: async () => undefined,
|
|
61
|
+
_links: {
|
|
62
|
+
creator: {
|
|
63
|
+
href: "",
|
|
64
|
+
},
|
|
65
|
+
namedVersions: {
|
|
66
|
+
href: "",
|
|
67
|
+
},
|
|
68
|
+
changesets: {
|
|
69
|
+
href: "",
|
|
70
|
+
},
|
|
71
|
+
upload: undefined,
|
|
72
|
+
complete: undefined,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
export const mockExtractionRequestDetails = [
|
|
79
|
+
{
|
|
80
|
+
iModelId: mockIModelId1,
|
|
81
|
+
mappings: [{ id: mockMappingId1 }],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
iModelId: mockIModelId2,
|
|
85
|
+
mappings: [{ id: mockMappingId2 }],
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
|
|
13
89
|
interface WrapperProps {
|
|
14
90
|
children?: React.ReactNode;
|
|
15
91
|
}
|
|
16
|
-
export const mockITwinId: string = "mockiTwinId";
|
|
17
92
|
|
|
18
93
|
function render(ui: React.ReactElement, contextProps?: Partial<ReportsConfigContextProps>, { ...options } = {}) {
|
|
19
94
|
const Wrapper = ({ children }: WrapperProps) => (
|
|
20
|
-
<ReportsConfigContext
|
|
21
|
-
getAccessToken={mockAccessToken}
|
|
22
|
-
iTwinId={contextProps?.iTwinId ?? mockITwinId}
|
|
23
|
-
{...contextProps}
|
|
24
|
-
>
|
|
95
|
+
<ReportsConfigContext getAccessToken={mockAccessToken} iTwinId={contextProps?.iTwinId ?? mockITwinId} {...contextProps}>
|
|
25
96
|
{children}
|
|
26
97
|
</ReportsConfigContext>
|
|
27
98
|
);
|
|
@@ -1,54 +1,40 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
Widget,
|
|
8
|
-
} from "@itwin/appui-react";
|
|
9
|
-
import {
|
|
10
|
-
StagePanelLocation,
|
|
11
|
-
StagePanelSection,
|
|
12
|
-
StageUsage,
|
|
13
|
-
} from "@itwin/appui-react";
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import type { UiItemsProvider, Widget } from "@itwin/appui-react";
|
|
6
|
+
import { StagePanelLocation, StagePanelSection, StageUsage } from "@itwin/appui-react";
|
|
14
7
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
15
8
|
|
|
16
9
|
import * as React from "react";
|
|
17
10
|
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
18
11
|
import ReportsContainer from "./components/ReportsContainer";
|
|
19
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
20
16
|
export const REPORTS_CONFIG_BASE_URL = "https://api.bentley.com";
|
|
21
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Reports Config Widget UI Provider
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
22
|
export class ReportsConfigProvider implements UiItemsProvider {
|
|
23
23
|
public readonly id = "ReportsConfigProvider";
|
|
24
24
|
private readonly _getAccessToken?: () => Promise<AccessToken>;
|
|
25
25
|
private readonly _baseUrl: string;
|
|
26
26
|
|
|
27
|
-
constructor(
|
|
28
|
-
getAccessToken?: () => Promise<AccessToken>,
|
|
29
|
-
baseUrl: string = REPORTS_CONFIG_BASE_URL
|
|
30
|
-
) {
|
|
27
|
+
constructor(getAccessToken?: () => Promise<AccessToken>, baseUrl: string = REPORTS_CONFIG_BASE_URL) {
|
|
31
28
|
this._getAccessToken = getAccessToken;
|
|
32
29
|
this._baseUrl = baseUrl;
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
public provideWidgets(
|
|
36
|
-
_stageId: string,
|
|
37
|
-
stageUsage: string,
|
|
38
|
-
location: StagePanelLocation,
|
|
39
|
-
section?: StagePanelSection
|
|
40
|
-
): ReadonlyArray<Widget> {
|
|
32
|
+
public provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection): ReadonlyArray<Widget> {
|
|
41
33
|
const widgets: Widget[] = [];
|
|
42
|
-
if (
|
|
43
|
-
location === StagePanelLocation.Left &&
|
|
44
|
-
section === StagePanelSection.Start &&
|
|
45
|
-
stageUsage === StageUsage.General
|
|
46
|
-
) {
|
|
34
|
+
if (location === StagePanelLocation.Left && section === StagePanelSection.Start && stageUsage === StageUsage.General) {
|
|
47
35
|
const ReportsWidget: Widget = {
|
|
48
36
|
id: "reports-config-widget",
|
|
49
|
-
label: ReportsConfigWidget.localization.getLocalizedString(
|
|
50
|
-
"ReportsConfigWidget:ReportsConfig"
|
|
51
|
-
),
|
|
37
|
+
label: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ReportsConfig"),
|
|
52
38
|
content: <ReportsContainer getAccessToken={this._getAccessToken} baseUrl={this._baseUrl} />,
|
|
53
39
|
};
|
|
54
40
|
|
|
@@ -28,23 +28,12 @@ const ActionPanel = ({
|
|
|
28
28
|
return (
|
|
29
29
|
<div className="rcw-action-panel">
|
|
30
30
|
{isLoading && <LoadingSpinner />}
|
|
31
|
-
<Button
|
|
32
|
-
disabled={isSavingDisabled || isLoading}
|
|
33
|
-
styleType="high-visibility"
|
|
34
|
-
onClick={onAction}
|
|
35
|
-
>
|
|
31
|
+
<Button disabled={isSavingDisabled || isLoading} styleType="high-visibility" onClick={onAction}>
|
|
36
32
|
{actionLabel}
|
|
37
33
|
</Button>
|
|
38
34
|
{onCancel && (
|
|
39
|
-
<Button
|
|
40
|
-
|
|
41
|
-
type="button"
|
|
42
|
-
onClick={onCancel}
|
|
43
|
-
disabled={isCancelDisabled || isLoading}
|
|
44
|
-
>
|
|
45
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
46
|
-
"ReportsConfigWidget:Cancel"
|
|
47
|
-
)}
|
|
35
|
+
<Button styleType="default" type="button" onClick={onCancel} disabled={isCancelDisabled || isLoading}>
|
|
36
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Cancel")}
|
|
48
37
|
</Button>
|
|
49
38
|
)}
|
|
50
39
|
</div>
|