@itwin/reports-config-widget-react 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +76 -1
- package/CHANGELOG.md +27 -2
- package/LICENSE.md +9 -9
- package/README.md +38 -38
- package/__mocks__/fileMock.js +4 -4
- package/api/reports-config-widget-react.api.md +126 -0
- package/api/reports-config-widget-react.exports.csv +14 -0
- package/api/temp/reports-config-widget-react.api.md +126 -0
- package/coverage/clover.xml +521 -521
- package/coverage/coverage-final.json +32 -32
- package/coverage/lcov-report/index.html +31 -31
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +15 -15
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/test/index.html +11 -11
- package/coverage/lcov-report/src/test/test-utils.tsx.html +46 -16
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +29 -86
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +5 -38
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +25 -121
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +120 -96
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +5 -5
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +13 -103
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +7 -22
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +7 -28
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +20 -47
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +20 -11
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +16 -79
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +15 -108
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +36 -75
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +62 -92
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +104 -128
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +88 -301
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +42 -204
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +164 -50
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +15 -63
- package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +8 -47
- package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +6 -12
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +13 -25
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +11 -56
- package/coverage/lcov-report/src/widget/components/index.html +50 -50
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +25 -169
- package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +6 -12
- package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +10 -13
- package/coverage/lcov-report/src/widget/context/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +12 -54
- package/coverage/lcov-report/src/widget/index.html +13 -13
- package/coverage/lcov.info +941 -919
- package/jest.config.js +14 -17
- package/lib/cjs/ReportsConfigWidget.d.ts +4 -0
- package/lib/cjs/ReportsConfigWidget.d.ts.map +1 -1
- package/lib/cjs/ReportsConfigWidget.js +4 -0
- package/lib/cjs/ReportsConfigWidget.js.map +1 -1
- package/lib/cjs/reports-config-widget-react.d.ts +1 -0
- package/lib/cjs/reports-config-widget-react.d.ts.map +1 -1
- package/lib/cjs/reports-config-widget-react.js +4 -3
- package/lib/cjs/reports-config-widget-react.js.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.js +11 -10
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
- package/lib/cjs/test/BulkExtractor.test.js +68 -43
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
- package/lib/cjs/test/DeleteModal.test.js +3 -3
- package/lib/cjs/test/DeleteModal.test.js.map +1 -1
- package/lib/cjs/test/ReportAction.test.js +6 -4
- package/lib/cjs/test/ReportAction.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +64 -25
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/cjs/test/ReportMappings.test.js +39 -18
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +3 -3
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +3 -3
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/test-utils.d.ts +8 -0
- package/lib/cjs/test/test-utils.d.ts.map +1 -1
- package/lib/cjs/test/test-utils.js +16 -4
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +10 -4
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +11 -7
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js +7 -7
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.scss +1 -1
- package/lib/cjs/widget/components/BulkExtractor.d.ts +8 -5
- package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.js +52 -35
- package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
- package/lib/cjs/widget/components/Constants.d.ts.map +1 -1
- package/lib/cjs/widget/components/Constants.js +3 -3
- package/lib/cjs/widget/components/Constants.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js +5 -5
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.scss +2 -2
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.js +9 -9
- package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.scss +1 -1
- package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionToast.js +3 -3
- package/lib/cjs/widget/components/ExtractionToast.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.js +1 -2
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.scss +1 -4
- package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.d.ts +8 -0
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js +9 -7
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.scss +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js +4 -4
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +46 -45
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts +8 -0
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js +25 -11
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/Reports.d.ts +9 -1
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js +7 -8
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/Reports.scss +0 -1
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts +34 -4
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.js +27 -9
- package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.d.ts +3 -6
- package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js +7 -5
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.scss +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsHeader.js +6 -7
- package/lib/cjs/widget/components/ReportsHeader.js.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.js +3 -3
- package/lib/cjs/widget/components/ReportsRouter.js.map +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/cjs/widget/components/SearchBar.js +4 -4
- package/lib/cjs/widget/components/SearchBar.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +1 -1
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.scss +1 -1
- package/lib/cjs/widget/components/utils.d.ts +1 -1
- package/lib/cjs/widget/components/utils.d.ts.map +1 -1
- package/lib/cjs/widget/components/utils.js +5 -5
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts +3 -3
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.d.ts +1 -4
- package/lib/cjs/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.js +3 -3
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
- package/lib/esm/ReportsConfigWidget.d.ts +4 -0
- package/lib/esm/ReportsConfigWidget.d.ts.map +1 -1
- package/lib/esm/ReportsConfigWidget.js +4 -0
- package/lib/esm/ReportsConfigWidget.js.map +1 -1
- package/lib/esm/reports-config-widget-react.d.ts +1 -0
- package/lib/esm/reports-config-widget-react.d.ts.map +1 -1
- package/lib/esm/reports-config-widget-react.js +4 -3
- package/lib/esm/reports-config-widget-react.js.map +1 -1
- package/lib/esm/test/AddMappingModal.test.js +12 -11
- package/lib/esm/test/AddMappingModal.test.js.map +1 -1
- package/lib/esm/test/BulkExtractor.test.js +69 -44
- package/lib/esm/test/BulkExtractor.test.js.map +1 -1
- package/lib/esm/test/DeleteModal.test.js +4 -4
- package/lib/esm/test/DeleteModal.test.js.map +1 -1
- package/lib/esm/test/ReportAction.test.js +7 -5
- package/lib/esm/test/ReportAction.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +65 -26
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/esm/test/ReportMappings.test.js +41 -20
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +4 -4
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +3 -3
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/test-utils.d.ts +8 -0
- package/lib/esm/test/test-utils.d.ts.map +1 -1
- package/lib/esm/test/test-utils.js +15 -3
- package/lib/esm/test/test-utils.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts +10 -4
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.js +12 -8
- package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/esm/widget/components/ActionPanel.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.js +7 -7
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.scss +1 -1
- package/lib/esm/widget/components/BulkExtractor.d.ts +8 -5
- package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.js +53 -36
- package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
- package/lib/esm/widget/components/Constants.d.ts.map +1 -1
- package/lib/esm/widget/components/Constants.js +3 -3
- package/lib/esm/widget/components/Constants.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/esm/widget/components/DeleteModal.js +6 -6
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.scss +2 -2
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.js +9 -9
- package/lib/esm/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.scss +1 -1
- package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionToast.js +3 -3
- package/lib/esm/widget/components/ExtractionToast.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.js +1 -2
- package/lib/esm/widget/components/HorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.scss +1 -4
- package/lib/esm/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.d.ts +8 -0
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.js +10 -8
- package/lib/esm/widget/components/ReportAction.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.scss +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.js +6 -6
- package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js +47 -46
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.d.ts +8 -0
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js +28 -14
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/Reports.d.ts +9 -1
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js +8 -9
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/Reports.scss +0 -1
- package/lib/esm/widget/components/ReportsConfigContext.d.ts +34 -4
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.js +28 -10
- package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.d.ts +3 -6
- package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.js +7 -5
- package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.scss +1 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts +1 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsHeader.js +6 -7
- package/lib/esm/widget/components/ReportsHeader.js.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.js +3 -3
- package/lib/esm/widget/components/ReportsRouter.js.map +1 -1
- package/lib/esm/widget/components/SearchBar.d.ts +1 -1
- package/lib/esm/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/esm/widget/components/SearchBar.js +4 -4
- package/lib/esm/widget/components/SearchBar.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.d.ts +1 -1
- package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/esm/widget/components/SelectIModel.js +2 -2
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.scss +1 -1
- package/lib/esm/widget/components/utils.d.ts +1 -1
- package/lib/esm/widget/components/utils.d.ts.map +1 -1
- package/lib/esm/widget/components/utils.js +6 -6
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts +3 -3
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/esm/widget/hooks/useValidator.d.ts +1 -4
- package/lib/esm/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/esm/widget/hooks/useValidator.js +3 -3
- package/lib/esm/widget/hooks/useValidator.js.map +1 -1
- package/package.json +9 -4
- package/src/ReportsConfigWidget.ts +9 -9
- package/src/reports-config-widget-react.ts +4 -3
- package/src/test/AddMappingModal.test.tsx +45 -70
- package/src/test/BulkExtractor.test.ts +73 -118
- package/src/test/DeleteModal.test.tsx +6 -23
- package/src/test/ReportAction.test.tsx +20 -38
- package/src/test/ReportMappingHorizontalTile.test.tsx +137 -106
- package/src/test/ReportMappings.test.tsx +73 -88
- package/src/test/Reports.test.tsx +30 -64
- package/src/test/WidgetHeader.test.tsx +3 -3
- package/src/test/test-utils.tsx +18 -8
- package/src/widget/ReportsConfigUiProvider.tsx +18 -37
- package/src/widget/components/ActionPanel.tsx +3 -14
- package/src/widget/components/AddMappingsModal.scss +1 -1
- package/src/widget/components/AddMappingsModal.tsx +21 -53
- package/src/widget/components/BulkExtractor.ts +67 -59
- package/src/widget/components/Constants.ts +4 -4
- package/src/widget/components/DeleteModal.scss +2 -2
- package/src/widget/components/DeleteModal.tsx +11 -41
- package/src/widget/components/ExtractionStates/FailedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/QueuedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/RunningExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/StartingExtractionState.tsx +4 -11
- package/src/widget/components/ExtractionStates/SucceededExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStatus.scss +1 -1
- package/src/widget/components/ExtractionStatus.tsx +9 -18
- package/src/widget/components/ExtractionToast.tsx +12 -9
- package/src/widget/components/HorizontalTile.scss +1 -4
- package/src/widget/components/HorizontalTile.tsx +12 -33
- package/src/widget/components/LocalizedTablePaginator.tsx +13 -44
- package/src/widget/components/ReportAction.scss +1 -1
- package/src/widget/components/ReportAction.tsx +26 -39
- package/src/widget/components/ReportHorizontalTile.tsx +45 -55
- package/src/widget/components/ReportMappingHorizontalTile.tsx +70 -78
- package/src/widget/components/ReportMappings.tsx +61 -132
- package/src/widget/components/Reports.scss +0 -1
- package/src/widget/components/Reports.tsx +30 -84
- package/src/widget/components/ReportsConfigContext.tsx +70 -32
- package/src/widget/components/ReportsContainer.scss +1 -1
- package/src/widget/components/ReportsContainer.tsx +12 -28
- package/src/widget/components/ReportsHeader.tsx +6 -19
- package/src/widget/components/ReportsRouter.tsx +4 -6
- package/src/widget/components/SearchBar.tsx +9 -13
- package/src/widget/components/SelectIModel.scss +1 -1
- package/src/widget/components/SelectIModel.tsx +9 -24
- package/src/widget/components/utils.scss +1 -1
- package/src/widget/components/utils.tsx +21 -69
- package/src/widget/context/BulkExtractorContext.tsx +4 -6
- package/src/widget/context/ReportsConfigApiContext.tsx +7 -8
- package/src/widget/hooks/useValidator.ts +10 -24
- package/tsconfig.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkExtractorContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/BulkExtractorContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,oBAAY,gBAAgB,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1D,MAAM,WAAW,yBAAyB;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,0CAA+C,CAAC;AAEjF,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"BulkExtractorContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/BulkExtractorContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,oBAAY,gBAAgB,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1D,MAAM,WAAW,yBAAyB;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,0CAA+C,CAAC;AAEjF,eAAO,MAAM,gBAAgB,iCAM5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkExtractorContext.js","sourceRoot":"","sources":["../../../../src/widget/context/BulkExtractorContext.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAStC,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAA4B,EAAE,CAAC,CAAC;AAEjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"BulkExtractorContext.js","sourceRoot":"","sources":["../../../../src/widget/context/BulkExtractorContext.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAStC,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAA4B,EAAE,CAAC,CAAC;AAEjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;KAC3F;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,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 type { AccessToken } from \"@itwin/core-bentley\";\nimport * as React from \"react\";\nimport { createContext } from \"react\";\nimport type { BulkExtractor } from \"../components/BulkExtractor\";\n\nexport type GetAccessTokenFn = () => Promise<AccessToken>;\n\nexport interface BulkExtractorContextProps {\n bulkExtractor?: BulkExtractor;\n}\n\nexport const BulkExtractorContext = createContext<BulkExtractorContextProps>({});\n\nexport const useBulkExtractor = () => {\n const context = React.useContext(BulkExtractorContext);\n if (!context) {\n throw new Error(\"useBulkExtractor should be used within a BulkExtractorContext provider\");\n }\n return context;\n};\n"]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
2
2
|
import { IModelsClient } from "@itwin/imodels-client-management";
|
|
3
|
-
import {
|
|
3
|
+
import type { IMappingsClient, IReportsClient } from "@itwin/insights-client";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
export declare type GetAccessTokenFn = () => Promise<AccessToken>;
|
|
6
6
|
export interface ReportsConfigApiProps {
|
|
7
7
|
getAccessToken: GetAccessTokenFn;
|
|
8
8
|
iTwinId: string;
|
|
9
9
|
baseUrl: string;
|
|
10
|
-
reportsClient:
|
|
11
|
-
mappingsClient:
|
|
10
|
+
reportsClient: IReportsClient;
|
|
11
|
+
mappingsClient: IMappingsClient;
|
|
12
12
|
iModelsClient: IModelsClient;
|
|
13
13
|
}
|
|
14
14
|
export declare const ReportsConfigApiContext: React.Context<ReportsConfigApiProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsConfigApiContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/ReportsConfigApiContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ReportsConfigApiContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/ReportsConfigApiContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,oBAAY,gBAAgB,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1D,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,gBAAgB,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,cAAc,CAAC;IAC9B,cAAc,EAAE,eAAe,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,eAAO,MAAM,uBAAuB,sCAOlC,CAAC;AAEH,eAAO,MAAM,mBAAmB,6BAM/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsConfigApiContext.js","sourceRoot":"","sources":["../../../../src/widget/context/ReportsConfigApiContext.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"ReportsConfigApiContext.js","sourceRoot":"","sources":["../../../../src/widget/context/ReportsConfigApiContext.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAatC,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAwB;IAC1E,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;IAC9B,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,IAAI,aAAa,EAAE;IAClC,cAAc,EAAE,IAAI,cAAc,EAAE;IACpC,aAAa,EAAE,IAAI,aAAa,EAAE;CACnC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAC1D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;KACjG;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,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 type { AccessToken } from \"@itwin/core-bentley\";\nimport { IModelsClient } from \"@itwin/imodels-client-management\";\nimport type { IMappingsClient, IReportsClient } from \"@itwin/insights-client\";\nimport { MappingsClient, ReportsClient } from \"@itwin/insights-client\";\nimport * as React from \"react\";\nimport { createContext } from \"react\";\n\nexport type GetAccessTokenFn = () => Promise<AccessToken>;\n\nexport interface ReportsConfigApiProps {\n getAccessToken: GetAccessTokenFn;\n iTwinId: string;\n baseUrl: string;\n reportsClient: IReportsClient;\n mappingsClient: IMappingsClient;\n iModelsClient: IModelsClient;\n}\n\nexport const ReportsConfigApiContext = createContext<ReportsConfigApiProps>({\n getAccessToken: async () => \"\",\n iTwinId: \"\",\n baseUrl: \"\",\n reportsClient: new ReportsClient(),\n mappingsClient: new MappingsClient(),\n iModelsClient: new IModelsClient(),\n});\n\nexport const useReportsConfigApi = () => {\n const context = React.useContext(ReportsConfigApiContext);\n if (!context) {\n throw new Error(\"useReportsConfigApi should be used within a ReportsConfigApiContext provider\");\n }\n return context;\n};\n"]}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import SimpleReactValidator from "simple-react-validator";
|
|
2
2
|
export declare const NAME_REQUIREMENTS = "required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresSpacesAndDigits|CharLimit";
|
|
3
|
-
declare const useValidator: () => [
|
|
4
|
-
SimpleReactValidator,
|
|
5
|
-
React.Dispatch<React.SetStateAction<boolean>>
|
|
6
|
-
];
|
|
3
|
+
declare const useValidator: () => [SimpleReactValidator, React.Dispatch<React.SetStateAction<boolean>>];
|
|
7
4
|
export default useValidator;
|
|
8
5
|
//# sourceMappingURL=useValidator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useValidator.d.ts","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":"AAKA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAG1D,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"useValidator.d.ts","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":"AAKA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAG1D,eAAO,MAAM,iBAAiB,0HAA0H,CAAC;AAEzJ,QAAA,MAAM,YAAY,QAAO,CAAC,oBAAoB,EAAE,MAAM,QAAQ,CAAC,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC,CA2C5F,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -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 { useState } from "react";
|
|
6
6
|
import SimpleReactValidator from "simple-react-validator";
|
|
7
7
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
@@ -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.7.0",
|
|
4
4
|
"description": "An iTwin.js 3D Viewer Widget that interfaces with the iTwin Reporting Platform.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Bentley",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"copy:public": "cpx \"./public/**/*\" ./lib/public",
|
|
34
34
|
"cover": "npm test -- --coverage",
|
|
35
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",
|
|
36
37
|
"lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
|
|
37
38
|
"lint:fix": "npm run lint -- --fix",
|
|
38
39
|
"pseudolocalize": "betools pseudolocalize --englishDir ./public/locales/en --out ./public/locales/en-PSEUDO",
|
|
@@ -44,7 +45,10 @@
|
|
|
44
45
|
"plugins": [
|
|
45
46
|
"@itwin"
|
|
46
47
|
],
|
|
47
|
-
"extends":
|
|
48
|
+
"extends": [
|
|
49
|
+
"plugin:@itwin/ui",
|
|
50
|
+
"prettier"
|
|
51
|
+
],
|
|
48
52
|
"rules": {
|
|
49
53
|
"no-duplicate-imports": "off",
|
|
50
54
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
@@ -58,7 +62,7 @@
|
|
|
58
62
|
"@itwin/imodels-access-common": "^4.1.4",
|
|
59
63
|
"@itwin/imodels-access-frontend": "^4.1.4",
|
|
60
64
|
"@itwin/imodels-client-management": "^4.2.3",
|
|
61
|
-
"@itwin/insights-client": "^0.
|
|
65
|
+
"@itwin/insights-client": "^0.10.1",
|
|
62
66
|
"@itwin/itwinui-icons-color-react": "^2.1.0",
|
|
63
67
|
"@itwin/itwinui-icons-react": "^2.4.0",
|
|
64
68
|
"@itwin/itwinui-react": "^2.11.0",
|
|
@@ -81,8 +85,8 @@
|
|
|
81
85
|
"@itwin/core-quantity": "^4.0.0",
|
|
82
86
|
"@itwin/core-react": "^4.0.0",
|
|
83
87
|
"@itwin/core-telemetry": "^4.0.0",
|
|
84
|
-
"@itwin/eslint-plugin": "^3.7.8",
|
|
85
88
|
"@itwin/ecschema-metadata": "^4.0.0",
|
|
89
|
+
"@itwin/eslint-plugin": "^3.7.8",
|
|
86
90
|
"@itwin/imodel-components-react": "^4.0.0",
|
|
87
91
|
"@itwin/presentation-common": "^4.0.0",
|
|
88
92
|
"@itwin/presentation-frontend": "^4.0.0",
|
|
@@ -104,6 +108,7 @@
|
|
|
104
108
|
"chai": "^4.2.0",
|
|
105
109
|
"cpx2": "^3.0.0",
|
|
106
110
|
"eslint": "^7.32.0",
|
|
111
|
+
"eslint-config-prettier": "^9.1.0",
|
|
107
112
|
"eslint-plugin-node": "^11.1.0",
|
|
108
113
|
"eslint-plugin-react": "^7.33.2",
|
|
109
114
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
@@ -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,10 +1,11 @@
|
|
|
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";
|
|
8
|
+
export * from "@itwin/insights-client";
|
|
8
9
|
|
|
9
10
|
export { Reports, ReportsProps } from "./widget/components/Reports";
|
|
10
11
|
export { ReportMappings, ReportMappingsProps } from "./widget/components/ReportMappings";
|
|
@@ -1,29 +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 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
|
-
mockIModelId1,
|
|
11
|
-
mockIModelId2,
|
|
12
|
-
mockIModelsResponse,
|
|
13
|
-
mockITwinId,
|
|
14
|
-
mockReportId,
|
|
15
|
-
render,
|
|
16
|
-
screen,
|
|
17
|
-
waitFor,
|
|
18
|
-
within,
|
|
19
|
-
} from "./test-utils";
|
|
9
|
+
import { mockIModelId1, mockIModelId2, mockIModelsResponse, mockITwinId, mockReportId, render, screen, waitFor, within } from "./test-utils";
|
|
20
10
|
import * as moq from "typemoq";
|
|
21
|
-
import type {
|
|
22
|
-
MappingsClient,
|
|
23
|
-
MappingSingle,
|
|
24
|
-
ReportMappingCollection,
|
|
25
|
-
ReportsClient,
|
|
26
|
-
} from "@itwin/insights-client";
|
|
11
|
+
import type { MappingContainer, MappingsClient, ReportMappingCollection, ReportsClient } from "@itwin/insights-client";
|
|
27
12
|
import type { ReportMappingAndMapping } from "../widget/components/ReportMappings";
|
|
28
13
|
import type { GetSingleIModelParams, IModelsClient } from "@itwin/imodels-client-management";
|
|
29
14
|
import { AddMappingsModal } from "../widget/components/AddMappingsModal";
|
|
@@ -89,29 +74,25 @@ const mockReportMappingsFactory = (): ReportMappingCollection => {
|
|
|
89
74
|
};
|
|
90
75
|
};
|
|
91
76
|
|
|
92
|
-
const mockMappingsFactory = (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
imodel: {
|
|
108
|
-
// Tie the mapping to to the iModel Id
|
|
109
|
-
href: mapping.imodelId,
|
|
110
|
-
},
|
|
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,
|
|
111
92
|
},
|
|
112
93
|
},
|
|
113
|
-
}
|
|
114
|
-
);
|
|
94
|
+
},
|
|
95
|
+
}));
|
|
115
96
|
|
|
116
97
|
const extraMappingId = faker.datatype.uuid();
|
|
117
98
|
const extraMappingName = "mOcKNaMeExTrA";
|
|
@@ -128,7 +109,7 @@ const mockMappingsFactory = (
|
|
|
128
109
|
modifiedOn: "",
|
|
129
110
|
modifiedBy: "",
|
|
130
111
|
_links: {
|
|
131
|
-
|
|
112
|
+
iModel: {
|
|
132
113
|
href: "",
|
|
133
114
|
},
|
|
134
115
|
},
|
|
@@ -138,19 +119,18 @@ const mockMappingsFactory = (
|
|
|
138
119
|
return mockMappings;
|
|
139
120
|
};
|
|
140
121
|
|
|
141
|
-
const mockReportMappingsAndMappingsFactory = (mockMappings:
|
|
142
|
-
const reportMappingsAndMapping =
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
});
|
|
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
|
+
});
|
|
154
134
|
return reportMappingsAndMapping;
|
|
155
135
|
};
|
|
156
136
|
|
|
@@ -172,12 +152,13 @@ const mockMappingsClient = moq.Mock.ofType<MappingsClient>();
|
|
|
172
152
|
beforeAll(async () => {
|
|
173
153
|
const localization = new EmptyLocalization();
|
|
174
154
|
await ReportsConfigWidget.initialize(localization);
|
|
175
|
-
mockIModelsClientOperations
|
|
155
|
+
mockIModelsClientOperations
|
|
156
|
+
.setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId1 })))
|
|
176
157
|
.returns(async () => mockIModelsResponse[0].iModel);
|
|
177
|
-
mockIModelsClientOperations
|
|
158
|
+
mockIModelsClientOperations
|
|
159
|
+
.setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId2 })))
|
|
178
160
|
.returns(async () => mockIModelsResponse[1].iModel);
|
|
179
|
-
mockIModelsClient.setup((x) => x.iModels)
|
|
180
|
-
.returns(() => mockIModelsClientOperations.object);
|
|
161
|
+
mockIModelsClient.setup((x) => x.iModels).returns(() => mockIModelsClientOperations.object);
|
|
181
162
|
mockReportsClient.setup(async (x) => x.createReportMapping(moq.It.isAny(), moq.It.isAny(), moq.It.isAny())).returns(mockCreateReportMapping);
|
|
182
163
|
mockMappingsClient.setup(async (x) => x.getMappings(moq.It.isAny(), moq.It.isAny())).returns(mockGetMappings);
|
|
183
164
|
});
|
|
@@ -193,7 +174,7 @@ describe("Add Mapping Modal", () => {
|
|
|
193
174
|
const mockMappings = mockMappingsFactory(mockReportMappings);
|
|
194
175
|
const mockReportMappingsAndMappings = mockReportMappingsAndMappingsFactory(mockMappings, mockReportMappings);
|
|
195
176
|
|
|
196
|
-
mockGetMappings.mockReturnValueOnce(mockMappings.map((m:
|
|
177
|
+
mockGetMappings.mockReturnValueOnce({ mappings: mockMappings.map((m: MappingContainer) => m.mapping) });
|
|
197
178
|
|
|
198
179
|
const { user } = render(
|
|
199
180
|
<AddMappingsModal
|
|
@@ -202,7 +183,8 @@ describe("Add Mapping Modal", () => {
|
|
|
202
183
|
existingMappings={mockReportMappingsAndMappings}
|
|
203
184
|
onClose={jest.fn()}
|
|
204
185
|
defaultIModelId={mockIModelId1}
|
|
205
|
-
/>,
|
|
186
|
+
/>,
|
|
187
|
+
{ iTwinId: mockITwinId, reportsClient: mockReportsClient.object, mappingsClient: mockMappingsClient.object, iModelsClient: mockIModelsClient.object },
|
|
206
188
|
);
|
|
207
189
|
|
|
208
190
|
expect(screen.getByRole("dialog")).toBeInTheDocument();
|
|
@@ -219,10 +201,7 @@ describe("Add Mapping Modal", () => {
|
|
|
219
201
|
// Already mapped mappings are disabled
|
|
220
202
|
for (let i = 0; i < mockMappings.length - 1; i++) {
|
|
221
203
|
const row = screen.getByRole("row", {
|
|
222
|
-
name: new RegExp(
|
|
223
|
-
`${mockMappings[i].mapping.mappingName} ${mockMappings[i].mapping.description}`,
|
|
224
|
-
"i"
|
|
225
|
-
),
|
|
204
|
+
name: new RegExp(`${mockMappings[i].mapping.mappingName} ${mockMappings[i].mapping.description}`, "i"),
|
|
226
205
|
});
|
|
227
206
|
|
|
228
207
|
const checkbox = within(row).getByRole("checkbox");
|
|
@@ -231,11 +210,7 @@ describe("Add Mapping Modal", () => {
|
|
|
231
210
|
|
|
232
211
|
// Click on checkbox on new mapping
|
|
233
212
|
const unmappedRow = screen.getByRole("row", {
|
|
234
|
-
name: new RegExp(
|
|
235
|
-
`${mockMappings[mockMappings.length - 1].mapping.mappingName
|
|
236
|
-
} ${mockMappings[mockMappings.length - 1].mapping.description}`,
|
|
237
|
-
"i"
|
|
238
|
-
),
|
|
213
|
+
name: new RegExp(`${mockMappings[mockMappings.length - 1].mapping.mappingName} ${mockMappings[mockMappings.length - 1].mapping.description}`, "i"),
|
|
239
214
|
});
|
|
240
215
|
|
|
241
216
|
const enabledCheckbox = within(unmappedRow).getByRole("checkbox");
|