-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8751 from jeffibm/utilization-tabs-conversion
Fix Utilisation accessibility violation and tabs conversion from HAML to React
- Loading branch information
Showing
9 changed files
with
57 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module UtilizationHelper | ||
def utilization_tab_configuration | ||
[:summary, :details, :report].map do |item| | ||
{:name => item, :text => utilization_tabs_types[item]} | ||
end | ||
end | ||
|
||
def utilization_tab_content(key_name, &block) | ||
if utilization_tabs_types[key_name] | ||
class_name = key_name == :summary ? 'tab_content active' : 'tab_content' | ||
tag.div(:id => key_name, :class => class_name, &block) | ||
end | ||
end | ||
|
||
private | ||
|
||
def utilization_tabs_types | ||
{ | ||
:summary => _('Summary'), | ||
:details => _('Details'), | ||
:report => _('Report'), | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
#utilization_tabs | ||
%ul.nav.nav-tabs{'role' => 'tablist'} | ||
= miq_tab_header('summary', @sb[:active_tab]) do | ||
= _('Summary') | ||
= miq_tab_header('details', @sb[:active_tab]) do | ||
= _('Details') | ||
= miq_tab_header('report', @sb[:active_tab]) do | ||
= _('Report') | ||
.tab-content | ||
= miq_tab_content('summary', @sb[:active_tab]) do | ||
#utilization-tabs-wrapper.miq_custom_tab_wrapper | ||
= react('MiqCustomTab', {:containerId => 'utilization-tabs', | ||
:tabLabels => utilization_tab_configuration, | ||
:type => 'UTILIZATION'}) | ||
#utilization-tabs.miq_custom_tabs_container | ||
= utilization_tab_content(:summary) do | ||
= render :partial => "utilization_summary" | ||
= miq_tab_content('details', @sb[:active_tab]) do | ||
= utilization_tab_content(:details) do | ||
= render :partial => "utilization_details" | ||
= miq_tab_content('report', @sb[:active_tab]) do | ||
= utilization_tab_content(:report) do | ||
= render :partial => "utilization_report" | ||
|
||
:javascript | ||
miq_tabs_init('#utilization_tabs', '/utilization/change_tab'); |