Skip to content

Commit

Permalink
clean up code, changing from valid but non-existing cc id to existing…
Browse files Browse the repository at this point in the history
… cc id working
  • Loading branch information
alexmnguyen committed Apr 20, 2016
1 parent 657c786 commit 21bac12
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 37 deletions.
5 changes: 0 additions & 5 deletions monitoring_ui/src/actions/ChaincodeActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ export function sendObcRequest(args, fn, requestType){

return function(dispatch, getState){
let state = getState();

console.log(args);
//iterate through the args and delete any empty strings

for(var propertyName in args){
Expand Down Expand Up @@ -239,12 +237,9 @@ export function sendObcRequest(args, fn, requestType){
body: JSON.stringify(requestPayload)
}

console.log(config)

return fetch(state.configuration.urlRestRoot + '/devops/'+requestType.toLowerCase()+'/', config)
.then(response => response.json())
.then(json => {
console.log(json);

//TODO: Display error message and then do nothing
if(json.Error){
Expand Down
1 change: 0 additions & 1 deletion monitoring_ui/src/actions/ConfigurationActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export function setConfiguration(obcConfigObj){

//clear the existing interval timer
let intervalId = state.configuration.chainHeightPollingIntervalId
console.log('Interval to clear: ' + intervalId)
clearInterval(intervalId);

//create a new interval and set it in the state
Expand Down
3 changes: 0 additions & 3 deletions monitoring_ui/src/containers/ConfigurationDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import { actions, getField } from 'react-redux-form';

class ConfigurationDialog extends React.Component {
render() {
console.log(this.props);
return (
<div>
<FlatButton label={strings.OBC_CONFIG_DIALOG_TITLE} onTouchTap={this.props.openDialog} style={{color:"#ffffff", marginTop: 8}}/>
Expand Down Expand Up @@ -66,8 +65,6 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
const {showDialog, validChaincodeID, obcConfigurationForm} = stateProps;
const {dispatch} = dispatchProps;

console.log(stateProps)

return{
...stateProps,
closeDialog: () => {
Expand Down
4 changes: 1 addition & 3 deletions monitoring_ui/src/containers/ResponsePayloadContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class ResponsePayloadContainer extends React.Component{
//objToJsx should be an empty array
readObjProps = (obj, objToJsx, indents) => {

console.log(Object.prototype.toString.call(obj))

//If the object itself is a primitive and not an array, we just return that as a string.
//for example {"OK":100}
if(obj && Object.prototype.toString.call(obj) !== '[object Object]'){
Expand All @@ -63,7 +61,7 @@ class ResponsePayloadContainer extends React.Component{
}
}

for(var propertyName in obj){
for(var propertyName in obj){

if (obj.hasOwnProperty(propertyName)) {

Expand Down
15 changes: 0 additions & 15 deletions monitoring_ui/src/containers/forms/ChaincodeOpsForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,7 @@ import MenuItem from 'material-ui/lib/menus/menu-item';

class ChaincodeOpsForm extends React.Component {

handleSubmit(chaincodeOpsForm) {
let { dispatch } = this.props;

console.log(chaincodeOpsForm);

//set the properties specific to obc in our configuration store
//dispatch(setConfiguration(obcConfiguration))

//close the dialog
//dispatch(setConfigDialogDisplay(false))
}

handleChange(e,i,v) {
console.log(i);

//dispatch an action to change the form model specifically for the form under a particular tab.
this.props.dispatch(actions.change('chaincodeOpsForm.'+this.props.tab+'.selectedFn',i));
Expand All @@ -50,8 +37,6 @@ class ChaincodeOpsForm extends React.Component {
render() {
let { chaincodeOpsForm, tab } = this.props;

//console.log(chaincodeOpsForm);

return (
<Form model="chaincodeOpsForm" noValidate
onSubmit={(chaincodeOpsForm) => this.handleSubmit(chaincodeOpsForm)}>
Expand Down
3 changes: 1 addition & 2 deletions monitoring_ui/src/containers/forms/JsonSchemaForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class JsonSchemaForm extends React.Component {
}

handleChange = (data) => {
console.log(data)
//dispatch an action to change the form model specifically for the form under a particular tab.
this.props.dispatch(actions.change('chaincodeOpsForm.'+this.props.currentTab+'.fns['+this.props.fnIndex+'].args',data.formData));
}
Expand Down Expand Up @@ -113,7 +112,7 @@ function mapStateToProps(state) {
if(state.chaincodeOpsForm[currentTab]){
fnIndex = state.chaincodeOpsForm[currentTab].selectedFn;
fnName = state.chaincodeOpsForm[currentTab].fns[fnIndex].name;
selectedJsonSchema = state.chaincode.schema.API[fnName].properties.args.items;
selectedJsonSchema = state.chaincode.schema ? state.chaincode.schema.API[fnName].properties.args.items : null;
//console.log(selectedJsonSchema);
}

Expand Down
8 changes: 0 additions & 8 deletions monitoring_ui/src/containers/forms/ObcConfigurationForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ class ObcConfigurationForm extends React.Component {
handleSubmit(obcConfiguration) {
let { dispatch } = this.props;

console.log(obcConfiguration);
let idWithoutSpaces = obcConfiguration.chaincodeId.replace(/ /g,'');

console.log(idWithoutSpaces);
console.log(idWithoutSpaces.length)

//submit if the length is correct
if(idWithoutSpaces.length === 128){
this.props.dispatch(actions.change('obcConfiguration.chaincodeId',obcConfiguration.chaincodeId.replace(/ /g,'')));
Expand All @@ -59,10 +54,7 @@ class ObcConfigurationForm extends React.Component {
this.props.dispatch(actions.setValidity('obcConfiguration.chaincodeId', true));
}else{
//set an error message if the length is incorrect
//this.props.dispatch(actions.change('obcConfiguration.errors.chaincodeId',strings.CHAINCODE_LENGTH_ERROR(idWithoutSpaces.length)));
this.props.dispatch(actions.setValidity('obcConfiguration.chaincodeId', false));
//console.log(getField(obcConfiguration, 'chaincodeId').valid)
//this.props.dispatch(actions.validate('obcConfiguration.chaincodeId', false))
}


Expand Down

0 comments on commit 21bac12

Please sign in to comment.