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

Remove WIDGET_TYPES, SINGULAR_WIDGET_TYPES from UiConstants #2025

Merged
merged 2 commits into from
Aug 29, 2017
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions app/controllers/report_controller/widgets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ module ReportController::Widgets
"Vmware RSS Feeds" => "http://vmware.simplefeed.net/rss?f=995b0290-01dc-11dc-3032-0019bbc54f6f"
}.freeze

SINGULAR_WIDGET_TYPES = {
"r" => N_('Report'),
"c" => N_('Chart'),
"rf" => N_('RSS Feed'),
"m" => N_('Menu')
}.freeze

def widget_refresh
assert_privileges("widget_refresh")
replace_right_cell
Expand Down
14 changes: 0 additions & 14 deletions app/helpers/ui_constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,20 +190,6 @@ module UiConstants
N_('4 Years Ago')
]

# Need this for display purpose to map with id
WIDGET_TYPES = {
"r" => N_('Reports'),
"c" => N_('Charts'),
"rf" => N_('RSS Feeds'),
"m" => N_('Menus')
}

SINGULAR_WIDGET_TYPES = {
"r" => N_('Report'),
"c" => N_('Chart'),
"rf" => N_('RSS Feed'),
"m" => N_('Menu')
}
# Need this for mapping with MiqWidget record content_type field
WIDGET_CONTENT_TYPE = {
"r" => "report",
Expand Down
8 changes: 8 additions & 0 deletions app/presenters/tree_builder_report_widgets.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
class TreeBuilderReportWidgets < TreeBuilder
# Need this for display purpose to map with id
WIDGET_TYPES = {
"r" => N_('Reports'),
"c" => N_('Charts'),
"rf" => N_('RSS Feeds'),
"m" => N_('Menus')
}.freeze

private

def tree_init_options(tree_name)
Expand Down