@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useValidator.js","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useValidator.js","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,CAAC,MAAM,iBAAiB,GAAG,uHAAuH,CAAC;AAEzJ,MAAM,YAAY,GAAG,GAA0E,EAAE;IAC/F,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,eAAe,GAAG;QACtB,qBAAqB,EAAE;YACrB,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,sDAAsD,CAAC;YACpH,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC5B,CAAC;SACF;QACD,gCAAgC,EAAE;YAChC,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,iEAAiE,CAAC;YAC/H,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACjC,CAAC;SACF;QACD,2CAA2C,EAAE;YAC3C,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,4EAA4E,CAAC;YAC1I,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACzC,CAAC;SACF;QACD,SAAS,EAAE;YACT,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,0CAA0C,CAAC;YACxG,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC;YAC3B,CAAC;SACF;KACF,CAAC;IAEF,MAAM,cAAc,GAAG;QACrB,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,oDAAoD,CAAC;KACpH,CAAC;IAEF,MAAM,SAAS,GAAG,IAAI,oBAAoB,CAAC;QACzC,QAAQ,EAAE,cAAc;QACxB,UAAU,EAAE,eAAe;KAC5B,CAAC,CAAC;IAEH,IAAI,IAAI,EAAE;QACR,SAAS,CAAC,YAAY,EAAE,CAAC;KAC1B;IAED,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { useState } from \"react\";\nimport SimpleReactValidator from \"simple-react-validator\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport const NAME_REQUIREMENTS = \"required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresSpacesAndDigits|CharLimit\";\n\nconst useValidator = (): [SimpleReactValidator, React.Dispatch<React.SetStateAction<boolean>>] => {\n const [show, setShow] = useState(false);\n const customValidator = {\n NoDuplicateUnderscore: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.NoDuplicateUnderscore\"),\n rule: (val: string) => {\n return !val.match(/__+/i);\n },\n },\n OnlyBeginsWithLetterOrUnderscore: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.OnlyBeginsWithLetterOrUnderscore\"),\n rule: (val: string) => {\n return !val.match(/^[\\W\\d]+/i);\n },\n },\n FollowedByLettersUnderscoresSpacesAndDigits: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.FollowedByLettersUnderscoresSpacesAndDigits\"),\n rule: (val: string) => {\n return !val.match(/[^a-zA-Z0-9_\\s]+/i);\n },\n },\n CharLimit: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.CharLimit\"),\n rule: (val: string) => {\n return val.length <= 128;\n },\n },\n };\n\n const customMessages = {\n required: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.ThisFieldIsRequired\"),\n };\n\n const validator = new SimpleReactValidator({\n messages: customMessages,\n validators: customValidator,\n });\n\n if (show) {\n validator.showMessages();\n }\n\n return [validator, setShow];\n};\n\nexport default useValidator;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/reports-config-widget-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "An iTwin.js 3D Viewer Widget that interfaces with the iTwin Reporting Platform.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Bentley",
|
|
@@ -22,11 +22,33 @@
|
|
|
22
22
|
"main": "lib/cjs/reports-config-widget-react.js",
|
|
23
23
|
"module": "lib/esm/reports-config-widget-react.js",
|
|
24
24
|
"typings": "lib/cjs/reports-config-widget-react",
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "npm run -s dual-build && npm run -s copy:assets",
|
|
27
|
+
"build:cjs": "tsc 1>&2 --outDir lib/cjs",
|
|
28
|
+
"build:esm": "tsc 1>&2 --module ES2020 --outDir lib/esm",
|
|
29
|
+
"clean": "rimraf lib",
|
|
30
|
+
"copy:assets": "npm run -s copy:public && npm run -s copy:cjs && npm run -s copy:esm",
|
|
31
|
+
"copy:cjs": "cpx \"./src/**/*.scss\" ./lib/cjs",
|
|
32
|
+
"copy:esm": "cpx \"./src/**/*.scss\" ./lib/esm",
|
|
33
|
+
"copy:public": "cpx \"./public/**/*\" ./lib/public",
|
|
34
|
+
"cover": "npm test -- --coverage",
|
|
35
|
+
"dual-build": "npm run -s build:cjs && npm run -s build:esm",
|
|
36
|
+
"extract-api": "betools extract-api --entry=reports-config-widget-react --apiReportFolder=./api --apiReportTempFolder=./api/temp --apiSummaryFolder=./api",
|
|
37
|
+
"lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
|
|
38
|
+
"lint:fix": "npm run lint -- --fix",
|
|
39
|
+
"pseudolocalize": "betools pseudolocalize --englishDir ./public/locales/en --out ./public/locales/en-PSEUDO",
|
|
40
|
+
"rebuild": "npm run clean && npm run build",
|
|
41
|
+
"test": "jest",
|
|
42
|
+
"test:watch": "jest --watch "
|
|
43
|
+
},
|
|
25
44
|
"eslintConfig": {
|
|
26
45
|
"plugins": [
|
|
27
46
|
"@itwin"
|
|
28
47
|
],
|
|
29
|
-
"extends":
|
|
48
|
+
"extends": [
|
|
49
|
+
"plugin:@itwin/ui",
|
|
50
|
+
"prettier"
|
|
51
|
+
],
|
|
30
52
|
"rules": {
|
|
31
53
|
"no-duplicate-imports": "off",
|
|
32
54
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
@@ -37,9 +59,10 @@
|
|
|
37
59
|
}
|
|
38
60
|
},
|
|
39
61
|
"dependencies": {
|
|
40
|
-
"@itwin/imodels-access-
|
|
41
|
-
"@itwin/imodels-
|
|
42
|
-
"@itwin/
|
|
62
|
+
"@itwin/imodels-access-common": "^4.1.4",
|
|
63
|
+
"@itwin/imodels-access-frontend": "^4.1.4",
|
|
64
|
+
"@itwin/imodels-client-management": "^4.2.3",
|
|
65
|
+
"@itwin/insights-client": "^0.10.1",
|
|
43
66
|
"@itwin/itwinui-icons-color-react": "^2.1.0",
|
|
44
67
|
"@itwin/itwinui-icons-react": "^2.4.0",
|
|
45
68
|
"@itwin/itwinui-react": "^2.11.0",
|
|
@@ -61,6 +84,8 @@
|
|
|
61
84
|
"@itwin/core-orbitgt": "^4.0.0",
|
|
62
85
|
"@itwin/core-quantity": "^4.0.0",
|
|
63
86
|
"@itwin/core-react": "^4.0.0",
|
|
87
|
+
"@itwin/core-telemetry": "^4.0.0",
|
|
88
|
+
"@itwin/ecschema-metadata": "^4.0.0",
|
|
64
89
|
"@itwin/eslint-plugin": "^3.7.8",
|
|
65
90
|
"@itwin/imodel-components-react": "^4.0.0",
|
|
66
91
|
"@itwin/presentation-common": "^4.0.0",
|
|
@@ -83,21 +108,21 @@
|
|
|
83
108
|
"chai": "^4.2.0",
|
|
84
109
|
"cpx2": "^3.0.0",
|
|
85
110
|
"eslint": "^7.32.0",
|
|
111
|
+
"eslint-config-prettier": "^9.1.0",
|
|
86
112
|
"eslint-plugin-node": "^11.1.0",
|
|
87
|
-
"eslint-plugin-react": "^7.
|
|
113
|
+
"eslint-plugin-react": "^7.33.2",
|
|
88
114
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
89
115
|
"jest": "^27.5.1",
|
|
90
116
|
"jest-cli": "^27.5.1",
|
|
91
117
|
"jest-transform-stub": "^2.0.0",
|
|
92
|
-
"msw": "^0.39.2",
|
|
93
118
|
"react": "^17.0.2",
|
|
94
119
|
"react-dom": "^17.0.2",
|
|
95
|
-
"react-redux": "^7.2.
|
|
96
|
-
"redux": "^4.0
|
|
120
|
+
"react-redux": "^7.2.2",
|
|
121
|
+
"redux": "^4.1.0",
|
|
97
122
|
"rimraf": "^3.0.2",
|
|
98
123
|
"ts-jest": "^27.1.3",
|
|
99
124
|
"typemoq": "^2.1.0",
|
|
100
|
-
"typescript": "~4.
|
|
125
|
+
"typescript": "~4.6.0",
|
|
101
126
|
"xmlhttprequest": "^1.8.0"
|
|
102
127
|
},
|
|
103
128
|
"peerDependencies": {
|
|
@@ -108,24 +133,5 @@
|
|
|
108
133
|
"react": "^17.0.2",
|
|
109
134
|
"react-dom": "^17.0.2",
|
|
110
135
|
"react-redux": "^7.2.0"
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
"build": "npm run -s dual-build && npm run -s copy:assets",
|
|
114
|
-
"build:cjs": "tsc 1>&2 --outDir lib/cjs",
|
|
115
|
-
"build:esm": "tsc 1>&2 --module ES2020 --outDir lib/esm",
|
|
116
|
-
"clean": "rimraf lib",
|
|
117
|
-
"copy:assets": "npm run -s copy:public && npm run -s copy:cjs && npm run -s copy:esm",
|
|
118
|
-
"copy:cjs": "cpx \"./src/**/*.scss\" ./lib/cjs",
|
|
119
|
-
"copy:esm": "cpx \"./src/**/*.scss\" ./lib/esm",
|
|
120
|
-
"copy:public": "cpx \"./public/**/*\" ./lib/public",
|
|
121
|
-
"cover": "npm test -- --coverage",
|
|
122
|
-
"dual-build": "npm run -s build:cjs && npm run -s build:esm",
|
|
123
|
-
"lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
|
|
124
|
-
"lint:fix": "npm run lint -- --fix",
|
|
125
|
-
"pseudolocalize": "betools pseudolocalize --englishDir ./public/locales/en --out ./public/locales/en-PSEUDO",
|
|
126
|
-
"rebuild": "npm run clean && npm run build",
|
|
127
|
-
"test": "jest",
|
|
128
|
-
"test:watch": "jest --watch "
|
|
129
|
-
},
|
|
130
|
-
"readme": "# @itwin/reports-config-widget-react\r\n\r\nCopyright © Bentley Systems, Incorporated. All rights reserved.\r\nThe Reports Config widget is a UI component for iTwin Viewer applications that simplifies how users (and developers) interface with the [Reporting Platform APIs](https://developer.bentley.com/apis/insights/overview/). This widget is one piece of the Reporting story that focuses on the configuration of Reports and the extraction thereof. It complements the [Grouping & Mapping Widget](https://www.npmjs.com/package/@itwin/grouping-mapping-widget).\r\nThe reports-config-widget-react package provides a UiProvider class - `ReportsConfigProvider` - which can be passed into the `uiProviders` prop of the iTwin Viewer's `<Viewer />` component.\r\n\r\n## Getting Started\r\n\r\nThis is not a standalone UI and requires a parent iTwin Viewer application to work as intended.\r\nA guide on how to create a basic iTwin Viewer application can be found here: <https://www.itwinjs.org/learning/tutorials/develop-web-viewer/>.\r\nThis package provides a viewer 'widget'. Documentation on how to add a widget to your application can be found here: <https://developer.bentley.com/tutorials/itwin-viewer-hello-world/#2-your-first-ui-widget>.\r\n\r\n## Permissions and Scopes\r\n\r\nThe SPA client used by your iTwin viewer must have these additional scopes:\r\n\r\n- `insights:read`\r\n- `insights:modify`\r\n- `projects:read`\r\n\r\nIn addition, users must have the `imodels_read` and `imodels_write` [permissions](https://developer.bentley.com/apis/insights/operations/create-mapping/#authorization) assigned at either the Project or iModel level. Further instruction on how to create roles and assign permissions can be found in the [iTwin Platform Projects API documentation](https://developer.bentley.com/apis/projects/tutorials/).\r\n\r\n## Sample usage\r\n\r\n### Call ReportsConfigWidget.initialize() **_before_** making use of the provider\r\n\r\n```ts\r\nimport { ReportsConfigProvider, ReportsConfigWidget } from '@itwin/reports-config-widget-react'\r\n\r\n...\r\n\r\nawait ReportsConfigWidget.initialize(IModelApp.localization);\r\n\r\n<Viewer\r\n ...\r\n uiProviders={[new ReportsConfigProvider()]}\r\n/>\r\n```\r\n"
|
|
131
|
-
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -1,10 +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 type { Localization } from "@itwin/core-common";
|
|
6
6
|
import { IModelApp } from "@itwin/core-frontend";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* ReportsConfigWidget localization
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
8
12
|
export class ReportsConfigWidget {
|
|
9
13
|
private static _localizationNamespace: string;
|
|
10
14
|
private static _localization: Localization;
|
|
@@ -21,16 +25,12 @@ export class ReportsConfigWidget {
|
|
|
21
25
|
ReportsConfigWidget._localization = localization ?? IModelApp.localization;
|
|
22
26
|
// Setup localization
|
|
23
27
|
const ReportsConfigWidgetNamespace = "ReportsConfigWidget";
|
|
24
|
-
await ReportsConfigWidget._localization.registerNamespace(
|
|
25
|
-
ReportsConfigWidgetNamespace
|
|
26
|
-
);
|
|
28
|
+
await ReportsConfigWidget._localization.registerNamespace(ReportsConfigWidgetNamespace);
|
|
27
29
|
|
|
28
30
|
ReportsConfigWidget._localizationNamespace = ReportsConfigWidgetNamespace;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
public static terminate() {
|
|
32
|
-
ReportsConfigWidget._localization.unregisterNamespace(
|
|
33
|
-
ReportsConfigWidget.localizationNamespace
|
|
34
|
-
);
|
|
34
|
+
ReportsConfigWidget._localization.unregisterNamespace(ReportsConfigWidget.localizationNamespace);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -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
|
/** UI Provider for iTwin Viewer Applications */
|
|
6
6
|
export * from "./widget/ReportsConfigUiProvider";
|
|
7
7
|
export * from "./ReportsConfigWidget";
|
|
@@ -1,84 +1,19 @@
|
|
|
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
|
-
waitFor,
|
|
13
|
-
within,
|
|
14
|
-
} from "./test-utils";
|
|
9
|
+
import { mockIModelId1, mockIModelId2, mockIModelsResponse, mockITwinId, mockReportId, render, screen, waitFor, within } from "./test-utils";
|
|
15
10
|
import * as moq from "typemoq";
|
|
16
|
-
import type {
|
|
17
|
-
MappingsClient,
|
|
18
|
-
MappingSingle,
|
|
19
|
-
ReportMappingCollection,
|
|
20
|
-
ReportsClient,
|
|
21
|
-
} from "@itwin/insights-client";
|
|
11
|
+
import type { MappingContainer, MappingsClient, ReportMappingCollection, ReportsClient } from "@itwin/insights-client";
|
|
22
12
|
import type { ReportMappingAndMapping } from "../widget/components/ReportMappings";
|
|
23
|
-
import type { GetSingleIModelParams,
|
|
24
|
-
import { IModelState } from "@itwin/imodels-client-management";
|
|
13
|
+
import type { GetSingleIModelParams, IModelsClient } from "@itwin/imodels-client-management";
|
|
25
14
|
import { AddMappingsModal } from "../widget/components/AddMappingsModal";
|
|
26
15
|
import { EmptyLocalization } from "@itwin/core-common";
|
|
27
|
-
|
|
28
|
-
const mockITwinId = faker.datatype.uuid();
|
|
29
|
-
const mockIModelId1 = faker.datatype.uuid();
|
|
30
|
-
const mockIModelId2 = faker.datatype.uuid();
|
|
31
|
-
|
|
32
|
-
const mockReportId = faker.datatype.uuid();
|
|
33
|
-
|
|
34
|
-
const mockIModelsResponse = [
|
|
35
|
-
{
|
|
36
|
-
iModel: {
|
|
37
|
-
id: mockIModelId1,
|
|
38
|
-
displayName: "rAnDoMdIsPlAynAmE1",
|
|
39
|
-
name: "rAnDomName1",
|
|
40
|
-
description: "rAnDoMDeScRiPtIoN1",
|
|
41
|
-
createdDateTime: "2021-10-04T22:13:50.397Z",
|
|
42
|
-
state: IModelState.Initialized,
|
|
43
|
-
projectId: mockITwinId,
|
|
44
|
-
extent: null,
|
|
45
|
-
_links: {
|
|
46
|
-
creator: {
|
|
47
|
-
href: "",
|
|
48
|
-
},
|
|
49
|
-
namedVersions: {
|
|
50
|
-
href: "",
|
|
51
|
-
},
|
|
52
|
-
changesets: {
|
|
53
|
-
href: "",
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
iModel: {
|
|
60
|
-
id: mockIModelId2,
|
|
61
|
-
displayName: "rAnDoMdIsPlAynAmE2",
|
|
62
|
-
name: "rAnDomName2",
|
|
63
|
-
description: "rAnDoMDeScRiPtIoN2",
|
|
64
|
-
createdDateTime: "2021-10-04T22:13:50.397Z",
|
|
65
|
-
state: IModelState.Initialized,
|
|
66
|
-
projectId: mockITwinId,
|
|
67
|
-
extent: null,
|
|
68
|
-
_links: {
|
|
69
|
-
creator: {
|
|
70
|
-
href: "",
|
|
71
|
-
},
|
|
72
|
-
namedVersions: {
|
|
73
|
-
href: "",
|
|
74
|
-
},
|
|
75
|
-
changesets: {
|
|
76
|
-
href: "",
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
];
|
|
16
|
+
import type { IModelOperations, OperationOptions } from "@itwin/imodels-client-management/lib/operations";
|
|
82
17
|
|
|
83
18
|
const mockProjectIModels = {
|
|
84
19
|
iModels: mockIModelsResponse.map((iModel) => ({
|
|
@@ -139,29 +74,25 @@ const mockReportMappingsFactory = (): ReportMappingCollection => {
|
|
|
139
74
|
};
|
|
140
75
|
};
|
|
141
76
|
|
|
142
|
-
const mockMappingsFactory = (
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
imodel: {
|
|
158
|
-
// Tie the mapping to to the iModel Id
|
|
159
|
-
href: mapping.imodelId,
|
|
160
|
-
},
|
|
77
|
+
const mockMappingsFactory = (mockReportMappings: ReportMappingCollection): MappingContainer[] => {
|
|
78
|
+
const mockMappings: MappingContainer[] = mockReportMappings.mappings.map((mapping, index) => ({
|
|
79
|
+
mapping: {
|
|
80
|
+
id: mapping.mappingId,
|
|
81
|
+
mappingName: `mOcKMaPpIngNaMe${index}`,
|
|
82
|
+
description: `mOcKmApPInGDeScRiPtIoN${index}`,
|
|
83
|
+
extractionEnabled: false,
|
|
84
|
+
createdOn: "",
|
|
85
|
+
createdBy: "",
|
|
86
|
+
modifiedOn: "",
|
|
87
|
+
modifiedBy: "",
|
|
88
|
+
_links: {
|
|
89
|
+
iModel: {
|
|
90
|
+
// Tie the mapping to to the iModel Id
|
|
91
|
+
href: mapping.imodelId,
|
|
161
92
|
},
|
|
162
93
|
},
|
|
163
|
-
}
|
|
164
|
-
);
|
|
94
|
+
},
|
|
95
|
+
}));
|
|
165
96
|
|
|
166
97
|
const extraMappingId = faker.datatype.uuid();
|
|
167
98
|
const extraMappingName = "mOcKNaMeExTrA";
|
|
@@ -178,7 +109,7 @@ const mockMappingsFactory = (
|
|
|
178
109
|
modifiedOn: "",
|
|
179
110
|
modifiedBy: "",
|
|
180
111
|
_links: {
|
|
181
|
-
|
|
112
|
+
iModel: {
|
|
182
113
|
href: "",
|
|
183
114
|
},
|
|
184
115
|
},
|
|
@@ -188,19 +119,18 @@ const mockMappingsFactory = (
|
|
|
188
119
|
return mockMappings;
|
|
189
120
|
};
|
|
190
121
|
|
|
191
|
-
const mockReportMappingsAndMappingsFactory = (mockMappings:
|
|
192
|
-
const reportMappingsAndMapping =
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
});
|
|
122
|
+
const mockReportMappingsAndMappingsFactory = (mockMappings: MappingContainer[], reportMappings: ReportMappingCollection): ReportMappingAndMapping[] => {
|
|
123
|
+
const reportMappingsAndMapping = reportMappings.mappings.map((reportMapping) => {
|
|
124
|
+
const mapping = mockMappings.find((x) => x.mapping.id === reportMapping.mappingId)!.mapping;
|
|
125
|
+
const iModelName = mockProjectIModels.iModels.find((x) => x.id === reportMapping.imodelId)!.displayName;
|
|
126
|
+
const reportMappingAndMapping: ReportMappingAndMapping = {
|
|
127
|
+
...reportMapping,
|
|
128
|
+
iModelName,
|
|
129
|
+
mappingName: mapping.mappingName,
|
|
130
|
+
mappingDescription: mapping.description ?? "",
|
|
131
|
+
};
|
|
132
|
+
return reportMappingAndMapping;
|
|
133
|
+
});
|
|
204
134
|
return reportMappingsAndMapping;
|
|
205
135
|
};
|
|
206
136
|
|
|
@@ -222,12 +152,13 @@ const mockMappingsClient = moq.Mock.ofType<MappingsClient>();
|
|
|
222
152
|
beforeAll(async () => {
|
|
223
153
|
const localization = new EmptyLocalization();
|
|
224
154
|
await ReportsConfigWidget.initialize(localization);
|
|
225
|
-
mockIModelsClientOperations
|
|
155
|
+
mockIModelsClientOperations
|
|
156
|
+
.setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId1 })))
|
|
226
157
|
.returns(async () => mockIModelsResponse[0].iModel);
|
|
227
|
-
mockIModelsClientOperations
|
|
158
|
+
mockIModelsClientOperations
|
|
159
|
+
.setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId2 })))
|
|
228
160
|
.returns(async () => mockIModelsResponse[1].iModel);
|
|
229
|
-
mockIModelsClient.setup((x) => x.iModels)
|
|
230
|
-
.returns(() => mockIModelsClientOperations.object);
|
|
161
|
+
mockIModelsClient.setup((x) => x.iModels).returns(() => mockIModelsClientOperations.object);
|
|
231
162
|
mockReportsClient.setup(async (x) => x.createReportMapping(moq.It.isAny(), moq.It.isAny(), moq.It.isAny())).returns(mockCreateReportMapping);
|
|
232
163
|
mockMappingsClient.setup(async (x) => x.getMappings(moq.It.isAny(), moq.It.isAny())).returns(mockGetMappings);
|
|
233
164
|
});
|
|
@@ -243,7 +174,7 @@ describe("Add Mapping Modal", () => {
|
|
|
243
174
|
const mockMappings = mockMappingsFactory(mockReportMappings);
|
|
244
175
|
const mockReportMappingsAndMappings = mockReportMappingsAndMappingsFactory(mockMappings, mockReportMappings);
|
|
245
176
|
|
|
246
|
-
mockGetMappings.mockReturnValueOnce(mockMappings.map((m:
|
|
177
|
+
mockGetMappings.mockReturnValueOnce({ mappings: mockMappings.map((m: MappingContainer) => m.mapping) });
|
|
247
178
|
|
|
248
179
|
const { user } = render(
|
|
249
180
|
<AddMappingsModal
|
|
@@ -252,7 +183,8 @@ describe("Add Mapping Modal", () => {
|
|
|
252
183
|
existingMappings={mockReportMappingsAndMappings}
|
|
253
184
|
onClose={jest.fn()}
|
|
254
185
|
defaultIModelId={mockIModelId1}
|
|
255
|
-
/>,
|
|
186
|
+
/>,
|
|
187
|
+
{ iTwinId: mockITwinId, reportsClient: mockReportsClient.object, mappingsClient: mockMappingsClient.object, iModelsClient: mockIModelsClient.object },
|
|
256
188
|
);
|
|
257
189
|
|
|
258
190
|
expect(screen.getByRole("dialog")).toBeInTheDocument();
|
|
@@ -269,10 +201,7 @@ describe("Add Mapping Modal", () => {
|
|
|
269
201
|
// Already mapped mappings are disabled
|
|
270
202
|
for (let i = 0; i < mockMappings.length - 1; i++) {
|
|
271
203
|
const row = screen.getByRole("row", {
|
|
272
|
-
name: new RegExp(
|
|
273
|
-
`${mockMappings[i].mapping.mappingName} ${mockMappings[i].mapping.description}`,
|
|
274
|
-
"i"
|
|
275
|
-
),
|
|
204
|
+
name: new RegExp(`${mockMappings[i].mapping.mappingName} ${mockMappings[i].mapping.description}`, "i"),
|
|
276
205
|
});
|
|
277
206
|
|
|
278
207
|
const checkbox = within(row).getByRole("checkbox");
|
|
@@ -281,11 +210,7 @@ describe("Add Mapping Modal", () => {
|
|
|
281
210
|
|
|
282
211
|
// Click on checkbox on new mapping
|
|
283
212
|
const unmappedRow = screen.getByRole("row", {
|
|
284
|
-
name: new RegExp(
|
|
285
|
-
`${mockMappings[mockMappings.length - 1].mapping.mappingName
|
|
286
|
-
} ${mockMappings[mockMappings.length - 1].mapping.description}`,
|
|
287
|
-
"i"
|
|
288
|
-
),
|
|
213
|
+
name: new RegExp(`${mockMappings[mockMappings.length - 1].mapping.mappingName} ${mockMappings[mockMappings.length - 1].mapping.description}`, "i"),
|
|
289
214
|
});
|
|
290
215
|
|
|
291
216
|
const enabledCheckbox = within(unmappedRow).getByRole("checkbox");
|