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

React-ify Request Detail page #213

Merged
merged 2 commits into from
Feb 16, 2017
Merged

React-ify Request Detail page #213

merged 2 commits into from
Feb 16, 2017

Conversation

PtrTeixeira
Copy link
Contributor

Move the RequestDetail page over to React.

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';
Copy link
Member

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']),
Copy link
Member

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,
Copy link
Member

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.
@ssalinas ssalinas merged commit 9a1bdd2 into react Feb 16, 2017
@ssalinas ssalinas deleted the react-request branch February 16, 2017 21:27
@ssalinas ssalinas modified the milestone: 0.5.0 May 23, 2017
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