@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
|
@@ -2,30 +2,27 @@
|
|
|
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 { Fieldset, LabeledInput,
|
|
5
|
+
import { Fieldset, LabeledInput, Text } from "@itwin/itwinui-react";
|
|
6
6
|
import React, { useState } from "react";
|
|
7
7
|
import ActionPanel from "./ActionPanel";
|
|
8
8
|
import useValidator, { NAME_REQUIREMENTS } from "../hooks/useValidator";
|
|
9
9
|
import {
|
|
10
|
-
generateUrl,
|
|
11
10
|
handleError,
|
|
12
11
|
handleInputChange,
|
|
13
|
-
WidgetHeader,
|
|
14
12
|
} from "./utils";
|
|
15
13
|
import "./ReportAction.scss";
|
|
16
14
|
import type { Report } from "@itwin/insights-client";
|
|
17
|
-
import {
|
|
18
|
-
import { useReportsApiConfig } from "../context/ReportsApiConfigContext";
|
|
15
|
+
import { useReportsConfigApi } from "../context/ReportsConfigApiContext";
|
|
19
16
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
20
17
|
|
|
21
|
-
interface ReportActionProps {
|
|
22
|
-
iTwinId: string;
|
|
18
|
+
export interface ReportActionProps {
|
|
23
19
|
report?: Report;
|
|
24
|
-
|
|
20
|
+
onSaveSuccess: () => void;
|
|
21
|
+
onClickCancel?: () => void;
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
const ReportAction = ({
|
|
28
|
-
const
|
|
24
|
+
export const ReportAction = ({ report, onSaveSuccess, onClickCancel }: ReportActionProps) => {
|
|
25
|
+
const { iTwinId, getAccessToken, reportsClient } = useReportsConfigApi();
|
|
29
26
|
const [values, setValues] = useState({
|
|
30
27
|
name: report?.displayName ?? "",
|
|
31
28
|
description: report?.description ?? "",
|
|
@@ -40,21 +37,22 @@ const ReportAction = ({ iTwinId, report, returnFn }: ReportActionProps) => {
|
|
|
40
37
|
return;
|
|
41
38
|
}
|
|
42
39
|
setIsLoading(true);
|
|
43
|
-
const
|
|
44
|
-
generateUrl(REPORTING_BASE_PATH, apiConfig.baseUrl)
|
|
45
|
-
);
|
|
46
|
-
const accessToken = await apiConfig.getAccessToken();
|
|
40
|
+
const accessToken = await getAccessToken();
|
|
47
41
|
report
|
|
48
|
-
? await
|
|
42
|
+
? await reportsClient.updateReport(accessToken, report.id ?? "", {
|
|
49
43
|
displayName: values.name,
|
|
50
44
|
description: values.description,
|
|
51
45
|
})
|
|
52
|
-
: await
|
|
46
|
+
: await reportsClient.createReport(accessToken, {
|
|
53
47
|
displayName: values.name,
|
|
54
48
|
description: values.description,
|
|
55
49
|
projectId: iTwinId,
|
|
56
50
|
});
|
|
57
|
-
|
|
51
|
+
onSaveSuccess();
|
|
52
|
+
setValues({
|
|
53
|
+
name: report?.displayName ?? "",
|
|
54
|
+
description: report?.description ?? "",
|
|
55
|
+
});
|
|
58
56
|
} catch (error: any) {
|
|
59
57
|
handleError(error.status);
|
|
60
58
|
setIsLoading(false);
|
|
@@ -65,18 +63,6 @@ const ReportAction = ({ iTwinId, report, returnFn }: ReportActionProps) => {
|
|
|
65
63
|
|
|
66
64
|
return (
|
|
67
65
|
<>
|
|
68
|
-
<WidgetHeader
|
|
69
|
-
title={
|
|
70
|
-
report
|
|
71
|
-
? ReportsConfigWidget.localization.getLocalizedString(
|
|
72
|
-
"ReportsConfigWidget:ModifyReport"
|
|
73
|
-
)
|
|
74
|
-
: ReportsConfigWidget.localization.getLocalizedString(
|
|
75
|
-
"ReportsConfigWidget:AddReport"
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
returnFn={returnFn}
|
|
79
|
-
/>
|
|
80
66
|
<div className="rcw-details-form-container">
|
|
81
67
|
<Fieldset
|
|
82
68
|
legend={ReportsConfigWidget.localization.getLocalizedString(
|
|
@@ -84,11 +70,11 @@ const ReportAction = ({ iTwinId, report, returnFn }: ReportActionProps) => {
|
|
|
84
70
|
)}
|
|
85
71
|
className="rcw-details-form"
|
|
86
72
|
>
|
|
87
|
-
<
|
|
73
|
+
<Text variant='small' className="field-legend">
|
|
88
74
|
{ReportsConfigWidget.localization.getLocalizedString(
|
|
89
75
|
"ReportsConfigWidget:MandatoryFields"
|
|
90
76
|
)}
|
|
91
|
-
</
|
|
77
|
+
</Text>
|
|
92
78
|
<LabeledInput
|
|
93
79
|
name="name"
|
|
94
80
|
label={ReportsConfigWidget.localization.getLocalizedString(
|
|
@@ -133,7 +119,7 @@ const ReportAction = ({ iTwinId, report, returnFn }: ReportActionProps) => {
|
|
|
133
119
|
"ReportsConfigWidget:Add"
|
|
134
120
|
)}
|
|
135
121
|
onAction={onSave}
|
|
136
|
-
onCancel={
|
|
122
|
+
onCancel={onClickCancel}
|
|
137
123
|
isSavingDisabled={!values.name}
|
|
138
124
|
isLoading={isLoading}
|
|
139
125
|
/>
|
|
@@ -141,4 +127,3 @@ const ReportAction = ({ iTwinId, report, returnFn }: ReportActionProps) => {
|
|
|
141
127
|
);
|
|
142
128
|
};
|
|
143
129
|
|
|
144
|
-
export default ReportAction;
|
|
@@ -2,9 +2,8 @@
|
|
|
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 { useEffect, useRef, useState } from "react";
|
|
6
|
-
import
|
|
7
|
-
import type BulkExtractor from "./BulkExtractor";
|
|
5
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
6
|
+
import type { BulkExtractor } from "./BulkExtractor";
|
|
8
7
|
import { ExtractionStates, ExtractionStatus } from "./ExtractionStatus";
|
|
9
8
|
import type { BeEvent } from "@itwin/core-bentley";
|
|
10
9
|
import { STATUS_CHECK_INTERVAL } from "./Constants";
|
|
@@ -21,16 +20,16 @@ import {
|
|
|
21
20
|
SvgMore,
|
|
22
21
|
} from "@itwin/itwinui-icons-react";
|
|
23
22
|
import { HorizontalTile } from "./HorizontalTile";
|
|
24
|
-
import type { HorizontalTileProps } from "./HorizontalTile";
|
|
25
23
|
|
|
26
|
-
export interface ReportHorizontalTileProps
|
|
24
|
+
export interface ReportHorizontalTileProps {
|
|
27
25
|
selected: boolean;
|
|
28
26
|
onSelectionChange: (reportId: string, controlPressed: boolean) => void;
|
|
29
27
|
bulkExtractor: BulkExtractor;
|
|
30
28
|
jobStartEvent: BeEvent<(reportId: string) => void>;
|
|
31
29
|
report: Report;
|
|
32
30
|
onClickDelete: () => void;
|
|
33
|
-
onClickModify:
|
|
31
|
+
onClickModify?: (report: Report) => void;
|
|
32
|
+
onClickTitle?: (report: Report) => void;
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
export const ReportHorizontalTile = (props: ReportHorizontalTileProps) => {
|
|
@@ -81,7 +80,7 @@ export const ReportHorizontalTile = (props: ReportHorizontalTileProps) => {
|
|
|
81
80
|
subtextToolTip={props.report.description ?? ""}
|
|
82
81
|
titleTooltip={props.report.displayName}
|
|
83
82
|
onClick={onClickTile}
|
|
84
|
-
onClickTitle={props.onClickTitle}
|
|
83
|
+
onClickTitle={() => props.onClickTitle?.(props.report)}
|
|
85
84
|
selected={props.selected}
|
|
86
85
|
actionGroup={extractionState === ExtractionStates.None ? (
|
|
87
86
|
<div
|
|
@@ -89,15 +88,15 @@ export const ReportHorizontalTile = (props: ReportHorizontalTileProps) => {
|
|
|
89
88
|
data-testid="tile-action-button">
|
|
90
89
|
<DropdownMenu
|
|
91
90
|
menuItems={(close: () => void) => [
|
|
92
|
-
<MenuItem
|
|
91
|
+
props.onClickModify ? <MenuItem
|
|
93
92
|
key={0}
|
|
94
|
-
onClick={props.onClickModify}
|
|
93
|
+
onClick={() => props.onClickModify?.(props.report)}
|
|
95
94
|
icon={<SvgEdit />}
|
|
96
95
|
>
|
|
97
96
|
{ReportsConfigWidget.localization.getLocalizedString(
|
|
98
97
|
"ReportsConfigWidget:Modify"
|
|
99
98
|
)}
|
|
100
|
-
</MenuItem
|
|
99
|
+
</MenuItem> : [],
|
|
101
100
|
<MenuItem
|
|
102
101
|
key={1}
|
|
103
102
|
onClick={() => {
|
|
@@ -110,9 +109,9 @@ export const ReportHorizontalTile = (props: ReportHorizontalTileProps) => {
|
|
|
110
109
|
"ReportsConfigWidget:Remove"
|
|
111
110
|
)}
|
|
112
111
|
</MenuItem>,
|
|
113
|
-
]}
|
|
112
|
+
].flat()}
|
|
114
113
|
>
|
|
115
|
-
<IconButton styleType="borderless">
|
|
114
|
+
<IconButton styleType="borderless" title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ReportOptions")}>
|
|
116
115
|
<SvgMore />
|
|
117
116
|
</IconButton>
|
|
118
117
|
</DropdownMenu>
|
|
@@ -2,9 +2,8 @@
|
|
|
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 { useCallback, useEffect, useRef, useState } from "react";
|
|
6
|
-
import
|
|
7
|
-
import type BulkExtractor from "./BulkExtractor";
|
|
5
|
+
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
6
|
+
import type { BulkExtractor } from "./BulkExtractor";
|
|
8
7
|
import { ExtractionStates, ExtractionStatus } from "./ExtractionStatus";
|
|
9
8
|
import type { BeEvent } from "@itwin/core-bentley";
|
|
10
9
|
import { STATUS_CHECK_INTERVAL } from "./Constants";
|
|
@@ -12,7 +11,7 @@ import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
|
12
11
|
import { IconButton } from "@itwin/itwinui-react";
|
|
13
12
|
import {
|
|
14
13
|
SvgDelete,
|
|
15
|
-
|
|
14
|
+
SvgPlay,
|
|
16
15
|
} from "@itwin/itwinui-icons-react";
|
|
17
16
|
import { HorizontalTile } from "./HorizontalTile";
|
|
18
17
|
import type { ReportMappingAndMapping } from "./ReportMappings";
|
|
@@ -87,20 +86,33 @@ export const ReportMappingHorizontalTile = (props: ReportMappingHorizontalTilePr
|
|
|
87
86
|
data-testid="tile-action-button">
|
|
88
87
|
{extractionState === ExtractionStates.None ?
|
|
89
88
|
(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
89
|
+
<>
|
|
90
|
+
<IconButton
|
|
91
|
+
styleType="borderless"
|
|
92
|
+
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
93
|
+
"ReportsConfigWidget:UpdateDataset"
|
|
94
|
+
)}
|
|
95
|
+
onClick={async () => {
|
|
96
|
+
setExtractionState(ExtractionStates.Starting);
|
|
97
|
+
await props.bulkExtractor.runIModelExtraction(props.mapping.imodelId);
|
|
98
|
+
props.jobStartEvent.raiseEvent(props.mapping.imodelId);
|
|
99
|
+
}}
|
|
100
|
+
disabled={jobStarted}
|
|
101
|
+
>
|
|
102
|
+
<SvgPlay />
|
|
103
|
+
</IconButton>
|
|
104
|
+
<IconButton
|
|
105
|
+
styleType="borderless"
|
|
106
|
+
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
107
|
+
"ReportsConfigWidget:Remove"
|
|
108
|
+
)}
|
|
109
|
+
onClick={() => {
|
|
110
|
+
props.onClickDelete();
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
<SvgDelete />
|
|
114
|
+
</IconButton>
|
|
115
|
+
</>
|
|
104
116
|
) : (
|
|
105
117
|
<ExtractionStatus
|
|
106
118
|
state={extractionState}
|
|
@@ -109,18 +121,6 @@ export const ReportMappingHorizontalTile = (props: ReportMappingHorizontalTilePr
|
|
|
109
121
|
}}
|
|
110
122
|
></ExtractionStatus>
|
|
111
123
|
)}
|
|
112
|
-
<IconButton
|
|
113
|
-
styleType="borderless"
|
|
114
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
115
|
-
"ReportsConfigWidget:Remove"
|
|
116
|
-
)}
|
|
117
|
-
onClick={() => {
|
|
118
|
-
props.onClickDelete();
|
|
119
|
-
}}
|
|
120
|
-
disabled={jobStarted}
|
|
121
|
-
>
|
|
122
|
-
<SvgDelete />
|
|
123
|
-
</IconButton>
|
|
124
124
|
</div >
|
|
125
125
|
)}
|
|
126
126
|
/>
|
|
@@ -2,31 +2,29 @@
|
|
|
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
5
|
|
|
7
6
|
.rcw-report-mapping-misc {
|
|
8
7
|
display: flex;
|
|
9
8
|
flex-direction: column;
|
|
10
|
-
gap:
|
|
9
|
+
gap: var(--iui-size-s);
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
.rcw-report-mappings-container {
|
|
14
13
|
display: flex;
|
|
15
14
|
flex-direction: column;
|
|
16
15
|
flex-grow: 1;
|
|
17
|
-
padding: $iui-baseline $iui-m;
|
|
18
16
|
min-height: 0;
|
|
19
17
|
|
|
20
18
|
.rcw-odata-url-input {
|
|
21
|
-
margin-bottom:
|
|
19
|
+
margin-bottom: calc(var(--iui-size-s) * 2);
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
.rcw-toolbar {
|
|
25
23
|
display: flex;
|
|
26
24
|
justify-content: space-between;
|
|
27
|
-
gap:
|
|
28
|
-
border-bottom: 1px solid var(--iui-color-
|
|
29
|
-
padding-bottom:
|
|
25
|
+
gap: var(--iui-size-xs);
|
|
26
|
+
border-bottom: 1px solid var(--iui-color-border-subtle);
|
|
27
|
+
padding-bottom: var(--iui-size-s);
|
|
30
28
|
flex-wrap: wrap;
|
|
31
29
|
}
|
|
32
30
|
|
|
@@ -34,13 +32,14 @@
|
|
|
34
32
|
display: flex;
|
|
35
33
|
flex-direction: column;
|
|
36
34
|
overflow-y: overlay;
|
|
37
|
-
gap:
|
|
38
|
-
margin-top:
|
|
35
|
+
gap: var(--iui-size-xs);
|
|
36
|
+
margin-top: var(--iui-size-xs);
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
.rcw-search-bar-container {
|
|
42
|
-
flex-basis:
|
|
40
|
+
flex-basis: var(--iui-size-3xl);
|
|
43
41
|
flex-shrink: 1;
|
|
44
42
|
flex-grow: 1;
|
|
43
|
+
display: flex;
|
|
45
44
|
}
|
|
46
|
-
}
|
|
45
|
+
}
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
import {
|
|
6
6
|
SvgAdd,
|
|
7
7
|
SvgCopy,
|
|
8
|
+
SvgRefresh,
|
|
8
9
|
} from "@itwin/itwinui-icons-react";
|
|
9
10
|
import {
|
|
10
11
|
Button,
|
|
11
12
|
IconButton,
|
|
12
13
|
LabeledInput,
|
|
13
|
-
Surface,
|
|
14
14
|
Text,
|
|
15
15
|
toaster,
|
|
16
16
|
} from "@itwin/itwinui-react";
|
|
@@ -21,27 +21,25 @@ import {
|
|
|
21
21
|
generateUrl,
|
|
22
22
|
handleError,
|
|
23
23
|
LoadingOverlay,
|
|
24
|
-
|
|
24
|
+
LoadingSpinner,
|
|
25
25
|
} from "./utils";
|
|
26
26
|
import "./ReportMappings.scss";
|
|
27
27
|
import DeleteModal from "./DeleteModal";
|
|
28
|
-
import type { Report, ReportMapping } from "@itwin/insights-client";
|
|
29
|
-
import {
|
|
28
|
+
import type { MappingsClient, Report, ReportMapping, ReportsClient } from "@itwin/insights-client";
|
|
29
|
+
import { REPORTING_BASE_PATH } from "@itwin/insights-client";
|
|
30
30
|
import { AddMappingsModal } from "./AddMappingsModal";
|
|
31
31
|
import type {
|
|
32
32
|
GetSingleIModelParams,
|
|
33
|
-
|
|
33
|
+
IModelsClient,
|
|
34
34
|
} from "@itwin/imodels-client-management";
|
|
35
|
-
import { Constants, IModelsClient } from "@itwin/imodels-client-management";
|
|
36
35
|
import { AccessTokenAdapter } from "@itwin/imodels-access-frontend";
|
|
37
36
|
import { SearchBar } from "./SearchBar";
|
|
38
|
-
import
|
|
39
|
-
import { useReportsApiConfig } from "../context/ReportsApiConfigContext";
|
|
37
|
+
import { useReportsConfigApi } from "../context/ReportsConfigApiContext";
|
|
40
38
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
41
39
|
import { ReportMappingHorizontalTile } from "./ReportMappingHorizontalTile";
|
|
42
|
-
import type
|
|
40
|
+
import type { AccessToken } from "@itwin/core-bentley";
|
|
43
41
|
import { BeEvent } from "@itwin/core-bentley";
|
|
44
|
-
import {
|
|
42
|
+
import { useBulkExtractor } from "../context/BulkExtractorContext";
|
|
45
43
|
|
|
46
44
|
export type ReportMappingType = CreateTypeFromInterface<ReportMapping>;
|
|
47
45
|
|
|
@@ -51,35 +49,22 @@ export type ReportMappingAndMapping = ReportMappingType & {
|
|
|
51
49
|
iModelName: string;
|
|
52
50
|
};
|
|
53
51
|
|
|
54
|
-
enum ReportMappingsView {
|
|
55
|
-
REPORTMAPPINGS = "reportmappings",
|
|
56
|
-
ADDING = "adding",
|
|
57
|
-
}
|
|
58
|
-
|
|
59
52
|
const fetchReportMappings = async (
|
|
60
53
|
setReportMappings: (mappings: ReportMappingAndMapping[]) => void,
|
|
61
54
|
reportId: string,
|
|
62
|
-
setIsLoading:
|
|
63
|
-
|
|
55
|
+
setIsLoading: (isLoading: boolean) => void,
|
|
56
|
+
reportsClient: ReportsClient,
|
|
57
|
+
mappingsClient: MappingsClient,
|
|
58
|
+
iModelsClient: IModelsClient,
|
|
59
|
+
getAccessToken: () => Promise<AccessToken>
|
|
64
60
|
) => {
|
|
65
61
|
try {
|
|
66
62
|
setIsLoading(true);
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
);
|
|
70
|
-
const mappingsClientApi = new MappingsClient(
|
|
71
|
-
generateUrl(REPORTING_BASE_PATH, apiContext.baseUrl)
|
|
72
|
-
);
|
|
73
|
-
const accessToken = await apiContext.getAccessToken();
|
|
74
|
-
const reportMappings = await reportsClientApi.getReportMappings(
|
|
63
|
+
const accessToken = await getAccessToken();
|
|
64
|
+
const reportMappings = await reportsClient.getReportMappings(
|
|
75
65
|
accessToken,
|
|
76
66
|
reportId
|
|
77
67
|
);
|
|
78
|
-
const iModelClientOptions: IModelsClientOptions = {
|
|
79
|
-
api: { baseUrl: generateUrl(Constants.api.baseUrl, apiContext.baseUrl) },
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const iModelsClient: IModelsClient = new IModelsClient(iModelClientOptions);
|
|
83
68
|
const authorization =
|
|
84
69
|
AccessTokenAdapter.toAuthorizationCallback(accessToken);
|
|
85
70
|
const iModelNames = new Map<string, string>();
|
|
@@ -88,7 +73,7 @@ const fetchReportMappings = async (
|
|
|
88
73
|
for (const reportMapping of reportMappings) {
|
|
89
74
|
const iModelId = reportMapping.imodelId;
|
|
90
75
|
let iModelName = "";
|
|
91
|
-
const mapping = await
|
|
76
|
+
const mapping = await mappingsClient.getMapping(
|
|
92
77
|
accessToken,
|
|
93
78
|
iModelId,
|
|
94
79
|
reportMapping.mappingId
|
|
@@ -121,23 +106,21 @@ const fetchReportMappings = async (
|
|
|
121
106
|
}
|
|
122
107
|
};
|
|
123
108
|
|
|
124
|
-
interface ReportMappingsProps {
|
|
109
|
+
export interface ReportMappingsProps {
|
|
125
110
|
report: Report;
|
|
126
|
-
|
|
127
|
-
|
|
111
|
+
onClickClose: () => void;
|
|
112
|
+
defaultIModelId?: string;
|
|
128
113
|
}
|
|
129
114
|
|
|
130
|
-
export const ReportMappings = ({ report,
|
|
131
|
-
const
|
|
132
|
-
const [
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);
|
|
115
|
+
export const ReportMappings = ({ report, onClickClose, defaultIModelId }: ReportMappingsProps) => {
|
|
116
|
+
const { getAccessToken, reportsClient, iModelsClient, mappingsClient, baseUrl } = useReportsConfigApi();
|
|
117
|
+
const [showDeleteModal, setShowDeleteModal] = useState<ReportMappingAndMapping | undefined>(undefined);
|
|
118
|
+
const [showAddMapping, setShowAddMapping] = useState<boolean>(false);
|
|
119
|
+
const { bulkExtractor } = useBulkExtractor();
|
|
136
120
|
const [isLoading, setIsLoading] = useState<boolean>(true);
|
|
137
121
|
const [searchValue, setSearchValue] = useState<string>("");
|
|
138
122
|
const [reportMappings, setReportMappings] = useState<ReportMappingAndMapping[]>([]);
|
|
139
123
|
const [jobRunning, setJobRunning] = useState<boolean>(false);
|
|
140
|
-
|
|
141
124
|
const jobStartEvent = useMemo(
|
|
142
125
|
() => new BeEvent<(iModelId: string) => void>(),
|
|
143
126
|
[]
|
|
@@ -148,33 +131,39 @@ export const ReportMappings = ({ report, bulkExtractor, goBack }: ReportMappings
|
|
|
148
131
|
setReportMappings,
|
|
149
132
|
report.id,
|
|
150
133
|
setIsLoading,
|
|
151
|
-
|
|
134
|
+
reportsClient,
|
|
135
|
+
mappingsClient,
|
|
136
|
+
iModelsClient,
|
|
137
|
+
getAccessToken
|
|
152
138
|
);
|
|
153
|
-
}, [
|
|
139
|
+
}, [getAccessToken, iModelsClient, mappingsClient, report.id, reportsClient, setIsLoading]);
|
|
154
140
|
|
|
155
141
|
useEffect(() => {
|
|
142
|
+
if (!bulkExtractor) return;
|
|
156
143
|
bulkExtractor.setHook(setJobRunning, reportMappings.map((x) => x.imodelId));
|
|
157
144
|
}, [bulkExtractor, reportMappings]);
|
|
158
145
|
|
|
159
146
|
const refresh = useCallback(async () => {
|
|
160
|
-
setReportMappingsView(ReportMappingsView.REPORTMAPPINGS);
|
|
161
147
|
await fetchReportMappings(
|
|
162
148
|
setReportMappings,
|
|
163
149
|
report.id,
|
|
164
150
|
setIsLoading,
|
|
165
|
-
|
|
151
|
+
reportsClient,
|
|
152
|
+
mappingsClient,
|
|
153
|
+
iModelsClient,
|
|
154
|
+
getAccessToken
|
|
166
155
|
);
|
|
167
|
-
}, [
|
|
168
|
-
|
|
169
|
-
const addMapping = () => {
|
|
170
|
-
setReportMappingsView(ReportMappingsView.ADDING);
|
|
171
|
-
};
|
|
156
|
+
}, [getAccessToken, iModelsClient, mappingsClient, report.id, reportsClient]);
|
|
172
157
|
|
|
173
158
|
const odataFeedUrl = `${generateUrl(
|
|
174
159
|
REPORTING_BASE_PATH,
|
|
175
|
-
|
|
160
|
+
baseUrl
|
|
176
161
|
)}/odata/${report.id}`;
|
|
177
162
|
|
|
163
|
+
const addMapping = useCallback(() => {
|
|
164
|
+
setShowAddMapping(true);
|
|
165
|
+
}, []);
|
|
166
|
+
|
|
178
167
|
const filteredReportMappings = useMemo(
|
|
179
168
|
() =>
|
|
180
169
|
reportMappings.filter((x) =>
|
|
@@ -186,10 +175,13 @@ export const ReportMappings = ({ report, bulkExtractor, goBack }: ReportMappings
|
|
|
186
175
|
[reportMappings, searchValue]
|
|
187
176
|
);
|
|
188
177
|
|
|
178
|
+
const onAddMappingsModalClose = useCallback(async () => { await refresh(); setShowAddMapping(false); }, [refresh]);
|
|
179
|
+
|
|
180
|
+
if (!bulkExtractor) return null;
|
|
181
|
+
|
|
189
182
|
return (
|
|
190
183
|
<>
|
|
191
|
-
<
|
|
192
|
-
<div className="rcw-report-mapping-misc">
|
|
184
|
+
<div className="rcw-report-mappings-container">
|
|
193
185
|
<LabeledInput
|
|
194
186
|
label={ReportsConfigWidget.localization.getLocalizedString(
|
|
195
187
|
"ReportsConfigWidget:ODataFeedURL"
|
|
@@ -202,7 +194,6 @@ export const ReportMappings = ({ report, bulkExtractor, goBack }: ReportMappings
|
|
|
202
194
|
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
203
195
|
"ReportsConfigWidget:Copy"
|
|
204
196
|
)}
|
|
205
|
-
styleType="borderless"
|
|
206
197
|
onClick={async (_) => {
|
|
207
198
|
await navigator.clipboard.writeText(odataFeedUrl);
|
|
208
199
|
toaster.positive(
|
|
@@ -217,8 +208,6 @@ export const ReportMappings = ({ report, bulkExtractor, goBack }: ReportMappings
|
|
|
217
208
|
}
|
|
218
209
|
iconDisplayStyle="inline"
|
|
219
210
|
/>
|
|
220
|
-
</div>
|
|
221
|
-
<Surface className="rcw-report-mappings-container">
|
|
222
211
|
<div className="rcw-toolbar">
|
|
223
212
|
<Button
|
|
224
213
|
startIcon={<SvgAdd />}
|
|
@@ -230,6 +219,16 @@ export const ReportMappings = ({ report, bulkExtractor, goBack }: ReportMappings
|
|
|
230
219
|
)}
|
|
231
220
|
</Button>
|
|
232
221
|
<div className="rcw-search-bar-container" data-testid="rcw-search-bar">
|
|
222
|
+
<IconButton
|
|
223
|
+
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
224
|
+
"ReportsConfigWidget:Refresh"
|
|
225
|
+
)}
|
|
226
|
+
onClick={refresh}
|
|
227
|
+
disabled={isLoading}
|
|
228
|
+
styleType='borderless'
|
|
229
|
+
>
|
|
230
|
+
<SvgRefresh />
|
|
231
|
+
</IconButton>
|
|
233
232
|
<SearchBar
|
|
234
233
|
searchValue={searchValue}
|
|
235
234
|
setSearchValue={setSearchValue}
|
|
@@ -248,7 +247,7 @@ export const ReportMappings = ({ report, bulkExtractor, goBack }: ReportMappings
|
|
|
248
247
|
)}
|
|
249
248
|
</Text>
|
|
250
249
|
<div>
|
|
251
|
-
<Button onClick={
|
|
250
|
+
<Button onClick={addMapping} styleType="cta">
|
|
252
251
|
{ReportsConfigWidget.localization.getLocalizedString(
|
|
253
252
|
"ReportsConfigWidget:LetsAddSomeMappingsCTA"
|
|
254
253
|
)}
|
|
@@ -264,8 +263,7 @@ export const ReportMappings = ({ report, bulkExtractor, goBack }: ReportMappings
|
|
|
264
263
|
bulkExtractor={bulkExtractor}
|
|
265
264
|
mapping={mapping}
|
|
266
265
|
onClickDelete={() => {
|
|
267
|
-
|
|
268
|
-
setShowDeleteModal(true);
|
|
266
|
+
setShowDeleteModal(mapping);
|
|
269
267
|
}}
|
|
270
268
|
odataFeedUrl={odataFeedUrl}
|
|
271
269
|
jobStartEvent={jobStartEvent}
|
|
@@ -273,29 +271,26 @@ export const ReportMappings = ({ report, bulkExtractor, goBack }: ReportMappings
|
|
|
273
271
|
))}
|
|
274
272
|
</div>
|
|
275
273
|
)}
|
|
276
|
-
</
|
|
274
|
+
</div>
|
|
277
275
|
<AddMappingsModal
|
|
278
|
-
show={
|
|
276
|
+
show={showAddMapping}
|
|
279
277
|
reportId={report.id}
|
|
280
278
|
existingMappings={reportMappings}
|
|
281
|
-
|
|
279
|
+
onClose={onAddMappingsModalClose}
|
|
280
|
+
defaultIModelId={defaultIModelId}
|
|
282
281
|
/>
|
|
283
282
|
<DeleteModal
|
|
284
|
-
entityName={
|
|
285
|
-
show={showDeleteModal}
|
|
286
|
-
setShow={setShowDeleteModal}
|
|
283
|
+
entityName={showDeleteModal?.mappingName ?? ""}
|
|
287
284
|
onDelete={async () => {
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
);
|
|
291
|
-
const accessToken = await apiConfig.getAccessToken();
|
|
292
|
-
await reportsClientApi.deleteReportMapping(
|
|
285
|
+
const accessToken = await getAccessToken();
|
|
286
|
+
await reportsClient.deleteReportMapping(
|
|
293
287
|
accessToken,
|
|
294
288
|
report.id,
|
|
295
|
-
|
|
289
|
+
showDeleteModal?.mappingId ?? ""
|
|
296
290
|
);
|
|
297
291
|
}}
|
|
298
292
|
refresh={refresh}
|
|
293
|
+
onClose={() => setShowDeleteModal(undefined)}
|
|
299
294
|
/>
|
|
300
295
|
<div className="rcw-action-panel">
|
|
301
296
|
{isLoading && <LoadingSpinner />}
|
|
@@ -318,7 +313,7 @@ export const ReportMappings = ({ report, bulkExtractor, goBack }: ReportMappings
|
|
|
318
313
|
<Button
|
|
319
314
|
styleType="default"
|
|
320
315
|
type="button"
|
|
321
|
-
onClick={
|
|
316
|
+
onClick={onClickClose}
|
|
322
317
|
disabled={isLoading}
|
|
323
318
|
>
|
|
324
319
|
{ReportsConfigWidget.localization.getLocalizedString(
|