@gen3/frontend 0.10.75 → 0.10.76
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 +16 -35
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.d.ts +0 -1
- package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.d.ts.map +1 -1
- package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.js +3 -3
- package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.js.map +1 -1
- package/dist/dts/components/Buttons/UploadJSONButton.d.ts.map +1 -1
- package/dist/dts/components/Buttons/UploadJSONButton.js +12 -1
- package/dist/dts/components/Buttons/UploadJSONButton.js.map +1 -1
- package/dist/dts/components/Content/TextContent.d.ts +2 -1
- package/dist/dts/components/Content/TextContent.d.ts.map +1 -1
- package/dist/dts/components/Content/TextContent.js +8 -5
- package/dist/dts/components/Content/TextContent.js.map +1 -1
- package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.d.ts +12 -8
- package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.d.ts.map +1 -1
- package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.js +11 -17
- package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.js.map +1 -1
- package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.unit.test.js +4 -18
- package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.unit.test.js.map +1 -1
- package/dist/dts/components/Login/LoginProvidersPanel.d.ts.map +1 -1
- package/dist/dts/components/Login/LoginProvidersPanel.js +8 -5
- package/dist/dts/components/Login/LoginProvidersPanel.js.map +1 -1
- package/dist/dts/components/MessageCards/ErrorCard.js +1 -1
- package/dist/dts/components/MessageCards/ErrorCard.js.map +1 -1
- package/dist/dts/components/MessageCards/WarningCard.js +1 -1
- package/dist/dts/components/MessageCards/WarningCard.js.map +1 -1
- package/dist/dts/components/MessagePanel.d.ts.map +1 -1
- package/dist/dts/components/MessagePanel.js +1 -1
- package/dist/dts/components/MessagePanel.js.map +1 -1
- package/dist/dts/components/Providers/Gen3Provider.d.ts +2 -3
- package/dist/dts/components/Providers/Gen3Provider.d.ts.map +1 -1
- package/dist/dts/components/Providers/Gen3Provider.js +4 -8
- package/dist/dts/components/Providers/Gen3Provider.js.map +1 -1
- package/dist/dts/components/Providers/ResourceMonitor.d.ts +1 -1
- package/dist/dts/components/Providers/ResourceMonitor.d.ts.map +1 -1
- package/dist/dts/components/Providers/ResourceMonitor.js +131 -48
- package/dist/dts/components/Providers/ResourceMonitor.js.map +1 -1
- package/dist/dts/components/charts/echarts/BarChart.d.ts.map +1 -1
- package/dist/dts/components/charts/echarts/BarChart.js +4 -28
- package/dist/dts/components/charts/echarts/BarChart.js.map +1 -1
- package/dist/dts/components/facets/FacetControlsHeader.d.ts.map +1 -1
- package/dist/dts/components/facets/FacetControlsHeader.js +1 -0
- package/dist/dts/components/facets/FacetControlsHeader.js.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortBuilder.d.ts +0 -1
- package/dist/dts/features/CohortBuilder/CohortBuilder.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortBuilder.js +1 -13
- package/dist/dts/features/CohortBuilder/CohortBuilder.js.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortManager.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/CohortManager.js +17 -0
- package/dist/dts/features/CohortBuilder/CohortManager.js.map +1 -0
- package/dist/dts/features/CohortBuilder/CohortPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortPanel.js +2 -3
- package/dist/dts/features/CohortBuilder/CohortPanel.js.map +1 -1
- package/dist/dts/features/CohortBuilder/CohortSelector.d.ts +3 -0
- package/dist/dts/features/CohortBuilder/CohortSelector.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/CohortSelector.js +18 -0
- package/dist/dts/features/CohortBuilder/CohortSelector.js.map +1 -0
- package/dist/dts/features/CohortBuilder/{QueryExpression/QueryExpressionSection.d.ts → QueryExpressionSection.d.ts} +4 -1
- package/dist/dts/features/CohortBuilder/QueryExpressionSection.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/{QueryExpression/QueryExpressionSection.js → QueryExpressionSection.js} +28 -36
- package/dist/dts/features/CohortBuilder/QueryExpressionSection.js.map +1 -0
- package/dist/dts/features/CohortBuilder/QueryExpressionsExpandedContext.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/QueryExpressionsExpandedContext.js.map +1 -0
- package/dist/dts/features/CohortBuilder/{QueryExpression/QueryRepresentation.d.ts → QueryRepresentation.d.ts} +1 -1
- package/dist/dts/features/CohortBuilder/QueryRepresentation.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/{QueryExpression/QueryRepresentation.js → QueryRepresentation.js} +30 -23
- package/dist/dts/features/CohortBuilder/QueryRepresentation.js.map +1 -0
- package/dist/dts/features/CohortBuilder/QueryRepresentationLabel.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/QueryRepresentationLabel.js.map +1 -0
- package/dist/dts/features/CohortBuilder/hooks.d.ts +0 -1
- package/dist/dts/features/CohortBuilder/hooks.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/hooks.js +1 -52
- package/dist/dts/features/CohortBuilder/hooks.js.map +1 -1
- package/dist/dts/features/CohortBuilder/style.d.ts +0 -6
- package/dist/dts/features/CohortBuilder/style.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/style.js +0 -11
- package/dist/dts/features/CohortBuilder/style.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.js +4 -6
- package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/FilterPanels/createFacetPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortDiscovery/IndexPanel.d.ts.map +1 -1
- package/dist/dts/features/CohortDiscovery/IndexPanel.js +3 -5
- package/dist/dts/features/CohortDiscovery/IndexPanel.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/appApi.d.ts +0 -2
- package/dist/dts/features/CohortDiscovery/appApi.d.ts.map +1 -1
- package/dist/dts/features/CohortDiscovery/appApi.js +0 -2
- package/dist/dts/features/CohortDiscovery/appApi.js.map +1 -1
- package/dist/dts/features/CohortDiscovery/hooks.d.ts +0 -10
- package/dist/dts/features/CohortDiscovery/hooks.d.ts.map +1 -1
- package/dist/dts/features/CohortDiscovery/hooks.js +1 -38
- package/dist/dts/features/CohortDiscovery/hooks.js.map +1 -1
- package/dist/dts/features/CohortDiversity/diversityApi.d.ts +12 -12
- package/dist/dts/features/Crosswalk/CrosswalkPanel.d.ts +1 -1
- package/dist/dts/features/Crosswalk/CrosswalkPanel.d.ts.map +1 -1
- package/dist/dts/features/Crosswalk/CrosswalkPanel.js +11 -11
- package/dist/dts/features/Crosswalk/CrosswalkPanel.js.map +1 -1
- package/dist/dts/features/Crosswalk/types.d.ts +1 -0
- package/dist/dts/features/Crosswalk/types.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/QueryDetails.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/QueryDetails.js +2 -2
- package/dist/dts/features/DataLibrary/QueryDetails.js.map +1 -1
- package/dist/dts/features/Dictionary/Dictionary.d.ts.map +1 -1
- package/dist/dts/features/Dictionary/Dictionary.js +1 -0
- package/dist/dts/features/Dictionary/Dictionary.js.map +1 -1
- package/dist/dts/features/Dictionary/index.d.ts +3 -1
- package/dist/dts/features/Dictionary/index.d.ts.map +1 -1
- package/dist/dts/features/Dictionary/index.js +3 -1
- package/dist/dts/features/Dictionary/index.js.map +1 -1
- package/dist/dts/features/Dictionary/metadata/MetadataDictionary.d.ts +7 -0
- package/dist/dts/features/Dictionary/metadata/MetadataDictionary.d.ts.map +1 -0
- package/dist/dts/features/Dictionary/metadata/MetadataDictionary.js +39 -0
- package/dist/dts/features/Dictionary/metadata/MetadataDictionary.js.map +1 -0
- package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.d.ts +9 -0
- package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.d.ts.map +1 -0
- package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.js +113 -0
- package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.js.map +1 -0
- package/dist/dts/features/Dictionary/metadata/registerApp.d.ts +3 -0
- package/dist/dts/features/Dictionary/metadata/registerApp.d.ts.map +1 -0
- package/dist/dts/features/Dictionary/metadata/registerApp.js +13 -0
- package/dist/dts/features/Dictionary/metadata/registerApp.js.map +1 -0
- package/dist/dts/features/Dictionary/metadata/types.d.ts +17 -0
- package/dist/dts/features/Dictionary/metadata/types.d.ts.map +1 -0
- package/dist/dts/features/Dictionary/metadata/types.js +2 -0
- package/dist/dts/features/Dictionary/metadata/types.js.map +1 -0
- package/dist/dts/features/Navigation/TopBar.d.ts.map +1 -1
- package/dist/dts/features/Navigation/TopBar.js +4 -3
- package/dist/dts/features/Navigation/TopBar.js.map +1 -1
- package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.d.ts.map +1 -1
- package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.js +1 -1
- package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.js.map +1 -1
- package/dist/dts/features/Workspace/NotebookCard.d.ts.map +1 -1
- package/dist/dts/features/Workspace/NotebookCard.js +30 -8
- package/dist/dts/features/Workspace/NotebookCard.js.map +1 -1
- package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.d.ts.map +1 -1
- package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js +3 -4
- package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js.map +1 -1
- package/dist/dts/features/Workspace/StatusAndControls.d.ts.map +1 -1
- package/dist/dts/features/Workspace/StatusAndControls.js +3 -4
- package/dist/dts/features/Workspace/StatusAndControls.js.map +1 -1
- package/dist/dts/features/Workspace/Workspace.d.ts.map +1 -1
- package/dist/dts/features/Workspace/Workspace.js +0 -1
- package/dist/dts/features/Workspace/Workspace.js.map +1 -1
- package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.d.ts.map +1 -1
- package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.js +4 -1
- package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.js.map +1 -1
- package/dist/dts/features/Workspace/WorkspacePanel.d.ts.map +1 -1
- package/dist/dts/features/Workspace/WorkspacePanel.js +10 -9
- package/dist/dts/features/Workspace/WorkspacePanel.js.map +1 -1
- package/dist/dts/features/Workspace/WorkspaceProvider.d.ts.map +1 -1
- package/dist/dts/features/Workspace/WorkspaceProvider.js +1 -0
- package/dist/dts/features/Workspace/WorkspaceProvider.js.map +1 -1
- package/dist/dts/features/Workspace/WorkspaceStatusProvider.d.ts +2 -1
- package/dist/dts/features/Workspace/WorkspaceStatusProvider.d.ts.map +1 -1
- package/dist/dts/features/Workspace/WorkspaceStatusProvider.js +56 -27
- package/dist/dts/features/Workspace/WorkspaceStatusProvider.js.map +1 -1
- package/dist/dts/features/Workspace/types.d.ts +10 -0
- package/dist/dts/features/Workspace/types.d.ts.map +1 -1
- package/dist/dts/features/Workspace/types.js +10 -1
- package/dist/dts/features/Workspace/types.js.map +1 -1
- package/dist/dts/index.d.ts +3 -2
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/index.js +3 -2
- package/dist/dts/index.js.map +1 -1
- package/dist/dts/lib/session/session.d.ts.map +1 -1
- package/dist/dts/lib/session/session.js +7 -7
- package/dist/dts/lib/session/session.js.map +1 -1
- package/dist/dts/pages/Crosswalk/data.d.ts +2 -3
- package/dist/dts/pages/Crosswalk/data.d.ts.map +1 -1
- package/dist/dts/pages/Crosswalk/data.js +27 -11
- package/dist/dts/pages/Crosswalk/data.js.map +1 -1
- package/dist/dts/pages/Theme/index.d.ts.map +1 -1
- package/dist/dts/utils/date.d.ts +0 -6
- package/dist/dts/utils/date.d.ts.map +1 -1
- package/dist/dts/utils/date.js +0 -12
- package/dist/dts/utils/date.js.map +1 -1
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/index.js +1 -0
- package/dist/dts/utils/index.js.map +1 -1
- package/dist/dts/utils/time.d.ts +15 -0
- package/dist/dts/utils/time.d.ts.map +1 -1
- package/dist/dts/utils/time.js +105 -0
- package/dist/dts/utils/time.js.map +1 -1
- package/dist/esm/index.js +16 -35
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +46 -15
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/LICENSE +0 -201
- package/dist/dts/components/CountButton/CountButton.d.ts +0 -19
- package/dist/dts/components/CountButton/CountButton.d.ts.map +0 -1
- package/dist/dts/components/CountButton/CountButton.js +0 -18
- package/dist/dts/components/CountButton/CountButton.js.map +0 -1
- package/dist/dts/components/ErrorMessage.d.ts +0 -6
- package/dist/dts/components/ErrorMessage.d.ts.map +0 -1
- package/dist/dts/components/ErrorMessage.js +0 -8
- package/dist/dts/components/ErrorMessage.js.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.d.ts +0 -10
- package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.js +0 -53
- package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.js.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.d.ts +0 -7
- package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.js +0 -38
- package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.js.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.d.ts +0 -13
- package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.js +0 -56
- package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.js.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.d.ts +0 -4
- package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.js +0 -22
- package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.js.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.d.ts +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.js +0 -320
- package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.js.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.d.ts +0 -29
- package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js +0 -85
- package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.d.ts +0 -6
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js +0 -55
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.d.ts +0 -13
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.js +0 -41
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.js.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.js.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionsExpandedContext.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionsExpandedContext.js.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.js.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentationLabel.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentationLabel.js.map +0 -1
- package/dist/dts/features/CohortBuilder/cohortUtils.d.ts +0 -4
- package/dist/dts/features/CohortBuilder/cohortUtils.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/cohortUtils.js +0 -23
- package/dist/dts/features/CohortBuilder/cohortUtils.js.map +0 -1
- package/dist/dts/features/CohortDiscovery/CohortManager.d.ts.map +0 -1
- package/dist/dts/features/CohortDiscovery/CohortManager.js +0 -57
- package/dist/dts/features/CohortDiscovery/CohortManager.js.map +0 -1
- package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts +0 -23
- package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts.map +0 -1
- package/dist/dts/features/CohortDiscovery/CohortSelectors.js +0 -35
- package/dist/dts/features/CohortDiscovery/CohortSelectors.js.map +0 -1
- package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts +0 -91
- package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts.map +0 -1
- package/dist/dts/features/CohortDiscovery/CohortSlice.js +0 -93
- package/dist/dts/features/CohortDiscovery/CohortSlice.js.map +0 -1
- package/dist/dts/utils/icons.d.ts +0 -18
- package/dist/dts/utils/icons.d.ts.map +0 -1
- package/dist/dts/utils/icons.js +0 -18
- package/dist/dts/utils/icons.js.map +0 -1
- /package/dist/dts/features/{CohortDiscovery → CohortBuilder}/CohortManager.d.ts +0 -0
- /package/dist/dts/features/CohortBuilder/{QueryExpression/QueryExpressionsExpandedContext.d.ts → QueryExpressionsExpandedContext.d.ts} +0 -0
- /package/dist/dts/features/CohortBuilder/{QueryExpression/QueryExpressionsExpandedContext.js → QueryExpressionsExpandedContext.js} +0 -0
- /package/dist/dts/features/CohortBuilder/{QueryExpression/QueryRepresentationLabel.d.ts → QueryRepresentationLabel.d.ts} +0 -0
- /package/dist/dts/features/CohortBuilder/{QueryExpression/QueryRepresentationLabel.js → QueryRepresentationLabel.js} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Icon } from '@iconify/react';
|
|
3
|
+
import { Divider } from '@mantine/core';
|
|
3
4
|
import { mergeDefaultTailwindClassnames } from '../../utils/mergeDefaultTailwindClassnames';
|
|
4
5
|
import LoginButton from '../../components/Login/LoginButton';
|
|
5
6
|
import LoginAccountButton from '../../components/Login/LoginAccountButton';
|
|
@@ -8,7 +9,7 @@ import { LoginButtonVisibility } from '../../components/Login/types';
|
|
|
8
9
|
var TopIconButton = function (_a) {
|
|
9
10
|
var name = _a.name, _b = _a.leftIcon, leftIcon = _b === void 0 ? undefined : _b, _c = _a.rightIcon, rightIcon = _c === void 0 ? undefined : _c, _d = _a.classNames, classNames = _d === void 0 ? {} : _d, _e = _a.drawBorder, drawBorder = _e === void 0 ? true : _e;
|
|
10
11
|
var classNamesDefaults = {
|
|
11
|
-
root: "flex items-center align-middle px-2
|
|
12
|
+
root: "flex items-center align-middle px-2 my-2",
|
|
12
13
|
button: 'flex flex-nowrap items-center align-middle border-b-2 hover:border-accent border-transparent',
|
|
13
14
|
leftIcon: 'text-secondary-contrast-lighter pr-1',
|
|
14
15
|
label: 'font-content text-secondary-contrast-lighter block',
|
|
@@ -20,7 +21,7 @@ var TopIconButton = function (_a) {
|
|
|
20
21
|
var processTopBarItems = function (items, showLogin) {
|
|
21
22
|
return items.reduce(function (acc, item, index) {
|
|
22
23
|
var needsBorder = !(index === items.length - 1 && !showLogin);
|
|
23
|
-
acc.push(_jsxs("a", { className: "flex", href: item.href, children: [' ', _jsx(TopIconButton, { name: item.name, leftIcon: item.leftIcon, rightIcon: item.rightIcon, classNames: item.classNames, drawBorder: needsBorder }), ' '] }, "".concat(item.href, "_").concat(item.name)));
|
|
24
|
+
acc.push(_jsxs("a", { className: "flex", href: item.href, children: [' ', _jsx(TopIconButton, { name: item.name, leftIcon: item.leftIcon, rightIcon: item.rightIcon, classNames: item.classNames, drawBorder: needsBorder }), ' ', _jsx(Divider, { size: "md", color: "accent.4", orientation: "vertical", classNames: { root: 'my-2' } })] }, "".concat(item.href, "_").concat(item.name)));
|
|
24
25
|
return acc;
|
|
25
26
|
}, []);
|
|
26
27
|
};
|
|
@@ -31,7 +32,7 @@ var TopBar = function (_a) {
|
|
|
31
32
|
login: 'font-content hover:border-accent',
|
|
32
33
|
};
|
|
33
34
|
var mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
|
|
34
|
-
return (_jsx("div", { children: _jsx("header", { className: extractClassName('root', mergedClassnames), children: _jsxs("div", { role: "navigation", "aria-label": "top most navigation", className: "flex items-center align-middle", children: [processTopBarItems(items, loginButtonVisibility === LoginButtonVisibility.Visible), loginButtonVisibility != LoginButtonVisibility.Hidden ? (_jsx(LoginAccountButton, { className: extractClassName('login', mergedClassnames) })) : null, loginButtonVisibility != LoginButtonVisibility.Hidden ? (_jsx(LoginButton, { visibility: loginButtonVisibility, className: extractClassName('login', mergedClassnames) })) : null] }) }) }));
|
|
35
|
+
return (_jsx("div", { children: _jsx("header", { className: extractClassName('root', mergedClassnames), children: _jsxs("div", { role: "navigation", "aria-label": "top most navigation", className: "flex items-center align-middle", children: [processTopBarItems(items, loginButtonVisibility === LoginButtonVisibility.Visible), loginButtonVisibility != LoginButtonVisibility.Hidden ? (_jsxs("div", { className: "flex items-center", children: [_jsx(LoginAccountButton, { className: extractClassName('login', mergedClassnames) }), _jsx(Divider, { size: "md", color: "accent.4", orientation: "vertical" })] })) : null, loginButtonVisibility != LoginButtonVisibility.Hidden ? (_jsx("div", { className: "flex items-center", children: _jsx(LoginButton, { visibility: loginButtonVisibility, className: extractClassName('login', mergedClassnames) }) })) : null] }) }) }));
|
|
35
36
|
};
|
|
36
37
|
export default TopBar;
|
|
37
38
|
//# sourceMappingURL=TopBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopBar.js","sourceRoot":"","sources":["../../../../src/features/Navigation/TopBar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAC7D,OAAO,kBAAkB,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAgBrE,IAAM,aAAa,GAAG,UAAC,EAMT;QALZ,IAAI,UAAA,EACJ,gBAAoB,EAApB,QAAQ,mBAAG,SAAS,KAAA,EACpB,iBAAqB,EAArB,SAAS,mBAAG,SAAS,KAAA,EACrB,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA,EACf,kBAAiB,EAAjB,UAAU,mBAAG,IAAI,KAAA;IAEjB,IAAM,kBAAkB,GAAG;QACzB,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"TopBar.js","sourceRoot":"","sources":["../../../../src/features/Navigation/TopBar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,WAAW,MAAM,oCAAoC,CAAC;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AAS,EAAE,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,YAC3D,eACE,IAAI,EAAC,YAAY,gBACN,qBAAqB,EAChC,SAAS,EAAC,gCAAgC,aAEzC,kBAAkB,CACjB,KAAK,EACL,qBAAqB,KAAK,qBAAqB,CAAC,OAAO,CACxD,EACA,qBAAqB,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,CACvD,eAAK,SAAS,EAAC,mBAAmB,aAChC,KAAC,kBAAkB,IACjB,SAAS,EAAE,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,CAAC,GACtD,EACF,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,UAAU,EAAC,WAAW,EAAC,UAAU,GAAG,IACzD,CACP,CAAC,CAAC,CAAC,IAAI,EACP,qBAAqB,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,CACvD,cAAK,SAAS,EAAC,mBAAmB,YAChC,KAAC,WAAW,IACV,UAAU,EAAE,qBAAqB,EACjC,SAAS,EAAE,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,CAAC,GACtD,GACE,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,GACC,GACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalLoginsStatus.d.ts","sourceRoot":"","sources":["../../../../../src/features/Workspace/ExternalLogins/ExternalLoginsStatus.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ExternalLoginsStatus.d.ts","sourceRoot":"","sources":["../../../../../src/features/Workspace/ExternalLogins/ExternalLoginsStatus.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,oBAAoB,kEAsDzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -7,7 +7,7 @@ var ExternalLoginsStatus = function () {
|
|
|
7
7
|
return (_jsx("div", { className: "bg-primary h-24 flex justify-center", children: _jsx(Loader, {}) }));
|
|
8
8
|
}
|
|
9
9
|
if (isError) {
|
|
10
|
-
return _jsx("div", { children: "Error occurred while fetching external logins" });
|
|
10
|
+
return (_jsx("div", { className: "flex justify-center w-full p-1", children: _jsx(Text, { fw: 500, children: "Error occurred while fetching external logins" }) }));
|
|
11
11
|
}
|
|
12
12
|
if (isSuccess) {
|
|
13
13
|
var providersNeedToken = externalProviders.providers.filter(function (option) { return !option.refresh_token_expiration; });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalLoginsStatus.js","sourceRoot":"","sources":["../../../../../src/features/Workspace/ExternalLogins/ExternalLoginsStatus.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"ExternalLoginsStatus.js","sourceRoot":"","sources":["../../../../../src/features/Workspace/ExternalLogins/ExternalLoginsStatus.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,KAAK,EAAU,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1E,IAAM,oBAAoB,GAAG;IACrB,IAAA,KAKF,yBAAyB,EAAE,EAJvB,iBAAiB,UAAA,EACvB,SAAS,eAAA,EACT,OAAO,aAAA,EACP,SAAS,eACoB,CAAC;IAEhC,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CACL,cAAK,SAAS,EAAC,qCAAqC,YAClD,KAAC,MAAM,KAAG,GACN,CACP,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,cAAK,SAAS,EAAC,gCAAgC,YAC7C,KAAC,IAAI,IAAC,EAAE,EAAE,GAAG,8DAAsD,GAC/D,CACP,CAAC;IACJ,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,IAAM,kBAAkB,GAAG,iBAAiB,CAAC,SAAS,CAAC,MAAM,CAC3D,UAAC,MAAM,IAAK,OAAA,CAAC,MAAM,CAAC,wBAAwB,EAAhC,CAAgC,CAC7C,CAAC;QACF,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClC,OAAO,CACL,cAAK,SAAS,EAAC,qCAAqC,YAClD,MAAC,KAAK,eACJ,MAAC,IAAI,oIAEgD,GAAG,IACjD,EACP,KAAC,KAAK,IAAC,GAAG,EAAC,IAAI,YACZ,kBAAkB,CAAC,GAAG,CAAC,UAAC,QAAQ,IAAK,OAAA,CACpC,KAAC,KAAK,IACJ,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,SAAS,EACjB,MAAM,EAAC,IAAI,YAGV,QAAQ,CAAC,IAAI,IAFT,QAAQ,CAAC,IAAI,CAGZ,CACT,EATqC,CASrC,CAAC,GACI,IACF,GACJ,CACP,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotebookCard.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/NotebookCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotebookCard.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/NotebookCard.tsx"],"names":[],"mappings":"AAUA,OAAO,EAKL,aAAa,EAEd,MAAM,YAAY,CAAC;AAiBpB,UAAU,kBAAkB;IAC1B,IAAI,EAAE,aAAa,CAAC;CACrB;AACD,QAAA,MAAM,YAAY,aAAc,kBAAkB,4CAwFjD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,21 +1,43 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Card, Group, Stack, Text, Transition } from '@mantine/core';
|
|
2
|
+
import { Button, Card, Group, Stack, Text, Tooltip, Transition, } from '@mantine/core';
|
|
3
3
|
import { Icon } from '@iconify/react';
|
|
4
4
|
import { selectActiveWorkspaceId, selectRequestedWorkspaceStatus, selectWorkspaceStatusFromService, useCoreSelector, WorkspaceStatus, } from '@gen3/core';
|
|
5
5
|
import { useWorkspaceStatusContext } from './WorkspaceStatusProvider';
|
|
6
|
+
import { PayModelStatus } from './types';
|
|
7
|
+
var LaunchDisabledMessage = {
|
|
8
|
+
NOT_SELECTED: 'A pay model is not selected',
|
|
9
|
+
NOT_REQUIRED: 'A pay model is not required',
|
|
10
|
+
VALID: 'Launch Workspace',
|
|
11
|
+
INVALID: 'A pay model is invalid',
|
|
12
|
+
ERROR: 'An error occurred getting the pay model status',
|
|
13
|
+
OVER_LIMIT: 'You have exceeded your pay model limit',
|
|
14
|
+
GETTING: 'Getting pay model status',
|
|
15
|
+
};
|
|
6
16
|
var COMPUTE_PROPS_LABEL_STYLE = 'text-base-lighter font-medium text-sm opacity-90';
|
|
7
17
|
var NotebookCard = function (_a) {
|
|
8
18
|
var info = _a.info;
|
|
9
|
-
var _b = useWorkspaceStatusContext(), startWorkspace = _b.startWorkspace, stopWorkspace = _b.stopWorkspace,
|
|
19
|
+
var _b = useWorkspaceStatusContext(), startWorkspace = _b.startWorkspace, stopWorkspace = _b.stopWorkspace, payModelStatus = _b.payModelStatus;
|
|
10
20
|
var status = useCoreSelector(selectWorkspaceStatusFromService).status;
|
|
11
21
|
var requestedStatus = useCoreSelector(selectRequestedWorkspaceStatus);
|
|
12
22
|
var workspaceId = useCoreSelector(selectActiveWorkspaceId);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
var launchDisabled = status !== WorkspaceStatus.NotFound ||
|
|
24
|
+
!(payModelStatus === PayModelStatus.NOT_REQUIRED ||
|
|
25
|
+
payModelStatus === PayModelStatus.VALID) ||
|
|
26
|
+
(info.id !== workspaceId && requestedStatus === 'Launch');
|
|
27
|
+
return (_jsxs(Card, { withBorder: true, radius: "xs", className: "w-64", children: [_jsx(Card.Section, { inheritPadding: true, py: "xs", children: _jsxs(Stack, { align: "center", children: [_jsx(Icon, { height: '48px', icon: 'workspace:jupyter' }), _jsx(Text, { ta: "center", classNames: { root: 'h-20 font-header' }, size: "md", fw: 500, lineClamp: 3, children: info.name })] }) }), _jsx(Card.Section, { inheritPadding: true, py: "xs", children: _jsxs(Group, { justify: "center", children: [_jsxs(Text, { c: "base-contrast.4", className: COMPUTE_PROPS_LABEL_STYLE, children: ["CPU Limit: ", info.cpuLimit] }), _jsxs(Text, { c: "base-contrast.4", className: COMPUTE_PROPS_LABEL_STYLE, size: "xs", children: ["Memory: ", info.memoryLimit] })] }) }), _jsx("div", { className: "flex mx-8 justify-center border-1 border-base" }), _jsxs(Group, { className: "mt-2 p-2", justify: "center", children: [_jsx(Tooltip, { label: LaunchDisabledMessage[payModelStatus], children: _jsx(Button, { loading: info.id === workspaceId && requestedStatus === 'Launch', "data-disabled": launchDisabled, onClick: function (event) {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
startWorkspace(info.id);
|
|
30
|
+
}, children: "Launch" }) }), _jsx(Transition, { mounted: (info.id === workspaceId && requestedStatus === 'Launch') ||
|
|
31
|
+
status === 'Launching', transition: "fade", duration: 400, timingFunction: "ease", children: function () {
|
|
32
|
+
if (info.id == workspaceId) {
|
|
33
|
+
return (_jsx(Button, { onClick: function () {
|
|
34
|
+
stopWorkspace();
|
|
35
|
+
}, children: "Shutdown" }));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return _jsx("p", {});
|
|
39
|
+
}
|
|
40
|
+
} })] })] }));
|
|
19
41
|
};
|
|
20
42
|
export default NotebookCard;
|
|
21
43
|
//# sourceMappingURL=NotebookCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotebookCard.js","sourceRoot":"","sources":["../../../../src/features/Workspace/NotebookCard.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"NotebookCard.js","sourceRoot":"","sources":["../../../../src/features/Workspace/NotebookCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,EACJ,OAAO,EACP,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,gCAAgC,EAChC,eAAe,EAEf,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,IAAM,qBAAqB,GAAmC;IAC5D,YAAY,EAAE,6BAA6B;IAC3C,YAAY,EAAE,6BAA6B;IAC3C,KAAK,EAAE,kBAAkB;IACzB,OAAO,EAAE,wBAAwB;IACjC,KAAK,EAAE,gDAAgD;IACvD,UAAU,EAAE,wCAAwC;IACpD,OAAO,EAAE,0BAA0B;CACpC,CAAC;AAEF,IAAM,yBAAyB,GAC7B,kDAAkD,CAAC;AAKrD,IAAM,YAAY,GAAG,UAAC,EAA4B;QAA1B,IAAI,UAAA;IACpB,IAAA,KACJ,yBAAyB,EAAE,EADrB,cAAc,oBAAA,EAAE,aAAa,mBAAA,EAAE,cAAc,oBACxB,CAAC;IAEtB,IAAA,MAAM,GAAK,eAAe,CAAC,gCAAgC,CAAC,OAAtD,CAAuD;IACrE,IAAM,eAAe,GAAG,eAAe,CAAC,8BAA8B,CAAC,CAAC;IACxE,IAAM,WAAW,GAAG,eAAe,CAAC,uBAAuB,CAAC,CAAC;IAE7D,IAAM,cAAc,GAClB,MAAM,KAAK,eAAe,CAAC,QAAQ;QACnC,CAAC,CACC,cAAc,KAAK,cAAc,CAAC,YAAY;YAC9C,cAAc,KAAK,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KAAK,CAAC,cAAc,EAAE,CAAC;gCACvB,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;4BAC1B,CAAC,uBAGM,GACD,EACV,KAAC,UAAU,IACT,OAAO,EACL,CAAC,IAAI,CAAC,EAAE,KAAK,WAAW,IAAI,eAAe,KAAK,QAAQ,CAAC;4BACzD,MAAM,KAAK,WAAW,EAExB,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAE,GAAG,EACb,cAAc,EAAC,MAAM,YAEpB;4BACC,IAAI,IAAI,CAAC,EAAE,IAAI,WAAW,EAAE,CAAC;gCAC3B,OAAO,CACL,KAAC,MAAM,IACL,OAAO,EAAE;wCACP,aAAa,EAAE,CAAC;oCAClB,CAAC,yBAGM,CACV,CAAC;4BACJ,CAAC;iCAAM,CAAC;gCACN,OAAO,aAAK,CAAC;4BACf,CAAC;wBACH,CAAC,GACU,IACP,IACH,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentPanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/Workspace/PaymentPanel/PaymentPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaymentPanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/Workspace/PaymentPanel/PaymentPanel.tsx"],"names":[],"mappings":"AA4DA,QAAA,MAAM,YAAY,+CA2JjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { Accordion, Group, Loader, Select, Text, } from '@mantine/core';
|
|
3
|
+
import { Accordion, Center, Group, Loader, Select, Text, } from '@mantine/core';
|
|
4
4
|
import { useGetWorkspacePayModelsQuery, useSetCurrentPayModelMutation, } from '@gen3/core';
|
|
5
5
|
import { useDeepCompareMemo, useDeepCompareCallback } from 'use-deep-compare';
|
|
6
6
|
var LIMITS_LABEL_STYLE = 'text-base-lighter font-medium text-sm opacity-90';
|
|
7
7
|
import { FaUser as ActiveIcon, FaExclamationCircle as InactiveIcon, } from 'react-icons/fa';
|
|
8
8
|
import { PaymentNumberToString } from '../utils';
|
|
9
9
|
import { ErrorCard } from '../../../components/MessageCards';
|
|
10
|
-
import StatusAndControls from '../StatusAndControls';
|
|
11
10
|
var isNoPayModelError = function (error) {
|
|
12
11
|
return ('status' in error &&
|
|
13
12
|
error.status === 'PARSING_ERROR' &&
|
|
14
13
|
error.originalStatus === 404);
|
|
15
14
|
};
|
|
16
15
|
var NoPayModel = function () {
|
|
17
|
-
return (
|
|
16
|
+
return (_jsx(Group, { className: "p-2 border-1 border-l-0 border-r-0 border-base-lighter w-full h-16", justify: "space-between", children: _jsx(Text, { className: "pl-4", size: "md", classNames: { root: 'font-heading text-utility-warning' }, children: "No pay model defined" }) }));
|
|
18
17
|
};
|
|
19
18
|
var PaymentPanel = function () {
|
|
20
19
|
var _a = useGetWorkspacePayModelsQuery(), data = _a.data, isLoading = _a.isLoading, isFetching = _a.isFetching, isError = _a.isError, error = _a.error;
|
|
@@ -65,7 +64,7 @@ var PaymentPanel = function () {
|
|
|
65
64
|
return _jsx(NoPayModel, {});
|
|
66
65
|
}
|
|
67
66
|
else
|
|
68
|
-
return _jsx(ErrorCard, { message: "Unable to get Payment information" });
|
|
67
|
+
return (_jsx(Center, { children: _jsx(ErrorCard, { message: "Unable to get Payment information" }) }));
|
|
69
68
|
}
|
|
70
69
|
return (_jsx("div", { children: _jsx(Accordion, { chevronPosition: "left", children: _jsxs(Accordion.Item, { value: "accountInformation", children: [_jsx(Accordion.Control, { children: _jsxs(Group, { justify: "space-between", children: ["Account Information", _jsxs(Group, { className: "font-heading text-base-contrast", children: [_jsx(Text, { fw: 600, children: workspaceName }), _jsxs("div", { className: "flex items-center", children: [_jsx(Text, { fw: 500, size: "sm", className: "mr-1", children: "Total Usage:" }), _jsx(Text, { fw: 500, size: "sm", children: PaymentNumberToString(totalUsage) })] }), _jsxs("div", { className: "flex items-center pr-1", children: [_jsx(Text, { fw: 500, size: "sm", className: "mr-1", children: "Hard Limit:" }), _jsx(Text, { fw: 500, size: "sm", children: PaymentNumberToString(hardLimit) })] })] })] }) }), _jsx(Accordion.Panel, { children: _jsxs("div", { className: "grid grid-cols-3 p-4", children: [_jsxs("div", { className: "flex flex-col border-1 border-gray p-2 mr-4", children: [_jsxs("div", { className: "flex justify-between border-b-1 border-gray mb-2 w-full py-2", children: [_jsx("div", { className: "ml-2 text-xs", children: "Account" }), _jsx("div", { className: "mr-2 text-xs", children: "Workspace Account Manager" })] }), _jsx("div", { className: "text-center", children: _jsx("div", { children: _jsx(Select, { placeholder: "Select Workspace", renderOption: PayModelSelectItem, data: usersPayModels, onChange: function (id) {
|
|
71
70
|
if (id)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentPanel.js","sourceRoot":"","sources":["../../../../../src/features/Workspace/PaymentPanel/PaymentPanel.tsx"],"names":[],"mappings":";AAAA,OAAc,
|
|
1
|
+
{"version":3,"file":"PaymentPanel.js","sourceRoot":"","sources":["../../../../../src/features/Workspace/PaymentPanel/PaymentPanel.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAgB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EACL,SAAS,EACT,MAAM,EACN,KAAK,EACL,MAAM,EACN,MAAM,EAEN,IAAI,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE9E,IAAM,kBAAkB,GAAG,kDAAkD,CAAC;AAQ9E,OAAO,EACL,MAAM,IAAI,UAAU,EACpB,mBAAmB,IAAI,YAAY,GACpC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,qB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C,SAAS,EAAC,MAAM,4BAElC,EACP,KAAC,IAAI,IAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAC,IAAI,YACrB,qBAAqB,CAAC,SAAS,CAAC,GAC5B,IACH,IACA,IACF,GACU,EACpB,KAAC,SAAS,CAAC,KAAK,cACd,eAAK,SAAS,EAAC,sBAAsB,aACnC,eAAK,SAAS,EAAC,6CAA6C,aAC1D,eAAK,SAAS,EAAC,8DAA8D,aAC3E,cAAK,SAAS,EAAC,cAAc,wBAAc,EAC3C,cAAK,SAAS,EAAC,cAAc,0CAAgC,IACzD,EACN,cAAK,SAAS,EAAC,aAAa,YAC1B,wBACE,KAAC,MAAM,IACL,WAAW,EAAC,kBAAkB,EAC9B,YAAY,EAAE,kBAAkB,EAChC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,UAAC,EAAE;wDACX,IAAI,EAAE;4DAAE,WAAW,CAAC,EAAE,CAAC,CAAC;oDAC1B,CAAC,EACD,KAAK,EAAE,gBAAgB,GACvB,GACE,GACF,IACF,EACN,eAAK,SAAS,EAAC,yDAAyD,aACtE,cAAK,SAAS,EAAC,yDAAyD,oCAElE,EACN,KAAC,IAAI,cAAE,qBAAqB,CAAC,UAAU,CAAC,GAAQ,IAC5C,EACN,eAAK,SAAS,EAAC,oDAAoD,aACjE,cAAK,SAAS,EAAC,yDAAyD,qCAElE,EACN,KAAC,IAAI,cAAE,qBAAqB,CAAC,SAAS,CAAC,GAAQ,IAC3C,IACF,GACU,IACH,GACP,GACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusAndControls.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/StatusAndControls.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusAndControls.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/StatusAndControls.tsx"],"names":[],"mappings":"AAeA,QAAA,MAAM,iBAAiB,+CAmEtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Group, Text, Tooltip, Transition
|
|
2
|
+
import { Button, Group, Text, Tooltip, Transition } from '@mantine/core';
|
|
3
3
|
import { modals } from '@mantine/modals';
|
|
4
4
|
import { FaRegStopCircle as StopIcon } from 'react-icons/fa';
|
|
5
5
|
import { BsArrowsFullscreen as FullscreenIcon } from 'react-icons/bs';
|
|
6
|
-
import { Icon } from '@iconify/react';
|
|
7
6
|
import { useWorkspaceStatusContext } from './WorkspaceStatusProvider';
|
|
8
|
-
import { isWorkspaceRunningOrStopping, selectActiveWorkspaceStatus, selectRequestedWorkspaceStatus, useCoreSelector, } from '@gen3/core';
|
|
7
|
+
import { isWorkspaceRunningOrStopping, RequestedWorkspaceStatus, selectActiveWorkspaceStatus, selectRequestedWorkspaceStatus, useCoreSelector, } from '@gen3/core';
|
|
9
8
|
var StatusAndControls = function () {
|
|
10
9
|
var _a = useWorkspaceStatusContext(), stopWorkspace = _a.stopWorkspace, toggleFullscreen = _a.toggleFullscreen, isFullscreen = _a.isFullscreen;
|
|
11
10
|
var openModal = function () {
|
|
@@ -18,7 +17,7 @@ var StatusAndControls = function () {
|
|
|
18
17
|
};
|
|
19
18
|
var workspaceStatus = useCoreSelector(selectActiveWorkspaceStatus);
|
|
20
19
|
var requestedStatus = useCoreSelector(selectRequestedWorkspaceStatus);
|
|
21
|
-
return (_jsx(Transition, { mounted: isWorkspaceRunningOrStopping(workspaceStatus), transition: "fade", duration: 1200, timingFunction: "ease", children: function (styles) { return (_jsx("div", { style: styles, children: _jsxs(Group, { children: [_jsx(
|
|
20
|
+
return (_jsx(Transition, { mounted: isWorkspaceRunningOrStopping(workspaceStatus), transition: "fade", duration: 1200, timingFunction: "ease", children: function (styles) { return (_jsx("div", { style: styles, children: _jsxs(Group, { children: [_jsx(Tooltip, { label: "Stop Workspace", children: _jsx(Button, { loading: requestedStatus === RequestedWorkspaceStatus.Terminate, size: "md", color: "accent.5", variant: "default", onClick: function () {
|
|
22
21
|
openModal();
|
|
23
22
|
}, "aria-label": "Stop Workspace", leftSection: _jsx(StopIcon, { color: "utility.2", size: "1rem", className: "text-accent-warm" }), children: "Stop Workspace" }) }), _jsx(Tooltip, { label: "Toggle fullscreen mode", children: _jsx(Button, { color: "utility.2", size: "md", variant: "default", onClick: function () {
|
|
24
23
|
toggleFullscreen();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusAndControls.js","sourceRoot":"","sources":["../../../../src/features/Workspace/StatusAndControls.tsx"],"names":[],"mappings":";AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"StatusAndControls.js","sourceRoot":"","sources":["../../../../src/features/Workspace/StatusAndControls.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,8BAA8B,EAC9B,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,IAAM,iBAAiB,GAAG;IAClB,IAAA,KACJ,yBAAyB,EAAE,EADrB,aAAa,mBAAA,EAAE,gBAAgB,sBAAA,EAAE,YAAY,kBACxB,CAAC;IAE9B,IAAM,SAAS,GAAG;QAChB,OAAA,MAAM,CAAC,gBAAgB,CAAC;YACtB,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,KAAC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D,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,GAC9C,GACD,IACJ,GACJ,CACP,EA1CY,CA0CZ,GACU,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Workspace.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/Workspace.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Workspace.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/Workspace.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM1C,UAAU,cAAc;IACtB,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,QAAA,MAAM,SAAS,eAAgB,cAAc,4CAY5C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -3,7 +3,6 @@ import ProtectedContent from '../../components/Protected/ProtectedContent';
|
|
|
3
3
|
import WorkspaceProvider from './WorkspaceProvider';
|
|
4
4
|
import WorkspaceStatusProvider from './WorkspaceStatusProvider';
|
|
5
5
|
import WorkspaceNotebookPanelWithControls from './WorkspaceNotebookPanelWithControls';
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
6
|
var Workspace = function (_a) {
|
|
8
7
|
var config = _a.config;
|
|
9
8
|
return (_jsx(ProtectedContent, { children: _jsx(WorkspaceProvider, { config: config, children: _jsx(WorkspaceStatusProvider, { children: _jsx("div", { className: "flex flex-col grow w-full relative", children: _jsx(WorkspaceNotebookPanelWithControls, {}) }) }) }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Workspace.js","sourceRoot":"","sources":["../../../../src/features/Workspace/Workspace.tsx"],"names":[],"mappings":";AAEA,OAAO,gBAAgB,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"Workspace.js","sourceRoot":"","sources":["../../../../src/features/Workspace/Workspace.tsx"],"names":[],"mappings":";AAEA,OAAO,gBAAgB,MAAM,6CAA6C,CAAC;AAC3E,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AAMtF,IAAM,SAAS,GAAG,UAAC,EAA0B;QAAxB,MAAM,YAAA;IACzB,OAAO,CACL,KAAC,gBAAgB,cACf,KAAC,iBAAiB,IAAC,MAAM,EAAE,MAAM,YAC/B,KAAC,uBAAuB,cACtB,cAAK,SAAS,EAAC,oCAAoC,YACjD,KAAC,kCAAkC,KAAG,GAClC,GACkB,GACR,GACH,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceNotebookPanelWithControls.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspaceNotebookPanelWithControls.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WorkspaceNotebookPanelWithControls.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspaceNotebookPanelWithControls.tsx"],"names":[],"mappings":"AAaA,QAAA,MAAM,kCAAkC,+CAwBvC,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
|
|
@@ -5,12 +5,15 @@ import { useWorkspaceStatusContext } from './WorkspaceStatusProvider';
|
|
|
5
5
|
import ExternalLoginsStatus from './ExternalLogins/ExternalLoginsStatus';
|
|
6
6
|
import PaymentPanel from './PaymentPanel/PaymentPanel';
|
|
7
7
|
import WorkspaceLaunchProgress from './WorkspaceLaunchProgress';
|
|
8
|
+
import { useWorkspaceContext } from './WorkspaceProvider';
|
|
9
|
+
import StatusAndControls from './StatusAndControls';
|
|
8
10
|
var FULLSCREEN_STYLE = 'fixed top-0 left-0 w-full h-full flex flex-col flex-grow content-center items-center bg-base-lightest';
|
|
9
11
|
var WorkspaceNotebookPanelWithControls = function () {
|
|
10
12
|
var isFullscreen = useWorkspaceStatusContext().isFullscreen;
|
|
13
|
+
var requirePayModel = useWorkspaceContext().requirePayModel;
|
|
11
14
|
return (_jsxs("div", { className: isFullscreen
|
|
12
15
|
? FULLSCREEN_STYLE
|
|
13
|
-
: 'flex flex-col grow w-full h-full relative', children: [_jsx(ExternalLoginsStatus, {}), _jsx(PaymentPanel, {}), _jsx(WorkspaceLaunchProgress, {}), _jsx(WorkspacePanel, {}), _jsx(WorkspaceNotebook, {})] }));
|
|
16
|
+
: 'flex flex-col grow w-full h-full relative', children: [_jsx(ExternalLoginsStatus, {}), _jsxs("div", { className: "flex w-full p-2 ".concat(requirePayModel ? 'justify-between' : 'justify-end'), children: [requirePayModel && _jsx(PaymentPanel, {}), _jsx(StatusAndControls, {})] }), _jsx(WorkspaceLaunchProgress, {}), _jsx(WorkspacePanel, {}), _jsx(WorkspaceNotebook, {})] }));
|
|
14
17
|
};
|
|
15
18
|
export default WorkspaceNotebookPanelWithControls;
|
|
16
19
|
//# sourceMappingURL=WorkspaceNotebookPanelWithControls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceNotebookPanelWithControls.js","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspaceNotebookPanelWithControls.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,oBAAoB,MAAM,uCAAuC,CAAC;AACzE,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkspaceNotebookPanelWithControls.js","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspaceNotebookPanelWithControls.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,oBAAoB,MAAM,uCAAuC,CAAC;AACzE,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,IAAM,gBAAgB,GACpB,uGAAuG,CAAC;AAE1G,IAAM,kCAAkC,GAAG;IACjC,IAAA,YAAY,GAAK,yBAAyB,EAAE,aAAhC,CAAiC;IAC7C,IAAA,eAAe,GAAK,mBAAmB,EAAE,gBAA1B,CAA2B;IAElD,OAAO,CACL,eACE,SAAS,EACP,YAAY;YACV,CAAC,CAAC,gBAAgB;YAClB,CAAC,CAAC,2CAA2C,aAGjD,KAAC,oBAAoB,KAAG,EACxB,eACE,SAAS,EAAE,0BAAmB,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAE,aAElF,eAAe,IAAI,KAAC,YAAY,KAAG,EACpC,KAAC,iBAAiB,KAAG,IACjB,EACN,KAAC,uBAAuB,KAAG,EAC3B,KAAC,cAAc,KAAG,EAClB,KAAC,iBAAiB,KAAG,IACjB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspacePanel.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspacePanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WorkspacePanel.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspacePanel.tsx"],"names":[],"mappings":"AAWA,QAAA,MAAM,cAAc,+CAoDnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Grid, rem, Transition } from '@mantine/core';
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Center, Grid, LoadingOverlay, rem, Transition } from '@mantine/core';
|
|
3
|
+
import { useGetWorkspaceOptionsQuery, useGetWorkspaceStatusQuery, WorkspaceStatus, } from '@gen3/core';
|
|
4
4
|
import { ErrorCard } from '../../components/MessageCards';
|
|
5
5
|
import NotebookCard from './NotebookCard';
|
|
6
6
|
var WorkspacePanel = function () {
|
|
7
|
-
var _a = useGetWorkspaceOptionsQuery(), data = _a.data, isLoading = _a.isLoading, isError = _a.isError
|
|
8
|
-
var
|
|
7
|
+
var _a = useGetWorkspaceOptionsQuery(), data = _a.data, isLoading = _a.isLoading, isError = _a.isError;
|
|
8
|
+
var workspaceStatusData = useGetWorkspaceStatusQuery(undefined).data;
|
|
9
9
|
if (isError) {
|
|
10
|
-
return _jsx(ErrorCard, { message: "Error loading workspace definitions" });
|
|
10
|
+
return (_jsx(Center, { children: _jsx(ErrorCard, { message: "Error loading workspace definitions" }) }));
|
|
11
11
|
}
|
|
12
|
+
var workspaceStatus = workspaceStatusData === null || workspaceStatusData === void 0 ? void 0 : workspaceStatusData.status;
|
|
12
13
|
return (_jsx(_Fragment, { children: _jsx(Transition, { mounted: workspaceStatus === WorkspaceStatus.NotFound ||
|
|
13
|
-
workspaceStatus === WorkspaceStatus.Launching, transition: "scale-y", duration: 600, exitDuration: 600, timingFunction: "ease", children: function (styles) { return (
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
workspaceStatus === WorkspaceStatus.Launching, transition: "scale-y", duration: 600, exitDuration: 600, timingFunction: "ease", children: function (styles) { return (_jsxs("div", { className: "px-2 mt-4", style: styles, children: [_jsx(LoadingOverlay, { visible: isLoading }), _jsx(Grid, { justify: "center", align: "stretch", gutter: "sm", overflow: "hidden", children: data === null || data === void 0 ? void 0 : data.map(function (card) {
|
|
15
|
+
return (_jsx(Grid.Col, { span: "content", style: { minHeight: rem(150) }, children: _jsx(NotebookCard, { info: card }) }, card.id));
|
|
16
|
+
}) })] })); } }) }));
|
|
16
17
|
};
|
|
17
18
|
export default WorkspacePanel;
|
|
18
19
|
//# sourceMappingURL=WorkspacePanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspacePanel.js","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspacePanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkspacePanel.js","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspacePanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAE1B,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,IAAM,cAAc,GAAG;IACf,IAAA,KAA+B,2BAA2B,EAAE,EAA1D,IAAI,UAAA,EAAE,SAAS,eAAA,EAAE,OAAO,aAAkC,CAAC;IAE3D,IAAM,mBAAmB,GAAK,0BAA0B,CAAC,SAAS,CAAC,KAA1C,CAA2C;IAE5E,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,KAAC,MAAM,cACL,KAAC,SAAS,IAAC,OAAO,EAAC,qCAAqC,GAAG,GACpD,CACV,CAAC;IACJ,CAAC;IAED,IAAM,eAAe,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,MAAM,CAAC;IACpD,OAAO,CACL,4BACE,KAAC,UAAU,IACT,OAAO,EACL,eAAe,KAAK,eAAe,CAAC,QAAQ;gBAC5C,eAAe,KAAK,eAAe,CAAC,SAAS,EAE/C,UAAU,EAAC,SAAS,EACpB,QAAQ,EAAE,GAAG,EACb,YAAY,EAAE,GAAG,EACjB,cAAc,EAAC,MAAM,YAEpB,UAAC,MAAM,IAAK,OAAA,CACX,eAAK,SAAS,EAAC,WAAW,EAAC,KAAK,EAAE,MAAM,aACtC,KAAC,cAAc,IAAC,OAAO,EAAE,SAAS,GAAI,EACtC,KAAC,IAAI,IACH,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAC,SAAS,EACf,MAAM,EAAC,IAAI,EACX,QAAQ,EAAC,QAAQ,YAEhB,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,CAAC,UAAC,IAAmB;4BAC7B,OAAO,CACL,KAAC,IAAI,CAAC,GAAG,IAEP,IAAI,EAAC,SAAS,EACd,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,YAE9B,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,GAAI,IAJvB,IAAI,CAAC,EAAE,CAKH,CACZ,CAAC;wBACJ,CAAC,CAAC,GACG,IACH,CACP,EAtBY,CAsBZ,GACU,GACZ,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceProvider.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspaceProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkspaceProvider.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspaceProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA0B1C,eAAO,MAAM,mBAAmB,uBAM/B,CAAC;AAEF,QAAA,MAAM,iBAAiB,0BAGpB;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;CACzB,4CAOA,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -12,6 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import React, { createContext } from 'react';
|
|
14
14
|
var WorkspaceConfigDefaults = {
|
|
15
|
+
requirePayModel: true,
|
|
15
16
|
launchStepIndicatorConfig: {
|
|
16
17
|
steps: [
|
|
17
18
|
{ label: 'Requesting', description: 'requesting workspace resources' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceProvider.js","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspaceProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAGxD,IAAM,uBAAuB,GAAoB;IAC/C,yBAAyB,EAAE;QACzB,KAAK,EAAE;YACL,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,gCAAgC,EAAE;YACtE,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,8BAA8B,EAAE;YACtE,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE;YAC1D;gBACE,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,sBAAsB;aACpC;YACD;gBACE,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,qCAAqC;aACnD;YACD,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE;SACtD;KACF;CACF,CAAC;AAEF,IAAM,gBAAgB,GAAG,aAAa,CACpC,uBAAuB,CACxB,CAAC;AAEF,MAAM,CAAC,IAAM,mBAAmB,GAAG;IACjC,IAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IACnD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,KAAK,CAAC,wDAAwD,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,IAAM,iBAAiB,GAAG,UAAC,EAM1B;QALC,QAAQ,cAAA,EACR,MAAM,YAAA;IAKN,IAAM,YAAY,yBAAQ,uBAAuB,GAAK,MAAM,CAAE,CAAC;IAC/D,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC3C,QAAQ,GACiB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"WorkspaceProvider.js","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspaceProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAGxD,IAAM,uBAAuB,GAAoB;IAC/C,eAAe,EAAE,IAAI;IACrB,yBAAyB,EAAE;QACzB,KAAK,EAAE;YACL,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,gCAAgC,EAAE;YACtE,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,8BAA8B,EAAE;YACtE,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE;YAC1D;gBACE,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,sBAAsB;aACpC;YACD;gBACE,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,qCAAqC;aACnD;YACD,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE;SACtD;KACF;CACF,CAAC;AAEF,IAAM,gBAAgB,GAAG,aAAa,CACpC,uBAAuB,CACxB,CAAC;AAEF,MAAM,CAAC,IAAM,mBAAmB,GAAG;IACjC,IAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IACnD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,KAAK,CAAC,wDAAwD,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,IAAM,iBAAiB,GAAG,UAAC,EAM1B;QALC,QAAQ,cAAA,EACR,MAAM,YAAA;IAKN,IAAM,YAAY,yBAAQ,uBAAuB,GAAK,MAAM,CAAE,CAAC;IAC/D,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC3C,QAAQ,GACiB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { PayModelStatus } from './types';
|
|
2
3
|
interface WorkspaceStatusContextValue {
|
|
3
4
|
isFullscreen: boolean;
|
|
4
5
|
startWorkspace: (id: string) => void;
|
|
@@ -7,7 +8,7 @@ interface WorkspaceStatusContextValue {
|
|
|
7
8
|
statusError?: boolean;
|
|
8
9
|
workspaceLaunchIsLoading: boolean;
|
|
9
10
|
terminateIsLoading: boolean;
|
|
10
|
-
|
|
11
|
+
payModelStatus: PayModelStatus;
|
|
11
12
|
}
|
|
12
13
|
export declare const useWorkspaceStatusContext: () => WorkspaceStatusContextValue;
|
|
13
14
|
declare const WorkspaceStatusProvider: ({ children }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceStatusProvider.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspaceStatusProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,
|
|
1
|
+
{"version":3,"file":"WorkspaceStatusProvider.d.ts","sourceRoot":"","sources":["../../../../src/features/Workspace/WorkspaceStatusProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAEZ,SAAS,EAIV,MAAM,OAAO,CAAC;AAmBf,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAwBzC,UAAU,2BAA2B;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wBAAwB,EAAE,OAAO,CAAC;IAClC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;CAChC;AAWD,eAAO,MAAM,yBAAyB,mCAQrC,CAAC;AAEF,QAAA,MAAM,uBAAuB,iBAAkB;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAmIrE,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React, {
|
|
3
|
-
import {
|
|
2
|
+
import React, { createContext, useEffect, useMemo, useState, } from 'react';
|
|
3
|
+
import { getCurrentTimestamp, isFetchBaseQueryError, RequestedWorkspaceStatus, selectActiveWorkspaceStatus, setActiveWorkspace, setActiveWorkspaceStatus, setRequestedWorkspaceStatus, useCoreDispatch, useCoreSelector, useGetWorkspacePayModelsQuery, useLaunchWorkspaceMutation, useTerminateWorkspaceMutation, WorkspaceStatus, } from '@gen3/core';
|
|
4
4
|
import { useDeepCompareEffect } from 'use-deep-compare';
|
|
5
5
|
import { notifications } from '@mantine/notifications';
|
|
6
6
|
import { useFullscreen } from '@mantine/hooks';
|
|
7
|
+
import { PayModelStatus } from './types';
|
|
8
|
+
import { useWorkspaceContext } from './WorkspaceProvider';
|
|
7
9
|
var getWorkspaceErrorMessage = function (error, defaultMessage) {
|
|
8
10
|
if (isFetchBaseQueryError(error)) {
|
|
9
11
|
return error.data;
|
|
10
12
|
}
|
|
11
13
|
return defaultMessage;
|
|
12
14
|
};
|
|
15
|
+
var showErrorNotification = function (title, message) {
|
|
16
|
+
// Clear any existing notifications first
|
|
17
|
+
notifications.clean(); // TODO debounce instead of clearing
|
|
18
|
+
notifications.show({
|
|
19
|
+
title: title,
|
|
20
|
+
message: message,
|
|
21
|
+
position: 'top-center',
|
|
22
|
+
});
|
|
23
|
+
};
|
|
13
24
|
var WorkspaceStatusContext = createContext({
|
|
14
25
|
isFullscreen: false,
|
|
15
26
|
startWorkspace: function () { return null; },
|
|
@@ -17,7 +28,7 @@ var WorkspaceStatusContext = createContext({
|
|
|
17
28
|
toggleFullscreen: function () { return null; },
|
|
18
29
|
workspaceLaunchIsLoading: false,
|
|
19
30
|
terminateIsLoading: false,
|
|
20
|
-
|
|
31
|
+
payModelStatus: PayModelStatus.INVALID,
|
|
21
32
|
});
|
|
22
33
|
export var useWorkspaceStatusContext = function () {
|
|
23
34
|
var context = React.useContext(WorkspaceStatusContext);
|
|
@@ -29,22 +40,41 @@ export var useWorkspaceStatusContext = function () {
|
|
|
29
40
|
var WorkspaceStatusProvider = function (_a) {
|
|
30
41
|
var children = _a.children;
|
|
31
42
|
var _b = useFullscreen(), switchScreenMode = _b.toggle, isFullscreen = _b.fullscreen;
|
|
32
|
-
var _c = useState(
|
|
43
|
+
var _c = useState(PayModelStatus.INVALID), payModelStatus = _c[0], setPayModelStatus = _c[1];
|
|
44
|
+
var requirePayModel = useWorkspaceContext().requirePayModel;
|
|
33
45
|
var _d = useLaunchWorkspaceMutation(), launchTrigger = _d[0], _e = _d[1], isWorkspaceLaunchError = _e.isError, workspaceLaunchError = _e.error;
|
|
34
46
|
var _f = useTerminateWorkspaceMutation(), terminateWorkspace = _f[0], _g = _f[1], terminateIsLoading = _g.isLoading, isTerminateError = _g.isError, workspaceTerminateError = _g.error;
|
|
35
47
|
var _h = useGetWorkspacePayModelsQuery(), payModels = _h.data, isPayModelLoading = _h.isLoading, isPayModelError = _h.isError;
|
|
36
|
-
|
|
37
|
-
if (isPayModelError) {
|
|
38
|
-
notifications.show({
|
|
39
|
-
title: 'Pay Model Error',
|
|
40
|
-
message: 'Unable to get Pay Model.',
|
|
41
|
-
});
|
|
42
|
-
}
|
|
48
|
+
useEffect(function () {
|
|
43
49
|
if (isPayModelLoading) {
|
|
44
|
-
|
|
50
|
+
setPayModelStatus(PayModelStatus.GETTING);
|
|
51
|
+
}
|
|
52
|
+
if (isPayModelError && requirePayModel) {
|
|
53
|
+
setPayModelStatus(PayModelStatus.ERROR);
|
|
54
|
+
showErrorNotification('Payment Error', 'Unable to get payment model');
|
|
45
55
|
}
|
|
56
|
+
else if (!requirePayModel)
|
|
57
|
+
setPayModelStatus(PayModelStatus.VALID);
|
|
58
|
+
}, [isPayModelLoading, isPayModelError, payModelStatus, requirePayModel]);
|
|
59
|
+
useEffect(function () {
|
|
60
|
+
var _a;
|
|
46
61
|
if (payModels) {
|
|
47
|
-
|
|
62
|
+
var isPayModelAboveLimit = ((_a = payModels.currentPayModel) === null || _a === void 0 ? void 0 : _a.request_status) === 'above limit';
|
|
63
|
+
if (isPayModelAboveLimit) {
|
|
64
|
+
setPayModelStatus(PayModelStatus.OVER_LIMIT);
|
|
65
|
+
showErrorNotification('Payment Error', 'Selected pay model usage has exceeded its available funding. Please choose another pay model.');
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (Object.keys(payModels).length === 0) {
|
|
69
|
+
setPayModelStatus(PayModelStatus.NOT_REQUIRED);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (Object.keys(payModels).length > 0) {
|
|
73
|
+
if (payModels.currentPayModel != null)
|
|
74
|
+
setPayModelStatus(PayModelStatus.VALID);
|
|
75
|
+
else
|
|
76
|
+
setPayModelStatus(PayModelStatus.NOT_SELECTED);
|
|
77
|
+
}
|
|
48
78
|
}
|
|
49
79
|
}, [payModels]);
|
|
50
80
|
var dispatch = useCoreDispatch();
|
|
@@ -52,33 +82,29 @@ var WorkspaceStatusProvider = function (_a) {
|
|
|
52
82
|
// handle errors in launching, getting status, or terminating
|
|
53
83
|
useDeepCompareEffect(function () {
|
|
54
84
|
if (isWorkspaceLaunchError || isTerminateError) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
? 'Error launching workspace'
|
|
61
|
-
: 'Error stopping workspace'),
|
|
62
|
-
position: 'top-center',
|
|
63
|
-
containerWidth: '50%',
|
|
64
|
-
});
|
|
65
|
-
dispatch(setRequestedWorkspaceStatus('NotSet'));
|
|
85
|
+
var errorMessage = getWorkspaceErrorMessage(isWorkspaceLaunchError ? workspaceLaunchError : workspaceTerminateError, isWorkspaceLaunchError
|
|
86
|
+
? 'Error launching workspace'
|
|
87
|
+
: 'Error stopping workspace');
|
|
88
|
+
showErrorNotification('Workspace Error', errorMessage);
|
|
89
|
+
dispatch(setRequestedWorkspaceStatus(RequestedWorkspaceStatus.Unset));
|
|
66
90
|
dispatch(setActiveWorkspaceStatus(WorkspaceStatus.NotFound));
|
|
67
91
|
}
|
|
68
92
|
}, [isWorkspaceLaunchError, isTerminateError]);
|
|
69
93
|
var status = useMemo(function () {
|
|
70
94
|
var startWorkspace = function (id) {
|
|
71
95
|
launchTrigger(id);
|
|
96
|
+
dispatch(setRequestedWorkspaceStatus(RequestedWorkspaceStatus.Launch));
|
|
72
97
|
dispatch(setActiveWorkspace({
|
|
73
98
|
id: id,
|
|
74
99
|
status: WorkspaceStatus.Launching,
|
|
75
|
-
requestedStatus:
|
|
100
|
+
requestedStatus: RequestedWorkspaceStatus.Launch,
|
|
101
|
+
requestedStatusTimestamp: getCurrentTimestamp(),
|
|
76
102
|
}));
|
|
77
103
|
};
|
|
78
104
|
var toggleFullscreen = function () { return switchScreenMode(); };
|
|
79
105
|
var stopWorkspace = function () {
|
|
80
106
|
terminateWorkspace();
|
|
81
|
-
dispatch(setRequestedWorkspaceStatus(
|
|
107
|
+
dispatch(setRequestedWorkspaceStatus(RequestedWorkspaceStatus.Terminate));
|
|
82
108
|
dispatch(setActiveWorkspaceStatus(WorkspaceStatus.Terminating));
|
|
83
109
|
};
|
|
84
110
|
return {
|
|
@@ -88,12 +114,15 @@ var WorkspaceStatusProvider = function (_a) {
|
|
|
88
114
|
toggleFullscreen: toggleFullscreen,
|
|
89
115
|
workspaceLaunchIsLoading: currentWorkspaceStatus === WorkspaceStatus.Launching,
|
|
90
116
|
terminateIsLoading: terminateIsLoading,
|
|
91
|
-
|
|
117
|
+
payModelStatus: payModelStatus,
|
|
92
118
|
};
|
|
93
119
|
}, [
|
|
120
|
+
currentWorkspaceStatus,
|
|
94
121
|
dispatch,
|
|
95
122
|
isFullscreen,
|
|
96
123
|
launchTrigger,
|
|
124
|
+
payModelStatus,
|
|
125
|
+
switchScreenMode,
|
|
97
126
|
terminateIsLoading,
|
|
98
127
|
terminateWorkspace,
|
|
99
128
|
]);
|