Skip to content
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

Allow selecting an optional volume type when creating an Openstack cloud volume #4536

Merged

Conversation

mansam
Copy link
Contributor

@mansam mansam commented Aug 24, 2018

Allows selecting an optional Volume Type when creating an Openstack cloud volume. Generalizes the existing AWS volume type code in the new volume form wherever possible.

Implements https://bugzilla.redhat.com/show_bug.cgi?id=1550008

select_volume_type

@mzazrivec
Copy link
Contributor

@mansam Could you please address the above codeclimate issues? Thanks.

@mansam mansam force-pushed the openstack-create-volume-with-volume-type branch from bca34ab to d39008e Compare August 27, 2018 16:14
@miq-bot
Copy link
Member

miq-bot commented Sep 3, 2018

This pull request is not mergeable. Please rebase and repush.

@mansam mansam force-pushed the openstack-create-volume-with-volume-type branch from d39008e to 02fe265 Compare September 12, 2018 19:06
@Loicavenel
Copy link

@mzazrivec, can you review it...

= _("Required")

.form-group{"ng-class" => "{'has-error': angularForm.volume_type.$invalid}",
"ng-if" => "vm.cloudVolumeModel.emstype == 'ManageIQ::Providers::Openstack::StorageManager::CinderManager'"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to avoid constructs like this as much as possible (i.e. stating specific model name in UI code).

Ideally, this test should happen on the ruby side, using our supports? functionality and just propagate a boolean of some sort to the angular code & the view.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not aware of supports? being accessible through the API, and the user can change the Storage Manager form field on the fly, so I can't pre-inject a boolean value into the form. With that in mind, what is the appropriate UI pattern for dynamically accessing the result of supports_whatever_feature? when the Storage Manager selection is changed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we don't have a universal pattern for this really. But I guess results of the supports? call can come with the storage managers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mzazrivec I don't think it can, since the storage managers are loaded via the API. I think in order to access it via the API it would have to be added as a virtual column like https://github.com/ManageIQ/manageiq-providers-openstack/pull/355/files, and that seems like it would be incredibly messy in the general case since you'd need a virtual column for every feature you wanted to check against.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, apparently there's already precedent for doing exactly that. Still seems incredibly messy, but I suppose that's how it has to be done.

@miq-bot
Copy link
Member

miq-bot commented Sep 19, 2018

Checked commits mansam/manageiq-ui-classic@f141f58~...d69a89e with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - Linter::Haml STDERR:
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.6-compliant syntax, but you are running 2.3.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

@mansam
Copy link
Contributor Author

mansam commented Sep 19, 2018

@mansam
Copy link
Contributor Author

mansam commented Sep 20, 2018

@mzazrivec Are these changes sufficient?

@Loicavenel
Copy link

@mzazrivec can you review this one today?

@aufi
Copy link
Member

aufi commented Sep 25, 2018

Both dependent PRs were merged, could we get this in?

@Ladas
Copy link
Contributor

Ladas commented Sep 25, 2018

@martinpovolny can you check this out, please? @mzazrivec is on PTO.

@mzazrivec
Copy link
Contributor

@terezanovotna Seeing this PR has ux/review label assigned -- from UX perspective, are you OK with the proposed changes?

@terezanovotna
Copy link

@miq-bot remove_label ux/review
@miq-bot add_label ux/approved

Welcome back from PTO @mzazrivec! I don't see any inconsistencies with the rest of the product, do you @mzazrivec?

@mzazrivec mzazrivec self-assigned this Oct 2, 2018
@mzazrivec
Copy link
Contributor

Nope, no UX inconsistencies found.

@mzazrivec mzazrivec added this to the Sprint 96 Ending Oct 8, 2018 milestone Oct 2, 2018
@mzazrivec mzazrivec merged commit 7c4afa8 into ManageIQ:master Oct 2, 2018
@simaishi
Copy link
Contributor

@mansam Can this be hammer/yes?

@mansam
Copy link
Contributor Author

mansam commented Oct 16, 2018

@miq-bot add_label hammer/yes

@mansam
Copy link
Contributor Author

mansam commented Oct 16, 2018

@simaishi Yes, and it looks like the other two components have already been included in Hammer. ManageIQ/manageiq-providers-openstack#358 and ManageIQ/manageiq#18000

simaishi pushed a commit that referenced this pull request Oct 17, 2018
…ume-type

Allow selecting an optional volume type when creating an Openstack cloud volume

(cherry picked from commit 7c4afa8)

https://bugzilla.redhat.com/show_bug.cgi?id=1550008
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit 88f3a01cbb4cf14d437c1de355caaa3905d02c91
Author: Milan Zázrivec <[email protected]>
Date:   Tue Oct 2 16:48:20 2018 +0200

    Merge pull request #4536 from mansam/openstack-create-volume-with-volume-type
    
    Allow selecting an optional volume type when creating an Openstack cloud volume
    
    (cherry picked from commit 7c4afa8014dd5b93637ce5650f85bd5e6ab4956c)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1550008

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants