-
Notifications
You must be signed in to change notification settings - Fork 357
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 base_model name instead of demodulize #5182
Conversation
@miq-bot add_label bug |
@miq-bot add_reviewer @gmcculloug |
19c7c1d
to
a1dafd1
Compare
b74d064
to
1f49d87
Compare
@@ -140,7 +101,7 @@ def determine_target_type(obj) | |||
when /^Service/ | |||
"service" | |||
else | |||
obj.class.name.demodulize.underscore | |||
obj.class.base_model.name.underscore.downcase |
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 seems like a much different return value in some cases. Were you able to fully verify this change?
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 ones that are different from the old file with this change are:
cloud_network
for what would have been private
and
host
for what would've returned host_esx
76d14a9
to
8c105d8
Compare
@bdunne any chance you could 👀 for me please? |
Checked commit d-m-u@e31688a with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@gmcculloug @bdunne please review? |
let(:obj) { double(:class => ManageIQ::Providers::Vmware::CloudManager, :id => 123) } | ||
|
||
include_examples "DialogLocalService#determine_dialog_locals_for_custom_button return value", | ||
"ext_management_system", "providers", "/ems_cloud" |
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.
Is "/ems_cloud" right? Do you know how that is used?
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.
Oh, is that a UI route?
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.
Yeah but it'd be real spiffing if someone on the UI team could confirm that that's what is supposed to happen 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.
👍 Can't merge here, but LGTM
Use base_model name instead of demodulize (cherry picked from commit a510142) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1702490
Hammer backport details:
|
CustomButtons run on Hosts return "HostEsx" with demodulize, and CloudNetworks when demodulized return "public" or "private", which means that for four or so different object types we're not running the custom buttons currently cause we can't find the right target_type for the API endpoint.
However, the check that was in was temporary and used to determine if the object could use the new dialogs. Erik confirmed that all objects that needed to do now, so this check can be removed. To anyone who doesn't like it, the alternatives are adding a buncha models to the NEW_DIALOG_USERS list, or moving all that logic to the respective models, neither of which is particularly palatable, so boooooya. (a64c119 and 65281ac and 0f4d24f)
It's been in since bcfee50.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1668023