@itwin/reports-config-widget-react 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +61 -0
- package/CHANGELOG.md +23 -2
- package/LICENSE.md +9 -9
- package/README.md +38 -38
- package/__mocks__/fileMock.js +4 -4
- package/api/reports-config-widget-react.api.md +130 -0
- package/api/reports-config-widget-react.exports.csv +14 -0
- package/api/temp/reports-config-widget-react.api.md +130 -0
- package/coverage/clover.xml +524 -514
- package/coverage/coverage-final.json +32 -32
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +26 -26
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +15 -15
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/test/index.html +15 -15
- package/coverage/lcov-report/src/test/test-utils.tsx.html +233 -20
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +22 -64
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +5 -38
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +23 -119
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +117 -90
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +16 -10
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +16 -106
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +7 -22
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +7 -28
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +20 -47
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +20 -11
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +16 -79
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +15 -108
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +36 -75
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +62 -92
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +104 -128
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +86 -299
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +64 -226
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +63 -45
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +10 -49
- package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +8 -47
- package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +6 -12
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +15 -27
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +12 -57
- package/coverage/lcov-report/src/widget/components/index.html +56 -56
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +32 -176
- package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +9 -15
- package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +9 -15
- package/coverage/lcov-report/src/widget/context/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +12 -54
- package/coverage/lcov-report/src/widget/index.html +1 -1
- package/coverage/lcov.info +959 -922
- package/jest.config.js +14 -17
- package/lib/cjs/ReportsConfigWidget.d.ts +4 -0
- package/lib/cjs/ReportsConfigWidget.d.ts.map +1 -1
- package/lib/cjs/ReportsConfigWidget.js +4 -0
- package/lib/cjs/ReportsConfigWidget.js.map +1 -1
- package/lib/cjs/reports-config-widget-react.js +8 -4
- package/lib/cjs/reports-config-widget-react.js.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.js +24 -72
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
- package/lib/cjs/test/BulkExtractor.test.js +73 -44
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
- package/lib/cjs/test/DeleteModal.test.js +3 -3
- package/lib/cjs/test/DeleteModal.test.js.map +1 -1
- package/lib/cjs/test/ReportAction.test.js +6 -4
- package/lib/cjs/test/ReportAction.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +76 -86
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/cjs/test/ReportMappings.test.js +53 -80
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +54 -50
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +3 -3
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/test-utils.d.ts +38 -0
- package/lib/cjs/test/test-utils.d.ts.map +1 -1
- package/lib/cjs/test/test-utils.js +79 -5
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +7 -0
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +13 -4
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.js +5 -1
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js +12 -8
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.scss +1 -1
- package/lib/cjs/widget/components/BulkExtractor.d.ts +7 -4
- package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.js +52 -35
- package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
- package/lib/cjs/widget/components/Constants.d.ts +1 -0
- package/lib/cjs/widget/components/Constants.d.ts.map +1 -1
- package/lib/cjs/widget/components/Constants.js +5 -4
- package/lib/cjs/widget/components/Constants.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js +10 -6
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.scss +2 -2
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.js +14 -10
- package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.scss +1 -1
- package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionToast.js +3 -3
- package/lib/cjs/widget/components/ExtractionToast.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.js +1 -2
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.scss +1 -4
- package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js +6 -2
- package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.d.ts +8 -0
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js +14 -8
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.scss +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js +9 -5
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +51 -46
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts +8 -0
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js +30 -12
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/Reports.d.ts +9 -1
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js +12 -9
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/Reports.scss +0 -1
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts +8 -0
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.js +20 -7
- package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.d.ts +1 -1
- package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js +7 -5
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.scss +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsHeader.js +6 -7
- package/lib/cjs/widget/components/ReportsHeader.js.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.js +3 -3
- package/lib/cjs/widget/components/ReportsRouter.js.map +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/cjs/widget/components/SearchBar.js +9 -5
- package/lib/cjs/widget/components/SearchBar.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +7 -3
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.scss +1 -1
- package/lib/cjs/widget/components/utils.d.ts +1 -1
- package/lib/cjs/widget/components/utils.d.ts.map +1 -1
- package/lib/cjs/widget/components/utils.js +5 -5
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js +5 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js +5 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.d.ts +1 -4
- package/lib/cjs/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.js +3 -3
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
- package/lib/esm/ReportsConfigWidget.d.ts +4 -0
- package/lib/esm/ReportsConfigWidget.d.ts.map +1 -1
- package/lib/esm/ReportsConfigWidget.js +4 -0
- package/lib/esm/ReportsConfigWidget.js.map +1 -1
- package/lib/esm/reports-config-widget-react.js +3 -3
- package/lib/esm/reports-config-widget-react.js.map +1 -1
- package/lib/esm/test/AddMappingModal.test.js +12 -64
- package/lib/esm/test/AddMappingModal.test.js.map +1 -1
- package/lib/esm/test/BulkExtractor.test.js +69 -44
- package/lib/esm/test/BulkExtractor.test.js.map +1 -1
- package/lib/esm/test/DeleteModal.test.js +4 -4
- package/lib/esm/test/DeleteModal.test.js.map +1 -1
- package/lib/esm/test/ReportAction.test.js +7 -5
- package/lib/esm/test/ReportAction.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +66 -80
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/esm/test/ReportMappings.test.js +42 -73
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +32 -51
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +3 -3
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/test-utils.d.ts +38 -0
- package/lib/esm/test/test-utils.d.ts.map +1 -1
- package/lib/esm/test/test-utils.js +73 -3
- package/lib/esm/test/test-utils.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts +7 -0
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.js +9 -4
- package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/esm/widget/components/ActionPanel.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.js +7 -7
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.scss +1 -1
- package/lib/esm/widget/components/BulkExtractor.d.ts +7 -4
- package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.js +53 -36
- package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
- package/lib/esm/widget/components/Constants.d.ts +1 -0
- package/lib/esm/widget/components/Constants.d.ts.map +1 -1
- package/lib/esm/widget/components/Constants.js +4 -3
- package/lib/esm/widget/components/Constants.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/esm/widget/components/DeleteModal.js +6 -6
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.scss +2 -2
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.js +9 -9
- package/lib/esm/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.scss +1 -1
- package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionToast.js +3 -3
- package/lib/esm/widget/components/ExtractionToast.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.js +1 -2
- package/lib/esm/widget/components/HorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.scss +1 -4
- package/lib/esm/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.d.ts +8 -0
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.js +10 -8
- package/lib/esm/widget/components/ReportAction.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.scss +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.js +6 -6
- package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js +47 -46
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.d.ts +8 -0
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js +28 -14
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/Reports.d.ts +9 -1
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js +8 -9
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/Reports.scss +0 -1
- package/lib/esm/widget/components/ReportsConfigContext.d.ts +8 -0
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.js +17 -8
- package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.d.ts +1 -1
- package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.js +2 -4
- package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.scss +1 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts +1 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsHeader.js +6 -7
- package/lib/esm/widget/components/ReportsHeader.js.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.js +3 -3
- package/lib/esm/widget/components/ReportsRouter.js.map +1 -1
- package/lib/esm/widget/components/SearchBar.d.ts +1 -1
- package/lib/esm/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/esm/widget/components/SearchBar.js +4 -4
- package/lib/esm/widget/components/SearchBar.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.d.ts +1 -1
- package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/esm/widget/components/SelectIModel.js +3 -3
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.scss +1 -1
- package/lib/esm/widget/components/utils.d.ts +1 -1
- package/lib/esm/widget/components/utils.d.ts.map +1 -1
- package/lib/esm/widget/components/utils.js +6 -6
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/esm/widget/hooks/useValidator.d.ts +1 -4
- package/lib/esm/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/esm/widget/hooks/useValidator.js +3 -3
- package/lib/esm/widget/hooks/useValidator.js.map +1 -1
- package/package.json +37 -31
- package/src/ReportsConfigWidget.ts +9 -9
- package/src/reports-config-widget-react.ts +3 -3
- package/src/test/AddMappingModal.test.tsx +47 -122
- package/src/test/BulkExtractor.test.ts +73 -118
- package/src/test/DeleteModal.test.tsx +6 -23
- package/src/test/ReportAction.test.tsx +20 -38
- package/src/test/ReportMappingHorizontalTile.test.tsx +140 -161
- package/src/test/ReportMappings.test.tsx +80 -146
- package/src/test/Reports.test.tsx +57 -169
- package/src/test/WidgetHeader.test.tsx +3 -3
- package/src/test/test-utils.tsx +80 -9
- package/src/widget/ReportsConfigUiProvider.tsx +16 -30
- package/src/widget/components/ActionPanel.tsx +3 -14
- package/src/widget/components/AddMappingsModal.scss +1 -1
- package/src/widget/components/AddMappingsModal.tsx +19 -51
- package/src/widget/components/BulkExtractor.ts +63 -54
- package/src/widget/components/Constants.ts +5 -3
- package/src/widget/components/DeleteModal.scss +2 -2
- package/src/widget/components/DeleteModal.tsx +11 -41
- package/src/widget/components/ExtractionStates/FailedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/QueuedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/RunningExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/StartingExtractionState.tsx +4 -11
- package/src/widget/components/ExtractionStates/SucceededExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStatus.scss +1 -1
- package/src/widget/components/ExtractionStatus.tsx +9 -18
- package/src/widget/components/ExtractionToast.tsx +12 -9
- package/src/widget/components/HorizontalTile.scss +1 -4
- package/src/widget/components/HorizontalTile.tsx +12 -33
- package/src/widget/components/LocalizedTablePaginator.tsx +13 -44
- package/src/widget/components/ReportAction.scss +1 -1
- package/src/widget/components/ReportAction.tsx +26 -39
- package/src/widget/components/ReportHorizontalTile.tsx +45 -55
- package/src/widget/components/ReportMappingHorizontalTile.tsx +70 -78
- package/src/widget/components/ReportMappings.tsx +59 -130
- package/src/widget/components/Reports.scss +0 -1
- package/src/widget/components/Reports.tsx +28 -82
- package/src/widget/components/ReportsConfigContext.tsx +32 -26
- package/src/widget/components/ReportsContainer.scss +1 -1
- package/src/widget/components/ReportsContainer.tsx +8 -21
- package/src/widget/components/ReportsHeader.tsx +6 -19
- package/src/widget/components/ReportsRouter.tsx +4 -6
- package/src/widget/components/SearchBar.tsx +9 -13
- package/src/widget/components/SelectIModel.scss +1 -1
- package/src/widget/components/SelectIModel.tsx +10 -25
- package/src/widget/components/utils.scss +1 -1
- package/src/widget/components/utils.tsx +21 -69
- package/src/widget/context/BulkExtractorContext.tsx +4 -6
- package/src/widget/context/ReportsConfigApiContext.tsx +4 -6
- package/src/widget/hooks/useValidator.ts +10 -24
- package/tsconfig.json +11 -11
- package/.rush/temp/operation/rebuild/all.log +0 -9
- package/.rush/temp/operation/rebuild/state.json +0 -3
- package/.rush/temp/package-deps_rebuild.json +0 -68
- package/.rush/temp/shrinkwrap-deps.json +0 -898
- package/reports-config-widget-react.build.error.log +0 -14
- package/reports-config-widget-react.build.log +0 -63
|
@@ -6,11 +6,7 @@ import { SvgAdd, SvgPlay, SvgRefresh } from "@itwin/itwinui-icons-react";
|
|
|
6
6
|
import { Button, IconButton } from "@itwin/itwinui-react";
|
|
7
7
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
8
8
|
import type { CreateTypeFromInterface } from "./utils";
|
|
9
|
-
import {
|
|
10
|
-
EmptyMessage,
|
|
11
|
-
handleError,
|
|
12
|
-
LoadingOverlay,
|
|
13
|
-
} from "./utils";
|
|
9
|
+
import { EmptyMessage, handleError, LoadingOverlay } from "./utils";
|
|
14
10
|
import "./Reports.scss";
|
|
15
11
|
import DeleteModal from "./DeleteModal";
|
|
16
12
|
import type { Report, ReportsClient } from "@itwin/insights-client";
|
|
@@ -29,7 +25,7 @@ const fetchReports = async (
|
|
|
29
25
|
iTwinId: string | undefined,
|
|
30
26
|
setIsLoading: (isLoading: boolean) => void,
|
|
31
27
|
reportsClient: ReportsClient,
|
|
32
|
-
getAccessToken: () => Promise<AccessToken
|
|
28
|
+
getAccessToken: () => Promise<AccessToken>,
|
|
33
29
|
) => {
|
|
34
30
|
try {
|
|
35
31
|
if (!iTwinId) return;
|
|
@@ -44,70 +40,47 @@ const fetchReports = async (
|
|
|
44
40
|
}
|
|
45
41
|
};
|
|
46
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Props for {@link Reports} component.
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
47
|
export interface ReportsProps {
|
|
48
48
|
onClickAddReport?: () => void;
|
|
49
49
|
onClickReportTitle?: (report: Report) => void;
|
|
50
50
|
onClickReportModify?: (report: Report) => void;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}: ReportsProps) => {
|
|
53
|
+
/**
|
|
54
|
+
* Component to manage and list reports for an iTwin.
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
export const Reports = ({ onClickAddReport, onClickReportModify, onClickReportTitle }: ReportsProps) => {
|
|
58
58
|
const { iTwinId, getAccessToken, reportsClient } = useReportsConfigApi();
|
|
59
59
|
const { bulkExtractor } = useBulkExtractor();
|
|
60
|
-
const [showDeleteModal, setShowDeleteModal] = useState<Report | undefined>(
|
|
61
|
-
undefined
|
|
62
|
-
);
|
|
60
|
+
const [showDeleteModal, setShowDeleteModal] = useState<Report | undefined>(undefined);
|
|
63
61
|
const [selectedReportIds, setSelectedReportIds] = useState<string[]>([]);
|
|
64
62
|
const [isLoading, setIsLoading] = useState<boolean>(true);
|
|
65
63
|
const [searchValue, setSearchValue] = useState<string>("");
|
|
66
64
|
const [reports, setReports] = useState<Report[]>([]);
|
|
67
|
-
const jobStartEvent = useMemo(
|
|
68
|
-
() => new BeEvent<(reportId: string) => void>(),
|
|
69
|
-
[]
|
|
70
|
-
);
|
|
65
|
+
const jobStartEvent = useMemo(() => new BeEvent<(reportId: string) => void>(), []);
|
|
71
66
|
|
|
72
67
|
useEffect(() => {
|
|
73
|
-
void fetchReports(
|
|
74
|
-
setReports,
|
|
75
|
-
iTwinId,
|
|
76
|
-
setIsLoading,
|
|
77
|
-
reportsClient,
|
|
78
|
-
getAccessToken
|
|
79
|
-
);
|
|
68
|
+
void fetchReports(setReports, iTwinId, setIsLoading, reportsClient, getAccessToken);
|
|
80
69
|
}, [getAccessToken, iTwinId, reportsClient, setIsLoading]);
|
|
81
70
|
|
|
82
71
|
const refresh = useCallback(async () => {
|
|
83
|
-
await fetchReports(
|
|
84
|
-
setReports,
|
|
85
|
-
iTwinId,
|
|
86
|
-
setIsLoading,
|
|
87
|
-
reportsClient,
|
|
88
|
-
getAccessToken
|
|
89
|
-
);
|
|
72
|
+
await fetchReports(setReports, iTwinId, setIsLoading, reportsClient, getAccessToken);
|
|
90
73
|
}, [getAccessToken, iTwinId, reportsClient]);
|
|
91
74
|
|
|
92
75
|
const filteredReports = useMemo(
|
|
93
|
-
() =>
|
|
94
|
-
|
|
95
|
-
[x.displayName, x.description]
|
|
96
|
-
.join(" ")
|
|
97
|
-
.toLowerCase()
|
|
98
|
-
.includes(searchValue.toLowerCase())
|
|
99
|
-
),
|
|
100
|
-
[reports, searchValue]
|
|
76
|
+
() => reports.filter((x) => [x.displayName, x.description].join(" ").toLowerCase().includes(searchValue.toLowerCase())),
|
|
77
|
+
[reports, searchValue],
|
|
101
78
|
);
|
|
102
79
|
|
|
103
80
|
const onSelectionChange = (reportId: string, control: boolean) => {
|
|
104
81
|
if (!control) setSelectedReportIds([]);
|
|
105
82
|
|
|
106
|
-
setSelectedReportIds((sr) =>
|
|
107
|
-
sr.some((r) => reportId === r)
|
|
108
|
-
? sr.filter((r) => reportId !== r)
|
|
109
|
-
: [...sr, reportId]
|
|
110
|
-
);
|
|
83
|
+
setSelectedReportIds((sr) => (sr.some((r) => reportId === r) ? sr.filter((r) => reportId !== r) : [...sr, reportId]));
|
|
111
84
|
};
|
|
112
85
|
|
|
113
86
|
const updateDatasets = useCallback(async () => {
|
|
@@ -125,46 +98,28 @@ export const Reports = ({
|
|
|
125
98
|
<div className="rcw-toolbar">
|
|
126
99
|
<div className="rcw-button-spacing">
|
|
127
100
|
{onClickAddReport && (
|
|
128
|
-
<Button
|
|
129
|
-
|
|
130
|
-
onClick={onClickAddReport}
|
|
131
|
-
styleType="high-visibility"
|
|
132
|
-
title="New Report"
|
|
133
|
-
>
|
|
134
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
135
|
-
"ReportsConfigWidget:New"
|
|
136
|
-
)}
|
|
101
|
+
<Button startIcon={<SvgAdd />} onClick={onClickAddReport} styleType="high-visibility" title="New Report">
|
|
102
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:New")}
|
|
137
103
|
</Button>
|
|
138
104
|
)}
|
|
139
105
|
<IconButton
|
|
140
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
141
|
-
"ReportsConfigWidget:UpdateDatasets"
|
|
142
|
-
)}
|
|
106
|
+
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:UpdateDatasets")}
|
|
143
107
|
onClick={updateDatasets}
|
|
144
108
|
disabled={selectedReportIds.length === 0}
|
|
145
109
|
>
|
|
146
110
|
<SvgPlay />
|
|
147
111
|
</IconButton>
|
|
148
112
|
</div>
|
|
149
|
-
<div
|
|
150
|
-
className="rcw-search-bar-container"
|
|
151
|
-
data-testid="rcw-search-bar"
|
|
152
|
-
>
|
|
113
|
+
<div className="rcw-search-bar-container" data-testid="rcw-search-bar">
|
|
153
114
|
<IconButton
|
|
154
|
-
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
155
|
-
"ReportsConfigWidget:Refresh"
|
|
156
|
-
)}
|
|
115
|
+
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Refresh")}
|
|
157
116
|
onClick={refresh}
|
|
158
117
|
disabled={isLoading}
|
|
159
118
|
styleType="borderless"
|
|
160
119
|
>
|
|
161
120
|
<SvgRefresh />
|
|
162
121
|
</IconButton>
|
|
163
|
-
<SearchBar
|
|
164
|
-
searchValue={searchValue}
|
|
165
|
-
setSearchValue={setSearchValue}
|
|
166
|
-
disabled={isLoading}
|
|
167
|
-
/>
|
|
122
|
+
<SearchBar searchValue={searchValue} setSearchValue={setSearchValue} disabled={isLoading} />
|
|
168
123
|
</div>
|
|
169
124
|
</div>
|
|
170
125
|
{isLoading ? (
|
|
@@ -172,14 +127,10 @@ export const Reports = ({
|
|
|
172
127
|
) : reports.length === 0 && onClickAddReport ? (
|
|
173
128
|
<EmptyMessage>
|
|
174
129
|
<>
|
|
175
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
176
|
-
"ReportsConfigWidget:NoReports"
|
|
177
|
-
)}
|
|
130
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:NoReports")}
|
|
178
131
|
<div>
|
|
179
132
|
<Button onClick={onClickAddReport} styleType="cta">
|
|
180
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
181
|
-
"ReportsConfigWidget:CreateOneReportCTA"
|
|
182
|
-
)}
|
|
133
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:CreateOneReportCTA")}
|
|
183
134
|
</Button>
|
|
184
135
|
</div>
|
|
185
136
|
</>
|
|
@@ -198,9 +149,7 @@ export const Reports = ({
|
|
|
198
149
|
}}
|
|
199
150
|
onClickModify={onClickReportModify}
|
|
200
151
|
onSelectionChange={onSelectionChange}
|
|
201
|
-
selected={selectedReportIds.some(
|
|
202
|
-
(reportId) => report.id === reportId
|
|
203
|
-
)}
|
|
152
|
+
selected={selectedReportIds.some((reportId) => report.id === reportId)}
|
|
204
153
|
/>
|
|
205
154
|
))}
|
|
206
155
|
</div>
|
|
@@ -211,10 +160,7 @@ export const Reports = ({
|
|
|
211
160
|
onClose={() => setShowDeleteModal(undefined)}
|
|
212
161
|
onDelete={async () => {
|
|
213
162
|
const accessToken = await getAccessToken();
|
|
214
|
-
await reportsClient.deleteReport(
|
|
215
|
-
accessToken,
|
|
216
|
-
showDeleteModal?.id ?? ""
|
|
217
|
-
);
|
|
163
|
+
await reportsClient.deleteReport(accessToken, showDeleteModal?.id ?? "");
|
|
218
164
|
}}
|
|
219
165
|
refresh={refresh}
|
|
220
166
|
/>
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { IModelApp } from "@itwin/core-frontend";
|
|
6
6
|
import type { IModelsClientOptions } from "@itwin/imodels-client-management";
|
|
7
|
-
import {
|
|
8
|
-
import { ExtractionClient, MappingsClient, REPORTING_BASE_PATH, ReportsClient } from "@itwin/insights-client";
|
|
7
|
+
import { IModelsClient } from "@itwin/imodels-client-management";
|
|
8
|
+
import { ExtractionClient, GROUPING_AND_MAPPING_BASE_PATH, MappingsClient, REPORTING_BASE_PATH, ReportsClient } from "@itwin/insights-client";
|
|
9
9
|
import { toaster } from "@itwin/itwinui-react";
|
|
10
10
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
11
11
|
import { BulkExtractorContext } from "../context/BulkExtractorContext";
|
|
12
|
-
import type {
|
|
13
|
-
GetAccessTokenFn,
|
|
14
|
-
ReportsConfigApiProps,
|
|
15
|
-
} from "../context/ReportsConfigApiContext";
|
|
12
|
+
import type { GetAccessTokenFn, ReportsConfigApiProps } from "../context/ReportsConfigApiContext";
|
|
16
13
|
import { ReportsConfigApiContext } from "../context/ReportsConfigApiContext";
|
|
17
14
|
import { REPORTS_CONFIG_BASE_URL } from "../ReportsConfigUiProvider";
|
|
18
15
|
import { BulkExtractor } from "./BulkExtractor";
|
|
16
|
+
import { IMODELS_BASE_URL } from "./Constants";
|
|
19
17
|
import { FailedExtractionToast, SuccessfulExtractionToast } from "./ExtractionToast";
|
|
20
18
|
import { generateUrl } from "./utils";
|
|
21
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Props for the {@link ReportsConfigContext} component.
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
22
24
|
export interface ReportsConfigContextProps {
|
|
23
25
|
getAccessToken?: GetAccessTokenFn;
|
|
24
26
|
baseUrl?: string;
|
|
@@ -31,27 +33,29 @@ export interface ReportsConfigContextProps {
|
|
|
31
33
|
children?: React.ReactNode;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
const authorizationClientGetAccessToken = async () =>
|
|
35
|
-
(await IModelApp.authorizationClient?.getAccessToken()) ?? "";
|
|
36
|
+
const authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? "";
|
|
36
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Reports Config context providers required for all components.
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
37
42
|
export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
|
|
38
|
-
const reportsBaseUrl = useCallback(() => generateUrl(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const [extractionClient, setExtractionClient] = useState<ExtractionClient>(
|
|
46
|
-
props.extractionClient ?? new ExtractionClient(reportsBaseUrl())
|
|
43
|
+
const reportsBaseUrl = useCallback(() => generateUrl(REPORTING_BASE_PATH, props.baseUrl || REPORTS_CONFIG_BASE_URL), [props.baseUrl]);
|
|
44
|
+
const groupingMappingBaseUrl = useCallback(() => generateUrl(GROUPING_AND_MAPPING_BASE_PATH, props.baseUrl || REPORTS_CONFIG_BASE_URL), [props.baseUrl]);
|
|
45
|
+
const iModelClientOptions: IModelsClientOptions = useMemo(
|
|
46
|
+
() => ({
|
|
47
|
+
api: { baseUrl: generateUrl(IMODELS_BASE_URL, props.baseUrl ?? REPORTS_CONFIG_BASE_URL) },
|
|
48
|
+
}),
|
|
49
|
+
[props.baseUrl],
|
|
47
50
|
);
|
|
51
|
+
const [extractionClient, setExtractionClient] = useState<ExtractionClient>(props.extractionClient ?? new ExtractionClient(reportsBaseUrl()));
|
|
48
52
|
|
|
49
53
|
const [apiConfig, setApiConfig] = useState<ReportsConfigApiProps>({
|
|
50
54
|
getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,
|
|
51
55
|
baseUrl: reportsBaseUrl(),
|
|
52
56
|
iTwinId: props.iTwinId,
|
|
53
57
|
reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),
|
|
54
|
-
mappingsClient: props.mappingsClient ?? new MappingsClient(
|
|
58
|
+
mappingsClient: props.mappingsClient ?? new MappingsClient(groupingMappingBaseUrl()),
|
|
55
59
|
iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),
|
|
56
60
|
});
|
|
57
61
|
|
|
@@ -70,8 +74,12 @@ export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
|
|
|
70
74
|
};
|
|
71
75
|
|
|
72
76
|
const bulkExtractor = useMemo(
|
|
73
|
-
() => ({
|
|
74
|
-
|
|
77
|
+
() => ({
|
|
78
|
+
bulkExtractor:
|
|
79
|
+
props.bulkExtractor ??
|
|
80
|
+
new BulkExtractor(apiConfig.reportsClient, extractionClient, apiConfig.getAccessToken, successfulExtractionToast, failedExtractionToast),
|
|
81
|
+
}),
|
|
82
|
+
[apiConfig.getAccessToken, apiConfig.reportsClient, extractionClient, props.bulkExtractor],
|
|
75
83
|
);
|
|
76
84
|
|
|
77
85
|
useEffect(() => {
|
|
@@ -87,9 +95,7 @@ export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
|
|
|
87
95
|
|
|
88
96
|
return (
|
|
89
97
|
<ReportsConfigApiContext.Provider value={apiConfig}>
|
|
90
|
-
<BulkExtractorContext.Provider value={bulkExtractor}>
|
|
91
|
-
{props.children}
|
|
92
|
-
</BulkExtractorContext.Provider>
|
|
98
|
+
<BulkExtractorContext.Provider value={bulkExtractor}>{props.children}</BulkExtractorContext.Provider>
|
|
93
99
|
</ReportsConfigApiContext.Provider>
|
|
94
100
|
);
|
|
95
101
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
6
6
|
import React, { useCallback, useState } from "react";
|
|
7
7
|
import "./ReportsContainer.scss";
|
|
@@ -19,7 +19,7 @@ interface ReportsContainerProps {
|
|
|
19
19
|
export enum RouteStep {
|
|
20
20
|
ReportsList,
|
|
21
21
|
ReportAction,
|
|
22
|
-
ReportMappings
|
|
22
|
+
ReportMappings,
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface ReportsRouteFields {
|
|
@@ -32,14 +32,8 @@ export interface Route {
|
|
|
32
32
|
reportsRoutingFields: ReportsRouteFields;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const ReportsContainer = ({
|
|
36
|
-
|
|
37
|
-
baseUrl,
|
|
38
|
-
}: ReportsContainerProps) => {
|
|
39
|
-
|
|
40
|
-
const [routingHistory, setRoutingHistory] = useState<Route[]>([
|
|
41
|
-
{ step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} },
|
|
42
|
-
]);
|
|
35
|
+
const ReportsContainer = ({ getAccessToken, baseUrl }: ReportsContainerProps) => {
|
|
36
|
+
const [routingHistory, setRoutingHistory] = useState<Route[]>([{ step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} }]);
|
|
43
37
|
const currentRoute = routingHistory[routingHistory.length - 1];
|
|
44
38
|
const iTwinId = useActiveIModelConnection()?.iTwinId ?? "";
|
|
45
39
|
const navigateTo = useCallback((toRoute: (prev: Route | undefined) => Route) => {
|
|
@@ -55,15 +49,8 @@ const ReportsContainer = ({
|
|
|
55
49
|
return (
|
|
56
50
|
<ReportsConfigContext getAccessToken={getAccessToken} baseUrl={baseUrl} iTwinId={iTwinId}>
|
|
57
51
|
<div className="rcw-reports-container">
|
|
58
|
-
<ReportsHeader
|
|
59
|
-
|
|
60
|
-
currentRoute={currentRoute}
|
|
61
|
-
/>
|
|
62
|
-
<ReportsRouter
|
|
63
|
-
currentRoute={currentRoute}
|
|
64
|
-
navigateTo={navigateTo}
|
|
65
|
-
goBack={goBack}
|
|
66
|
-
/>
|
|
52
|
+
<ReportsHeader goBack={goBack} currentRoute={currentRoute} />
|
|
53
|
+
<ReportsRouter currentRoute={currentRoute} navigateTo={navigateTo} goBack={goBack} />
|
|
67
54
|
</div>
|
|
68
55
|
</ReportsConfigContext>
|
|
69
56
|
);
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
6
|
import type { Route } from "./ReportsContainer";
|
|
7
7
|
import { RouteStep } from "./ReportsContainer";
|
|
8
8
|
import { WidgetHeader } from "./utils";
|
|
9
9
|
|
|
10
|
-
export const ReportsHeader = ({
|
|
11
|
-
|
|
12
|
-
currentRoute,
|
|
13
|
-
}: {
|
|
14
|
-
goBack: () => void;
|
|
15
|
-
currentRoute: Route;
|
|
16
|
-
}) => {
|
|
17
|
-
const shouldDisableReturnFn =
|
|
18
|
-
currentRoute.step === RouteStep.ReportsList ||
|
|
19
|
-
currentRoute.step === RouteStep.ReportAction;
|
|
10
|
+
export const ReportsHeader = ({ goBack, currentRoute }: { goBack: () => void; currentRoute: Route }) => {
|
|
11
|
+
const shouldDisableReturnFn = currentRoute.step === RouteStep.ReportsList || currentRoute.step === RouteStep.ReportAction;
|
|
20
12
|
|
|
21
|
-
return
|
|
22
|
-
<WidgetHeader
|
|
23
|
-
returnFn={shouldDisableReturnFn ? undefined : goBack}
|
|
24
|
-
title={currentRoute.title}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
13
|
+
return <WidgetHeader returnFn={shouldDisableReturnFn ? undefined : goBack} title={currentRoute.title} />;
|
|
27
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { useActiveIModelConnection } from "@itwin/appui-react";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
@@ -29,9 +29,7 @@ export const ReportsRouter = ({
|
|
|
29
29
|
onClickAddReport={() =>
|
|
30
30
|
navigateTo(() => ({
|
|
31
31
|
step: RouteStep.ReportAction,
|
|
32
|
-
title: ReportsConfigWidget.localization.getLocalizedString(
|
|
33
|
-
"ReportsConfigWidget:ITwinReports"
|
|
34
|
-
),
|
|
32
|
+
title: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ITwinReports"),
|
|
35
33
|
reportsRoutingFields: {},
|
|
36
34
|
}))
|
|
37
35
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { SvgCloseSmall, SvgSearch } from "@itwin/itwinui-icons-react";
|
|
6
6
|
import { IconButton, LabeledInput } from "@itwin/itwinui-react";
|
|
7
7
|
import React, { useState } from "react";
|
|
@@ -14,16 +14,13 @@ interface SearchBarProps {
|
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export const SearchBar = ({
|
|
18
|
-
searchValue,
|
|
19
|
-
setSearchValue,
|
|
20
|
-
disabled,
|
|
21
|
-
}: SearchBarProps) => {
|
|
17
|
+
export const SearchBar = ({ searchValue, setSearchValue, disabled }: SearchBarProps) => {
|
|
22
18
|
const [searchBarOpen, setSearchBarOpened] = useState<boolean>(false);
|
|
23
19
|
const [searchBarClosing, setSearchBarClosing] = useState<boolean>(false);
|
|
24
20
|
|
|
25
21
|
return searchBarOpen || searchValue ? (
|
|
26
|
-
<div
|
|
22
|
+
<div
|
|
23
|
+
className="rcw-search-button"
|
|
27
24
|
style={{
|
|
28
25
|
animation: searchBarClosing ? "rcw-shrink .5s" : "rcw-expand .5s",
|
|
29
26
|
}}
|
|
@@ -37,9 +34,7 @@ export const SearchBar = ({
|
|
|
37
34
|
>
|
|
38
35
|
<LabeledInput
|
|
39
36
|
aria-label="search-textbox"
|
|
40
|
-
placeholder={ReportsConfigWidget.localization.getLocalizedString(
|
|
41
|
-
"ReportsConfigWidget:Search"
|
|
42
|
-
)}
|
|
37
|
+
placeholder={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Search")}
|
|
43
38
|
svgIcon={
|
|
44
39
|
<IconButton
|
|
45
40
|
onClick={() => setSearchBarClosing(true)}
|
|
@@ -60,7 +55,8 @@ export const SearchBar = ({
|
|
|
60
55
|
styleType="borderless"
|
|
61
56
|
data-testid="rcw-search-button"
|
|
62
57
|
title={ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:SearchReport")}
|
|
63
|
-
onClick={() => setSearchBarOpened(true)}
|
|
58
|
+
onClick={() => setSearchBarOpened(true)}
|
|
59
|
+
>
|
|
64
60
|
<SvgSearch />
|
|
65
61
|
</IconButton>
|
|
66
62
|
);
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
6
6
|
import { AccessTokenAdapter } from "@itwin/imodels-access-frontend";
|
|
7
|
-
import type {
|
|
8
|
-
|
|
9
|
-
IModelsClient,
|
|
10
|
-
MinimalIModel,
|
|
11
|
-
} from "@itwin/imodels-client-management";
|
|
12
|
-
import {
|
|
13
|
-
toArray,
|
|
14
|
-
} from "@itwin/imodels-client-management";
|
|
7
|
+
import type { GetIModelListParams, IModelsClient, MinimalIModel } from "@itwin/imodels-client-management";
|
|
8
|
+
import { toArray } from "@itwin/imodels-client-management";
|
|
15
9
|
import { ComboBox, Label } from "@itwin/itwinui-react";
|
|
16
10
|
import React, { useEffect, useMemo, useState } from "react";
|
|
17
11
|
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
@@ -22,17 +16,15 @@ const fetchIModels = async (
|
|
|
22
16
|
setiModels: React.Dispatch<React.SetStateAction<MinimalIModel[]>>,
|
|
23
17
|
iTwinId: string,
|
|
24
18
|
iModelsClient: IModelsClient,
|
|
25
|
-
getAccessToken: () => Promise<AccessToken
|
|
19
|
+
getAccessToken: () => Promise<AccessToken>,
|
|
26
20
|
) => {
|
|
27
21
|
const accessToken = await getAccessToken();
|
|
28
22
|
const authorization = AccessTokenAdapter.toAuthorizationCallback(accessToken);
|
|
29
23
|
const getiModelListParams: GetIModelListParams = {
|
|
30
|
-
urlParams: {
|
|
24
|
+
urlParams: { iTwinId },
|
|
31
25
|
authorization,
|
|
32
26
|
};
|
|
33
|
-
const iModels = await toArray(
|
|
34
|
-
iModelsClient.iModels.getMinimalList(getiModelListParams)
|
|
35
|
-
);
|
|
27
|
+
const iModels = await toArray(iModelsClient.iModels.getMinimalList(getiModelListParams));
|
|
36
28
|
setiModels(iModels);
|
|
37
29
|
};
|
|
38
30
|
|
|
@@ -41,10 +33,7 @@ interface SelectedIModelProps {
|
|
|
41
33
|
setSelectedIModelId: (iModelId: string) => void;
|
|
42
34
|
}
|
|
43
35
|
|
|
44
|
-
export const SelectIModel = ({
|
|
45
|
-
selectedIModelId,
|
|
46
|
-
setSelectedIModelId,
|
|
47
|
-
}: SelectedIModelProps) => {
|
|
36
|
+
export const SelectIModel = ({ selectedIModelId, setSelectedIModelId }: SelectedIModelProps) => {
|
|
48
37
|
const { iTwinId, getAccessToken, iModelsClient } = useReportsConfigApi();
|
|
49
38
|
const [iModels, setIModels] = useState<MinimalIModel[]>([]);
|
|
50
39
|
|
|
@@ -61,11 +50,7 @@ export const SelectIModel = ({
|
|
|
61
50
|
|
|
62
51
|
return (
|
|
63
52
|
<div className="rcw-select-imodel">
|
|
64
|
-
<Label htmlFor="combo-input">
|
|
65
|
-
{ReportsConfigWidget.localization.getLocalizedString(
|
|
66
|
-
"ReportsConfigWidget:SelectIModel"
|
|
67
|
-
)}
|
|
68
|
-
</Label>
|
|
53
|
+
<Label htmlFor="combo-input">{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:SelectIModel")}</Label>
|
|
69
54
|
<div className="rcw-combobox">
|
|
70
55
|
<ComboBox<string>
|
|
71
56
|
options={iModelOptions}
|