Skip to content

Commit

Permalink
Merge pull request #36 from gambtho/master
Browse files Browse the repository at this point in the history
Minor readme and mixpanel updates
  • Loading branch information
gambtho committed Apr 6, 2016
2 parents 11c22de + 45834e4 commit b73a002
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[![Stories in Ready](https://badge.waffle.io/krujos/willitconnect.png?label=ready&title=Ready)](https://waffle.io/krujos/willitconnect)

Will It Connect?
================
[![wercker status](https://app.wercker.com/status/95669acf2b99f3b76662dd01e0696d37/m "wercker status")](https://app.wercker.com/project/bykey/95669acf2b99f3b76662dd01e0696d37)
[![Stories in Ready](https://badge.waffle.io/krujos/willitconnect.png?label=ready&title=Ready)](https://waffle.io/krujos/willitconnect)

Sometimes, you just want to know if you can reach your thing (service really)
from Cloud Foundry. Is there a proxy in the way, is there an app security
Expand Down Expand Up @@ -151,6 +152,4 @@ You can run it locally by using
➜ ./gradlew bootRun
```

#TODO
* improve test coverage for UI

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"style-loader": "^0.13.0",
"url-loader": "^0.5.7",
"webpack": "^1.12.14",
"webpack-babel-jest": "^1.0.4"
"webpack-babel-jest": "^1.0.4",
"jasmine": "^2.4.1",
"jest": "^0.1.40"
},
"scripts": {
"test": "jest",
Expand All @@ -61,9 +63,5 @@
"bugs": {
"url": "https://github.com/krujos/willitconnect/issues"
},
"homepage": "https://github.com/krujos/willitconnect#readme",
"devDependencies": {
"jasmine": "^2.4.1",
"jest": "^0.1.40"
}
"homepage": "https://github.com/krujos/willitconnect#readme"
}
7 changes: 6 additions & 1 deletion src/main/resources/static/scripts/Entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ var Entry = React.createClass({
return JSON.stringify({"target": this.props.host+":"+this.props.port});
},
successFunc: function(data){
mixpanel.track("connection attempted", {"canConnect":data.canConnect});
mixpanel.track("connection attempted", { "canConnect": data.canConnect,
"httpStatus": data.httpStatus, "validHostName":data.validHostName,
"validUrl":data.validUrl});
this.setState({status: data});
},
componentWillMount: function () {
Expand All @@ -37,6 +39,9 @@ var Entry = React.createClass({

if(Object.keys(this.state.status).length) {
connectionStyle = this.state.status.canConnect ? {color: 'green'} : {color: 'red'};
if(this.state.status.statusCode) {
resultString += " statusCode - " + this.state.status.statusCode;
}
}

return (
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/static/scripts/EntryForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var EntryForm = React.createClass({
}

if(this.state.isChecked) {
mixpanel.track("connect attempted with proxy");
proxyHost = this.refs.proxyHost.getValue();
proxyPort = this.refs.proxyPort.getValue();
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/static/scripts/__test__/EntryFormTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ describe('EntryForm', () => {

var entryForm, renderedEntryForm;

var mixpanel = {
track: function () {}
};

beforeEach(function() {
window.mixpanel = mixpanel;
entryForm = TestUtils.renderIntoDocument(<EntryForm />);
renderedEntryForm = ReactDOM.findDOMNode(entryForm);

});

it("displays the form", function() {
Expand Down

0 comments on commit b73a002

Please sign in to comment.