-
Notifications
You must be signed in to change notification settings - Fork 37
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
React-ify Request Detail page #213
Conversation
Move the ReactDetail page over to React. There aren't really any actions on this page, so this is pretty much all of it.
@@ -0,0 +1,101 @@ | |||
import React from 'react'; | |||
import _ from 'underscore'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_
should be available globally, shouldn't need this import
serviceId: Utils.maybe(state, ['api', 'requestResponse', ownProps.params.requestId, 'data', 'request', 'loadBalancerService', 'serviceId']), | ||
agentResponses: Utils.maybe(state, ['api', 'requestResponse', ownProps.params.requestId, 'data', 'agentResponses']), | ||
message: Utils.maybe(state, ['api', 'requestResponse', ownProps.params.requestId, 'data', 'message']), | ||
request: Utils.maybe(state, ['api', 'requestResponse', ownProps.params.requestId, 'data', 'request']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
migWe already have the response
object in api. requestResponse.(requestId).data
mapped to params on the line below this. Would be a bit cleaner to just use that rather that mapping each individual field we need to a param
agentResponses: PropTypes.object, | ||
message: PropTypes.string, | ||
request: PropTypes.object, | ||
response: PropTypes.object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we know the form response takes, we can actually be more detailed here using PropTypes.shape
e.g.
response: PropTypes.shape({
loadBalancerRequestId: PropTypes.string,
agentResponses: PropTypes.arrayOf(PropTypes.shape({ ...
...
This principally involved changing where the destructuring was taking place; in particular, it moved if from the HOC binding into the beginning of the render method. If also involved adding a loading icon to handle when the UI had yet to finish the request, and dropping the global `_` from being included in the vendor bundle.
Move the RequestDetail page over to React.