-
Notifications
You must be signed in to change notification settings - Fork 368
Rewriting Cloud Volume Form to React #7399
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
Conversation
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
8f30142 to
c686189
Compare
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
skateman
left a comment
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 created a core PR that should allow us more precise querying of the supported providers for create and edit separately. Please change the logic accordingly.
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
722b76e to
8c790c9
Compare
skateman
left a comment
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.
Due to some complex conditions in the amazon form, we need to tap into some dark magic to hide the standard (Magnetic) volume type from the dropdown when editing a non-magnetic amazon volume.
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
skateman
left a comment
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 getting close, just please avoid applying suggested changes using the browser as it creates a mess in the code/commits.
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
skateman
left a comment
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 are a bunch of linting errors in the codebase, please integrate eslint into your editor to see them.
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
d26b28a to
734a50b
Compare
app/javascript/components/cloud-volume-form/cloud-volume-form.schema.js
Outdated
Show resolved
Hide resolved
|
@DavidResende0 can you please rebase this PR? |
704b897 to
ae93b37
Compare
dbf0733 to
eaae185
Compare
|
Fields are now provider-specific, coming from the API, so there are some differences. The steps/size things is also coming from the provider, it's their decision to have bytes/gbytes, not a UI problem 😉 |
Right, so..
I can't help but notice the "provider decision" was made by you :) Let's fix it before merging, bad UI is always a UI problem :). |
|
Different provider backend expect different values (bytes, gigabytes) so I don't know what would be the fix here. Also it's not related to this PR as it is coming from the provider ... Amazon/Openstack expects bytes, while IBM needs GBs |
We should make our provider plugins work from a single standard and do necessary conversions when communicating with the actual provider. I am assuming that standard is bytes. /cc @agrare |
|
The point of provider pluggability and form schemas coming over the API is that these things aren't implemented in the UI repo anymore and they don't block us in merging this. With other words: there is nothing else to do in this repo so why can't we get this in @himdel? |
|
I agree that all providers should use bytes for consistency (someone could be calling We also don't have to do that before this PR is merged, it can be fixed in the IBM Cloud repo independently. |
He decided on bytes which was correct ;) Looks like IBM API takes GB but we should be converting that in raw_create_volume not in the form. |
|
@himdel all providers are consistent now, please take another look |
No, I didn't 😆 IBM folks were complaining that the form isn't working |
|
IBM guy here 😄. I understand the value in consistent provider back-ends, so I agree with ManageIQ/manageiq-providers-ibm_cloud#135. But now the user interface to create volumes for the IBM Cloud provider isn't great. Is there a way to define the provider form to display GB to the user, but submit the value as bytes? It seems arduous to ask a user to type |
|
@jaywcarman @agrare @himdel do we have to do anything else in this PR or these problems can be solved in the provider repos? In that case what is blocking us from merging this UI PR? |
skateman
left a comment
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.
The Carbon mapper got merged, you should rebase
238c8e2 to
c0dbe6c
Compare
c0dbe6c to
140a2ee
Compare
|
Checked commit DavidResende0@140a2ee with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint **
|
bump |
I don't have any issues with merging this PR. If we do that I can open an issue against the IBM Cloud provider to discuss whether/how to improve the display units. |
|
@skateman merge away if you're good with this |
|
@jaywcarman There's likely no way you can do the conversion in the provider repo, unfortunately :(. The only way is for the UI to provide a bytes-to-human-size component the providers can then use. Looks like the UI changes will be up to you then, sorry about that. ( #7311 should be a good example of enhancing an existing component by wrapping it, in your case you'd be creating a new one by wrapping an existing number input, but otherwise the principle should be the same) If you do end up fixing it, please make sure the component is used by all the providers :)
Sorry, I was too late. The logic was, without this PR, everybody can still use the old forms, with gigabytes and we don't have a TODO(before release). I do agree with the need to settle on bytes on the data level, but IMO without a component to convert that, it makes the UI less than useable. And I'm not aware of any way to do that from a provider repo (other than doing what should be done here, except 3 times). (Though, one possible consideration, values over 8 PB can't be represented exactly in js if the representation is numeric bytes.) |
|
@himdel without this PR you can't really create IBM cloud volumes. Also who would actually create a volume that has 8 PB??? 😱 |
Form can be found in Storage->Block Storage->Volumes
Fixes #7334