Skip to content

Commit 9658593

Browse files
authored
Merge pull request #99 from Gossamer-React/neyser-previous-log
Neyser previous log
2 parents 9609025 + 8e46d9a commit 9658593

File tree

10 files changed

+27
-94
lines changed

10 files changed

+27
-94
lines changed

build/webpack-bundle.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/webpack-bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/graphql.css

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#graphql-container {
22
width: 75%;
3-
background-color: rgba(214, 214, 214, 0.4);
4-
border: 1px solid rgba(0, 0, 0, 0.3);
5-
border-radius: 5px;
63
margin-left: 20px;
74
min-height: 600px;
85
}
@@ -13,37 +10,25 @@
1310
margin: 0px;
1411
}
1512

16-
#req-res{
17-
display: flex;
18-
}
19-
2013
#graphql-hr {
2114
margin: 10px 0px;
2215
}
2316

24-
#graphql {
25-
border-right: 1px solid black;
26-
width: 50%;
27-
padding: 10px;
28-
}
29-
3017
#graphql-res {
31-
width: 50%;
18+
background-color: rgba(214, 214, 214, 0.4);
19+
border: 1px solid rgba(0, 0, 0, 0.3);
20+
border-radius: 5px;
3221
padding: 10px;
22+
margin-bottom: 10px;
3323
}
3424

3525
#graphql-schema {
3626
overflow-y: scroll;
3727
max-height: 90%;
3828
padding: 10px;
39-
}
40-
41-
.graphql {
42-
padding: 5px;
43-
}
44-
45-
.graphql:not(:last-child) {
46-
border-bottom: 1px solid grey;
29+
background-color: rgba(214, 214, 214, 0.4);
30+
border: 1px solid rgba(0, 0, 0, 0.3);
31+
border-radius: 5px;
4732
}
4833

4934
.graphql-p {

public/log-container.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
border: 1px solid rgba(0, 0, 0, 0.3);
66
border-radius: 5px;
77
max-height: 600px;
8-
height: 600px;
8+
height: 650px;
99
}
1010

1111
#log-header{
@@ -23,6 +23,7 @@
2323
padding: 15px;
2424
background:rgba(255,255,255,0.5);
2525
margin: 8px 0px;
26+
cursor: pointer;
2627
}
2728

2829
.log-p{

src/components/GraphQLRequest.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/components/GraphQLResponse.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const GraphQLResponse = ({ logs, log }) => {
1717
name={null}
1818
iconStyle='triangle'
1919
indentWidth={1}
20+
collapsed={3}
2021
enableClipboard={false}
2122
displayDataTypes={false}
2223
displayObjectSize={false}

src/components/Log/Log.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import { GraphqlCodeBlock } from 'graphql-syntax-highlighter-react';
44

55
const Log = props => {
66
return (
7-
<div className='log'>
8-
<button onClick={() => {props.logChange(props.logId)}}>view</button>
7+
<div className='log' onClick={() => { props.logChange(props.logId) }}>
98
<p className='log-p'>
109
<b>Request:</b> {props.logId}
1110
</p>

src/containers/GraphQLContainer.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ const GraphQLContainer = ({ logs, schema, log }) => {
99
<div id='graphql-container'>
1010
{logs.length !== 0 ? (
1111
<div>
12-
<div id='req-res'>
13-
<GraphQLRequest logs={logs} log ={log}/>
14-
<GraphQLResponse logs={logs} log ={log}/>
15-
</div>
16-
<hr />
12+
<GraphQLResponse logs={logs} log={log} />
1713
<GraphQLSchema schema={schema} />
1814
</div>
1915
) : (
20-
<h1>No requests have been made yet.</h1>
21-
)}
16+
<h1>No requests have been made yet.</h1>
17+
)}
2218
</div>
2319
);
2420
};

src/containers/StateContainer.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const StateContainer = ({ stateDiffs, clearLog }) => {
1616
Clear All
1717
</button>
1818
</div>
19+
<hr />
1920
{stateDiffs.map((el, i) => {
2021
return (
2122
<div className='stateDiff-div'>
@@ -28,7 +29,7 @@ const StateContainer = ({ stateDiffs, clearLog }) => {
2829
indentWidth={1}
2930
groupArraysAfterLength={20}
3031
enableClipboard={false}
31-
collapsed={2}
32+
collapsed={1}
3233
displayDataTypes={false}
3334
displayObjectSize={false}
3435
/>

src/devtools.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class App extends Component {
2828

2929
this.handleMouseOver = this.handleMouseOver.bind(this);
3030

31-
chrome.devtools.panels.create("Lucid", null, "devtools.html");
31+
chrome.devtools.panels.create('Lucid', null, 'devtools.html');
3232
}
3333

3434
componentDidMount() {
@@ -76,8 +76,8 @@ class App extends Component {
7676

7777
if (httpReq.response.content) {
7878
httpReq.getContent(responseBody => {
79-
if (responseBody === "") {
80-
log.res = "No response received";
79+
if (responseBody === '') {
80+
log.res = 'No response received';
8181
} else {
8282
const parsedResponseBody = JSON.parse(responseBody);
8383
log.res = parsedResponseBody;
@@ -111,13 +111,11 @@ class App extends Component {
111111

112112
//* invoke schema fetch only after a log object from a previous response is available
113113
componentDidUpdate(prevProps, prevState) {
114-
console.log('LENGTH: ', this.state.appFilteredDOM.length)
115-
if (this.state.schema === "GraphQL schema not available.") {
114+
if (this.state.schema === 'GraphQL schema not available.') {
116115
this.fetchSchemaFromGraphQLServer();
117116
}
118117

119118
if (prevState.appState !== this.state.appState) {
120-
console.log(this.state.componentsToFilter);
121119
if (this.state.componentsToFilter.length) {
122120
let result = [];
123121
filter(this.state.appState, this.state.componentsToFilter, result);
@@ -186,7 +184,9 @@ class App extends Component {
186184
// * handles the change of a log
187185
handleLogChange(reqId) {
188186
let req = this.state.logs[reqId];
189-
this.setState({ logView: req })
187+
req.id = reqId;
188+
console.log('HandleChange: ', req)
189+
this.setState({ logView: req });
190190
}
191191

192192
render() {
@@ -195,6 +195,7 @@ class App extends Component {
195195
<div>
196196
{this.state.appState.length === 0 ?
197197
<div id='devToolsLoader'>
198+
<img src='./logo.png' alt='devtool logo'/>
198199
<h1>Please trigger a setState() to activate Lucid devtool.<br /></h1>
199200
<p>Lucid works best on React v15/16</p>
200201
</div>

0 commit comments

Comments
 (0)