@itwin/reports-config-widget-react 0.0.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/package-deps_rebuild.json +46 -32
- package/.rush/temp/shrinkwrap-deps.json +14 -6
- package/CHANGELOG.json +27 -0
- package/CHANGELOG.md +16 -1
- package/coverage/clover.xml +648 -427
- package/coverage/coverage-final.json +28 -18
- package/coverage/lcov-report/index.html +34 -19
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +10 -10
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/test/index.html +1 -1
- package/coverage/lcov-report/src/test/test-utils.tsx.html +22 -22
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +7 -7
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +29 -41
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +31 -37
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +661 -0
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +106 -0
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +21 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +187 -0
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +145 -0
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +139 -0
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +151 -0
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +190 -0
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +176 -0
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +295 -0
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +208 -0
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +77 -44
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +8 -8
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +14 -20
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +475 -0
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +469 -0
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +184 -250
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +180 -132
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +10 -10
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +11 -11
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +31 -31
- package/coverage/lcov-report/src/widget/components/index.html +134 -59
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +32 -32
- package/coverage/lcov-report/src/widget/context/ReportsApiConfigContext.tsx.html +8 -8
- 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 +7 -7
- package/coverage/lcov-report/src/widget/index.html +1 -1
- package/coverage/lcov.info +1137 -738
- package/jest.config.js +7 -0
- package/lib/cjs/test/AddMappingModal.test.d.ts +2 -0
- package/lib/cjs/test/AddMappingModal.test.d.ts.map +1 -0
- package/lib/cjs/test/AddMappingModal.test.js +277 -0
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -0
- package/lib/cjs/test/BulkExtractor.test.d.ts +2 -0
- package/lib/cjs/test/BulkExtractor.test.d.ts.map +1 -0
- package/lib/cjs/test/BulkExtractor.test.js +182 -0
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -0
- package/lib/cjs/test/DeleteModal.test.d.ts +2 -0
- package/lib/cjs/test/DeleteModal.test.d.ts.map +1 -0
- package/lib/cjs/test/DeleteModal.test.js +93 -0
- package/lib/cjs/test/DeleteModal.test.js.map +1 -0
- package/lib/cjs/test/ReportAction.test.js +2 -3
- package/lib/cjs/test/ReportAction.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.d.ts +2 -0
- package/lib/cjs/test/ReportMappingHorizontalTile.test.d.ts.map +1 -0
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +340 -0
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -0
- package/lib/cjs/test/ReportMappings.test.js +115 -267
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +1 -1
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.js +4 -5
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +2 -2
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js +5 -4
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.scss +4 -3
- package/lib/cjs/widget/components/BulkExtractor.d.ts +37 -0
- package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -0
- package/lib/cjs/widget/components/BulkExtractor.js +155 -0
- package/lib/cjs/widget/components/BulkExtractor.js.map +1 -0
- package/lib/cjs/widget/components/Constants.d.ts +4 -0
- package/lib/cjs/widget/components/Constants.d.ts.map +1 -0
- package/lib/cjs/widget/components/Constants.js +11 -0
- package/lib/cjs/widget/components/Constants.js.map +1 -0
- package/lib/cjs/widget/components/DeleteModal.js +1 -1
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.scss +4 -3
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts +8 -0
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -0
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js +23 -0
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -0
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts +3 -0
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -0
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js +18 -0
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -0
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts +3 -0
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -0
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js +17 -0
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -0
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts +3 -0
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -0
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js +18 -0
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -0
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts +8 -0
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -0
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js +23 -0
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -0
- package/lib/cjs/widget/components/ExtractionStatus.d.ts +17 -0
- package/lib/cjs/widget/components/ExtractionStatus.d.ts.map +1 -0
- package/lib/cjs/widget/components/ExtractionStatus.js +76 -0
- package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -0
- package/lib/cjs/widget/components/{Extraction.scss → ExtractionStatus.scss} +17 -15
- package/lib/cjs/widget/components/ExtractionToast.d.ts +11 -0
- package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -0
- package/lib/cjs/widget/components/ExtractionToast.js +33 -0
- package/lib/cjs/widget/components/ExtractionToast.js.map +1 -0
- package/lib/cjs/widget/components/HorizontalTile.d.ts +8 -7
- package/lib/cjs/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.js +10 -6
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/HorizontalTile.scss +42 -22
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js +3 -3
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.scss +2 -2
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts +16 -0
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportHorizontalTile.js +71 -0
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -0
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts +13 -0
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +82 -0
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -0
- package/lib/cjs/widget/components/ReportMappings.d.ts +3 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js +39 -40
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.scss +7 -7
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js +43 -28
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/Reports.scss +8 -4
- package/lib/cjs/widget/components/ReportsContainer.js +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.scss +2 -2
- package/lib/cjs/widget/components/SearchBar.js +1 -1
- package/lib/cjs/widget/components/SearchBar.js.map +1 -1
- package/lib/cjs/widget/components/SearchBar.scss +6 -0
- package/lib/cjs/widget/components/SelectIModel.js +2 -2
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.scss +4 -3
- package/lib/cjs/widget/components/utils.js +1 -1
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +2 -2
- package/lib/esm/test/AddMappingModal.test.d.ts +2 -0
- package/lib/esm/test/AddMappingModal.test.d.ts.map +1 -0
- package/lib/esm/test/AddMappingModal.test.js +253 -0
- package/lib/esm/test/AddMappingModal.test.js.map +1 -0
- package/lib/esm/test/BulkExtractor.test.d.ts +2 -0
- package/lib/esm/test/BulkExtractor.test.d.ts.map +1 -0
- package/lib/esm/test/BulkExtractor.test.js +158 -0
- package/lib/esm/test/BulkExtractor.test.js.map +1 -0
- package/lib/esm/test/DeleteModal.test.d.ts +2 -0
- package/lib/esm/test/DeleteModal.test.d.ts.map +1 -0
- package/lib/esm/test/DeleteModal.test.js +69 -0
- package/lib/esm/test/DeleteModal.test.js.map +1 -0
- package/lib/esm/test/ReportAction.test.js +2 -3
- package/lib/esm/test/ReportAction.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.d.ts +2 -0
- package/lib/esm/test/ReportMappingHorizontalTile.test.d.ts.map +1 -0
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +316 -0
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -0
- package/lib/esm/test/ReportMappings.test.js +117 -269
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +1 -1
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/esm/widget/components/ActionPanel.js +4 -5
- package/lib/esm/widget/components/ActionPanel.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts +2 -2
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.js +4 -5
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.scss +4 -3
- package/lib/esm/widget/components/BulkExtractor.d.ts +37 -0
- package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -0
- package/lib/esm/widget/components/BulkExtractor.js +152 -0
- package/lib/esm/widget/components/BulkExtractor.js.map +1 -0
- package/lib/esm/widget/components/Constants.d.ts +4 -0
- package/lib/esm/widget/components/Constants.d.ts.map +1 -0
- package/lib/esm/widget/components/Constants.js +8 -0
- package/lib/esm/widget/components/Constants.js.map +1 -0
- package/lib/esm/widget/components/DeleteModal.js +1 -1
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.scss +4 -3
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts +8 -0
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -0
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js +16 -0
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.js.map +1 -0
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts +3 -0
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -0
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js +11 -0
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.js.map +1 -0
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts +3 -0
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -0
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js +10 -0
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -0
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts +3 -0
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -0
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js +11 -0
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.js.map +1 -0
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts +8 -0
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -0
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js +16 -0
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -0
- package/lib/esm/widget/components/ExtractionStatus.d.ts +17 -0
- package/lib/esm/widget/components/ExtractionStatus.d.ts.map +1 -0
- package/lib/esm/widget/components/ExtractionStatus.js +53 -0
- package/lib/esm/widget/components/ExtractionStatus.js.map +1 -0
- package/{src/widget/components/Extraction.scss → lib/esm/widget/components/ExtractionStatus.scss} +17 -15
- package/lib/esm/widget/components/ExtractionToast.d.ts +11 -0
- package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -0
- package/lib/esm/widget/components/ExtractionToast.js +25 -0
- package/lib/esm/widget/components/ExtractionToast.js.map +1 -0
- package/lib/esm/widget/components/HorizontalTile.d.ts +8 -7
- package/lib/esm/widget/components/HorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.js +10 -6
- package/lib/esm/widget/components/HorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/HorizontalTile.scss +42 -22
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.js +3 -3
- package/lib/esm/widget/components/ReportAction.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.scss +2 -2
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts +16 -0
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportHorizontalTile.js +64 -0
- package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -0
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts +13 -0
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js +75 -0
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -0
- package/lib/esm/widget/components/ReportMappings.d.ts +3 -1
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js +40 -41
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.scss +7 -7
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js +45 -30
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/Reports.scss +8 -4
- package/lib/esm/widget/components/ReportsContainer.js +1 -1
- package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.scss +2 -2
- package/lib/esm/widget/components/SearchBar.js +1 -1
- package/lib/esm/widget/components/SearchBar.js.map +1 -1
- package/lib/esm/widget/components/SearchBar.scss +6 -0
- 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 +4 -3
- package/lib/esm/widget/components/utils.js +1 -1
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +2 -2
- package/lib/public/locales/en/ReportsConfigWidget.json +7 -1
- package/package.json +9 -3
- package/public/locales/en/ReportsConfigWidget.json +7 -1
- package/reports-config-widget-react.build.error.log +10 -6
- package/reports-config-widget-react.build.log +51 -36
- package/src/test/AddMappingModal.test.tsx +315 -0
- package/src/test/BulkExtractor.test.ts +301 -0
- package/src/test/DeleteModal.test.tsx +118 -0
- package/src/test/ReportAction.test.tsx +2 -4
- package/src/test/ReportMappingHorizontalTile.test.tsx +451 -0
- package/src/test/ReportMappings.test.tsx +154 -549
- package/src/test/Reports.test.tsx +1 -1
- package/src/widget/components/ActionPanel.tsx +19 -23
- package/src/widget/components/AddMappingsModal.scss +4 -3
- package/src/widget/components/AddMappingsModal.tsx +4 -6
- package/src/widget/components/BulkExtractor.ts +192 -0
- package/src/widget/components/Constants.ts +7 -0
- package/src/widget/components/DeleteModal.scss +4 -3
- package/src/widget/components/DeleteModal.tsx +1 -1
- package/src/widget/components/ExtractionStates/FailedExtractionState.tsx +34 -0
- package/src/widget/components/ExtractionStates/QueuedExtractionState.tsx +20 -0
- package/src/widget/components/ExtractionStates/RunningExtractionState.tsx +18 -0
- package/src/widget/components/ExtractionStates/StartingExtractionState.tsx +22 -0
- package/src/widget/components/ExtractionStates/SucceededExtractionState.tsx +35 -0
- package/{lib/esm/widget/components/Extraction.scss → src/widget/components/ExtractionStatus.scss} +17 -15
- package/src/widget/components/ExtractionStatus.tsx +70 -0
- package/src/widget/components/ExtractionToast.tsx +41 -0
- package/src/widget/components/HorizontalTile.scss +42 -22
- package/src/widget/components/HorizontalTile.tsx +45 -34
- package/src/widget/components/ReportAction.scss +2 -2
- package/src/widget/components/ReportAction.tsx +1 -3
- package/src/widget/components/ReportHorizontalTile.tsx +130 -0
- package/src/widget/components/ReportMappingHorizontalTile.tsx +128 -0
- package/src/widget/components/ReportMappings.scss +7 -7
- package/src/widget/components/ReportMappings.tsx +91 -113
- package/src/widget/components/Reports.scss +8 -4
- package/src/widget/components/Reports.tsx +78 -62
- package/src/widget/components/ReportsContainer.scss +2 -2
- package/src/widget/components/ReportsContainer.tsx +1 -1
- package/src/widget/components/SearchBar.scss +6 -0
- package/src/widget/components/SearchBar.tsx +1 -1
- package/src/widget/components/SelectIModel.scss +4 -3
- package/src/widget/components/SelectIModel.tsx +2 -2
- package/src/widget/components/utils.scss +2 -2
- package/src/widget/components/utils.tsx +1 -1
- package/coverage/lcov-report/src/widget/components/Extraction.tsx.html +0 -1030
- package/lib/cjs/widget/components/Extraction.d.ts +0 -28
- package/lib/cjs/widget/components/Extraction.d.ts.map +0 -1
- package/lib/cjs/widget/components/Extraction.js +0 -190
- package/lib/cjs/widget/components/Extraction.js.map +0 -1
- package/lib/esm/widget/components/Extraction.d.ts +0 -28
- package/lib/esm/widget/components/Extraction.d.ts.map +0 -1
- package/lib/esm/widget/components/Extraction.js +0 -166
- package/lib/esm/widget/components/Extraction.js.map +0 -1
- package/src/widget/components/Extraction.tsx +0 -315
|
@@ -291,7 +291,7 @@ describe("Reports View", () => {
|
|
|
291
291
|
|
|
292
292
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
293
293
|
|
|
294
|
-
const searchButton = within(screen.getByTestId(/search-bar/i)).getByRole(
|
|
294
|
+
const searchButton = within(screen.getByTestId(/rcw-search-bar/i)).getByRole(
|
|
295
295
|
"button"
|
|
296
296
|
);
|
|
297
297
|
await user.click(searchButton);
|
|
@@ -26,29 +26,25 @@ const ActionPanel = ({
|
|
|
26
26
|
isLoading = false,
|
|
27
27
|
}: ActionPanelProps): JSX.Element => {
|
|
28
28
|
return (
|
|
29
|
-
<div
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"ReportsConfigWidget:Cancel"
|
|
49
|
-
)}
|
|
50
|
-
</Button>
|
|
51
|
-
</div>
|
|
29
|
+
<div className="rcw-action-panel">
|
|
30
|
+
{isLoading && <LoadingSpinner />}
|
|
31
|
+
<Button
|
|
32
|
+
disabled={isSavingDisabled || isLoading}
|
|
33
|
+
styleType="high-visibility"
|
|
34
|
+
onClick={onAction}
|
|
35
|
+
>
|
|
36
|
+
{actionLabel}
|
|
37
|
+
</Button>
|
|
38
|
+
<Button
|
|
39
|
+
styleType="default"
|
|
40
|
+
type="button"
|
|
41
|
+
onClick={onCancel}
|
|
42
|
+
disabled={isCancelDisabled || isLoading}
|
|
43
|
+
>
|
|
44
|
+
{ReportsConfigWidget.localization.getLocalizedString(
|
|
45
|
+
"ReportsConfigWidget:Cancel"
|
|
46
|
+
)}
|
|
47
|
+
</Button>
|
|
52
48
|
</div>
|
|
53
49
|
);
|
|
54
50
|
};
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
@import "~@itwin/itwinui-css/scss/variables";
|
|
6
6
|
|
|
7
|
-
.add-mappings-container {
|
|
7
|
+
.rcw-add-mappings-container {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
gap: $iui-baseline;
|
|
11
11
|
width: 45vw;
|
|
12
12
|
min-width: 100%;
|
|
13
13
|
overflow: auto;
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
.rcw-add-mappings-table {
|
|
15
16
|
flex-grow: 1;
|
|
16
17
|
overflow: auto;
|
|
17
18
|
}
|
|
18
|
-
}
|
|
19
|
+
}
|
|
@@ -50,13 +50,13 @@ interface AddMappingsModalProps {
|
|
|
50
50
|
returnFn: () => Promise<void>;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const AddMappingsModal = ({
|
|
53
|
+
export const AddMappingsModal = ({
|
|
54
54
|
reportId,
|
|
55
55
|
existingMappings,
|
|
56
56
|
show,
|
|
57
57
|
returnFn,
|
|
58
58
|
}: AddMappingsModalProps) => {
|
|
59
|
-
const [isLoading, setIsLoading] = useState<boolean>(
|
|
59
|
+
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
60
60
|
const [selectedMappings, setSelectedMappings] = useState<Mapping[]>([]);
|
|
61
61
|
const [selectedIModelId, setSelectediModelId] = useState<string>("");
|
|
62
62
|
const [mappings, setMappings] = useState<Mapping[]>([]);
|
|
@@ -135,7 +135,7 @@ const AddMappingsModal = ({
|
|
|
135
135
|
}}
|
|
136
136
|
style={{ display: "flex", flexDirection: "column", maxHeight: "77vh" }}
|
|
137
137
|
>
|
|
138
|
-
<div className="add-mappings-container">
|
|
138
|
+
<div className="rcw-add-mappings-container">
|
|
139
139
|
<SelectIModel
|
|
140
140
|
selectedIModelId={selectedIModelId}
|
|
141
141
|
setSelectedIModelId={setSelectediModelId}
|
|
@@ -143,7 +143,7 @@ const AddMappingsModal = ({
|
|
|
143
143
|
<Table<MappingType>
|
|
144
144
|
data={isLoading ? [] : mappings}
|
|
145
145
|
columns={mappingsColumns}
|
|
146
|
-
className="add-mappings-table"
|
|
146
|
+
className="rcw-add-mappings-table"
|
|
147
147
|
emptyTableContent={ReportsConfigWidget.localization.getLocalizedString(
|
|
148
148
|
"ReportsConfigWidget:NoMappingsAvailable"
|
|
149
149
|
)}
|
|
@@ -171,5 +171,3 @@ const AddMappingsModal = ({
|
|
|
171
171
|
</Modal>
|
|
172
172
|
);
|
|
173
173
|
};
|
|
174
|
-
|
|
175
|
-
export default AddMappingsModal;
|
|
@@ -0,0 +1,192 @@
|
|
|
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
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ExtractionClient, ExtractorState, REPORTING_BASE_PATH, ReportsClient } from "@itwin/insights-client";
|
|
6
|
+
import type { ReportMapping } from "@itwin/insights-client";
|
|
7
|
+
import { generateUrl, handleError } from "./utils";
|
|
8
|
+
import type { ReportsApiConfig } from "../context/ReportsApiConfigContext";
|
|
9
|
+
import { ExtractionStates } from "./ExtractionStatus";
|
|
10
|
+
import { STATUS_CHECK_INTERVAL } from "./Constants";
|
|
11
|
+
|
|
12
|
+
export type ReportMappingAndMapping = ReportMapping & {
|
|
13
|
+
mappingName: string;
|
|
14
|
+
mappingDescription: string;
|
|
15
|
+
iModelName: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default class BulkExtractor {
|
|
19
|
+
private _reportsClientApi: ReportsClient;
|
|
20
|
+
private _extractionClientApi: ExtractionClient;
|
|
21
|
+
private _accessToken: () => Promise<string>;
|
|
22
|
+
|
|
23
|
+
private _reportIModels = new Map<string, string[]>(); // key: reportId, value: iModels
|
|
24
|
+
private _iModelStates = new Map<string, ExtractorState>(); // key: iModelId, value: state
|
|
25
|
+
private _timeFetched = new Date();
|
|
26
|
+
private _iModelRun = new Map<string, string>(); // key: iModelId, value: runId
|
|
27
|
+
private _iModelToast = new Set<string>();
|
|
28
|
+
private _successfulExtractionToast: (iModelName: string, odataFeedUrl: string) => void;
|
|
29
|
+
private _failedExtractionToast: (iModelName: string) => void;
|
|
30
|
+
private _setJobRunning: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
31
|
+
private _iModels: string[] = [];
|
|
32
|
+
|
|
33
|
+
constructor(
|
|
34
|
+
apiConfig: ReportsApiConfig,
|
|
35
|
+
successfulExtractionToast: (iModelName: string, odataFeedUrl: string) => void,
|
|
36
|
+
failedExtractionToast: (iModelName: string) => void,
|
|
37
|
+
) {
|
|
38
|
+
const url = generateUrl(REPORTING_BASE_PATH, apiConfig.baseUrl);
|
|
39
|
+
this._reportsClientApi = new ReportsClient(url);
|
|
40
|
+
this._extractionClientApi = new ExtractionClient(url);
|
|
41
|
+
this._accessToken = apiConfig.getAccessToken;
|
|
42
|
+
this._successfulExtractionToast = successfulExtractionToast;
|
|
43
|
+
this._failedExtractionToast = failedExtractionToast;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private async fetchStates(): Promise<void> {
|
|
47
|
+
for (const [iModelId, runId] of this._iModelRun) {
|
|
48
|
+
const state = await this.getState(runId);
|
|
49
|
+
if (state === ExtractorState.Succeeded || state === ExtractorState.Failed) {
|
|
50
|
+
this._iModelRun.delete(iModelId);
|
|
51
|
+
}
|
|
52
|
+
this._iModelStates.set(iModelId, state);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public async getReportState(reportId: string): Promise<ExtractionStates> {
|
|
57
|
+
if ((new Date().getTime() - this._timeFetched.getTime()) > STATUS_CHECK_INTERVAL) {
|
|
58
|
+
this._timeFetched = new Date();
|
|
59
|
+
await this.fetchStates();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const iModels = this._reportIModels.get(reportId);
|
|
63
|
+
if (!iModels) return ExtractionStates.None;
|
|
64
|
+
const states: ExtractorState[] = [];
|
|
65
|
+
for (const iModelId of iModels) {
|
|
66
|
+
const state = this._iModelStates.get(iModelId);
|
|
67
|
+
if (!state) continue;
|
|
68
|
+
states.push(state);
|
|
69
|
+
}
|
|
70
|
+
return BulkExtractor.getFinalState(states);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public async getIModelState(iModelId: string, iModelName: string, odataFeedUrl: string): Promise<ExtractionStates> {
|
|
74
|
+
if ((new Date().getTime() - this._timeFetched.getTime()) > STATUS_CHECK_INTERVAL) {
|
|
75
|
+
this._timeFetched = new Date();
|
|
76
|
+
await this.fetchStates();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const state = this._iModelStates.get(iModelId);
|
|
80
|
+
if (!state) return ExtractionStates.None;
|
|
81
|
+
if (!this._iModelToast.has(iModelId)) {
|
|
82
|
+
if (state === ExtractorState.Succeeded) {
|
|
83
|
+
this._successfulExtractionToast(iModelName, odataFeedUrl);
|
|
84
|
+
this._iModelToast.add(iModelId);
|
|
85
|
+
this.checkRunning();
|
|
86
|
+
} else if (state === ExtractorState.Failed) {
|
|
87
|
+
this._failedExtractionToast(iModelName);
|
|
88
|
+
this._iModelToast.add(iModelId);
|
|
89
|
+
this.checkRunning();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return BulkExtractor.getFinalState([state]);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private static getFinalState(states: ExtractorState[]): ExtractionStates {
|
|
96
|
+
if (states.includes(ExtractorState.Failed))
|
|
97
|
+
return ExtractionStates.Failed;
|
|
98
|
+
|
|
99
|
+
if (states.includes(ExtractorState.Queued))
|
|
100
|
+
return ExtractionStates.Queued;
|
|
101
|
+
|
|
102
|
+
if (states.includes(ExtractorState.Running))
|
|
103
|
+
return ExtractionStates.Running;
|
|
104
|
+
|
|
105
|
+
if (states.includes(ExtractorState.Succeeded))
|
|
106
|
+
return ExtractionStates.Succeeded;
|
|
107
|
+
|
|
108
|
+
return ExtractionStates.Failed;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
private async getState(runId: string): Promise<ExtractorState> {
|
|
112
|
+
try {
|
|
113
|
+
const accessToken = await this._accessToken();
|
|
114
|
+
const response = await this._extractionClientApi.getExtractionStatus(accessToken, runId);
|
|
115
|
+
return response.state;
|
|
116
|
+
} catch (error: any) {
|
|
117
|
+
handleError(error.status);
|
|
118
|
+
}
|
|
119
|
+
return ExtractorState.Failed;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private checkRunning(): void {
|
|
123
|
+
if (this._setJobRunning) {
|
|
124
|
+
let allFinished = true;
|
|
125
|
+
this._iModels.forEach((iModelId) => {
|
|
126
|
+
const state = this._iModelStates.get(iModelId);
|
|
127
|
+
if (state === ExtractorState.Queued || state === ExtractorState.Running) {
|
|
128
|
+
allFinished = false;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
this._setJobRunning(!allFinished);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public async runReportExtractions(reportIds: string[]): Promise<void> {
|
|
137
|
+
const reportIModelIds = new Map<string, string[]>();
|
|
138
|
+
for (const reportId of reportIds) {
|
|
139
|
+
const reportIModels = await this.fetchReportIModels(reportId);
|
|
140
|
+
reportIModelIds.set(reportId, reportIModels);
|
|
141
|
+
this._reportIModels.set(reportId, reportIModels);
|
|
142
|
+
}
|
|
143
|
+
const iModels = new Set(Array.from(reportIModelIds.values()).flat());
|
|
144
|
+
|
|
145
|
+
for (const iModel of iModels) {
|
|
146
|
+
await this.runIModelExtractions([iModel]);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
private async runExtraction(iModelId: string): Promise<string | undefined> {
|
|
151
|
+
try {
|
|
152
|
+
const response = await this._extractionClientApi.runExtraction(
|
|
153
|
+
await this._accessToken(),
|
|
154
|
+
iModelId
|
|
155
|
+
);
|
|
156
|
+
this._iModelToast.delete(iModelId);
|
|
157
|
+
return response.id;
|
|
158
|
+
} catch (error: any) {
|
|
159
|
+
handleError(error.status);
|
|
160
|
+
}
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
public async runIModelExtraction(iModelId: string): Promise<void> {
|
|
165
|
+
return this.runIModelExtractions([iModelId]);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
public setHook(setJobRunning: React.Dispatch<React.SetStateAction<boolean>>, iModels: string[]): void {
|
|
169
|
+
this._setJobRunning = setJobRunning;
|
|
170
|
+
this._iModels = iModels;
|
|
171
|
+
this.checkRunning();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
public async runIModelExtractions(iModels: string[]): Promise<void> {
|
|
175
|
+
for (const iModelId of iModels) {
|
|
176
|
+
const run = await this.runExtraction(iModelId);
|
|
177
|
+
if (run) {
|
|
178
|
+
this._iModelStates.set(iModelId, ExtractorState.Queued);
|
|
179
|
+
this._iModelRun.set(iModelId, run);
|
|
180
|
+
}
|
|
181
|
+
this.checkRunning();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
private async fetchReportIModels(reportId: string): Promise<string[]> {
|
|
186
|
+
const reportMappings = await this._reportsClientApi.getReportMappings(
|
|
187
|
+
await this._accessToken(),
|
|
188
|
+
reportId
|
|
189
|
+
);
|
|
190
|
+
return reportMappings.map((x) => x.imodelId);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
export const STATUS_CHECK_INTERVAL = 5000;
|
|
6
|
+
export const ANIMATION_DELAY = "5s";
|
|
7
|
+
export const ANIMATION_DURATION = "1s";
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
@import "~@itwin/itwinui-css/scss/variables";
|
|
6
6
|
|
|
7
|
-
.delete-modal-body-text {
|
|
7
|
+
.rcw-delete-modal-body-text {
|
|
8
8
|
display: flex;
|
|
9
9
|
gap: $iui-xs;
|
|
10
10
|
flex-wrap: wrap;
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
>strong {
|
|
12
13
|
min-width: 0px;
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
.rcw-loading-delete {
|
|
17
18
|
margin-right: $iui-s;
|
|
18
|
-
}
|
|
19
|
+
}
|
|
@@ -57,7 +57,7 @@ export const DeleteModal = ({
|
|
|
57
57
|
}}
|
|
58
58
|
>
|
|
59
59
|
<ModalContent>
|
|
60
|
-
<div className="delete-modal-body-text">
|
|
60
|
+
<div className="rcw-delete-modal-body-text">
|
|
61
61
|
<Leading>
|
|
62
62
|
{ReportsConfigWidget.localization.getLocalizedString(
|
|
63
63
|
"ReportsConfigWidget:AreYouSureYouWantToDelete"
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { SvgStatusError } from "@itwin/itwinui-icons-color-react";
|
|
7
|
+
import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
|
|
8
|
+
import { ANIMATION_DELAY, ANIMATION_DURATION } from "../Constants";
|
|
9
|
+
|
|
10
|
+
interface ExtractionStateProps {
|
|
11
|
+
animation: boolean;
|
|
12
|
+
onAnimationEnd: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const FailedExtractionState = ({ animation, onAnimationEnd }: ExtractionStateProps) => (
|
|
16
|
+
<div
|
|
17
|
+
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
18
|
+
"ReportsConfigWidget:Failed"
|
|
19
|
+
)}
|
|
20
|
+
className="rcw-extraction-status"
|
|
21
|
+
>
|
|
22
|
+
<div
|
|
23
|
+
className={`rcw-status-icon`}
|
|
24
|
+
style={{
|
|
25
|
+
animationName: animation ? "rcw-fade-out" : "",
|
|
26
|
+
animationDelay: ANIMATION_DELAY,
|
|
27
|
+
animationDuration: ANIMATION_DURATION,
|
|
28
|
+
}}
|
|
29
|
+
onAnimationEnd={onAnimationEnd}
|
|
30
|
+
>
|
|
31
|
+
<SvgStatusError />
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { SvgStatusPending } from "@itwin/itwinui-icons-color-react";
|
|
7
|
+
import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
|
|
8
|
+
|
|
9
|
+
export const QueuedExtractionState = () => (
|
|
10
|
+
<div
|
|
11
|
+
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
12
|
+
"ReportsConfigWidget:Queued"
|
|
13
|
+
)}
|
|
14
|
+
className="rcw-extraction-status"
|
|
15
|
+
>
|
|
16
|
+
<div className="rcw-status-icon">
|
|
17
|
+
<SvgStatusPending />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { ProgressRadial } from "@itwin/itwinui-react";
|
|
7
|
+
import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
|
|
8
|
+
|
|
9
|
+
export const RunningExtractionState = () => (
|
|
10
|
+
<div
|
|
11
|
+
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
12
|
+
"ReportsConfigWidget:Running"
|
|
13
|
+
)}
|
|
14
|
+
className="rcw-extraction-status-running"
|
|
15
|
+
>
|
|
16
|
+
<ProgressRadial size="x-small" indeterminate />
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { SvgStatusPendingHollow } from "@itwin/itwinui-icons-color-react";
|
|
7
|
+
import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
|
|
8
|
+
|
|
9
|
+
export const StartingExtractionState = () => (
|
|
10
|
+
<div
|
|
11
|
+
title={
|
|
12
|
+
ReportsConfigWidget.localization.getLocalizedString(
|
|
13
|
+
"ReportsConfigWidget:Starting"
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
className="rcw-extraction-status"
|
|
17
|
+
>
|
|
18
|
+
<div className="rcw-status-icon">
|
|
19
|
+
<SvgStatusPendingHollow />
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { SvgStatusSuccess } from "@itwin/itwinui-icons-color-react";
|
|
7
|
+
import { ReportsConfigWidget } from "../../../ReportsConfigWidget";
|
|
8
|
+
import { ANIMATION_DELAY, ANIMATION_DURATION } from "../Constants";
|
|
9
|
+
|
|
10
|
+
interface ExtractionStateProps {
|
|
11
|
+
animation: boolean;
|
|
12
|
+
onAnimationEnd: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const SucceededExtractionState = ({ animation, onAnimationEnd }: ExtractionStateProps) => (
|
|
16
|
+
<div
|
|
17
|
+
title={ReportsConfigWidget.localization.getLocalizedString(
|
|
18
|
+
"ReportsConfigWidget:Success"
|
|
19
|
+
)}
|
|
20
|
+
className="rcw-extraction-status"
|
|
21
|
+
>
|
|
22
|
+
<div
|
|
23
|
+
className={`rcw-status-icon`}
|
|
24
|
+
data-testid="rcw-success-animation"
|
|
25
|
+
style={{
|
|
26
|
+
animationName: animation ? "rcw-fade-out" : "",
|
|
27
|
+
animationDelay: ANIMATION_DELAY,
|
|
28
|
+
animationDuration: ANIMATION_DURATION,
|
|
29
|
+
}}
|
|
30
|
+
onAnimationEnd={onAnimationEnd}
|
|
31
|
+
>
|
|
32
|
+
<SvgStatusSuccess />
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
package/{lib/esm/widget/components/Extraction.scss → src/widget/components/ExtractionStatus.scss}
RENAMED
|
@@ -4,26 +4,27 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
@import "~@itwin/itwinui-css/scss/variables";
|
|
6
6
|
|
|
7
|
-
.extraction-
|
|
8
|
-
display: flex;
|
|
9
|
-
justify-content: space-between;
|
|
7
|
+
.rcw-extraction-status {
|
|
10
8
|
align-items: center;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
height: 38px;
|
|
10
|
+
display: flex;
|
|
11
|
+
|
|
12
|
+
.rcw-status-icon {
|
|
13
|
+
width: $iui-icons-default;
|
|
14
|
+
height: $iui-icons-default;
|
|
15
|
+
align-items: center;
|
|
16
|
+
margin: auto $iui-xs * 3;
|
|
18
17
|
display: flex;
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
.extraction-status {
|
|
23
|
-
display: flex;
|
|
21
|
+
.rcw-extraction-status-running {
|
|
24
22
|
align-items: center;
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
height: 38px;
|
|
24
|
+
display: flex;
|
|
25
|
+
margin: auto $iui-xs * 3;
|
|
26
|
+
|
|
27
|
+
.rcw-status-icon {
|
|
27
28
|
width: $iui-icons-default;
|
|
28
29
|
height: $iui-icons-default;
|
|
29
30
|
}
|
|
@@ -33,7 +34,8 @@
|
|
|
33
34
|
0% {
|
|
34
35
|
opacity: 1;
|
|
35
36
|
}
|
|
37
|
+
|
|
36
38
|
100% {
|
|
37
39
|
opacity: 0;
|
|
38
40
|
}
|
|
39
|
-
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { useEffect, useState } from "react";
|
|
7
|
+
import "./ExtractionStatus.scss";
|
|
8
|
+
import { STATUS_CHECK_INTERVAL } from "./Constants";
|
|
9
|
+
import { StartingExtractionState } from "./ExtractionStates/StartingExtractionState";
|
|
10
|
+
import { RunningExtractionState } from "./ExtractionStates/RunningExtractionState";
|
|
11
|
+
import { FailedExtractionState } from "./ExtractionStates/FailedExtractionState";
|
|
12
|
+
import { QueuedExtractionState } from "./ExtractionStates/QueuedExtractionState";
|
|
13
|
+
import { SucceededExtractionState } from "./ExtractionStates/SucceededExtractionState";
|
|
14
|
+
|
|
15
|
+
export enum ExtractionStates {
|
|
16
|
+
None,
|
|
17
|
+
Starting,
|
|
18
|
+
Queued,
|
|
19
|
+
Running,
|
|
20
|
+
Succeeded,
|
|
21
|
+
Failed,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface ExtractionStatusProps {
|
|
25
|
+
state: ExtractionStates;
|
|
26
|
+
clearExtractionState: () => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const ExtractionStatus = ({
|
|
30
|
+
state,
|
|
31
|
+
clearExtractionState,
|
|
32
|
+
}: ExtractionStatusProps) => {
|
|
33
|
+
const [fadeOut, setFadeOut] = useState<boolean>(false);
|
|
34
|
+
|
|
35
|
+
const onAnimationEnd = () => {
|
|
36
|
+
clearExtractionState();
|
|
37
|
+
setFadeOut(false);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
let timer: number;
|
|
42
|
+
switch (state) {
|
|
43
|
+
case ExtractionStates.Succeeded:
|
|
44
|
+
case ExtractionStates.Failed:
|
|
45
|
+
timer = window.setTimeout(() => setFadeOut(true), STATUS_CHECK_INTERVAL);
|
|
46
|
+
}
|
|
47
|
+
return () => window.clearTimeout(timer);
|
|
48
|
+
}, [state]);
|
|
49
|
+
|
|
50
|
+
switch (state) {
|
|
51
|
+
case ExtractionStates.Starting:
|
|
52
|
+
return (<StartingExtractionState />);
|
|
53
|
+
case ExtractionStates.Queued:
|
|
54
|
+
return (<QueuedExtractionState />);
|
|
55
|
+
case ExtractionStates.Running:
|
|
56
|
+
return (<RunningExtractionState />);
|
|
57
|
+
case ExtractionStates.Succeeded:
|
|
58
|
+
return (<SucceededExtractionState
|
|
59
|
+
animation={fadeOut}
|
|
60
|
+
onAnimationEnd={onAnimationEnd}
|
|
61
|
+
/>);
|
|
62
|
+
case ExtractionStates.Failed:
|
|
63
|
+
return (<FailedExtractionState
|
|
64
|
+
animation={fadeOut}
|
|
65
|
+
onAnimationEnd={onAnimationEnd}
|
|
66
|
+
/>);
|
|
67
|
+
default:
|
|
68
|
+
return <></>;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { Text } from "@itwin/itwinui-react";
|
|
7
|
+
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
8
|
+
|
|
9
|
+
interface SuccessfulExtractionToastProps extends ExtractionToastProps {
|
|
10
|
+
odataFeedUrl: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface ExtractionToastProps {
|
|
14
|
+
iModelName: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const SuccessfulExtractionToast = ({ iModelName, odataFeedUrl }: SuccessfulExtractionToastProps) => {
|
|
18
|
+
const onClick = async (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
await navigator.clipboard.writeText(odataFeedUrl);
|
|
21
|
+
};
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
<Text>{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ExtractionSuccess")}{iModelName}</Text>
|
|
25
|
+
<a
|
|
26
|
+
href="#"
|
|
27
|
+
onClick={onClick}
|
|
28
|
+
>
|
|
29
|
+
{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:CopyODataUrl")}
|
|
30
|
+
</a>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const FailedExtractionToast = ({ iModelName }: ExtractionToastProps) => {
|
|
36
|
+
return (
|
|
37
|
+
<div>
|
|
38
|
+
<Text>{ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:ExtractionFailed")}{iModelName}</Text>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|