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
OCPBUGS-33011: fix issues with Edit Route form #13799
Conversation
@rhamilto: This pull request references Jira Issue OCPBUGS-33011, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@@ -66,7 +66,7 @@ class CreateRouteWithTranslation extends React.Component< | |||
namespace: getActiveNamespace(), | |||
labels: {}, | |||
portOptions: {}, | |||
alternateServices: [], | |||
alternateBackends: [], |
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.
Throughout the PR: use alternateBackends
to align with the Route schema.
alternateServices: updatedServiceEntriesArray, | ||
}; | ||
}); | ||
this.setState( |
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.
Fixes a console error resulting from the nested setState
calls. Fix is to move the second setState
to a callback.
@@ -342,7 +346,7 @@ class CreateRouteWithTranslation extends React.Component< | |||
className="pf-v5-c-form-control" | |||
type="text" | |||
onChange={this.handleChange} | |||
value={this.state.path} | |||
value={this.state.path ?? ''} // this.state.path can be set to undefined in componentDidMount |
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.
Fixes a console error related to controlled component changing to an uncontrolled one.
@@ -426,7 +430,8 @@ class CreateRouteWithTranslation extends React.Component< | |||
{!_.isEmpty(portOptions) && ( | |||
<Dropdown | |||
items={portOptions} | |||
title={portOptions[targetPort] || t('public~Select target port')} | |||
title={t('public~Select target port')} | |||
selectedKey={_.isNumber(targetPort) ? UNNAMED_PORT_KEY : targetPort} // if targetPort is a number, it's an unnamed port |
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.
Fix so the Target port
dropdown is correctly populated when editing (before the dropdown did not have a selected value).
if (!_.isEmpty(alternateBackends)) { | ||
route.spec.alternateBackends = alternateBackends; | ||
} | ||
route.spec.alternateBackends = altBackends; |
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.
This fixes the bug as reported in the Jira issue. Passing an empty array is ok!
validationSchema={routeValidationSchema} | ||
enableReinitialize | ||
<> | ||
<Helmet> |
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.
Add missing <title>
@rhamilto: This pull request references Jira Issue OCPBUGS-33011, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/assign @jhadvig, @TheRealJon |
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: rhamilto, TheRealJon 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 |
/cherry-pick release-4.15 |
@rhamilto: once the present PR merges, I will cherry-pick it on top of release-4.15 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@rhamilto: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@rhamilto: Jira Issue OCPBUGS-33011: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-33011 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@rhamilto: new pull request created: #13800 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fix included in accepted release 4.16.0-0.nightly-2024-04-29-222758 |
After:
Screen.Recording.2024-04-26.at.1.20.12.PM.mov