project
- {this.renderPopover("Image Project","The project for which the image is used.")}
+ {this.renderPopover("Image Project","The project for which the image is used. Default: Use the Skaha project to access the default CANFAR image list.")}
- name
+ session name
{this.renderPopover("Session Name","Name for the session. Alphanumeric and '-' characters only.")}
@@ -244,7 +255,7 @@ class SciencePortalForm extends React.Component {
# cores
- {this.renderPopover("# of Cores", "Number of cores used by the session. Default: 2")}
+ {this.renderPopover("# of Cores", "Number of cores used by the session.")}
@@ -265,7 +276,7 @@ class SciencePortalForm extends React.Component {
{/* placeholder column so buttons line up with form entry elements */}
+ project
+ {this.renderPopover("Image Project","The project for which the image is used.")}
+
+
+ {this.renderPlaceholder()}
+
container image
- {this.renderPopover("Container Image","Reference to an image to use to start the session container")}
+ {this.renderPopover("Container Image","Reference to an image to use to start the session container. Default: use skaha project access the default CANFAR image list.")}
{this.renderPlaceholder()}
- name
+ session name
{this.renderPopover("Session Name","Name for the session. Default name reflects the current number of sessions of the selected type.\n" +
"Alphanumeric characters only. 15 character maximum.")}
@@ -302,7 +321,7 @@ class SciencePortalForm extends React.Component {
memory
- {this.renderPopover("Memory","System memory (RAM) to be used for the session. Default: 16G")}
+ {this.renderPopover("Memory","System memory (RAM) to be used for the session.")}
{this.renderPlaceholder()}
@@ -310,7 +329,7 @@ class SciencePortalForm extends React.Component {
# cores
- {this.renderPopover("# of Cores","Number of cores used by the session. Default: 2")}
+ {this.renderPopover("# of Cores","Number of cores used by the session.")}
{this.renderPlaceholder()}
diff --git a/src/react/SciencePortalPrivateForm.js b/src/react/SciencePortalPrivateForm.js
index 019dffb..6ffac05 100644
--- a/src/react/SciencePortalPrivateForm.js
+++ b/src/react/SciencePortalPrivateForm.js
@@ -12,16 +12,19 @@ import Popover from 'react-bootstrap/Popover';
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faQuestionCircle} from "@fortawesome/free-solid-svg-icons";
+// Constants
+import {DEFAULT_CORES_NUMBER, DEFAULT_RAM_NUMBER} from "./utilities/constants";
+
class SciencePortalPrivateForm extends React.Component {
constructor(props) {
super(props)
- this.selectedRAM = ""
- this.selectedCores = ""
+ this.selectedRAM = DEFAULT_RAM_NUMBER
+ this.selectedCores = DEFAULT_CORES_NUMBER
this.repositoryUsername = props.authenticatedUsername && props.authenticatedUsername !== "Login" ? props.authenticatedUsername : ""
if (typeof props.fData.contextData !== "undefined") {
- this.selectedRAM = props.fData.contextData.defaultRAM
- this.selectedCores = props.fData.contextData.defaultCores
+ this.selectedRAM = Math.max(props.fData.contextData.defaultRAM, DEFAULT_RAM_NUMBER)
+ this.selectedCores = Math.max(props.fData.contextData.defaultCores, DEFAULT_CORES_NUMBER)
}
const repositoryHostArray = props.fData.repositoryHosts
@@ -84,8 +87,8 @@ class SciencePortalPrivateForm extends React.Component {
const formProps = this.props;
this.setState({
- selectedCores : this.state.fData.contextData.defaultCores,
- selectedRAM : this.state.fData.contextData.defaultRAM,
+ selectedCores : Math.max(this.props.fData.contextData.defaultCores, DEFAULT_CORES_NUMBER),
+ selectedRAM : Math.max(this.props.fData.contextData.defaultRAM, DEFAULT_RAM_NUMBER),
repositoryUsername: formProps.authenticatedUsername && formProps.authenticatedUsername !== "Login"
? formProps.authenticatedUsername : ""
});
@@ -185,7 +188,7 @@ class SciencePortalPrivateForm extends React.Component {