Skip to content

Commit

Permalink
adds displayRequestComponent toggle for try it
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome committed Oct 14, 2019
1 parent 207d263 commit 058abe0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/app/views/query-runner/QueryRunner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators, Dispatch } from 'redux';

import { Mode } from '../../../types/action';
import {
IQueryRunnerProps,
IQueryRunnerState,
Expand Down Expand Up @@ -95,6 +96,8 @@ export class QueryRunner extends Component<
};

public render() {
const { graphExplorerMode } = this.props;
const displayRequestComponent = (graphExplorerMode === Mode.Complete);

return (
<div>
Expand All @@ -109,11 +112,13 @@ export class QueryRunner extends Component<
/>
</div>
</div>
<div className='row'>
<div className='col-sm-12 col-lg-12'>
<Request handleOnEditorChange={this.handleOnEditorChange} />
{displayRequestComponent && (
<div className='row'>
<div className='col-sm-12 col-lg-12'>
<Request handleOnEditorChange={this.handleOnEditorChange} />
</div>
</div>
</div>
)}
</div>
);
}
Expand All @@ -130,6 +135,7 @@ function mapDispatchToProps(dispatch: Dispatch): object {

function mapStateToProps(state: any) {
return {
graphExplorerMode: state.graphExplorerMode,
headers: state.headersAdded,
sampleQuery: state.sampleQuery,
};
Expand Down
1 change: 1 addition & 0 deletions src/types/query-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface IQueryRunnerProps {
headers: Array<{ name: string; value: string }>;
onSelectVerb: Function;
sampleQuery: IQuery;
graphExplorerMode: Mode;
actions?: {
runQuery: Function;
addRequestHeader: Function;
Expand Down

0 comments on commit 058abe0

Please sign in to comment.