Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature added #12, clickable links on output #39

Merged
merged 4 commits into from
Mar 22, 2020
Merged

feature added #12, clickable links on output #39

merged 4 commits into from
Mar 22, 2020

Conversation

sudipt1999
Copy link
Contributor

What does this PR fixes/adds

  1. Added the feature clickable links on output
  2. Added styles to them
  3. Createad a generic function for output purpose that can be used in all types of output but currently is added to GET request only (Kindly let me know this one! I will be more than happy to add them).

Working proof is added here
ezgif com-video-to-gif

Copy link
Member

@xadahiya xadahiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Please review my suggestions and resolve conflicts. Then we can merge.

@@ -305,8 +367,13 @@ class HydraConsole extends React.Component {
}
axios.post(this.agentEndpoint + '/send-command', getBody)
.then( (response) => {
let outputText = ""
if(response.data.length === 0)
outputText = String(JSON.stringify(response.data, this.jsonStringifyReplacer, 8))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If response.data.length is 0, why would you stringify an empty string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @xadahiya , actually it was because I was rendering the jsx incase its length was >0 so I stringify in case of empty response but thanks for correcting I will make changes accordingly

resourcesIDs: resourcesIDs
})
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add proper comments/docstrings to explain what each function does

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if you can do this for all the functions not just for the functions you wrote. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing to do, my plan was to add them to every function once it was reviewed! Thank you

arr.push(<div className={classes.outputEntryDiv}></div>)
arr.push(<span className={classes.outputConsoleKey}>{key} :</span>)
if(key == "@id")
arr.push(<span className={classes.outputConsoleLink}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should consider adding {} to improve readability and futureproofing (in case we want to add something else)

@sudipt1999
Copy link
Contributor Author

@xadahiya thanks for reviewing my work ! Will update with changes soon

@sudipt1999
Copy link
Contributor Author

@xadahiya so I have added generic methos to support any kind of json response, and added the method to all the request response as asked, kindly review it, a proof of attachment from my side has been added, all the elements are jsx instead of string like earlier :
Screenshot from 2020-03-22 01-13-17
Screenshot from 2020-03-22 01-12-29
Screenshot from 2020-03-22 01-11-43
Screenshot from 2020-03-22 01-11-25

@xadahiya xadahiya merged commit b3c5d2b into HTTP-APIs:develop Mar 22, 2020
@sudipt1999 sudipt1999 deleted the c-links branch April 4, 2020 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants