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
Bug 1881881: Replace route dropdown input with typeahead select menu in import/edit flow #6719
Bug 1881881: Replace route dropdown input with typeahead select menu in import/edit flow #6719
Conversation
@rottencandy: This pull request references Bugzilla bug 1881881, which is invalid:
Comment 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. |
/kind bug |
/cc @christianvogt |
@rottencandy: This pull request references Bugzilla bug 1881881, which is invalid:
Comment 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. |
); | ||
return acc; | ||
}, {}); | ||
const portOptions = ports.map((port) => port.containerPort); |
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.
When you convert the ports here to strings the Select
automatically matches the user input and do not show "Create "8080"" if the option is already available. Wdyt?
const portOptions = ports.map((port) => port.containerPort); | |
const portOptions: string[] = ports.map((port) => port.containerPort.toString()); |
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.
Updated. Not sure if there is something we can do about the "Create ..." option, even the Patternfly demos behave the same way: https://www.patternfly.org/v4/documentation/react/components/select#typeahead
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.
Okay, thanks for revalidating this. I though that the .toString() solves this issue.
|
||
const CreateRoute: React.FC = () => { | ||
const { | ||
values: { | ||
image: { ports }, | ||
route: { defaultUnknownPort, targetPort }, | ||
route: { defaultUnknownPort }, | ||
}, | ||
} = useFormikContext<FormikValues>(); |
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.
} = useFormikContext<FormikValues>(); | |
} = useFormikContext<DeployImageFormData | GitImportFormData>(); |
Adding this types so that the ports and defaultUnknownPort vars are typed.
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.
Updated, didn't know we could do that. Now I'm wondering why we even use FormikValues
type :P.
@rottencandy Technical this works fine, I have added two comments to the code. I also want ask you if you want rename your new component from In this case a port validation 1-65535 would be also a good idea. It's not required, but I missed this when entering some invalid numbers. Wdyt? |
755b1be
to
43aec9f
Compare
Thanks for the review @jerolimov , Renamed to
Currently we do the validation using a regex( |
43aec9f
to
a41fb6a
Compare
We could use a number check similar to this instead of regex for the const portValidationSchema = yup
.number()
.typeError('Port must be an Integer.')
.integer('Port must be an Integer.')
.min(1, 'Port must be between 1 and 65535.')
.max(65535, 'Port must be between 1 and 65535.'); Didn't know the typeError check before. It was the message if you enter "asd". Integer ensures that user could not enter "3.1415". Wdyt? Is it worth to update the PR again? :) |
a41fb6a
to
984bd82
Compare
Updated. |
984bd82
to
9c1e4e3
Compare
/retest |
9c1e4e3
to
44bfac9
Compare
Updated to behave the same way when selecting Knative Service. |
Hmm, I'm really sorry but could not verify this issue. I tried to set a custom port for the route and select "Knative Service" as Deployment. The created Route has not set the port anywhere. Then I tried this on master, and changed @rottencandy Unfortunately, I'm now thinking about the unifying between two different cases. Before we have |
/assign |
44bfac9
to
175816c
Compare
@jerolimov The knative service function prioritized AFAIK,
|
One more small issue:
|
710a489
to
c37779d
Compare
Fixed. |
/bugzilla refresh |
@rottencandy: This pull request references Bugzilla bug 1881881, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 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 kubernetes/test-infra repository. |
c37779d
to
19d7814
Compare
/retest |
2 similar comments
/retest |
/retest |
@rottencandy I could reproduce the above issue for knative service workload. Have a look at the gif below: |
19d7814
to
6cb02d2
Compare
Updated edit flow to use |
6cb02d2
to
d3c5c46
Compare
verified this locally |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bgliwa01, christianvogt, debsmita1, rottencandy, serenamarie125 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 |
@rottencandy: All pull requests linked via external trackers have merged: Bugzilla bug 1881881 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 kubernetes/test-infra repository. |
/cherrypick release-4.6 |
@rottencandy: new pull request created: #7064 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. |
Fixes:
https://issues.redhat.com/browse/ODC-4869
Analysis / Root cause:
The dropdown only allows for the selection of the exposed ports from the builder image.
Solution Description:
The user should have the ability to specify their target port to ensure the route works.
Relevant Slack thread: https://coreos.slack.com/archives/CHC2R6AGG/p1600757882002000
Screen shots / Gifs for design review:
cc: @openshift/team-devconsole-ux
Unit test coverage report:
Unchanged.
Test setup:
Browser conformance: