mirror of
https://github.com/valitydev/redash.git
synced 2024-11-08 01:48:54 +00:00
Improving security checks & removing unused log
This commit is contained in:
parent
edd2a1b547
commit
02d27c1a0b
@ -65,7 +65,6 @@ function ChartEditor(clientConfig) {
|
||||
scatter: { name: 'Scatter', icon: 'circle-o' },
|
||||
};
|
||||
|
||||
console.log(clientConfig);
|
||||
if (clientConfig.allowCustomJSVisualizations) {
|
||||
scope.chartTypes.custom = { name: 'Custom', icon: 'code' };
|
||||
}
|
||||
|
@ -426,7 +426,7 @@ const PlotlyChart = () => {
|
||||
};
|
||||
};
|
||||
|
||||
const CustomPlotlyChart = () => {
|
||||
const CustomPlotlyChart = (clientConfig) => {
|
||||
const customChart = {
|
||||
restrict: 'E',
|
||||
template: '<div></div>',
|
||||
@ -436,6 +436,9 @@ const CustomPlotlyChart = () => {
|
||||
height: '=',
|
||||
},
|
||||
link(scope, element) {
|
||||
if (!clientConfig.allowCustomJSVisualizations) {
|
||||
return;
|
||||
}
|
||||
const refresh = () => {
|
||||
const codeCall = eval(`codeCall = function(x, ys, element, Plotly){ ${scope.options.customCode} }`);
|
||||
codeCall(scope.x, scope.ys, element[0].children[0], Plotly);
|
||||
@ -472,5 +475,5 @@ const CustomPlotlyChart = () => {
|
||||
export default function (ngModule) {
|
||||
ngModule.constant('ColorPalette', ColorPalette);
|
||||
ngModule.directive('plotlyChart', PlotlyChart);
|
||||
ngModule.directive('customPlotlyChart', CustomPlotlyChart);
|
||||
ngModule.directive('customPlotlyChart', ['clientConfig', CustomPlotlyChart]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user