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
Fix HealthCheckProbeData type #9300
Fix HealthCheckProbeData type #9300
Conversation
/cc @andrewballantyne |
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.
Looking good. It's a pity we don't have Deployment and Deployment Config defined more strictly so we can use your type within' 🤔
One change to do because we really need to be typing both ends of a utility (I think there are other utilities in your files that are not double-ended typed, but we can fix those each time we touch the area rather than make this PR a hunt-and-fix PR -- because that may not have an easy end).
@@ -41,26 +47,48 @@ export const getRequestType = (data: HealthCheckProbeData) => { | |||
return ''; | |||
}; | |||
|
|||
export const convertResourceDataToFormData = (resourceData: HealthCheckProbeData) => { |
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.
export const convertResourceDataToFormData = (resourceData: HealthCheckProbeData) => { | |
export const convertResourceDataToFormData = (resourceData: HealthCheckProbeData): HealthCheckFormData => { |
It's important, especially for the TypeScript help, that stand-alone utilities have an explicit return type. Super important when they are objects as there is a lot more ambiguity in the structure of the object.
3c62f78
to
476dadb
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne, debsmita1, vikram-raj The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes:
https://issues.redhat.com/browse/ODC-6037
Solution description:
Created types:
HealthCheckFormProbeData
: which contains properties required to populate the Health checks formHealthCheckProbeData
: which contains properties required to update the k8s resourceGIF:
No UI changes
Unit Tests:
Update the unit tests