Skip to content

Commit

Permalink
Merge pull request ManageIQ#2291 from PanSpagetka/no-type-chart
Browse files Browse the repository at this point in the history
Chart data returns empty chart for unknown chart types
  • Loading branch information
himdel authored Oct 5, 2017
2 parents 3f8969f + 757ba69 commit 3b5612c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/assets/javascripts/miq_application.js
Original file line number Diff line number Diff line change
Expand Up @@ -1535,8 +1535,19 @@ function rbacGroupLoadTab(id) {
}

function chartData(type, data, data2) {
var empty = {
data: {
columns: [],
},
};

if (type === undefined) {
return;
return empty;
}

var config = _.cloneDeep(ManageIQ.charts.c3config[type]);
if (config === undefined) {
return empty;
}

if (_.isObject(data.miq)) {
Expand Down Expand Up @@ -1607,7 +1618,7 @@ function chartData(type, data, data2) {
};
}

var config = _.cloneDeep(ManageIQ.charts.c3config[type]);

// some PatternFly default configs define contents function, but it breaks formatting
if (_.isObject(config.tooltip)) {
config.tooltip.contents = undefined;
Expand Down

0 comments on commit 3b5612c

Please sign in to comment.