Commit cd44a92b authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

enable scenario control buttons only when sandbox selected

parent 98b48166
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -70,7 +70,8 @@ import {
  IDC_DIALOG_SAVE_SCENARIO,
  IDC_DIALOG_SAVE_REPLAY,
  MOBILITY_EVENT,
  NETWORK_CHARACTERISTICS_EVENT
  NETWORK_CHARACTERISTICS_EVENT,
  EXEC_SELECT_SANDBOX
} from '../../meep-constants';

class ExecPageContainer extends Component {
@@ -406,12 +407,12 @@ class ExecPageContainer extends Component {
                        this.props.setSandbox(e.target.value);
                      }}
                      value={sandbox}
                      // data-cy={MON_DASHBOARD_SELECT}
                      data-cy={EXEC_SELECT_SANDBOX}
                    />
                  </GridCell>
                  <GridCell align={'middle'} span={2}>
                    <ExecPageSandboxButtons
                      sandbox={this.props.sandbox}
                      sandbox={sandbox}
                      onNewSandbox={() => this.onNewSandbox()}
                      onDeleteSandbox={() => this.onDeleteSandbox()}
                    />
@@ -430,6 +431,7 @@ class ExecPageContainer extends Component {
                    <GridInner align={'right'}>
                      <GridCell align={'middle'} span={12}>
                        <ExecPageScenarioButtons
                          sandbox={sandbox}
                          onDeploy={() => this.onDeployScenario()}
                          onSaveScenario={() => this.onSaveScenario()}
                          onTerminate={() => this.onTerminateScenario()}
+5 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ class ExecPageScenarioButtons extends Component {

  canDeploy() {
    return (
      this.props.sandbox &&
      this.props.podsTerminated &&
      this.props.scenarioState.scenario !== EXEC_STATE_DEPLOYED
    );
@@ -50,6 +51,7 @@ class ExecPageScenarioButtons extends Component {

  canTerminate() {
    return (
      this.props.sandbox &&
      !this.props.podsTerminating &&
      this.props.scenarioState.scenario === EXEC_STATE_DEPLOYED &&
      this.props.okToTerminate
@@ -58,6 +60,7 @@ class ExecPageScenarioButtons extends Component {

  canSaveScenario() {
    return (
      this.props.sandbox &&
      !this.props.podsPending &&
      !this.props.podsTerminating &&
      !this.props.podsTerminated
@@ -66,6 +69,7 @@ class ExecPageScenarioButtons extends Component {

  canOpenDashCfg() {
    return (
      this.props.sandbox &&
      !this.props.podsPending &&
      !this.props.podsTerminating &&
      !this.props.podsTerminated
@@ -74,6 +78,7 @@ class ExecPageScenarioButtons extends Component {

  canOpenEventCfg() {
    return (
      this.props.sandbox &&
      !this.props.podsPending &&
      !this.props.podsTerminating &&
      !this.props.podsTerminated
+2 −0
Original line number Diff line number Diff line
@@ -132,6 +132,8 @@ export const EXEC_STATE_IDLE = 'IDLE';
export const EXEC_STATE_DEPLOYED = 'DEPLOYED';

// Execution page IDs
export const EXEC_SELECT_SANDBOX = 'exec-select-sandbox';

export const EXEC_BTN_NEW_SANDBOX = 'exec-btn-new-sandbox';
export const EXEC_BTN_DELETE_SANDBOX = 'exec-btn-delete-sandbox';
export const EXEC_BTN_DEPLOY = 'exec-btn-deploy';