-
Notifications
You must be signed in to change notification settings - Fork 667
Bug 1811003: Make storage class dropdown required #5071
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 1811003: Make storage class dropdown required #5071
Conversation
|
@afreen23: This pull request references Bugzilla bug 1811003, 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
DetailsIn 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. |
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.
Why do you need catch block here. handlePromise does handle that.
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.
Because handlePromise returns a promise and it needs to be either returned or caught.
I removed return as you can compare so I need to put catch.
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.
It does not have to be. (remove the return). We can let it be
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 is not a new style I am introducing in the console. There is a precedent for it.
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.
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.
| throw new Error('No storage class is selected'); | |
| throw new Error('No storageclass selected'); |
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.
I found this better.
5df89b0 to
1b2122a
Compare
|
@afreen23 we need it for the add capacity flow as well. |
e99ab89 to
d906718
Compare
|
@afreen23: This pull request references Bugzilla bug 1811003, which is valid. 3 validation(s) were run on this bug
DetailsIn 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. |
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.
I think this is still required if something else fails.
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 is all handled by withHandlePromise HOC.
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.
You are right, I got confused with other component.
Added back.
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.
| handlePromise(makeOCSRequest(selectedNodes, storageClass, osdSize)) | |
| .then(() => { | |
| history.push( | |
| `/k8s/ns/${ns}/clusterserviceversions/${appName}/${referenceForModel( | |
| OCSServiceModel, | |
| )}/${getName(ocsRequestData)}`, | |
| ); | |
| }) | |
| .catch(() => null); | |
| // eslint-disable-next-line promise/catch-or-return | |
| handlePromise(makeOCSRequest(selectedNodes, storageClass, osdSize)) | |
| .then(() => { | |
| history.push( | |
| `/k8s/ns/${ns}/clusterserviceversions/${appName}/${referenceForModel( | |
| OCSServiceModel, | |
| )}/${getName(ocsRequestData)}`, | |
| ); | |
| }); |
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 code looks wrong to me. handlePromise does not expose setError or setProgress to the user. There is a bigger issue here.
/hold
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.
i think you missed these lines https://github.com/openshift/console/pull/5071/files#diff-ecff7031320d48d9e801ba99a2fb7188R38-R39
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.
Yes, that's where the bug is. So handlePromise will return props.errorMessage and props.isLoading. These values are different from the state values declared in the line you pointed me to. Hence the handling done by handlePromise is not used here.
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.
You are not manually setting the progress like the code that you just deleted. Hence loading state and error will not be correctly reflected for ALL cases. Technically the deleted code is incorrect as it does not use handlePromise in the correct manner, but mixing the right way and the wrong way causes issues.
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 then @cloudbehl point makes sense, sorry I missed that in haste.
https://github.com/openshift/console/pull/5071/files#r409588659
d906718 to
87b6c02
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.
| .handlePromise(k8sPatch(OCSServiceModel, ocsConfig, [patch])) | |
| .k8sPatch(OCSServiceModel, ocsConfig, [patch])) |
No need to use handlePromise since the props provided by it is not used anywhere in the code.
- Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1811003 Signed-off-by: Afreen Rahman <afrahman@redhat.com>
87b6c02 to
b13121a
Compare
|
/hold cancel |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afreen23, bipuladh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
@afreen23: All pull requests linked via external trackers have merged: openshift/console#5071. Bugzilla bug 1811003 has been moved to the MODIFIED state. DetailsIn 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. |

Merge after #5017
https://bugzilla.redhat.com/show_bug.cgi?id=1811003