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

Use dialog-user component for more custom button object types #4374

Merged
merged 2 commits into from
Aug 3, 2018

Conversation

eclarizio
Copy link
Member

Related to #3439

This PR adds support with the dialog-user component for the following custom button object types:
AvailabilityZone
ContainerGroup
ContainerImage
ContainerProject
ContainerTemplate
ContainerVolume
LoadBalancer
NetworkRouter
OrchestrationStack
SecurityGroup
Switch

I also refactored the case statement a bit, since a lot of these new objects were simple, so basically now unless something needs special handling, it will fall through to the else part of the case statement and default to changing something like AvailabilityZone into availability_zones for the API collection name and "/availability_zone" for the UI cancel endpoint.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1597914

/cc @gmcculloug
@d-m-u Can you review, please?
@tinaafitz Do you think you can help set up something with QE so we can test all of these new object types with custom buttons? I was able to test a few of them locally but the others I don't have the data for and not sure how to set them up properly.

@miq-bot assign @h-kataria
@miq-bot add_label enhancement, automation/automate

Copy link
Contributor

@d-m-u d-m-u left a comment

Choose a reason for hiding this comment

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

lgtm

:cancel_endpoint => "/availability_zone"
)
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

I see 15 it blocks doing very similar thing, just with different parameters. Could this be turned into a shared example perhaps? Or something else by using parameters?

Copy link
Member Author

Choose a reason for hiding this comment

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

@mzazrivec Good call, easy fix with a shared example, will do that. 👍

@eclarizio eclarizio force-pushed the BZ1597914 branch 2 times, most recently from 665f9ef to 8ac805a Compare August 1, 2018 18:02
context "when the object is a AvailabilityZone" do
let(:obj) { double(:class => ManageIQ::Providers::Vmware::InfraManager::AvailabilityZone, :id => 123) }

it_behaves_like "DialogLocalService#determine_dialog_locals_for_custom_button returning a hash",
Copy link
Member

Choose a reason for hiding this comment

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

Please use include_examples instead of it_behaves_like.

@tinaafitz
Copy link
Member

@eclarizio I made a note to work with QE once this PR is merged.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1597914

This PR adds support with the dialog-user component for the following
custom button object types:
AvailabilityZone
ContainerGroup
ContainerImage
ContainerProject
ContainerTemplate
ContainerVolume
LoadBalancer
NetworkRouter
OrchestrationStack
SecurityGroup
Switch
@miq-bot
Copy link
Member

miq-bot commented Aug 2, 2018

Checked commits eclarizio/manageiq-ui-classic@65281ac~...d889ab8 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 1 offense detected

spec/services/dialog_local_service_spec.rb

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

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

The Seal of Approval

@mzazrivec mzazrivec assigned mzazrivec and unassigned h-kataria Aug 3, 2018
@mzazrivec mzazrivec added this to the Sprint 92 Ending Aug 13, 2018 milestone Aug 3, 2018
@mzazrivec mzazrivec merged commit 7399a64 into ManageIQ:master Aug 3, 2018
rvsia pushed a commit to rvsia/manageiq-ui-classic that referenced this pull request Aug 14, 2018
Use dialog-user component for more custom button object types
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.

7 participants