Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrating from angular to react/flux
- Loading branch information
1 parent
6bebad9
commit 2d649e1
Showing
43 changed files
with
915 additions
and
1,341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import AppDispatcher from '../dispatchers/AppDispatcher'; | ||
import configConstants from '../constants/config-constants'; | ||
|
||
export default { | ||
toggleConnect: function() { | ||
AppDispatcher.dispatch({ | ||
action: configConstants.TOGGLE_CONNECT | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import AppDispatcher from '../dispatchers/AppDispatcher'; | ||
import requestConstants from '../constants/request-constants'; | ||
|
||
export default { | ||
selectRequest: function(request) { | ||
AppDispatcher.dispatch({ | ||
action: requestConstants.SELECT_REQUEST, | ||
request: request | ||
}); | ||
}, | ||
|
||
setFilter: function(expression) { | ||
AppDispatcher.dispatch({ | ||
action: requestConstants.SET_FILTER, | ||
expression | ||
}); | ||
}, | ||
|
||
clear: function() { | ||
AppDispatcher.dispatch({ | ||
action: requestConstants.CLEAR | ||
}); | ||
}, | ||
|
||
togglePause: function() { | ||
AppDispatcher.dispatch({ | ||
action: requestConstants.TOGGLE_PAUSE | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
import 'babel/polyfill'; | ||
import './lib/angular'; | ||
import './services'; | ||
import './filters'; | ||
import './directives'; | ||
import './controllers'; | ||
import React from 'react'; | ||
import domready from "domready"; | ||
import PhoenixMatrixApp from './components/PhoenixMatrixApp'; | ||
import requestStore from './stores/request-store'; | ||
|
||
requestStore.init(); | ||
|
||
domready(function () { | ||
React.render( | ||
<PhoenixMatrixApp />, | ||
document.body | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
|
||
export default React.createClass({ | ||
render: function() { | ||
return ( | ||
<div className="footer-section"></div> | ||
); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import _ from 'lodash'; | ||
|
||
import React from 'react'; | ||
import requestActions from '../actions/request-actions'; | ||
|
||
export default React.createClass({ | ||
setFilter: function(expression) { | ||
requestActions.setFilter(expression.trim()); | ||
}, | ||
|
||
onChange: function(e) { | ||
this.setFilter(e.target.value); | ||
}, | ||
|
||
componentWillMount: function() { | ||
this.setFilter = _.debounce(this.setFilter, 500); | ||
}, | ||
|
||
render: function() { | ||
return ( | ||
<div className="header-section navbar navbar-inverse navbar-fixed-top"> | ||
<span className="navbar-brand">PhoenixMatrix web debugging proxy v0.1 Preview</span> | ||
<form className="navbar-form navbar-right"> | ||
<input ref="searchInput" type="text" className="form-control" placeholder="Search..." onChange={this.onChange} /> | ||
</form> | ||
</div> | ||
); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import _ from 'lodash'; | ||
|
||
const PureRenderMixin = React.addons.PureRenderMixin; | ||
|
||
export default React.createClass({ | ||
mixins: [PureRenderMixin], | ||
getInitialState: function() { | ||
return { showTable: true }; | ||
}, | ||
|
||
toggle: function() { | ||
this.setState({showTable: !this.state.showTable}); | ||
}, | ||
|
||
render: function() { | ||
const headers = this.props.headers; | ||
|
||
let content = null; | ||
let headerTable; | ||
|
||
if(headers && Object.keys(headers).length) { | ||
if(this.state.showTable) { | ||
headerTable = | ||
<table className="table table-hover" ng-if="!collapseRequestHeaders"> | ||
<tbody> | ||
{ | ||
_.map(headers, function(value, key) { | ||
return <tr key={key}> | ||
<td>{key}</td> | ||
<td>{value}</td> | ||
</tr>; | ||
}) | ||
} | ||
</tbody> | ||
</table> | ||
} | ||
|
||
content = <div className="panel panel-primary headers-list"> | ||
<div className="panel-heading" onClick={this.toggle}> | ||
Headers | ||
</div> | ||
{headerTable} | ||
</div>; | ||
} | ||
|
||
return content; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
|
||
import VerticalButtonBar from './VerticalButtonBar'; | ||
import RequestList from './RequestList'; | ||
|
||
const PureRenderMixin = React.addons.PureRenderMixin; | ||
|
||
export default React.createClass({ | ||
mixins: [PureRenderMixin], | ||
render: function() { | ||
return ( | ||
<div className="left-section"> | ||
<VerticalButtonBar paused={this.props.paused} config={this.props.config} /> | ||
<RequestList | ||
requests={this.props.requests} | ||
selectedRequest={this.props.selectedRequest} | ||
/> | ||
</div> | ||
); | ||
} | ||
}); |
Oops, something went wrong.