@itwin/reports-config-widget-react 0.2.1 → 0.4.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/.rush/temp/operation/rebuild/all.log +9 -0
- package/.rush/temp/operation/rebuild/state.json +3 -0
- package/.rush/temp/package-deps_rebuild.json +48 -44
- package/.rush/temp/shrinkwrap-deps.json +228 -207
- package/CHANGELOG.json +44 -0
- package/CHANGELOG.md +24 -1
- package/coverage/clover.xml +562 -542
- package/coverage/coverage-final.json +24 -20
- package/coverage/lcov-report/index.html +51 -51
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +22 -22
- package/coverage/lcov-report/src/index.html +21 -21
- package/coverage/lcov-report/src/test/index.html +11 -11
- package/coverage/lcov-report/src/test/test-utils.tsx.html +20 -140
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +14 -35
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +26 -20
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +94 -109
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +55 -52
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +1 -1
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +28 -46
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +3 -3
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +8 -8
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +36 -81
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +38 -41
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +46 -46
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +127 -142
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +189 -312
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +370 -0
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +111 -33
- package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +166 -0
- package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +274 -0
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +22 -7
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +40 -94
- package/coverage/lcov-report/src/widget/components/index.html +142 -97
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +22 -19
- package/coverage/lcov-report/src/widget/context/{ReportsApiConfigContext.tsx.html → BulkExtractorContext.tsx.html} +23 -26
- package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +202 -0
- package/coverage/lcov-report/src/widget/context/index.html +30 -15
- package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +11 -11
- package/coverage/lcov-report/src/widget/index.html +13 -13
- package/coverage/lcov.info +1036 -1034
- package/jest.config.js +1 -0
- package/lib/cjs/ReportsConfigWidget.js +1 -1
- package/lib/cjs/ReportsConfigWidget.js.map +1 -1
- package/lib/cjs/reports-config-widget-react.d.ts +5 -0
- package/lib/cjs/reports-config-widget-react.d.ts.map +1 -1
- package/lib/cjs/reports-config-widget-react.js +11 -0
- package/lib/cjs/reports-config-widget-react.js.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.js +20 -34
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
- package/lib/cjs/test/BulkExtractor.test.js +13 -19
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
- package/lib/cjs/test/DeleteModal.test.d.ts.map +1 -1
- package/lib/cjs/test/DeleteModal.test.js +4 -62
- package/lib/cjs/test/DeleteModal.test.js.map +1 -1
- package/lib/cjs/test/ReportAction.test.js +14 -79
- package/lib/cjs/test/ReportAction.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +20 -54
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/cjs/test/ReportMappings.test.d.ts.map +1 -1
- package/lib/cjs/test/ReportMappings.test.js +51 -106
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +41 -96
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +9 -3
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/test-utils.d.ts +3 -8
- package/lib/cjs/test/test-utils.d.ts.map +1 -1
- package/lib/cjs/test/test-utils.js +6 -34
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +3 -3
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +5 -7
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts +3 -3
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.js +4 -4
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.scss +2 -3
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +4 -4
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js +39 -43
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.scss +1 -2
- package/lib/cjs/widget/components/BulkExtractor.d.ts +4 -4
- package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.js +8 -8
- package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts +4 -5
- package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js +11 -15
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.scss +2 -3
- package/lib/cjs/widget/components/ExtractionStatus.js +2 -2
- package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.scss +6 -7
- package/lib/cjs/widget/components/HorizontalTile.js +2 -2
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.scss +11 -14
- package/lib/cjs/widget/components/LocalizedTablePaginator.js +2 -2
- package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.d.ts +4 -5
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js +24 -26
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.scss +1 -2
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts +4 -4
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js +33 -20
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +36 -21
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts +4 -6
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js +50 -63
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.scss +10 -11
- package/lib/cjs/widget/components/Reports.d.ts +6 -1
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js +53 -94
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/Reports.scss +15 -15
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts +18 -0
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportsConfigContext.js +79 -0
- package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -0
- package/lib/cjs/widget/components/ReportsContainer.d.ts +14 -0
- package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js +27 -16
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.scss +1 -3
- package/lib/cjs/widget/components/ReportsHeader.d.ts +7 -0
- package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportsHeader.js +20 -0
- package/lib/cjs/widget/components/ReportsHeader.js.map +1 -0
- package/lib/cjs/widget/components/ReportsRouter.d.ts +8 -0
- package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportsRouter.js +51 -0
- package/lib/cjs/widget/components/ReportsRouter.js.map +1 -0
- package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/cjs/widget/components/SearchBar.js +4 -5
- package/lib/cjs/widget/components/SearchBar.js.map +1 -1
- package/lib/cjs/widget/components/SearchBar.scss +1 -2
- package/lib/cjs/widget/components/SelectIModel.d.ts +3 -3
- package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +10 -30
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.scss +2 -3
- 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 +1 -1
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +16 -8
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts +10 -0
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -0
- package/lib/cjs/widget/context/{ReportsApiConfigContext.js → BulkExtractorContext.js} +7 -10
- package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -0
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts +16 -0
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -0
- package/lib/cjs/widget/context/ReportsConfigApiContext.js +43 -0
- package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -0
- package/lib/cjs/widget/hooks/useValidator.js +1 -1
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
- package/lib/esm/ReportsConfigWidget.js +1 -1
- package/lib/esm/ReportsConfigWidget.js.map +1 -1
- package/lib/esm/reports-config-widget-react.d.ts +5 -0
- package/lib/esm/reports-config-widget-react.d.ts.map +1 -1
- package/lib/esm/reports-config-widget-react.js +5 -0
- package/lib/esm/reports-config-widget-react.js.map +1 -1
- package/lib/esm/test/AddMappingModal.test.js +17 -31
- package/lib/esm/test/AddMappingModal.test.js.map +1 -1
- package/lib/esm/test/BulkExtractor.test.js +14 -17
- package/lib/esm/test/BulkExtractor.test.js.map +1 -1
- package/lib/esm/test/DeleteModal.test.d.ts.map +1 -1
- package/lib/esm/test/DeleteModal.test.js +5 -44
- package/lib/esm/test/DeleteModal.test.js.map +1 -1
- package/lib/esm/test/ReportAction.test.js +14 -60
- package/lib/esm/test/ReportAction.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +4 -38
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/esm/test/ReportMappings.test.d.ts.map +1 -1
- package/lib/esm/test/ReportMappings.test.js +43 -98
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +24 -60
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +8 -2
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/test-utils.d.ts +3 -8
- package/lib/esm/test/test-utils.d.ts.map +1 -1
- package/lib/esm/test/test-utils.js +4 -31
- package/lib/esm/test/test-utils.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts +3 -3
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.js +2 -4
- package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/esm/widget/components/ActionPanel.d.ts +3 -3
- package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/esm/widget/components/ActionPanel.js +4 -4
- package/lib/esm/widget/components/ActionPanel.js.map +1 -1
- package/lib/esm/widget/components/ActionPanel.scss +2 -3
- package/lib/esm/widget/components/AddMappingsModal.d.ts +4 -4
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.js +35 -39
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.scss +1 -2
- package/lib/esm/widget/components/BulkExtractor.d.ts +4 -4
- package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.js +7 -8
- package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts +4 -5
- package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/esm/widget/components/DeleteModal.js +11 -15
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.scss +2 -3
- package/lib/esm/widget/components/ExtractionStatus.scss +6 -7
- package/lib/esm/widget/components/HorizontalTile.scss +11 -14
- package/lib/esm/widget/components/ReportAction.d.ts +4 -5
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.js +17 -21
- package/lib/esm/widget/components/ReportAction.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.scss +1 -2
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts +4 -4
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.js +6 -9
- package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js +12 -13
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.d.ts +4 -6
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js +43 -56
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.scss +10 -11
- package/lib/esm/widget/components/Reports.d.ts +6 -1
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js +46 -87
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/Reports.scss +15 -15
- package/lib/esm/widget/components/ReportsConfigContext.d.ts +18 -0
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportsConfigContext.js +56 -0
- package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -0
- package/lib/esm/widget/components/ReportsContainer.d.ts +14 -0
- package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.js +27 -17
- package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.scss +1 -3
- package/lib/esm/widget/components/ReportsHeader.d.ts +7 -0
- package/lib/esm/widget/components/ReportsHeader.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportsHeader.js +13 -0
- package/lib/esm/widget/components/ReportsHeader.js.map +1 -0
- package/lib/esm/widget/components/ReportsRouter.d.ts +8 -0
- package/lib/esm/widget/components/ReportsRouter.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportsRouter.js +44 -0
- package/lib/esm/widget/components/ReportsRouter.js.map +1 -0
- package/lib/esm/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/esm/widget/components/SearchBar.js +2 -3
- package/lib/esm/widget/components/SearchBar.js.map +1 -1
- package/lib/esm/widget/components/SearchBar.scss +1 -2
- package/lib/esm/widget/components/SelectIModel.d.ts +3 -3
- package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/esm/widget/components/SelectIModel.js +7 -27
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.scss +2 -3
- 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 +2 -2
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +16 -8
- package/lib/esm/widget/context/BulkExtractorContext.d.ts +10 -0
- package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -0
- package/lib/esm/widget/context/BulkExtractorContext.js +11 -0
- package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -0
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts +16 -0
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -0
- package/lib/esm/widget/context/ReportsConfigApiContext.js +20 -0
- package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -0
- package/lib/public/locales/en/ReportsConfigWidget.json +6 -1
- package/package.json +29 -29
- package/public/locales/en/ReportsConfigWidget.json +6 -1
- package/reports-config-widget-react.build.error.log +6 -6
- package/reports-config-widget-react.build.log +52 -49
- package/src/reports-config-widget-react.ts +6 -0
- package/src/test/AddMappingModal.test.tsx +20 -37
- package/src/test/BulkExtractor.test.ts +15 -17
- package/src/test/DeleteModal.test.tsx +4 -73
- package/src/test/ReportAction.test.tsx +17 -90
- package/src/test/ReportMappingHorizontalTile.test.tsx +3 -54
- package/src/test/ReportMappings.test.tsx +50 -135
- package/src/test/Reports.test.tsx +21 -80
- package/src/test/WidgetHeader.test.tsx +9 -2
- package/src/test/test-utils.tsx +9 -49
- package/src/widget/ReportsConfigUiProvider.tsx +7 -14
- package/src/widget/components/ActionPanel.scss +2 -3
- package/src/widget/components/ActionPanel.tsx +17 -15
- package/src/widget/components/AddMappingsModal.scss +1 -2
- package/src/widget/components/AddMappingsModal.tsx +55 -60
- package/src/widget/components/BulkExtractor.ts +11 -10
- package/src/widget/components/DeleteModal.scss +2 -3
- package/src/widget/components/DeleteModal.tsx +17 -23
- package/src/widget/components/ExtractionStatus.scss +6 -7
- package/src/widget/components/HorizontalTile.scss +11 -14
- package/src/widget/components/ReportAction.scss +1 -2
- package/src/widget/components/ReportAction.tsx +18 -33
- package/src/widget/components/ReportHorizontalTile.tsx +11 -12
- package/src/widget/components/ReportMappingHorizontalTile.tsx +30 -30
- package/src/widget/components/ReportMappings.scss +10 -11
- package/src/widget/components/ReportMappings.tsx +67 -72
- package/src/widget/components/Reports.scss +15 -15
- package/src/widget/components/Reports.tsx +140 -181
- package/src/widget/components/ReportsConfigContext.tsx +95 -0
- package/src/widget/components/ReportsContainer.scss +1 -3
- package/src/widget/components/ReportsContainer.tsx +47 -21
- package/src/widget/components/ReportsHeader.tsx +27 -0
- package/src/widget/components/ReportsRouter.tsx +63 -0
- package/src/widget/components/SearchBar.scss +1 -2
- package/src/widget/components/SearchBar.tsx +7 -2
- package/src/widget/components/SelectIModel.scss +2 -3
- package/src/widget/components/SelectIModel.tsx +11 -29
- package/src/widget/components/utils.scss +16 -8
- package/src/widget/components/utils.tsx +8 -7
- package/src/widget/context/{ReportsApiConfigContext.tsx → BulkExtractorContext.tsx} +9 -10
- package/src/widget/context/ReportsConfigApiContext.tsx +39 -0
- package/lib/cjs/widget/context/ReportsApiConfigContext.d.ts +0 -9
- package/lib/cjs/widget/context/ReportsApiConfigContext.d.ts.map +0 -1
- package/lib/cjs/widget/context/ReportsApiConfigContext.js.map +0 -1
- package/lib/esm/widget/context/ReportsApiConfigContext.d.ts +0 -9
- package/lib/esm/widget/context/ReportsApiConfigContext.d.ts.map +0 -1
- package/lib/esm/widget/context/ReportsApiConfigContext.js +0 -14
- package/lib/esm/widget/context/ReportsApiConfigContext.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"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","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 { SvgChevronLeft } from \"@itwin/itwinui-icons-react\";\nimport {\n Icon,\n ProgressRadial,\n Text,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport \"./utils.scss\";\nimport React from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport interface WidgetHeaderProps {\n title: string;\n disabled?: boolean;\n returnFn?: () => void;\n}\n\nexport const WidgetHeader = ({\n title,\n disabled = false,\n returnFn,\n}: WidgetHeaderProps) => {\n return (\n <div className=\"rcw-widget-header-container\">\n {returnFn && (\n <Icon\n className={`${disabled ? \"rcw-chevron-disabled\" : \"rcw-chevron\"}`}\n onClick={disabled ? undefined : returnFn}\n size=\"large\"\n title={ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Back\")}\n >\n <SvgChevronLeft />\n </Icon>\n )}\n <Text className=\"rcw-title\" variant=\"title\">\n {title}\n </Text>\n </div>\n );\n};\n\nexport const handleError = (errorStatus: number) => {\n let errorMessage = `${ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.Error\"\n )} `;\n switch (errorStatus) {\n case 401:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.401\"\n );\n break;\n case 403:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.403\"\n );\n break;\n case 404:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.404\"\n );\n break;\n case 409:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.409\"\n );\n break;\n case 422:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.422\"\n );\n break;\n case 429:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.429\"\n );\n break;\n case 500:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.500\"\n );\n break;\n case 502:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.502\"\n );\n break;\n case 503:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.503\"\n );\n break;\n default:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:ErrorMessages.SomethingWentWrong\"\n );\n }\n toaster.negative(errorMessage);\n};\n\nexport const LoadingOverlay = () => (\n <div className=\"rcw-center-overlay\">\n <Text>\n {ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Loading\"\n )}\n </Text>\n <ProgressRadial indeterminate />\n <Text>\n {ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:PleaseWait\"\n )}\n </Text>\n </div>\n);\ninterface EmptyMessageProps {\n children?: React.ReactNode;\n}\nexport const EmptyMessage = ({ children }: EmptyMessageProps) => {\n return <div className=\"rcw-center-overlay\">{children}</div>;\n};\n\nexport const handleInputChange = <T,>(\n e: React.ChangeEvent<HTMLInputElement>,\n values: T,\n setValues: React.Dispatch<React.SetStateAction<T>>\n) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const LoadingSpinner = () => {\n return (\n <div\n className=\"rcw-loading-spinner\"\n data-testid=\"rcw-action-loading-spinner\"\n >\n <ProgressRadial size=\"small\" indeterminate />\n </div>\n );\n};\n\nexport const SkeletonBlock = () => (\n <div className=\"rcw-skeleton-block iui-skeleton\" />\n);\n\nexport const generateUrl = (baseUrl: string, newBaseUrl: string) => {\n return baseUrl.replace(\"https://api.bentley.com\", newBaseUrl);\n};\n\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n"]}
|
|
@@ -2,20 +2,28 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import "~@itwin/itwinui-css/scss/variables";
|
|
6
|
-
@import "~@itwin/itwinui-css/scss/icon/index";
|
|
7
|
-
@import "~@itwin/itwinui-css/scss/button/index";
|
|
8
5
|
|
|
9
6
|
.rcw-widget-header-container {
|
|
10
7
|
display: flex;
|
|
11
|
-
margin-bottom:
|
|
12
|
-
|
|
8
|
+
margin-bottom: calc(var(--iui-size-s) * 2);
|
|
9
|
+
|
|
10
|
+
.rcw-chevron {
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
align-self: center;
|
|
13
|
+
margin-right: var(--iui-size-xs);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.rcw-chevron-disabled {
|
|
17
|
+
fill: var(--iui-color-icon-muted);
|
|
18
|
+
cursor: not-allowed;
|
|
19
|
+
align-self: center;
|
|
20
|
+
margin-right: var(--iui-size-xs);
|
|
21
|
+
}
|
|
13
22
|
|
|
14
23
|
.rcw-title {
|
|
15
24
|
overflow: hidden;
|
|
16
25
|
white-space: nowrap;
|
|
17
26
|
text-overflow: ellipsis;
|
|
18
|
-
margin-bottom: 3px;
|
|
19
27
|
}
|
|
20
28
|
}
|
|
21
29
|
|
|
@@ -29,11 +37,11 @@
|
|
|
29
37
|
justify-content: center;
|
|
30
38
|
align-items: center;
|
|
31
39
|
flex-direction: column;
|
|
32
|
-
gap:
|
|
40
|
+
gap: var(--iui-size-s);
|
|
33
41
|
height: 100%;
|
|
34
42
|
}
|
|
35
43
|
|
|
36
44
|
.rcw-skeleton-block {
|
|
37
|
-
height:
|
|
45
|
+
height: calc(var(--iui-size-s) * 3);
|
|
38
46
|
width: 100%;
|
|
39
47
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AccessToken } from "@itwin/core-bentley";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import type { BulkExtractor } from "../components/BulkExtractor";
|
|
4
|
+
export declare type GetAccessTokenFn = () => Promise<AccessToken>;
|
|
5
|
+
export interface BulkExtractorContextProps {
|
|
6
|
+
bulkExtractor?: BulkExtractor;
|
|
7
|
+
}
|
|
8
|
+
export declare const BulkExtractorContext: React.Context<BulkExtractorContextProps>;
|
|
9
|
+
export declare const useBulkExtractor: () => BulkExtractorContextProps;
|
|
10
|
+
//# sourceMappingURL=BulkExtractorContext.d.ts.map
|
|
@@ -0,0 +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,iCAQ5B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
export const BulkExtractorContext = createContext({});
|
|
4
|
+
export const useBulkExtractor = () => {
|
|
5
|
+
const context = React.useContext(BulkExtractorContext);
|
|
6
|
+
if (!context) {
|
|
7
|
+
throw new Error("useBulkExtractor should be used within a BulkExtractorContext provider");
|
|
8
|
+
}
|
|
9
|
+
return context;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=BulkExtractorContext.js.map
|
|
@@ -0,0 +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,CACb,wEAAwE,CACzE,CAAC;KACH;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(\n \"useBulkExtractor should be used within a BulkExtractorContext provider\"\n );\n }\n return context;\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AccessToken } from "@itwin/core-bentley";
|
|
2
|
+
import { IModelsClient } from "@itwin/imodels-client-management";
|
|
3
|
+
import { MappingsClient, ReportsClient } from "@itwin/insights-client";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
export declare type GetAccessTokenFn = () => Promise<AccessToken>;
|
|
6
|
+
export interface ReportsConfigApiProps {
|
|
7
|
+
getAccessToken: GetAccessTokenFn;
|
|
8
|
+
iTwinId: string;
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
reportsClient: ReportsClient;
|
|
11
|
+
mappingsClient: MappingsClient;
|
|
12
|
+
iModelsClient: IModelsClient;
|
|
13
|
+
}
|
|
14
|
+
export declare const ReportsConfigApiContext: React.Context<ReportsConfigApiProps>;
|
|
15
|
+
export declare const useReportsConfigApi: () => ReportsConfigApiProps;
|
|
16
|
+
//# sourceMappingURL=ReportsConfigApiContext.d.ts.map
|
|
@@ -0,0 +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,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvE,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,aAAa,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,eAAO,MAAM,uBAAuB,sCAOlC,CAAC;AAEH,eAAO,MAAM,mBAAmB,6BAQ/B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IModelsClient } from "@itwin/imodels-client-management";
|
|
2
|
+
import { MappingsClient, ReportsClient } from "@itwin/insights-client";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { createContext } from "react";
|
|
5
|
+
export const ReportsConfigApiContext = createContext({
|
|
6
|
+
getAccessToken: async () => "",
|
|
7
|
+
iTwinId: "",
|
|
8
|
+
baseUrl: "",
|
|
9
|
+
reportsClient: new ReportsClient(),
|
|
10
|
+
mappingsClient: new MappingsClient(),
|
|
11
|
+
iModelsClient: new IModelsClient(),
|
|
12
|
+
});
|
|
13
|
+
export const useReportsConfigApi = () => {
|
|
14
|
+
const context = React.useContext(ReportsConfigApiContext);
|
|
15
|
+
if (!context) {
|
|
16
|
+
throw new Error("useReportsConfigApi should be used within a ReportsConfigApiContext provider");
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=ReportsConfigApiContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportsConfigApiContext.js","sourceRoot":"","sources":["../../../../src/widget/context/ReportsConfigApiContext.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,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,CACb,8EAA8E,CAC/E,CAAC;KACH;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 { 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: ReportsClient;\n mappingsClient: MappingsClient;\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(\n \"useReportsConfigApi should be used within a ReportsConfigApiContext provider\"\n );\n }\n return context;\n};\n"]}
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
"AddMappings": "Add Mappings",
|
|
5
5
|
"AddReport": "Add Report",
|
|
6
6
|
"AreYouSureYouWantToDelete": "Are you sure you want to delete",
|
|
7
|
+
"Back": "Back",
|
|
7
8
|
"Cancel": "Cancel",
|
|
9
|
+
"ClearSearch": "Clear Search",
|
|
8
10
|
"Close": "Close",
|
|
9
11
|
"Checking": "Checking",
|
|
10
12
|
"Confirm": "Confirm",
|
|
@@ -46,13 +48,16 @@
|
|
|
46
48
|
"ODataFeedURL": "OData Feed URL",
|
|
47
49
|
"PleaseWait": "Please wait...",
|
|
48
50
|
"Queued": "Queued",
|
|
51
|
+
"Refresh": "Refresh",
|
|
49
52
|
"Remove": "Remove",
|
|
50
53
|
"ReportDetails": "Report Details",
|
|
51
54
|
"ReportName": "Report Name",
|
|
52
55
|
"ReportsConfig": "Reports Config",
|
|
56
|
+
"ReportOptions": "Report Options",
|
|
53
57
|
"RunExtraction": "Run Extraction",
|
|
54
58
|
"Running": "Running",
|
|
55
59
|
"Search": "Search...",
|
|
60
|
+
"SearchReport": "Search",
|
|
56
61
|
"SelectIModel": "Select an iModel",
|
|
57
62
|
"Starting": "Starting",
|
|
58
63
|
"Success": "Success",
|
|
@@ -79,4 +84,4 @@
|
|
|
79
84
|
"CharLimit": "There is an 128 character limit.",
|
|
80
85
|
"ThisFieldIsRequired": "This field is required"
|
|
81
86
|
}
|
|
82
|
-
}
|
|
87
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/reports-config-widget-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "An iTwin.js 3D Viewer Widget that interfaces with the iTwin Reporting Platform.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Bentley",
|
|
@@ -30,42 +30,42 @@
|
|
|
30
30
|
"rules": {
|
|
31
31
|
"no-duplicate-imports": "off",
|
|
32
32
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
33
|
-
"deprecation/deprecation": "
|
|
33
|
+
"deprecation/deprecation": "error",
|
|
34
34
|
"jsx-a11y/no-static-element-interactions": "off",
|
|
35
35
|
"jsx-a11y/click-events-have-key-events": "off",
|
|
36
36
|
"jsx-a11y/anchor-is-valid": "off"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@itwin/imodels-access-frontend": "^
|
|
40
|
+
"@itwin/imodels-access-frontend": "^4.0.0",
|
|
41
41
|
"@itwin/imodels-client-management": "^1.0.1",
|
|
42
42
|
"@itwin/insights-client": "^0.4.0",
|
|
43
|
-
"@itwin/itwinui-icons-color-react": "^1.0
|
|
44
|
-
"@itwin/itwinui-icons-react": "^
|
|
45
|
-
"@itwin/itwinui-react": "^
|
|
43
|
+
"@itwin/itwinui-icons-color-react": "^2.1.0",
|
|
44
|
+
"@itwin/itwinui-icons-react": "^2.4.0",
|
|
45
|
+
"@itwin/itwinui-react": "^2.11.0",
|
|
46
46
|
"classnames": "^2.3.1",
|
|
47
47
|
"simple-react-validator": "^1.6.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@faker-js/faker": "6.2.0",
|
|
51
|
-
"@itwin/appui-abstract": "^
|
|
52
|
-
"@itwin/appui-layout-react": "^
|
|
53
|
-
"@itwin/appui-react": "^
|
|
54
|
-
"@itwin/build-tools": "^
|
|
55
|
-
"@itwin/components-react": "^
|
|
56
|
-
"@itwin/core-bentley": "^
|
|
57
|
-
"@itwin/core-common": "^
|
|
58
|
-
"@itwin/core-frontend": "^
|
|
59
|
-
"@itwin/core-geometry": "^
|
|
60
|
-
"@itwin/core-markup": "^
|
|
61
|
-
"@itwin/core-orbitgt": "^
|
|
62
|
-
"@itwin/core-quantity": "^
|
|
63
|
-
"@itwin/core-react": "^
|
|
64
|
-
"@itwin/eslint-plugin": "^3.
|
|
65
|
-
"@itwin/imodel-components-react": "^
|
|
66
|
-
"@itwin/presentation-common": "^
|
|
67
|
-
"@itwin/presentation-frontend": "^
|
|
68
|
-
"@itwin/webgl-compatibility": "^
|
|
51
|
+
"@itwin/appui-abstract": "^4.0.0",
|
|
52
|
+
"@itwin/appui-layout-react": "^4.0.0",
|
|
53
|
+
"@itwin/appui-react": "^4.0.0",
|
|
54
|
+
"@itwin/build-tools": "^4.0.0",
|
|
55
|
+
"@itwin/components-react": "^4.0.0",
|
|
56
|
+
"@itwin/core-bentley": "^4.0.0",
|
|
57
|
+
"@itwin/core-common": "^4.0.0",
|
|
58
|
+
"@itwin/core-frontend": "^4.0.0",
|
|
59
|
+
"@itwin/core-geometry": "^4.0.0",
|
|
60
|
+
"@itwin/core-markup": "^4.0.0",
|
|
61
|
+
"@itwin/core-orbitgt": "^4.0.0",
|
|
62
|
+
"@itwin/core-quantity": "^4.0.0",
|
|
63
|
+
"@itwin/core-react": "^4.0.0",
|
|
64
|
+
"@itwin/eslint-plugin": "^3.7.8",
|
|
65
|
+
"@itwin/imodel-components-react": "^4.0.0",
|
|
66
|
+
"@itwin/presentation-common": "^4.0.0",
|
|
67
|
+
"@itwin/presentation-frontend": "^4.0.0",
|
|
68
|
+
"@itwin/webgl-compatibility": "^4.0.0",
|
|
69
69
|
"@testing-library/dom": "^8.12.0",
|
|
70
70
|
"@testing-library/jest-dom": "^5.16.3",
|
|
71
71
|
"@testing-library/react": "^12.1.4",
|
|
@@ -97,14 +97,14 @@
|
|
|
97
97
|
"rimraf": "^3.0.2",
|
|
98
98
|
"ts-jest": "^27.1.3",
|
|
99
99
|
"typemoq": "^2.1.0",
|
|
100
|
-
"typescript": "~4.
|
|
100
|
+
"typescript": "~4.5.0",
|
|
101
101
|
"xmlhttprequest": "^1.8.0"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@itwin/appui-abstract": "^
|
|
105
|
-
"@itwin/appui-react": "^
|
|
106
|
-
"@itwin/core-bentley": "^
|
|
107
|
-
"@itwin/core-frontend": "^
|
|
104
|
+
"@itwin/appui-abstract": "^4.0.0",
|
|
105
|
+
"@itwin/appui-react": "^4.0.0",
|
|
106
|
+
"@itwin/core-bentley": "^4.0.0",
|
|
107
|
+
"@itwin/core-frontend": "^4.0.0",
|
|
108
108
|
"react": "^17.0.2",
|
|
109
109
|
"react-dom": "^17.0.2",
|
|
110
110
|
"react-redux": "^7.2.0"
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
"AddMappings": "Add Mappings",
|
|
5
5
|
"AddReport": "Add Report",
|
|
6
6
|
"AreYouSureYouWantToDelete": "Are you sure you want to delete",
|
|
7
|
+
"Back": "Back",
|
|
7
8
|
"Cancel": "Cancel",
|
|
9
|
+
"ClearSearch": "Clear Search",
|
|
8
10
|
"Close": "Close",
|
|
9
11
|
"Checking": "Checking",
|
|
10
12
|
"Confirm": "Confirm",
|
|
@@ -46,13 +48,16 @@
|
|
|
46
48
|
"ODataFeedURL": "OData Feed URL",
|
|
47
49
|
"PleaseWait": "Please wait...",
|
|
48
50
|
"Queued": "Queued",
|
|
51
|
+
"Refresh": "Refresh",
|
|
49
52
|
"Remove": "Remove",
|
|
50
53
|
"ReportDetails": "Report Details",
|
|
51
54
|
"ReportName": "Report Name",
|
|
52
55
|
"ReportsConfig": "Reports Config",
|
|
56
|
+
"ReportOptions": "Report Options",
|
|
53
57
|
"RunExtraction": "Run Extraction",
|
|
54
58
|
"Running": "Running",
|
|
55
59
|
"Search": "Search...",
|
|
60
|
+
"SearchReport": "Search",
|
|
56
61
|
"SelectIModel": "Select an iModel",
|
|
57
62
|
"Starting": "Starting",
|
|
58
63
|
"Success": "Success",
|
|
@@ -79,4 +84,4 @@
|
|
|
79
84
|
"CharLimit": "There is an 128 character limit.",
|
|
80
85
|
"ThisFieldIsRequired": "This field is required"
|
|
81
86
|
}
|
|
82
|
-
}
|
|
87
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
PASS src/test/
|
|
2
|
-
PASS src/test/
|
|
3
|
-
PASS src/test/Reports.test.tsx (7.469 s)
|
|
1
|
+
PASS src/test/ReportMappingHorizontalTile.test.tsx (11.175 s)
|
|
2
|
+
PASS src/test/ReportMappings.test.tsx
|
|
4
3
|
PASS src/test/BulkExtractor.test.ts
|
|
4
|
+
PASS src/test/Reports.test.tsx (10.973 s)
|
|
5
5
|
PASS src/test/AddMappingModal.test.tsx
|
|
6
|
-
PASS src/test/ReportAction.test.tsx
|
|
6
|
+
PASS src/test/ReportAction.test.tsx (6.602 s)
|
|
7
7
|
PASS src/test/DeleteModal.test.tsx
|
|
8
8
|
PASS src/test/WidgetHeader.test.tsx
|
|
9
9
|
|
|
10
10
|
Test Suites: 8 passed, 8 total
|
|
11
|
-
Tests:
|
|
11
|
+
Tests: 40 passed, 40 total
|
|
12
12
|
Snapshots: 0 total
|
|
13
|
-
Time:
|
|
13
|
+
Time: 47.701 s
|
|
14
14
|
Ran all test suites.
|
|
@@ -1,60 +1,63 @@
|
|
|
1
1
|
Invoking: npm test -- --coverage
|
|
2
2
|
|
|
3
|
+
> @itwin/reports-config-widget-react@0.3.0 test
|
|
4
|
+
> jest --coverage
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
PASS src/test/ReportMappings.test.tsx (9.915 s)
|
|
8
|
-
PASS src/test/ReportMappingHorizontalTile.test.tsx
|
|
9
|
-
PASS src/test/Reports.test.tsx (7.469 s)
|
|
6
|
+
PASS src/test/ReportMappingHorizontalTile.test.tsx (11.175 s)
|
|
7
|
+
PASS src/test/ReportMappings.test.tsx
|
|
10
8
|
PASS src/test/BulkExtractor.test.ts
|
|
9
|
+
PASS src/test/Reports.test.tsx (10.973 s)
|
|
11
10
|
PASS src/test/AddMappingModal.test.tsx
|
|
12
|
-
PASS src/test/ReportAction.test.tsx
|
|
11
|
+
PASS src/test/ReportAction.test.tsx (6.602 s)
|
|
13
12
|
PASS src/test/DeleteModal.test.tsx
|
|
14
13
|
PASS src/test/WidgetHeader.test.tsx
|
|
15
|
-
|
|
16
|
-
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
17
|
-
|
|
18
|
-
All files |
|
|
19
|
-
src |
|
|
20
|
-
ReportsConfigWidget.ts |
|
|
21
|
-
src/test | 100 |
|
|
22
|
-
test-utils.tsx | 100 |
|
|
23
|
-
src/widget |
|
|
24
|
-
ReportsConfigUiProvider.tsx |
|
|
25
|
-
src/widget/components |
|
|
26
|
-
ActionPanel.tsx | 100 |
|
|
27
|
-
AddMappingsModal.tsx |
|
|
28
|
-
BulkExtractor.ts |
|
|
29
|
-
Constants.ts | 100 | 100 | 100 | 100 |
|
|
30
|
-
DeleteModal.tsx |
|
|
31
|
-
ExtractionStatus.tsx | 94.28 | 90 | 83.33 | 96.87 | 63
|
|
32
|
-
ExtractionToast.tsx | 58.33 | 100 | 0 | 50 | 18-22,36
|
|
33
|
-
HorizontalTile.tsx | 100 | 100 | 100 | 100 |
|
|
34
|
-
LocalizedTablePaginator.tsx | 100 | 50 | 100 | 100 | 25
|
|
35
|
-
ReportAction.tsx | 94.
|
|
36
|
-
ReportHorizontalTile.tsx |
|
|
37
|
-
ReportMappingHorizontalTile.tsx | 93.
|
|
38
|
-
ReportMappings.tsx |
|
|
39
|
-
Reports.tsx |
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
14
|
+
----------------------------------------|---------|----------|---------|---------|-------------------------
|
|
15
|
+
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
16
|
+
----------------------------------------|---------|----------|---------|---------|-------------------------
|
|
17
|
+
All files | 84.8 | 66.66 | 76.83 | 85.44 |
|
|
18
|
+
src | 77.77 | 50 | 50 | 77.77 |
|
|
19
|
+
ReportsConfigWidget.ts | 77.77 | 50 | 50 | 77.77 | 13,32
|
|
20
|
+
src/test | 100 | 100 | 100 | 100 |
|
|
21
|
+
test-utils.tsx | 100 | 100 | 100 | 100 |
|
|
22
|
+
src/widget | 42.85 | 0 | 0 | 42.85 |
|
|
23
|
+
ReportsConfigUiProvider.tsx | 42.85 | 0 | 0 | 42.85 | 23-58
|
|
24
|
+
src/widget/components | 84.5 | 69.3 | 77.41 | 85.42 |
|
|
25
|
+
ActionPanel.tsx | 100 | 90.9 | 100 | 100 | 26
|
|
26
|
+
AddMappingsModal.tsx | 92 | 80 | 90 | 93.33 | 38,112,134
|
|
27
|
+
BulkExtractor.ts | 92.92 | 90.47 | 100 | 93.68 | 109,118-120,129,160-162
|
|
28
|
+
Constants.ts | 100 | 100 | 100 | 100 |
|
|
29
|
+
DeleteModal.tsx | 94.44 | 100 | 100 | 94.11 | 40
|
|
30
|
+
ExtractionStatus.tsx | 94.28 | 90 | 83.33 | 96.87 | 63
|
|
31
|
+
ExtractionToast.tsx | 58.33 | 100 | 0 | 50 | 18-22,36
|
|
32
|
+
HorizontalTile.tsx | 100 | 100 | 100 | 100 |
|
|
33
|
+
LocalizedTablePaginator.tsx | 100 | 50 | 100 | 100 | 25
|
|
34
|
+
ReportAction.tsx | 94.11 | 80 | 100 | 93.93 | 57-58
|
|
35
|
+
ReportHorizontalTile.tsx | 73.17 | 40 | 76.92 | 71.79 | 42-44,56-62,123
|
|
36
|
+
ReportMappingHorizontalTile.tsx | 93.75 | 100 | 91.66 | 93.47 | 65-68
|
|
37
|
+
ReportMappings.tsx | 91.76 | 61.9 | 85 | 93.58 | 82,266-293
|
|
38
|
+
Reports.tsx | 84.12 | 66.66 | 77.77 | 91.07 | 108,114-117
|
|
39
|
+
ReportsConfigContext.tsx | 91.17 | 87.09 | 70 | 90 | 35,65,69
|
|
40
|
+
ReportsContainer.tsx | 52.17 | 50 | 20 | 54.54 | 40-55
|
|
41
|
+
ReportsHeader.tsx | 71.42 | 0 | 0 | 66.66 | 18-21
|
|
42
|
+
ReportsRouter.tsx | 37.5 | 0 | 0 | 42.1 | 23-61
|
|
43
|
+
SearchBar.tsx | 70.58 | 71.42 | 60 | 68.75 | 31-45
|
|
44
|
+
SelectIModel.tsx | 95.83 | 100 | 83.33 | 95.45 | 74
|
|
45
|
+
utils.tsx | 62.74 | 35.29 | 87.5 | 55.81 | 52-95,151
|
|
46
|
+
src/widget/components/ExtractionStates | 96.87 | 25 | 80 | 96.29 |
|
|
47
|
+
FailedExtractionState.tsx | 85.71 | 0 | 0 | 83.33 | 16
|
|
48
|
+
QueuedExtractionState.tsx | 100 | 100 | 100 | 100 |
|
|
49
|
+
RunningExtractionState.tsx | 100 | 100 | 100 | 100 |
|
|
50
|
+
StartingExtractionState.tsx | 100 | 100 | 100 | 100 |
|
|
51
|
+
SucceededExtractionState.tsx | 100 | 50 | 100 | 100 | 26
|
|
52
|
+
src/widget/context | 85.71 | 0 | 66.66 | 84.21 |
|
|
53
|
+
BulkExtractorContext.tsx | 88.88 | 0 | 100 | 87.5 | 21
|
|
54
|
+
ReportsConfigApiContext.tsx | 83.33 | 0 | 50 | 81.81 | 23,34
|
|
55
|
+
src/widget/hooks | 100 | 100 | 100 | 100 |
|
|
56
|
+
useValidator.ts | 100 | 100 | 100 | 100 |
|
|
57
|
+
----------------------------------------|---------|----------|---------|---------|-------------------------
|
|
55
58
|
|
|
56
59
|
Test Suites: 8 passed, 8 total
|
|
57
|
-
Tests:
|
|
60
|
+
Tests: 40 passed, 40 total
|
|
58
61
|
Snapshots: 0 total
|
|
59
|
-
Time:
|
|
62
|
+
Time: 47.701 s
|
|
60
63
|
Ran all test suites.
|
|
@@ -5,3 +5,9 @@
|
|
|
5
5
|
/** UI Provider for iTwin Viewer Applications */
|
|
6
6
|
export * from "./widget/ReportsConfigUiProvider";
|
|
7
7
|
export * from "./ReportsConfigWidget";
|
|
8
|
+
|
|
9
|
+
export { Reports, ReportsProps } from "./widget/components/Reports";
|
|
10
|
+
export { ReportMappings, ReportMappingsProps } from "./widget/components/ReportMappings";
|
|
11
|
+
export { ReportsConfigContext, ReportsConfigContextProps } from "./widget/components/ReportsConfigContext";
|
|
12
|
+
export { ReportAction, ReportActionProps } from "./widget/components/ReportAction";
|
|
13
|
+
export { BulkExtractor } from "./widget/components/BulkExtractor";
|
|
@@ -5,25 +5,22 @@
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import faker from "@faker-js/faker";
|
|
7
7
|
import "@testing-library/jest-dom";
|
|
8
|
-
import type {
|
|
9
|
-
IModelConnection,
|
|
10
|
-
} from "@itwin/core-frontend";
|
|
11
|
-
import { NoRenderApp } from "@itwin/core-frontend";
|
|
12
8
|
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
13
9
|
import {
|
|
14
10
|
render,
|
|
15
11
|
screen,
|
|
16
|
-
TestUtils,
|
|
17
12
|
waitFor,
|
|
18
13
|
within,
|
|
19
14
|
} from "./test-utils";
|
|
20
15
|
import * as moq from "typemoq";
|
|
21
16
|
import type {
|
|
17
|
+
MappingsClient,
|
|
22
18
|
MappingSingle,
|
|
23
19
|
ReportMappingCollection,
|
|
20
|
+
ReportsClient,
|
|
24
21
|
} from "@itwin/insights-client";
|
|
25
22
|
import type { ReportMappingAndMapping } from "../widget/components/ReportMappings";
|
|
26
|
-
import type { IModelOperations, OperationOptions } from "@itwin/imodels-client-management";
|
|
23
|
+
import type { GetSingleIModelParams, IModelOperations, IModelsClient, OperationOptions } from "@itwin/imodels-client-management";
|
|
27
24
|
import { IModelState } from "@itwin/imodels-client-management";
|
|
28
25
|
import { AddMappingsModal } from "../widget/components/AddMappingsModal";
|
|
29
26
|
import { EmptyLocalization } from "@itwin/core-common";
|
|
@@ -207,19 +204,8 @@ const mockReportMappingsAndMappingsFactory = (mockMappings: MappingSingle[], rep
|
|
|
207
204
|
return reportMappingsAndMapping;
|
|
208
205
|
};
|
|
209
206
|
|
|
210
|
-
const connectionMock = moq.Mock.ofType<IModelConnection>();
|
|
211
|
-
const mockIModelsClient = moq.Mock.ofType<IModelOperations<OperationOptions>>();
|
|
212
|
-
|
|
213
|
-
jest.mock("@itwin/appui-react", () => ({
|
|
214
|
-
...jest.requireActual("@itwin/appui-react"),
|
|
215
|
-
useActiveIModelConnection: () => connectionMock.object,
|
|
216
|
-
}));
|
|
217
|
-
|
|
218
207
|
jest.mock("@itwin/imodels-client-management", () => ({
|
|
219
208
|
...jest.requireActual("@itwin/imodels-client-management"),
|
|
220
|
-
IModelsClient: jest.fn().mockImplementation(() => ({
|
|
221
|
-
iModels: mockIModelsClient.object,
|
|
222
|
-
})),
|
|
223
209
|
toArray: jest.fn().mockImplementation(async () => {
|
|
224
210
|
return mockProjectIModels.iModels;
|
|
225
211
|
}),
|
|
@@ -228,24 +214,22 @@ jest.mock("@itwin/imodels-client-management", () => ({
|
|
|
228
214
|
const mockGetMappings = jest.fn();
|
|
229
215
|
const mockCreateReportMapping = jest.fn();
|
|
230
216
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
})),
|
|
236
|
-
ReportsClient: jest.fn().mockImplementation(() => ({
|
|
237
|
-
createReportMapping: mockCreateReportMapping,
|
|
238
|
-
})),
|
|
239
|
-
}));
|
|
217
|
+
const mockIModelsClient = moq.Mock.ofType<IModelsClient>();
|
|
218
|
+
const mockIModelsClientOperations = moq.Mock.ofType<IModelOperations<OperationOptions>>();
|
|
219
|
+
const mockReportsClient = moq.Mock.ofType<ReportsClient>();
|
|
220
|
+
const mockMappingsClient = moq.Mock.ofType<MappingsClient>();
|
|
240
221
|
|
|
241
222
|
beforeAll(async () => {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
223
|
+
const localization = new EmptyLocalization();
|
|
224
|
+
await ReportsConfigWidget.initialize(localization);
|
|
225
|
+
mockIModelsClientOperations.setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId1 })))
|
|
226
|
+
.returns(async () => mockIModelsResponse[0].iModel);
|
|
227
|
+
mockIModelsClientOperations.setup(async (x) => x.getSingle(moq.It.isObjectWith<GetSingleIModelParams>({ iModelId: mockIModelId2 })))
|
|
228
|
+
.returns(async () => mockIModelsResponse[1].iModel);
|
|
229
|
+
mockIModelsClient.setup((x) => x.iModels)
|
|
230
|
+
.returns(() => mockIModelsClientOperations.object);
|
|
231
|
+
mockReportsClient.setup(async (x) => x.createReportMapping(moq.It.isAny(), moq.It.isAny(), moq.It.isAny())).returns(mockCreateReportMapping);
|
|
232
|
+
mockMappingsClient.setup(async (x) => x.getMappings(moq.It.isAny(), moq.It.isAny())).returns(mockGetMappings);
|
|
249
233
|
});
|
|
250
234
|
|
|
251
235
|
afterEach(() => {
|
|
@@ -266,8 +250,9 @@ describe("Add Mapping Modal", () => {
|
|
|
266
250
|
show={true}
|
|
267
251
|
reportId={mockReportId}
|
|
268
252
|
existingMappings={mockReportMappingsAndMappings}
|
|
269
|
-
|
|
270
|
-
|
|
253
|
+
onClose={jest.fn()}
|
|
254
|
+
defaultIModelId={mockIModelId1}
|
|
255
|
+
/>, { iTwinId: mockITwinId, reportsClient: mockReportsClient.object, mappingsClient: mockMappingsClient.object, iModelsClient: mockIModelsClient.object }
|
|
271
256
|
);
|
|
272
257
|
|
|
273
258
|
expect(screen.getByRole("dialog")).toBeInTheDocument();
|
|
@@ -278,8 +263,6 @@ describe("Add Mapping Modal", () => {
|
|
|
278
263
|
const addButton = withinModal.getByRole("button", {
|
|
279
264
|
name: /add/i,
|
|
280
265
|
});
|
|
281
|
-
// Add button should be disabled
|
|
282
|
-
expect(addButton).toBeDisabled();
|
|
283
266
|
|
|
284
267
|
await waitFor(() => screen.getByRole("row"));
|
|
285
268
|
|