-
Notifications
You must be signed in to change notification settings - Fork 356
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
Make Automate Domains and Providers clickable from the list displayed through Tenant's Relationships #6144
Make Automate Domains and Providers clickable from the list displayed through Tenant's Relationships #6144
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,24 @@ def index | |
case params[:model] | ||
when 'ExtManagementSystem' | ||
record = ExtManagementSystem.find_by(:id => params[:id]) | ||
record ? redirect_to(polymorphic_path(record)) : handle_missing_record | ||
if record | ||
if %w[ManageIQ::Providers::ConfigurationManager].include?(record.type) || record.type.starts_with?('ManageIQ::Providers::Foreman') | ||
redirect_to(:controller => 'provider_foreman', :action => 'show', :id => params[:id]) | ||
elsif %w[ManageIQ::Providers::AnsibleTower::AutomationManager].include?(record.type) | ||
redirect_to(:controller => 'automation_manager', :action => 'show', :id => params[:id]) | ||
elsif %w[ManageIQ::Providers::EmbeddedAnsible::AutomationManager].include?(record.type) | ||
redirect_to(:controller => 'ansible_playbook', :action => 'show_list') | ||
else | ||
begin | ||
redirect_to(polymorphic_path(record)) | ||
rescue NoMethodError | ||
flash_to_session(_("Cannot redirect to \"%{record}\" provider.") % {:record => record.name}, :error) | ||
redirect_to(:controller => 'ops', :action => 'explorer') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to redirect user back to the tenant detail, but can stay in the screen displaying providers There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After discussion with Martin P we decided to redirect user back to the Tenant textual summary. |
||
end | ||
end | ||
else | ||
handle_missing_record | ||
end | ||
when 'ServiceTemplateTransformationPlanRequest' | ||
req = ServiceTemplateTransformationPlanRequest.select(:source_id).find(params[:id]) | ||
req ? redirect_to(:controller => 'migration', :action => 'index', :anchor => "plan/#{req.source_id}") : handle_missing_record | ||
|
@@ -15,7 +32,12 @@ def index | |
record = VmOrTemplate.select(:id, :type).find(params[:id]) | ||
record ? handle_vm_redirect(record) : handle_missing_record | ||
else | ||
handle_missing_record | ||
if params[:model].starts_with?('ExtManagementSystem') | ||
params[:model], params[:id] = params[:model].split('/') | ||
index | ||
else | ||
handle_missing_record | ||
end | ||
end | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#main_div | ||
= render :partial => "all_tabs" | ||
|
||
-# To include MyCodeMirror JS and CSS files | ||
= render :partial => "/layouts/my_code_mirror", :locals => {:text_area_id => "miq_none", :mode => "ruby"} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
= render(:partial => 'shared/provider_paused', :locals => {:record => @record}) | ||
|
||
#main_div | ||
= render(:partial => 'layouts/x_gtl') |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2081,6 +2081,7 @@ | |
explorer | ||
method_form_fields | ||
namespace | ||
show | ||
), | ||
:post => %w( | ||
add_update_method | ||
|
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 the word
redirect
here is a bit unfortunate. I understand that we're in redirect controller and what we're doing here is rendering redirects, but the user reading the above flash message isn't expecting any redirects, the user is just clicking in the ui.May I suggest a string like:
Cannot display ... provider
or something like 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.
"Cannot redirect..." flash message/string was suggested by @martinpovolny.
And in my opinion, "cannot redirect..." can be more accurate. We just have problems with redirecting to the proper place from list of Providers from Tenant's summary, not with displaying provider's info in general. Displaying still can be possible for example via different place/controller. I just cannot guarantee proper redirecting for all kinds of providers here, so I better implemented displaying this flash message. I am little bit worried that we would create a little misunderstanding by using "cannot display..". It would feel like we are not able to display the provider at all. @martinpovolny @mzazrivec What do you think?
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.
But we aren't able to display the provider in this case, are we? My point was that redirect is really a matter of internal implementation here, not necessarilly something a user would understand.
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.
IMHO, the flash message is ok. And yes, it could be confusing for some users because as you said, it's about internal implementation. I have no problem with changing the string in a flash message. But .. I think that this all is just about that we are trying to see into users' heads and assume what's understandable for them. Anyway, @martinpovolny what do you think about Milan's assumption?