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

Fix UI mapping for label tag mapping. #780

Merged
merged 3 commits into from
Mar 27, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ def label_tag_mapping_edit
end

def entity_ui_name_or_all(entity)
if entity.nil?
_("<All>")
else
if entity
entity = entity.split('::').last
entity = 'VmOrTemplate' if entity == 'Image'
Copy link
Contributor

@cben cben Mar 27, 2017

Choose a reason for hiding this comment

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

so 'Amazon::Vm' becomes ui_lookup(model: 'Vm') == "VM and Instance",
Amazon::Image becomes ui_lookup(model: 'VmOrTemplate') == "VM or Template".
Would user understand the distinction? Perhaps you want something like _("VM") and _("VM Image")?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cben I don't see a way around it. Unless there's to an option to Dictionary.gettext that we can pass (which is being called in the ui_lookup method in lib/global_methods.rb), I don't see a way around this for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

@djberg96 how abut using ui_lookup(:model => 'ManageIQ::Providers::CloudManager::Template')

ui_lookup(:model => entity)
else
_("<All>")
end
end

Expand Down