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

simplified event container

parent c00caad7
Loading
Loading
Loading
Loading
+62 −93
Original line number Diff line number Diff line
@@ -37,47 +37,40 @@ const styles = {
  }
};

const ConfigurationView = props => {
  return (
    <>
      <Grid style={{ marginBottom: 10 }}>
        <GridCell span={6}>
          <Button
            outlined
            style={styles.button}
            onClick={props.onCreateEvent}
            data-cy={EXEC_BTN_MANUAL_REPLAY}
          >
            MANUAL
          </Button>
          <Button
            outlined
            style={styles.button}
            onClick={props.onReplayEvent}
            data-cy={EXEC_BTN_AUTO_REPLAY}
          >
            AUTO-REPLAY
          </Button>
          <Button
            outlined
            style={styles.button}
            onClick={props.onSaveReplay}
            data-cy={EXEC_BTN_SAVE_REPLAY}
          >
            SAVE EVENTS AS ...
          </Button>
        </GridCell>
      </Grid>
    </>
  );
class EventContainer extends Component {
  constructor(props) {
    super(props);
    this.state = {
      sourceNodeId: ''
    };
  }

  componentDidMount() { }

const EventConfiguration = props => {
  if (!props.eventCfgMode) {
  componentWillUnmount() {
    clearInterval(this.dataTimer);
  }

  // CREATE EVENT PANE
  onCreateEvent() {
    this.props.changeEventCreationMode(true);
    this.props.changeEventReplayMode(false);
  }

  // SHOW REPLAY EVENT PANE
  onReplayEvent() {
    this.props.changeEventReplayMode(true);
    this.props.changeEventCreationMode(false);
  }

  render() {

    if (!this.props.eventCfgMode) {
      return null;
    }

    return (
      <>
        <Elevation
          z={2}
          className="component-style"
@@ -96,7 +89,7 @@ const EventConfiguration = props => {
                <Button
                  outlined
                  style={styles.button}
              onClick={() => props.onCloseEventCfg()}
                  onClick={this.props.onCloseEventCfg}
                >
                  Close
                </Button>
@@ -104,62 +97,38 @@ const EventConfiguration = props => {
            </GridCell>
          </Grid>

      <ConfigurationView
        onCreateEvent={props.onCreateEvent}
        onReplayEvent={props.onReplayEvent}
        onSaveReplay={props.onSaveReplay}
      />
          <Grid style={{ marginBottom: 10 }}>
            <GridCell span={6}>
              <Button
                outlined
                style={styles.button}
                onClick={() => this.onCreateEvent()}
                data-cy={EXEC_BTN_MANUAL_REPLAY}
              >
                MANUAL
              </Button>
              <Button
                outlined
                style={styles.button}
                onClick={() => this.onReplayEvent()}
                data-cy={EXEC_BTN_AUTO_REPLAY}
              >
                AUTO-REPLAY
              </Button>
              <Button
                outlined
                style={styles.button}
                onClick={this.props.onSaveReplay}
                data-cy={EXEC_BTN_SAVE_REPLAY}
              >
                SAVE EVENTS AS ...
              </Button>
            </GridCell>
          </Grid>

      <div>{props.replayStatus ? props.replayStatus.status : 'NONE'}</div>
          <div>{this.props.replayStatus ? this.props.replayStatus.status : 'NONE'}</div>
          
        </Elevation>
  );
};

class EventContainer extends Component {
  constructor(props) {
    super(props);
    this.state = {
      sourceNodeId: ''
    };
  }

  componentDidMount() { }

  componentWillUnmount() {
    clearInterval(this.dataTimer);
  }

  changeReplayLoop(checked) {
    this.props.onReplayLoopChanged(checked);
  }

  // CREATE EVENT PANE
  onCreateEvent() {
    this.props.changeEventCreationMode(true);
    this.props.changeEventReplayMode(false);
  }

  // SHOW REPLAY EVENT PANE
  onReplayEvent() {
    this.props.changeEventReplayMode(true);
    this.props.changeEventCreationMode(false);
  }

  render() {

    return (
      <>
        <EventConfiguration
          eventCfgMode={this.props.eventCfgMode}
          onCloseEventCfg={this.props.onCloseEventCfg}
          onCreateEvent={() => this.onCreateEvent()}
          onReplayEvent={() => this.onReplayEvent()}
          onSaveReplay={this.props.onSaveReplay}
          changeReplayLoop={checked => this.changeReplayLoop(checked)}
          replayLoop={this.props.replayLoop}
          replayStatus={this.props.replayStatus}
        />
      </>
    );
  }
+0 −1
Original line number Diff line number Diff line
@@ -200,7 +200,6 @@ class EventReplayPane extends Component {
        </Grid>
        <div>{this.props.replayStatus ? this.props.replayStatus.status : 'NONE'}</div>
      </div>

    );
  }
}