forked from ATIX-AG/foreman
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #13424 - c3 patternfly react implementation
- Loading branch information
1 parent
2322228
commit 659d49a
Showing
60 changed files
with
1,399 additions
and
48 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"presets": ["es2015"] | ||
"presets": ["react", "es2015"], | ||
"plugins": ["transform-object-rest-spread", "transform-object-assign"] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const c3 = {}; | ||
|
||
c3.generate = () => { | ||
return undefined; | ||
}; | ||
|
||
export default c3; |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module ReactjsHelper | ||
def mount_react_component(name, selector, data) | ||
javascript_tag defer: 'defer' do | ||
"$(tfm.reactMounter.mount('#{name}', '#{selector}', #{data}));".html_safe | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<%= javascript 'charts' %> | ||
<% title @fact.name %> | ||
|
||
<%= pie_chart @fact.name, _("%s Distribution") % @fact.name.camelize, FactValue.count_each(@fact.name) %> |
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,9 +1,5 @@ | ||
<% title _("Statistics"), _('Statistics') %> | ||
<div id="statistics"> | ||
<% @stats.each do |stat| %> | ||
<div data-ajax-url=<%= stat.url %> class='stats-well' data-on-complete='refreshCharts'> | ||
<h4 class='ca pie-title'><%= stat.title %></h4> | ||
<div class='statistics-pie-placeholder small'><span class='spinner spinner-lg spinner-inline'></span></div> | ||
</div> | ||
<% end %> | ||
</div> | ||
|
||
<div id="statistics"></div> | ||
|
||
<%= mount_react_component('StatisticsChartsList', '#statistics', @metadata.to_json)%> |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -50,7 +50,7 @@ var config = { | |
test: /(\.png|\.gif)$/, | ||
loader: "url-loader?limit=32767" | ||
} | ||
], | ||
] | ||
}, | ||
|
||
plugins: [ | ||
|
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,15 +1,15 @@ | ||
require 'integration_test_helper' | ||
|
||
class StatisticIntegrationTest < ActionDispatch::IntegrationTest | ||
class StatisticIntegrationTest < IntegrationTestWithJavascript | ||
test "statistics page" do | ||
visit statistics_path | ||
assert page.has_selector?('h4', :text => "OS Distribution") | ||
assert page.has_selector?('h4', :text => "Architecture Distribution") | ||
assert page.has_selector?('h4', :text => "Environment Distribution") | ||
assert page.has_selector?('h4', :text => "Number of CPUs") | ||
assert page.has_selector?('h4', :text => "Hardware") | ||
assert page.has_selector?('h4', :text => "Class Distribution") | ||
assert page.has_selector?('h4', :text => "Average memory usage") | ||
assert page.has_selector?('h4', :text => "Average swap usage") | ||
assert page.has_selector?('h3', :text => "OS Distribution") | ||
assert page.has_selector?('h3', :text => "Architecture Distribution") | ||
assert page.has_selector?('h3', :text => "Environment Distribution") | ||
assert page.has_selector?('h3', :text => "Number of CPUs") | ||
assert page.has_selector?('h3', :text => "Hardware") | ||
assert page.has_selector?('h3', :text => "Class Distribution") | ||
assert page.has_selector?('h3', :text => "Average memory usage") | ||
assert page.has_selector?('h3', :text => "Average swap usage") | ||
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
4 changes: 2 additions & 2 deletions
4
...vascripts/__tests__/foreman_tools.test.js → .../assets/javascripts/foreman_tools.test.js
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import ServerActions from './actions/ServerActions'; | ||
|
||
export default { | ||
getStatisticsData(url) { | ||
$.ajaxPrefilter(function (options, originalOptions, jqXHR) { | ||
jqXHR.originalRequestOptions = originalOptions; | ||
}); | ||
$.getJSON(url) | ||
.success( | ||
(rawStatistics, textStatus, jqXHR) => { | ||
ServerActions.receivedStatistics(rawStatistics, textStatus, jqXHR); | ||
}) | ||
.error((jqXHR, textStatus, errorThrown) => { | ||
ServerActions.statisticsRequestError(jqXHR, textStatus, errorThrown); | ||
}); | ||
} | ||
}; |
Oops, something went wrong.