@gen3/frontend 0.10.49 → 0.10.51
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/dist/cjs/index.js +2225 -240
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.d.ts +11 -0
- package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.d.ts.map +1 -0
- package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.js +75 -0
- package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.js.map +1 -0
- package/dist/dts/components/Buttons/UploadJSONButton.d.ts +9 -0
- package/dist/dts/components/Buttons/UploadJSONButton.d.ts.map +1 -0
- package/dist/dts/components/Buttons/UploadJSONButton.js +65 -0
- package/dist/dts/components/Buttons/UploadJSONButton.js.map +1 -0
- package/dist/dts/components/Login/CredentialsLogin.d.ts.map +1 -1
- package/dist/dts/components/Login/CredentialsLogin.js +11 -6
- package/dist/dts/components/Login/CredentialsLogin.js.map +1 -1
- package/dist/dts/components/Login/LoginPanel.d.ts.map +1 -1
- package/dist/dts/components/Login/LoginPanel.js +10 -6
- package/dist/dts/components/Login/LoginPanel.js.map +1 -1
- package/dist/dts/components/Login/LoginProvidersPanel.d.ts.map +1 -1
- package/dist/dts/components/Login/LoginProvidersPanel.js +5 -1
- package/dist/dts/components/Login/LoginProvidersPanel.js.map +1 -1
- package/dist/dts/components/MessageCards/CardContainer.d.ts +7 -0
- package/dist/dts/components/MessageCards/CardContainer.d.ts.map +1 -0
- package/dist/dts/components/MessageCards/CardContainer.js +8 -0
- package/dist/dts/components/MessageCards/CardContainer.js.map +1 -0
- package/dist/dts/components/MessageCards/ErrorCard.d.ts +5 -0
- package/dist/dts/components/MessageCards/ErrorCard.d.ts.map +1 -0
- package/dist/dts/components/MessageCards/ErrorCard.js +9 -0
- package/dist/dts/components/MessageCards/ErrorCard.js.map +1 -0
- package/dist/dts/components/MessageCards/MessageCard.d.ts +13 -0
- package/dist/dts/components/MessageCards/MessageCard.d.ts.map +1 -0
- package/dist/dts/components/MessageCards/MessageCard.js +13 -0
- package/dist/dts/components/MessageCards/MessageCard.js.map +1 -0
- package/dist/dts/components/MessageCards/WarningCard.d.ts +5 -0
- package/dist/dts/components/MessageCards/WarningCard.d.ts.map +1 -0
- package/dist/dts/components/MessageCards/WarningCard.js +9 -0
- package/dist/dts/components/MessageCards/WarningCard.js.map +1 -0
- package/dist/dts/components/MessageCards/index.d.ts +6 -0
- package/dist/dts/components/MessageCards/index.d.ts.map +1 -0
- package/dist/dts/components/MessageCards/index.js +6 -0
- package/dist/dts/components/MessageCards/index.js.map +1 -0
- package/dist/dts/components/Profile/ResourcesTable.d.ts.map +1 -1
- package/dist/dts/components/Profile/ResourcesTable.js.map +1 -1
- package/dist/dts/components/Protected/ProtectedContent.d.ts.map +1 -1
- package/dist/dts/components/Protected/ProtectedContent.js +4 -4
- package/dist/dts/components/Protected/ProtectedContent.js.map +1 -1
- package/dist/dts/components/Providers/Gen3Provider.d.ts +1 -1
- package/dist/dts/components/Providers/Gen3Provider.d.ts.map +1 -1
- package/dist/dts/components/Providers/Gen3Provider.js +1 -1
- package/dist/dts/components/Providers/Gen3Provider.js.map +1 -1
- package/dist/dts/components/Providers/ResourceMonitor.d.ts +6 -0
- package/dist/dts/components/Providers/ResourceMonitor.d.ts.map +1 -0
- package/dist/dts/components/Providers/ResourceMonitor.js +105 -0
- package/dist/dts/components/Providers/ResourceMonitor.js.map +1 -0
- package/dist/dts/components/StyledComponents/DarkFunctionButton.d.ts +7 -0
- package/dist/dts/components/StyledComponents/DarkFunctionButton.d.ts.map +1 -0
- package/dist/dts/components/StyledComponents/DarkFunctionButton.js +9 -0
- package/dist/dts/components/StyledComponents/DarkFunctionButton.js.map +1 -0
- package/dist/dts/components/charts/BarChart.d.ts.map +1 -1
- package/dist/dts/components/charts/BarChart.js.map +1 -1
- package/dist/dts/features/Analysis/AnalysisCardEditor.d.ts +3 -0
- package/dist/dts/features/Analysis/AnalysisCardEditor.d.ts.map +1 -0
- package/dist/dts/features/Analysis/AnalysisCardEditor.js +275 -0
- package/dist/dts/features/Analysis/AnalysisCardEditor.js.map +1 -0
- package/dist/dts/features/Analysis/AnalysisCenter.d.ts +5 -0
- package/dist/dts/features/Analysis/AnalysisCenter.d.ts.map +1 -0
- package/dist/dts/features/Analysis/AnalysisCenter.js +68 -0
- package/dist/dts/features/Analysis/AnalysisCenter.js.map +1 -0
- package/dist/dts/features/Analysis/AnalysisPanel.d.ts +4 -0
- package/dist/dts/features/Analysis/AnalysisPanel.d.ts.map +1 -0
- package/dist/dts/features/Analysis/AnalysisPanel.js +8 -0
- package/dist/dts/features/Analysis/AnalysisPanel.js.map +1 -0
- package/dist/dts/features/Analysis/TextDescription.d.ts +7 -0
- package/dist/dts/features/Analysis/TextDescription.d.ts.map +1 -0
- package/dist/dts/features/Analysis/TextDescription.js +11 -0
- package/dist/dts/features/Analysis/TextDescription.js.map +1 -0
- package/dist/dts/features/Analysis/index.d.ts +3 -0
- package/dist/dts/features/Analysis/index.d.ts.map +1 -0
- package/dist/dts/features/Analysis/index.js +3 -0
- package/dist/dts/features/Analysis/index.js.map +1 -0
- package/dist/dts/features/Analysis/types.d.ts +16 -0
- package/dist/dts/features/Analysis/types.d.ts.map +1 -0
- package/dist/dts/features/Analysis/types.js +2 -0
- package/dist/dts/features/Analysis/types.js.map +1 -0
- package/dist/dts/features/CohortBuilder/CohortManager.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortManager.js +1 -1
- package/dist/dts/features/CohortBuilder/CohortManager.js.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.js +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.js.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortSelector.d.ts +10 -0
- package/dist/dts/features/CohortBuilder/CohortSelector.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/CohortSelector.js +20 -0
- package/dist/dts/features/CohortBuilder/CohortSelector.js.map +1 -0
- package/dist/dts/features/CohortBuilder/ExplorerTable/CellRenderers.d.ts +1 -6
- package/dist/dts/features/CohortBuilder/ExplorerTable/CellRenderers.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/ExplorerTable/CellRenderers.js.map +1 -1
- package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/QueryRowDetailsPanel.js +1 -1
- package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/QueryRowDetailsPanel.js.map +1 -1
- package/dist/dts/features/CohortBuilder/ExplorerTable/types.d.ts +9 -3
- package/dist/dts/features/CohortBuilder/ExplorerTable/types.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/QueryExpressionSection.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/QueryExpressionSection.js +8 -6
- package/dist/dts/features/CohortBuilder/QueryExpressionSection.js.map +1 -1
- package/dist/dts/features/CohortBuilder/style.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/style.js +2 -2
- package/dist/dts/features/CohortBuilder/style.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/IndexPanel.js +1 -1
- package/dist/dts/features/CohortDiscovery/IndexPanel.js.map +1 -1
- package/dist/dts/features/CohortDiversity/CohortDiversityApp.js +1 -1
- package/dist/dts/features/CohortDiversity/CohortDiversityApp.js.map +1 -1
- package/dist/dts/features/Dictionary/Cell.d.ts.map +1 -1
- package/dist/dts/features/Dictionary/Cell.js.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/CellRendererFactory.d.ts.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/CellRendererFactory.js +2 -2
- package/dist/dts/features/Discovery/TableRenderers/CellRendererFactory.js.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/CellRenderers.js +2 -2
- package/dist/dts/features/Discovery/TableRenderers/CellRenderers.js.map +1 -1
- package/dist/dts/features/Discovery/TableRenderers/RowRendererFactory.js +2 -2
- package/dist/dts/features/Discovery/TableRenderers/RowRendererFactory.js.map +1 -1
- package/dist/dts/features/Navigation/TopBar.js +1 -1
- package/dist/dts/features/Navigation/TopBar.js.map +1 -1
- package/dist/dts/features/Navigation/Vertical/VerticalTopBar.d.ts.map +1 -1
- package/dist/dts/features/Navigation/Vertical/VerticalTopBar.js.map +1 -1
- package/dist/dts/features/Navigation/types.d.ts +8 -0
- package/dist/dts/features/Navigation/types.d.ts.map +1 -1
- package/dist/dts/features/Theme/ColorTheme.js.map +1 -1
- package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.d.ts +3 -0
- package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.d.ts.map +1 -0
- package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.js +21 -0
- package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.js.map +1 -0
- package/dist/dts/features/Workspace/NotebookCard.d.ts +7 -0
- package/dist/dts/features/Workspace/NotebookCard.d.ts.map +1 -0
- package/dist/dts/features/Workspace/NotebookCard.js +22 -0
- package/dist/dts/features/Workspace/NotebookCard.js.map +1 -0
- package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.d.ts +3 -0
- package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.d.ts.map +1 -0
- package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js +76 -0
- package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js.map +1 -0
- package/dist/dts/features/Workspace/StatusAndControls.d.ts +3 -0
- package/dist/dts/features/Workspace/StatusAndControls.d.ts.map +1 -0
- package/dist/dts/features/Workspace/StatusAndControls.js +28 -0
- package/dist/dts/features/Workspace/StatusAndControls.js.map +1 -0
- package/dist/dts/features/Workspace/Workspace.d.ts +7 -0
- package/dist/dts/features/Workspace/Workspace.d.ts.map +1 -0
- package/dist/dts/features/Workspace/Workspace.js +12 -0
- package/dist/dts/features/Workspace/Workspace.js.map +1 -0
- package/dist/dts/features/Workspace/WorkspaceLaunchProgress.d.ts +3 -0
- package/dist/dts/features/Workspace/WorkspaceLaunchProgress.d.ts.map +1 -0
- package/dist/dts/features/Workspace/WorkspaceLaunchProgress.js +19 -0
- package/dist/dts/features/Workspace/WorkspaceLaunchProgress.js.map +1 -0
- package/dist/dts/features/Workspace/WorkspaceNotebook.d.ts +3 -0
- package/dist/dts/features/Workspace/WorkspaceNotebook.d.ts.map +1 -0
- package/dist/dts/features/Workspace/WorkspaceNotebook.js +11 -0
- package/dist/dts/features/Workspace/WorkspaceNotebook.js.map +1 -0
- package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.d.ts +3 -0
- package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.d.ts.map +1 -0
- package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.js +16 -0
- package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.js.map +1 -0
- package/dist/dts/features/Workspace/WorkspacePanel.d.ts +3 -0
- package/dist/dts/features/Workspace/WorkspacePanel.d.ts.map +1 -0
- package/dist/dts/features/Workspace/WorkspacePanel.js +18 -0
- package/dist/dts/features/Workspace/WorkspacePanel.js.map +1 -0
- package/dist/dts/features/Workspace/WorkspaceProvider.d.ts +9 -0
- package/dist/dts/features/Workspace/WorkspaceProvider.d.ts.map +1 -0
- package/dist/dts/features/Workspace/WorkspaceProvider.js +46 -0
- package/dist/dts/features/Workspace/WorkspaceProvider.js.map +1 -0
- package/dist/dts/features/Workspace/WorkspaceStatusProvider.d.ts +17 -0
- package/dist/dts/features/Workspace/WorkspaceStatusProvider.d.ts.map +1 -0
- package/dist/dts/features/Workspace/WorkspaceStatusProvider.js +103 -0
- package/dist/dts/features/Workspace/WorkspaceStatusProvider.js.map +1 -0
- package/dist/dts/features/Workspace/admin/WorkspaceEditorContext.d.ts +20 -0
- package/dist/dts/features/Workspace/admin/WorkspaceEditorContext.d.ts.map +1 -0
- package/dist/dts/features/Workspace/admin/WorkspaceEditorContext.js +78 -0
- package/dist/dts/features/Workspace/admin/WorkspaceEditorContext.js.map +1 -0
- package/dist/dts/features/Workspace/admin/WorkspacePanelForm.d.ts +4 -0
- package/dist/dts/features/Workspace/admin/WorkspacePanelForm.d.ts.map +1 -0
- package/dist/dts/features/Workspace/admin/WorkspacePanelForm.js +46 -0
- package/dist/dts/features/Workspace/admin/WorkspacePanelForm.js.map +1 -0
- package/dist/dts/features/Workspace/admin/WorkspacePanelsEditor.d.ts +3 -0
- package/dist/dts/features/Workspace/admin/WorkspacePanelsEditor.d.ts.map +1 -0
- package/dist/dts/features/Workspace/admin/WorkspacePanelsEditor.js +7 -0
- package/dist/dts/features/Workspace/admin/WorkspacePanelsEditor.js.map +1 -0
- package/dist/dts/features/Workspace/calculateLaunchSteps.d.ts +6 -0
- package/dist/dts/features/Workspace/calculateLaunchSteps.d.ts.map +1 -0
- package/dist/dts/features/Workspace/calculateLaunchSteps.js +101 -0
- package/dist/dts/features/Workspace/calculateLaunchSteps.js.map +1 -0
- package/dist/dts/features/Workspace/constants.d.ts +8 -0
- package/dist/dts/features/Workspace/constants.d.ts.map +1 -0
- package/dist/dts/features/Workspace/constants.js +24 -0
- package/dist/dts/features/Workspace/constants.js.map +1 -0
- package/dist/dts/features/Workspace/index.d.ts +3 -3
- package/dist/dts/features/Workspace/index.d.ts.map +1 -1
- package/dist/dts/features/Workspace/index.js +2 -2
- package/dist/dts/features/Workspace/index.js.map +1 -1
- package/dist/dts/features/Workspace/test/calculateLaunchSteps.unit.test.d.ts +2 -0
- package/dist/dts/features/Workspace/test/calculateLaunchSteps.unit.test.d.ts.map +1 -0
- package/dist/dts/features/Workspace/test/calculateLaunchSteps.unit.test.js +105 -0
- package/dist/dts/features/Workspace/test/calculateLaunchSteps.unit.test.js.map +1 -0
- package/dist/dts/features/Workspace/types.d.ts +26 -1
- package/dist/dts/features/Workspace/types.d.ts.map +1 -1
- package/dist/dts/features/Workspace/utils.d.ts +2 -0
- package/dist/dts/features/Workspace/utils.d.ts.map +1 -0
- package/dist/dts/features/Workspace/utils.js +8 -0
- package/dist/dts/features/Workspace/utils.js.map +1 -0
- package/dist/dts/index.d.ts +13 -4
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/index.js +12 -4
- package/dist/dts/index.js.map +1 -1
- package/dist/dts/lib/content/ContentDatabase.d.ts +1 -0
- package/dist/dts/lib/content/ContentDatabase.d.ts.map +1 -1
- package/dist/dts/lib/content/ContentDatabase.js +8 -0
- package/dist/dts/lib/content/ContentDatabase.js.map +1 -1
- package/dist/dts/lib/content/filesystem.d.ts +2 -1
- package/dist/dts/lib/content/filesystem.d.ts.map +1 -1
- package/dist/dts/lib/content/filesystem.js +28 -0
- package/dist/dts/lib/content/filesystem.js.map +1 -1
- package/dist/dts/lib/content/types.d.ts +1 -0
- package/dist/dts/lib/content/types.d.ts.map +1 -1
- package/dist/dts/lib/session/session.d.ts.map +1 -1
- package/dist/dts/lib/session/session.js +4 -2
- package/dist/dts/lib/session/session.js.map +1 -1
- package/dist/dts/pages/Analysis/Analysis.d.ts +4 -0
- package/dist/dts/pages/Analysis/Analysis.d.ts.map +1 -0
- package/dist/dts/pages/Analysis/Analysis.js +13 -0
- package/dist/dts/pages/Analysis/Analysis.js.map +1 -0
- package/dist/dts/pages/Analysis/data.d.ts +4 -0
- package/dist/dts/pages/Analysis/data.d.ts.map +1 -0
- package/dist/dts/pages/Analysis/data.js +78 -0
- package/dist/dts/pages/Analysis/data.js.map +1 -0
- package/dist/dts/pages/Analysis/index.d.ts +3 -0
- package/dist/dts/pages/Analysis/index.d.ts.map +1 -0
- package/dist/dts/pages/Analysis/index.js +3 -0
- package/dist/dts/pages/Analysis/index.js.map +1 -0
- package/dist/dts/pages/Analysis/types.d.ts +6 -0
- package/dist/dts/pages/Analysis/types.d.ts.map +1 -0
- package/dist/dts/pages/Analysis/types.js +2 -0
- package/dist/dts/pages/Analysis/types.js.map +1 -0
- package/dist/dts/pages/Explorer/Explorer.d.ts.map +1 -1
- package/dist/dts/pages/Explorer/Explorer.js.map +1 -1
- package/dist/dts/pages/Explorer/index.d.ts +1 -0
- package/dist/dts/pages/Explorer/index.d.ts.map +1 -1
- package/dist/dts/pages/Explorer/index.js +1 -0
- package/dist/dts/pages/Explorer/index.js.map +1 -1
- package/dist/dts/pages/NotebookLite/NotebookLite.d.ts +4 -0
- package/dist/dts/pages/NotebookLite/NotebookLite.d.ts.map +1 -0
- package/dist/dts/pages/NotebookLite/NotebookLite.js +12 -0
- package/dist/dts/pages/NotebookLite/NotebookLite.js.map +1 -0
- package/dist/dts/pages/NotebookLite/data.d.ts +3 -0
- package/dist/dts/pages/NotebookLite/data.d.ts.map +1 -0
- package/dist/dts/pages/NotebookLite/data.js +62 -0
- package/dist/dts/pages/NotebookLite/data.js.map +1 -0
- package/dist/dts/pages/NotebookLite/index.d.ts +3 -0
- package/dist/dts/pages/NotebookLite/index.d.ts.map +1 -0
- package/dist/dts/pages/NotebookLite/index.js +3 -0
- package/dist/dts/pages/NotebookLite/index.js.map +1 -0
- package/dist/dts/pages/Workspace/Workspace.d.ts +4 -0
- package/dist/dts/pages/Workspace/Workspace.d.ts.map +1 -0
- package/dist/dts/pages/Workspace/Workspace.js +13 -0
- package/dist/dts/pages/Workspace/Workspace.js.map +1 -0
- package/dist/dts/pages/Workspace/WorkspaceNoAccess.d.ts +4 -0
- package/dist/dts/pages/Workspace/WorkspaceNoAccess.d.ts.map +1 -0
- package/dist/dts/pages/Workspace/WorkspaceNoAccess.js +15 -0
- package/dist/dts/pages/Workspace/WorkspaceNoAccess.js.map +1 -0
- package/dist/dts/pages/Workspace/data.d.ts +4 -2
- package/dist/dts/pages/Workspace/data.d.ts.map +1 -1
- package/dist/dts/pages/Workspace/data.js +33 -6
- package/dist/dts/pages/Workspace/data.js.map +1 -1
- package/dist/dts/pages/Workspace/index.d.ts +4 -2
- package/dist/dts/pages/Workspace/index.d.ts.map +1 -1
- package/dist/dts/pages/Workspace/index.js +4 -2
- package/dist/dts/pages/Workspace/index.js.map +1 -1
- package/dist/dts/pages/Workspace/types.d.ts +3 -3
- package/dist/dts/pages/Workspace/types.d.ts.map +1 -1
- package/dist/dts/pages/admin/Workspace/WorkspaceNotebooks.d.ts +7 -0
- package/dist/dts/pages/admin/Workspace/WorkspaceNotebooks.d.ts.map +1 -0
- package/dist/dts/pages/admin/Workspace/WorkspaceNotebooks.js +13 -0
- package/dist/dts/pages/admin/Workspace/WorkspaceNotebooks.js.map +1 -0
- package/dist/dts/pages/admin/Workspace/data.d.ts +2 -0
- package/dist/dts/pages/admin/Workspace/data.d.ts.map +1 -0
- package/dist/dts/pages/admin/Workspace/data.js +45 -0
- package/dist/dts/pages/admin/Workspace/data.js.map +1 -0
- package/dist/dts/pages/admin/Workspace/index.d.ts +3 -0
- package/dist/dts/pages/admin/Workspace/index.d.ts.map +1 -0
- package/dist/dts/pages/admin/Workspace/index.js +3 -0
- package/dist/dts/pages/admin/Workspace/index.js.map +1 -0
- package/dist/dts/pages/admin/analysis/Analysis.d.ts +7 -0
- package/dist/dts/pages/admin/analysis/Analysis.d.ts.map +1 -0
- package/dist/dts/pages/admin/analysis/Analysis.js +13 -0
- package/dist/dts/pages/admin/analysis/Analysis.js.map +1 -0
- package/dist/dts/pages/admin/analysis/data.d.ts +9 -0
- package/dist/dts/pages/admin/analysis/data.d.ts.map +1 -0
- package/dist/dts/pages/admin/analysis/data.js +76 -0
- package/dist/dts/pages/admin/analysis/data.js.map +1 -0
- package/dist/dts/pages/admin/authz/index.d.ts.map +1 -1
- package/dist/dts/pages/admin/authz/index.js.map +1 -1
- package/dist/dts/utils/RendererFactory.d.ts.map +1 -1
- package/dist/dts/utils/RendererFactory.js +1 -0
- package/dist/dts/utils/RendererFactory.js.map +1 -1
- package/dist/dts/utils/download.d.ts.map +1 -1
- package/dist/dts/utils/download.js.map +1 -1
- package/dist/esm/index.js +2224 -248
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +108 -26
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/dist/dts/components/FilterPanel.d.ts +0 -1
- package/dist/dts/components/FilterPanel.d.ts.map +0 -1
- package/dist/dts/components/FilterPanel.js +0 -2
- package/dist/dts/components/FilterPanel.js.map +0 -1
- package/dist/dts/components/Login/utils.d.ts +0 -1
- package/dist/dts/components/Login/utils.d.ts.map +0 -1
- package/dist/dts/components/Login/utils.js +0 -2
- package/dist/dts/components/Login/utils.js.map +0 -1
- package/dist/dts/features/Submission/Tables/hooks.d.ts +0 -1
- package/dist/dts/features/Submission/Tables/hooks.d.ts.map +0 -1
- package/dist/dts/features/Submission/Tables/hooks.js +0 -2
- package/dist/dts/features/Submission/Tables/hooks.js.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -37,15 +37,17 @@ var MiniSearch = require('minisearch');
|
|
|
37
37
|
var uniq = require('lodash/uniq');
|
|
38
38
|
var sum = require('lodash/sum');
|
|
39
39
|
var remarkGfm = require('remark-gfm');
|
|
40
|
+
var iconsReact = require('@tabler/icons-react');
|
|
40
41
|
var reactCookie = require('react-cookie');
|
|
41
42
|
var FileSaver = require('file-saver');
|
|
42
43
|
var defaultComposer = require('default-composer');
|
|
43
|
-
var bs = require('react-icons/bs');
|
|
44
44
|
var tw = require('tailwind-styled-components');
|
|
45
45
|
require('universal-cookie');
|
|
46
46
|
var ri = require('react-icons/ri');
|
|
47
47
|
var io = require('react-icons/io');
|
|
48
48
|
var GraphiQL = require('graphiql');
|
|
49
|
+
var modals = require('@mantine/modals');
|
|
50
|
+
var bs = require('react-icons/bs');
|
|
49
51
|
var fs = require('fs');
|
|
50
52
|
var path = require('path');
|
|
51
53
|
var react$1 = require('redux-persist/integration/react');
|
|
@@ -53,11 +55,11 @@ var reduxPersist = require('redux-persist');
|
|
|
53
55
|
var redux = require('redux');
|
|
54
56
|
var storage = require('redux-persist/lib/storage');
|
|
55
57
|
var toolkit = require('@reduxjs/toolkit');
|
|
56
|
-
var modals = require('@mantine/modals');
|
|
57
58
|
var dynamic = require('next/dynamic');
|
|
58
59
|
var form = require('@mantine/form');
|
|
59
60
|
var YAML = require('yaml');
|
|
60
61
|
var filesize = require('filesize');
|
|
62
|
+
var dnd = require('@hello-pangea/dnd');
|
|
61
63
|
var plugin = require('tailwindcss/plugin');
|
|
62
64
|
var cookie = require('cookie');
|
|
63
65
|
|
|
@@ -378,6 +380,107 @@ const useManageSession = (userStatus)=>{
|
|
|
378
380
|
return session;
|
|
379
381
|
};
|
|
380
382
|
|
|
383
|
+
const WorkspacePollingInterval = {
|
|
384
|
+
'Not Found': 0,
|
|
385
|
+
Launching: 5000,
|
|
386
|
+
Terminating: 5000,
|
|
387
|
+
Running: 300000,
|
|
388
|
+
Stopped: 5000,
|
|
389
|
+
Errored: 10000,
|
|
390
|
+
'Status Error': 0
|
|
391
|
+
};
|
|
392
|
+
const workspaceShutdownAlertLimit = 30000; // 5 minutes: 5 * 60 * 1000 TODO Figure how to configure this
|
|
393
|
+
/**
|
|
394
|
+
* Monitors resource usage.
|
|
395
|
+
* Currently, handles workspace, payment and idle status
|
|
396
|
+
*/ const useResourceMonitor = ()=>{
|
|
397
|
+
const [pollingInterval, setPollingInterval] = React.useState(0);
|
|
398
|
+
const { data: workspaceStatusData, isError: isWorkspaceStatusError, isSuccess: isWorkspaceStatusSuccess, refetch } = core.useGetWorkspaceStatusQuery(undefined, {
|
|
399
|
+
pollingInterval: pollingInterval,
|
|
400
|
+
refetchOnMountOrArgChange: 1800,
|
|
401
|
+
refetchOnFocus: true
|
|
402
|
+
});
|
|
403
|
+
const [terminateWorkspace] = core.useTerminateWorkspaceMutation();
|
|
404
|
+
const requestedStatus = core.useCoreSelector(core.selectRequestedWorkspaceStatus);
|
|
405
|
+
const dispatch = core.useCoreDispatch();
|
|
406
|
+
useDeepCompare.useDeepCompareEffect(()=>{
|
|
407
|
+
if (requestedStatus === 'Launching') {
|
|
408
|
+
setPollingInterval(WorkspacePollingInterval[core.WorkspaceStatus.Launching]);
|
|
409
|
+
refetch();
|
|
410
|
+
}
|
|
411
|
+
if (requestedStatus === 'Terminating') {
|
|
412
|
+
setPollingInterval(WorkspacePollingInterval[core.WorkspaceStatus.Terminating]);
|
|
413
|
+
}
|
|
414
|
+
}, [
|
|
415
|
+
requestedStatus
|
|
416
|
+
]);
|
|
417
|
+
useDeepCompare.useDeepCompareEffect(()=>{
|
|
418
|
+
if (!workspaceStatusData) return;
|
|
419
|
+
if (isWorkspaceStatusError) {
|
|
420
|
+
dispatch(core.setActiveWorkspaceStatus(core.WorkspaceStatus.StatusError));
|
|
421
|
+
setPollingInterval(0); // stop polling
|
|
422
|
+
}
|
|
423
|
+
if (workspaceStatusData.status === core.WorkspaceStatus.Running) {
|
|
424
|
+
// in some state other than idle
|
|
425
|
+
if (!workspaceStatusData.idleTimeLimit || workspaceStatusData.idleTimeLimit < 0) {
|
|
426
|
+
// Do not need to poll
|
|
427
|
+
dispatch(core.setActiveWorkspaceStatus(workspaceStatusData.status));
|
|
428
|
+
setPollingInterval(0);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
if (workspaceStatusData?.idleTimeLimit && workspaceStatusData.idleTimeLimit > 0 && workspaceStatusData.lastActivityTime > 0) {
|
|
432
|
+
const remainingWorkspaceKernelLife = workspaceStatusData.idleTimeLimit - (Date.now() - workspaceStatusData.lastActivityTime);
|
|
433
|
+
if (remainingWorkspaceKernelLife <= 0) {
|
|
434
|
+
// kernel has died due to inactivity
|
|
435
|
+
terminateWorkspace();
|
|
436
|
+
setPollingInterval(WorkspacePollingInterval[core.WorkspaceStatus.Terminating]);
|
|
437
|
+
dispatch(core.setActiveWorkspaceStatus(core.WorkspaceStatus.Terminating));
|
|
438
|
+
notifications.notifications.show({
|
|
439
|
+
title: 'Workspace Shutdown',
|
|
440
|
+
message: 'Workspace has been idle for too long. Shutting workspace down',
|
|
441
|
+
position: 'top-center'
|
|
442
|
+
});
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
if (remainingWorkspaceKernelLife <= workspaceShutdownAlertLimit) {
|
|
446
|
+
// TODO change running refresh to handle this
|
|
447
|
+
notifications.notifications.show({
|
|
448
|
+
title: 'Workspace Warning',
|
|
449
|
+
message: 'Workspace has been idle for too long. Will shutdown soon',
|
|
450
|
+
position: 'top-center'
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
if (requestedStatus === 'Launching') {
|
|
455
|
+
dispatch(core.setRequestedWorkspaceStatus('NotSet'));
|
|
456
|
+
}
|
|
457
|
+
if (requestedStatus === 'Terminating') {
|
|
458
|
+
refetch();
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
dispatch(core.setActiveWorkspaceStatus(workspaceStatusData.status));
|
|
462
|
+
setPollingInterval(WorkspacePollingInterval[workspaceStatusData.status]);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
if (workspaceStatusData.status === core.WorkspaceStatus.NotFound) {
|
|
466
|
+
if (requestedStatus !== 'Launching') {
|
|
467
|
+
// need to consider that if in launchState might get a number of NotFound status before Launching
|
|
468
|
+
setPollingInterval(WorkspacePollingInterval[core.WorkspaceStatus.NotFound]);
|
|
469
|
+
dispatch(core.setActiveWorkspaceStatus(core.WorkspaceStatus.NotFound));
|
|
470
|
+
}
|
|
471
|
+
if (requestedStatus === 'Terminating') dispatch(core.setRequestedWorkspaceStatus('NotSet'));
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
dispatch(core.setActiveWorkspaceStatus(workspaceStatusData.status));
|
|
475
|
+
setPollingInterval(WorkspacePollingInterval[workspaceStatusData.status]);
|
|
476
|
+
}, [
|
|
477
|
+
dispatch,
|
|
478
|
+
workspaceStatusData,
|
|
479
|
+
isWorkspaceStatusError,
|
|
480
|
+
requestedStatus
|
|
481
|
+
]);
|
|
482
|
+
};
|
|
483
|
+
|
|
381
484
|
const MinutesToMilliseconds = (minutes)=>minutes * 60 * 1000;
|
|
382
485
|
const logoutSession = async ()=>{
|
|
383
486
|
await fetch(`${core.GEN3_FENCE_API}/user/logout?next=${core.GEN3_REDIRECT_URL}/`, {
|
|
@@ -452,6 +555,7 @@ const UPDATE_SESSION_LIMIT = MinutesToMilliseconds(5);
|
|
|
452
555
|
*/ const SessionProvider = ({ children, session, updateSessionTime = 5, inactiveTimeLimit = 20, workspaceInactivityTimeLimit = 0, logoutInactiveUsers = true })=>{
|
|
453
556
|
const router$1 = router.useRouter();
|
|
454
557
|
const coreDispatch = core.useCoreDispatch();
|
|
558
|
+
useResourceMonitor();
|
|
455
559
|
const [getUserDetails] = core.useLazyFetchUserDetailsQuery(); // Fetch user details
|
|
456
560
|
const userStatus = core.useCoreSelector((state)=>core.selectUserAuthStatus(state));
|
|
457
561
|
const [mostRecentActivityTimestamp, setMostRecentActivityTimestamp] = React.useState(Date.now());
|
|
@@ -500,14 +604,14 @@ const UPDATE_SESSION_LIMIT = MinutesToMilliseconds(5);
|
|
|
500
604
|
if (isUserOnPage('Login')) return;
|
|
501
605
|
const timeSinceLastActivity = Date.now() - mostRecentActivityTimestamp;
|
|
502
606
|
if (logoutInactiveUsers) {
|
|
503
|
-
if (timeSinceLastActivity >= inactiveTimeLimitMilliseconds && !isUserOnPage('
|
|
607
|
+
if (timeSinceLastActivity >= inactiveTimeLimitMilliseconds && !isUserOnPage('Workspace')) {
|
|
504
608
|
coreDispatch(core.showModal({
|
|
505
609
|
modal: core.Modals.SessionExpireModal
|
|
506
610
|
}));
|
|
507
611
|
endSession();
|
|
508
612
|
return;
|
|
509
613
|
}
|
|
510
|
-
if (workspaceInactivityTimeLimitMilliseconds > 0 && timeSinceLastActivity >= workspaceInactivityTimeLimitMilliseconds && isUserOnPage('
|
|
614
|
+
if (workspaceInactivityTimeLimitMilliseconds > 0 && timeSinceLastActivity >= workspaceInactivityTimeLimitMilliseconds && isUserOnPage('Workspace')) {
|
|
511
615
|
coreDispatch(core.showModal({
|
|
512
616
|
modal: core.Modals.SessionExpireModal
|
|
513
617
|
}));
|
|
@@ -678,7 +782,7 @@ const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, c
|
|
|
678
782
|
className: "flex items-center align-middle",
|
|
679
783
|
children: [
|
|
680
784
|
processTopBarItems(items, loginButtonVisibility === LoginButtonVisibility.Visible),
|
|
681
|
-
loginButtonVisibility != LoginButtonVisibility.
|
|
785
|
+
loginButtonVisibility != LoginButtonVisibility.Hidden ? /*#__PURE__*/ jsxRuntime.jsx(LoginAccountButton, {}) : null,
|
|
682
786
|
loginButtonVisibility != LoginButtonVisibility.Hidden ? /*#__PURE__*/ jsxRuntime.jsx(LoginButton, {
|
|
683
787
|
visibility: loginButtonVisibility
|
|
684
788
|
}) : null
|
|
@@ -1216,8 +1320,8 @@ class DiscoveryCellRendererFactory {
|
|
|
1216
1320
|
DiscoveryCellRendererFactory.getInstance().cellRendererCatalog[type][functionName] = func;
|
|
1217
1321
|
}
|
|
1218
1322
|
static registerCellRendererCatalog(catalog) {
|
|
1219
|
-
Object.keys(catalog).
|
|
1220
|
-
Object.entries(catalog[type]).
|
|
1323
|
+
Object.keys(catalog).forEach((type)=>{
|
|
1324
|
+
Object.entries(catalog[type]).forEach(([name, func])=>{
|
|
1221
1325
|
DiscoveryCellRendererFactory.registerCellRenderer(type, name, func);
|
|
1222
1326
|
});
|
|
1223
1327
|
});
|
|
@@ -1289,8 +1393,8 @@ class DiscoveryRowRendererFactory {
|
|
|
1289
1393
|
DiscoveryRowRendererFactory.getInstance().RowRendererCatalog[type][functionName] = func;
|
|
1290
1394
|
}
|
|
1291
1395
|
static registerRowRendererCatalog(catalog) {
|
|
1292
|
-
Object.keys(catalog).
|
|
1293
|
-
Object.entries(catalog[type]).
|
|
1396
|
+
Object.keys(catalog).forEach((type)=>{
|
|
1397
|
+
Object.entries(catalog[type]).forEach(([name, func])=>{
|
|
1294
1398
|
DiscoveryRowRendererFactory.registerRowRenderer(type, name, func);
|
|
1295
1399
|
});
|
|
1296
1400
|
});
|
|
@@ -1655,11 +1759,11 @@ const RenderYearOfBirthRestricted = ({ value }, params)=>{
|
|
|
1655
1759
|
}
|
|
1656
1760
|
// Check if the content is a string and represents a year less than 1935
|
|
1657
1761
|
let displayContent;
|
|
1658
|
-
if (typeof content === 'string' && !isNaN(Number(content)) && Number(content) < 1935) {
|
|
1762
|
+
if (typeof content === 'string' && !Number.isNaN(Number(content)) && Number(content) < 1935) {
|
|
1659
1763
|
displayContent = '1935';
|
|
1660
1764
|
} else if (lodash.isArray(content)) {
|
|
1661
1765
|
displayContent = content.map((item)=>{
|
|
1662
|
-
if (typeof item === 'string' && !isNaN(Number(item)) && Number(item) < 1935) {
|
|
1766
|
+
if (typeof item === 'string' && !Number.isNaN(Number(item)) && Number(item) < 1935) {
|
|
1663
1767
|
return '1935';
|
|
1664
1768
|
}
|
|
1665
1769
|
return item;
|
|
@@ -3035,6 +3139,7 @@ class RenderFactoryTypedInstance {
|
|
|
3035
3139
|
}
|
|
3036
3140
|
getRenderer(type, functionName) {
|
|
3037
3141
|
if (!this.rendererExists(type, functionName)) {
|
|
3142
|
+
console.warn('[RenderFactory] Renderer function not found for type: ', type, ' and function name: ', functionName, '. Using default renderer instead.');
|
|
3038
3143
|
return DefaultItemRenderer;
|
|
3039
3144
|
}
|
|
3040
3145
|
return this.catalog[type][functionName];
|
|
@@ -5628,6 +5733,51 @@ const useResourcesContext = ()=>{
|
|
|
5628
5733
|
});
|
|
5629
5734
|
};
|
|
5630
5735
|
|
|
5736
|
+
const CardContainer = ({ children })=>/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
5737
|
+
className: "flex justify-center pt-2 items-center",
|
|
5738
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Card, {
|
|
5739
|
+
shadow: "sm",
|
|
5740
|
+
p: "md",
|
|
5741
|
+
className: "bg-base-lightest border-2 border-base-lighter",
|
|
5742
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Group, {
|
|
5743
|
+
align: "center",
|
|
5744
|
+
wrap: "nowrap",
|
|
5745
|
+
children: children
|
|
5746
|
+
})
|
|
5747
|
+
})
|
|
5748
|
+
});
|
|
5749
|
+
|
|
5750
|
+
const MessageText = ({ message, color })=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
5751
|
+
c: color,
|
|
5752
|
+
size: "md",
|
|
5753
|
+
fw: 500,
|
|
5754
|
+
children: message
|
|
5755
|
+
});
|
|
5756
|
+
const MessageCard = ({ message, icon, size = 'lg', color = 'utility.5' })=>/*#__PURE__*/ jsxRuntime.jsxs(CardContainer, {
|
|
5757
|
+
children: [
|
|
5758
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.ThemeIcon, {
|
|
5759
|
+
color: color,
|
|
5760
|
+
variant: "outline",
|
|
5761
|
+
radius: "xl",
|
|
5762
|
+
size: size,
|
|
5763
|
+
children: icon
|
|
5764
|
+
}),
|
|
5765
|
+
/*#__PURE__*/ jsxRuntime.jsx(MessageText, {
|
|
5766
|
+
message: message,
|
|
5767
|
+
color: color
|
|
5768
|
+
}),
|
|
5769
|
+
' '
|
|
5770
|
+
]
|
|
5771
|
+
});
|
|
5772
|
+
|
|
5773
|
+
const ErrorCard = ({ message })=>/*#__PURE__*/ jsxRuntime.jsx(MessageCard, {
|
|
5774
|
+
message: message,
|
|
5775
|
+
icon: /*#__PURE__*/ jsxRuntime.jsx(iconsReact.IconAlertTriangle, {
|
|
5776
|
+
size: 24
|
|
5777
|
+
}),
|
|
5778
|
+
color: "utility.3"
|
|
5779
|
+
});
|
|
5780
|
+
|
|
5631
5781
|
const LoginProviderMultipleItems = ({ provider, handleLoginSelected })=>{
|
|
5632
5782
|
const [value, setValue] = React.useState(null);
|
|
5633
5783
|
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
@@ -5670,7 +5820,12 @@ const LoginProviderSingleItem = ({ provider, handleLoginSelected })=>{
|
|
|
5670
5820
|
}, provider.name);
|
|
5671
5821
|
};
|
|
5672
5822
|
const LoginProvidersPanel = ({ handleLoginSelected })=>{
|
|
5673
|
-
const { data, isSuccess } = core.useGetLoginProvidersQuery();
|
|
5823
|
+
const { data, isSuccess, isError } = core.useGetLoginProvidersQuery();
|
|
5824
|
+
if (isError) {
|
|
5825
|
+
return /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
5826
|
+
message: 'request to authentication service failed'
|
|
5827
|
+
});
|
|
5828
|
+
}
|
|
5674
5829
|
if (!isSuccess) {
|
|
5675
5830
|
return /*#__PURE__*/ jsxRuntime.jsx(core$1.LoadingOverlay, {
|
|
5676
5831
|
visible: !isSuccess
|
|
@@ -5715,6 +5870,7 @@ const CredentialsLogin = ({ handleLogin })=>{
|
|
|
5715
5870
|
const sessionContext = React.useContext(SessionContext);
|
|
5716
5871
|
const [credentials, setCredentials] = React.useState(null);
|
|
5717
5872
|
const [file, setFile] = React.useState(null);
|
|
5873
|
+
const [isCredentialsPending, setIsCredentialsPending] = React.useState(false);
|
|
5718
5874
|
React.useEffect(()=>{
|
|
5719
5875
|
if (file) {
|
|
5720
5876
|
const reader = new FileReader();
|
|
@@ -5727,8 +5883,10 @@ const CredentialsLogin = ({ handleLogin })=>{
|
|
|
5727
5883
|
file
|
|
5728
5884
|
]);
|
|
5729
5885
|
const handleCredentialsLogin = React.useCallback(async (credentials)=>{
|
|
5886
|
+
setIsCredentialsPending(true);
|
|
5730
5887
|
const updateSession = sessionContext?.updateSession ?? (()=>null);
|
|
5731
5888
|
try {
|
|
5889
|
+
// setIsCredentialsPending(true);
|
|
5732
5890
|
const json = await JSON.parse(credentials);
|
|
5733
5891
|
await fetch('/api/auth/credentialsLogin', {
|
|
5734
5892
|
method: 'POST',
|
|
@@ -5744,6 +5902,8 @@ const CredentialsLogin = ({ handleLogin })=>{
|
|
|
5744
5902
|
title: 'Format Error',
|
|
5745
5903
|
message: 'JSON is not valid'
|
|
5746
5904
|
});
|
|
5905
|
+
} finally{
|
|
5906
|
+
setIsCredentialsPending(false); // Set loading to false once fetch is done (success or fail)
|
|
5747
5907
|
}
|
|
5748
5908
|
}, [
|
|
5749
5909
|
handleLogin,
|
|
@@ -5791,6 +5951,7 @@ const CredentialsLogin = ({ handleLogin })=>{
|
|
|
5791
5951
|
}),
|
|
5792
5952
|
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
5793
5953
|
color: "blue",
|
|
5954
|
+
loading: isCredentialsPending,
|
|
5794
5955
|
onClick: async ()=>{
|
|
5795
5956
|
await handleCredentialsLogin(credentials ?? '');
|
|
5796
5957
|
},
|
|
@@ -5946,7 +6107,13 @@ const LoginPanel = (loginConfig)=>{
|
|
|
5946
6107
|
router$1
|
|
5947
6108
|
]);
|
|
5948
6109
|
const handleCredentialsLogin = React.useCallback(async ()=>{
|
|
5949
|
-
|
|
6110
|
+
const redirect = !referer ? '/' : lodash.isArray(referer) ? referer[0] : referer;
|
|
6111
|
+
router$1.push(redirect).catch((e)=>{
|
|
6112
|
+
notifications.showNotification({
|
|
6113
|
+
title: 'Login Error',
|
|
6114
|
+
message: `error logging in ${e.message}`
|
|
6115
|
+
});
|
|
6116
|
+
});
|
|
5950
6117
|
}, [
|
|
5951
6118
|
referer,
|
|
5952
6119
|
router$1
|
|
@@ -6374,44 +6541,6 @@ const Gen3ModalsProvider = ({ config, children })=>{
|
|
|
6374
6541
|
});
|
|
6375
6542
|
};
|
|
6376
6543
|
|
|
6377
|
-
const ErrorMessage = ({ message })=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
6378
|
-
color: "utility.4",
|
|
6379
|
-
size: "md",
|
|
6380
|
-
fw: "md",
|
|
6381
|
-
children: message
|
|
6382
|
-
});
|
|
6383
|
-
const CardContainer = ({ children })=>/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
6384
|
-
className: "flex justify-center pt-10 items-center",
|
|
6385
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Card, {
|
|
6386
|
-
shadow: "sm",
|
|
6387
|
-
p: "lg",
|
|
6388
|
-
className: "bg-base-lightest border-2 border-base-lighter",
|
|
6389
|
-
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
6390
|
-
align: "center",
|
|
6391
|
-
children: [
|
|
6392
|
-
/*#__PURE__*/ jsxRuntime.jsx(core$1.ThemeIcon, {
|
|
6393
|
-
color: "utility.4",
|
|
6394
|
-
variant: "outline",
|
|
6395
|
-
radius: "xl",
|
|
6396
|
-
size: "lg",
|
|
6397
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(bs.BsExclamationTriangle, {
|
|
6398
|
-
size: 24
|
|
6399
|
-
})
|
|
6400
|
-
}),
|
|
6401
|
-
children
|
|
6402
|
-
]
|
|
6403
|
-
})
|
|
6404
|
-
})
|
|
6405
|
-
});
|
|
6406
|
-
const ErrorCard = ({ message })=>/*#__PURE__*/ jsxRuntime.jsxs(CardContainer, {
|
|
6407
|
-
children: [
|
|
6408
|
-
/*#__PURE__*/ jsxRuntime.jsx(ErrorMessage, {
|
|
6409
|
-
message: message
|
|
6410
|
-
}),
|
|
6411
|
-
' '
|
|
6412
|
-
]
|
|
6413
|
-
});
|
|
6414
|
-
|
|
6415
6544
|
const getAllFieldsFromFilterConfigs = (filterTabConfigs)=>filterTabConfigs.reduce((acc, cur)=>acc.concat(cur.fields), []);
|
|
6416
6545
|
const processBucketData = (data)=>{
|
|
6417
6546
|
if (!data) return {};
|
|
@@ -8231,20 +8360,133 @@ const convertFilterToComponent = (filter, index, path = '.')=>{
|
|
|
8231
8360
|
};
|
|
8232
8361
|
|
|
8233
8362
|
const getCombinedClassesExpandCollapseQuery = (allQueryExpressionsCollapsed)=>{
|
|
8234
|
-
const baseClasses = 'flex gap-0 items-center border-1 border-base-max rounded-md
|
|
8363
|
+
const baseClasses = 'flex gap-0 items-center border-1 border-base-max rounded-md';
|
|
8235
8364
|
const dynamicClasses = allQueryExpressionsCollapsed ? 'text-primary bg-base-max' : 'text-base-max bg-transparent';
|
|
8236
8365
|
const disabledClasses = 'disabled:opacity-50';
|
|
8237
8366
|
const enabledHoverClasses = 'enabled:hover:bg-primary-darkest enabled:hover:text-primary-content-lightest enabled:hover:border-primary-darkest';
|
|
8238
8367
|
return `${dynamicClasses} ${disabledClasses} ${enabledHoverClasses} ${baseClasses}`;
|
|
8239
8368
|
};
|
|
8240
8369
|
const getCombinedClassesForRowCollapse = (filtersSectionCollapsed)=>{
|
|
8241
|
-
const baseClasses = 'border-1 border-white rounded-md
|
|
8370
|
+
const baseClasses = 'border-1 border-white rounded-md flex items-center';
|
|
8242
8371
|
const dynamicClasses = !filtersSectionCollapsed ? 'text-primary bg-base-max' : 'text-base-max bg-transparent';
|
|
8243
8372
|
const disabledClasses = 'disabled:opacity-50 disabled:bg-base-max disabled:text-primary';
|
|
8244
8373
|
const enabledHoverClasses = 'enabled:hover:bg-primary-darkest enabled:hover:text-primary-content-lightest enabled:hover:border-primary-darkest';
|
|
8245
8374
|
return `${disabledClasses} ${enabledHoverClasses} ${baseClasses} ${dynamicClasses}`;
|
|
8246
8375
|
};
|
|
8247
8376
|
|
|
8377
|
+
const JSONObjectDownloadButton = ({ getData, filename = 'data.json', icon = 'gen3:download', tooltip })=>{
|
|
8378
|
+
const [isDownloading, setIsDownloading] = React.useState(false);
|
|
8379
|
+
const saveToJSONFile = async ()=>{
|
|
8380
|
+
setIsDownloading(true);
|
|
8381
|
+
try {
|
|
8382
|
+
const data = getData();
|
|
8383
|
+
// Create blob from JSON data
|
|
8384
|
+
const blob = new Blob([
|
|
8385
|
+
JSON.stringify(data, null, 2)
|
|
8386
|
+
], {
|
|
8387
|
+
type: 'application/json'
|
|
8388
|
+
});
|
|
8389
|
+
// Create URL for the blob
|
|
8390
|
+
const url = URL.createObjectURL(blob);
|
|
8391
|
+
// Create temporary link element
|
|
8392
|
+
const link = document.createElement('a');
|
|
8393
|
+
link.href = url;
|
|
8394
|
+
link.download = filename;
|
|
8395
|
+
// Append to document, click, and cleanup
|
|
8396
|
+
document.body.appendChild(link);
|
|
8397
|
+
link.click();
|
|
8398
|
+
document.body.removeChild(link);
|
|
8399
|
+
URL.revokeObjectURL(url);
|
|
8400
|
+
} catch (error) {
|
|
8401
|
+
console.error('Error saving file:', error);
|
|
8402
|
+
} finally{
|
|
8403
|
+
setIsDownloading(false);
|
|
8404
|
+
}
|
|
8405
|
+
};
|
|
8406
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
8407
|
+
label: tooltip,
|
|
8408
|
+
disabled: !tooltip,
|
|
8409
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
8410
|
+
variant: "outline",
|
|
8411
|
+
onClick: saveToJSONFile,
|
|
8412
|
+
disabled: isDownloading,
|
|
8413
|
+
loading: isDownloading,
|
|
8414
|
+
classNames: {
|
|
8415
|
+
root: 'bg-base-max'
|
|
8416
|
+
},
|
|
8417
|
+
className: "flex items-center gap-2",
|
|
8418
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
|
|
8419
|
+
icon: icon,
|
|
8420
|
+
height: "1.5rem"
|
|
8421
|
+
})
|
|
8422
|
+
})
|
|
8423
|
+
});
|
|
8424
|
+
};
|
|
8425
|
+
|
|
8426
|
+
const UploadJSONButton = ({ handleFileChange, tooltip, icon = 'gen3:upload' })=>{
|
|
8427
|
+
const [file, setFile] = React.useState(null);
|
|
8428
|
+
const [processingFile, setProcessingFile] = React.useState(false);
|
|
8429
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.FileButton, {
|
|
8430
|
+
onChange: async (file)=>{
|
|
8431
|
+
if (file !== null) {
|
|
8432
|
+
setProcessingFile(true);
|
|
8433
|
+
setFile(file);
|
|
8434
|
+
const contents = await file.text();
|
|
8435
|
+
handleFileChange(contents);
|
|
8436
|
+
setProcessingFile(false);
|
|
8437
|
+
}
|
|
8438
|
+
},
|
|
8439
|
+
accept: "application/json",
|
|
8440
|
+
children: ()=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
8441
|
+
label: tooltip,
|
|
8442
|
+
disabled: !tooltip,
|
|
8443
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
8444
|
+
loading: processingFile,
|
|
8445
|
+
variant: "outline",
|
|
8446
|
+
classNames: {
|
|
8447
|
+
root: 'bg-base-max'
|
|
8448
|
+
},
|
|
8449
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
|
|
8450
|
+
icon: icon,
|
|
8451
|
+
height: "1.5rem"
|
|
8452
|
+
})
|
|
8453
|
+
})
|
|
8454
|
+
})
|
|
8455
|
+
});
|
|
8456
|
+
};
|
|
8457
|
+
|
|
8458
|
+
const CohortSelector = ({ index, filters })=>{
|
|
8459
|
+
const dispatch = core.useCoreDispatch();
|
|
8460
|
+
const getData = useDeepCompare.useDeepCompareCallback(()=>{
|
|
8461
|
+
return filters;
|
|
8462
|
+
}, [
|
|
8463
|
+
filters
|
|
8464
|
+
]);
|
|
8465
|
+
const setCohort = useDeepCompare.useDeepCompareCallback((data)=>{
|
|
8466
|
+
const jsonForm = JSON.parse(data);
|
|
8467
|
+
dispatch(core.setCohortFilter({
|
|
8468
|
+
index,
|
|
8469
|
+
filters: jsonForm
|
|
8470
|
+
}));
|
|
8471
|
+
}, [
|
|
8472
|
+
index,
|
|
8473
|
+
dispatch
|
|
8474
|
+
]);
|
|
8475
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
8476
|
+
children: [
|
|
8477
|
+
/*#__PURE__*/ jsxRuntime.jsx(JSONObjectDownloadButton, {
|
|
8478
|
+
getData: getData,
|
|
8479
|
+
filename: "cohort.json",
|
|
8480
|
+
tooltip: "Export Cohort"
|
|
8481
|
+
}),
|
|
8482
|
+
/*#__PURE__*/ jsxRuntime.jsx(UploadJSONButton, {
|
|
8483
|
+
handleFileChange: setCohort,
|
|
8484
|
+
tooltip: "Import Cohort"
|
|
8485
|
+
})
|
|
8486
|
+
]
|
|
8487
|
+
});
|
|
8488
|
+
};
|
|
8489
|
+
|
|
8248
8490
|
const QueryExpressionContainer = tw.div`
|
|
8249
8491
|
flex
|
|
8250
8492
|
items-center
|
|
@@ -8397,9 +8639,13 @@ const QueryExpressionSection = ({ index, filters, currentCohortName, currentCoho
|
|
|
8397
8639
|
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
8398
8640
|
className: "display flex gap-2 ml-auto mr-3",
|
|
8399
8641
|
children: [
|
|
8642
|
+
/*#__PURE__*/ jsxRuntime.jsx(CohortSelector, {
|
|
8643
|
+
index: index,
|
|
8644
|
+
filters: filters
|
|
8645
|
+
}),
|
|
8400
8646
|
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
8401
8647
|
label: noFilters ? 'No values to expand/collapse' : allQueryExpressionsCollapsed ? 'Expand all values' : 'Collapse all values',
|
|
8402
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(
|
|
8648
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
8403
8649
|
"data-testid": "button-expand-collapse-cohort-queries",
|
|
8404
8650
|
color: "white",
|
|
8405
8651
|
onClick: ()=>allQueryExpressionsCollapsed ? setExpandedState({
|
|
@@ -8413,34 +8659,22 @@ const QueryExpressionSection = ({ index, filters, currentCohortName, currentCoho
|
|
|
8413
8659
|
"aria-expanded": !allQueryExpressionsCollapsed,
|
|
8414
8660
|
className: getCombinedClassesExpandCollapseQuery(allQueryExpressionsCollapsed),
|
|
8415
8661
|
disabled: noFilters,
|
|
8416
|
-
children: allQueryExpressionsCollapsed ? /*#__PURE__*/ jsxRuntime.
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
]
|
|
8427
|
-
}) : /*#__PURE__*/ jsxRuntime.jsxs(React.Fragment, {
|
|
8428
|
-
children: [
|
|
8429
|
-
/*#__PURE__*/ jsxRuntime.jsx(md.MdOutlineArrowForwardIos, {
|
|
8430
|
-
size: 16,
|
|
8431
|
-
"aria-hidden": "true"
|
|
8432
|
-
}),
|
|
8433
|
-
/*#__PURE__*/ jsxRuntime.jsx(md.MdOutlineArrowBackIos, {
|
|
8434
|
-
size: 16,
|
|
8435
|
-
"aria-hidden": "true"
|
|
8436
|
-
})
|
|
8437
|
-
]
|
|
8662
|
+
children: allQueryExpressionsCollapsed ? /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
|
|
8663
|
+
icon: "gen3:chevron-expand",
|
|
8664
|
+
"aria-hidden": "true",
|
|
8665
|
+
height: "1.5rem",
|
|
8666
|
+
children: ' '
|
|
8667
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
|
|
8668
|
+
icon: "gen3:chevron-contract",
|
|
8669
|
+
"aria-hidden": "true",
|
|
8670
|
+
height: "1.5rem",
|
|
8671
|
+
children: ' '
|
|
8438
8672
|
})
|
|
8439
8673
|
})
|
|
8440
8674
|
}),
|
|
8441
8675
|
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
8442
8676
|
label: noFilters || filtersRef.current != null && filtersRef?.current?.scrollHeight <= MAX_HEIGHT_QE_SECTION ? 'All rows are already displayed' : filtersSectionCollapsed ? 'Display all rows' : 'Display fewer rows',
|
|
8443
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(
|
|
8677
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
8444
8678
|
"data-testid": "button-expand-collapse-cohort-filters-section",
|
|
8445
8679
|
color: "white",
|
|
8446
8680
|
onClick: ()=>setFiltersSectionCollapsed(!filtersSectionCollapsed),
|
|
@@ -9952,74 +10186,1098 @@ var GqlQueryEditor$2 = /*#__PURE__*/Object.freeze({
|
|
|
9952
10186
|
default: GqlQueryEditor$1
|
|
9953
10187
|
});
|
|
9954
10188
|
|
|
9955
|
-
const
|
|
9956
|
-
|
|
9957
|
-
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
})
|
|
9962
|
-
});
|
|
9963
|
-
};
|
|
9964
|
-
|
|
9965
|
-
class FilesystemContent {
|
|
9966
|
-
constructor({ rootPath }){
|
|
9967
|
-
this.rootPath = rootPath || '';
|
|
10189
|
+
const ProtectedContent = ({ children, referer })=>{
|
|
10190
|
+
const router$1 = router.useRouter();
|
|
10191
|
+
let redirect = referer;
|
|
10192
|
+
if (!referer && typeof window !== 'undefined') {
|
|
10193
|
+
// route not available on SSR
|
|
10194
|
+
redirect = router$1.asPath;
|
|
9968
10195
|
}
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
10196
|
+
const onUnauthenticated = ()=>{
|
|
10197
|
+
if (typeof window !== 'undefined') // route not available on SSR
|
|
10198
|
+
router$1.push({
|
|
10199
|
+
pathname: '/Login',
|
|
10200
|
+
query: {
|
|
10201
|
+
referer: redirect
|
|
10202
|
+
}
|
|
10203
|
+
});
|
|
10204
|
+
};
|
|
10205
|
+
const { status, pending } = useSession(true, onUnauthenticated);
|
|
10206
|
+
if (status !== 'issued') {
|
|
10207
|
+
// not logged in
|
|
10208
|
+
if (pending) return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10209
|
+
className: "flex justify-center w-full mt-10",
|
|
10210
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Loader, {})
|
|
10211
|
+
});
|
|
10212
|
+
else return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10213
|
+
className: "w-full h-full relative",
|
|
10214
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
|
|
10215
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Paper, {
|
|
10216
|
+
shadow: "md",
|
|
10217
|
+
p: "md",
|
|
10218
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10219
|
+
children: "You are not signed in and cannot access this protected content. Please login in."
|
|
10220
|
+
})
|
|
10221
|
+
})
|
|
10222
|
+
})
|
|
10223
|
+
});
|
|
9975
10224
|
}
|
|
9976
|
-
|
|
10225
|
+
return /*#__PURE__*/ jsxRuntime.jsx(React.Fragment, {
|
|
10226
|
+
children: children
|
|
10227
|
+
});
|
|
10228
|
+
};
|
|
9977
10229
|
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
10230
|
+
const WorkspaceConfigDefaults = {
|
|
10231
|
+
launchStepIndicatorConfig: {
|
|
10232
|
+
steps: [
|
|
10233
|
+
{
|
|
10234
|
+
label: 'Requesting',
|
|
10235
|
+
description: 'requesting workspace resources'
|
|
10236
|
+
},
|
|
10237
|
+
{
|
|
10238
|
+
label: 'Initializing',
|
|
10239
|
+
description: 'starting workspace resources'
|
|
10240
|
+
},
|
|
10241
|
+
{
|
|
10242
|
+
label: 'Configuring',
|
|
10243
|
+
description: 'starting services'
|
|
10244
|
+
},
|
|
10245
|
+
{
|
|
10246
|
+
label: 'Starting',
|
|
10247
|
+
description: 'waiting for services'
|
|
10248
|
+
},
|
|
10249
|
+
{
|
|
10250
|
+
label: 'Connecting',
|
|
10251
|
+
description: 'waiting for connecting to workspace'
|
|
10252
|
+
},
|
|
10253
|
+
{
|
|
10254
|
+
label: 'Ready',
|
|
10255
|
+
description: 'workspace is ready'
|
|
10256
|
+
}
|
|
10257
|
+
]
|
|
9982
10258
|
}
|
|
9983
|
-
|
|
9984
|
-
|
|
10259
|
+
};
|
|
10260
|
+
const WorkspaceContext = /*#__PURE__*/ React.createContext(WorkspaceConfigDefaults);
|
|
10261
|
+
const useWorkspaceContext = ()=>{
|
|
10262
|
+
const context = React.useContext(WorkspaceContext);
|
|
10263
|
+
if (context === undefined) {
|
|
10264
|
+
throw Error('Workspace must be used inside of a useWorkspaceContext');
|
|
9985
10265
|
}
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
const
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
const config = {
|
|
9993
|
-
store: new FilesystemContent({
|
|
9994
|
-
rootPath: ContentRoot
|
|
9995
|
-
})
|
|
10266
|
+
return context;
|
|
10267
|
+
};
|
|
10268
|
+
const WorkspaceProvider = ({ children, config })=>{
|
|
10269
|
+
const mergedConfig = {
|
|
10270
|
+
...WorkspaceConfigDefaults,
|
|
10271
|
+
...config
|
|
9996
10272
|
};
|
|
9997
|
-
return
|
|
10273
|
+
return /*#__PURE__*/ jsxRuntime.jsx(WorkspaceContext.Provider, {
|
|
10274
|
+
value: mergedConfig,
|
|
10275
|
+
children: children
|
|
10276
|
+
});
|
|
9998
10277
|
};
|
|
9999
|
-
const ContentSource = setup();
|
|
10000
10278
|
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
* @returns A Promise resolving to an object containing header and footer props.
|
|
10005
|
-
*/ const getNavPageLayoutPropsFromConfig = async ()=>{
|
|
10006
|
-
const navigationConfigJSON = await ContentSource.get(`config/${core.GEN3_COMMONS_NAME}/navigation.json`);
|
|
10007
|
-
let bannerConfigJSON = [];
|
|
10008
|
-
try {
|
|
10009
|
-
bannerConfigJSON = await ContentSource.get(`config/${core.GEN3_COMMONS_NAME}/banner.json`);
|
|
10010
|
-
} catch (e) {
|
|
10011
|
-
console.warn('No banner config found at: ', `config/${core.GEN3_COMMONS_NAME}/banner.json`);
|
|
10279
|
+
const getWorkspaceErrorMessage = (error, defaultMessage)=>{
|
|
10280
|
+
if (core.isFetchBaseQueryError(error)) {
|
|
10281
|
+
return error.data;
|
|
10012
10282
|
}
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10283
|
+
return defaultMessage;
|
|
10284
|
+
};
|
|
10285
|
+
const WorkspaceStatusContext = /*#__PURE__*/ React.createContext({
|
|
10286
|
+
isFullscreen: false,
|
|
10287
|
+
startWorkspace: ()=>null,
|
|
10288
|
+
stopWorkspace: ()=>null,
|
|
10289
|
+
toggleFullscreen: ()=>null,
|
|
10290
|
+
workspaceLaunchIsLoading: false,
|
|
10291
|
+
terminateIsLoading: false,
|
|
10292
|
+
isPayModelNeededToLaunch: undefined
|
|
10293
|
+
});
|
|
10294
|
+
const useWorkspaceStatusContext = ()=>{
|
|
10295
|
+
const context = React.useContext(WorkspaceStatusContext);
|
|
10296
|
+
if (context === undefined) {
|
|
10297
|
+
throw Error('Any workspace status component must be used inside of a useWorkspaceStatusContext');
|
|
10298
|
+
}
|
|
10299
|
+
return context;
|
|
10300
|
+
};
|
|
10301
|
+
const WorkspaceStatusProvider = ({ children })=>{
|
|
10302
|
+
const { toggle: switchScreenMode, fullscreen: isFullscreen } = hooks.useFullscreen();
|
|
10303
|
+
const [isPayModelNeededToLaunch, setIsPayModelNeededToLaunch] = React.useState(undefined);
|
|
10304
|
+
const [launchTrigger, { isError: isWorkspaceLaunchError, error: workspaceLaunchError }] = core.useLaunchWorkspaceMutation();
|
|
10305
|
+
const [terminateWorkspace, { isLoading: terminateIsLoading, isError: isTerminateError, error: workspaceTerminateError }] = core.useTerminateWorkspaceMutation();
|
|
10306
|
+
const { data: payModels, isLoading: isPayModelLoading, isError: isPayModelError } = core.useGetWorkspacePayModelsQuery();
|
|
10307
|
+
useDeepCompare.useDeepCompareEffect(()=>{
|
|
10308
|
+
if (isPayModelError) {
|
|
10309
|
+
notifications.notifications.show({
|
|
10310
|
+
title: 'Pay Model Error',
|
|
10311
|
+
message: 'Unable to get Pay Model.'
|
|
10312
|
+
});
|
|
10313
|
+
}
|
|
10314
|
+
if (isPayModelLoading) {
|
|
10315
|
+
setIsPayModelNeededToLaunch(true);
|
|
10316
|
+
}
|
|
10317
|
+
if (payModels) {
|
|
10318
|
+
setIsPayModelNeededToLaunch(Object.keys(payModels).length > 0 && payModels.currentPayModel != null);
|
|
10319
|
+
}
|
|
10320
|
+
}, [
|
|
10321
|
+
payModels
|
|
10322
|
+
]);
|
|
10323
|
+
const dispatch = core.useCoreDispatch();
|
|
10324
|
+
const currentWorkspaceStatus = core.useCoreSelector(core.selectActiveWorkspaceStatus);
|
|
10325
|
+
// handle errors in launching, getting status, or terminating
|
|
10326
|
+
useDeepCompare.useDeepCompareEffect(()=>{
|
|
10327
|
+
if (isWorkspaceLaunchError || isTerminateError) {
|
|
10328
|
+
notifications.notifications.show({
|
|
10329
|
+
title: 'Workspace Error',
|
|
10330
|
+
message: getWorkspaceErrorMessage(isWorkspaceLaunchError ? workspaceLaunchError : workspaceTerminateError, isWorkspaceLaunchError ? 'Error launching workspace' : 'Error stopping workspace'),
|
|
10331
|
+
position: 'top-center',
|
|
10332
|
+
containerWidth: '50%'
|
|
10333
|
+
});
|
|
10334
|
+
dispatch(core.setRequestedWorkspaceStatus('NotSet'));
|
|
10335
|
+
dispatch(core.setActiveWorkspaceStatus(core.WorkspaceStatus.NotFound));
|
|
10336
|
+
}
|
|
10337
|
+
}, [
|
|
10338
|
+
isWorkspaceLaunchError,
|
|
10339
|
+
isTerminateError
|
|
10340
|
+
]);
|
|
10341
|
+
const status = React.useMemo(()=>{
|
|
10342
|
+
const startWorkspace = (id)=>{
|
|
10343
|
+
launchTrigger(id);
|
|
10344
|
+
dispatch(core.setActiveWorkspace({
|
|
10345
|
+
id: id,
|
|
10346
|
+
status: core.WorkspaceStatus.Launching,
|
|
10347
|
+
requestedStatus: 'Launching'
|
|
10348
|
+
}));
|
|
10349
|
+
};
|
|
10350
|
+
const toggleFullscreen = ()=>switchScreenMode();
|
|
10351
|
+
const stopWorkspace = ()=>{
|
|
10352
|
+
terminateWorkspace();
|
|
10353
|
+
dispatch(core.setRequestedWorkspaceStatus('Terminating'));
|
|
10354
|
+
dispatch(core.setActiveWorkspaceStatus(core.WorkspaceStatus.Terminating));
|
|
10355
|
+
};
|
|
10356
|
+
return {
|
|
10357
|
+
isFullscreen,
|
|
10358
|
+
startWorkspace,
|
|
10359
|
+
stopWorkspace,
|
|
10360
|
+
toggleFullscreen,
|
|
10361
|
+
workspaceLaunchIsLoading: currentWorkspaceStatus === core.WorkspaceStatus.Launching,
|
|
10362
|
+
terminateIsLoading,
|
|
10363
|
+
isPayModelNeededToLaunch
|
|
10364
|
+
};
|
|
10365
|
+
}, [
|
|
10366
|
+
dispatch,
|
|
10367
|
+
isFullscreen,
|
|
10368
|
+
launchTrigger,
|
|
10369
|
+
terminateIsLoading,
|
|
10370
|
+
terminateWorkspace
|
|
10371
|
+
]);
|
|
10372
|
+
return /*#__PURE__*/ jsxRuntime.jsx(WorkspaceStatusContext.Provider, {
|
|
10373
|
+
value: status,
|
|
10374
|
+
children: children
|
|
10375
|
+
});
|
|
10376
|
+
};
|
|
10377
|
+
|
|
10378
|
+
const COMPUTE_PROPS_LABEL_STYLE = 'text-base-lighter font-medium text-sm opacity-90';
|
|
10379
|
+
const NotebookCard = ({ info })=>{
|
|
10380
|
+
const { startWorkspace, stopWorkspace, isPayModelNeededToLaunch } = useWorkspaceStatusContext();
|
|
10381
|
+
const { status } = core.useCoreSelector(core.selectWorkspaceStatusFromService);
|
|
10382
|
+
const requestedStatus = core.useCoreSelector(core.selectRequestedWorkspaceStatus);
|
|
10383
|
+
const workspaceId = core.useCoreSelector(core.selectActiveWorkspaceId);
|
|
10384
|
+
console.log('NotebookCard: ', requestedStatus, workspaceId, status);
|
|
10385
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Card, {
|
|
10386
|
+
withBorder: true,
|
|
10387
|
+
radius: "xs",
|
|
10388
|
+
className: "w-64",
|
|
10389
|
+
children: [
|
|
10390
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Card.Section, {
|
|
10391
|
+
inheritPadding: true,
|
|
10392
|
+
py: "xs",
|
|
10393
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
|
|
10394
|
+
align: "center",
|
|
10395
|
+
children: [
|
|
10396
|
+
/*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
|
|
10397
|
+
height: '48px',
|
|
10398
|
+
icon: 'workspace:jupyter'
|
|
10399
|
+
}),
|
|
10400
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10401
|
+
ta: "center",
|
|
10402
|
+
className: "font-header",
|
|
10403
|
+
size: "md",
|
|
10404
|
+
fw: 500,
|
|
10405
|
+
children: info.name
|
|
10406
|
+
})
|
|
10407
|
+
]
|
|
10408
|
+
})
|
|
10409
|
+
}),
|
|
10410
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Card.Section, {
|
|
10411
|
+
inheritPadding: true,
|
|
10412
|
+
py: "xs",
|
|
10413
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
10414
|
+
justify: "center",
|
|
10415
|
+
children: [
|
|
10416
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Text, {
|
|
10417
|
+
c: "base-contrast.4",
|
|
10418
|
+
className: COMPUTE_PROPS_LABEL_STYLE,
|
|
10419
|
+
children: [
|
|
10420
|
+
"CPU Limit: ",
|
|
10421
|
+
info.cpuLimit
|
|
10422
|
+
]
|
|
10423
|
+
}),
|
|
10424
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Text, {
|
|
10425
|
+
c: "base-contrast.4",
|
|
10426
|
+
className: COMPUTE_PROPS_LABEL_STYLE,
|
|
10427
|
+
size: "xs",
|
|
10428
|
+
children: [
|
|
10429
|
+
"Memory: ",
|
|
10430
|
+
info.memoryLimit
|
|
10431
|
+
]
|
|
10432
|
+
})
|
|
10433
|
+
]
|
|
10434
|
+
})
|
|
10435
|
+
}),
|
|
10436
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10437
|
+
className: "flex mx-8 justify-center border-1 border-base"
|
|
10438
|
+
}),
|
|
10439
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
10440
|
+
className: "mt-2 p-2",
|
|
10441
|
+
justify: "center",
|
|
10442
|
+
children: [
|
|
10443
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
10444
|
+
loading: info.id === workspaceId && requestedStatus === 'Launching',
|
|
10445
|
+
disabled: status !== core.WorkspaceStatus.NotFound || isPayModelNeededToLaunch,
|
|
10446
|
+
onClick: ()=>{
|
|
10447
|
+
startWorkspace(info.id);
|
|
10448
|
+
},
|
|
10449
|
+
children: "Launch"
|
|
10450
|
+
}),
|
|
10451
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Transition, {
|
|
10452
|
+
mounted: info.id === workspaceId && requestedStatus === 'Launching' || status === 'Launching',
|
|
10453
|
+
transition: "fade",
|
|
10454
|
+
duration: 400,
|
|
10455
|
+
timingFunction: "ease",
|
|
10456
|
+
children: ()=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
10457
|
+
onClick: ()=>{
|
|
10458
|
+
stopWorkspace();
|
|
10459
|
+
},
|
|
10460
|
+
children: "Shutdown"
|
|
10461
|
+
})
|
|
10462
|
+
})
|
|
10463
|
+
]
|
|
10464
|
+
})
|
|
10465
|
+
]
|
|
10466
|
+
});
|
|
10467
|
+
};
|
|
10468
|
+
|
|
10469
|
+
const WorkspacePanel = ()=>{
|
|
10470
|
+
const { data, isLoading, isError, isSuccess } = core.useGetWorkspaceOptionsQuery();
|
|
10471
|
+
const workspaceStatus = core.useCoreSelector(core.selectActiveWorkspaceStatus);
|
|
10472
|
+
if (isError) {
|
|
10473
|
+
return /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
10474
|
+
message: "Error loading workspace definitions"
|
|
10475
|
+
});
|
|
10476
|
+
}
|
|
10477
|
+
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
10478
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Transition, {
|
|
10479
|
+
mounted: workspaceStatus === core.WorkspaceStatus.NotFound || workspaceStatus === core.WorkspaceStatus.Launching,
|
|
10480
|
+
transition: "scale-y",
|
|
10481
|
+
duration: 600,
|
|
10482
|
+
exitDuration: 600,
|
|
10483
|
+
timingFunction: "ease",
|
|
10484
|
+
children: (styles)=>/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10485
|
+
className: "px-2 mt-4",
|
|
10486
|
+
style: styles,
|
|
10487
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Grid, {
|
|
10488
|
+
justify: "center",
|
|
10489
|
+
align: "stretch",
|
|
10490
|
+
gutter: "md",
|
|
10491
|
+
children: data?.map((card)=>{
|
|
10492
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Grid.Col, {
|
|
10493
|
+
span: "content",
|
|
10494
|
+
style: {
|
|
10495
|
+
minHeight: core$1.rem(120)
|
|
10496
|
+
},
|
|
10497
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(NotebookCard, {
|
|
10498
|
+
info: card
|
|
10499
|
+
})
|
|
10500
|
+
}, card.id);
|
|
10501
|
+
})
|
|
10502
|
+
})
|
|
10503
|
+
})
|
|
10504
|
+
})
|
|
10505
|
+
});
|
|
10506
|
+
};
|
|
10507
|
+
|
|
10508
|
+
const WorkspaceNotebook = ()=>{
|
|
10509
|
+
const currentWorkspaceStatus = core.useCoreSelector(core.selectActiveWorkspaceStatus);
|
|
10510
|
+
if (currentWorkspaceStatus !== core.WorkspaceStatus.Running) return null;
|
|
10511
|
+
return /*#__PURE__*/ jsxRuntime.jsx(React.Fragment, {
|
|
10512
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10513
|
+
className: "flex flex-col w-full flex-grow content-center items-center",
|
|
10514
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("iframe", {
|
|
10515
|
+
className: "w-full h-full border-8",
|
|
10516
|
+
title: "Workspace",
|
|
10517
|
+
src: `${core.GEN3_WORKSPACE_API}/proxy/`
|
|
10518
|
+
})
|
|
10519
|
+
})
|
|
10520
|
+
});
|
|
10521
|
+
};
|
|
10522
|
+
|
|
10523
|
+
const ExternalLoginsStatus = ()=>{
|
|
10524
|
+
const { data: externalProviders, isLoading, isError, isSuccess } = core.useGetExternalLoginsQuery();
|
|
10525
|
+
if (isLoading) {
|
|
10526
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10527
|
+
className: "bg-primary h-24 flex justify-center",
|
|
10528
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Loader, {})
|
|
10529
|
+
});
|
|
10530
|
+
}
|
|
10531
|
+
if (isError) {
|
|
10532
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10533
|
+
children: "Error occurred while fetching external logins"
|
|
10534
|
+
});
|
|
10535
|
+
}
|
|
10536
|
+
if (isSuccess) {
|
|
10537
|
+
const providersNeedToken = externalProviders.providers.filter((option)=>!option.refresh_token_expiration);
|
|
10538
|
+
if (providersNeedToken.length > 0) {
|
|
10539
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10540
|
+
className: "p-2 border border-base-lighter pb-4",
|
|
10541
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
|
|
10542
|
+
children: [
|
|
10543
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Text, {
|
|
10544
|
+
children: [
|
|
10545
|
+
"To analyze all data to which you have access, please authorize these external data resources in the Profile page:",
|
|
10546
|
+
' '
|
|
10547
|
+
]
|
|
10548
|
+
}),
|
|
10549
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Group, {
|
|
10550
|
+
gap: "xs",
|
|
10551
|
+
children: providersNeedToken.map((provider)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Badge, {
|
|
10552
|
+
size: "lg",
|
|
10553
|
+
variant: "outline",
|
|
10554
|
+
radius: "sm",
|
|
10555
|
+
children: provider.name
|
|
10556
|
+
}, provider.name))
|
|
10557
|
+
})
|
|
10558
|
+
]
|
|
10559
|
+
})
|
|
10560
|
+
});
|
|
10561
|
+
}
|
|
10562
|
+
return null;
|
|
10563
|
+
}
|
|
10564
|
+
};
|
|
10565
|
+
|
|
10566
|
+
const PaymentNumberToString = (x, undefinedValue = 'N/A', precision = 2)=>{
|
|
10567
|
+
if (!x || Number.isNaN(x)) return undefinedValue;
|
|
10568
|
+
return x.toFixed(precision);
|
|
10569
|
+
};
|
|
10570
|
+
|
|
10571
|
+
const StatusAndControls = ()=>{
|
|
10572
|
+
const { stopWorkspace, toggleFullscreen, isFullscreen } = useWorkspaceStatusContext();
|
|
10573
|
+
const openModal = ()=>modals.modals.openConfirmModal({
|
|
10574
|
+
title: 'Workspace',
|
|
10575
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10576
|
+
size: "sm",
|
|
10577
|
+
children: "Please confirm workspace shutdown"
|
|
10578
|
+
}),
|
|
10579
|
+
labels: {
|
|
10580
|
+
confirm: 'Confirm',
|
|
10581
|
+
cancel: 'Cancel'
|
|
10582
|
+
},
|
|
10583
|
+
onConfirm: ()=>stopWorkspace()
|
|
10584
|
+
});
|
|
10585
|
+
const workspaceStatus = core.useCoreSelector(core.selectActiveWorkspaceStatus);
|
|
10586
|
+
const requestedStatus = core.useCoreSelector(core.selectRequestedWorkspaceStatus);
|
|
10587
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Transition, {
|
|
10588
|
+
mounted: core.isWorkspaceRunningOrStopping(workspaceStatus),
|
|
10589
|
+
transition: "fade",
|
|
10590
|
+
duration: 1200,
|
|
10591
|
+
timingFunction: "ease",
|
|
10592
|
+
children: (styles)=>/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10593
|
+
style: styles,
|
|
10594
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
10595
|
+
children: [
|
|
10596
|
+
/*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
|
|
10597
|
+
height: '2.0rem',
|
|
10598
|
+
icon: 'workspace:jupyter'
|
|
10599
|
+
}),
|
|
10600
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
10601
|
+
label: "Stop Workspace",
|
|
10602
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
10603
|
+
loading: requestedStatus === 'Terminating',
|
|
10604
|
+
size: "md",
|
|
10605
|
+
color: "accent.5",
|
|
10606
|
+
variant: "default",
|
|
10607
|
+
onClick: ()=>{
|
|
10608
|
+
openModal();
|
|
10609
|
+
},
|
|
10610
|
+
"aria-label": "Stop Workspace",
|
|
10611
|
+
leftSection: /*#__PURE__*/ jsxRuntime.jsx(fa.FaRegStopCircle, {
|
|
10612
|
+
color: "utility.2",
|
|
10613
|
+
size: "1rem",
|
|
10614
|
+
className: "text-accent-warm"
|
|
10615
|
+
}),
|
|
10616
|
+
children: "Stop Workspace"
|
|
10617
|
+
})
|
|
10618
|
+
}),
|
|
10619
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
|
|
10620
|
+
label: "Toggle fullscreen mode",
|
|
10621
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
10622
|
+
color: "utility.2",
|
|
10623
|
+
size: "md",
|
|
10624
|
+
variant: "default",
|
|
10625
|
+
onClick: ()=>{
|
|
10626
|
+
toggleFullscreen();
|
|
10627
|
+
},
|
|
10628
|
+
"aria-label": isFullscreen ? 'Exit Fullscreen' : 'Make Fullscreen',
|
|
10629
|
+
leftSection: /*#__PURE__*/ jsxRuntime.jsx(bs.BsArrowsFullscreen, {
|
|
10630
|
+
className: "text-accent-warm"
|
|
10631
|
+
}),
|
|
10632
|
+
children: isFullscreen ? 'Exit Fullscreen' : 'Make Fullscreen'
|
|
10633
|
+
})
|
|
10634
|
+
})
|
|
10635
|
+
]
|
|
10636
|
+
})
|
|
10637
|
+
})
|
|
10638
|
+
});
|
|
10639
|
+
};
|
|
10640
|
+
|
|
10641
|
+
const isNoPayModelError = (error)=>{
|
|
10642
|
+
return 'status' in error && error.status === 'PARSING_ERROR' && error.originalStatus === 404;
|
|
10643
|
+
};
|
|
10644
|
+
const NoPayModel = ()=>{
|
|
10645
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
10646
|
+
className: "p-2 border-1 border-l-0 border-r-0 border-base-lighter w-full h-16",
|
|
10647
|
+
justify: "space-between",
|
|
10648
|
+
children: [
|
|
10649
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10650
|
+
className: "pl-4",
|
|
10651
|
+
size: "md",
|
|
10652
|
+
classNames: {
|
|
10653
|
+
root: 'font-heading'
|
|
10654
|
+
},
|
|
10655
|
+
children: "No pay model defined"
|
|
10656
|
+
}),
|
|
10657
|
+
/*#__PURE__*/ jsxRuntime.jsx(StatusAndControls, {})
|
|
10658
|
+
]
|
|
10659
|
+
});
|
|
10660
|
+
};
|
|
10661
|
+
const PaymentPanel = ()=>{
|
|
10662
|
+
const { data, isLoading, isFetching, isError, error } = core.useGetWorkspacePayModelsQuery();
|
|
10663
|
+
const [setWorkspacePayModel] = core.useSetCurrentPayModelMutation();
|
|
10664
|
+
const [selectedPayModel, setSelectedPayModel] = React.useState(null);
|
|
10665
|
+
const setPayModel = useDeepCompare.useDeepCompareCallback((id)=>{
|
|
10666
|
+
setWorkspacePayModel(id); // triggers the call to the service to select the pay model
|
|
10667
|
+
setSelectedPayModel(id); // set the paymodel value for the select component
|
|
10668
|
+
}, [
|
|
10669
|
+
setWorkspacePayModel,
|
|
10670
|
+
selectedPayModel
|
|
10671
|
+
]);
|
|
10672
|
+
const { usersPayModels, workspaceName, hardLimit, totalUsage } = useDeepCompare.useDeepCompareMemo(()=>{
|
|
10673
|
+
if (!data) return {
|
|
10674
|
+
usersPayModels: [],
|
|
10675
|
+
selectedPayModel: [],
|
|
10676
|
+
workspaceName: 'Not Set',
|
|
10677
|
+
totalUsage: undefined,
|
|
10678
|
+
hardLimit: undefined
|
|
10679
|
+
};
|
|
10680
|
+
const usersPayModels = data.allPayModels.map((payModel)=>{
|
|
10681
|
+
return {
|
|
10682
|
+
value: payModel.bmh_workspace_id ?? payModel.workspace_type,
|
|
10683
|
+
label: payModel.workspace_type,
|
|
10684
|
+
totalUsage: payModel['total-usage'].toFixed(2),
|
|
10685
|
+
icon: payModel.request_status === 'active' ? /*#__PURE__*/ jsxRuntime.jsx(fa.FaUser, {}) : /*#__PURE__*/ jsxRuntime.jsx(fa.FaExclamationCircle, {})
|
|
10686
|
+
};
|
|
10687
|
+
});
|
|
10688
|
+
setSelectedPayModel(data.currentPayModel.bmh_workspace_id ?? data.currentPayModel.workspace_type);
|
|
10689
|
+
return {
|
|
10690
|
+
usersPayModels,
|
|
10691
|
+
workspaceName: data.currentPayModel.bmh_workspace_id.length > 0 ? data.currentPayModel.bmh_workspace_id.length : data.currentPayModel.workspace_type,
|
|
10692
|
+
totalUsage: data.currentPayModel['total-usage'],
|
|
10693
|
+
hardLimit: data.currentPayModel['hard-limit']
|
|
10694
|
+
};
|
|
10695
|
+
}, [
|
|
10696
|
+
data
|
|
10697
|
+
]);
|
|
10698
|
+
const PayModelSelectItem = ({ option })=>{
|
|
10699
|
+
const menuItem = usersPayModels[Number(option.value)];
|
|
10700
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10701
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
10702
|
+
wrap: "nowrap",
|
|
10703
|
+
children: [
|
|
10704
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10705
|
+
size: "sm",
|
|
10706
|
+
children: menuItem.label
|
|
10707
|
+
}),
|
|
10708
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10709
|
+
size: "sm",
|
|
10710
|
+
children: menuItem.totalUsage
|
|
10711
|
+
}),
|
|
10712
|
+
menuItem.icon
|
|
10713
|
+
]
|
|
10714
|
+
})
|
|
10715
|
+
});
|
|
10716
|
+
};
|
|
10717
|
+
if (isLoading && isFetching) return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10718
|
+
className: "flex justify-center p-2 border-1 border-l-0 border-r-0 border-base-lighter w-full h-14",
|
|
10719
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Loader, {})
|
|
10720
|
+
});
|
|
10721
|
+
if (isError) {
|
|
10722
|
+
if (isNoPayModelError(error)) {
|
|
10723
|
+
return /*#__PURE__*/ jsxRuntime.jsx(NoPayModel, {});
|
|
10724
|
+
} else return /*#__PURE__*/ jsxRuntime.jsx(ErrorCard, {
|
|
10725
|
+
message: "Unable to get Payment information"
|
|
10726
|
+
});
|
|
10727
|
+
}
|
|
10728
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10729
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Accordion, {
|
|
10730
|
+
chevronPosition: "left",
|
|
10731
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Accordion.Item, {
|
|
10732
|
+
value: "accountInformation",
|
|
10733
|
+
children: [
|
|
10734
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Accordion.Control, {
|
|
10735
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
10736
|
+
justify: "space-between",
|
|
10737
|
+
children: [
|
|
10738
|
+
"Account Information",
|
|
10739
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
10740
|
+
className: "font-heading text-base-contrast",
|
|
10741
|
+
children: [
|
|
10742
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10743
|
+
fw: 600,
|
|
10744
|
+
children: workspaceName
|
|
10745
|
+
}),
|
|
10746
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
10747
|
+
className: "flex items-center",
|
|
10748
|
+
children: [
|
|
10749
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10750
|
+
fw: 500,
|
|
10751
|
+
size: "sm",
|
|
10752
|
+
className: "mr-1",
|
|
10753
|
+
children: "Total Usage:"
|
|
10754
|
+
}),
|
|
10755
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10756
|
+
fw: 500,
|
|
10757
|
+
size: "sm",
|
|
10758
|
+
children: PaymentNumberToString(totalUsage)
|
|
10759
|
+
})
|
|
10760
|
+
]
|
|
10761
|
+
}),
|
|
10762
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
10763
|
+
className: "flex items-center pr-1",
|
|
10764
|
+
children: [
|
|
10765
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10766
|
+
fw: 500,
|
|
10767
|
+
size: "sm",
|
|
10768
|
+
className: "mr-1",
|
|
10769
|
+
children: "Hard Limit:"
|
|
10770
|
+
}),
|
|
10771
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10772
|
+
fw: 500,
|
|
10773
|
+
size: "sm",
|
|
10774
|
+
children: PaymentNumberToString(hardLimit)
|
|
10775
|
+
})
|
|
10776
|
+
]
|
|
10777
|
+
})
|
|
10778
|
+
]
|
|
10779
|
+
})
|
|
10780
|
+
]
|
|
10781
|
+
})
|
|
10782
|
+
}),
|
|
10783
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Accordion.Panel, {
|
|
10784
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
10785
|
+
className: "grid grid-cols-3 p-4",
|
|
10786
|
+
children: [
|
|
10787
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
10788
|
+
className: "flex flex-col border-1 border-gray p-2 mr-4",
|
|
10789
|
+
children: [
|
|
10790
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
10791
|
+
className: "flex justify-between border-b-1 border-gray mb-2 w-full py-2",
|
|
10792
|
+
children: [
|
|
10793
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10794
|
+
className: "ml-2 text-xs",
|
|
10795
|
+
children: "Account"
|
|
10796
|
+
}),
|
|
10797
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10798
|
+
className: "mr-2 text-xs",
|
|
10799
|
+
children: "Workspace Account Manager"
|
|
10800
|
+
})
|
|
10801
|
+
]
|
|
10802
|
+
}),
|
|
10803
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10804
|
+
className: "text-center",
|
|
10805
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10806
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Select, {
|
|
10807
|
+
placeholder: "Select Workspace",
|
|
10808
|
+
renderOption: PayModelSelectItem,
|
|
10809
|
+
data: usersPayModels,
|
|
10810
|
+
onChange: (id)=>{
|
|
10811
|
+
if (id) setPayModel(id);
|
|
10812
|
+
},
|
|
10813
|
+
value: selectedPayModel
|
|
10814
|
+
})
|
|
10815
|
+
})
|
|
10816
|
+
})
|
|
10817
|
+
]
|
|
10818
|
+
}),
|
|
10819
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
10820
|
+
className: "flex flex-col text-center border-1 border-gray p-2 mr-4",
|
|
10821
|
+
children: [
|
|
10822
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10823
|
+
className: "text-md border-b-1 border-gray mb-2 w-full py-2 text-xs",
|
|
10824
|
+
children: "Total Charges (USD)"
|
|
10825
|
+
}),
|
|
10826
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10827
|
+
children: PaymentNumberToString(totalUsage)
|
|
10828
|
+
})
|
|
10829
|
+
]
|
|
10830
|
+
}),
|
|
10831
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
10832
|
+
className: "flex flex-col text-center border-1 border-gray p-2",
|
|
10833
|
+
children: [
|
|
10834
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10835
|
+
className: "text-md border-b-1 border-gray mb-2 w-full py-2 text-xs",
|
|
10836
|
+
children: "Spending Limit (USD)"
|
|
10837
|
+
}),
|
|
10838
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10839
|
+
children: PaymentNumberToString(hardLimit)
|
|
10840
|
+
})
|
|
10841
|
+
]
|
|
10842
|
+
})
|
|
10843
|
+
]
|
|
10844
|
+
})
|
|
10845
|
+
})
|
|
10846
|
+
]
|
|
10847
|
+
})
|
|
10848
|
+
})
|
|
10849
|
+
});
|
|
10850
|
+
};
|
|
10851
|
+
|
|
10852
|
+
const isTerminated = (state)=>{
|
|
10853
|
+
return state !== undefined && 'terminated' in state.state;
|
|
10854
|
+
};
|
|
10855
|
+
const PodConditionIndex = {
|
|
10856
|
+
PodScheduled: 0,
|
|
10857
|
+
Initialized: 1,
|
|
10858
|
+
PodReadyToStartContainers: 2,
|
|
10859
|
+
ContainersReady: 3,
|
|
10860
|
+
ProxyConnected: 4,
|
|
10861
|
+
Ready: 5
|
|
10862
|
+
};
|
|
10863
|
+
const retrievePodConditionStatus = (conditionType, conditions)=>{
|
|
10864
|
+
const matchingCondition = conditions.find((condition)=>condition.type === conditionType);
|
|
10865
|
+
if (!matchingCondition) return core.PodStatus.Unknown;
|
|
10866
|
+
return matchingCondition.status;
|
|
10867
|
+
};
|
|
10868
|
+
const calculateCurrentStep = (conditions)=>{
|
|
10869
|
+
let currentStep = 0;
|
|
10870
|
+
conditions.forEach((condition)=>{
|
|
10871
|
+
const idx = PodConditionIndex[condition.type];
|
|
10872
|
+
if (condition.status === core.PodStatus.True) currentStep = Math.max(idx + 1, currentStep); // Add +1 since if True this
|
|
10873
|
+
});
|
|
10874
|
+
return currentStep;
|
|
10875
|
+
};
|
|
10876
|
+
const calculateLaunchSteps = ({ status, conditions, containerStates, workspaceType })=>{
|
|
10877
|
+
// if status is not 'Launching', or 'Stopped',
|
|
10878
|
+
// or we don't have conditions array, don't display steps bar
|
|
10879
|
+
if (!conditions || conditions.length === 0 || status !== 'Launching' && status !== 'Stopped') {
|
|
10880
|
+
return undefined;
|
|
10881
|
+
}
|
|
10882
|
+
// the return steps state
|
|
10883
|
+
const workspaceLaunchStatus = {
|
|
10884
|
+
step: 0,
|
|
10885
|
+
status: 'not ready'
|
|
10886
|
+
};
|
|
10887
|
+
const currentStep = calculateCurrentStep(conditions);
|
|
10888
|
+
workspaceLaunchStatus.step = currentStep;
|
|
10889
|
+
workspaceLaunchStatus.status = status === 'Stopped' ? 'error' : 'processing';
|
|
10890
|
+
if (currentStep == 2) {
|
|
10891
|
+
// PodReadyToStartContainers == False
|
|
10892
|
+
const cs = containerStates ?? [];
|
|
10893
|
+
// handle container stats
|
|
10894
|
+
if (cs.some((element)=>isTerminated(element))) {
|
|
10895
|
+
workspaceLaunchStatus.status = 'error';
|
|
10896
|
+
workspaceLaunchStatus.message = 'Service is terminated';
|
|
10897
|
+
}
|
|
10898
|
+
workspaceLaunchStatus.message = 'Starting notebook services';
|
|
10899
|
+
}
|
|
10900
|
+
if (currentStep == 3) {
|
|
10901
|
+
// ContainersReady == False
|
|
10902
|
+
// get container status
|
|
10903
|
+
if (workspaceType === 'ECS') {
|
|
10904
|
+
if (status === 'Launching') {
|
|
10905
|
+
workspaceLaunchStatus.status = 'processing';
|
|
10906
|
+
} else if (status !== 'Stopped') {
|
|
10907
|
+
workspaceLaunchStatus.status = 'error';
|
|
10908
|
+
}
|
|
10909
|
+
} else {
|
|
10910
|
+
const cs = containerStates ?? [];
|
|
10911
|
+
// handle container stats
|
|
10912
|
+
if (cs.some((element)=>isTerminated(element))) {
|
|
10913
|
+
workspaceLaunchStatus.status = 'error';
|
|
10914
|
+
workspaceLaunchStatus.message = 'Service is terminated';
|
|
10915
|
+
} else {
|
|
10916
|
+
// If container states are available, display detailed pod statuses
|
|
10917
|
+
workspaceLaunchStatus.subSteps = cs.map((c)=>({
|
|
10918
|
+
title: c.name,
|
|
10919
|
+
description: `${c.ready ? 'ready' : 'pending'}`
|
|
10920
|
+
}));
|
|
10921
|
+
}
|
|
10922
|
+
}
|
|
10923
|
+
const podStatus = retrievePodConditionStatus(core.PodConditionType.ProxyConnected, conditions);
|
|
10924
|
+
if (podStatus === core.PodStatus.False) workspaceLaunchStatus.message = 'In progress. If you are stuck here for more than a few minutes, cancel launch and try again or contact user support.';
|
|
10925
|
+
}
|
|
10926
|
+
// wait for proxy
|
|
10927
|
+
if (currentStep == 4) {
|
|
10928
|
+
// ProxyConnect == False
|
|
10929
|
+
const podStatus = retrievePodConditionStatus(core.PodConditionType.ProxyConnected, conditions);
|
|
10930
|
+
if (podStatus === core.PodStatus.True) workspaceLaunchStatus.message = 'Proxy is ready';
|
|
10931
|
+
else workspaceLaunchStatus.status = 'error';
|
|
10932
|
+
}
|
|
10933
|
+
if (currentStep == 5) {
|
|
10934
|
+
workspaceLaunchStatus.message = 'Proxy is ready';
|
|
10935
|
+
workspaceLaunchStatus.status = 'complete';
|
|
10936
|
+
}
|
|
10937
|
+
return workspaceLaunchStatus;
|
|
10938
|
+
};
|
|
10939
|
+
|
|
10940
|
+
const WorkspaceStepper = ({ stepsConfig, step })=>{
|
|
10941
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Transition, {
|
|
10942
|
+
mounted: step !== undefined,
|
|
10943
|
+
transition: "fade",
|
|
10944
|
+
duration: 1200,
|
|
10945
|
+
exitDuration: 1200,
|
|
10946
|
+
timingFunction: "ease",
|
|
10947
|
+
children: (styles)=>/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10948
|
+
className: "p-2 mt-2 w-3/4 mx-4",
|
|
10949
|
+
style: styles,
|
|
10950
|
+
children: !step ? null : /*#__PURE__*/ jsxRuntime.jsx(core$1.Stepper, {
|
|
10951
|
+
size: "xs",
|
|
10952
|
+
active: step?.step,
|
|
10953
|
+
allowNextStepsSelect: false,
|
|
10954
|
+
wrap: false,
|
|
10955
|
+
children: stepsConfig.steps.map((x)=>{
|
|
10956
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Stepper.Step, {
|
|
10957
|
+
label: x.label,
|
|
10958
|
+
description: x.description,
|
|
10959
|
+
color: step.status === 'error' ? 'red' : 'accent.4',
|
|
10960
|
+
children: step.message ? /*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
|
|
10961
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
10962
|
+
children: step.message
|
|
10963
|
+
})
|
|
10964
|
+
}) : null
|
|
10965
|
+
}, x.label);
|
|
10966
|
+
})
|
|
10967
|
+
})
|
|
10968
|
+
})
|
|
10969
|
+
});
|
|
10970
|
+
};
|
|
10971
|
+
const WorkspaceLaunchProgress = ()=>{
|
|
10972
|
+
const config = useWorkspaceContext();
|
|
10973
|
+
const workspaceStatus = core.useCoreSelector(core.selectWorkspaceStatusFromService);
|
|
10974
|
+
const step = calculateLaunchSteps(workspaceStatus);
|
|
10975
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
10976
|
+
className: "px-2 py-1 mx-8",
|
|
10977
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(WorkspaceStepper, {
|
|
10978
|
+
stepsConfig: config.launchStepIndicatorConfig,
|
|
10979
|
+
step: step
|
|
10980
|
+
})
|
|
10981
|
+
});
|
|
10982
|
+
};
|
|
10983
|
+
|
|
10984
|
+
const FULLSCREEN_STYLE = 'fixed top-0 left-0 w-full h-full flex flex-col flex-grow content-center items-center bg-base-lightest';
|
|
10985
|
+
const WorkspaceNotebookPanelWithControls = ()=>{
|
|
10986
|
+
const { isFullscreen } = useWorkspaceStatusContext();
|
|
10987
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
10988
|
+
className: isFullscreen ? FULLSCREEN_STYLE : 'flex flex-col grow w-full h-full relative',
|
|
10989
|
+
children: [
|
|
10990
|
+
/*#__PURE__*/ jsxRuntime.jsx(ExternalLoginsStatus, {}),
|
|
10991
|
+
/*#__PURE__*/ jsxRuntime.jsx(PaymentPanel, {}),
|
|
10992
|
+
/*#__PURE__*/ jsxRuntime.jsx(WorkspaceLaunchProgress, {}),
|
|
10993
|
+
/*#__PURE__*/ jsxRuntime.jsx(WorkspacePanel, {}),
|
|
10994
|
+
/*#__PURE__*/ jsxRuntime.jsx(WorkspaceNotebook, {})
|
|
10995
|
+
]
|
|
10996
|
+
});
|
|
10997
|
+
};
|
|
10998
|
+
|
|
10999
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11000
|
+
const Workspace = ({ config })=>{
|
|
11001
|
+
return /*#__PURE__*/ jsxRuntime.jsx(ProtectedContent, {
|
|
11002
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(WorkspaceProvider, {
|
|
11003
|
+
config: config,
|
|
11004
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(WorkspaceStatusProvider, {
|
|
11005
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11006
|
+
className: "flex flex-col grow w-full relative",
|
|
11007
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(WorkspaceNotebookPanelWithControls, {})
|
|
11008
|
+
})
|
|
11009
|
+
})
|
|
11010
|
+
})
|
|
11011
|
+
});
|
|
11012
|
+
};
|
|
11013
|
+
|
|
11014
|
+
const TextDescription = ({ description })=>{
|
|
11015
|
+
const [extend, setExtend] = React.useState(false);
|
|
11016
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
11017
|
+
children: [
|
|
11018
|
+
!extend ? /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
11019
|
+
lineClamp: 4,
|
|
11020
|
+
children: description
|
|
11021
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
11022
|
+
children: description
|
|
11023
|
+
}),
|
|
11024
|
+
/*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
11025
|
+
onClick: ()=>setExtend((extend)=>!extend),
|
|
11026
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
11027
|
+
className: "flex text-xs font-semibold text-gray-400",
|
|
11028
|
+
children: [
|
|
11029
|
+
!extend ? 'Extend Text' : 'Collapse Text',
|
|
11030
|
+
' ',
|
|
11031
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11032
|
+
className: "my-auto",
|
|
11033
|
+
children: !extend ? /*#__PURE__*/ jsxRuntime.jsx(md.MdKeyboardArrowDown, {}) : /*#__PURE__*/ jsxRuntime.jsx(md.MdKeyboardArrowUp, {})
|
|
11034
|
+
})
|
|
11035
|
+
]
|
|
11036
|
+
})
|
|
11037
|
+
})
|
|
11038
|
+
]
|
|
11039
|
+
});
|
|
11040
|
+
};
|
|
11041
|
+
|
|
11042
|
+
const AnalysisCenter = ({ tools, showFilterAndSort = false })=>{
|
|
11043
|
+
const [cards, setCards] = React.useState({
|
|
11044
|
+
type: '',
|
|
11045
|
+
access: '',
|
|
11046
|
+
search: ''
|
|
11047
|
+
});
|
|
11048
|
+
const handleCardsFilter = (filterType, selected)=>{
|
|
11049
|
+
if (!selected?.length) return;
|
|
11050
|
+
setCards((c)=>({
|
|
11051
|
+
...c,
|
|
11052
|
+
[filterType]: selected
|
|
11053
|
+
}));
|
|
11054
|
+
};
|
|
11055
|
+
const handleCardsSearch = (keyword)=>{
|
|
11056
|
+
if (!keyword.length) return;
|
|
11057
|
+
};
|
|
11058
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
11059
|
+
className: "w-full bg-base-lighter",
|
|
11060
|
+
children: [
|
|
11061
|
+
showFilterAndSort ? /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
11062
|
+
className: "flex justify-between items-center w-7/8 mt-2 mx-2",
|
|
11063
|
+
children: [
|
|
11064
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
11065
|
+
className: "flex space-x-4",
|
|
11066
|
+
children: [
|
|
11067
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Select, {
|
|
11068
|
+
// todo: data opts
|
|
11069
|
+
data: [],
|
|
11070
|
+
value: cards.type,
|
|
11071
|
+
comboboxProps: {
|
|
11072
|
+
transitionProps: {
|
|
11073
|
+
transition: 'pop-top-left',
|
|
11074
|
+
duration: 50,
|
|
11075
|
+
timingFunction: 'ease'
|
|
11076
|
+
}
|
|
11077
|
+
},
|
|
11078
|
+
placeholder: "Filter by type",
|
|
11079
|
+
onChange: (value)=>handleCardsFilter('type', value)
|
|
11080
|
+
}),
|
|
11081
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Select, {
|
|
11082
|
+
// todo: data opts
|
|
11083
|
+
data: [],
|
|
11084
|
+
value: cards.access,
|
|
11085
|
+
comboboxProps: {
|
|
11086
|
+
transitionProps: {
|
|
11087
|
+
transition: 'pop-top-left',
|
|
11088
|
+
duration: 50,
|
|
11089
|
+
timingFunction: 'ease'
|
|
11090
|
+
}
|
|
11091
|
+
},
|
|
11092
|
+
placeholder: "Filter by access",
|
|
11093
|
+
onChange: (value)=>handleCardsFilter('access', value)
|
|
11094
|
+
})
|
|
11095
|
+
]
|
|
11096
|
+
}),
|
|
11097
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11098
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.TextInput, {
|
|
11099
|
+
placeholder: "Search in Analysis Center",
|
|
11100
|
+
value: cards.search,
|
|
11101
|
+
size: "md",
|
|
11102
|
+
onChange: (event)=>handleCardsSearch(event.currentTarget.value)
|
|
11103
|
+
})
|
|
11104
|
+
})
|
|
11105
|
+
]
|
|
11106
|
+
}) : null,
|
|
11107
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11108
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11109
|
+
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 p-1 mx-4 overflow-y-scroll",
|
|
11110
|
+
children: tools.map(({ title, description, type, icon, image, hasDemo, loginRequired, href }, key)=>{
|
|
11111
|
+
return /*#__PURE__*/ jsxRuntime.jsx(core$1.Stack, {
|
|
11112
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
11113
|
+
className: "rounded-sm bg-base-max",
|
|
11114
|
+
children: [
|
|
11115
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11116
|
+
className: "p-0 rounded-sm",
|
|
11117
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Image, {
|
|
11118
|
+
component: Image,
|
|
11119
|
+
src: `/images/apps/${image}`,
|
|
11120
|
+
alt: `${title} image`,
|
|
11121
|
+
height: 1000,
|
|
11122
|
+
width: 1000,
|
|
11123
|
+
radius: "md"
|
|
11124
|
+
})
|
|
11125
|
+
}),
|
|
11126
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
11127
|
+
className: "flex -mt-5 relative z-10",
|
|
11128
|
+
children: [
|
|
11129
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11130
|
+
className: "p-0.5 rounded-sm bg-base-lightest ml-5 border-2 border-base",
|
|
11131
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Image, {
|
|
11132
|
+
component: Image,
|
|
11133
|
+
src: `/icons/apps/${icon}`,
|
|
11134
|
+
alt: `${title} logo`,
|
|
11135
|
+
width: 40,
|
|
11136
|
+
height: 40,
|
|
11137
|
+
radius: "lg"
|
|
11138
|
+
})
|
|
11139
|
+
}),
|
|
11140
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11141
|
+
className: "relative mb-0 ml-2",
|
|
11142
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
11143
|
+
className: "absolute bottom-0 left-0 text-xs text-gray-700 w-max",
|
|
11144
|
+
children: type === 'application' ? 'Application' : 'Jupyter Notebook'
|
|
11145
|
+
})
|
|
11146
|
+
})
|
|
11147
|
+
]
|
|
11148
|
+
}),
|
|
11149
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
11150
|
+
className: "flex flex-col mt-2 ml-2",
|
|
11151
|
+
children: [
|
|
11152
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11153
|
+
className: "text-sm font-black h-6",
|
|
11154
|
+
children: title
|
|
11155
|
+
}),
|
|
11156
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11157
|
+
className: "text-xs text-gray-400 h-6",
|
|
11158
|
+
children: loginRequired ? 'Login Required' : ' '
|
|
11159
|
+
}),
|
|
11160
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11161
|
+
className: "text-sm p-2 h-fit",
|
|
11162
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(TextDescription, {
|
|
11163
|
+
description: description
|
|
11164
|
+
})
|
|
11165
|
+
}),
|
|
11166
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
11167
|
+
className: "flex mb-4 rounded-b-md",
|
|
11168
|
+
children: type === 'application' ? /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
11169
|
+
className: "m-auto",
|
|
11170
|
+
children: [
|
|
11171
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.NavLink, {
|
|
11172
|
+
component: Link,
|
|
11173
|
+
href: href ?? '_blank',
|
|
11174
|
+
classNames: {
|
|
11175
|
+
root: 'bg-accent text-accent-contrast hover:bg-accent-darker p-2 rounded-sm',
|
|
11176
|
+
label: 'text-sm font-semibold'
|
|
11177
|
+
},
|
|
11178
|
+
label: "Run App"
|
|
11179
|
+
}),
|
|
11180
|
+
hasDemo && /*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
11181
|
+
className: "ml-2 p-1.5 rounded-sm text-sm font-semibold",
|
|
11182
|
+
children: "Demo"
|
|
11183
|
+
})
|
|
11184
|
+
]
|
|
11185
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
11186
|
+
className: "m-auto bg-accent text-accent-contrast p-1.5 rounded-sm text-sm font-semibold",
|
|
11187
|
+
children: "View Notebook"
|
|
11188
|
+
})
|
|
11189
|
+
})
|
|
11190
|
+
]
|
|
11191
|
+
})
|
|
11192
|
+
]
|
|
11193
|
+
})
|
|
11194
|
+
}, key);
|
|
11195
|
+
})
|
|
11196
|
+
})
|
|
11197
|
+
})
|
|
11198
|
+
]
|
|
11199
|
+
});
|
|
11200
|
+
};
|
|
11201
|
+
|
|
11202
|
+
const myGlob = (dir, filter)=>{
|
|
11203
|
+
try {
|
|
11204
|
+
const files = fs.readdirSync(dir);
|
|
11205
|
+
return files.filter((file)=>file.search(filter) !== -1);
|
|
11206
|
+
} catch (error) {
|
|
11207
|
+
console.log('myGlow error', error, dir);
|
|
11208
|
+
}
|
|
11209
|
+
return [];
|
|
11210
|
+
};
|
|
11211
|
+
class FilesystemContent {
|
|
11212
|
+
constructor({ rootPath }){
|
|
11213
|
+
this.rootPath = rootPath || '';
|
|
11214
|
+
}
|
|
11215
|
+
async get(filepath) {
|
|
11216
|
+
try {
|
|
11217
|
+
return await JSON.parse(fs.readFileSync(path.join(this.rootPath, filepath)).toString('utf-8'));
|
|
11218
|
+
} catch (err) {
|
|
11219
|
+
throw new Error(`Cannot process ${filepath}`);
|
|
11220
|
+
}
|
|
11221
|
+
}
|
|
11222
|
+
async getAll(filepath, filter) {
|
|
11223
|
+
try {
|
|
11224
|
+
const files = myGlob(path.join(this.rootPath, filepath), filter);
|
|
11225
|
+
return Promise.all(files.map((file)=>this.get(path.join(this.rootPath, filepath, file))));
|
|
11226
|
+
} catch (err) {
|
|
11227
|
+
throw new Error(`getAllCannot process ${filepath}/${filter}`);
|
|
11228
|
+
}
|
|
11229
|
+
}
|
|
11230
|
+
}
|
|
11231
|
+
|
|
11232
|
+
class ContentDatabase {
|
|
11233
|
+
constructor(config){
|
|
11234
|
+
this.config = config;
|
|
11235
|
+
this.store = config.store;
|
|
11236
|
+
}
|
|
11237
|
+
async get(filepath) {
|
|
11238
|
+
return this.store.get(filepath);
|
|
11239
|
+
}
|
|
11240
|
+
async getAll(filepath, filter) {
|
|
11241
|
+
// Array<Promise<T>>
|
|
11242
|
+
return this.store.getAll(filepath, filter);
|
|
11243
|
+
}
|
|
11244
|
+
}
|
|
11245
|
+
|
|
11246
|
+
const GEN3_FRONTEND_CONFIGURATION_ROOT = process.env.GEN3_FRONTEND_CONFIGURATION_ROOT || './';
|
|
11247
|
+
|
|
11248
|
+
const ContentRoot = GEN3_FRONTEND_CONFIGURATION_ROOT;
|
|
11249
|
+
const setup = ()=>{
|
|
11250
|
+
const config = {
|
|
11251
|
+
store: new FilesystemContent({
|
|
11252
|
+
rootPath: ContentRoot
|
|
11253
|
+
})
|
|
11254
|
+
};
|
|
11255
|
+
return new ContentDatabase(config);
|
|
11256
|
+
};
|
|
11257
|
+
const ContentSource = setup();
|
|
11258
|
+
|
|
11259
|
+
/**
|
|
11260
|
+
* Retrieves navigation page layout properties from configuration.
|
|
11261
|
+
* Note: GEN3_COMMONS_NAME depends on siteConfig.json value in the data commons package
|
|
11262
|
+
* @returns A Promise resolving to an object containing header and footer props.
|
|
11263
|
+
*/ const getNavPageLayoutPropsFromConfig = async ()=>{
|
|
11264
|
+
const navigationConfigJSON = await ContentSource.get(`config/${core.GEN3_COMMONS_NAME}/navigation.json`);
|
|
11265
|
+
let bannerConfigJSON = [];
|
|
11266
|
+
try {
|
|
11267
|
+
bannerConfigJSON = await ContentSource.get(`config/${core.GEN3_COMMONS_NAME}/banner.json`);
|
|
11268
|
+
} catch (e) {
|
|
11269
|
+
console.warn('No banner config found at: ', `config/${core.GEN3_COMMONS_NAME}/banner.json`);
|
|
11270
|
+
}
|
|
11271
|
+
const { topBar, navigation, type = 'original' } = navigationConfigJSON;
|
|
11272
|
+
const headerProps = {
|
|
11273
|
+
top: topBar,
|
|
11274
|
+
navigation: navigation,
|
|
11275
|
+
banners: bannerConfigJSON,
|
|
11276
|
+
type
|
|
11277
|
+
};
|
|
11278
|
+
const footerProps = await ContentSource.get(`config/${core.GEN3_COMMONS_NAME}/footer.json`);
|
|
11279
|
+
return {
|
|
11280
|
+
headerProps,
|
|
10023
11281
|
footerProps,
|
|
10024
11282
|
headerData: {
|
|
10025
11283
|
title: 'Gen3 Frontend Framework Page',
|
|
@@ -11701,7 +12959,7 @@ const createMantineTheme = (fonts, colors)=>{
|
|
|
11701
12959
|
* inactivity limits for session timeouts.
|
|
11702
12960
|
*/ const Gen3Provider = ({ colors, icons, fonts, sessionConfig, modalsConfig, children })=>{
|
|
11703
12961
|
React.useEffect(()=>{
|
|
11704
|
-
react.addCollection(
|
|
12962
|
+
icons.forEach((i)=>react.addCollection(i));
|
|
11705
12963
|
}, [
|
|
11706
12964
|
icons
|
|
11707
12965
|
]);
|
|
@@ -12506,51 +13764,6 @@ const ColorThemePageGetServerSideProps = async ()=>{
|
|
|
12506
13764
|
};
|
|
12507
13765
|
};
|
|
12508
13766
|
|
|
12509
|
-
const ProtectedContent = ({ children, referer })=>{
|
|
12510
|
-
const router$1 = router.useRouter();
|
|
12511
|
-
let redirect = referer;
|
|
12512
|
-
if (!referer && typeof window !== 'undefined') {
|
|
12513
|
-
// route not available on SSR
|
|
12514
|
-
redirect = router$1.asPath;
|
|
12515
|
-
}
|
|
12516
|
-
const onUnauthenticated = ()=>{
|
|
12517
|
-
if (typeof window !== 'undefined') // route not available on SSR
|
|
12518
|
-
router$1.push({
|
|
12519
|
-
pathname: '/Login',
|
|
12520
|
-
query: {
|
|
12521
|
-
referer: redirect
|
|
12522
|
-
}
|
|
12523
|
-
});
|
|
12524
|
-
};
|
|
12525
|
-
const { status, pending } = useSession(true, onUnauthenticated);
|
|
12526
|
-
if (status !== 'issued') {
|
|
12527
|
-
// not logged in
|
|
12528
|
-
if (pending) return /*#__PURE__*/ jsxRuntime.jsx(core$1.LoadingOverlay, {
|
|
12529
|
-
visible: pending
|
|
12530
|
-
});
|
|
12531
|
-
else return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
12532
|
-
className: "w-full h-full relative",
|
|
12533
|
-
children: [
|
|
12534
|
-
/*#__PURE__*/ jsxRuntime.jsx(core$1.LoadingOverlay, {
|
|
12535
|
-
visible: pending
|
|
12536
|
-
}),
|
|
12537
|
-
/*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
|
|
12538
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Paper, {
|
|
12539
|
-
shadow: "md",
|
|
12540
|
-
p: "md",
|
|
12541
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
12542
|
-
children: "You are not signed in and cannot access this protected content. Please login in."
|
|
12543
|
-
})
|
|
12544
|
-
})
|
|
12545
|
-
})
|
|
12546
|
-
]
|
|
12547
|
-
});
|
|
12548
|
-
}
|
|
12549
|
-
return /*#__PURE__*/ jsxRuntime.jsx(React.Fragment, {
|
|
12550
|
-
children: children
|
|
12551
|
-
});
|
|
12552
|
-
};
|
|
12553
|
-
|
|
12554
13767
|
const SOON_IN_DAYS = 86400 * 5;
|
|
12555
13768
|
const getStatus = (expiration, now)=>{
|
|
12556
13769
|
if (expiration < now) return 'Expired';
|
|
@@ -15086,67 +16299,182 @@ const SubmissionsTable = ()=>{
|
|
|
15086
16299
|
}),
|
|
15087
16300
|
' '
|
|
15088
16301
|
]
|
|
15089
|
-
});
|
|
15090
|
-
}
|
|
15091
|
-
if (isError) {
|
|
15092
|
-
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
15093
|
-
className: "flex w-full py-24 h-100 relative justify-center",
|
|
15094
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
15095
|
-
size: 'xl',
|
|
15096
|
-
children: "Error loading project data"
|
|
15097
|
-
})
|
|
15098
|
-
});
|
|
15099
|
-
}
|
|
15100
|
-
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
15101
|
-
className: "flex w-full bg-base-max p-4 rounded-lg",
|
|
15102
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
15103
|
-
className: "grow w-auto inline-block overflow-x-scroll",
|
|
15104
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(mantineReactTable.MantineReactTable, {
|
|
15105
|
-
table: table
|
|
15106
|
-
})
|
|
16302
|
+
});
|
|
16303
|
+
}
|
|
16304
|
+
if (isError) {
|
|
16305
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16306
|
+
className: "flex w-full py-24 h-100 relative justify-center",
|
|
16307
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
16308
|
+
size: 'xl',
|
|
16309
|
+
children: "Error loading project data"
|
|
16310
|
+
})
|
|
16311
|
+
});
|
|
16312
|
+
}
|
|
16313
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16314
|
+
className: "flex w-full bg-base-max p-4 rounded-lg",
|
|
16315
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16316
|
+
className: "grow w-auto inline-block overflow-x-scroll",
|
|
16317
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(mantineReactTable.MantineReactTable, {
|
|
16318
|
+
table: table
|
|
16319
|
+
})
|
|
16320
|
+
})
|
|
16321
|
+
});
|
|
16322
|
+
};
|
|
16323
|
+
|
|
16324
|
+
const SubmissionPanel = ({ config })=>{
|
|
16325
|
+
if (!config) {
|
|
16326
|
+
return /*#__PURE__*/ jsxRuntime.jsx(MessagePanel, {
|
|
16327
|
+
message: "Submission config is not defined. Page disabled"
|
|
16328
|
+
});
|
|
16329
|
+
}
|
|
16330
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
16331
|
+
className: "flex flex-col items-center p-4 w-full bg-base-lightest",
|
|
16332
|
+
children: [
|
|
16333
|
+
/*#__PURE__*/ jsxRuntime.jsx(ProjectTable, {
|
|
16334
|
+
columns: config.projectTable.columns
|
|
16335
|
+
}),
|
|
16336
|
+
/*#__PURE__*/ jsxRuntime.jsx(SubmissionsTable, {})
|
|
16337
|
+
]
|
|
16338
|
+
});
|
|
16339
|
+
};
|
|
16340
|
+
|
|
16341
|
+
const SubmissionPage = ({ submissionConfig, headerProps, footerProps })=>{
|
|
16342
|
+
return /*#__PURE__*/ jsxRuntime.jsx(NavPageLayout, {
|
|
16343
|
+
footerProps: footerProps,
|
|
16344
|
+
headerProps: headerProps,
|
|
16345
|
+
headerData: {
|
|
16346
|
+
title: 'Gen3 Submission Page',
|
|
16347
|
+
content: 'Submission page',
|
|
16348
|
+
key: 'gen3-submission-page'
|
|
16349
|
+
},
|
|
16350
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(SubmissionPanel, {
|
|
16351
|
+
config: submissionConfig
|
|
16352
|
+
})
|
|
16353
|
+
});
|
|
16354
|
+
};
|
|
16355
|
+
|
|
16356
|
+
const SubmissionPageGetServerSideProps = async ()=>{
|
|
16357
|
+
try {
|
|
16358
|
+
const submissionConfig = await ContentSource.get(`config/${core.GEN3_COMMONS_NAME}/submission.json`);
|
|
16359
|
+
return {
|
|
16360
|
+
props: {
|
|
16361
|
+
...await getNavPageLayoutPropsFromConfig(),
|
|
16362
|
+
submissionConfig: submissionConfig
|
|
16363
|
+
}
|
|
16364
|
+
};
|
|
16365
|
+
} catch (err) {
|
|
16366
|
+
console.error(err);
|
|
16367
|
+
return {
|
|
16368
|
+
props: {
|
|
16369
|
+
...await getNavPageLayoutPropsFromConfig(),
|
|
16370
|
+
submissionConfig: undefined
|
|
16371
|
+
}
|
|
16372
|
+
};
|
|
16373
|
+
}
|
|
16374
|
+
};
|
|
16375
|
+
|
|
16376
|
+
const WorkspacePage = ({ headerProps, footerProps, workspaceProps })=>{
|
|
16377
|
+
return /*#__PURE__*/ jsxRuntime.jsx(NavPageLayout, {
|
|
16378
|
+
headerProps,
|
|
16379
|
+
footerProps,
|
|
16380
|
+
headerData: {
|
|
16381
|
+
title: 'Gen3 Workspace Page',
|
|
16382
|
+
content: 'Workspace page',
|
|
16383
|
+
key: 'gen3-workspace-page'
|
|
16384
|
+
},
|
|
16385
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(Workspace, {
|
|
16386
|
+
config: workspaceProps
|
|
16387
|
+
})
|
|
16388
|
+
});
|
|
16389
|
+
};
|
|
16390
|
+
|
|
16391
|
+
const WorkspaceNoAccessPage = ({ headerProps, footerProps })=>{
|
|
16392
|
+
const supportEmail = headerProps?.siteProps?.contactEmail || 'support@datacommons.io';
|
|
16393
|
+
return /*#__PURE__*/ jsxRuntime.jsx(NavPageLayout, {
|
|
16394
|
+
headerProps,
|
|
16395
|
+
footerProps,
|
|
16396
|
+
headerData: {
|
|
16397
|
+
title: 'Gen3 Workspace No Access Page',
|
|
16398
|
+
content: 'Workspace no access page',
|
|
16399
|
+
key: 'gen3-workspace-no-access-page'
|
|
16400
|
+
},
|
|
16401
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(CardContainer, {
|
|
16402
|
+
children: [
|
|
16403
|
+
/*#__PURE__*/ jsxRuntime.jsx("h1", {
|
|
16404
|
+
children: "Error opening workspace..."
|
|
16405
|
+
}),
|
|
16406
|
+
/*#__PURE__*/ jsxRuntime.jsxs("p", {
|
|
16407
|
+
children: [
|
|
16408
|
+
"Workspace access requires authorization. Please contact",
|
|
16409
|
+
' ',
|
|
16410
|
+
/*#__PURE__*/ jsxRuntime.jsx("a", {
|
|
16411
|
+
href: `mailto:${supportEmail}`,
|
|
16412
|
+
children: supportEmail
|
|
16413
|
+
}),
|
|
16414
|
+
" for more information."
|
|
16415
|
+
]
|
|
16416
|
+
})
|
|
16417
|
+
]
|
|
15107
16418
|
})
|
|
15108
16419
|
});
|
|
15109
16420
|
};
|
|
15110
16421
|
|
|
15111
|
-
const
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
16422
|
+
const WorkspacePageGetServerSideProps = async (_context)=>{
|
|
16423
|
+
const workspaceProps = await ContentSource.get(`config/${core.GEN3_COMMONS_NAME}/workspace.json`);
|
|
16424
|
+
try {
|
|
16425
|
+
return {
|
|
16426
|
+
props: {
|
|
16427
|
+
...await getNavPageLayoutPropsFromConfig(),
|
|
16428
|
+
workspaceProps
|
|
16429
|
+
}
|
|
16430
|
+
};
|
|
16431
|
+
} catch (err) {
|
|
16432
|
+
return {
|
|
16433
|
+
props: {
|
|
16434
|
+
...await getNavPageLayoutPropsFromConfig(),
|
|
16435
|
+
workspaceProps: {
|
|
16436
|
+
launchStepIndicatorConfig: {}
|
|
16437
|
+
}
|
|
16438
|
+
}
|
|
16439
|
+
};
|
|
15116
16440
|
}
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
|
|
16441
|
+
};
|
|
16442
|
+
const WorkspaceNoAccessPageServerSideProps = async ()=>{
|
|
16443
|
+
return {
|
|
16444
|
+
props: {
|
|
16445
|
+
...await getNavPageLayoutPropsFromConfig()
|
|
16446
|
+
}
|
|
16447
|
+
};
|
|
16448
|
+
};
|
|
16449
|
+
|
|
16450
|
+
const AnalysisPanel = ({ tools })=>{
|
|
16451
|
+
return /*#__PURE__*/ jsxRuntime.jsx(AnalysisCenter, {
|
|
16452
|
+
tools: tools
|
|
15125
16453
|
});
|
|
15126
16454
|
};
|
|
15127
16455
|
|
|
15128
|
-
const
|
|
16456
|
+
const AnalysisPage = ({ headerProps, footerProps, tools })=>{
|
|
15129
16457
|
return /*#__PURE__*/ jsxRuntime.jsx(NavPageLayout, {
|
|
15130
|
-
|
|
15131
|
-
|
|
16458
|
+
headerProps,
|
|
16459
|
+
footerProps,
|
|
15132
16460
|
headerData: {
|
|
15133
|
-
title: 'Gen3
|
|
15134
|
-
content: '
|
|
15135
|
-
key: 'gen3-
|
|
16461
|
+
title: 'Gen3 Analysis Center',
|
|
16462
|
+
content: 'Analysis Center',
|
|
16463
|
+
key: 'gen3-analysis-center'
|
|
15136
16464
|
},
|
|
15137
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(
|
|
15138
|
-
|
|
16465
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(AnalysisPanel, {
|
|
16466
|
+
tools: tools
|
|
15139
16467
|
})
|
|
15140
16468
|
});
|
|
15141
16469
|
};
|
|
15142
16470
|
|
|
15143
|
-
const
|
|
16471
|
+
const AnalysisPageGetServerSideProps = async ()=>{
|
|
15144
16472
|
try {
|
|
15145
|
-
const
|
|
16473
|
+
const analysisConfig = await ContentSource.get(`config/${core.GEN3_COMMONS_NAME}/analysisTools.json`);
|
|
15146
16474
|
return {
|
|
15147
16475
|
props: {
|
|
15148
16476
|
...await getNavPageLayoutPropsFromConfig(),
|
|
15149
|
-
|
|
16477
|
+
...analysisConfig
|
|
15150
16478
|
}
|
|
15151
16479
|
};
|
|
15152
16480
|
} catch (err) {
|
|
@@ -15154,31 +16482,647 @@ const SubmissionPageGetServerSideProps = async ()=>{
|
|
|
15154
16482
|
return {
|
|
15155
16483
|
props: {
|
|
15156
16484
|
...await getNavPageLayoutPropsFromConfig(),
|
|
15157
|
-
|
|
16485
|
+
tools: []
|
|
15158
16486
|
}
|
|
15159
16487
|
};
|
|
15160
16488
|
}
|
|
15161
16489
|
};
|
|
15162
16490
|
|
|
15163
|
-
|
|
16491
|
+
// File validation
|
|
16492
|
+
const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB
|
|
16493
|
+
const ALLOWED_IMAGE_TYPES = [
|
|
16494
|
+
'image/jpeg',
|
|
16495
|
+
'image/png',
|
|
16496
|
+
'image/svg+xml'
|
|
16497
|
+
];
|
|
16498
|
+
const MAX_HISTORY = 50;
|
|
16499
|
+
const AnalysisCardEditor = ()=>{
|
|
16500
|
+
// Enhanced state management with history
|
|
16501
|
+
const [history, setHistory] = React.useState({
|
|
16502
|
+
past: [],
|
|
16503
|
+
present: [],
|
|
16504
|
+
future: []
|
|
16505
|
+
});
|
|
16506
|
+
const [editingIndex, setEditingIndex] = React.useState(null);
|
|
16507
|
+
const [selectedCards, setSelectedCards] = React.useState([]);
|
|
16508
|
+
const [errors, setErrors] = React.useState({});
|
|
16509
|
+
const [searchTerm, setSearchTerm] = React.useState('');
|
|
16510
|
+
const [filters, setFilters] = React.useState({
|
|
16511
|
+
type: [],
|
|
16512
|
+
loginRequired: null
|
|
16513
|
+
});
|
|
16514
|
+
const [currentCard, setCurrentCard] = React.useState({
|
|
16515
|
+
title: '',
|
|
16516
|
+
type: '',
|
|
16517
|
+
icon: '',
|
|
16518
|
+
image: '',
|
|
16519
|
+
description: '',
|
|
16520
|
+
loginRequired: false,
|
|
16521
|
+
href: '/'
|
|
16522
|
+
});
|
|
16523
|
+
// Helper function to update history
|
|
16524
|
+
const updateHistory = React.useCallback((newPresent)=>{
|
|
16525
|
+
setHistory((prev)=>({
|
|
16526
|
+
past: [
|
|
16527
|
+
...prev.past,
|
|
16528
|
+
prev.present
|
|
16529
|
+
].slice(-MAX_HISTORY),
|
|
16530
|
+
present: newPresent,
|
|
16531
|
+
future: []
|
|
16532
|
+
}));
|
|
16533
|
+
}, []);
|
|
16534
|
+
// Undo/Redo functions
|
|
16535
|
+
const undo = React.useCallback(()=>{
|
|
16536
|
+
setHistory((prev)=>{
|
|
16537
|
+
if (prev.past.length === 0) return prev;
|
|
16538
|
+
const newPast = prev.past.slice(0, -1);
|
|
16539
|
+
const newPresent = prev.past[prev.past.length - 1];
|
|
16540
|
+
return {
|
|
16541
|
+
past: newPast,
|
|
16542
|
+
present: newPresent,
|
|
16543
|
+
future: [
|
|
16544
|
+
prev.present,
|
|
16545
|
+
...prev.future
|
|
16546
|
+
]
|
|
16547
|
+
};
|
|
16548
|
+
});
|
|
16549
|
+
}, []);
|
|
16550
|
+
const redo = React.useCallback(()=>{
|
|
16551
|
+
setHistory((prev)=>{
|
|
16552
|
+
if (prev.future.length === 0) return prev;
|
|
16553
|
+
const [newPresent, ...newFuture] = prev.future;
|
|
16554
|
+
return {
|
|
16555
|
+
past: [
|
|
16556
|
+
...prev.past,
|
|
16557
|
+
prev.present
|
|
16558
|
+
],
|
|
16559
|
+
present: newPresent,
|
|
16560
|
+
future: newFuture
|
|
16561
|
+
};
|
|
16562
|
+
});
|
|
16563
|
+
}, []);
|
|
16564
|
+
const validateFile = (file, type)=>{
|
|
16565
|
+
if (!file) return null;
|
|
16566
|
+
if (!ALLOWED_IMAGE_TYPES.includes(file.type)) {
|
|
16567
|
+
return 'Invalid file type. Please upload a JPEG, PNG, or SVG file.';
|
|
16568
|
+
}
|
|
16569
|
+
if (file.size > MAX_FILE_SIZE) {
|
|
16570
|
+
return 'File size exceeds 5MB limit.';
|
|
16571
|
+
}
|
|
16572
|
+
return null;
|
|
16573
|
+
};
|
|
16574
|
+
const handleFileChange = (file, field)=>{
|
|
16575
|
+
const error = validateFile(file);
|
|
16576
|
+
if (error) {
|
|
16577
|
+
setErrors({
|
|
16578
|
+
...errors,
|
|
16579
|
+
[field]: error
|
|
16580
|
+
});
|
|
16581
|
+
return;
|
|
16582
|
+
}
|
|
16583
|
+
setErrors({
|
|
16584
|
+
...errors,
|
|
16585
|
+
[field]: ''
|
|
16586
|
+
});
|
|
16587
|
+
if (file) {
|
|
16588
|
+
const fileWithPreview = file;
|
|
16589
|
+
fileWithPreview.preview = URL.createObjectURL(file);
|
|
16590
|
+
setCurrentCard((prev)=>({
|
|
16591
|
+
...prev,
|
|
16592
|
+
[`${field}File`]: fileWithPreview,
|
|
16593
|
+
[field]: file.name
|
|
16594
|
+
}));
|
|
16595
|
+
}
|
|
16596
|
+
};
|
|
16597
|
+
const validateForm = ()=>{
|
|
16598
|
+
const newErrors = {};
|
|
16599
|
+
if (!currentCard.title.trim()) {
|
|
16600
|
+
newErrors.title = 'Title is required';
|
|
16601
|
+
}
|
|
16602
|
+
if (!currentCard.type) {
|
|
16603
|
+
newErrors.type = 'Type is required';
|
|
16604
|
+
}
|
|
16605
|
+
if (!currentCard.description.trim()) {
|
|
16606
|
+
newErrors.description = 'Description is required';
|
|
16607
|
+
}
|
|
16608
|
+
if (!currentCard.href.trim()) {
|
|
16609
|
+
newErrors.description = 'href is required';
|
|
16610
|
+
}
|
|
16611
|
+
setErrors(newErrors);
|
|
16612
|
+
return Object.keys(newErrors).length === 0;
|
|
16613
|
+
};
|
|
16614
|
+
const handleDelete = (indices)=>{
|
|
16615
|
+
const newCards = history.present.filter((_, index)=>!indices.includes(index));
|
|
16616
|
+
updateHistory(newCards);
|
|
16617
|
+
setSelectedCards([]);
|
|
16618
|
+
};
|
|
16619
|
+
// Import/Export
|
|
16620
|
+
const handleImport = (file)=>{
|
|
16621
|
+
if (!file) return;
|
|
16622
|
+
const reader = new FileReader();
|
|
16623
|
+
reader.onload = (e)=>{
|
|
16624
|
+
try {
|
|
16625
|
+
const content = e.target?.result;
|
|
16626
|
+
const imported = JSON.parse(content);
|
|
16627
|
+
const withImages = imported.map((card)=>{
|
|
16628
|
+
return {
|
|
16629
|
+
...card,
|
|
16630
|
+
iconFile: {
|
|
16631
|
+
preview: card.icon
|
|
16632
|
+
},
|
|
16633
|
+
imageFile: {
|
|
16634
|
+
preview: card.image
|
|
16635
|
+
}
|
|
16636
|
+
};
|
|
16637
|
+
});
|
|
16638
|
+
if (Array.isArray(withImages)) {
|
|
16639
|
+
updateHistory(withImages);
|
|
16640
|
+
console.log('Imported cards:', withImages);
|
|
16641
|
+
}
|
|
16642
|
+
} catch (error) {
|
|
16643
|
+
alert('Invalid file format');
|
|
16644
|
+
}
|
|
16645
|
+
};
|
|
16646
|
+
reader.readAsText(file);
|
|
16647
|
+
};
|
|
16648
|
+
const handleExport = ()=>{
|
|
16649
|
+
const dataStr = JSON.stringify(history.present, null, 2);
|
|
16650
|
+
const blob = new Blob([
|
|
16651
|
+
dataStr
|
|
16652
|
+
], {
|
|
16653
|
+
type: 'application/json'
|
|
16654
|
+
});
|
|
16655
|
+
const url = URL.createObjectURL(blob);
|
|
16656
|
+
const link = document.createElement('a');
|
|
16657
|
+
link.download = 'analysis-cards.json';
|
|
16658
|
+
link.href = url;
|
|
16659
|
+
link.click();
|
|
16660
|
+
};
|
|
16661
|
+
// Filter cards
|
|
16662
|
+
history.present.filter((card)=>{
|
|
16663
|
+
const matchesSearch = card.title.toLowerCase().includes(searchTerm.toLowerCase()) || card.description.toLowerCase().includes(searchTerm.toLowerCase());
|
|
16664
|
+
const matchesType = filters.type.length === 0 || filters.type.includes(card.type);
|
|
16665
|
+
const matchesLogin = filters.loginRequired === null || card.loginRequired === filters.loginRequired;
|
|
16666
|
+
return matchesSearch && matchesType && matchesLogin;
|
|
16667
|
+
});
|
|
16668
|
+
// Enhanced drag and drop handling with history
|
|
16669
|
+
const handleDragEnd = (result)=>{
|
|
16670
|
+
if (!result.destination) return;
|
|
16671
|
+
const items = Array.from(history.present);
|
|
16672
|
+
const [reorderedItem] = items.splice(result.source.index, 1);
|
|
16673
|
+
items.splice(result.destination.index, 0, reorderedItem);
|
|
16674
|
+
updateHistory(items);
|
|
16675
|
+
};
|
|
16676
|
+
// Enhanced edit handling with history
|
|
16677
|
+
const handleEdit = (index)=>{
|
|
16678
|
+
setEditingIndex(index);
|
|
16679
|
+
setCurrentCard({
|
|
16680
|
+
...history.present[index],
|
|
16681
|
+
// Reset file previews when editing
|
|
16682
|
+
iconFile: undefined,
|
|
16683
|
+
imageFile: undefined
|
|
16684
|
+
});
|
|
16685
|
+
};
|
|
16686
|
+
// Enhanced save handling
|
|
16687
|
+
const handleSave = ()=>{
|
|
16688
|
+
if (!validateForm()) return;
|
|
16689
|
+
let newCards;
|
|
16690
|
+
if (editingIndex !== null) {
|
|
16691
|
+
newCards = history.present.map((card, index)=>index === editingIndex ? {
|
|
16692
|
+
...currentCard,
|
|
16693
|
+
// Remove the file preview properties before saving
|
|
16694
|
+
iconFile: undefined,
|
|
16695
|
+
imageFile: undefined
|
|
16696
|
+
} : card);
|
|
16697
|
+
} else {
|
|
16698
|
+
newCards = [
|
|
16699
|
+
...history.present,
|
|
16700
|
+
{
|
|
16701
|
+
...currentCard,
|
|
16702
|
+
// Remove the file preview properties before saving
|
|
16703
|
+
iconFile: undefined,
|
|
16704
|
+
imageFile: undefined
|
|
16705
|
+
}
|
|
16706
|
+
];
|
|
16707
|
+
}
|
|
16708
|
+
updateHistory(newCards);
|
|
16709
|
+
resetForm();
|
|
16710
|
+
};
|
|
16711
|
+
// Enhanced reset form
|
|
16712
|
+
const resetForm = ()=>{
|
|
16713
|
+
setCurrentCard({
|
|
16714
|
+
title: '',
|
|
16715
|
+
type: '',
|
|
16716
|
+
icon: '',
|
|
16717
|
+
image: '',
|
|
16718
|
+
description: '',
|
|
16719
|
+
loginRequired: false,
|
|
16720
|
+
href: '/'
|
|
16721
|
+
});
|
|
16722
|
+
setEditingIndex(null);
|
|
16723
|
+
setErrors({});
|
|
16724
|
+
};
|
|
16725
|
+
const CardPreview = ({ card })=>/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16726
|
+
className: "flex flex-col items-center w-full max-w-sm",
|
|
16727
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
16728
|
+
className: "rounded-sm bg-white w-full",
|
|
16729
|
+
children: [
|
|
16730
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16731
|
+
className: "p-0 rounded-sm relative h-48 bg-gray-200",
|
|
16732
|
+
children: card.imageFile?.preview ? /*#__PURE__*/ jsxRuntime.jsx(Image, {
|
|
16733
|
+
src: `/images/apps/${card.imageFile.preview}`,
|
|
16734
|
+
alt: "Preview",
|
|
16735
|
+
className: "w-full h-full object-cover"
|
|
16736
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16737
|
+
className: "w-full h-full flex items-center justify-center text-gray-400",
|
|
16738
|
+
children: "Preview Image"
|
|
16739
|
+
})
|
|
16740
|
+
}),
|
|
16741
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
16742
|
+
className: "flex -mt-5 relative z-10",
|
|
16743
|
+
children: [
|
|
16744
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16745
|
+
className: "p-0.5 rounded-sm bg-gray-100 ml-5 w-10 h-10",
|
|
16746
|
+
children: card.iconFile?.preview ? /*#__PURE__*/ jsxRuntime.jsx(Image, {
|
|
16747
|
+
src: `/icons/apps/${card.iconFile.preview}`,
|
|
16748
|
+
alt: "Icon",
|
|
16749
|
+
className: "w-full h-full object-contain"
|
|
16750
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16751
|
+
className: "w-full h-full flex items-center justify-center bg-gray-200"
|
|
16752
|
+
})
|
|
16753
|
+
}),
|
|
16754
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16755
|
+
className: "relative mb-0 ml-2",
|
|
16756
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
16757
|
+
className: "absolute bottom-0 left-0 text-xs text-gray-400 w-max",
|
|
16758
|
+
children: card.type === 'application' ? 'Application' : 'Jupyter Notebook'
|
|
16759
|
+
})
|
|
16760
|
+
})
|
|
16761
|
+
]
|
|
16762
|
+
}),
|
|
16763
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
16764
|
+
className: "flex flex-col mt-2 ml-2",
|
|
16765
|
+
children: [
|
|
16766
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16767
|
+
className: "text-sm font-black h-6",
|
|
16768
|
+
children: card.title
|
|
16769
|
+
}),
|
|
16770
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16771
|
+
className: "text-xs text-gray-400 h-6",
|
|
16772
|
+
children: card.loginRequired ? 'Login Required' : ' '
|
|
16773
|
+
}),
|
|
16774
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16775
|
+
className: "text-sm p-2 h-fit",
|
|
16776
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(TextDescription, {
|
|
16777
|
+
description: card.description
|
|
16778
|
+
})
|
|
16779
|
+
}),
|
|
16780
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16781
|
+
className: "flex mb-4 rounded-b-md h-6",
|
|
16782
|
+
children: card.type === 'application' ? /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
16783
|
+
className: "m-auto",
|
|
16784
|
+
children: [
|
|
16785
|
+
/*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
16786
|
+
className: "bg-blue-500 mr-2 text-white p-1.5 rounded-sm text-sm font-semibold",
|
|
16787
|
+
children: "Run App"
|
|
16788
|
+
}),
|
|
16789
|
+
/*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
16790
|
+
className: "bg-blue-500 ml-2 text-white p-1.5 rounded-sm text-sm font-semibold",
|
|
16791
|
+
children: "Demo"
|
|
16792
|
+
})
|
|
16793
|
+
]
|
|
16794
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
16795
|
+
className: "m-auto bg-blue-500 text-white p-1.5 rounded-sm text-sm font-semibold",
|
|
16796
|
+
children: "View Notebook"
|
|
16797
|
+
})
|
|
16798
|
+
})
|
|
16799
|
+
]
|
|
16800
|
+
})
|
|
16801
|
+
]
|
|
16802
|
+
})
|
|
16803
|
+
});
|
|
16804
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16805
|
+
className: "p-8 max-w-6xl mx-auto",
|
|
16806
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
|
|
16807
|
+
gap: "xl",
|
|
16808
|
+
children: [
|
|
16809
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Title, {
|
|
16810
|
+
order: 2,
|
|
16811
|
+
children: "Analysis Card Editor"
|
|
16812
|
+
}),
|
|
16813
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
16814
|
+
children: [
|
|
16815
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Tabs, {
|
|
16816
|
+
defaultValue: "edit",
|
|
16817
|
+
children: [
|
|
16818
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Tabs.List, {
|
|
16819
|
+
children: [
|
|
16820
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Tab, {
|
|
16821
|
+
value: "edit",
|
|
16822
|
+
children: "Edit"
|
|
16823
|
+
}),
|
|
16824
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Tab, {
|
|
16825
|
+
value: "preview",
|
|
16826
|
+
children: "Preview"
|
|
16827
|
+
})
|
|
16828
|
+
]
|
|
16829
|
+
}),
|
|
16830
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Panel, {
|
|
16831
|
+
value: "edit",
|
|
16832
|
+
pt: "xs",
|
|
16833
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Card, {
|
|
16834
|
+
shadow: "sm",
|
|
16835
|
+
p: "lg",
|
|
16836
|
+
radius: "md",
|
|
16837
|
+
withBorder: true,
|
|
16838
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
|
|
16839
|
+
gap: "md",
|
|
16840
|
+
children: [
|
|
16841
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.TextInput, {
|
|
16842
|
+
required: true,
|
|
16843
|
+
label: "Title",
|
|
16844
|
+
placeholder: "Enter tool title",
|
|
16845
|
+
value: currentCard.title,
|
|
16846
|
+
onChange: (e)=>setCurrentCard((prev)=>({
|
|
16847
|
+
...prev,
|
|
16848
|
+
title: e.target.value
|
|
16849
|
+
})),
|
|
16850
|
+
error: errors.title
|
|
16851
|
+
}),
|
|
16852
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Select, {
|
|
16853
|
+
required: true,
|
|
16854
|
+
label: "Type",
|
|
16855
|
+
placeholder: "Select tool type",
|
|
16856
|
+
value: currentCard.type,
|
|
16857
|
+
onChange: (value)=>setCurrentCard((prev)=>({
|
|
16858
|
+
...prev,
|
|
16859
|
+
type: value || ''
|
|
16860
|
+
})),
|
|
16861
|
+
data: [
|
|
16862
|
+
{
|
|
16863
|
+
value: 'application',
|
|
16864
|
+
label: 'Application'
|
|
16865
|
+
},
|
|
16866
|
+
{
|
|
16867
|
+
value: 'notebook',
|
|
16868
|
+
label: 'Jupyter Notebook'
|
|
16869
|
+
}
|
|
16870
|
+
],
|
|
16871
|
+
error: errors.type
|
|
16872
|
+
}),
|
|
16873
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
16874
|
+
grow: true,
|
|
16875
|
+
children: [
|
|
16876
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.FileInput, {
|
|
16877
|
+
label: "Icon",
|
|
16878
|
+
placeholder: "Upload icon",
|
|
16879
|
+
accept: ALLOWED_IMAGE_TYPES.join(','),
|
|
16880
|
+
onChange: (file)=>handleFileChange(file, 'icon'),
|
|
16881
|
+
error: errors.icon
|
|
16882
|
+
}),
|
|
16883
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.FileInput, {
|
|
16884
|
+
label: "Preview Image",
|
|
16885
|
+
placeholder: "Upload preview image",
|
|
16886
|
+
accept: ALLOWED_IMAGE_TYPES.join(','),
|
|
16887
|
+
onChange: (file)=>handleFileChange(file, 'image'),
|
|
16888
|
+
error: errors.image
|
|
16889
|
+
})
|
|
16890
|
+
]
|
|
16891
|
+
}),
|
|
16892
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Textarea, {
|
|
16893
|
+
required: true,
|
|
16894
|
+
label: "Description",
|
|
16895
|
+
placeholder: "Enter tool description",
|
|
16896
|
+
minRows: 4,
|
|
16897
|
+
value: currentCard.description,
|
|
16898
|
+
onChange: (e)=>setCurrentCard((prev)=>({
|
|
16899
|
+
...prev,
|
|
16900
|
+
description: e.target.value
|
|
16901
|
+
})),
|
|
16902
|
+
error: errors.description
|
|
16903
|
+
}),
|
|
16904
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.TextInput, {
|
|
16905
|
+
required: true,
|
|
16906
|
+
label: "href",
|
|
16907
|
+
placeholder: "Enter application path",
|
|
16908
|
+
value: currentCard.href,
|
|
16909
|
+
onChange: (e)=>setCurrentCard((prev)=>({
|
|
16910
|
+
...prev,
|
|
16911
|
+
href: e.target.value
|
|
16912
|
+
})),
|
|
16913
|
+
error: errors.href
|
|
16914
|
+
}),
|
|
16915
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Switch, {
|
|
16916
|
+
label: "Login Required",
|
|
16917
|
+
checked: currentCard.loginRequired,
|
|
16918
|
+
onChange: (e)=>setCurrentCard((prev)=>({
|
|
16919
|
+
...prev,
|
|
16920
|
+
loginRequired: e.currentTarget.checked
|
|
16921
|
+
}))
|
|
16922
|
+
}),
|
|
16923
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
16924
|
+
children: [
|
|
16925
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
16926
|
+
onClick: handleSave,
|
|
16927
|
+
color: "blue",
|
|
16928
|
+
children: editingIndex !== null ? 'Update Card' : 'Add Card'
|
|
16929
|
+
}),
|
|
16930
|
+
editingIndex !== null && /*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
16931
|
+
onClick: resetForm,
|
|
16932
|
+
color: "gray",
|
|
16933
|
+
children: "Cancel Edit"
|
|
16934
|
+
})
|
|
16935
|
+
]
|
|
16936
|
+
})
|
|
16937
|
+
]
|
|
16938
|
+
})
|
|
16939
|
+
})
|
|
16940
|
+
}),
|
|
16941
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Panel, {
|
|
16942
|
+
value: "preview",
|
|
16943
|
+
pt: "xs",
|
|
16944
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(CardPreview, {
|
|
16945
|
+
card: currentCard
|
|
16946
|
+
})
|
|
16947
|
+
})
|
|
16948
|
+
]
|
|
16949
|
+
}),
|
|
16950
|
+
history.present.length > 0 && /*#__PURE__*/ jsxRuntime.jsx(core$1.Card, {
|
|
16951
|
+
shadow: "sm",
|
|
16952
|
+
p: "lg",
|
|
16953
|
+
radius: "md",
|
|
16954
|
+
withBorder: true,
|
|
16955
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Stack, {
|
|
16956
|
+
gap: "md",
|
|
16957
|
+
children: [
|
|
16958
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Title, {
|
|
16959
|
+
order: 3,
|
|
16960
|
+
children: [
|
|
16961
|
+
"Added Cards (",
|
|
16962
|
+
history.present.length,
|
|
16963
|
+
")"
|
|
16964
|
+
]
|
|
16965
|
+
}),
|
|
16966
|
+
/*#__PURE__*/ jsxRuntime.jsx(dnd.DragDropContext, {
|
|
16967
|
+
onDragEnd: handleDragEnd,
|
|
16968
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(dnd.Droppable, {
|
|
16969
|
+
droppableId: "cards",
|
|
16970
|
+
children: (provided)=>/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
16971
|
+
...provided.droppableProps,
|
|
16972
|
+
ref: provided.innerRef,
|
|
16973
|
+
children: [
|
|
16974
|
+
history.present.map((card, index)=>/*#__PURE__*/ jsxRuntime.jsx(dnd.Draggable, {
|
|
16975
|
+
draggableId: `card-${index}`,
|
|
16976
|
+
index: index,
|
|
16977
|
+
children: (provided)=>/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
16978
|
+
ref: provided.innerRef,
|
|
16979
|
+
...provided.draggableProps,
|
|
16980
|
+
...provided.dragHandleProps,
|
|
16981
|
+
className: "mb-2",
|
|
16982
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Card, {
|
|
16983
|
+
withBorder: true,
|
|
16984
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
16985
|
+
justify: "space-between",
|
|
16986
|
+
children: [
|
|
16987
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
16988
|
+
children: [
|
|
16989
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
|
|
16990
|
+
fw: 500,
|
|
16991
|
+
children: card.title
|
|
16992
|
+
}),
|
|
16993
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Text, {
|
|
16994
|
+
size: "sm",
|
|
16995
|
+
color: "dimmed",
|
|
16996
|
+
children: [
|
|
16997
|
+
"Type: ",
|
|
16998
|
+
card.type
|
|
16999
|
+
]
|
|
17000
|
+
}),
|
|
17001
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Text, {
|
|
17002
|
+
size: "sm",
|
|
17003
|
+
color: "dimmed",
|
|
17004
|
+
children: [
|
|
17005
|
+
"Login Required:",
|
|
17006
|
+
' ',
|
|
17007
|
+
card.loginRequired ? 'Yes' : 'No'
|
|
17008
|
+
]
|
|
17009
|
+
})
|
|
17010
|
+
]
|
|
17011
|
+
}),
|
|
17012
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
17013
|
+
children: [
|
|
17014
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
17015
|
+
variant: "light",
|
|
17016
|
+
size: "xs",
|
|
17017
|
+
onClick: ()=>handleEdit(index),
|
|
17018
|
+
children: "Edit"
|
|
17019
|
+
}),
|
|
17020
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
17021
|
+
variant: "light",
|
|
17022
|
+
color: "red",
|
|
17023
|
+
size: "xs",
|
|
17024
|
+
onClick: ()=>handleDelete([
|
|
17025
|
+
index
|
|
17026
|
+
]),
|
|
17027
|
+
children: "Delete"
|
|
17028
|
+
})
|
|
17029
|
+
]
|
|
17030
|
+
})
|
|
17031
|
+
]
|
|
17032
|
+
})
|
|
17033
|
+
})
|
|
17034
|
+
})
|
|
17035
|
+
}, index)),
|
|
17036
|
+
provided.placeholder
|
|
17037
|
+
]
|
|
17038
|
+
})
|
|
17039
|
+
})
|
|
17040
|
+
})
|
|
17041
|
+
]
|
|
17042
|
+
})
|
|
17043
|
+
})
|
|
17044
|
+
]
|
|
17045
|
+
}),
|
|
17046
|
+
/*#__PURE__*/ jsxRuntime.jsxs(core$1.Group, {
|
|
17047
|
+
gap: "xs",
|
|
17048
|
+
children: [
|
|
17049
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.ActionIcon, {
|
|
17050
|
+
onClick: undo,
|
|
17051
|
+
disabled: history.past.length === 0,
|
|
17052
|
+
title: "Undo",
|
|
17053
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(fa.FaUndo, {
|
|
17054
|
+
size: 20
|
|
17055
|
+
})
|
|
17056
|
+
}),
|
|
17057
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.ActionIcon, {
|
|
17058
|
+
onClick: redo,
|
|
17059
|
+
disabled: history.future.length === 0,
|
|
17060
|
+
title: "Redo",
|
|
17061
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(fa.FaRedo, {
|
|
17062
|
+
size: 20
|
|
17063
|
+
})
|
|
17064
|
+
}),
|
|
17065
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.FileInput, {
|
|
17066
|
+
accept: ".json",
|
|
17067
|
+
onChange: handleImport,
|
|
17068
|
+
style: {
|
|
17069
|
+
display: 'none'
|
|
17070
|
+
},
|
|
17071
|
+
id: "import-file"
|
|
17072
|
+
}),
|
|
17073
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
17074
|
+
variant: "light",
|
|
17075
|
+
leftSection: /*#__PURE__*/ jsxRuntime.jsx(fa.FaUpload, {
|
|
17076
|
+
size: 16
|
|
17077
|
+
}),
|
|
17078
|
+
onClick: ()=>document.getElementById('import-file')?.click(),
|
|
17079
|
+
children: "Import"
|
|
17080
|
+
}),
|
|
17081
|
+
/*#__PURE__*/ jsxRuntime.jsx(core$1.Button, {
|
|
17082
|
+
variant: "light",
|
|
17083
|
+
leftSection: /*#__PURE__*/ jsxRuntime.jsx(fa.FaDownload, {
|
|
17084
|
+
size: 16
|
|
17085
|
+
}),
|
|
17086
|
+
onClick: handleExport,
|
|
17087
|
+
children: "Export"
|
|
17088
|
+
})
|
|
17089
|
+
]
|
|
17090
|
+
})
|
|
17091
|
+
]
|
|
17092
|
+
})
|
|
17093
|
+
});
|
|
17094
|
+
};
|
|
17095
|
+
|
|
17096
|
+
const AnalysisEditorPage = ({ headerProps, footerProps, analysisFile })=>{
|
|
15164
17097
|
return /*#__PURE__*/ jsxRuntime.jsx(NavPageLayout, {
|
|
15165
17098
|
headerProps,
|
|
15166
17099
|
footerProps,
|
|
17100
|
+
headerProps: headerProps,
|
|
15167
17101
|
headerData: {
|
|
15168
|
-
title: 'Gen3
|
|
15169
|
-
content: '
|
|
15170
|
-
key: 'gen3-
|
|
17102
|
+
title: 'Gen3 Analysis Editor Page',
|
|
17103
|
+
content: 'Analysis Editor page',
|
|
17104
|
+
key: 'gen3-analysis-editor-page'
|
|
15171
17105
|
},
|
|
15172
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(
|
|
15173
|
-
});
|
|
15174
|
-
};
|
|
15175
|
-
|
|
15176
|
-
const
|
|
15177
|
-
const
|
|
17106
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(AnalysisCardEditor, {})
|
|
17107
|
+
});
|
|
17108
|
+
};
|
|
17109
|
+
|
|
17110
|
+
const AnalysisEditorPageGetServerSideProps = async ()=>{
|
|
17111
|
+
// const rootPath = `config/${GEN3_COMMONS_NAME}/`;
|
|
17112
|
+
// const filepath = 'user.yaml';
|
|
17113
|
+
// let data: Record<string, any> = {};
|
|
17114
|
+
// try {
|
|
17115
|
+
// // const contents = fs.readFileSync(path.join(rootPath, filepath), 'utf8');
|
|
17116
|
+
// // data = await YAML.parse(contents);
|
|
17117
|
+
// } catch (error: unknown) {
|
|
17118
|
+
// if (error instanceof Error) {
|
|
17119
|
+
// console.error(error.message);
|
|
17120
|
+
// }
|
|
17121
|
+
// throw new Error(`Cannot process ${rootPath}${filepath}`);
|
|
17122
|
+
// }
|
|
15178
17123
|
return {
|
|
15179
17124
|
props: {
|
|
15180
|
-
...await getNavPageLayoutPropsFromConfig()
|
|
15181
|
-
workspaceProps
|
|
17125
|
+
...await getNavPageLayoutPropsFromConfig()
|
|
15182
17126
|
}
|
|
15183
17127
|
};
|
|
15184
17128
|
};
|
|
@@ -15227,6 +17171,38 @@ const AISearchPageGetServerSideProps = async ()=>{
|
|
|
15227
17171
|
}
|
|
15228
17172
|
};
|
|
15229
17173
|
|
|
17174
|
+
const NotebookLitePage = ({ headerProps, footerProps })=>{
|
|
17175
|
+
return /*#__PURE__*/ jsxRuntime.jsx(NavPageLayout, {
|
|
17176
|
+
footerProps,
|
|
17177
|
+
headerProps,
|
|
17178
|
+
headerData: {
|
|
17179
|
+
title: 'Gen3 Notebooks Lite Page',
|
|
17180
|
+
content: 'Notebooks Lite',
|
|
17181
|
+
key: 'gen3-notebooks-lite-page'
|
|
17182
|
+
},
|
|
17183
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
17184
|
+
className: "flex justify-items-center w-full",
|
|
17185
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("iframe", {
|
|
17186
|
+
allow: "cross-origin",
|
|
17187
|
+
src: "https://localhost:3010/jupyter/index.html",
|
|
17188
|
+
width: "100%",
|
|
17189
|
+
height: "100%",
|
|
17190
|
+
title: "client notebook"
|
|
17191
|
+
})
|
|
17192
|
+
})
|
|
17193
|
+
});
|
|
17194
|
+
};
|
|
17195
|
+
|
|
17196
|
+
// should move this thing into _app.tsx and make a dedicated layout component after https://github.com/vercel/next.js/discussions/10949 is addressed
|
|
17197
|
+
const NotebookLitePageGetStaticProps = async ()=>{
|
|
17198
|
+
const navPageLayoutProps = await getNavPageLayoutPropsFromConfig();
|
|
17199
|
+
return {
|
|
17200
|
+
props: {
|
|
17201
|
+
...navPageLayoutProps
|
|
17202
|
+
}
|
|
17203
|
+
};
|
|
17204
|
+
};
|
|
17205
|
+
|
|
15230
17206
|
const CrosswalkTable = ({ mapping, data, isFetching, isError, tableMessage, showSubmittedIdInTable })=>{
|
|
15231
17207
|
const cols = React.useMemo(()=>{
|
|
15232
17208
|
return [
|
|
@@ -15803,6 +17779,11 @@ exports.AISearchPageGetServerSideProps = AISearchPageGetServerSideProps;
|
|
|
15803
17779
|
exports.AdminAuthZPageGetServerSideProps = AdminAuthZPageGetServerSideProps;
|
|
15804
17780
|
exports.AiSearch = AiSearch;
|
|
15805
17781
|
exports.AiSearchPage = AISearchPage;
|
|
17782
|
+
exports.AnalysisCenter = AnalysisCenter;
|
|
17783
|
+
exports.AnalysisEditorPage = AnalysisEditorPage;
|
|
17784
|
+
exports.AnalysisEditorPageGetServerSideProps = AnalysisEditorPageGetServerSideProps;
|
|
17785
|
+
exports.AnalysisPage = AnalysisPage;
|
|
17786
|
+
exports.AnalysisPageGetServerSideProps = AnalysisPageGetServerSideProps;
|
|
15806
17787
|
exports.AuthzPage = AuthzPage;
|
|
15807
17788
|
exports.BaseModal = BaseModal;
|
|
15808
17789
|
exports.Charts = Charts;
|
|
@@ -15847,6 +17828,8 @@ exports.NavPageLayout = NavPageLayout;
|
|
|
15847
17828
|
exports.NavigationBar = NavigationBar;
|
|
15848
17829
|
exports.NavigationButton = NavigationButton;
|
|
15849
17830
|
exports.NoAccessModal = NoAccessModal;
|
|
17831
|
+
exports.NotebookLitePage = NotebookLitePage;
|
|
17832
|
+
exports.NotebookLitePageGetStaticProps = NotebookLitePageGetStaticProps;
|
|
15850
17833
|
exports.ProfilePage = ProfilePage;
|
|
15851
17834
|
exports.ProfilePageGetServerSideProps = ProfilePageGetServerSideProps;
|
|
15852
17835
|
exports.ProfileProvider = ProfileProvider;
|
|
@@ -15862,9 +17845,11 @@ exports.SubmissionPageGetServerSideProps = SubmissionPageGetServerSideProps;
|
|
|
15862
17845
|
exports.TagCloud = TagCloud;
|
|
15863
17846
|
exports.TailwindConfig = TailwindConfig;
|
|
15864
17847
|
exports.User = User;
|
|
15865
|
-
exports.
|
|
15866
|
-
exports.
|
|
15867
|
-
exports.
|
|
17848
|
+
exports.Workspace = Workspace;
|
|
17849
|
+
exports.WorkspaceNoAccessPage = WorkspaceNoAccessPage;
|
|
17850
|
+
exports.WorkspaceNoAccessPageServerSideProps = WorkspaceNoAccessPageServerSideProps;
|
|
17851
|
+
exports.WorkspacePage = WorkspacePage;
|
|
17852
|
+
exports.WorkspacePageGetServerSideProps = WorkspacePageGetServerSideProps;
|
|
15868
17853
|
exports.capitalize = capitalize;
|
|
15869
17854
|
exports.computeRowSpan = computeRowSpan;
|
|
15870
17855
|
exports.create10ColorAccessibleContrast = create10ColorAccessibleContrast;
|