-
Notifications
You must be signed in to change notification settings - Fork 80
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
Lazy-load server data with ec2 instance info #615
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #615 +/- ##
===========================================
- Coverage 43.45% 15.66% -27.80%
===========================================
Files 323 323
Lines 17589 16439 -1150
Branches 5363 4992 -371
===========================================
- Hits 7644 2575 -5069
- Misses 8670 11845 +3175
- Partials 1275 2019 +744
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
) | ||
return update(state, { | ||
isFetching: { $set: false }, | ||
data: { [serverIdx]: { $set: action.payload } } |
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.
Not necessarily needed, but seems like an opportunity to reuse the serverData variable?
_onExpandServer = (index: number) => { | ||
this.props.fetchServer(this.state.otpServers[index].id) | ||
} | ||
|
||
_onSaveServer = (index: number) => this.props.updateServer(this.state.otpServers[index]) |
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.
What happens if a server is expanded, you apply updates, and click save? Are the server ec2 instances no longer shown?
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.
One minor comment, one that probably needs addressing.
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.
Subject to @landonreed's comment about refetching EC2 instances on an expanded server panel.
Good catch. I just pushed a change that addresses this. |
Checklist
dev
before they can be merged tomaster
)Description
This PR changes the way data is loaded for the ServerSettings admin component. Whenever a panel showing the details about a server is expanded, the UI will now make a call to a new endpoint in datatools-server to load the full information about the server which could include data about ec2 instances. This is done to avoid making unnecessary calls to AWS until that data is actually needed.
This PR requires using the code in ibi-group/datatools-server#343.