Skip to content

Commit f20beff

Browse files
authored
Merge pull request #60 from oslabs-beta/cleanCode
removed logs
2 parents 436f55a + 75c9c52 commit f20beff

File tree

16 files changed

+25
-83
lines changed

16 files changed

+25
-83
lines changed

__tests__/businessReducer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ describe('Business reducer', () => {
3434
queryArr: null,
3535
protoPath: null,
3636
services: null,
37+
protoContent: ''
3738
},
3839
newRequestCookies: {
3940
cookiesArr: [],

__tests__/protoParserTests.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import protoParser from '../src/client/components/composer/protos/protoParser';
1+
import protoParser from '../src/client/protoParser';
22

33

44
describe('testing protoParser', ()=> {
@@ -37,7 +37,6 @@ describe('testing protoParser', ()=> {
3737
it('should get packageName', () => {
3838
const parsedProto = protoParser(protoFile)
3939
.then(data => {
40-
// console.log(d)
4140
expect(data.packageName).toEqual('helloworld')
4241
})
4342

@@ -52,7 +51,6 @@ describe('testing protoParser', ()=> {
5251
}]
5352
const parsedProto = protoParser(protoFile)
5453
.then(data => {
55-
// console.log(d)
5654
expect(data.serviceArr[0].messages).toHaveLength(4);
5755
expect(data.serviceArr[0].rpcs).toHaveLength(4);
5856
expect(data.serviceArr[0].name).toEqual('Greeter');

grpc_mockData/server.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ function sayHello(ctx) {
3535
metadata.set('indeed', 'it do')
3636
// Watcher creates a watch execution context for the watch
3737
// The execution context provides scripts and templates with access to the watch metadata
38-
console.log("received metadata from client request", ctx.metadata)
39-
console.dir(ctx.metadata, { depth: 3, colors: true });
40-
console.log(`got sayHello request name: ${ctx.req.name}`);
38+
// console.log("received metadata from client request", ctx.metadata)
39+
// console.dir(ctx.metadata, { depth: 3, colors: true });
40+
// console.log(`got sayHello request name: ${ctx.req.name}`);
4141

4242
// an alias to ctx.response.res
4343
// This is set only in case of DUPLEX calls, to the the gRPC call reference itself
@@ -47,7 +47,7 @@ function sayHello(ctx) {
4747
metadata.set('UNARY', 'yes')
4848
ctx.sendMetadata(metadata)
4949

50-
console.log(`set sayHello response: ${ctx.res.message}`);
50+
// console.log(`set sayHello response: ${ctx.res.message}`);
5151
}
5252
// nested Unary stream
5353

@@ -58,14 +58,14 @@ function sayHelloNested(ctx) {
5858
metadata.set('indeed', 'it do')
5959
// Watcher creates a watch execution context for the watch
6060
// The execution context provides scripts and templates with access to the watch metadata
61-
console.log("received metadata from client request", ctx.metadata)
62-
console.dir(ctx.metadata, { depth: 3, colors: true });
61+
// console.log("received metadata from client request", ctx.metadata)
62+
// console.dir(ctx.metadata, { depth: 3, colors: true });
6363
// console.log("ctx line 64 from server.js", ctx)
6464

6565
// nested unary response call
6666
let firstPerson = ctx.req.firstPerson.name;
6767
let secondPerson = ctx.req.secondPerson.name;
68-
console.log("firstPerson line 68 from server.js:", firstPerson)
68+
// console.log("firstPerson line 68 from server.js:", firstPerson)
6969
ctx.res = {"serverMessage": [{message: "Hello! " + firstPerson}, {message: 'Hello! ' + secondPerson}]}
7070

7171
// send response header metadata object directly as an argument and that is set and sent
@@ -79,9 +79,9 @@ async function sayHellos(ctx) {
7979
metadata.set('it', 'works?')
8080
metadata.set('indeed', 'it do')
8181
// The execution context provides scripts and templates with access to the watch metadata
82-
console.dir(ctx.metadata, { depth: 3, colors: true });
82+
// console.dir(ctx.metadata, { depth: 3, colors: true });
8383
// converts a request into strings
84-
console.log(`got sayHellos request name:`, JSON.stringify(ctx.req, null, 4));
84+
// console.log(`got sayHellos request name:`, JSON.stringify(ctx.req, null, 4));
8585

8686
// alias for ctx.request.req
8787
// In case of UNARY and RESPONSE_STREAM calls it is simply the gRPC call's request
@@ -98,7 +98,6 @@ async function sayHellos(ctx) {
9898
// send response header metadata object directly as an argument and that is set and sent
9999
ctx.sendMetadata(metadata)
100100

101-
console.log(`done sayHellos`);
102101
// ends server stream
103102
ctx.res.end()
104103
}
@@ -113,15 +112,15 @@ function sayHelloCs (ctx) {
113112
metadata.set('clientStream', 'indubitably')
114113
// The execution context provides scripts and templates with access to the watch metadata
115114
console.dir(ctx.metadata, { depth: 3, colors: true })
116-
console.log('got sayHelloClients')
115+
// console.log('got sayHelloClients')
117116
let counter = 0;
118117
let messages = [];
119118
// client streaming calls to write messages and end writing before you can get the response
120119
return new Promise((resolve, reject) => {
121120
hl(ctx.req)
122121
.map(message => {
123122
counter++
124-
console.log('message content',message.name)
123+
// console.log('message content',message.name)
125124
ctx.response.res = { message: 'Client stream: ' + message.name }
126125
messages.push(message.name)
127126
ctx.sendMetadata(metadata)
@@ -130,9 +129,9 @@ function sayHelloCs (ctx) {
130129
.collect()
131130
.toCallback((err, result) => {
132131
if (err) return reject(err)
133-
console.log(`done sayHelloClients counter ${counter}`)
132+
// console.log(`done sayHelloClients counter ${counter}`)
134133
ctx.response.res = { message: 'SAYHELLOCs Client stream: ' + messages }
135-
console.log(ctx.response.res)
134+
// console.log(ctx.response.res)
136135
resolve()
137136
})
138137
})
@@ -144,7 +143,7 @@ function sayHelloBidi(ctx) {
144143
let metadata = new grpc.Metadata();
145144
metadata.set('it', 'works?')
146145
metadata.set('indeed', 'it do')
147-
console.log("got sayHelloBidi");
146+
// console.log("got sayHelloBidi");
148147
// The execution context provides scripts and templates with access to the watch metadata
149148
console.dir(ctx.metadata, { depth: 3, colors: true });
150149
let counter = 0;
@@ -158,7 +157,7 @@ function sayHelloBidi(ctx) {
158157
ctx.sendMetadata(metadata);
159158
// calls end to client before closing server
160159
ctx.req.on("end", () => {
161-
console.log(`done sayHelloBidi counter ${counter}`);
160+
// console.log(`done sayHelloBidi counter ${counter}`);
162161
// ends server stream
163162
ctx.res.end();
164163
});

main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ function createWindow() {
169169
});
170170
}
171171
else {
172-
console.log('__dirname', __dirname);
173172
indexPath = url.format({// if we are not in dev mode load production build file
174173
protocol: 'file:',
175174
pathname: path.join(__dirname, 'dist', 'index.html'),
@@ -276,7 +275,7 @@ ipcMain.on('fatalError', () => {
276275
mainWindow.reload();
277276
});
278277
ipcMain.on('uncaughtException', () => {
279-
console.log('received uncaguht fatal error')
278+
console.log('received uncaught fatal error')
280279
});
281280

282281
app.on('activate', () => {

src/client/components/composer/NewRequest/FieldEntryForm.jsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ class FieldEntryForm extends Component {
1010
}
1111

1212
onChangeHandler(e, property, graphQL) {
13-
// console.log('graphQL from onchangehandler in field entry form', graphQL)
1413
let value = e.target.value;
15-
// if (!e.target.value) value = 'GRPC'
16-
// console.log('value from event in field entry form', value)
1714

1815
switch (property) {
1916
case 'url': {
@@ -25,15 +22,6 @@ class FieldEntryForm extends Component {
2522
break;
2623
}
2724
case 'protocol': {
28-
// let grabbedProtocol, afterProtocol;
29-
// if (!!this.props.newRequestFields.url) {
30-
// grabbedProtocol = this.props.newRequestFields.url.match(/(https?:\/\/)|(localhost:)|(wss?:\/\/)/) !== null
31-
// ? this.props.newRequestFields.url.match(/(https?:\/\/)|(localhost:)|(wss?:\/\/)/)[0]
32-
// : ""
33-
// afterProtocol = this.props.newRequestFields.url.substring(grabbedProtocol.length, this.props.newRequestFields.url.length)
34-
// }
35-
// else afterProtocol = ''
36-
// console.log('graphQL prop: ',graphQL)
3725
if (!!graphQL) { //if graphql
3826
this.props.setNewRequestFields({
3927
...this.props.newRequestFields,
@@ -112,7 +100,6 @@ class FieldEntryForm extends Component {
112100
break;
113101
}
114102
case 'method': {
115-
// console.log(value)
116103
const methodReplaceRegex = new RegExp(`${this.props.newRequestFields.method}`, 'mi')
117104
let newBody = "";
118105
if (!this.props.newRequestFields.graphQL && !this.props.newRequestFields.gRPC) { //if one of 5 http methods (get, post, put, patch, delete)
@@ -169,16 +156,8 @@ class FieldEntryForm extends Component {
169156
}
170157
};
171158

172-
// handleKeyPress(event) {
173-
// if (event.key === 'Enter') {
174-
// this.props.addRequestProp();
175-
// }
176-
// }
177159

178160
render() {
179-
// console.log('what is this field entry form', this.props.newRequestFields)
180-
181-
182161
return (
183162
<div>
184163
<ProtocolSelect

src/client/components/composer/NewRequest/HeaderEntryForm.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class HeaderEntryForm extends Component {
2929

3030
checkContentTypeHeaderUpdate() {
3131
let contentType;
32-
// console.log(this.props.newRequestBody.bodyType)
3332

3433
if (this.props.newRequestBody.bodyType === 'GRPC' || this.props.newRequestBody.bodyType === 'none' || this.props.newRequestBody.bodyType === 'raw') {
3534
contentType = ''
@@ -96,7 +95,6 @@ class HeaderEntryForm extends Component {
9695

9796
addHeader() {
9897
const headersDeepCopy = JSON.parse(JSON.stringify(this.props.newRequestHeaders.headersArr));
99-
// console.log(headersDeepCopy);
10098
headersDeepCopy.push({
10199
id: this.props.newRequestHeaders.headersArr.length,
102100
active: false,
@@ -118,7 +116,6 @@ class HeaderEntryForm extends Component {
118116
let indexToBeUpdated;
119117
for (let i = 0; i < headersDeepCopy.length; i += 1) {
120118
if (headersDeepCopy[i].id === id) {
121-
// console.log('updating this one: ', i)
122119
indexToBeUpdated = i;
123120

124121
}

src/client/components/containers/ReqResContainer.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class ReqResContainer extends Component {
2323
}
2424

2525
render() {
26-
console.log(this.props.reqResArray)
2726
const reqResArr = this.props.reqResArray
2827
.map((reqRes, index) => {
2928
return <SingleReqResContainer

src/client/components/display/ClearHistoryBtn.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const ClearHistoryBtn = (props) => (
1212

1313
dialog.showMessageBox(null, opts)
1414
.then((response) => {
15-
console.log('in messageDialog .then resp :' , response)
1615
if (response.response === 0) {
1716
props.clearHistory();
1817
}

src/client/components/display/CookieTableRow.jsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ class CookieTableRow extends Component {
1616
if (!this.props.cookie.expirationDate) {
1717
tableCellArray.push(<CookieTableCell detail={''} key='expirationDate'></CookieTableCell>)
1818
}
19-
// else {
20-
// tableCellArray.push(<CookieTableCell detail={this.props.cookie.expirationDate} key='expirationDate'></CookieTableCell>)
21-
// }
22-
// console.log('tableCellArray', tableCellArray);
2319
return (
2420
<div className='cookieTableRow grid-9'>
2521
{tableCellArray}

src/client/components/display/Graph.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ class Graph extends Component {
7373
}
7474

7575
componentDidUpdate() {
76-
console.log('req res array in graph',this.props.reqResArray);
7776

7877
let openRequestCount = 0;
7978
this.props.reqResArray.forEach((reqRes) => {

0 commit comments

Comments
 (0)