@itwin/reports-config-widget-react 0.5.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 +47 -1
- package/CHANGELOG.md +14 -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 +505 -504
- package/coverage/coverage-final.json +32 -32
- package/coverage/lcov-report/index.html +24 -24
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +15 -15
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/test/index.html +11 -11
- package/coverage/lcov-report/src/test/test-utils.tsx.html +46 -16
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +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 +5 -5
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +13 -103
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +7 -22
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +7 -28
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +6 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +20 -47
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +20 -11
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +16 -79
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +15 -108
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +36 -75
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +62 -92
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +104 -128
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +86 -299
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +40 -202
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +59 -44
- 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 +13 -25
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +11 -56
- package/coverage/lcov-report/src/widget/components/index.html +50 -50
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +25 -169
- package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +6 -12
- package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +6 -12
- 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 +917 -893
- 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 +3 -3
- package/lib/cjs/reports-config-widget-react.js.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.js +11 -10
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
- package/lib/cjs/test/BulkExtractor.test.js +68 -43
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
- package/lib/cjs/test/DeleteModal.test.js +3 -3
- package/lib/cjs/test/DeleteModal.test.js.map +1 -1
- package/lib/cjs/test/ReportAction.test.js +6 -4
- package/lib/cjs/test/ReportAction.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +64 -25
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/cjs/test/ReportMappings.test.js +39 -18
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +3 -3
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +3 -3
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/test-utils.d.ts +8 -0
- package/lib/cjs/test/test-utils.d.ts.map +1 -1
- package/lib/cjs/test/test-utils.js +16 -4
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +7 -0
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +8 -3
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js +7 -7
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.scss +1 -1
- package/lib/cjs/widget/components/BulkExtractor.d.ts +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.map +1 -1
- package/lib/cjs/widget/components/Constants.js +3 -3
- package/lib/cjs/widget/components/Constants.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js +5 -5
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.scss +2 -2
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.js +9 -9
- package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.scss +1 -1
- package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionToast.js +3 -3
- package/lib/cjs/widget/components/ExtractionToast.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.js +1 -2
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.scss +1 -4
- package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.d.ts +8 -0
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js +9 -7
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.scss +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js +4 -4
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +46 -45
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts +8 -0
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js +25 -11
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/Reports.d.ts +9 -1
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js +7 -8
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/Reports.scss +0 -1
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts +8 -0
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.js +13 -5
- 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 +2 -4
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.scss +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsHeader.js +6 -7
- package/lib/cjs/widget/components/ReportsHeader.js.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.js +3 -3
- package/lib/cjs/widget/components/ReportsRouter.js.map +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts +1 -1
- package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -1
- package/lib/cjs/widget/components/SearchBar.js +4 -4
- package/lib/cjs/widget/components/SearchBar.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +1 -1
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.scss +1 -1
- package/lib/cjs/widget/components/utils.d.ts +1 -1
- package/lib/cjs/widget/components/utils.d.ts.map +1 -1
- package/lib/cjs/widget/components/utils.js +5 -5
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.d.ts +1 -4
- package/lib/cjs/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.js +3 -3
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
- package/lib/esm/ReportsConfigWidget.d.ts +4 -0
- package/lib/esm/ReportsConfigWidget.d.ts.map +1 -1
- package/lib/esm/ReportsConfigWidget.js +4 -0
- package/lib/esm/ReportsConfigWidget.js.map +1 -1
- package/lib/esm/reports-config-widget-react.js +3 -3
- package/lib/esm/reports-config-widget-react.js.map +1 -1
- package/lib/esm/test/AddMappingModal.test.js +12 -11
- package/lib/esm/test/AddMappingModal.test.js.map +1 -1
- package/lib/esm/test/BulkExtractor.test.js +69 -44
- package/lib/esm/test/BulkExtractor.test.js.map +1 -1
- package/lib/esm/test/DeleteModal.test.js +4 -4
- package/lib/esm/test/DeleteModal.test.js.map +1 -1
- package/lib/esm/test/ReportAction.test.js +7 -5
- package/lib/esm/test/ReportAction.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +65 -26
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/esm/test/ReportMappings.test.js +41 -20
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +4 -4
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +3 -3
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/test-utils.d.ts +8 -0
- package/lib/esm/test/test-utils.d.ts.map +1 -1
- package/lib/esm/test/test-utils.js +15 -3
- package/lib/esm/test/test-utils.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts +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.map +1 -1
- package/lib/esm/widget/components/Constants.js +3 -3
- package/lib/esm/widget/components/Constants.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/esm/widget/components/DeleteModal.js +6 -6
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.scss +2 -2
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js +3 -3
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.js +9 -9
- package/lib/esm/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.scss +1 -1
- package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionToast.js +3 -3
- package/lib/esm/widget/components/ExtractionToast.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.js +1 -2
- package/lib/esm/widget/components/HorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.scss +1 -4
- package/lib/esm/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.d.ts +8 -0
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.js +10 -8
- package/lib/esm/widget/components/ReportAction.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.scss +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.js +6 -6
- package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js +47 -46
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.d.ts +8 -0
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js +28 -14
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/Reports.d.ts +9 -1
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js +8 -9
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/Reports.scss +0 -1
- package/lib/esm/widget/components/ReportsConfigContext.d.ts +8 -0
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.js +14 -6
- 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 +2 -2
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.scss +1 -1
- package/lib/esm/widget/components/utils.d.ts +1 -1
- package/lib/esm/widget/components/utils.d.ts.map +1 -1
- package/lib/esm/widget/components/utils.js +6 -6
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/esm/widget/hooks/useValidator.d.ts +1 -4
- package/lib/esm/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/esm/widget/hooks/useValidator.js +3 -3
- package/lib/esm/widget/hooks/useValidator.js.map +1 -1
- package/package.json +9 -4
- package/src/ReportsConfigWidget.ts +9 -9
- package/src/reports-config-widget-react.ts +3 -3
- package/src/test/AddMappingModal.test.tsx +45 -70
- package/src/test/BulkExtractor.test.ts +73 -118
- package/src/test/DeleteModal.test.tsx +6 -23
- package/src/test/ReportAction.test.tsx +20 -38
- package/src/test/ReportMappingHorizontalTile.test.tsx +137 -106
- package/src/test/ReportMappings.test.tsx +73 -88
- package/src/test/Reports.test.tsx +30 -64
- package/src/test/WidgetHeader.test.tsx +3 -3
- package/src/test/test-utils.tsx +18 -8
- package/src/widget/ReportsConfigUiProvider.tsx +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 +4 -4
- package/src/widget/components/DeleteModal.scss +2 -2
- package/src/widget/components/DeleteModal.tsx +11 -41
- package/src/widget/components/ExtractionStates/FailedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/QueuedExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/RunningExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStates/StartingExtractionState.tsx +4 -11
- package/src/widget/components/ExtractionStates/SucceededExtractionState.tsx +4 -9
- package/src/widget/components/ExtractionStatus.scss +1 -1
- package/src/widget/components/ExtractionStatus.tsx +9 -18
- package/src/widget/components/ExtractionToast.tsx +12 -9
- package/src/widget/components/HorizontalTile.scss +1 -4
- package/src/widget/components/HorizontalTile.tsx +12 -33
- package/src/widget/components/LocalizedTablePaginator.tsx +13 -44
- package/src/widget/components/ReportAction.scss +1 -1
- package/src/widget/components/ReportAction.tsx +26 -39
- package/src/widget/components/ReportHorizontalTile.tsx +45 -55
- package/src/widget/components/ReportMappingHorizontalTile.tsx +70 -78
- package/src/widget/components/ReportMappings.tsx +59 -130
- package/src/widget/components/Reports.scss +0 -1
- package/src/widget/components/Reports.tsx +28 -82
- package/src/widget/components/ReportsConfigContext.tsx +30 -25
- 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 +9 -24
- package/src/widget/components/utils.scss +1 -1
- package/src/widget/components/utils.tsx +21 -69
- package/src/widget/context/BulkExtractorContext.tsx +4 -6
- package/src/widget/context/ReportsConfigApiContext.tsx +4 -6
- package/src/widget/hooks/useValidator.ts +10 -24
- package/tsconfig.json +11 -11
|
@@ -25,9 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ReportsConfigContext = void 0;
|
|
27
27
|
/*---------------------------------------------------------------------------------------------
|
|
28
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
-
*--------------------------------------------------------------------------------------------*/
|
|
28
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
+
*--------------------------------------------------------------------------------------------*/
|
|
31
31
|
const core_frontend_1 = require("@itwin/core-frontend");
|
|
32
32
|
const imodels_client_management_1 = require("@itwin/imodels-client-management");
|
|
33
33
|
const insights_client_1 = require("@itwin/insights-client");
|
|
@@ -41,8 +41,13 @@ const Constants_1 = require("./Constants");
|
|
|
41
41
|
const ExtractionToast_1 = require("./ExtractionToast");
|
|
42
42
|
const utils_1 = require("./utils");
|
|
43
43
|
const authorizationClientGetAccessToken = async () => (await core_frontend_1.IModelApp.authorizationClient?.getAccessToken()) ?? "";
|
|
44
|
+
/**
|
|
45
|
+
* Reports Config context providers required for all components.
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
44
48
|
const ReportsConfigContext = (props) => {
|
|
45
49
|
const reportsBaseUrl = (0, react_1.useCallback)(() => (0, utils_1.generateUrl)(insights_client_1.REPORTING_BASE_PATH, props.baseUrl || ReportsConfigUiProvider_1.REPORTS_CONFIG_BASE_URL), [props.baseUrl]);
|
|
50
|
+
const groupingMappingBaseUrl = (0, react_1.useCallback)(() => (0, utils_1.generateUrl)(insights_client_1.GROUPING_AND_MAPPING_BASE_PATH, props.baseUrl || ReportsConfigUiProvider_1.REPORTS_CONFIG_BASE_URL), [props.baseUrl]);
|
|
46
51
|
const iModelClientOptions = (0, react_1.useMemo)(() => ({
|
|
47
52
|
api: { baseUrl: (0, utils_1.generateUrl)(Constants_1.IMODELS_BASE_URL, props.baseUrl ?? ReportsConfigUiProvider_1.REPORTS_CONFIG_BASE_URL) },
|
|
48
53
|
}), [props.baseUrl]);
|
|
@@ -52,7 +57,7 @@ const ReportsConfigContext = (props) => {
|
|
|
52
57
|
baseUrl: reportsBaseUrl(),
|
|
53
58
|
iTwinId: props.iTwinId,
|
|
54
59
|
reportsClient: props.reportsClient ?? new insights_client_1.ReportsClient(reportsBaseUrl()),
|
|
55
|
-
mappingsClient: props.mappingsClient ?? new insights_client_1.MappingsClient(
|
|
60
|
+
mappingsClient: props.mappingsClient ?? new insights_client_1.MappingsClient(groupingMappingBaseUrl()),
|
|
56
61
|
iModelsClient: props.iModelsClient ?? new imodels_client_management_1.IModelsClient(iModelClientOptions),
|
|
57
62
|
});
|
|
58
63
|
(0, react_1.useEffect)(() => {
|
|
@@ -66,7 +71,10 @@ const ReportsConfigContext = (props) => {
|
|
|
66
71
|
const failedExtractionToast = (iModelName) => {
|
|
67
72
|
itwinui_react_1.toaster.negative(react_1.default.createElement(ExtractionToast_1.FailedExtractionToast, { iModelName: iModelName }));
|
|
68
73
|
};
|
|
69
|
-
const bulkExtractor = (0, react_1.useMemo)(() => ({
|
|
74
|
+
const bulkExtractor = (0, react_1.useMemo)(() => ({
|
|
75
|
+
bulkExtractor: props.bulkExtractor ??
|
|
76
|
+
new BulkExtractor_1.BulkExtractor(apiConfig.reportsClient, extractionClient, apiConfig.getAccessToken, successfulExtractionToast, failedExtractionToast),
|
|
77
|
+
}), [apiConfig.getAccessToken, apiConfig.reportsClient, extractionClient, props.bulkExtractor]);
|
|
70
78
|
(0, react_1.useEffect)(() => {
|
|
71
79
|
setApiConfig(() => ({
|
|
72
80
|
getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsConfigContext.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsConfigContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"ReportsConfigContext.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsConfigContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,wDAAiD;AAEjD,gFAAiE;A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,EAAE,KAAK,CAAC,aAAa,CAAC,CAC3F,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC;YAClB,cAAc,EAAE,KAAK,CAAC,cAAc,IAAI,iCAAiC;YACzE,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,iDAAuB;YACjD,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,IAAI,+BAAa,CAAC,cAAc,EAAE,CAAC;YACzE,cAAc,EAAE,KAAK,CAAC,cAAc,IAAI,IAAI,gCAAc,CAAC,cAAc,EAAE,CAAC;YAC5E,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,IAAI,yCAAa,CAAC,mBAAmB,CAAC;SAC7E,CAAC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,aAAa,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAE9J,OAAO,CACL,8BAAC,iDAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS;QAChD,8BAAC,2CAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,IAAG,KAAK,CAAC,QAAQ,CAAiC,CACpE,CACpC,CAAC;AACJ,CAAC,CAAC;AA3DW,QAAA,oBAAoB,wBA2D/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { IModelsClientOptions } from \"@itwin/imodels-client-management\";\nimport { IModelsClient } from \"@itwin/imodels-client-management\";\nimport { ExtractionClient, GROUPING_AND_MAPPING_BASE_PATH, MappingsClient, REPORTING_BASE_PATH, ReportsClient } from \"@itwin/insights-client\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { BulkExtractorContext } from \"../context/BulkExtractorContext\";\nimport type { GetAccessTokenFn, ReportsConfigApiProps } from \"../context/ReportsConfigApiContext\";\nimport { ReportsConfigApiContext } from \"../context/ReportsConfigApiContext\";\nimport { REPORTS_CONFIG_BASE_URL } from \"../ReportsConfigUiProvider\";\nimport { BulkExtractor } from \"./BulkExtractor\";\nimport { IMODELS_BASE_URL } from \"./Constants\";\nimport { FailedExtractionToast, SuccessfulExtractionToast } from \"./ExtractionToast\";\nimport { generateUrl } from \"./utils\";\n\n/**\n * Props for the {@link ReportsConfigContext} component.\n * @public\n */\nexport interface ReportsConfigContextProps {\n getAccessToken?: GetAccessTokenFn;\n baseUrl?: string;\n iTwinId: string;\n bulkExtractor?: BulkExtractor;\n reportsClient?: ReportsClient;\n mappingsClient?: MappingsClient;\n extractionClient?: ExtractionClient;\n iModelsClient?: IModelsClient;\n children?: React.ReactNode;\n}\n\nconst authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? \"\";\n\n/**\n * Reports Config context providers required for all components.\n * @public\n */\nexport const ReportsConfigContext = (props: ReportsConfigContextProps) => {\n const reportsBaseUrl = useCallback(() => generateUrl(REPORTING_BASE_PATH, props.baseUrl || REPORTS_CONFIG_BASE_URL), [props.baseUrl]);\n const groupingMappingBaseUrl = useCallback(() => generateUrl(GROUPING_AND_MAPPING_BASE_PATH, props.baseUrl || REPORTS_CONFIG_BASE_URL), [props.baseUrl]);\n const iModelClientOptions: IModelsClientOptions = useMemo(\n () => ({\n api: { baseUrl: generateUrl(IMODELS_BASE_URL, props.baseUrl ?? REPORTS_CONFIG_BASE_URL) },\n }),\n [props.baseUrl],\n );\n const [extractionClient, setExtractionClient] = useState<ExtractionClient>(props.extractionClient ?? new ExtractionClient(reportsBaseUrl()));\n\n const [apiConfig, setApiConfig] = useState<ReportsConfigApiProps>({\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n baseUrl: reportsBaseUrl(),\n iTwinId: props.iTwinId,\n reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),\n mappingsClient: props.mappingsClient ?? new MappingsClient(groupingMappingBaseUrl()),\n iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),\n });\n\n useEffect(() => {\n if (!props.extractionClient) {\n setExtractionClient(props.extractionClient ?? new ExtractionClient(reportsBaseUrl()));\n }\n }, [props.extractionClient, reportsBaseUrl]);\n\n const successfulExtractionToast = (iModelName: string, odataFeedUrl: string) => {\n toaster.positive(<SuccessfulExtractionToast iModelName={iModelName} odataFeedUrl={odataFeedUrl} />);\n };\n\n const failedExtractionToast = (iModelName: string) => {\n toaster.negative(<FailedExtractionToast iModelName={iModelName} />);\n };\n\n const bulkExtractor = useMemo(\n () => ({\n bulkExtractor:\n props.bulkExtractor ??\n new BulkExtractor(apiConfig.reportsClient, extractionClient, apiConfig.getAccessToken, successfulExtractionToast, failedExtractionToast),\n }),\n [apiConfig.getAccessToken, apiConfig.reportsClient, extractionClient, props.bulkExtractor],\n );\n\n useEffect(() => {\n setApiConfig(() => ({\n getAccessToken: props.getAccessToken ?? authorizationClientGetAccessToken,\n baseUrl: props.baseUrl || REPORTS_CONFIG_BASE_URL,\n iTwinId: props.iTwinId,\n reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),\n mappingsClient: props.mappingsClient ?? new MappingsClient(reportsBaseUrl()),\n iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),\n }));\n }, [props.getAccessToken, props.baseUrl, props.iTwinId, props.reportsClient, props.mappingsClient, props.iModelsClient, reportsBaseUrl, iModelClientOptions]);\n\n return (\n <ReportsConfigApiContext.Provider value={apiConfig}>\n <BulkExtractorContext.Provider value={bulkExtractor}>{props.children}</BulkExtractorContext.Provider>\n </ReportsConfigApiContext.Provider>\n );\n};\n"]}
|
|
@@ -19,6 +19,6 @@ export interface Route {
|
|
|
19
19
|
title: string;
|
|
20
20
|
reportsRoutingFields: ReportsRouteFields;
|
|
21
21
|
}
|
|
22
|
-
declare const ReportsContainer: ({ getAccessToken, baseUrl
|
|
22
|
+
declare const ReportsContainer: ({ getAccessToken, baseUrl }: ReportsContainerProps) => JSX.Element;
|
|
23
23
|
export default ReportsContainer;
|
|
24
24
|
//# sourceMappingURL=ReportsContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsContainer.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsContainer.tsx"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAMrD,UAAU,qBAAqB;IAC7B,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oBAAY,SAAS;IACnB,WAAW,IAAA;IACX,YAAY,IAAA;IACZ,cAAc,IAAA;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB,EAAE,kBAAkB,CAAC;CAC1C;AAED,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ReportsContainer.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsContainer.tsx"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAMrD,UAAU,qBAAqB;IAC7B,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oBAAY,SAAS;IACnB,WAAW,IAAA;IACX,YAAY,IAAA;IACZ,cAAc,IAAA;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB,EAAE,kBAAkB,CAAC;CAC1C;AAED,QAAA,MAAM,gBAAgB,gCAAiC,qBAAqB,gBAsB3E,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -36,10 +36,8 @@ var RouteStep;
|
|
|
36
36
|
RouteStep[RouteStep["ReportAction"] = 1] = "ReportAction";
|
|
37
37
|
RouteStep[RouteStep["ReportMappings"] = 2] = "ReportMappings";
|
|
38
38
|
})(RouteStep = exports.RouteStep || (exports.RouteStep = {}));
|
|
39
|
-
const ReportsContainer = ({ getAccessToken, baseUrl
|
|
40
|
-
const [routingHistory, setRoutingHistory] = (0, react_1.useState)([
|
|
41
|
-
{ step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} },
|
|
42
|
-
]);
|
|
39
|
+
const ReportsContainer = ({ getAccessToken, baseUrl }) => {
|
|
40
|
+
const [routingHistory, setRoutingHistory] = (0, react_1.useState)([{ step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} }]);
|
|
43
41
|
const currentRoute = routingHistory[routingHistory.length - 1];
|
|
44
42
|
const iTwinId = (0, appui_react_1.useActiveIModelConnection)()?.iTwinId ?? "";
|
|
45
43
|
const navigateTo = (0, react_1.useCallback)((toRoute) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsContainer.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsContainer.tsx"],"names":[],"mappings":";;;;;;;;;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AAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,MAAM,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC9B,MAAM,cAAc,GAAG,CAAC,GAAG,cAAc,CAAC,CAAC;QAC3C,cAAc,CAAC,GAAG,EAAE,CAAC;QACrB,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,8BAAC,2CAAoB,IAAC,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;QACtF,uCAAK,SAAS,EAAC,uBAAuB;YACpC,8BAAC,6BAAa,IAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAI;YAC7D,8BAAC,6BAAa,IAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAI,CACjF,CACe,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport React, { useCallback, useState } from \"react\";\nimport \"./ReportsContainer.scss\";\nimport type { Report } from \"@itwin/insights-client\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { ReportsHeader } from \"./ReportsHeader\";\nimport { ReportsRouter } from \"./ReportsRouter\";\nimport { ReportsConfigContext } from \"./ReportsConfigContext\";\n\ninterface ReportsContainerProps {\n getAccessToken?: () => Promise<AccessToken>;\n baseUrl: string;\n}\n\nexport enum RouteStep {\n ReportsList,\n ReportAction,\n ReportMappings,\n}\n\nexport interface ReportsRouteFields {\n report?: Report;\n}\n\nexport interface Route {\n step: RouteStep;\n title: string;\n reportsRoutingFields: ReportsRouteFields;\n}\n\nconst ReportsContainer = ({ getAccessToken, baseUrl }: ReportsContainerProps) => {\n const [routingHistory, setRoutingHistory] = useState<Route[]>([{ step: RouteStep.ReportsList, title: \"iTwin Reports\", reportsRoutingFields: {} }]);\n const currentRoute = routingHistory[routingHistory.length - 1];\n const iTwinId = useActiveIModelConnection()?.iTwinId ?? \"\";\n const navigateTo = useCallback((toRoute: (prev: Route | undefined) => Route) => {\n setRoutingHistory((r) => [...r, toRoute(r[r.length - 1])]);\n }, []);\n\n const goBack = useCallback(() => {\n const updatedRouting = [...routingHistory];\n updatedRouting.pop();\n setRoutingHistory(updatedRouting);\n }, [routingHistory]);\n\n return (\n <ReportsConfigContext getAccessToken={getAccessToken} baseUrl={baseUrl} iTwinId={iTwinId}>\n <div className=\"rcw-reports-container\">\n <ReportsHeader goBack={goBack} currentRoute={currentRoute} />\n <ReportsRouter currentRoute={currentRoute} navigateTo={navigateTo} goBack={goBack} />\n </div>\n </ReportsConfigContext>\n );\n};\n\nexport default ReportsContainer;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Route } from "./ReportsContainer";
|
|
3
|
-
export declare const ReportsHeader: ({ goBack, currentRoute
|
|
3
|
+
export declare const ReportsHeader: ({ goBack, currentRoute }: {
|
|
4
4
|
goBack: () => void;
|
|
5
5
|
currentRoute: Route;
|
|
6
6
|
}) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsHeader.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsHeader.tsx"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAIhD,eAAO,MAAM,aAAa;
|
|
1
|
+
{"version":3,"file":"ReportsHeader.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsHeader.tsx"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAIhD,eAAO,MAAM,aAAa;YAAwC,MAAM,IAAI;kBAAgB,KAAK;iBAIhG,CAAC"}
|
|
@@ -5,16 +5,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ReportsHeader = void 0;
|
|
7
7
|
/*---------------------------------------------------------------------------------------------
|
|
8
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
11
|
const react_1 = __importDefault(require("react"));
|
|
12
12
|
const ReportsContainer_1 = require("./ReportsContainer");
|
|
13
13
|
const utils_1 = require("./utils");
|
|
14
|
-
const ReportsHeader = ({ goBack, currentRoute
|
|
15
|
-
const shouldDisableReturnFn = currentRoute.step === ReportsContainer_1.RouteStep.ReportsList ||
|
|
16
|
-
|
|
17
|
-
return (react_1.default.createElement(utils_1.WidgetHeader, { returnFn: shouldDisableReturnFn ? undefined : goBack, title: currentRoute.title }));
|
|
14
|
+
const ReportsHeader = ({ goBack, currentRoute }) => {
|
|
15
|
+
const shouldDisableReturnFn = currentRoute.step === ReportsContainer_1.RouteStep.ReportsList || currentRoute.step === ReportsContainer_1.RouteStep.ReportAction;
|
|
16
|
+
return react_1.default.createElement(utils_1.WidgetHeader, { returnFn: shouldDisableReturnFn ? undefined : goBack, title: currentRoute.title });
|
|
18
17
|
};
|
|
19
18
|
exports.ReportsHeader = ReportsHeader;
|
|
20
19
|
//# sourceMappingURL=ReportsHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsHeader.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsHeader.tsx"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"ReportsHeader.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsHeader.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,kDAA0B;AAE1B,yDAA+C;AAC/C,mCAAuC;AAEhC,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAE,YAAY,EAA+C,EAAE,EAAE;IACrG,MAAM,qBAAqB,GAAG,YAAY,CAAC,IAAI,KAAK,4BAAS,CAAC,WAAW,IAAI,YAAY,CAAC,IAAI,KAAK,4BAAS,CAAC,YAAY,CAAC;IAE1H,OAAO,8BAAC,oBAAY,IAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,GAAI,CAAC;AAC3G,CAAC,CAAC;AAJW,QAAA,aAAa,iBAIxB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport type { Route } from \"./ReportsContainer\";\nimport { RouteStep } from \"./ReportsContainer\";\nimport { WidgetHeader } from \"./utils\";\n\nexport const ReportsHeader = ({ goBack, currentRoute }: { goBack: () => void; currentRoute: Route }) => {\n const shouldDisableReturnFn = currentRoute.step === RouteStep.ReportsList || currentRoute.step === RouteStep.ReportAction;\n\n return <WidgetHeader returnFn={shouldDisableReturnFn ? undefined : goBack} title={currentRoute.title} />;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsRouter.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsRouter.tsx"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGhD,eAAO,MAAM,aAAa;kBAKV,KAAK;iCACU,KAAK,GAAG,SAAS,KAAK,KAAK,KAAK,IAAI;YACzD,MAAM,IAAI;
|
|
1
|
+
{"version":3,"file":"ReportsRouter.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/ReportsRouter.tsx"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGhD,eAAO,MAAM,aAAa;kBAKV,KAAK;iCACU,KAAK,GAAG,SAAS,KAAK,KAAK,KAAK,IAAI;YACzD,MAAM,IAAI;wBAwCnB,CAAC"}
|
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ReportsRouter = void 0;
|
|
7
7
|
/*---------------------------------------------------------------------------------------------
|
|
8
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
11
|
const appui_react_1 = require("@itwin/appui-react");
|
|
12
12
|
const react_1 = __importDefault(require("react"));
|
|
13
13
|
const ReportsConfigWidget_1 = require("../../ReportsConfigWidget");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsRouter.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsRouter.tsx"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"ReportsRouter.js","sourceRoot":"","sources":["../../../../src/widget/components/ReportsRouter.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,oDAA+D;AAC/D,kDAA0B;AAC1B,mEAA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E,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAI,CAAC;QACxF,KAAK,4BAAS,CAAC,cAAc;YAC3B,IAAI,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAC;YACzB,OAAO,8BAAC,+BAAc,IAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,GAAI,CAAC;QAC7F;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC;AA/CW,QAAA,aAAa,iBA+CxB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\nimport { ReportAction } from \"./ReportAction\";\nimport { ReportMappings } from \"./ReportMappings\";\nimport { Reports } from \"./Reports\";\nimport type { Route } from \"./ReportsContainer\";\nimport { RouteStep } from \"./ReportsContainer\";\n\nexport const ReportsRouter = ({\n currentRoute,\n navigateTo,\n goBack,\n}: {\n currentRoute: Route;\n navigateTo: (toRoute: (prev: Route | undefined) => Route) => void;\n goBack: () => void;\n}) => {\n const { report } = currentRoute.reportsRoutingFields;\n const iModelId = useActiveIModelConnection()?.iModelId ?? \"\";\n switch (currentRoute.step) {\n case RouteStep.ReportsList:\n return (\n <Reports\n onClickAddReport={() =>\n navigateTo(() => ({\n step: RouteStep.ReportAction,\n title: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ITwinReports\"),\n reportsRoutingFields: {},\n }))\n }\n onClickReportTitle={(r) => {\n navigateTo(() => ({\n step: RouteStep.ReportMappings,\n reportsRoutingFields: { report: r },\n title: r.displayName,\n }));\n }}\n onClickReportModify={(r) => {\n navigateTo(() => ({\n step: RouteStep.ReportAction,\n reportsRoutingFields: { report: r },\n title: r.displayName,\n }));\n }}\n />\n );\n\n case RouteStep.ReportAction:\n return <ReportAction report={report} onClickCancel={goBack} onSaveSuccess={goBack} />;\n case RouteStep.ReportMappings:\n if (!report) return null;\n return <ReportMappings report={report} onClickClose={goBack} defaultIModelId={iModelId} />;\n default:\n return null;\n }\n};\n"]}
|
|
@@ -5,6 +5,6 @@ interface SearchBarProps {
|
|
|
5
5
|
setSearchValue: React.Dispatch<React.SetStateAction<string>>;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const SearchBar: ({ searchValue, setSearchValue, disabled
|
|
8
|
+
export declare const SearchBar: ({ searchValue, setSearchValue, disabled }: SearchBarProps) => JSX.Element;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=SearchBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/SearchBar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,kBAAkB,CAAC;AAE1B,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/SearchBar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,kBAAkB,CAAC;AAE1B,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,8CAA+C,cAAc,gBA8ClF,CAAC"}
|
|
@@ -25,15 +25,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.SearchBar = void 0;
|
|
27
27
|
/*---------------------------------------------------------------------------------------------
|
|
28
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
-
*--------------------------------------------------------------------------------------------*/
|
|
28
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
+
*--------------------------------------------------------------------------------------------*/
|
|
31
31
|
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
32
32
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
33
33
|
const react_1 = __importStar(require("react"));
|
|
34
34
|
const ReportsConfigWidget_1 = require("../../ReportsConfigWidget");
|
|
35
35
|
require("./SearchBar.scss");
|
|
36
|
-
const SearchBar = ({ searchValue, setSearchValue, disabled
|
|
36
|
+
const SearchBar = ({ searchValue, setSearchValue, disabled }) => {
|
|
37
37
|
const [searchBarOpen, setSearchBarOpened] = (0, react_1.useState)(false);
|
|
38
38
|
const [searchBarClosing, setSearchBarClosing] = (0, react_1.useState)(false);
|
|
39
39
|
return searchBarOpen || searchValue ? (react_1.default.createElement("div", { className: "rcw-search-button", style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../../src/widget/components/SearchBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../../src/widget/components/SearchBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,oEAAsE;AACtE,wDAAgE;AACh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,8BAAC,0BAAU,IACT,SAAS,EAAC,YAAY,iBACV,mBAAmB,EAC/B,KAAK,EAAE,yCAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,EAC9F,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;QAEvC,8BAAC,+BAAS,OAAG,CACF,CACd,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,SAAS,aA8CpB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { SvgCloseSmall, SvgSearch } from \"@itwin/itwinui-icons-react\";\nimport { IconButton, LabeledInput } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\nimport \"./SearchBar.scss\";\n\ninterface SearchBarProps {\n searchValue: string;\n setSearchValue: React.Dispatch<React.SetStateAction<string>>;\n disabled?: boolean;\n}\n\nexport const SearchBar = ({ searchValue, setSearchValue, disabled }: SearchBarProps) => {\n const [searchBarOpen, setSearchBarOpened] = useState<boolean>(false);\n const [searchBarClosing, setSearchBarClosing] = useState<boolean>(false);\n\n return searchBarOpen || searchValue ? (\n <div\n className=\"rcw-search-button\"\n style={{\n animation: searchBarClosing ? \"rcw-shrink .5s\" : \"rcw-expand .5s\",\n }}\n onAnimationEnd={() => {\n if (searchBarClosing) {\n setSearchBarClosing(false);\n setSearchBarOpened(false);\n setSearchValue(\"\");\n }\n }}\n >\n <LabeledInput\n aria-label=\"search-textbox\"\n placeholder={ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Search\")}\n svgIcon={\n <IconButton\n onClick={() => setSearchBarClosing(true)}\n styleType=\"borderless\"\n title={ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ClearSearch\")}\n >\n <SvgCloseSmall />\n </IconButton>\n }\n iconDisplayStyle=\"inline\"\n value={searchValue}\n onChange={(e) => setSearchValue(e.target.value)}\n disabled={disabled}\n />\n </div>\n ) : (\n <IconButton\n styleType=\"borderless\"\n data-testid=\"rcw-search-button\"\n title={ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:SearchReport\")}\n onClick={() => setSearchBarOpened(true)}\n >\n <SvgSearch />\n </IconButton>\n );\n};\n"]}
|
|
@@ -4,6 +4,6 @@ interface SelectedIModelProps {
|
|
|
4
4
|
selectedIModelId?: string;
|
|
5
5
|
setSelectedIModelId: (iModelId: string) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare const SelectIModel: ({ selectedIModelId, setSelectedIModelId
|
|
7
|
+
export declare const SelectIModel: ({ selectedIModelId, setSelectedIModelId }: SelectedIModelProps) => JSX.Element;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=SelectIModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectIModel.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/SelectIModel.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SelectIModel.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/SelectIModel.tsx"],"names":[],"mappings":";AAYA,OAAO,qBAAqB,CAAC;AAkB7B,UAAU,mBAAmB;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD;AAED,eAAO,MAAM,YAAY,8CAA+C,mBAAmB,gBAiC1F,CAAC"}
|
|
@@ -41,7 +41,7 @@ const fetchIModels = async (setiModels, iTwinId, iModelsClient, getAccessToken)
|
|
|
41
41
|
const iModels = await (0, imodels_client_management_1.toArray)(iModelsClient.iModels.getMinimalList(getiModelListParams));
|
|
42
42
|
setiModels(iModels);
|
|
43
43
|
};
|
|
44
|
-
const SelectIModel = ({ selectedIModelId, setSelectedIModelId
|
|
44
|
+
const SelectIModel = ({ selectedIModelId, setSelectedIModelId }) => {
|
|
45
45
|
const { iTwinId, getAccessToken, iModelsClient } = (0, ReportsConfigApiContext_1.useReportsConfigApi)();
|
|
46
46
|
const [iModels, setIModels] = (0, react_1.useState)([]);
|
|
47
47
|
(0, react_1.useEffect)(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectIModel.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectIModel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,4EAAoE;
|
|
1
|
+
{"version":3,"file":"SelectIModel.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectIModel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,4EAAoE;AAEpE,gFAA2D;AAC3D,wDAAuD;AACvD,+CAA4D;AAC5D,mEAAgE;AAChE,gFAAyE;AACzE,+BAA6B;AAE7B,MAAM,YAAY,GAAG,KAAK,EACxB,UAAiE,EACjE,OAAe,EACf,aAA4B,EAC5B,cAA0C,EAC1C,EAAE;IACF,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;IAC3C,MAAM,aAAa,GAAG,4CAAkB,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAC9E,MAAM,mBAAmB,GAAwB;QAC/C,SAAS,EAAE,EAAE,OAAO,EAAE;QACtB,aAAa;KACd,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,IAAA,mCAAO,EAAC,aAAa,CAAC,OAAO,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACzF,UAAU,CAAC,OAAO,CAAC,CAAC;AACtB,CAAC,CAAC;AAOK,MAAM,YAAY,GAAG,CAAC,EAAE,gBAAgB,EAAE,mBAAmB,EAAuB,EAAE,EAAE;IAC7F,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,IAAA,6CAAmB,GAAE,CAAC;IACzE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAkB,EAAE,CAAC,CAAC;IAE5D,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,KAAK,YAAY,CAAC,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;IACxE,CAAC,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;IAEzD,MAAM,aAAa,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACjC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC9B,KAAK,EAAE,MAAM,CAAC,WAAW;YACzB,KAAK,EAAE,MAAM,CAAC,EAAE;SACjB,CAAC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACL,uCAAK,SAAS,EAAC,mBAAmB;QAChC,8BAAC,qBAAK,IAAC,OAAO,EAAC,aAAa,IAAE,yCAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAS;QAC9H,uCAAK,SAAS,EAAC,cAAc;YAC3B,8BAAC,wBAAQ,IACP,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBAClB,mBAAmB,CAAC,KAAK,CAAC,CAAC;gBAC7B,CAAC,EACD,UAAU,EAAE;oBACV,EAAE,EAAE,aAAa;iBAClB,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GACzC,CACE,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAjCW,QAAA,YAAY,gBAiCvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport { AccessTokenAdapter } from \"@itwin/imodels-access-frontend\";\nimport type { GetIModelListParams, IModelsClient, MinimalIModel } from \"@itwin/imodels-client-management\";\nimport { toArray } from \"@itwin/imodels-client-management\";\nimport { ComboBox, Label } from \"@itwin/itwinui-react\";\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\nimport { useReportsConfigApi } from \"../context/ReportsConfigApiContext\";\nimport \"./SelectIModel.scss\";\n\nconst fetchIModels = async (\n setiModels: React.Dispatch<React.SetStateAction<MinimalIModel[]>>,\n iTwinId: string,\n iModelsClient: IModelsClient,\n getAccessToken: () => Promise<AccessToken>,\n) => {\n const accessToken = await getAccessToken();\n const authorization = AccessTokenAdapter.toAuthorizationCallback(accessToken);\n const getiModelListParams: GetIModelListParams = {\n urlParams: { iTwinId },\n authorization,\n };\n const iModels = await toArray(iModelsClient.iModels.getMinimalList(getiModelListParams));\n setiModels(iModels);\n};\n\ninterface SelectedIModelProps {\n selectedIModelId?: string;\n setSelectedIModelId: (iModelId: string) => void;\n}\n\nexport const SelectIModel = ({ selectedIModelId, setSelectedIModelId }: SelectedIModelProps) => {\n const { iTwinId, getAccessToken, iModelsClient } = useReportsConfigApi();\n const [iModels, setIModels] = useState<MinimalIModel[]>([]);\n\n useEffect(() => {\n void fetchIModels(setIModels, iTwinId, iModelsClient, getAccessToken);\n }, [getAccessToken, iModelsClient, iTwinId, setIModels]);\n\n const iModelOptions = useMemo(() => {\n return iModels.map((iModel) => ({\n label: iModel.displayName,\n value: iModel.id,\n }));\n }, [iModels]);\n\n return (\n <div className=\"rcw-select-imodel\">\n <Label htmlFor=\"combo-input\">{ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:SelectIModel\")}</Label>\n <div className=\"rcw-combobox\">\n <ComboBox<string>\n options={iModelOptions}\n value={selectedIModelId}\n onChange={(value) => {\n setSelectedIModelId(value);\n }}\n inputProps={{\n id: \"combo-input\",\n }}\n style={{ flexGrow: 1, maxWidth: \"395px\" }}\n />\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -5,7 +5,7 @@ export interface WidgetHeaderProps {
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
returnFn?: () => void;
|
|
7
7
|
}
|
|
8
|
-
export declare const WidgetHeader: ({ title, disabled, returnFn
|
|
8
|
+
export declare const WidgetHeader: ({ title, disabled, returnFn }: WidgetHeaderProps) => JSX.Element;
|
|
9
9
|
export declare const handleError: (errorStatus: number) => void;
|
|
10
10
|
export declare const LoadingOverlay: () => JSX.Element;
|
|
11
11
|
interface EmptyMessageProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":"AAMA,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,kCAA2C,iBAAiB,gBAkBpF,CAAC;AAEF,eAAO,MAAM,WAAW,gBAAiB,MAAM,SAkC9C,CAAC;AAEF,eAAO,MAAM,cAAc,mBAM1B,CAAC;AACF,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AACD,eAAO,MAAM,YAAY,iBAAkB,iBAAiB,gBAE3D,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAW,MAAM,WAAW,CAAC,gBAAgB,CAAC,wEAO3E,CAAC;AAEF,eAAO,MAAM,cAAc,mBAM1B,CAAC;AAEF,eAAO,MAAM,aAAa,mBAA4D,CAAC;AAEvF,eAAO,MAAM,WAAW,YAAa,MAAM,cAAc,MAAM,WAE9D,CAAC;AAEF,oBAAY,uBAAuB,CAAC,SAAS,IAAI;KAC9C,QAAQ,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC;CACnD,CAAC"}
|
|
@@ -5,15 +5,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.generateUrl = exports.SkeletonBlock = exports.LoadingSpinner = exports.handleInputChange = exports.EmptyMessage = exports.LoadingOverlay = exports.handleError = exports.WidgetHeader = void 0;
|
|
7
7
|
/*---------------------------------------------------------------------------------------------
|
|
8
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
11
|
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
12
12
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
13
13
|
require("./utils.scss");
|
|
14
14
|
const react_1 = __importDefault(require("react"));
|
|
15
15
|
const ReportsConfigWidget_1 = require("../../ReportsConfigWidget");
|
|
16
|
-
const WidgetHeader = ({ title, disabled = false, returnFn
|
|
16
|
+
const WidgetHeader = ({ title, disabled = false, returnFn }) => {
|
|
17
17
|
return (react_1.default.createElement("div", { className: "rcw-widget-header-container" },
|
|
18
18
|
returnFn && (react_1.default.createElement(itwinui_react_1.Icon, { className: `${disabled ? "rcw-chevron-disabled" : "rcw-chevron"}`, onClick: disabled ? undefined : returnFn, size: "large", title: ReportsConfigWidget_1.ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Back") },
|
|
19
19
|
react_1.default.createElement(itwinui_icons_react_1.SvgChevronLeft, null))),
|
|
@@ -78,7 +78,7 @@ const LoadingSpinner = () => {
|
|
|
78
78
|
react_1.default.createElement(itwinui_react_1.ProgressRadial, { size: "small", indeterminate: true })));
|
|
79
79
|
};
|
|
80
80
|
exports.LoadingSpinner = LoadingSpinner;
|
|
81
|
-
const SkeletonBlock = () =>
|
|
81
|
+
const SkeletonBlock = () => react_1.default.createElement("div", { className: "rcw-skeleton-block iui-skeleton" });
|
|
82
82
|
exports.SkeletonBlock = SkeletonBlock;
|
|
83
83
|
const generateUrl = (baseUrl, newBaseUrl) => {
|
|
84
84
|
return baseUrl.replace("https://api.bentley.com", newBaseUrl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,oEAA4D;AAC5D,wDAA2E;AAC3E,wBAAsB;AACtB,kDAA0B;AAC1B,mEAAgE;AAQzD,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,EAAqB,EAAE,EAAE;IACvF,OAAO,CACL,uCAAK,SAAS,EAAC,6BAA6B;QACzC,QAAQ,IAAI,CACX,8BAAC,oBAAI,IACH,SAAS,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,aAAa,EAAE,EACjE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EACxC,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,yCAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,0BAA0B,CAAC;YAEtF,8BAAC,oCAAc,OAAG,CACb,CACR;QACD,8BAAC,oBAAI,IAAC,SAAS,EAAC,WAAW,EA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,GAAG,GAAG,EAAE,CAAC,uCAAK,SAAS,EAAC,iCAAiC,GAAG,CAAC;AAA1E,QAAA,aAAa,iBAA6D;AAEhF,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,UAAkB,EAAE,EAAE;IACjE,OAAO,OAAO,CAAC,OAAO,CAAC,yBAAyB,EAAE,UAAU,CAAC,CAAC;AAChE,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { SvgChevronLeft } from \"@itwin/itwinui-icons-react\";\nimport { Icon, ProgressRadial, Text, toaster } from \"@itwin/itwinui-react\";\nimport \"./utils.scss\";\nimport React from \"react\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport interface WidgetHeaderProps {\n title: string;\n disabled?: boolean;\n returnFn?: () => void;\n}\n\nexport const WidgetHeader = ({ title, disabled = false, returnFn }: WidgetHeaderProps) => {\n return (\n <div className=\"rcw-widget-header-container\">\n {returnFn && (\n <Icon\n className={`${disabled ? \"rcw-chevron-disabled\" : \"rcw-chevron\"}`}\n onClick={disabled ? undefined : returnFn}\n size=\"large\"\n title={ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Back\")}\n >\n <SvgChevronLeft />\n </Icon>\n )}\n <Text className=\"rcw-title\" variant=\"title\">\n {title}\n </Text>\n </div>\n );\n};\n\nexport const handleError = (errorStatus: number) => {\n let errorMessage = `${ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.Error\")} `;\n switch (errorStatus) {\n case 401:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.401\");\n break;\n case 403:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.403\");\n break;\n case 404:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.404\");\n break;\n case 409:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.409\");\n break;\n case 422:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.422\");\n break;\n case 429:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.429\");\n break;\n case 500:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.500\");\n break;\n case 502:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.502\");\n break;\n case 503:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.503\");\n break;\n default:\n errorMessage += ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:ErrorMessages.SomethingWentWrong\");\n }\n toaster.negative(errorMessage);\n};\n\nexport const LoadingOverlay = () => (\n <div className=\"rcw-center-overlay\">\n <Text>{ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Loading\")}</Text>\n <ProgressRadial indeterminate />\n <Text>{ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:PleaseWait\")}</Text>\n </div>\n);\ninterface EmptyMessageProps {\n children?: React.ReactNode;\n}\nexport const EmptyMessage = ({ children }: EmptyMessageProps) => {\n return <div className=\"rcw-center-overlay\">{children}</div>;\n};\n\nexport const handleInputChange = <T,>(e: React.ChangeEvent<HTMLInputElement>, values: T, setValues: React.Dispatch<React.SetStateAction<T>>) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const LoadingSpinner = () => {\n return (\n <div className=\"rcw-loading-spinner\" data-testid=\"rcw-action-loading-spinner\">\n <ProgressRadial size=\"small\" indeterminate />\n </div>\n );\n};\n\nexport const SkeletonBlock = () => <div className=\"rcw-skeleton-block iui-skeleton\" />;\n\nexport const generateUrl = (baseUrl: string, newBaseUrl: string) => {\n return baseUrl.replace(\"https://api.bentley.com\", newBaseUrl);\n};\n\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkExtractorContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/BulkExtractorContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,oBAAY,gBAAgB,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1D,MAAM,WAAW,yBAAyB;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,0CAA+C,CAAC;AAEjF,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"BulkExtractorContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/BulkExtractorContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,oBAAY,gBAAgB,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1D,MAAM,WAAW,yBAAyB;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,0CAA+C,CAAC;AAEjF,eAAO,MAAM,gBAAgB,iCAM5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkExtractorContext.js","sourceRoot":"","sources":["../../../../src/widget/context/BulkExtractorContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,6CAA+B;AAC/B,iCAAsC;AASzB,QAAA,oBAAoB,GAAG,IAAA,qBAAa,EAA4B,EAAE,CAAC,CAAC;AAE1E,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,4BAAoB,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"BulkExtractorContext.js","sourceRoot":"","sources":["../../../../src/widget/context/BulkExtractorContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,6CAA+B;AAC/B,iCAAsC;AASzB,QAAA,oBAAoB,GAAG,IAAA,qBAAa,EAA4B,EAAE,CAAC,CAAC;AAE1E,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,4BAAoB,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;KAC3F;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AANW,QAAA,gBAAgB,oBAM3B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport * as React from \"react\";\nimport { createContext } from \"react\";\nimport type { BulkExtractor } from \"../components/BulkExtractor\";\n\nexport type GetAccessTokenFn = () => Promise<AccessToken>;\n\nexport interface BulkExtractorContextProps {\n bulkExtractor?: BulkExtractor;\n}\n\nexport const BulkExtractorContext = createContext<BulkExtractorContextProps>({});\n\nexport const useBulkExtractor = () => {\n const context = React.useContext(BulkExtractorContext);\n if (!context) {\n throw new Error(\"useBulkExtractor should be used within a BulkExtractorContext provider\");\n }\n return context;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsConfigApiContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/ReportsConfigApiContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,oBAAY,gBAAgB,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1D,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,gBAAgB,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,eAAO,MAAM,uBAAuB,sCAOlC,CAAC;AAEH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ReportsConfigApiContext.d.ts","sourceRoot":"","sources":["../../../../src/widget/context/ReportsConfigApiContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,oBAAY,gBAAgB,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1D,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,gBAAgB,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,eAAO,MAAM,uBAAuB,sCAOlC,CAAC;AAEH,eAAO,MAAM,mBAAmB,6BAM/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsConfigApiContext.js","sourceRoot":"","sources":["../../../../src/widget/context/ReportsConfigApiContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,gFAAiE;AACjE,4DAAuE;AACvE,6CAA+B;AAC/B,iCAAsC;AAazB,QAAA,uBAAuB,GAAG,IAAA,qBAAa,EAAwB;IAC1E,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;IAC9B,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,IAAI,+BAAa,EAAE;IAClC,cAAc,EAAE,IAAI,gCAAc,EAAE;IACpC,aAAa,EAAE,IAAI,yCAAa,EAAE;CACnC,CAAC,CAAC;AAEI,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,+BAAuB,CAAC,CAAC;IAC1D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"ReportsConfigApiContext.js","sourceRoot":"","sources":["../../../../src/widget/context/ReportsConfigApiContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,gFAAiE;AACjE,4DAAuE;AACvE,6CAA+B;AAC/B,iCAAsC;AAazB,QAAA,uBAAuB,GAAG,IAAA,qBAAa,EAAwB;IAC1E,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;IAC9B,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,IAAI,+BAAa,EAAE;IAClC,cAAc,EAAE,IAAI,gCAAc,EAAE;IACpC,aAAa,EAAE,IAAI,yCAAa,EAAE;CACnC,CAAC,CAAC;AAEI,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,+BAAuB,CAAC,CAAC;IAC1D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;KACjG;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport { IModelsClient } from \"@itwin/imodels-client-management\";\nimport { MappingsClient, ReportsClient } from \"@itwin/insights-client\";\nimport * as React from \"react\";\nimport { createContext } from \"react\";\n\nexport type GetAccessTokenFn = () => Promise<AccessToken>;\n\nexport interface ReportsConfigApiProps {\n getAccessToken: GetAccessTokenFn;\n iTwinId: string;\n baseUrl: string;\n reportsClient: ReportsClient;\n mappingsClient: MappingsClient;\n iModelsClient: IModelsClient;\n}\n\nexport const ReportsConfigApiContext = createContext<ReportsConfigApiProps>({\n getAccessToken: async () => \"\",\n iTwinId: \"\",\n baseUrl: \"\",\n reportsClient: new ReportsClient(),\n mappingsClient: new MappingsClient(),\n iModelsClient: new IModelsClient(),\n});\n\nexport const useReportsConfigApi = () => {\n const context = React.useContext(ReportsConfigApiContext);\n if (!context) {\n throw new Error(\"useReportsConfigApi should be used within a ReportsConfigApiContext provider\");\n }\n return context;\n};\n"]}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import SimpleReactValidator from "simple-react-validator";
|
|
2
2
|
export declare const NAME_REQUIREMENTS = "required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresSpacesAndDigits|CharLimit";
|
|
3
|
-
declare const useValidator: () => [
|
|
4
|
-
SimpleReactValidator,
|
|
5
|
-
React.Dispatch<React.SetStateAction<boolean>>
|
|
6
|
-
];
|
|
3
|
+
declare const useValidator: () => [SimpleReactValidator, React.Dispatch<React.SetStateAction<boolean>>];
|
|
7
4
|
export default useValidator;
|
|
8
5
|
//# sourceMappingURL=useValidator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useValidator.d.ts","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":"AAKA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAG1D,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"useValidator.d.ts","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":"AAKA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAG1D,eAAO,MAAM,iBAAiB,0HAA0H,CAAC;AAEzJ,QAAA,MAAM,YAAY,QAAO,CAAC,oBAAoB,EAAE,MAAM,QAAQ,CAAC,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC,CA2C5F,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.NAME_REQUIREMENTS = void 0;
|
|
7
7
|
/*---------------------------------------------------------------------------------------------
|
|
8
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
11
|
const react_1 = require("react");
|
|
12
12
|
const simple_react_validator_1 = __importDefault(require("simple-react-validator"));
|
|
13
13
|
const ReportsConfigWidget_1 = require("../../ReportsConfigWidget");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useValidator.js","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"useValidator.js","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,iCAAiC;AACjC,oFAA0D;AAC1D,mEAAgE;AAEnD,QAAA,iBAAiB,GAAG,uHAAuH,CAAC;AAEzJ,MAAM,YAAY,GAAG,GAA0E,EAAE;IAC/F,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IACxC,MAAM,eAAe,GAAG;QACtB,qBAAqB,EAAE;YACrB,OAAO,EAAE,yCAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,sDAAsD,CAAC;YACpH,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC5B,CAAC;SACF;QACD,gCAAgC,EAAE;YAChC,OAAO,EAAE,yCAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,iEAAiE,CAAC;YAC/H,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACjC,CAAC;SACF;QACD,2CAA2C,EAAE;YAC3C,OAAO,EAAE,yCAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,4EAA4E,CAAC;YAC1I,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACzC,CAAC;SACF;QACD,SAAS,EAAE;YACT,OAAO,EAAE,yCAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,0CAA0C,CAAC;YACxG,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC;YAC3B,CAAC;SACF;KACF,CAAC;IAEF,MAAM,cAAc,GAAG;QACrB,QAAQ,EAAE,yCAAmB,CAAC,YAAY,CAAC,kBAAkB,CAAC,oDAAoD,CAAC;KACpH,CAAC;IAEF,MAAM,SAAS,GAAG,IAAI,gCAAoB,CAAC;QACzC,QAAQ,EAAE,cAAc;QACxB,UAAU,EAAE,eAAe;KAC5B,CAAC,CAAC;IAEH,IAAI,IAAI,EAAE;QACR,SAAS,CAAC,YAAY,EAAE,CAAC;KAC1B;IAED,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { useState } from \"react\";\nimport SimpleReactValidator from \"simple-react-validator\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport const NAME_REQUIREMENTS = \"required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresSpacesAndDigits|CharLimit\";\n\nconst useValidator = (): [SimpleReactValidator, React.Dispatch<React.SetStateAction<boolean>>] => {\n const [show, setShow] = useState(false);\n const customValidator = {\n NoDuplicateUnderscore: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.NoDuplicateUnderscore\"),\n rule: (val: string) => {\n return !val.match(/__+/i);\n },\n },\n OnlyBeginsWithLetterOrUnderscore: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.OnlyBeginsWithLetterOrUnderscore\"),\n rule: (val: string) => {\n return !val.match(/^[\\W\\d]+/i);\n },\n },\n FollowedByLettersUnderscoresSpacesAndDigits: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.FollowedByLettersUnderscoresSpacesAndDigits\"),\n rule: (val: string) => {\n return !val.match(/[^a-zA-Z0-9_\\s]+/i);\n },\n },\n CharLimit: {\n message: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.CharLimit\"),\n rule: (val: string) => {\n return val.length <= 128;\n },\n },\n };\n\n const customMessages = {\n required: ReportsConfigWidget.localization.getLocalizedString(\"ReportsConfigWidget:Validators.ThisFieldIsRequired\"),\n };\n\n const validator = new SimpleReactValidator({\n messages: customMessages,\n validators: customValidator,\n });\n\n if (show) {\n validator.showMessages();\n }\n\n return [validator, setShow];\n};\n\nexport default useValidator;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsConfigWidget.d.ts","sourceRoot":"","sources":["../../src/ReportsConfigWidget.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAS;IAC9C,OAAO,CAAC,MAAM,CAAC,aAAa,CAAe;IAE3C,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;IAED,WAAkB,YAAY,IAAI,YAAY,CAE7C;WAEmB,UAAU,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ReportsConfigWidget.d.ts","sourceRoot":"","sources":["../../src/ReportsConfigWidget.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAS;IAC9C,OAAO,CAAC,MAAM,CAAC,aAAa,CAAe;IAE3C,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;IAED,WAAkB,YAAY,IAAI,YAAY,CAE7C;WAEmB,UAAU,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;WAS5D,SAAS;CAGxB"}
|